Posts

Showing posts from July, 2012

Android-KSOAP Java.IO.IOException error -

Image
please refer attached screenshots. i'm new in android , trying hands on accessing web-service android. ws in .net. tried code accessing ws using ksoap (the same code available in website @ many qa). i'm getting error @ final step of calling ws, i.e. androidhttptransport.call(soap_action, envelope); step. please me understand might have caused this. let me know if need more details. try line, response = (soapobject) envelope.bodyin;

php - How to get only email value from HTML files using DOM ? Only Email value not like link -

http://www.frosher.com/schools/acme-academy-burdwan/contact this page link saved in folder , address contact information of school. seen email , web link before google map block. want email value. just save html page in scrapping folder. here's code: <?php include('simple_html_dom.php');//required $i = 0; $dir = 'scrapping/';//folder name in html file if ($handle = opendir($dir)) { while (($file = readdir($handle)) !== false){ if (!in_array($file, array('.', '..')) && !is_dir($dir.$file)) $i++; } } $filenames = array(); foreach(glob('scrapping/*.*') $filename){ $filenames[] = $filename;//get files name in folder } $i = 1; foreach($filenames $val){ $doc = new domdocument(); $doc = file_get_html($val); $ret = $doc->find('div[class=span5]'); foreach($doc->find('.span7') $element){ $contact = $element->plaintext; if (preg_match...

ios - Updating core data performance -

i'm creating app uses core data store information web server. when there's internet connection, app check if there changes in entries , update them. now, i'm wondering best way go it. each entry in database has last updated timestamp. of these 2 more efficient: go through entries , check timestamp see entry needs updated. delete whole entity , re-download again. sorry if seems obvious question , thanks! i'd option 1 efficient, there case downloading (especially in large database large amounts of data) more efficient downloading parts need.

iphone - Core Data Migration: Do I Need a new Mapping Model for each new Model Version I Add? -

i've done custom core data migration several versions when doing structure changes in app. (so created new model version, , mapping model custom policy class). now, want more changes. i've created model version. now, i'm not sure whether need create mapping model change? if do, core data figure out appropriate 1 use based on users version? will need create custom policy class, or can somehow add new logic first one? lastly, need add logic migrating original database straight current database? or core data figure out me, , migrate median version first, , current version when user loads app version original data structure? thanks! i guess answer whether or not need create mapping model is... depends. see apple's docs here (specifically comments on lightweight migration): https://developer.apple.com/library/ios/documentation/cocoa/conceptual/coredataversioning/articles/vmmigrationprocess.html#//apple_ref/doc/uid/tp40004399-ch6-sw1

in SciTE, how to make the whole block of code have less margin in python -

my english programming, not good, apologize. i'm using scite run python code. added while statement outside of block of code. then, in order indent next block of code, selected , pressed tab . after more coding, want delete while statement , dedent (unindent) block of code that's in while-loop. how can dedent block of code? hope people can understand poor description, man. thanks! highlight block of code , press shift + tab

Drupal prevent unauthorized access -

how prevent unauthorized url access in drupal? i tried 'access arguments' => array('access administration pages') didn't work its given in drupal documentation on how use access arguments .this example per drupal documentation,just make more clear on how use this. $items['test/mypage'] = array( 'title' => 'mypage', 'description' => 'welcome', 'page callback' => 'mypage_info', 'access arguments' => array('anyone can access this'), ); //define user permissions. function hook_perm() { return array('anyone can access this'); } now go permissions page [administer --> user management -->permissions) , there can see list of strings used access arguments .you find access argument named 'anyone can access this' in corresponding module .give necessary permission required user roles . you more information on followi...

process - How do I create a pipe between two processes in Guile? -

i want create 2 process in guile , send output (stdout) 1 of them input (stdin) other. using following example, how can done? echo "foo bar" | wc output: 1 2 8 yes, can using open-output-pipe : (let ((p (open-output-pipe "wc"))) (display "the quick brown fox jumps on lazy dog.\n" p) (close-pipe p)) there is, of course, open-input-pipe analogue. read pipes section of guile manual more details.

android - Processing user request in a separate activity -

i want have loading activity processes log in , register requests ,i tried start loading activity log in , register activities ,and start processing in onstart() function,but if screen goes off , on onstart() calls again , process repeats ,i don't know oncreate() method place or not,and if there approach. start activity result, startactivityforresult() like this, can have started activity stuff, , return value. http://developer.android.com/training/basics/intents/result.html

php - find duplicate value in multi-dimensional array -

from function given multidimensional array this: array( [0] => array( [0] => 7, [1] => 18 ), [1] => array( [0] => 12, [1] => 7 ), [2] => array( [0] => 12, [1] => 7, [2] => 13 ) ) i need find duplicate values in 3 arrays within main array. example, if value 7 repeats in 3 arrays, return 7. <?php $array = array(array(7,18), array(12,7), array(12, 7, 13)); $result = array(); $first = $array[0]; for($i=1; $i<count($array); $i++){ $result = array_intersect ($first, $array[$i]); $first = $result; } print_r($result);//7 ?>

objective c - Import AppDelegate into models? -

