Posts

Showing posts from March, 2012

qt - Create library archive from dependency walker? -

a little background: creating qt application based on shared library. have distribute same. have quite few dlls share , using tool dependency walker. did complete profiling of qt application , dependency walker rightly identified shaed libraries. now question: since dependency walker knows path of dlls, there option make bundle asking dependency walker copy dlls folder or so. did research in google , did not find any.? could kindly please guide me same or there other tool same? here thoughts , ramblings on subject: i haven't heard of 1 before, dependency walker list application accesses, , large number of them don't need deployed. chances there aren't many dependencies. of windows api libraries should not copied. you may need install 1 of vscred packages, such if built msvs 2010 32 bit binary, need run msvs c++ redistributables 2010 x86 installer on client machine. but when figuring out how things have in path accessible on new client machine h

java - ImageIO.write not working? -

i'm writing 3d paint , found problem in java. in 1 part of code it's working: try { imageicon savepane=new imageicon("save.png"); string filepath= (string)joptionpane.showinputdialog(null,"enter file path , name\n warning: instead of 1 '\\' write '\\\\'", "save",joptionpane.plain_message,savepane,null,"c:\\\\example.png"); bufferedimage image = new robot().createscreencapture(new rectangle(110,130,put.getwidth()-3,put.getheight())); imageio.write(image, "png", new file(filepath)); system.out.println(filepath); } catch (ioexception e) { e.printstacktrace(); } catch (headlessexception e) { e.printstacktrace(); } catch (awtexception e) { e.printstacktrace(); } while in 1 isn't working: try { string undofolder= "was.png"; bufferedimage image = new robot().createscreencapture(new rectangle(110,130,put.getwidth()-3,put.getheight())); imageio.writ

arrays - For each key, show value - Android -

im making app site, , need making statement. parse json api (server) , catch it, working, want show in listview, i've made adapter , that, working. when launch app 1 line in listview shows. have no idea on how values listview. my activity: public class filesactivity extends sherlockactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.dblist); getsupportactionbar().setdisplayhomeasupenabled(true); getsupportactionbar().settitle("files"); string response = null; defaulthttpclient httpclient = new defaulthttpclient(); responsehandler <string> resonsehandler = new basicresponsehandler(); httppost postmethod = new httppost("http://api.bayfiles.net/v1/account/files?session=<sessionid>"); try { jsonobject json = new jsonobject(); postmethod.setentity(new byte

Can Neo4j return additional property maps -

i using cypher rest api manually this. i return data in way easy parse. here's example of data same sort of relationships i'm dealing with: (me:person:normal), (dad:person:geezer), (brother:person:punk), (niece:person:tolerable), (daughter:person:awesome), (candy:rule), (tv:rule), (dad)-[:has_child {num:1}]->(brother), (dad)-[:has_child {num:2}]->(me), (me)-[:has_child {num:1}]->(daughter), (brother)-[:has_child {num:1}]->(niece), (me)-[:allows]->(candy), (me)-[:allows]->(tv) i want of has_child relationships , if of child nodes have :allows relationships want ids of too. so if like... start n=node({idofdad}) match n-[r?:has_child]->h-[?:allows]->allowed n, r, h, collect(id(allowed)) allowedids n, r, case when h not null [id(h), labels(h), r.num?, allowedids] else null end has return labels(n) labels, id(n) id, n node, collect(has) children; the :has_child may not

jquery - POST Javascript generated file -

using fabric.js, adding text overlays user's local image, , shoving <img src="" id="pic" style="display: none;"> now, need post server.i know how upload files justing html , <input type="file" id="popup_chooser" name="something"> however, cannot figure out how $('#pic').attr('src') post variable. how best way go doing this? thanks if understand question right : $('#popup_chooser').val($('#pic').attr('src'));

jsf - Which is better? - Querying database every time or keeping objects in session -

i have 2 pieces of code same thing. fill datatable in 2 different ways. here they: <h:datatable binding="#{currentuser.items}" style=" width:505px;" id="usertable" value="#{currentuser.items}" var="user" > <h:column> </h:column> <h:column> <f:facet name="header">account number</f:facet> #{user.name} </h:column> <h:column> <f:facet name="header">currency</f:facet> #{user.surname} </h:column> </h:datatable> where items array contains user's items , currentuser session scoped class object of type user. in first code, when user logins, items database, , add them session use later, fill table in way. second version: <h:datatable binding="#{user.items}" style=" width:505px;" id="usertable" value="#{user.items}

