Posts

Showing posts from August, 2013

twitter bootstrap - CSS height: 100% not working in html or body -

i'm trying make content in page fill remaining screen size. page has header , content 2 divs, both needing scrollable. i've tried few solutions , best i've come using flexbox , using css calc set height. but height of flexbox still height of content. other answers said set body , html tags height 100%. doesn't work either, , inspect page height not being inherited. suspect may problem, don't know answer be. i'm using bootstrap , using box-sizing fix issues has bootstrap, may issue. my flexbox css: html, body { height: 100%; /* setting height: 100vh doesn't work either height: 100vh; */ margin: 0 } body { background: none repeat scroll 0 0; padding-top: 105px; } /* header 102px high , using calc set remaining height */ .flex-box { display: flex; height: -moz-calc(100% - 102px); height: -webkit-calc(100% - 102px); height: calc(100% - 102px); } .left { flex: 1; order: 1; overflow: auto; backg...

sqlite - Efficient persistent storage for lists in Python -

i have (key, value) map each key have large list of heterogeneous lists (~max 250 items). each list mix of strings , numbers might want iterate over. key string. if wanted store such list thousands of such (key, value) pairs persistently efficient retrieval best options? if use sqlite need create table each key , map lists individual records in database. there better , efficient options if goal fast retrieval of list of lists particular key? here short example. animals map of keys list of lists. sample data looks this: animals = { "lion" : [["siberian", 203, "tanzania", 123.56], ["russian", 321, "timbktu", 23423.2]], "tiger: [["white", 121, "australia", 1211.1], ["indian", 111, "india", 1241.5]] } so want able persist data structure , able index name of animal (always unique) , list of lists particular animal care about. if lists within each animal's info of fixed leng...

model view controller - Laravel 5 stylesheets and scripts not loading for non-base routes -

i having trouble linking stylesheets, scripts, , images non-base route in laravel 5 app. when access example.com/about scripts , stylesheets working correctly if access example.com/about/something scripts , stylesheets link example.com/about/css/style.css rather example.com/css/style.css my code follows: routes.php: route::get('about/{slug?}', ['as' => 'officerprofile', 'uses' => 'pagescontroller@about']); pagescontroller.php: public function about($slug = 'president') { $officers = officer::all(); $currentofficer = officer::where('slug', $slug)->first(); return view("pages.about", ['title' => $this->maketitle('learn us')])->with('officers', $officers)->with('currentofficer', $currentofficer); } layout.blade.php: {!! html::script('https://code.jquery.com/jquery-2.1.4.min.js') !!} {!! html::script('js/skel.min.js') !!} {!! ...

How does the predicate 'repeat' create infinite choice points in prolog? -

i not understand how predicate repeat evaluates true @ times , create infinite choice points. example, when call: :- repeat, reset, do(task,job). thank help! it doesn't work @ once, bit bit. if defined following 2 clauses: repeat. repeat :- repeat.

angularjs - how to prevent error: [ng:btstrpd] App Already Bootstrapped with this Element 'document' -

using angular-meteor v 0.9 trying pre-packaged angularmeteor-smartadmin example app load properly getting error: error: [ng:btstrpd] app bootstrapped element 'document' is there way figure out why , error occurs? here meteor listing: angular:angular-animate 1.4.0 angularjs (official) release. full... angular:angular-cookies 1.4.0 angularjs (official) release. full... angular:angular-resource 1.4.0 angularjs (official) release. full... angular:angular-route 1.4.0 angularjs (official) release. full... angular:angular-sanitize 1.4.0 angularjs (official) release. full... angularui:angular-ui-router 0.2.15 angular-ui-router (official): flexibl... angularui:ui-utils 0.2.4 angular-ui-utils package meteor. autopublish ...

animation - WatchKit "unrecognized selector sent to instance" when trying to fire an NSTimer object in Swift -

in watchkit extensions interfacecontroller.swift file call function, within awakewithcontext function, runs animated sequence of images. i have used nstimer object time delay , fire off second animated sequence. var nstimerobject:nstimer = nstimer.scheduledtimerwithtimeinterval(showcodedelay, target: self, selector: "showcode(countercode1)", userinfo: nil, repeats: false); after first animation runs error preventing second animation being fired function specified in selector : [code_break_watchkit_extension.interfacecontroller showcode(countercode1)]: unrecognized selector sent instance 0x60800014c3f0 i have ios device app , watchkit extension ticked in target membership i found this thread on stack overflow sent me down route. another thread seemed suggest may need around "sharing" unclear. it feels should simple i'm stumped. i new please gentle on me :) sorted it! the problem in syntax setting selector function , passin...

MySQL Group by specific 24 hour interval -

i have mysql table, timestamps values in each row. objective sum values of amount column, , group custom 24 hour interval, starting 05:30:00 every day. input: timestamp amount -------------- ------ 2015-01-19 08:30:12 4 2015-01-19 15:37:40 2 2015-01-20 01:57:38 2 2015-01-20 07:10:07 4 2015-01-20 22:10:38 2 2015-01-21 08:35:55 4 expected: interval sum(amount) ------------- ----------- 2015-01-19 05:30:00 - 2015-01-20 05:30:00 8 2015-01-20 05:30:00 - 2015-01-21 05:30:00 6 2015-01-21 05:30:00 - 2015-01-22 05:30:00 4 i have tried implementing solution(s) presented here groupinginto interval of 5 minutes within time range , here mysql group 24 hour intervals - without success. you can subtracting 5.5 hours , aggregating date: select date_add(date(timestamp - interval (5*60 + 30) minute), interval (5*60 + 30) minute) inte...

amazon web services - Error when using AWS-SDK-GO (NoCredentialProviders: no valid providers in chain) -

i've started using aws-sdk-go package. walking through instructions, folder structure follows: bin/ , pkg/ (as always) src/ app/main.go (code taken docs ) github.com/aws now when run go install , , execute app.exe (using windows here), i'm getting following error: panic: nocredentialproviders: no valid providers in chain any ideas? you need provide aws access key , secret key authenticate , use aws services. see readme here https://github.com/aws/aws-sdk-go#configuring-credentials

sql - Row count based on table + index + statistics histogram -

i have nothing more table , column name. based on that, i'm looking row count grouped given columnname. yes, run ... select columnname, count_big(*) schema.tablename group columnname but means eating valuable resources. (io etc.) wonder, can't not collect need statistics histogram? after all, need narrow index on given column. first of all, need collect name of narrow index. task run query : select st.name, si.name, si.index_id, sc.column_id sys.tables st join sys.indexes si on si.[object_id] = st.[object_id] join sys.index_columns sic on sic.[index_id] = si.[index_id] , sic.[object_id] = si.[object_id] join sys.columns sc on sic.column_id = sc.column_id , sc.[object_id] = sic.[object_id] st.[object_id] = object_id('schemaname.tablename', 'u') , lower(sc.[name]) = 'columnname' this query gives me every index name, composite wide indexes. , that's not quite need. might say, doesn't matter, since both index histograms ...

linker - Linux - process killed when linking section into lowest 2 MB of memory? -

i'm learning ld linker scripts, , noticed if link .text section (or section) @ address lower than 2 mb, process gets instantly killed linux run it. here's example script i'm using: sections { . = 0x200000; /* base text section */ .text : { *(.text) } . = 0x800000; .rodata : { *(.rodata) } .data : { *(.data) } .bss : { *(.bss) } } if set text base 0x1fffff or below, program gets killed linux when run it: $ ./main killed 0x200000 works fine. linux have type of protection or in place lowest 2 mb of virtual memory? as more general question, there rules where sections should linked in virtual memory, or anywhere ok long don't step on reserved ranges? (obviously "real" program i'd use default ld script, i'm asking learning purposes). does linux have type of protection or in place lowest 2 mb of virtual memory? yes; mmap_min_addr sysctl value prevents processes mapping low memory pages protect agains...

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException -

i using android studio 1.2.2. i've integrated maps 4 work sdk, after build failing, using google play services lib in our project (using com.google.android.gms.tagmanager.*). after integrating googlemaps_sdk_m4b_lib, build not getting generated. before inte tried looking including tagmanager piece of google_play_services_lib not available dependency. build fails following: :nfarmers:dexdebug agpbi: {"kind":"simple","text":"unexpected top-level error:","position":{},"original":"unexpected top-level error:"} agpbi: {"kind":"simple","text":"java.lang.outofmemoryerror: gc overhead limit exceeded","position":{},"original":"java.lang.outofmemoryerror: gc overhead limit exceeded"} agpbi: {"kind":"simple","text":"\tat com.android.dx.cf.cst.constantpoolparser.parseutf8(constantpoolparser.java:3...

ios - Variable scoping in Swift with tasks -

i've got of code inside of function in view controller: self.activityindicator.startanimating() let url = nsurl(string: "http://www.google.com") var request = nsmutableurlrequest(url: url!) request.httpmethod = "put" var err: nserror? request.httpbody = nsjsonserialization.datawithjsonobject(["notes": self.textview.text], options: nil, error: &err) request.addvalue("application/json", forhttpheaderfield: "content-type") request.addvalue("application/json", forhttpheaderfield: "accept") var s = nsstring(data: request.httpbody!, encoding: nsutf8stringencoding) let task = nsurlsession.sharedsession().datataskwithrequest(request, completionhandler: { (data, reponse, error) -> void in // ------------------ // doesn't work // ------------------ self.activityindicator.stopanimating() println(nsstring(data: data, encoding: nsutf8stringencoding)) }) task.resume() i want activi...

inheritance - C++ how to destroy an object in the base class with a derived class constructor -

so in program have derived class called hangman , derived class called hangmangraphics. issue i'm having after game want reset variables reason base constructor not restarted or called. when run program go base constructor once towards end of program when: #include "player.h" #include "hangman.h" #include "hangmangraphics.h" using namespace std; int main() { hangmangraphics game2; while(1) { game2.play(); if(game2.play()=='y') { game2=hangmangraphics(); //in part of code want reset base //constructor values how do using //derived construtor continue; } } } cheap hack. moving definition of game2 while loop provide new game2 every pass though loop: int main() { while(1) { hangmangraphics game2; // game2 created here // stuff } // game2 destroyed here } there not enough information prov...

math - java how to determine logical expression minimum values to evauate -

i have expression (an example) (value1<15 , value2>25) or ((value3>0 , vaue4<5) or (value5<6 , value7>8)) the issue value1-7 calls external services, expensive. , need reduce cost, need make minimum number of calls evaluate expression. example if have (value1<15 , value2>25) evaluated true, don't need evaluate right part, don't need make useless calls external services. how determine in java (or may in math) when need stop, , further evaluations not make effect? update i have 5 workers works on 5 different servers. first worker: accept(expression) value1=calculatevalue1() setvaluetoexpression(expression, 0, value1) enough=expression.checkisitenough() if(!enough){ determinenextworker(expression) sendtonextworker() } else return expression.evaluate() the second worker accept(expression) value2=calculatevalue2() setvaluetoexpression(expression, 1, value2) enough=expression.check...

c# - Refactor/Move String to App.Config Key -

both visual studio 2013 , resharper offer many convenient shortcuts refactoring code. 1 commonly use resharper's "move string resource file", moves hard-coded string *.resx file in project. unfortunately, resharper doesn't provide "app.config" option among list of resource files move to. does know how enable or create "move/convert string app.config key" refactoring using either vs or resharper? config management going specific program, , in many cases build system. not programs read strait app/web config. in fact want create class or interface provides configuration options. such,i don't think resharper going provide easy way asking. you can create macro move text consistent config approach have taken.however, going developers role update config value, , update build variables(i.e if have config value connection string, needs updated build system if moving between different builds). if take macro approach, can put in defa...

How can I trap an ENTER keystroke in batch? -

new site , scripting in general. aware can create user inputs this: set input= set /p input=[y/n]: %=% then can ask using "if" see if responses. example: if "%input%"=="y" goto a: and check if isn't said input saying if "%input%" neq "y" goto b: because i'm uneducated, don't know how accomplish this, want able determine if input enter keystroke. have tried accomplish using if "%input%"==[enter] goto a: and if "%input%"==enter and every method think of determine if keystroke [enter]. stupid, there way this? thanks. there @ least 2 ways that: check value or check operation set /p retrieves typed input storing inside variable, when there no input, enter press, there no storage operation on variable keeps previous value. the usual way test value clear variable contents, use set /p , test if variable defined, is, has content set "var=" set /p "var=[y/n]?...

ruby on rails - "NameError: uninitialized constant" on existing ID -

i error when running rake db:seed in app: nameerror: uninitialized constant admissionepisode::admindistrictid . i have no idea why - admission_episode.admin_district_id exists in database , have belongs_to :admin_district in admissionepisode model. have idea what's going on? here admindistrict seed: districts.each |code, name| admindistrict.create({ code: code, name: name }) end and admissionepisode seed (with nameerror occuring on admissionepisode.create line: admissions.each |code, total, male, female| district = admindistrict.find_by_code(code) admissionepisode.create({ admin_district_id: district.id, total: total, male: male, female: female }) end districts , admissions referenced above both lists of data, of are, far can tell, formatted correctly. admin_district table populated correctly. alternatively can try this: admissions.each |code, total, male, female| district = admindistrict.find_by_...

MongoDB with millions of rows -

i've got mongodb 52m documents in it. can't queries ever finish. there no proper indexes, think might why. however, when try build index seemed failed well. left 2 hours , database still locked when came back. had restart service. any ideas or things for? thought mongo should able query on millions of rows. sample document { "_id" : objectid("54dfbcfe8b0de0cd148b4567"), "status" : "success", "articles" : [ { "sequenceid" : "423671544757", "id" : "20450468768", "language" : "danish", "title" : "se det spøjse billede: bendtner og co. tvunget midtergangen", "content" : "de er millionærer med dyre biler og sikkert også råd til en flybillet ved nødudgangen, men da wolfsburg-spillerne skulle transporteres til lørdagens kamp mod leverkusen skete det m...

Coloring specific areas in Venn Diagrams in R -

Image
i'm using 'venndiagram' package in r. know how make venn diagrams, there way color specific areas of diagram only? example, if had categories a1, a2, , a3, want color area within a1 doesn't overlap other categories. the venndiagram package doesn't give full control on colors of 7 plotting areas within 3-category venn diagram, allow control color of each individual circle. in case, can desired effect setting color of first region blue , remaining regions white , removing transparency: library(venndiagram) draw.triple.venn( area1 = 65, area2 = 75, area3 = 85, n12 = 35, n23 = 15, n13 = 25, n123 = 5, category = c("first", "second", "third"), fill = c("blue", "white", "white"), alpha=c(1, 1, 1), lty=c(1, 1, 1), cex = 2, cat.cex = 2, cat.col = c("black", "black", "black") )

xml serialization - Running sgen.exe on a .NET 4.5 assembly? -

i used run sgen.exe c:\program files\microsoft sdks\windows\v7.1\bin\sgen.exe , targeted .net 4 assembly , built fine. after upgrading project .net 4.5, fails error: microsoft (r) xml serialization support utility [microsoft (r) .net framework, version 2.0.50727.3038] copyright (c) microsoft corporation. rights reserved. sgen.exe : error: unable generate temporary class (result=1). error cs0012: type 'system.object' defined in assembly not referenced. must add reference assembly 'system.runtime, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'. error cs0012: type 'system.componentmodel.inotifypropertychanged' defined in assembly not referenced. must add reference assembly 'system.objectmodel, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'. i figured need updated sgen.exe new framework, tried c:\program files (x86)\microsoft sdks\windows\v8.1a\bin\netfx 4.5.1 tools , c:\program files (x86)\microsoft sdks\wi...

android - FacebookCallback.onCancel is getting called when trying to login using facebook sdk -

i have android app , trying use facebook's sdk (version 4.1.0) token , login. here code: public class loginactivity extends activity { private callbackmanager callbackmanager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_login); facebooksdk.sdkinitialize(getapplicationcontext()); callbackmanager = callbackmanager.factory.create(); loginmanager.getinstance().registercallback(callbackmanager, new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { accesstoken accesstoken = loginresult.getaccesstoken(); log.v(tag, "facebook login successful"); string authtoken = accesstoken.gettoken(); // user authtoken here: } @override public void oncancel() { ...

Matching groups in a Python regex lookahead -

i have ~raw download of text data wordpress blog, structured follows: post_id_1 title_1 date_1 text first post .. post_id_2 title_2 date_2 text second post .. i wrote regex capture post_id , title , , date . goal create python dictionary structured as: posts = {'date_1': {'post_id': post_id_1, 'title': title_1, 'text': 'this text first post ..' } } the regex capture headers ( post_id , title , date ) follows: header_regex_raw = r"""(\d+)\s(.*(?=january|february|march|april|may|june|july|august|september|october|november|december))(january|february|march|april|may|june|july|august|september|october|november|december)(\s\d+\,\s\d{4}\b)""" my thought re.findall(header_regex_raw + (.*(?={})).format(header_regex_raw) , unfortunately doesn't work planned. how capture multiple groups in lookahead? what's better way create above ...

html - PHP mail function doesn't complete sending of e-mail -

<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from: yoursite.com'; $to = 'contact@yoursite.com'; $subject = 'customer inquiry'; $body = "from: $name\n e-mail: $email\n message:\n $message"; if ($_post['submit']) { if (mail ($to, $subject, $body, $from)) { echo '<p>your message has been sent!</p>'; } else { echo '<p>something went wrong, go , try again!</p>'; } } ?> i've tried creating simple mail form. form on index.html page, submits separate "thank submission" page, thankyou.php , above php code embedded. code submits perfectly, never sends email. please help. there variety of reasons script appears not sending emails. it's difficult diagnose these things unless there obvious syntax error. without 1 need...

dev c++ - Dev c++ 4.9.9.2 is installed on my windows 8.1. Warning: "Source file not compiled" -

this hello world program. compiles, when run says : "source file not compiled" i have included header files stdio.h , conio.h . solution.? installed code::blocks well, got similar error in ide well. int main() { printf("hello world"); return 0; } as compiles, generating exe file, not showing in command prompt, somehow getting deleted(may mcafee doing it) specify path path variable...u can path variable control panel ...if ur file compiled ...means there no error ..ok ...then if u run ur program ur cpp file path should set path variable same java..

How to extern SDL_Surface array in C? -

i want extern sdl_surface array 1 function ( load_level ) ( initialize_balls ). have sdl_surface ( brickim ) dynamic pointer-struct defined inside of load_level function via malloc function , declared sdl_surface **brickim well. got segmentation fault when try access brickim[0]->w in initialize_balls function not in load_level function. piece of code hope me fix. file1.c #include <stdio.h> #include <sdl.h> sdl_surface **brickim; /*as global*/ sdl_surface* load_map(char *map_name , int tran ); void load_level(int stage){ int n; sdl_surface **brickim=( sdl_surface **)malloc(sizeof(sdl_surface)*input.n); (n=0;n < input.n;n++){ **brickim[n]=load_map("brick1.bmp",1); /*load sdl_surfaces*/** printf("%d\n",brickim[n]->w); /***access succesfully (returns 100 n times)***/ } ... }} sdl_surface* load_map(char *map_name , int tran ){ sdl_surface *temp,*map; uint32 colorkey; printf("loading bit map %...

wpf - Add value ticks into my Circular Slider -

Image
this circular slider : <slider name="knobslider" minimum="0" maximum="50" value="1" height="99" width="75" horizontalalignment="center" verticalalignment="center" grid.column="1"> <slider.template> <controltemplate> <viewbox> <canvas width="300" height="300" margin="5"> <ellipse fill="transparent" width="300" height="300" canvas.left="0" canvas.top="0" stroke="#ff878889" strokethickness="10" mouseleftbuttonup="ellipse_mouseleftbuttonup" mousemove="ellipse_mousemove"/> <ellipse fill="transparent" width="60" height="60" canvas.left="...

Get values of given coordinates in Matlab -

if have given coordinates [1 2; 4 5] , s = [ 0.0 0.4 0.5 0.6 0.9 0.4 0.0 0.3 0.4 0.5 0.5 0.3 0.0 0.5 0.8 0.6 0.4 0.5 0.0 0.6 0.9 0.5 0.8 0.6 0.0 ] i want following results: a should contain values of coordinates , inverse coordinates. i.e in example, a contains values of (1,2) , (2,1) , (4,5) , (5,4) . is: a=[0.4, 0.4, 0.6, 0.6] . b contains remaining values, b=[0, 0.5, 0.6, 0.9, 0, 0.3, 0.4, 0.5, 0.5, 0.3, 0, 0.5, 0.8, 0.4, 0.5, 0, 0.9, 0.5, 0.8, 0.6, 0] . so far have following code: linindices = sub2ind(size(s), coordinates(:, 1), coordinates(:, 2))'; = s(linindices) b = s(setdiff(1:numel(s), linindices)) but calculates a=[0.4,0.6] . how can inverse coordinates too? actually, there. thing getting inverse coordinates- can command fliplr . here can see how can done, whole code , results. critic line av : c=[1 2; 4 5]; s=[0 0.4 0.5 0.6 0.9 0.4 ...

Can't get a simple ruby Example working for pubnub -

require 'pubnub' pubnub = pubnub.new( :publish_key => 'demo', :subscribe_key => 'demo' ) pubnub.publish( :channel => 'the angular channel', :message => 'hello pubnub, love ruby sdk!', ) { |data| puts data.response } i followed example sdk documentation page. not sure went wrong. try using angular channel demo, can subscribe, using ruby script can't seem make work. the log printed pubnub log. created new pubnub::client instance d, [2015-06-14t16:54:05.940851 #33052] debug -- pubnub: event#initialize | initialized pubnub::publish d, [2015-06-14t16:54:05.940972 #33052] debug -- pubnub: pubnub::publish#uri http://pubsub.pubnub.com/publish/demo/demo/0/the%20angular%20channel/0/%22hello%20pubnub%2c%20love%20the%20ruby%20sdk%21%22?pnsdk=pubnub-ruby/3.7.1&uuid=065e1ab5-e87c-4fb2-a07d-b78bd8243610 i, [2015-06-14t16:54:05.941349 #33052] info -- pubnub: bytesize: 189 d, [2015-06-14t16:54:05.941...

ascii - Traceback from a Python Script: invalid literal -

in short, python script supposed load , calculate ascii type files. with pre-processed files, works without errors, while mine throws error. in case, looks though file different should (input-wise). traceback (most recent call last): file "d:\ter\scripts python\puissantpdi.py", line 124, in <module> in range (42, (42+(int(type_ncols)*int(type_nrows)))): valueerror: invalid literal int() base 10: 'nrows' *it not run in qgis/arcgis software, cmd or idle. edit just small part of code: import sys print("\npdi processing...\n") ''' option file ''' open("options_pdi.txt") f: content = f.readlines() content = [x.strip('\n') x in content] option= [] elem in content: option.extend(elem.strip().split(" ")) f.close() b_type_file=option[1] b_totalstage_file=option[3] b_function_file=option[5] b_state_file=option[7] b_age_file=option[9] b_material_file=option[11] b_occstage_file=...

bit manipulation - php synatax $b = (6 << 1); clarification -

this question has answer here: php operator << 5 answers i not understand following code snippets. $a = (5 << 0); $b = (6 << 1); echo $a|$b; from php.net knew << operator use shift left not clear how works , uses of | operator. explanation highly appreciated. thank you 5 << 0 produces 5, since no shift done. 6 << 1 shift bits in 6 (110b) 1 left, produce 12 (1100b). multiplying 2 essentially. the | operator bitwise or, operates on bits of 5 (0101b) , 12 (1100b) producing 13 (1101b)

php - MySQL Foreign Key Constraint Fail -

Image
so, clarify things: know why failing. question is: how work around that? setup: referencing table users , referencing column id, referenced table user_data, , referenced column id. want store email, username, salt , password in 1 table, user data login tokens , such in another. thought right way it. apparently missing something. and oh i'm using php pdo. function registeruser($email, $username, $password) { global $db; try { $prep = $db->prepare("insert users (email, username, salt, password) values(':email', ':username', ':salt', ':password')"); $salt = "abcd"; $prep->bindparam(':email', $email); $prep->bindparam(':username', $username); $prep->bindparam(':salt', $salt); $prep->bindparam(':password', $password); $prep->execute(); echo "success"; } catch (pdoexception $e) { die...

mysql - SQL query using MAX and SUBSTRING_INDEX in php -

how execute complex query in drupal i tried : $sql = "select max(substring_index(`table_field1`, '/', -1)) mm `tableitems` table_field2=' " .$selvalue."'"; $query = db_query($sql); echo $query; it returns array echo output. can please guide me through this. wanted maximum value column in database. , iam getting correct value when tried in mysql directly. also tried: $sql = "select max(substring_index(`table_field1`, '/', -1)) mm `tableitems` fieldprefix=' " .$selvalue."'"; $query = db_query($sql); foreach($query $r) echo $r->mm; but still gives incorrect you have use below fetch field value in drupal $sql = "select max(substring_index(`table_field1`, '/', -1)) mm `tableitems` table_field2=' " .$selvalue."'"; $query = db_query($sql)->fetchfield(); print_r($query);

c++ - Playback custom stream with QMediaPlayer -

i searched thoroughly find answer problem no other post has been helpful far. developing application in qt need playback video stream received through custom protocol. found myself trying in every possible way feed these packets in qmediaplayer no success. idea write incoming packets in qbuffer , read them qmediaplayer. follows trial: /// videoplayer.h class videoplayer : public qwidget { public slots: void play(); void handlepacket(qbytearray); [...] private: qmediaplayer mediaplayer; qbuffer buffer; }; /// videoplayer.cpp videoplayer::videoplayer(qwidget *parent) : qwidget(parent) , mediaplayer(0, (qmediaplayer::streamplayback)) { buffer.open(qbuffer::readwrite); } void videoplayer::handlepacket(qbytearray packet) { buffer.buffer().append(packet); } void videoplayer::play() { mediaplayer.setmedia(qmediacontent(), &buffer); mediaplayer.play(); } with above qmediaplayer plays data in buffer @ moment of calling mediaplayer.setmedi...

internet explorer - IE11 crashes when printing without Print dialog -

ie11 crashes during unprompted printing (without print dialog) when running in ie10 compatibility mode. this sample html code causes ie11 crash: <html lang="en"> <head> <meta http-equiv="x-ua-compatible" content="ie=10" /> <meta charset="utf-8"></meta> <title>microsoft internet explorer print test</title> <script language="vbscript"> sub print() olecmdid_print = 6 olecmdexecopt_dontpromptuser = 2 olecmdexecopt_promptuser = 1 call wb.execwb(olecmdid_print, olecmdexecopt_dontpromptuser,1) end sub document.write "<object id='wb' width='0' height='0' classid='clsid:8856f961-340a-11d0-a96b-00c04fd705a2'></object>" </script> </head> <body> print test. ...

asp.net - Reference web projects from other web projects in solution -

i working in visual studio 2013/2015. have 3 web projects in solution. want these web projects able make calls each other, means need know @ port hosted on during development. i hosting in iis express, default means auto-assigned ports. because if port unavailable, port used. since port determined @ runtime cannot have configuration file in each projects says other projects hosted. other manually assigning ports, possible somehow reference these other web projects 1 web project , make calls used port substituted?

java - Win8: DatagramSocket.send to multicast addr silently failes -

i trying write simple ssdp discovery routine upnp-enabled tv. here stripped-down version of code: private void discover() { string header = "m-search * http/1.1"; string[][] fields = new string[][] { {"st", "ssdp:all"}, {"man", "\"ssdp:discover\""}, {"host", "239.255.255.250:1900"}, {"mx", "10"}}; string p=this.make_packet(header, fields); multicastsocket s = null; arraylist<string> devices=new arraylist<string>(); string[] ret; string[] loc; try { inetaddress addr=inetaddress.getbyname("239.255.255.250"); s = new multicastsocket(1900); s.setreuseaddress(true); s.setsotimeout(3000); s.joingroup(addr); datagrampacket pack=new datagrampacket(p.getbytes("utf-8"), p.length(), addr, 1900); s.send(pack); byte[] buffer=new byte[1024]; datagrampacket packrec=new datagrampacket(buffer,...