i'm trying unify of functions of specific class within model file. instance, have function fetchcontactwithname:(nsstring *)name in model 'contact.h/contact.m', viewcontroller subsequently call. in case, bad idea import appdelegate.h file model file need access managedobjectcontext? #import "appdelegate.h" @implementation contact ... + (contact *) fetchcontactwithname:(nsstring *) name { appdelegate *delegate = (appdelegate*)[[uiapplication sharedapplication] delegate]; nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"contact" inmanagedobjectcontext:delegate.managedobjectcontext]; [fetchrequest setentity:entity]; nspredicate *predicate = [nspredicate predicatewithformat:@"name == %@", name]; [fetchrequest setpredicate:predicate]; nserror *error = nil; nsarray *fetchedobjects = [delegate.managedobjectcontext executefetchrequest:fetchrequ...

javascript - jQuery mobile stop running the script in the current page used after moving to the next page -

in jquery mobile application, iam having scripts being loaded @ index page(say index.php) , not using ( rel="external" or data-ajax="false" )for linking pages keep appication loaded ajax. in application, want run script 1 page(say home.php) , after leaving page, want kill script being used.in home.php, using $(document).on('pageinit', function(){ }) loading script. but found script iam using in home.php running throughout application after leaving page. how stop script running used through page-init function without using ( rel="external" or data-ajax="false" )? here code using in home.php, <script type="text/javascript"> $(document).on('pageinit', function(){ var auto_refresh = setinterval( function () { /* */ $("#color-bar").load("controller/file.txt"); }, 3000); ...

json - How the google charts query language works? -

i have implemented own datasource in go, returns json string. data source working fine , returning correct json format expected chart (which table object make tests easier). now, i'd able use query language features chart , not figure out how query language works. let's take table below example: name | age | phone ------------------------------- john | 23 | 12341234 chris | 47 | 54223452 sam | 36 | 69694356 when called, datasource return json representation of entire table above. in theory, should able javascript query.setquery('select name, age'); so, result ignore column "phone". now, question is: is setquery() method applied json response only, or datasource should able handle query on request , return correct data (only name , age columns). i'm not sure if query language act on json response or if it's interface tell server , server should able prepare correct data. i'm asking because said, json response w...

objective c - How to return BOOL from animateWithDuration? -

i try create method , return bool type animatewithduration. object seems not detected on completion block. can explain me, why can happen? + (bool)showanimationfirstcontent:(uiview *)view { bool status = no; cgrect show = [swfirstcontent rectfirstcontentshow]; [uiview animatewithduration:duration delay:delay options:uiviewanimationoptionbeginfromcurrentstate animations:^{ view.frame = show; } completion:^( bool finished ) { status = yes; }]; return status; } thanks advance. you setting status value inside block executed asynchronously. meaning, return statement not guaranteed executed after block executed. know when animation finished need declare method in different way. + (void)showanimationfirstcontent:(uiview *)view completion:(void (^)(void))callbackblock{ cgrect show = [swfirstcontent rectfirstcontentsh...

perl - Using goto LABEL for comparing two files -

i unable desired output. please correct errors. file1 a b c d e f file2 a d c desired output (if found print '1' @ relative position in larger file , if not print '0') 1 0 1 1 0 0 code #!/usr/bin/perl -w open(fh,$file); @q=<fh>; open(fh1,$file2); @d=<fh1>; open(out,">out.txt"); foreach $i(@q) { foreach $j(@d) { if ($i eq $j) { $id=1 ; goto label; } elsif ($i ne $j) { $id=1; goto label; } } } print out "1\t"; label: print out "0\t"; } close fh; close fh1; close out; note: actual files much larger , contain uneven number of elements . you looking for for $q (@q) { $found = 0; $d (@d) { if ($q eq $d) { $found = 1; goto label; } } label: print "$found\n"; } the above better written follows: for $q (@q) { $found = ...

CORS file upload for angularjs with IE8 support -

i seeking easy , light weight way upload small file rest api using cors. using following plugin: angular-file-upload the problem uses swf fallback deprecated browsers, don't support formdata object(such ie 8 , ie 9). i have opened issue on github on matter, no luck far. which means cannot upload file using cors on browsers, cannot allow (many users still use ie). angular-file-upload has solution old broswers(such ie8,9), just put code before "angular-file-upload-shim.js" <script> //optional need loaded before angular-file-upload-shim(.min).js fileapi = { jspath: '/js/fileapi.min.js/folder/', staticpath: '/flash/fileapi.flash.swf/folder/' } </script> you can visit this page on github more detail .

php - Changing Multiple values in MySQL with a single Query -

i want change different column values of table in 1 query, possible? i tried (just guess): <?php $q="update tab set name='samit' id='1' && set name='anju' id='4'"; $run=mysql_query($q); if($run){ echo 'updated'; } else{ echo 'update failed'; } ?> it's not working. can using loop, loop increase operation time. you can use join update tab t1 join tab t2 on t1.id = 1 , t2.id = 4 set t1.name = 'samit', t2.name = 'anju' here sqlfiddle demo

javascript - WebGL fragment shader opacity -

alright, first off, i'm pretty new @ glsl shaders, , i'm trying wrap head around following shader #ifdef gl_es //precision mediump float; precision highp float; #endif uniform vec2 utimes; varying vec2 texcoord; varying vec2 screencoord; void main(void) { vec3 col; float c; vec2 tmpv = texcoord * vec2(0.8, 1.0) - vec2(0.95, 1.0); c = exp(-pow(length(tmpv) * 1.8, 2.0)); col = mix(vec3(0.02, 0.0, 0.03), vec3(0.96, 0.98, 1.0) * 1.5, c); gl_fragcolor = vec4(col * 0.5, 0); } so far, know gives me radial gradient (perhaps). i'd know how make transparent. i'm thinking need vec4 that, right? you need turn on blending. see http://www.senchalabs.org/philogl/philogl/examples/lessons/8/ , http://learningwebgl.com/blog/?p=859 ‎. without blending, depth , color buffers updated without taking care in buffer, overwrite data. blending on, , depending on type of blending function usin...

xpages - styleClass property always gets overwritten when adding style in theme -

i using theme xpage application set global look&feel settings configuration viewroot looks this: <control dojotheme="true"> <name>viewroot</name> <property> <name>pageicon</name> <value>/favicon.ico</value> </property> <property> <name>style</name> <value>#{javascript: var response = facescontext.getexternalcontext().getresponse(); response.setheader("x-ua-compatible", "ie=8"); }</value> </property> <property mode="concat"> <name>styleclass</name> <value>claro</value> </property> </control> although use mode="concat", thought adds (like array.concat ) properties viewroot overwrites it, <body> looks this...

long integer - Mixnet: Working with thousands bit data -

i implementing mixnet , need operate on thousands of bits of messages. used c# , used biginteger. taking more time expected. there way can use integer type holding such long messages? now im using this biginteger p = biginteger.parse("1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000543"); but need this int p = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

python dll return value is wrong -

i have made dll contains code: #pragma once extern double __declspec(dllexport) add(double a, double b); extern double __declspec(dllexport) dif(double a, double b); #include "testdll.h" double add(double a, double b) { return + b; } double dif(double a, double b) { return - b; } the python code calls add function: = ctypes.c_double(1); b = ctypes.c_double(2); mydll = ctypes.cdll('testdll.dll'); mydll.restype = ctypes.c_double; ret = mydll.addnumbers(a, b); the problem add function doesnt return a+b screwd value: 2619340 please help the return type double , should set restype so: hlldll.add.restype = ctypes.c_double hlldll.add.argtypes = [ctypes.c_double, ctypes.c_double]

iphone - Performance decreases after a while especially when device is resting -

i have iphone game using unity game engine , self written library access apple's core motion framework. performance excellent on iphone 5 , used pretty on iphone 4 in past. running app today on iphone 4 (ios 6.1.3) continuous drop in frame rate occurs after while (noticeable after 5-10 minutes). after 20-30 minutes game unplayable , appears run in slow motion. the strange thing is: effect occurs when device lying still on table. when move device, frame rate rises noticeably decreases again when there no movement . found out game code written in c# (unity game engine) not blame obj-c part handling motion control core motion. i think problem began time when updated ios 5.1.x ios 6.1.3 not sure. it's hard exact time in revision history when problem has started, because did longer tests on fancy iphone 5 , quick tests on iphone 4 (ok, lesson learned ;-). i use 'old style' pull approach fetch cmdevicemotion instances i.e. startdevicemotionupdates without block ...

How to unchecked all choices as default of select one radio button in JSF? -

i have following jsf radio button: <h:selectoneradio id="journeydir" value="#{refparam.journeydir}"> <f:selectitems value="#{newmessage.journeydirectionselectitemlist}" /> </h:selectoneradio> the values of radio button, can selected user defined in java method: public list<selectitem> getjourneydirectionselectitemlist() { final list<selectitem> journeydirectionselectitemlist = new arraylist<selectitem>(); journeydirectionselectitemlist.add(new selectitem(journey.bidirection, yes)); journeydirectionselectitemlist.add(new selectitem(journey.oneway, no)); return journeydirectionselectitemlist; } now have problem, first value of radio button, declared in java method above, selected automatically load jsf webpage. have requirement, no values must selected automatically system. how can solve problem? ideas? use jsf 1.2. just make sure journeydir variable set null ...

android - ON_AFTER_RELEASE-flag doesn't work consistently -

after i'm releasing wakelock, want screen stay on duration of user's display timeout system setting, believe on_after_release-flag does. works fine on device (gnex, 4.3), lot of users (mainly on 4.3) reporting screen switches off after releasing wakelock. //to acquire wl: wl = pm.newwakelock(powermanager.screen_bright_wake_lock | powermanager.on_after_release, tag); @override public void onpause() { super.onpause(); if (wl != null) { if (wl.isheld()) { wl.release(); } } am doing wrong? you should try use powermanager.flag_keep_screen_on instead of screen_bright_wake_lock flag. there can issues because of different wakelock implementations on different devices. when have similar problem switching flag helped me.

android - ListView for buttons using BaseAdapters -

i trying perform actions on click of button listview . onclicklistener dosent called on click of button. here mainactivity.java public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final listview mylistview = (listview) findviewbyid(r.id.listview); final button mybutton = (button) findviewbyid(r.id.button); //create adapter final rownumadapter rownumadapter = new rownumadapter(this); mylistview.setadapter(rownumadapter); mylistview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { if(position==0) { toast.maketext(mainactivity.this,"you clicked"+ rownumadapter.getitem(posit...

How to prevent TOR Vidalia from changing my IP? -

i want manually change visible ip in vidalia, not automatically every x minutes. how in windows or linux? basically not possible directly in vidalia. tor designed in way public facing ip address change approximately @ every ten minutes. there »hacks« might work. vidalia allows choose »new identity«. when click on button you'll new public facing ip address (exit relay in tor terms). can change ip address within ten minute period. however if want keep ip longer amount of time specific site (say stackoverflow.com), have fiddle around torrc . can insert following line: trackhostexits stackoverflow.com now tor try use same exit ip address 30 minute period. option trackhostexitsexpire allows change time frame. default set 1800 (seconds). another useful option exitnodes . when enter torrc fingerprint or name of 1 single tor exit, tor use exit. visible ip address not change long don't change value , restart tor. should avoid using 1 or few exits because might ...

c++ - Calling a function using a string containing the function's name -

i have class defined class modify_field { public: std::string modify(std::string str) { return str; } }; is there way store function name inside string in main function , call it. tried it's not working. int main() { modify_field mf; std::string str,str1,str2; str = fetch_function_name(); //fetch_function_name() returns string modify str2 = "check"; cout << str; //prints modify str1 = str + "(" +str2 + ")"; mf.str1(); } i know wrong. want know if there way call function name using variable. this not directly possible in c++. c++ compiled language, names of functions , variables not present in executable file - there no way code associate string name of function. you can similar effect using function pointers, in case trying use member function well, complicates matters little bit. i make little example, wanted answer in before spend 10 minutes write code. edit: here's code...

r - apply calculation on multiple columns of each element in a list -

i have list consist of 23 elements 69 rows , 13 columns each. , need apply calculation on multiple columns each element of list. as simple example, list looks this: >list >$`1` > b c >1 2.1 1.4 3.4 >2 4.4 2.6 5.5 >3 2.6 0.4 3.0 ... >$`2` > b c >70 5.1 4.9 5.1 >71 4.4 7.6 8.5 >72 2.8 3.5 6.8 ... what wish z = (a-b) / c each element ($ 1 ,$ 2 ..., $ 23 ) i tried following code: for( in 1:23) { z = (list[[i]]$a - list[[i]]$b) / list[[i]]$c } which gave me 49 values, rather 1566 values. anyone have idea wrong code , able correct it? thank much! you can function lapply() . here example assuming in data frame columns have same name. ll<-list(data.frame(a=1:3,b=4:6,c=7:9), data.frame(a=1:3,b=6:4,c=7:9), data.frame(a=1:3,b=4:6,c=9:7)) lapply(ll, with, (a-b)/c)

highcharts - Shared tooltip with multiple stacks -

i've implemented stacked column chart 4 series divided on 2 stacks. want create tooltip each stack shows info series belong stack. when use shared: true option tooltip formatter function, series in $.each(this.points, function(i, point) {}) loop. how can create tooltip each stack, while still having access series in stack? any advice appreciated. you can use formatter , loop data y value. http://jsfiddle.net/3utat/10/ tooltip: { formatter: function () { var indexs = this.series.index, indexp = this.point.x, series = this.series.chart.series, out = 'y1:' + this.y + '<br/>'; switch (indexs) { case 0: out += 'y2: ' + series[1].data[indexp].y; break; case 1: out += 'y2: ' +series[0].data[indexp].y; break; case 2: ...

swing - Prevent vertical spacing when resizing a Java GUI -

i have simple gui , trying create buttons , controls left side of window. right side has text area display content. left side contains buttons , controls user manipulate. have used collection of layout managers (and seem considerably picky) make have now. i've looked on oracle's documentation on boxlayout left controls' container using, , don't see way prevent buttons spacing apart when window resized. i'd them smashed @ top , stay there without spacing out. boxlayout's 'glue' feature doesn't think does, should called rubber band. my question is, how keep content on left separating wider , wider screen gets resized? my gui: public class testcode extends jframe{ jtextarea textarea = new jtextarea (); jcombobox <string> typecombobox; jtextfield searchfield; jtextfield filefield; public testcode() { system.out.println ("in constructor"); settitle ("gui test"); setsize (600, 300); setdefaultcloseop...

Error while running simple app in Titanium Studio -

am new titanium app development , using fedora operating system , titanium studio titanium sdk 3.1.2.ga develop app. when create , run sample program, showing following issue. [error] exception occured while building android project: [error] traceback (most recent call last): [error] file "/root/.titanium/mobilesdk/linux/3.1.2.ga/android/builder.py", line 2596, in <module> [error] builder.build_and_run(false, avd_id, debugger_host=debugger_host, profiler_host=profiler_host) [error] file "/root/.titanium/mobilesdk/linux/3.1.2.ga/android/builder.py", line 2400, in build_and_run [error] launched, launch_failed = self.package_and_deploy() [error] file "/root/.titanium/mobilesdk/linux/3.1.2.ga/android/builder.py", line 1881, in package_and_deploy [error] self.keystore_alias], protect_arg_positions=(6,)) [error] file "/root/.titanium/mobilesdk/linux/3.1.2.ga/android/run.py", line 45, in run [error] process = subproce...

html - Position Fixed width 100% -

Image
i have position:fixed left column @ 250px wide 100% height , i'm trying place fixed, fluid horizontal bar @ top right of left column, example: but i'm getting here: this have done: jsfiddle .page-wrapper, html, body { width:100%; height:100%; margin:0; padding:0; } .left-column { position:fixed; top:0; left:0; z-index:1000; width:250px; height:100%; background:#090909; } .top-bar { position:fixed; top:0; left:250px; width:100%; height:54px; background:#090909; z-index:1000; } how can make fixed top bar span 100% width of screen, without spilling out. i'm hoping simple fix, i've spent ages building complex responsive template , have noticed, after adding content, things in right side of top bar disappearing off screen! i have 1 idea may not ideal, interested in others suggestions first. left fixed column given higher z-index value top bar, remove left-margin top bar, instead pu...

php - htaccess condition in 301 -

i sure there other threads on similar topics around web. can't working on own website. please me my site working in subdomain for eg http://demo.example.com/sitename/india if put 1 parameter (india) only. loading profile.php?countryname=india working good. but when add multiple parameters url this http://demo.example.com/sitename/india/tamilnadu/chennai i want load profile.php?countryname=india&state=tamilnadu&city=chennai . i try code rewritecond %{http_host} ^demo\.example\.com/sitename$ rewriterule (.*) walola/$1/$2 [r=301,l] rewriterule ^([a-za-z0-9_-]+)$ sitename/profile.php?countryname=$1&state=$2 [qsa] when pass single parameter url working otherwise shows 404 error. please guide me. ***answer*** rewritecond %{http_host} ^demo\.example\.com/sitename$ rewriterule (.*) sitename/([^/.]+)/([^/.]+) [r=301,l] rewriterule ^([a-za-z0-9_-]+)/([a-za-z0-9_-]+)$ sitename/profile.php?countryname=$1&state=$2 [qsa] its works good. ple...

mysql - SELECT multiple values to the same key in multiple tables -

i have 2 tables in following structure table_1 uid | name | age 1 | john | 24 2 | adam | 35 3 | sara | 26 table_2 id | uid | meta_key | meta_value 1 | 2 | location | ny 2 | 2 | school | nyu 3 | 3 | location | ny 4 | 3 | school | xyz 6 | 1 | location | ny 6 | 1 | school | nyu what trying select users table_1 location ny , school nyu here query tried using no luck select tabl_1.uid `tabl_1`, `tabl_2` tabl_1.uid = tabl_2.uid , table_2.meta_key in ('location', 'school') , table_2.meta_value in ('ny', 'nyu') order tabl_1.uid asc i have looked everywhere without luck, if have query works or link solution appreciated, thank you. you should try select t1.uid tabl_1 t1 inner join tabl_2 t2 on t1.uid = t2.uid , t2.meta_key = 'location' , t2.meta_value = 'ny' inner join tabl_2 t3 on t1.uid = t3.uid , t3.meta_key = 'school' , t3.meta_value = 'nyu' check result on...

javascript - place a div just below a textbox -

i have searched lot didn't got result satisfying, trying div below text using javascript autocomplete textbox <input type="text" id="one" onkeyup="suggest(event,this)" /> <p> <input type="text" id="two" onkeyup="suggest(event,this)" /> <p> <input type="text" id="two" onkeyup="suggest(event,this)" /> javascript: function suggest(e,the) { //here want create div , place below textbox on keyispressed } help! in general not idea attach javascript events html. idea dynamically create div , position below input field think following code work. here jsfiddle http://jsfiddle.net/krasimir/qcxpu/3/ <div class="wrapper"> <input type="text" id="one" class="suggest" /> <p>some text</p> <input type="text" id="two" class="suggest" /> <p>some text</p...

html - Float messes child width -

i remember have ran before cannot stress enough remember workaround.. have drop down menu fiddled ease. problem when hover on dot see how children elements wrapped , not displayed on single line. how can have them looking normally? http://jsfiddle.net/n45p7/ html <div class='addedfordisplaypurposes'> <div class="optionslist"> <span>•</span> <div class="optionsholder"> <div data-id="asdasd" class="socint">add friend</div> <a href="#">send message</a> </div> </div> </div> css .addedfordisplaypurposes { width:300px; } .optionslist { display:inline-block; position:relative; cursor:pointer; float:right; } .optionslist > span { font-size:20px; color:black; } .optionslist:hover > span { color:white; } .optionslist:hover .optionsholder { display:inline-block; } .optionshold...

html - Using a relative URL scheme effectively -

using has of issues on anchor-tags described in this question on base tags making hard use on site. i have navigation menu in site references different parts of site for example main/ |_index.html |_section1/ |_1a.html |_1b.html and navigation section on each page looks like <div id="nav"> <ul> <li><a href="index.html">home</a></li> <li><a href="section1/1a.html">1a</a></li> <li><a href="section1/1b.html">1b</a></li> </ul> </div> this works fine pages on in main folder pretty obvious reasons fails when i'm viewing page in section1 folder. can't use <base> because have large number of anchors in documents (and i'm using markdown cant change reference format easily). i'm concerned if use absolute references on pages, when upload site server huge amount of work replace absolute...

apache - ProxyPass for https not working -

i'm having set of codes in tomcat (port:8080) , set of codes in apache (port:80) . default port have set apache (document root: /var/www/html) , tomcat (/usr/.../webapps/root) now tomcat codebase running in https:// www.example.com , apache codebase running in http://ww.example.com i have written proxy proxypass /req https://example.com/req proxypassreverse /req https://example/req all request http, contains /req go https://example.com/req. but problem is, redirected http://example.com/req what can redirect https or can run tomcat in "http" add port redirect, rewrite proxy pass as, proxypass /req https://example.com:8080/req proxypassreverse /req https://example:8080/req

android - 2D Game, Performance Improvements? -

the game i'm developing progressing, more , more elements being added, i'm of course facing new problems, 1 of performance. currently, i'm having 3 threads, 2 of perform calculations, other 1 updates canvas. these 3 threads synchronized cyclicbarrier, have calculations finished when beginning draw canvas. i'm using several bitmaps in different sizes. in drawing method, bitmaps being rotated (by using drawbitmap-matrix combination scaling/translating/rotating added matrix "native" (i guess) management of it) , of course drawn. problem facing whenever have many "moving , rotating" elements on screen, gets choppy. matrix matrix = new matrix(); matrix.settranslate(view.getx(), view.gety()); matrix.prescale((1.0f * view.getwidth() / view.getcurrentbitmap().getwidth()), (1.0f * view.getheight() / view.getcurrentbitmap().getheight())); matrix.postrotate(view.getrotation(), view.getx() + view.getwidth()/2f, view.gety() + view.getheight()/2f); mca...

C# Google Drive API References -

i'm trying connect google drive api. google states provides necessary dll s , references at link here ("download latest version of library"). however, when try add necessary reference(s), c# unable find dll s , manual search them yields 0 results. referenced link: the zip file contains core library , drive-specific dlls. referencing these dlls in solution discussed in next section. the following namespaces need references: using dotnetopenauth.oauth2; using google.apis.authentication.oauth2; using google.apis.authentication.oauth2.dotnetopenauth; using google.apis.drive.v2; using google.apis.drive.v2.data; using google.apis.util; using google.apis.services; in looking around on google link, don't find necessary dll s referenced in above. note: test desktop console app, not web application. edit: should add, if add below files existing items, still unable find of assemblies: google.apis.drive.v2.1.5.0.95-beta.nuspec google.apis.drive.v2...

c# - Summation of data, linq -

Image
i want summarize "count" field "room" , "object code" equal. any ideas? i have no idea how context set, table name , dozen other things necessary answer question, use groupby linq method, like: var results = db.tablename.groupby(x => new { x.room, x.objectcode }) .select(g => new { g.key.room, g.key.objectcode, count = g.sum(x => x.code) }) .tolist();

How to overide django modelform to achieve custom behaviour -

i have item object has manytomany relation object option. create modelform item object so; class item(models.model): category = models.foreignkey(category) name = models.charfield(max_length=200) price = models.decimalfield(max_digits=9, decimal_places=2, blank=true, null=true) options = models.manytomanyfield(option) class optionform(modelform): options = forms.choicefield(widget=forms.radioselect()) class meta: model = item fields = ( 'options', ) when render form in template renders available options item object(the expected behavior) not created specific item. want able load options defined specific item chosen user. how override form achieve such behavior.for example without form can render items own options through id. item = item.objects.get(pk=id) its tough make modelform's defined on fly because intimately tied structure in model. nevertheless use clever template control flow , view rendering desired eff...

Convert JSON containing JS function definition to JavaScript object -

how convert json containing js function definitions { "a1": "5", "b1": "10", "c1": "function(param1,param2) { return param1 +param2}" } to javascript object containing functions (and not string definition): { a1: 5, b1: 10, c1: function(param1,param2) { return param1 + param2} } you can pass reviver function json.parse . lets apply custom logic parsed values. in function can test whether value starts pattern function(...) { : var obj = json.parse(str, function(k, v) { if (/^\s*function\s*\([^)]*\)\s*{/.test(v)) { try { // using function constructor evaluate function // definition in global scope return function('return ' + v)(); } catch() { return v; // maybe not js function definition after } } return v; }); demo of course iterate on resulting object , apply s...

tsql - Pivot with Temp Table (definition for column must include data type) -- SQL Server 2008 -

the following returning 2 errors: 'the definition column '0.63' must include data type.' 'the select list insert statement contains fewer items insert list. number of select values must match number of insert columns.' i understand need assign data type columns being inserted temp table don't quite understand how dynamic code however. if explanation on how @cols variable code working , specific issue. fldpk data type int , pivot fields i.e. @cols, float data type. declare @cols nvarchar(max), @query nvarchar(max); select @cols = stuff((select distinct ',' + quotename(fldci) fn_qryt_1() xml path(''), type ).value('.', 'nvarchar(max)') ,1,1,'') set @query = 'select fldpk, ' + @cols + ' ( select fldpk ,fldni ...

html - What is the purpose of this JavaScript code? -

i poking around inspect element , came across this: numberofdivstorandomdisplay = 10; var cookiename = 'divramdomvaluecookie'; function displayrandomdiv() { var r = math.ceil(math.random() * numberofdivstorandomdisplay); if (numberofdivstorandomdisplay > 1) { var ck = 0; var cookiebegin = document.cookie.indexof(cookiename + "="); if (cookiebegin > -1) { cookiebegin += 1 + cookiename.length; cookieend = document.cookie.indexof(";", cookiebegin); if (cookieend < cookiebegin) { cookieend = document.cookie.length; } ck = parseint(document.cookie.substring(cookiebegin, cookieend)); } while (r == ck) { r = math.ceil(math.random() * numberofdivstorandomdisplay); } document.cookie = cookiename + "=" + r; } (var = 1; <= numberofdivstorandomdisplay; i++) { document.getelem...

Access 2007 OutputTo PDF Different from Printed Output -

Image
using access 2007 sp3, have report. when printed printer, , in print preview, report looks fine. within margins, proper output, no pages...everything fine. when outputting same report pdf, report appears zoomed, , content clipped. no pages printed if i've gone beyond margins. here code i'm using: docmd.openreport rptname, acviewpreview docmd.outputto acoutputreport, "", acformatpdf, pdffilename, false docmd.close acreport, rptname the report opened in preview mode first page events fire show/hide objects based on fields in recordset feeds report. i've tried both screen quality , print quality parameters in outputto call, same results. also, if call outputto on 1 line , events don't fire, report still zoomed/clipped, has objects not hidden. i've tried on 2 different machines, 1 running windows 7 , 1 running windows server 2008. even when setting break point on outputto line, preview looks fine...it's resulting pdf file doesn't r...

http - Command line download large (500+mb) file using vbscript -

heart of problem: i'm trying download 650mb file using vbscript. file on 500mb fails following error... error: not enough storage available complete operation code: 8007000e source: msxml3.dll <-- when using msxml.xmlhttp or... source: winhttp.winhttprequest <-- when using winhttp i'm using code from here , both msxml.xmlhttp , winhttp (not wget). both scripts can watch in task manager build on 650mb, , fail above error. scripts work, if choose smaller files download occurs fine. the lines referenced in error messages .write objhttp.responsebody both. i've found few other people having same problem, although there doesn't seem large amount of people trying download giant files vbscript... can't imagine why. i know it's not space issue (i have plenty of hard drive space), or memory issue (i have 4gb, physical memory shows 70% @ peak). i've tried setting settimeouts option detailed here when using winhttp (i set them -1, infinite ti...

c# - HtmlElement doesn't parse the tag properly -

i have following line in html source: <input class="phone" name="site_url" type="text" placeholder="enter website url"> when navigate using webbrowser control (c#) , load site htmldocument object, , loop on each htmlelement, when input element above: i can't placeholder attribute. getattribute("placeholder") returns "". checked outerhtml/innerhtml fields , noted placeholder attribute copied "" while other attributes not, moreover, can retrieve other attributes (name, class). this output of innerhtml/outerhtml: <input class=phone placeholder="enter website url" name=site_url> can explain why , how can change placeholder in case? by default, webbrowser control runs in ie7 compatibility mode. in mode, placeholder attribute not supported. thus, first need switch ie10 mode, here's how . then, need call unmanaged getattributenode , value , here's how: bool fin...

Linux C: Changing process name during compilation -

so trying change name of process of c program crystal_capture crystal_captured, seems wanting keep old process name (crystal_capture) . here makefile. cc=gcc cflags=-c -wall msflags=-lpcap -i/usr/include/mysql -dbig_joins=1 -fno-strict-aliasing -g -l/usr/lib/arm-linux-gnueabihf -lmysqlclient -lpthread -lz -lm -lrt -ldl capture=crystal_captured all: $(capture) $(capture): parser.o $(capture).o $(cc) $(msflags) parser.o $(capture).o -o $@ $(capture).o: $(capture).cpp $(cc) $(cflags) $(msflags) $(capture).cpp parser.o: parser.c $(cc) $(cflags) parser.c clean: rm -rf *.o $(capture) commands make; sudo ./crystal_captured; ps -a | grep crystal seeing crystal_capture so there anyway can change process name compiling, without having go code. after debugging , figure out. wasn't doing wrong truncating 'd' added onto name. it must truncate 15 chars max.

javascript - HTML CSS fullscreen background with an image -

i'm working on website uses fullscreen background image. , in order make work on screen types i'm using jquery backstretch plugin. the problem have background image has text on , if screen size gets smaller, image on background , image on top overlays each other. it's rather difficult explain here actual page; preview page if width of page goes down below 1700 pixels you'll see problem. is there way solve problem without separating text background? you can use background-size: cover; { background: url(http://alicantest.info/public/_images/anasayfa_bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } or use other image in media query @media screen , (max-width: 1700px) { { background: url(newimage.jpg) no-repeat center center fixed; } }

iphone - UINavigationItem with titleview -

in app have uinavigationcontroller . , want add method when user press navigation happen.so add button titleview : self.navigationitem.titleview = self.titlebutton; and want add 2 buttons rightbarbuttonitems : self.navigationitem.rightbarbuttonitems = [nsarray arraywithobjects:self.editbuttonitem,self.atozbutton, nil]; and noticed 2 things can't work together,if add titleview see 1 button in right. any idea solution? other way able click uinavigationbar ? check frame of titlebutton have created. may reducing bit may allow add 2 buttons.

MissingMethodException in JSON.Net in Unity3D webplayer -

i'm serializing object using json.net 5.0r6 on unity3d, dotnet 2 version. can run fine in webplayer mode in editor build, when deploy webplayer. missing exception. can same code run fine on android (without stripping) it's not code side. missingmethodexception: method not found: 'system.collections.objectmodel.keyedcollection<system.string,newtonsoft.json.serialization.jsonproperty>..ctor'. @ newtonsoft.json.serialization.jsonobjectcontract..ctor (system.type underlyingtype) [0x00000] in <filename unknown>:0 @ newtonsoft.json.serialization.defaultcontractresolver.createobjectcontract (system.type objecttype) [0x00000] in <filename unknown>:0 @ newtonsoft.json.serialization.defaultcontractresolver.createcontract (system.type objecttype) [0x00000] in <filename unknown>:0 @ newtonsoft.json.serialization.defaultcontractresolver.resolvecontract (system.type type) [0x00000] in <filename unknown>:0 @ newtonsoft.json.seriali...

javascript - Best way to fade in fade out a loading css3 animation -

i facing problem loading fade in / out div has css3 based login animation when function loaded. have jsfiddle setup still can not make work. on appreciated! http://jsfiddle.net/adamchenwei/v4ck6/4/ html <!doctype html> <body> <div class="loading"> <div class="loading_ball_outside"><div class="loading_inside"></div></div> </div> <div class="section play"> <h1>pload css 2 anywhere--failed</h1> <div class="play_content"> <button class="play_button" id="1">play1</button> <button class="play_button" id="1">play2</button> <button class="play_button" id="1">play3</button> <button class="play_button" id="1">play4</button> <p>something in play ...</p...

javascript - NVD3 - Using JSON url data with LinePlusBarChart (mapping values) -

i'm trying use nvd3 library make graphs can't json url work code. graph script: d3.json("jsondata3.json",function(error,data){ var chart; nv.addgraph(function() { chart = nv.models.lineplusbarchart() .x(function(d) { return d.label }) .y(function(d) { return d.value }) .margin({top: 30, right: 20, bottom: 50, left: 175}) chart.y1axis.tickformat(d3.format(',f')); chart.y2axis.tickformat(d3.format(',f')); d3.select('#chart svg') .datum(data) .transition().duration(500) .call(chart); nv.utils.windowresize(chart.update); chart.dispatch.on('statechange', function(e) { nv.log('new state:', json.stringify(e)); }); return chart; }); }); json data format: [{"transaction_day":"20130620","mt_attempted":4505891,"mt_success":83.54,"mo_attempted":321857,"mo_success":98.9},{"transaction_day":"20130621","mt_attempted...

django distinct doesn't return just unique fields -

i've models chat messages 3 fields: sender, recipient ( foreignkey user model ) , message textfield. i'm trying select unique conversations either sender either recipient field (exclude request.user). , i'm bit messed in how implement that. i've 2 issues: message.objects.filter(q(sender = request.user)|q(recipient = request.user)).values('sender').distinct() doesn't return list of unique records ( order_by ). i've lot absolutely same senders: {'sender': 4l}, {'sender': 4l} (the same recipients). and second issue is: do need concatenate 2 queysets (for senders , recipients) or there way whole list of conversations current request.user? upd. ok, here table content: mysql> select id, sender_id, recipient_id, body messages_message ; +----+-----------+--------------+-----------+ | id | sender_id | recipient_id | body | +----+-----------+--------------+-----------+ | 1 | 4 | 1 | message 1 | | ...

java - Tomcat won't respond on port 8080 -

tomcat listening on port 8080, not respond correctly http requests. i'm running updated centos 6.2, , tomcat installed package tomcat6. tomcat running , listening on port 8080. # netstat -tlnp active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 0.0.0.0:8009 0.0.0.0:* listen 9214/java tcp 0 0 0.0.0.0:8080 0.0.0.0:* listen 9214/java tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 981/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* listen 1057/master tcp 0 0 127.0.0.1:8005 0.0.0.0:* listen 9214/java # ps aux | grep -i tomcat tomcat 9214 0.0 10.0 164556 51516 ? sl 15:00 0:01 /usr/lib/jvm/jre/b...