c++ - Is there a difference between `static_cast<bool>(x)` and `x != 0.0`? -

the setup i'm working api application called motionbuilder. in order access motionbuilder property's value, read double variable, regardless of sort of data type represents. here's utility function wrote evaluate value of scalar property: template <typename datat> inline datat getscalar(fbproperty& prop, fbevaluateinfo* evaluateinfo) { double data = 0.0; prop.getdata(&data, sizeof(data), evaluateinfo); return static_cast<datat>(data); } this way, can write getscalar<float>(camera.roll, evaluateinfo) or getscalar<bool>(camera.visibility, evaluateinfo) instead of having multiple-line mess of uninitialized buffers , casts littering code. i'm compiling in visual studio /w4 , addressing warnings come up. when use getscalar<bool> , compiler produces a c4800 warning : 'double' : forcing value bool 'true' or 'false' (performance warning) when compiler creates getscalar<bool> , w

java - Custom ClassLoader to proxy static library class in JUnit tests -

question possible provide implementation of class, using custom classloader , utilized static context? background working framework recommends use static class wire dependencies. works this.. public class myclass { @thisisadependency private mydependency mydependency; public void initialize() { frameworkprovideddependencyresolver.resolvedependencies(this); } } as might expect, nightmare test with, and, sure enough frameworkprovideddependencyresolver (not real name) throws nullpointerexception unless called within active framework environment not possible junit. what do, provide custom classloader can use in junit tests provide custom frameworkprovideddependencyresolver wires mock dependencies or whatever. ok, here's i'd unit tests like: @runwith(mytestrunner.class) public class testmyclass { @test public void testinitialization() { myclass myclass = new myclass(); myclass.initialize(); // not of

d3.js - trouble with scales and hebin in d3js -

i trying use hexbin layout data distributed around 0 - examples use data centered around center of screen, scales same screen scales (except y inversion) i've tried modify scale functions account possible negative values. works y-scale, x-scale gives nans, , hexagons plotted off screen upper left. not problem - programmatically determine bin size hexbin function - in data series, of values 'binned' 1 3 hexagons, , need them spread out on available domain.. here code <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/d3.hexbin.v0.min.js?5c6e4f0"></script> <script> minmultarray =function(arr,index){ var min = arr[0][index]; (i=0;i<arr.length;i++) { min = (min>arr[i][index]?arr[i][index]:min); } return min; }; maxmultarray =function(arr,index){ var max = arr[0][index]; (i=0;i<arr.length;i++) { max = (max< arr[i][index]?arr[i][index

rotation - Android: difference between preRotate and postRotate? -

what difference between prerotate , postrotate? if every translation using posttranslate prerotate image, mean image rotation first before translation. if wanted translate image rotate image origin of image. way work right... if use postrotate instead of prerotate, need move image , rotate posttranslate image location. am right?

linux - C socket recieves data then does not send it -

i have created simple socket connection sends request node.js app , receives random data , sends data sends , receives data correctly not send random data char *httpbody; struct addrinfo hints, *result; const char *host = "localhost"; char user[512] = "test@gmail.com"; char pass[512] = "test"; char headers[512]; srand(time(null)); memset(&hints, 0, sizeof(hints)); hints.ai_family = af_inet; hints.ai_socktype = sock_stream; if (getaddrinfo(host, "3000", &hints, &result) != 0) { freeaddrinfo(result); perror("could not resolve hostname."); exit(1); } int newsocket = socket(result->ai_family, result->ai_socktype, 0); if (newsocket == -1) { perror("could not create socket."); freeaddrinfo(result); close(newsocket); exit(1); } if (connect(newsocket, result->ai_addr, result->ai_addrlen) == -1) { perror("could not connect."); freeaddrinfo(result); clo

php - Shortcode with conditional tag to show different style -

i created short code displays content in 2 different pages. both sites have different styles show same content of short code. however, conditional tags not working properly. here code: function comunicacionpdf_sc($atts, $content = null) { extract(shortcode_atts(array("url" => 'http://www.example.com/file.pdf'), $atts)); if (is_page('comunicaciones')) { return 'test'; //$output .= '<h6><a href="'.$url.'" target="_blank">descargar pdf</a></h6>'; } else { //$output .= '<div class="cd_comunicacionespdf"><a href="'.$url.'" target="_blank">descargar aqu&iacute;</a></div>'; return 'no-test'; } } add_shortcode('comunicacionpdf', 'comunicacionpdf_sc'); please ignore commented output, in frontend. from

windows phone 7 - How to Reference the ViewModel in the View -

i attempting reference class in viewmodel within xaml of view, , getting error saying object reference not set instance of object . error occurs when attemping set viewmodel resource listbox. also, when attempting set itemssource property of listbox, error results stating the resource "effects" not resolved . mainpage.xaml <grid x:name="contentpanel" grid.row="1" margin="12,0,12,0"> <grid.resources> //error occurs here! <vm:effectitems x:key="effects"/> </grid.resources> //the itemssource property contains error <listbox name="listboxeffects" selectionmode="single" itemssource="{staticresource effects}" selectionchanged="listbox_selectionchanged" toolkit:tilteffect.istiltenabled="true" scrollviewer.verticalscrollbarvisibility="disabled"

angularjs - Angular JS - Parent view not updating when scope changes -

i'm building simple angular test app , have run problem. have list of items , "add item" link @ bottom of list (the list stored on simple nodejs server). "add item" link loads child view lets user set name of new item. when user clicks done item added list on server, tells parent list update. in console can see data being passed parent view isn't reflecting new list of items. i've looked $scope.$apply never using third party library have no reason use (i have tried , gives error "$digest running" seems expected after looking @ docs). here's code in question: html parent list <ul data-ng-controller="listcntrl"> <li data-ng-repeat="item in items"> <a href="#/item/{{item.name}}">{{item.name}}</a> </li> <li><a href="#/new">add item</a></li> </ul> <div data-ui-view></div> <!--child view loaded here-->

php - My jquery code does not work after for loop -

i trying iterate through textbox es in form using jquery. working fine other day , stopped working. understand has happened wrong sure couldn't identify. please me out of trouble if see error here code: <?php $serial = 0; while ($row_details = mysql_fetch_array($res_details)) { $serial++; $remaining_qty = $row_details['ordered_qty'] - $row_details['received_qty']; echo '<tr>'; echo '<td>' . $serial . '.<input type="hidden" name="pcode-' . $serial . '" id="pcode-' . $serial . '" value="' . $row_details['product_code'] . '"/></td>'; echo '<td>' . $row_details['product_name'] . ' [' . $row_details['product_code'] . ']</td>'; echo '<td>' . $row_details['ordered_qty'] . '</td>'; echo '<td>' . $row_details['receiv

regex - htaccess RewriteRule, how do should it handle hex codes -

i have following line of code in .htaccess file: rewriterule ^mypage/(.+)/$ mypage.php?a=$1 this rewriterule works of time. however, if try passing parameter c++ , mypage/c%2b%2b/ not work properly. should go mypage.php?a=c%2b%2b ... instead seems mypage.php?a=c++ , the php code sees value of a=c<space><space> how can update rewriterule pass hex coding rewritten url ? thank in advance trick use b flag . per manual: the [b] flag instructs rewriterule escape non-alphanumeric characters before applying transformation. read more here in doc . your modified rule should this: rewriterule ^mypage/(.+?)/?$ mypage.php?a=$1 [l,qsa,nc,b]

java - Build OpenGrok source failed -

i want build opengrok source following link ( https://github.com/opengrok/opengrok/wiki/how-to-build-opengrok-from-source ). when use ant command build opengrok, met following errors: build failed /tmp/hxu2/opengrok/nbproject/build-impl.xml:415: following error occurred while executing line: /tmp/hxu2/opengrok/nbproject/build-impl.xml:201: compile failed; see compiler error output details. @ org.apache.tools.ant.taskdefs.javac.compile(javac.java:1174) @ org.apache.tools.ant.taskdefs.javac.execute(javac.java:930) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:292) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.java:106) @ org.apache.tools.ant.task.perform(task.java:348) @ o

c - Pass Arbitrary Sized 2 Dimension Array -

hi studying sorting algorithms, want make simple program getting array of integers text file. while doing i'm having trouble , questions regarding arrays , functions take them parameters . here do: #include<stdio.h> #include<stdlib.h> #define max_size 64 #define max_int_size 10000 void itobuff(const char* istring,const int** sint); int getistring(file* file,char strbuffer[][max_size],int max_int,int max); int main(int argc,char*argv[]){ char buffer[max_int_size][max_size]; int int_counter=0; int int_buffer[max_int_size]; file *file = fopen("myfile.txt","r"); getistring(file,buffer,max_int_size,max_size); return 0; } my doubt definition of function int getistring(file* file,char strbuffer[][max_size],int max_int,int max); i want write function allows use size array. know wrong, logically want achieve can't figure out how. int getistring(file* file,char strbuffer[][],int max_int,int max); i know wan

enterprise - can the desktop SDK connect to QBES file hosted on Linux? -

i have written application using desktop sdk (12) accessing qb pro. customer moving qbes hosted on linux. app still work data? if how connection done? rds? yes, app still work. with enterprise hosted on linux, quickbooks company file/database/database manager components run on linux. actual quickbooks application still runs on windows. quickbooks sdk apps run alongside quickbooks, , connect quickbooks directly, not database manager. so, app installed on windows, alongside quickbooks, , connect quickbooks, in turn talk database/company file/database manager on linux.

ruby - Image uploads in Rails with jQuery plugins -

i have create prouct page , add photos page. after user creates product redirected page allows them add photos. i'm using jquery file-upload shows preview of pictures selected , upon clicking start adds them server. however, error. jquery file-upload error dwadecrop.jpg 97.74 kb error syntaxerror: json.parse: unexpected character console message started post "/photos" 127.0.0.1 @ 2013-07-10 21:03:03 -0400 processing photoscontroller#create json parameters: {"utf8"=>"✓", "authenticity_token"=>"tc6sbe9n/ppklzlupqywqxr3c6qjemnqjskr8+prczw=", "product_id"=>"129", "photo"=>{"upload"=>#<actiondispatch::http::uploadedfile:0xa5f0780 @original_filename="dwadecrop.jpg", @content_type="image/jpeg", @headers="content-disposition: form-data; name=\"photo[upload]\"; filename=\"dwadecrop.jpg\"\r\ncontent-type: image/jpeg\r\n&q

Unable to connect backend server with android emulator -

hi developing , android application communicates backed server. tested application inside working environment working fine... able connect server , got response... but when went testing in clients environment, unable connect end server.. used lan access web server... the problem having unknown host name.. insted of giving host name gave ip address host , application got response server, if change ip address dns unable connect.. i tried several options tried set host ip address in eclipse -> window -> preference -> android -> launch. didnt work. i tried launch emulator command line using following command emulator -avd myavd -dns-server x.x.x.x 1 didn't work. since time limited deploy need help.

sql - Select User data from the combination of four tables -

i have multiple tables such bit complex matter. 1)normal user table user id|username 0 |tom 1 |dad 2 |bob 2)two tables area smallarea id|name |bigarea 0 |blocka | 0(prefa) 1 |blockb | 0(prefa) 2 |blockc | 1(prefb) 3 |blockd | 1(prefb) 4 |blocke | 2(prefc) 3)two tables area bigarea id | name 0 | prefa 1 | prefb 2 | prefc it means blocka , blockb belong prefa blockc , blockd belong prefb blocke belongs prefc 4)user , small area connection table areaconnection user_id|smallarea 0(tom) | 0(blocka) 0(tom) | 1(blockb) 1(dad) | 2(blockc) 1(dad) | 3(blockd) 2(bob) | 3(blockd) it means tom belong blocka , blockb dad belongs blockc , blockd bob belongs blockd then assume, have bigarea key 0(it means prefb) i want select users belongs blocks belongs bigarea named prefb. (prefb has blockc , blockd, then dad , bob belongs blockc or blockd, so dad , bob should selected) how write pattern in sql? doctrine2 better such select u.id,u.userna

showing number of clicks within 10 seconds using jquery -

i'm trying develop game requires user rapidly click button seconds set 10, timer starts when click button, there's show me button shows result, , after 10 seconds total should popup. my problem can't seem increments right, , clicks still register after timer done shouldn't do. need help. $(document).ready(function() { $('#total').hide(); var sec = 10; $('.setthis').click(function() { var timer = setinterval(function() { sec = sec - 1; if (sec > 0) { $('#target').click(function() { $('#total').html(function(i, val) { return val * 1 + 1 }); }) } if (sec == 0) { $('#total').show(); clearinterval(timer); } }, 1000); }) $('#showme').click(function() { $('#total').show(); }) });

python - Add Values to Existing Entry in Dictionary -

i starting out list lists = [['test', '1', '-1', '0', '-1'],['test2', '0', '1', '0', '-1'] what want end {'test': [1, -1, 0, -1], 'test2': [0, 1, 0, -1]} so basically, need create dictionary out of lists. values of dictionary need integers , not strings. this non-working code: endresult = dict() x in lists: y in x: endresult.update({x[0]:int(y)}) endresult = {} x in lists: endresult[x[0]] = [int(y) y in x[1:]] example: >>> lists = [['test', '1', '-1', '0', '-1'],['test2', '0', '1', '0', '-1']] >>> endresult = {} >>> x in lists: ... endresult[x[0]] = [int(y) y in x[1:]] ... >>> endresult {'test2': [0, 1, 0, -1], 'test': [1, -1, 0, -1]}

How can we use Linux from a small storage pen drive? Does it work on micro-controllers also? -

i hear linux os can downloaded on flash, pen drive (floppy disk?) etc. how can that? i have rhel 5.4 source code - how can download pen drive , how space required? what other functionality can add apart os - when boot storage device can make use of them? can download linux os micro-controllers also? i hear linux os can downloaded on flash, pen drive (floppy disk?) etc. how > can that? if can't work on own, can buy ready made linux on usb drive site http://www.osdisc.com or http://www.cheapbytes.com not pcs, older pcs, can boot usb drive. newer pcs beginning ship security features can interfere booting code. when work, have find out proper way boot usb drive. might have few seconds during reboot enter right key, or boot windows (if windows installed). key bios boot menu might delete or escape or f10 or other key (varies pc motherboard manufacturer). message on screen flashes rather might mention keys can press. boot specific device or changing bo

java - How to convert 160 digit binary string to 20 byte array? -

this question has answer here: in java, how convert byte array string of hex digits while keeping leading zeros? 27 answers i have binary string containing 160 digit. have tried: new biginteger("0000000000000000000000000000000000000000000000010000000000000000000000000000001000000000010000011010000000000000000000000000000000000000000000000000000000000000", 2).tobytearray() but returns 15 bytes array removed leading 0 bytes. i reserve leading 0 bytes, keep 20 bytes. i know other ways accomplish that, know there easier way might need few lines of code. why not simply: public static byte[] convert160bitstobytes(string binstr) { byte[] = new biginteger(binstr, 2).tobytearray(); byte[] b = new byte[20]; int = 20 - a.length; int j = 0; if (i < 0) throw new illegalargumentexception("string long"); (; j < a.

html5 - Is it possible to edit an html file through a javascript based app? -

good day! want apologize bad title, not sure how express question in short manner. consider following situation: have html form (regardless fields) , have empty spaces. example consider has space text , space receiver. both styled css, inner html left empty. my question following: possible create program javascript edit (rather set) inner html of file , create new file containing it. my research far hasn't been successful, , starting think not possible (because can't directly read files javascript) decided ask here last resort. as far know, security reasons, javascript cannot access file system , design. hence, cannot read or change files using javascript or client based programming language. need server side languages php, c# achieve goal.

including a custom appender class for jboss logging jboss-log4j.xml -

i relatively new jboss. have use custom appender of have jar file available. for eg. <appender name="mylogger" class="org.log4j.appender.mylogappender"> <param name="file" value="/logs/abc.log"/> <param name="threshold" value="debug"/> ...more parameters... <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%-5p %-23d{} [%t] %x: %c{1} - %m%n"/> </layout> </appender> but doing error log4j:error not create appender. reported error follows. java.lang.classnotfoundexception: org.log4j.appender.mylogappender which file other jboss-log4j.xml must configured ? where must jar file placed in jboss hierarchy , how must jboss-log4j.xml configured use appender ? thanks. you don't version of jboss you're using, jboss 5.1.0, log4j lives in $jboss_home/common/lib , i'd suggest putti

c# - Dynamically Created Controls losing data after postback -

actually, creating 1 textbox on pageload , adding textbox panel . now, have linkbutton add another . i entering text in textbox , if needed need create new textbox ,by clicking add linkbutton . actually, able count , recreate textboxes . but,the problem that, entered text in generated textboxes missing. can anyone,suggest me solution this? protected void page_load(object sender, eventargs e) { try { if (!ispostback) { (int = 0; < 5; i++) { tablerow row = new tablerow(); (int j = 0; j < 5; j++) { tablecell cell = new tablecell(); textbox tb = new textbox(); tb.id = "textboxrow_" + + "col_" + j; cell.controls.add(tb); row.

c# - Complex regex or string parse -

we trying use urls complex querying , filtering. managed of simpler parst working using expression trees , mix of regex , string manipulation looked @ more complex string example var filterstring="(|(^(categoryid:eq:1,2,3,4)(categoryname:eq:condiments))(description:lk:”*and*”))"; i'd able parse out in parts allow recursive.. i'd out put looking like: item[0] (^(categoryid:eq:1,2,3,4)(categoryname:eq:condiments) item[1] description:lk:”*and*” from there strip down item[0] part get categoryid:eq:1,2,3,4 categoryname:eq:condiments at minute i'm using regex , strings find | ^ knowing if it's , or or regex matches brackets , works single item it's when nest values i'm struggling. the regex looks like @"\((.*?)\)" i need way of using regex match nested brackets , appreciated. you transform string valid xml (just simple replace, no validation): var output = filterstring .replace("(","<no

css - Media Queries not working in Internet Explorer ie6-ie8 -

the code given written css not working @ in ie(6-8) @media screen , (max-width: 340px) { .topmaindivleft{ width:100%; margin:0px; padding:0px; height:auto; float:left; } .topmaindivright{ width:100%; margin:0px; padding:0px; height:auto; float:left; } } want know codes make work in ie6-8 making responsive website that's because media queries aren't supported in ie6 through ie8 . this polyfill, called respond.js, may - https://github.com/scottjehl/respond . respond.js - fast & lightweight polyfill min/max-width css3 media queries (for ie 6-8, , more) here's demo example .

jquery - Extract binary or base64 from <img> -

is there way access full binary representation (or base64 encoding) when displaying img in jquery / javascript? such as <img id="myimage" src="http://someurl/someimage.png" /> javascript $('#myimage).getbuffer() the reason: want put image origin in canvas , modify it. putting source directly in canvas (see this ), nothing (same-origin-policy violation?). ajax requests have same problem. i can (and did) modify server allow new external origin (cors). works, such origin dynamic local ip , better have purely client-side. there isn't one. can not on client side override same-origin policy (unless hack browser or make own prevent browser set tainted flag (or rather origin-clean flag) on canvas :-) ). as long origin of source image !== origin of page standard require browser set canvas tainted unless source server accept usage other origin. there no solutions on client side around (for "security reasons"). the image

css - jquery hover fadein only works for a short moment! why? -

i wrote below codes. such when mouse hover imgforplaces_thumbnail . div checkbutton display , overlay on div testtest . however, div checkbutton appear 1-2 sec, , disappear. if remove position:absolute; in css in div testtest , div checkbutton appear below of it. can tell me why works 1-2 sec? i have 2 divs, .testtest , .checkbutton , wrapped .imgforplaces_thumbnail1. these divs: echo '<div class=imgforplaces_thumbnail1 id=imgforplaces_thumbnail>'; echo '<div class=testtest>'; echo "<a class='ajax' href='image_color_box.php?id=".$row['id']."' title='homer defined'>"; echo "<img src='../imgforplaces_thumbnail/" . $row['location_name'] . ".png' />"; echo '</a>'; echo '</div>'; echo '<div class=checkbutton><img src="../images/fbloginbutton.png"

android - ActionBarSherlock, how to get support progress bar indeterminate visibility? -

it's possible set visibility of indeterminate progress bar : setsupportprogressbarindeterminatevisibility(true / false); but how check visibility of progress bar? kind of "getsupportprogressbarindeterminatevisibility()" ? thanks. as far know, "getsupportprogressbarindeterminatevisibility()" doesn't exist of now. so, you possibly use flag achieve objective. for example: boolean isprogressbarvisible = false; ... //some code setsupportprogressbarindeterminatevisibility(true); isprogressbarvisible = true; //and when set visibility false, setsupportprogressbarindeterminatevisibility(false); isprogressbarvisible = false; //and in code u need perform check, if(isprogressbarvisible){ //do stuff }

javascript - How to zoom cube -

hello want make div text , when click on should rotate, zoom blank page , display new content. how can it? it's have. javascript: var props = 'transform webkittransform moztransform otransform mstransform'.split(' '), prop, el = document.createelement('div'); for(var = 0, l = props.length; < l; i++) { if(typeof el.style[props[i]] !== "undefined") { prop = props[i]; break; } } var xangle = 0, yangle = 0; $('#cube').on('click',function(){ yangle = -180; document.getelementbyid('cube').style[prop] = "rotatex("+xangle+"deg) rotatey("+yangle+"deg)"; }); fiddle

java - Android acessing MainActivity from AsyncTask -

my application crashes after click button, code executes properly. public void makelead(view v) throws exception { try { registertimer rt = new registertimer(); rt.ma = this; rt.execute(null); } catch (exception e) { e.printstacktrace(); } } public void log(string msg) { final textview tv = (textview)findviewbyid(r.id.edittext); tv.append(msg); } private class registertimer extends asynctask { public mainactivity ma; @override protected object doinbackground(object[] objects) { ma.log("ausd"); return null; } } makelead onclick event. method ma.log generates error works (msg added textedit ). when delete ma.log, app doesn't crash. have no logs in androidstudio can't see error message. what's wrong ? as described @raghunandan have not initialized ma. next cannot access view in background thread. if thread class inside of mainactivity class can use runonuithrea

c# - GDI+ Compose bitmap with transparency -

i'd rewrite method using graphics.drawimage() . no matter pixelformat of bitmaptodrawon , bitmapdrawn values (i tried combinations) should typically pixelformat.format32bpprgb , pixelformat.format32bppargb (or pixelformat.format32bpppargb ), cannot obtain result. this compose operation seems pretty obvious me, looks missing something. private static void composebitmapwithtransparency(bitmap bitmaptodrawon, bitmap bitmapdrawn) { debug.assert(bitmaptodrawon != null); debug.assert(bitmaptodrawon.pixelformat == pixelformat.format32bpprgb); debug.assert(bitmapdrawn != null); debug.assert(bitmapdrawn.pixelformat == pixelformat.format32bppargb); var width = bitmaptodrawon.width; debug.assert(bitmapdrawn.width == width); var height = bitmaptodrawon.height; debug.assert(bitmapdrawn.height == height); var rect = new rectangle(0, 0, width, height); var bitmaptodrawondata = bitmaptodrawon.lockbits( rect, imagelockmode.readwrite,

Analytics Exclude refferal -

i have 2 subdomains www.domain.com, client.domain.com , admin section @ different admin.com. tracking code set _setdomainname = 'domain.com'. i want exclude refferals admin.com in traffic sources report. setup filter type - exclude filter field - refferal pattern - admin.com but doesn't work. see referral admin.com in traffic sources (i aware filter doesn't work retrospectively). what i'm doing wrong? thank you.

c - Conditional tests in primality by trial division -

Image
my question conditional test in trial division. there seems debate on conditional test employ. let's @ code rosettacode . int is_prime(unsigned int n) { unsigned int p; if (!(n & 1) || n < 2 ) return n == 2; /* comparing p*p <= n can overflow */ (p = 3; p <= n/p; p += 2) if (!(n % p)) return 0; return 1; } wheel factorization or using predetermined list of primes not change essence of question. there 3 cases can think of conditional test: p<=n/p p*p<=n int cut = sqrt(n); (p = 3; p <= cut; p += 2) case 1: works n has division every iteration ( edit: not need division it's still slower. i'm not sure why. see assembly output below) . have found twice slow case 2 large values of n prime (on sandy bridge system). case 2: signficantly faster case 1 has problem overflows large n , goes infinitive loop. max value can handle (sqrt(n) + c)^2 = int_max //solve n = int_max -2*c*sqrt(int_max) + c^2 //int_ma

c# - Length of the data to decrypt is invalid. CryptoStream decrypting a string -

i have encrypt , decrypt method works on 1 site when copying on site started error: length of data decrypt invalid. have had online , on of questions find here none of them seemed have fix works me the code encrypts without issue not decrypt correctly. error occurs on line here int decryptedbytecount = cryptostream.read(plaintextbytes,0, plaintextbytes.length); it string trying decrypt here full decrypt method: public static string decrypt(string ciphertext) { string passphrase = "@not real pass"; // can string string saltvalue = "@not real salt"; // can string string hashalgorithm = "sha1"; // can "md5" int passworditerations = 2; // can number string initvector = "@1b2c3d4e5f6g7h8"; // must 16 bytes int keysize = 256; // can 192 or 128 // convert strings defining encryption key characteristics byte