Posts

Showing posts from August, 2013

How to close setup window when running installed application by Inno Setup? -

Image
i'm using inno setup install winforms utility , works fine. there's minor problem our users find quite annoying: on last step of installation, inno setup suggests launch utility has been installed. of users want launch , (and i). problem setup window of inno setup not closed until user closes installed utility. furthermore, can't close setup window unless close installed utility first. attached image demonstrates installed utility (the right icon) , inno's setup icon (the left one). so how fix problem? please advice. thank you the problem occurs on windows: xp, 7, 2003, 2008 etc. you need add nowait flag [run] section entry. modify script this: [run] filename: {app}\myexe.exe; description: launch app; flags: postinstall skipifsilent nowait

colors - How to change in all css "#xxx" to "#000" -

i have script, when enable it, shown things on page value #xxx (in color, borders, etc. etc.) change black #000. possible? want have 2 versions of site - 1 normal, , 1 'mourn' option.. client wanted :) make 2 different style-sheets different behaviors required , switch css files when need change versions. help available css file change dynamically: adding css file jquery jquery change css file dynamically

iphone - save photo in webview to ios photo library -

Image
this case in photo taken using camera , saved in library. , photo opened in webpage editing purpose , how save device memory name? ie... hw save photo displayed in webview photo library? in adv. bellow method done need:- - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. nsurl *url = [nsurl urlwithstring:@"yourimageurl"]; nsurlrequest *req = [nsurlrequest requestwithurl:url]; [webv loadrequest:req]; uitapgesturerecognizer *gs = [[uitapgesturerecognizer alloc] init]; gs.numberoftapsrequired = 1; gs.delegate = self; [self.view addgesturerecognizer:gs]; } -(bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldreceivetouch:(uitouch *)touch { nslog(@"tapped"); //touch gestures below top bar should not make page turn. //edited check tap here instead. if ([gesturerecognizer iskindofclass:[uitapgesturerecognizer class]]) {

Eclipse - Make dynamic web application include other projects in workspace -

i'd exported .war file include other (referenced) projects in workspace. when reference them in build path only, shows no "problems", classnotfoundexception thrown later, when try "run on server" or export. using eclipse kepler, tomcat 7.0.42. i've seen solution here: not able configure run path web application project in eclipse workspace ; that's how works now. there more convenient way? are running tomcat within eclipse? try this: run -> run configurations... (or debug configurations... ). find tomcat v7.0 server @ localhost (or whatever it's named you) under apache tomcat on left-hand side. go classpath tab on right. select user entries , click add projects... . select projects wish include. that should place project on tomcat's classpath.

node.js - Requirejs with nodejs doesn't tell me the line number of the error, just the error -

requirejs nodejs doesn't tell me line number of error, error for example result is: error: evaluating ccc.js module "ccc" failed error: syntaxerror: unexpected token , and stack: at function.req.load (d:\web\pc\node_modules\requirejs\bin\r.js:2470:23) @ object.context.load (d:\web\pc\node_modules\requirejs\bin\r.js:1858:21) @ object.module.load (d:\web\pc\node_modules\requirejs\bin\r.js:1059:29) @ object.module.fetch (d:\web\pc\node_modules\requirejs\bin\r.js:1049:66) @ object.module.check (d:\web\pc\node_modules\requirejs\bin\r.js:1079:26) @ object.module.enable (d:\web\pc\node_modules\requirejs\bin\r.js:1376:22) @ object.context.enable (d:\web\pc\node_modules\requirejs\bin\r.js:1730:39) @ object.<anonymous> (d:\web\pc\node_modules\requirejs\bin\r.js:1361:33) @ g (d:\web\pc\node_modules\requirejs\bin\r.js:363:23) @ each (d:\web\pc\node_modules\requirejs\bin\r.js:291:31) @ object.module.enable (d:\web\pc\node_modules\requirejs\bin\r.js:1323:17) @ object.mo

jquery - change in .appendTo() in jquery1.9.1 -

i trying understand change in behavior of .appendto() api in jquery 1.9.1 version previous versions. in upgrade guide says as of 1.9, these methods( .appendto , .insertbefore , .insertafter , , .replaceall ) return new set, making them consistently usable chaining , .end() method. prior 1.9, return old set if there single target element. note these methods have returned aggregate set of elements appended target elements. i tried simple usage of api <div class="test">hello </div> var $ = jquery.noconflict(); var =$("<p> hi </p>").appendto("div.test").attr("style","background-color:red"); console.log(a); here fiddle link i appending paragraph element div , changing background of resulting element. tried both 1.7.2 , 1.9.1 in both cases result after appending paragraph element. but has been explained in document prior 1.9 return old set(in example old set refers div element believe

Magento SQL Query to show product manufacturer -

i trying query product manufacturer in magento 1.7.0.2 . browse again , again table can manufacturer table , connect product sku. i try query hope can manufacturers of product: select eav_attribute_option_value.value eav_attribute, eav_attribute_option, eav_attribute_option_value eav_attribute.attribute_code = 'manufacturer' , eav_attribute_option.attribute_id = eav_attribute.attribute_id , eav_attribute_option_value.option_id = eav_attribute_option.option_id but not equal product manufacturer when compare result magento admin product manufacturer. my question should query can list of manufacturers of product can sql join in catalog_product_enity 's sku . does has idea case? new magento please gentle me. appreciated, in advance i hope understood correctly. if want manufacturer product, don't need query. should work. let's assume have product in var $_product ; $_product->getattributetext('manufacturer');//this gets label $_

sockets - (Android) File download normally on one host, but 'completed immediately' on another -

i'm in hurry i'll make short. if needed, i'll provide more info when pc. i'm creating download/upload speed test app android. here's of code: inetaddress host = inetaddress.getbyname(myhosename); socket s = new socket(host,80); //prepare data stream each direction outputstream output = s.getoutputstream(); inputstream input = s.getinputstream(); //send command output.write( ("get "+ myfilepath +" http/1.0\r\n").getbytes() ); output.write("accept: */*\r\n".getbytes()); output.write("\r\n".getbytes()); while ((downloadedbyte += input.read(bufferdata,0,bufferdata.length)) != -1) { //download started... bla bla bla the problem: i have same test file on 2 host. (the name test.jpg) one this: xxx.xxx.xxx.xxx (it's ip address) another 1 domain name my.testhost.com the problem when try download xxx.xxx.xxx.xxx, fine but

javascript - Grabbing ID Field from Element jQuery Each -

i'm trying cycle through of children in <ul> list, assign onclick event listener , use id of element event. using jquery , jquerymobile in application. reason, id property of element shows blank? when alert actual element, [objecthtmllielement] . when use devtools, id field present in of elements? this listview this how trying accomplish this... function set_onclicks() { var count = $('#main-listview').children().length; if (count > 0) { $('#main-listview').children().each(function() { this.onclick = function() { project_id = this.id; $.mobile.changepage('#main-project-page', 'slide', true, true); } }); } } can point me in right direction , explain why cannot grab id? in advance help! nathan recent edits i have tried implementing this, know not need bind through .each() loop. $('#main-listview').children().click(functio

How to skip input control screen in Jasperserver (Using Hyperlink from Drill report) -

ok created drill down report (lets call drillone ) uses hyperlink drill down other report (lets call drilltwo ) the drill down report (drilltwo) doesn't have input controls because gets info report calling (drillone) so hyperlink drilltwo looks "./flow.html?_flowid=viewreportflow&reportunit= %2fnwu%2fstudentinformation%2facademicprogramdevelopment%2fapqibi005drill &startdate=" + new simpledateformat("yyyy/mm/dd").format($p{startdate})" now problem comes when going drilltwo drillone (without having enter input controles again , clicking run) what happens when click hyperlink drillone sends parameters , along fine, loads input control screen , user has run report i want go directly drillone , run it, (skip input controle screen) is drillone set prompt input controls? turn off.

c# - Binding data to Template Field in Asp.net -

i want bind data templatefield in asp.net. know following code text = '<%#bind("columnname") %>' where text text property of control want bind to. want bind thing text in control, want bind hyperlink's navigateurl following: "default.aspx?id=" and bind , id database. how can achieve this? thank you. perhaps: navigateurl='<%# string.format("default.aspx?id={0}&nextparam={1}", eval("id"), eval("nextcolumn")) %>'

xml - SoapFault in PHP Soap Server (Error Handling) -

i'm working on new soap web service. previous web service used return array('error'=>"please login first"); when error encountered. i've read, better use soapfault instead. the following line used call soapfault: throw new soapfault($faultcode, $faultstring, $faultactor, $faultdetail, $faultname, $headerfault); i saw soap has pre-defined codes, namely: versionmismatch, mustunderstand, client , server. please me understand answering/correcting following: can use own custom faultcodes "auth" or "error55". some use array("namespace", "errorcode"). should rather used? , should value of namespace be? i assume faultstring can user "please login first". what purpose of faultactor? faultdetail array containing detail of fault. kind of detail? what purpose of faultname? what purpose of headerfault? i believe it's discouraged ask multiple questions in single question. also, of answ

java - How to import ldif file using unboundid-ldap-sdp? -

i exported following ldif file ldap server , trying import can replicate directory exported from: dn: cn=mycompany users,dc=mycompany,dc=com changetype: add objectclass: posixgroup objectclass: top cn: mycompany users gidnumber: 1001 dn: cn=jim smith,cn=mycompany users,dc=mycompany,dc=com objectclass: inetorgperson objectclass: posixaccount objectclass: top givenname: jim cn: jim smith sn: smith gidnumber: 1000 homedirectory: /home/users/arolls uid: jsmith uidnumber: 1038 userpassword: {md5}x03mo1qnzdydgyfeuilpmq== dn: cn=dave jones,cn=mycompany users,dc=mycompany,dc=com objectclass: inetorgperson objectclass: posixaccount objectclass: top givenname: dave userpassword: {md5}fhcdh0pmkopk/dp0golzua== loginshell: /bin/sh cn: dave jones sn: dave gidnumber: 1000 homedirectory: /home/users/dave uid: dave uidnumber: 1006 i'm trying import using ldifreader r = new ldifreader(resourceasstream); ldifchangerecord readentry = null; while ((readentry = r.readchangerecord()) != null)

string - SQL Statement to return before a certain character -

i need able output string return everthing specified character, believe making use of charindex best way approach unsure of syntax required. some examples: if string equal "601-test-test2_test3" wish return 601 if string equal "42-test_test3" wish return 42 if string equal "1-test_test3" wish return 1 -- should require: declare @string nvarchar(50) set @string = '601-test-test2_test3' select @string 'test string', left(@string, charindex('-', @string) - 1) 'upto-'

osx - Running Umbraco / Mono on OS X -

does have concise info on how umbraco running locally on mac osx. ive tried installing mono cant seem find clear instructions on how set local version of apache. i sure can't run umbraco on osx. however, there members of community working on mono-specific ports of umbraco. check out strawberry fin 's blog details: http://www.strawberryfin.co.uk/blog/2013/02/02/umbraco-6-is-out-mono-roadmap/

c++ time() function performance in solaris -

we have multi-threaded c++ application running on solaris (5.10, sparc platform) . per "pstack" of threads seem waiting on below call little long. corresponds " time_t currenttime = time(null) ; " function in application code current time in seconds. ffffffff76cdbe1c __time (0, 23e8, 1dab58, ffffffff76c63508, ffffffff76e3e000, 2000) + 8 the timezone " asia/riyadh ". tried setting tz variable both "asia/riyadh" ' <gmt+3>-3 '. there no obvious improvement either option. changing server code (even if there alternative) rather difficult @ point. test program (single thread, compiled without -o2) having 1 million " time(null) " invocations came out rather quickly. application & test program compiled using gcc 4.5.1 . is there else can try out? i agree rather broad question. try out valid suggestions , close there adequate improvement handle current load. edit 1 : please ignore reference time(null) above, pos

php - Add current date to dropdown if doesn't exist in database -

Image
i have table date selector trying add current date option unless there rows present date. here how looks: today 25th yet shows date 20th since there rows present 07/20/2013 date in it. how shows current date? here code <div class="lookup"> <form action="index.php" method="get"> <select name="exam_date" onchange="location = this.options[this.selectedindex].value;" id="type" class="neutral"> <?php $sql_gdate = "select distinct pat_date patients order pat_date desc"; $result_gdate = mysql_query($sql_gdate); while ($row_gdate = mysql_fetch_assoc($result_gdate)) { echo '<option value="?exam_date=' . $row_gdate['pat_date'] . '"'; if ($exam_date == $row_gdate['pat_date']) { echo 'selected="selected"'; } else { echo ''; } echo '>' . $row_gdate['pat_date'

html - Similarly structured WordPress template files producing different CSS styling -

i have 2 identical wordpress category template files being displayed differently in browser. the black-colored band @ bottom of this page should extend across entire width of page, on this page , reason not. both category template files structured same (as far can tell) , use same style sheet, @ loss why being displayed differently browser. adding closing incorrectly styled page seems solve problem, can't figure out why closing necessary in 1 template file, not in other. the code correctly-styled template file follows: <?php get_header(); ?> <body class="projects"> <div id="page-container"> <?php get_sidebar(); ?> <div id="content"> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div <?php post_class(); ?>> <div class="post-container"> <div class="post-title">

sql - MySQL case-insensitive DISTINCT -

can tell me how can select distinct database without being case-sensitive? my query select distinct email `jm_order` the results brings out emails in table repeats ones different cases e.g sam@gmail.com josh@gmail.com sam@gmail.com john@gmail.com what adjustment can make sql stop repeating sam@gmail.com because different cases? try use upper function select distinct upper(email) `jm_order` you can use lower instead select distinct lower(email) `jm_order` more information .

java - Spring MVC PATCH method: partial updates -

i have project using spring mvc + jackson build rest service. let's have following java entity public class myentity { private integer id; private boolean aboolean; private string averybigstring; //getter & setters } sometimes, want update boolean value, , don't think sending whole object big string idea update simple boolean. so, have considered using patch http method send fields need updated. so, declare following method in controller: @requestmapping(method = requestmethod.patch) public void patch(@requestbody myvariable myvariable) { //calling service update entity } the problem is: how know fields need updated? instance, if client wants update boolean, object empty "averybigstring". how supposed know user wants update boolean, not want empty string? i have "solved" problem building custom urls. instance, following url: post /myentities/1/aboolean/true mapped method allows update boolean. problem solution is not res

android - Way of combining drawables? -

i new java , android programming , having trouble app. have various imageviews pictures set pngs res folder (using .setimageresource), have png, transparent square red border, place on top of imageviews giving highlight effect. can't work out how combine 2 pngs give desired highlighted look. i have tried creating new bitmap , drawing highlighted image on top of imageview's background couldn't work out how convert drawables bitmaps. any appreciated, thanks.

cassandra - CPU usage goes high when read -

i using cassandra 1.2.5, have 4 nodes in cluster. each node m1.large system memory 8gb. read more. have 50,000 rows in column family. when ever try read data column family, every time either node3 or node4 cpu usage going high. have given logs below this. can make compaction strategy leveledcompactionstrategy , sstable_size_in_mb 10 problem. help? is there other solution this? logs: info [scheduledtasks:1] 2013-07-25 12:59:04,660 statuslogger.java (line 95) cache type size capacity keystosave provider info [scheduledtasks:1] 2013-07-25 12:59:04,660 statuslogger.java (line 96) keycache 18523284 52428800 info [scheduledtasks:1] 2013-07-25 12:59:04,661 statuslogger.java (line 102) rowcache 0 1073741824 org.apache.cassandra.cache.serializi

c# - Using EF5 to bind to Data Grid View issue -

i'm new using ef , i'm using ef5 attempt bind data view data grid view in winforms app. i'm not sure how properly, , i'm getting error: data binding directly store query (dbset, dbquery, dbsqlquery) not supported. instead populate dbset data, example calling load on dbset, , bind local data. wpf bind dbset.local. winforms bind dbset.local.tobindinglist(). here code: using (myentities context = new myentities ()) { var qry = col in context.vwsystemproperties select new { systempropertyname = col.systempropertyname, systempropertyenumval = col.systempropertyenumval, systempropertyvalue = col.systempropertyvalue, applicationscope = col.applicationscope, categoryscope = col.categoryscope, entityscope = col.entityscope,

objective c - iOS VST audio plugin support -

as objective c developer, there library or smart "easy" way vst plugins run on ios? (please improve tagging if have suggesions. ) if have source code, theoretically plug audiounit graph. isn't hard do, again, if have source wouldn't asking question. otherwise there no chance intel binary made run on ios, or if performance real time on iphone or ipad.

Youtube and Vimeo Videos support in Android with Vitamio -

in app trying play vimeo video using videoview seems out of scope right , therefore have decided first try , youtube video work. i added vitamio plugin , seems work fine mp4 videos uploaded on site on both 3g , wifi connection not work when provide rstp link of youtube videoview , try watch on wifi. do have use technique make youtube video work on both wifi , 3g? need special url it? if has suggestions on how can use vimeo video vitamio great. here code using: string srcpath = "rtsp://v4.cache7.c.youtube.com/cjyleny73wialqky7thxrrjpyrmydsanfeijbxytz29vz2xlsarsbxdhdgnoykjr78wv1zh5tgw=/0/0/0/video.3gp"; //this doesnot work on wifi string srcpath = "http://myurl.com/videoname.mp4"; //this works on 3g connection failes on wifi try { videoview myvideoview = (videoview)findviewbyid(r.id.myvideoview); myvideoview.setvideouri(uri.parse(srcpath)); myvideoview.setmediacontroller(new mediacontroller(this)); myvideovi

sqlite - Syntax for Select in SQL Query -

i have sqlite database following table: create table games (name text, date text, winloss int, gameid int, pointsfor int, pointsagainst int); two sample records like: anna a, 7/12/13, 0, 345, 56, 28 barley b, 7/12/13, 1, 345, 28, 56 (barley's team lost, , anna's won. each game has several players on each team.) want create query return games had x players on 1 team , y players on another, plus cumulative result of games. i know how using perl , csv file, , believe use same method dbi interface. want learn how create report using sql queries, however. newcomer sql, , suspect solution may involve pivoting table using case when or join create new table; can't see how it. this query return games players on same team , won (or lost, depending on value of winloss): select gameid,date games name in ('anna a', 'barley b') , winloss=1 group gameid having count(*)>1; but don't know how generalize query return games players on other team.

jquery - Append text in html <script></script> tag. Javascript issue -

i want add text span container on runtime calling javascript function html node : <span class="muted"> <script> //here want add string returned outer span. (i use jinja tags) getgenericobjname("{{n.news_type}}",{{n.news.object_id}}); </script> </span> the reason because iterate on news feed. , know function returns correct value. i tried use document.write(...) seems override whole page. thanks! do other way round, via js (using jquery): <script type="text/javascript"> $(".muted").html(getgenericobjname("{{n.news_type}}",{{n.news.object_id}})); </script> html: <span class="muted"></span>

node.js - switching database with mongoose -

hi there way switch database mongoose? thought that: mongoose.disconnect(); mongoose.connect('localhost',db); but not work receive error: error: trying open unclosed connection. i not know if because asynchronous it asynchronous. if pass callback function disconnect , try connect next database in callback, work. ex. var mongoose = require('mongoose') mongoose.connect('mongodb://localhost/test1', function() { console.log('connected test 1') mongoose.disconnect(connecttotest2) }) function connecttotest2() { mongoose.connect('mongodb://localhost/test2', function() { console.log('connected test 2') process.exit() }) }

Google APIs Console: Error Creating OAuth 2.0 Client ID -

i trying use google apis console create oauth 2.0 client id service account. id used query google analytics data through analytics api. however, when attempt create client id, apis console displays message, "an error has occurred. please retry later." have tried several times throughout last 2 weeks, keep getting same error message. can advise me on i'm doing wrong? or there way can access analytics data via api without oauth client id? i figured out issue. apparently, google apis console not allow collaborator account create new oauth service accounts, owner account can so.

asp.net mvc - CKEditor - move skins folder somewhere else -

i'm using ckeditor first time , trying thought simple far i've had no success. essentially want place editor.js, config.js , styles.js in scripts folder want "skins" folder contains css , images appear within separate "styles" folder. the application consists of simple view displays editor on load. the code display editor follows: angular.element(document).ready(function () { ckeditor.config.contentscss = '/styles/ckeditor/'; ckeditor.replace('editor'); }); the html within view follows: @section scripts { <script src="~/scripts/ckeditor.js" type="text/javascript"></script> <script src="~/scripts/angular.js"></script> <script src="~/scripts/main.js" type="text/javascript"></script> } <h2>index</h2> <textarea id="editor" name="editor"></textarea> this mvc application , scripts

c# - Delimiting data from a query -

i want write query in c# visual studio 2012 on winforms application delimits information access database. want able rid of data contains / or @ symbol i'm not quite sure how write query. this, select * date expression *does not have / or @* if lend appreciated. assuming you're connecting access db file oledb, try ... select * [date] not [expression] '%[/@]%'; if testing query within access application session, need change wild card characters ... select * [date] not [expression] '*[/@]*'; or can use alike instead of like , , query operate same in either situation ... select * [date] not [expression] alike '%[/@]%'; note date , expression both reserved words . enclosing them in square brackets avoids confusing db engine.

wpf - Some questions about Windows Presentation Foundation (C#) -

i working on program contains (among other things) wpf window using next code maximize @ mousedoubleclick event: this.windowstyle = windowstyle.none; this.windowstate = windowstate.maximized; this.topmost = true; now, want when window maximized , mouse exits screen (goes bottom of screen until exits screen) new window appear @ bottom of screen(wpf or windowsform) contains several things (buttons, scrollbars, etc) , active long mouse on (just in bsplayer). question how ? i'm starter wpf, don't know xaml , prefer as can using c# code. so: how know when mouse leaves screen , how make window appear on bottom of screen (without minimizing or doing else original window) ? tried using this.mouseleave doesn't work when window maximized. and if asking question here, use chance ask 2 other things: when wpf window maximized , if mouse hasn't been moved more 5 seconds, want mouse hidden , become visible again when mouse moves. h

c - Code benchmarking statistics - -

as wrote in previous topic: benchmarking code - doing right? need find way benchmark statistics, average, mean, standard deviation, etc. how can using methods posted? notice use solution benchmark code time interval, not calling function many times. ideas? i came one, dont know if correct (pseudocode): buffsize = 1024; buffer [buffsize]; totalcycles = 0 // arrays walltimeresults = [] cputimeresults = [] // benchmarking in (0, iterations): start = walltime(); fun2measure(args, buffer); end = walltime(); walltimeresults[i] = end - start; start = cputime(); fun2measure(args, buffer); end = cputime(); cputimeresults[i] = end - start; c1 = cyclecount(); fun2measure(args, buffer); c2 = cyclecount(); cyclesperbyte = c2-c1/(buffsize); totalcycles += cyclesperbyte; in range (0, iterations) : sum += walltimeresults[i]; avg_wall_time = sum / iterations; sum = 0; in range (0, iterations) : sum += cputimeresults[i]; avg_cpu_time = sum / iterat

css - Setting body { font-size: 100% } results in font-size: 12px; and not font-size: 16px; Why? -

i understood default font-size 16px on browsers. why height of inline-block(12px) same font-size (i've tried in chrome , ff) ? please me understand. thank you. <!doctype html> <html> <head> <style> body { font: 100% helvetica, arial, sans-serif; line-height: 1.625; } #temptest { display: inline-block; width: 10px; height: 12px; background-color: orange; } </style> </head> <body> <p class="heading"><span id="temptest"></span>remember, when young, shone sun. shine on crazy diamond</p> </body> </html> if inspect inline box using browser’s developer tools (hit f12 open them), can see height indeed 12px, set in code. happens because there nothing in require more height; in general, exact calculation of heights of inline blocks browser-dependent. the font size of t

regex - Java Regular Expression to match dollar amounts -

this i've been using \$?[0-9]+\.*[0-9]* but when doing testing noticed things like $$$34.00 would return match (but matcher.group() ) returns matched substring. don't want pass regular expression if user enters more 1 dollar sign tried this: \${1}[0-9]+\.*[0-9]* but seems behave same regular expression first typed. right i'm testing in java but, plan use in c++ using boost libraries. please don't give me solution here because i'm trying learn without giving me answer. but need making user can enter 1 dollar sign (which thought \${1} do) since you're doing learn regex... ^\$(([1-9]\d{0,2}(,\d{3})*)|(([1-9]\d*)?\d))(\.\d\d)?$ breakdown: ^\$ start of string $ single dollar sign ([1-9]\d{0,2}(,\d{3})*) 1-3 digits first digit not 0, followed 0 or more occurrences of comma 3 digits or (([1-9]\d*)?\d) 1 or more digits first digit can 0 if it's digit (\.\d\d)?$ period , 2 digits optionally @ end of string matches: $

ios - UIImageView+animatedGIF always LOOPS -

i used class made "mayoff" (rob mayoff) "uiimageview+animatedgif" proposed in 1 of answers here on stackoverflow. uiimageview+animatedgif with can import animated .gif images in uiimageview on ios. class works flawlessly, problem .gif looping. no matter how export (i exporting image photoshop - 67 frames, set repeat "once") loops forever in uiimageview. i importing .gif these 2 lines: nsurl *url = [[nsbundle mainbundle] urlforresource:@"loading" withextension:@"gif"]; self.loadingimageview.image = [uiimage animatedimagewithanimatedgifdata:[nsdata datawithcontentsofurl:url]]; very simple , works. have tried setting animationrepeatcount property 1, recomended rob didn't trick. have tried setting uiimageview's animationimages property gifimage.images too, instead of setting view's image property gifimage. in case, .gif not animating @ all. any ideas how play .gif once? can think of many tricks (like setting last f

c# - Substitution Cipher Letter Mappings Data Structure -

what data structure better stores following substitution-cipher letter mappings? abcdefghijklmnopqrstuvwxyz qpalzxmskwoeidjcnvbfhguryt i using 2 dictionaries, there must simpler: char[] alphabet = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; char[] mappings = {'q', 'p', 'a', 'l', 'z', 'x', 'm', 's', 'k', 'w', 'o', 'e', 'i', 'd', 'j', 'c', 'n', 'v', 'b', 'f', 'h', 'g

ios5 - iOS: How to programmatically navigate/jump to different scenes managed by Navigation Controller? -

i have series of views managed under navigation controller. there way programmatically (in ios5+) jump (push/pop) different views? instance, have navigationcontroller->rootviewcontroller->detailviewcontroller1->detailviewcontroller2->detailviewcontroller3 how can i, say, jump rootviewcontroller detailviewcontroller3, , jump detailviewcontroller1? thanks. you can try this. get vcs storyboard. (you have set identifiers in storyboard) uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; uiviewcontroller *detailviewcontroller1 = [storyboard instantiateviewcontrollerwithidentifier:@"detailviewcontroller1identifier"]; uiviewcontroller *detailviewcontroller3 = [storyboard instantiateviewcontrollerwithidentifier:@"detailviewcontroller3identifier"]; push vcs way need. [self.navigationcontroller pushviewcontroller:(detailviewcontroller1) animated:yes]; [self.navigationcontroller pushviewcon

c# - Dynamically Generated Dropdowns Postback -

i'm having trouble same dynamically generated dropdowns , viewstate. long story short, user upload excel file, file parsed , dropdowns created appropriate data. done on when asp button pressed, , controls added table follows: public void generatefromsheet(ordereddictionary columns, datatable oppcolumns, list<string> requireddrops) { int index = 0; foreach (dictionaryentry entry in columns) { dropdownlist ddl = new dropdownlist() { id = "ddlmapping" + entry.key.tostring(), datasource = columns, datatextfield = "key", datavaluefield = "value", selectedindex = index, enabled = requireddrops.contains(entry.key) ? false : true }; ddl.databind(); dropdownlist ddl2 = new dropdownlist() { id = "opportunitymappingddl" + index,

java - Divide and conquer matrix multiplication base case + how to split matrix into 4 quarters -

i've been trying code divide , conquer matrix multiplication algorithm there's problem when try divide matrix 4 quarters gives me error arrayoutofindexbound i'm not sure if i'm right base case, can me out guys? the problem @ double[][] a21 public static double[][] divideandconquer(double[][] , double[][] b, int dimension){ if (a.length == 1){ double[][] result = new double[1][1]; result[0][0]= a[0][0]*b[0][0]; return result; } else { int m = dimension/2; double[][] a11 = new double[m][m]; for(int = 0; < m ; i++){ (int j = 0 ; j< m ; j++) a11[i][j]= a[i][j]; } double[][] a21 = new double[m][m]; for(int = m; < dimension; i++){ (int j = 0 ; j< m ; j++) a21[i][j]= a[i][j]; } double[][] a12 = new double[m][m]; for(int = 0; < m ; i++){ (int j = m ; j< dimension ; j++) a12[i][j]= a[i][j]; } doub

javascript - selecting an optimal span -

this pure programming question. have array of words. words have pauses after them various length (mostly zero). each word has certainty score. want select optimal span of words lookahead window. the lower overall certainty better (or lower 33th percentile of certainty better). the longer pauses on edges better (with hard minimum). there optimum length (like 5 seconds). closer better. there hard limits on mimimum , maximum length. nota bene, in javascript, cannot afford using support vector machines s or like. :-) performance thoughts, calculated maybe every minute on window of 2-minute length (250 words or so). second nota bene interested: select span of words generated automatic speech recognition manual transcription (active learning). how approach this? a night's sleep brought light on issue. there's little magic needed. since number of candidate spans quite limited (in worst case square of number of words in window -- 250^2), can evaluate fitness of

mysql - Are the entity_ids supposed to be incremental in the customer_entity table in Magento? What would cause a jump? -

i noticed there periodic jumps in customer number assignment via end of magento , wondered might cause this? they supposed incremental. guess depends on how big jumps , if customers being deleted. there other underlying causes related lockwait issues or extension not saving customers correctly. sounds more data being deleted.

java - DataInputStream.readInt() returns EOFException even if there is still data -

i having lots of trouble reading custom file in java. custom file format consists of called "magic" byte array, file format version , gzipped json-string. writing file works charm - reading on other side works not intended. eofexception gets thrown when trying read following data length. i checked produced file hex editor, data gets saved correctly. seems go wrong while datainputstream tries read file. the read file code: datainputstream in = new datainputstream(new fileinputstream(file)); // check file header byte[] b = new byte[magic.length]; in.read(b); if (!arrays.equals(b, magic)) { throw new ioexception("invalid file format!"); } short v = in.readshort(); if (v != version) { throw new ioexception("old file version!"); } // read data int length = in.readint(); // <----- throws eofexception byte[] data = new byte[length]; in.read(data, 0, length); // decompress gzip data bytearrayinputstream bytes = new bytearrayinputstream

c++ iterative combination function not working -

i have homework problem asking write iterative , recursive combination function. place them in given program see takes longer. i having problem iterative function. have gone on several times , keep getting mach-o-linker error. have tried identifying variables many different ways , still haven't come luck. any on topic appreciated. think there problem iterator function or possibly factorial function, unable see life of me right now. thanks again ahead of time #include <iostream> #include <sys/time.h> #include <cstdlib> using std::cout; using std::endl; double ir; double in; typedef unsigned int uint; uint factorial(uint n) { if (n == 0) return 1; if (n <= 2) return n; else return n * factorial(n - 1); } double combination_recursive(double in, double ir); double combination_iterative(int in, int ir); int main(int argc, const char * argv[]) { typedef struct timeval time; time stop, start; gettimeofday(&start, null); in

SQL: Multiple Foreign Keys for Inheritance -

i have few tables in database , have quick question regarding foreign keys. tables company pk: companyid manufacturer pk, fk: companyid make/model pk: makemodelid fk: manufacturerid equipment pk: equipmentid fk: makemodelid would proper include manufacturerid column fk manufacturer in equipment table? , smart create index on both manufacturerid , makemodelid in equipment table? i'm self taught , seeking design input. thanks. no, not proper include fk manufacturer table in equipment table. the equipment table has fk make/model table has fk manufacturer table. if created fk, technically record in equipment table linked 2 different manufacturers.

How Do I Retrieve Content Specific Content Using PHP and MySQL -

i brand new php , mysql. watched lynda.com tutorial entitled "php mysql essential training". followed along , converted static site dynamic cms. tutorial showed how insert content database, text. after course, left wondering following--"how specific content render? example, have static page called "websites". page contains couple divs screenshot images of websites i've developed , images linked sites. when created page in database added regular text content database. how html render contains specific content associated page? write sql insert statement database inserting html? i'd appreciate guidance. thanks, chris you need write query, yes. see mysql manual entry select statements . select use fetch data database, insert used when need put data inside.

css - Freeze screen in chrome debugger / DevTools panel for popover inspection? -

i'm using chrome inspector try , analyze z-index of twitter bootstrap popover, , finding extremely frustrating... is there way freeze popover (while shown) can assess , modify associated css? placing fixed 'hover' on associated link not cause popover appear. got working. here procedure: browse desired page open dev console - f12 on windows/linux or option + ⌘ + j on osx select sources tab in chrome inspector in web browser window, hover on desired element initiate popover hit f8 on windows/linux (or fn + f8 on osx) while popover showing. if have clicked anywhere on actual page f8 nothing. last click needs somewhere in inspector, sources tab go elements tab in inspector find popover (it nested in trigger element's html) have fun modifying css

asp.net mvc - .mdf file not able to attach at runtime MVC4 -

error: cannot attach file 'c:\users\dboyle\desktop\new folder (2)\oilngasweb\oilngasweb\app_data\aspnet-mvcapplication4-20130726115749.mdf' database 'aspnet-mvcapplication4-20130726115749'. * this error occured after deleting web.config file * ( replacing new 1 new project , replacing default conection string needed) edit: sofar have tried deleting .mdf physical file , vs, sql. re-running update package manager within vs. database gets made, yet same error persists. i have found <objectgroup name="defaultconnection" order="1" enabled="false"> <destination path="data source=ane-sql\anesqlserver;initial catalog=oilgas;user id=software;password=glvp$102" /> <object type="dbcodefirst"> <source path="dbmigration" dbcontext="oilngasweb.models.oilngasdb, oilngasweb" migrationconfiguration="oilngasweb.migrations.configuration, oilngasweb

objective c - Importing libPusher in iOS app -

i creating app makes use of pusher in order send packages app thing controlling. ran problem importing libpusher.h class. i followed of instructions here--> http://pusher.com/docs/ios_quick_start yet put in #import @ top of file, still error saying " 'libpusher/libpusher.h' file not found" can not find libpusher.h file in libpusher folder. there problem files downloaded library or doing else wrong? in advance. just encountered myself. i'm wondering if perhaps cocoapods version of pusher behind? anyway, quick @ github shows contained in "libpusher/libpusher.h" these 4 lines #import <libpusher/ptpusher.h> #import <libpusher/ptpusherchannel.h> #import <libpusher/ptpusherevent.h> #import <libpusher/ptpusherapi.h> including these throw " #import <libpusher/libpusher.h> " should work same.

android - How to move to a new activity after the finishing the quiz? -

i'm making android quiz app , seems it's done except adding questions there still big error. see i've put random generater generates 4 questions. when answer fourth new activity starts display of score. instead app doesn't respond. i'm clueless. thank you! package com.matej.hajdukkviz; import java.util.arraylist; import java.util.collections; import java.util.list; import java.util.random; import android.os.bundle; import android.app.activity; import android.graphics.color; import android.view.view; import android.view.window; import android.view.windowmanager; import android.view.view.onclicklistener; import android.widget.button; import android.widget.textview; public class glavno extends activity implements onclicklistener { int score = 0; textview textview1, textview2, textview3, countdown; button btn1, btn2, btn3, btn4; arraylist<question> qsts = new arraylist<question>(); list<integer> generated = new arraylist<integer>();

java - JScrollPane increases its size -

i have panel divided 2 parts boxlayout.x_axis : public tabspanel() { setlayout(new boxlayout(this, boxlayout.x_axis)); add(createleftpanel()); add(createrightpanel()); } each left , right panels have following structure: outer panel borderlayout , , inner panel in borderlayout.center of outer panel, in turn has boxlayout.y_axis , several components top bottom. right panel has jtextarea jscrollpane 1 of components: protected jpanel createrightpanel() { jpanel pane = new jpanel(); pane.setlayout(new borderlayout()); jpanel panel = new jpanel(); panel.setlayout(new boxlayout(panel, boxlayout.y_axis)); jtextarea label = createlabel(); jscrollpane scroll = new jscrollpane(label); scroll.setmaximumsize(new dimension(500, 200)); panel.add(box.createrigidarea(new dimension(0,106))); panel.add(scroll); jpanel panel_buttons = new jpanel(); panel_buttons.setlayout(new