Posts

Showing posts from August, 2014

c# - Dynamically added TextBoxes empty on button click -

i'm adding textboxes dynamically , when click submit button , have postback, can't see values entered textboxes, coming emtpy. here's .aspx page...\ form id="form1" runat="server"> <asp:placeholder id="phformcontent" runat="server"> </asp:placeholder> <br /><br /> <asp:button id="btnaddform" runat="server" text="add form" onclick="btnaddform_click" /> <asp:button id="btnsubmitforms" runat="server" text="submit forms" onclick="btnsubmit_click" /> </form> ...here's how add textboxes form on clicking btnaddform... protected void btnaddform_click(object sender, eventargs e) { // create labels label lblname = new label(); lblname.text = "name:"; label lblnumber = new label(); lblnum

python - time.time vs. timeit.timeit -

sometimes, time how long takes parts of code run. i've checked lot of online sites , have seen, @ large, 2 main ways this. 1 using time.time , other using timeit.timeit . so, wrote simple script compare two: from timeit import timeit time import time start = time() in range(100): print('abc') print(time()-start, timeit("for in range(100): print('abc')", number=1)) basically, times how long takes print "abc" 100 times in for-loop. number on left results time.time , number on right timeit.timeit : # first run 0.0 0.012654680972022981 # second run 0.031000137329101562 0.012747430190149865 # run 0.0 0.011262325239660349 # run 0.016000032424926758 0.012740166697164025 # run 0.016000032424926758 0.0440628627381413 as can see, sometimes, time.time faster , it's slower. better way (more accurate)? timeit more accurate, 3 reasons: it repeats tests many times eliminate influence of other tasks on machine, such disk flus

java - Netty 4.0 IdleStateHandler not working correctly -

edit: works correctly. problem entirely on side. can used working example. i'm trying implement idlestatehandler netty 4.0.9 in server. problem i'm getting doesn't fire idlestateevent. to test i'm making client "crash" did oio (and worked intended in case). i'm sure have no blocking anywhere, works fine (including normal closing connection request client). here code... pipeline public pipelineinitializer(){ super(); } @override protected void initchannel(socketchannel ch) throws exception { // idle handlers ch.pipeline().addlast("idlechecker", new idlestatehandler(15,0,0)); ch.pipeline().addlast("idledisconnecter", new idledisconnecter()); // decoding handlers ch.pipeline().addlast("framer", new delimiterbasedframedecoder(integer.max_value, delimiters.linedelimiter())); ch.pipeline().addlast("decoder", str_decoder); // encoding handlers ch.pipeline().addlast("

php - cURL & Looping Through an Array -

i'm attempting create script cycle through array contain various file names use of curl & '404' error detection. in other words, if initial defaulted file name comes '404', create loop function cycle through array while still running through same curl session. , when detects status '200', stops loop & proceeds next value sent client. i've tried using foreach(), haven't had success. code i'm using start. <?php if (isset($_post['request'])) { $req = $_post['request']; $url = $addr; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_nobody, true); curl_exec($ch); if (curl_getinfo($ch, curlinfo_http_code) == '200') { echo $url; } curl_close($ch); } ?> if (isset($_post['request'])) { $req = $_post['request']; $url = $addr; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlop

gorm - Grails addTo* with result of database -

why code not work fine? def classeinstrumento = classeinstrumentoservice.getclasseinstrumento("value") def instrumentoinstance = new instrumento().addtoclasseinstrumento(classeinstrumento) i receive error message on console: no signature of method: package.instrumento.addtoclasseinstrumento() applicable argument types: (package.classeinstrumento) values: [package.classeinstrumento : 5] and domains structure class classeinstrumento { static hasmany = instrumentos: instrumento } class instrumento { classeinstrumento idclasseinstrumento static hasmany = [ativodefs: ativodef, futurodefs: futurodef, operacaodefs: operacaodef] static belongsto = [classeinstrumento] } so expected worked, didn't :( thanks replies! instrumento belongsto classeinstrumento . which means classeinstrumento parent , instrumento child of classeinstrumento (signified hasmany in classeinstrumento ) addto*

jsf - h:outputScript with target="head" not working with Primefaces 3.5 -

i have jsf application scripts inserted using target="head" attribute, after including primefaces 3.5 classpath, these scripts stop rendering. here page code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> </h:head> <h:body> <h:outputscript target="head"> function a(){}; </h:outputscript> </h:body> </html> removing target attribute renders script ok, in body, not in head... any clues? & regards. since primefaces 3.0, there new headrenderer allows customizable resource ordering. see this blog . has overriden standard jsf head rende

Median of Medians -

i have read order statistics find k-th smallest (or largest) element in array of size n in linear time o(n). there 1 step needs find median of medians. split array [n/5] parts. each part has 5 elements. find median in each part. (we have [n/5] numbers now) repeat step 1 , 2 until have last number. (i.e. recursive) t(n) = t(n/5) + o(n) , can t(n) = o(n). but, true that, number not median of medians, median of medians of medians of medians of medians of medians, if have large array. please consider array has 125 elements. first, split 25 parts , find 25 medians. then, split these 25 numbers 5 parts , find 5 medians, finally, obtain number median of medians of medians. (not median of medians) the reason why care that, can understand there @ [3/4]*n elements smaller (or larger) median of medians. if not median of medians median of medians of medians? in worse case there must less elements smaller (or larger) pivot, means pivot closer bound of array. if have large ar

javascript - How to find "title" of multi-dimensional array where value was found? -

i'm trying "title" of nested array matched date found...but no avail. if date found in array, should alert "true". date has match or within date range. when found, i'd "title" of nested array found match. (ie. date "10/29/2013" found match under "person 2". i'd title well. i'm looping through both nested arrays check match on date. eventually, they'll lot more people , times. note, no time show twice within array. used display available during time on webpage. while database better route go, sitting on mainframe , not tied db2. if there easier way of going that, i'm ears well. var data = [] var data = [ {title:'person 1',contents:[ {primary:"7/09/2013"},{primary:"7/22/2013"},{primary:"10/15/2013"},{primary:"10/28/2013"},{primary:"1/21/2014"},{primary:"2/03/2014"}]}, {title:'person 2',contents:[ {primary

mysql - Overcoming Extra Rows -

i have insert multiple columns different tables keep having same problem. the problem this: can insert column tablea.columna tableb.columna no problem. next need insert tablec.columna tableb.columnb , insert command adds rows change id's of data. my insert commands, plus update command executing id's match (unsuccessfully) below. i know insert command can add rows how passed id's match? i thought maybe columns had auto increment set not -- not seem problem. appreciated. (1) insert users_posts (author_id, post_id, post_title) select contents.user_id, contents.id, contents.title contents contents.id = id (2) insert users_posts (post_content) select content_bodies.content content_bodies content_bodies.id = id (3) update users_posts set post_content = (select content_bodies.content content_bodies content_bodies.id = users

python - manage.py throwing error "PostgreSQL with tsearch2 support is needed to use the pgsql FTS backend" -

first off, requisite "i'm quite new python" comment must made. some of environment details: - windows 7 - python 2.7 - django 1.3.4 - postgresql 9.2 i following error thrown when attempting run "manage.py syncdb". file "c:\python27\lib\site-packages\fts\backends\pgsql.py", line 46, in __init__ raise invalidftsbackenderror("postgresql tsearch2 support needed use pgsql fts backend") fts.backends.base.invalidftsbackenderror: postgresql tsearch2 support needed use pgsql fts backend i'm confused why error being thrown because have django-tsearch2 package installed (found here: https://github.com/hcarvalhoalves/django-tsearch2 ) any insight why i'm getting error? thanks time! it looks you're trying use older django version newer postgresql. full text search converted contrib module built-in feature in more recent postgresql versions. used tsearch2 extension, appears django looking for. for backward c

How do I build Boost.Build before compiling boost using MinGW on Windows 7? -

i'm running windows 7 enterprise sp1 , trying set c++ dev environment. installed mingw, , seems working on own. next, need install boost... seems option compile source. (i don't see official windows binaries. found several unofficial ones, tend several version behind current , isn't clear they're being maintained.) so download tarball, extract it, open msys shell mingw, go tools/build/v2 , run bootstrap.sh - fails, , bootstrap.log reads follows: ### ### using 'gcc' toolset. ### rm -rf bootstrap mkdir bootstrap gcc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.c pathunix.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modu

android - Create custom spinner in xml layout -

i want create custom spinner want re-use throughout app. hence, want create spinner xml layout file (i.e. /layout/custom_spinner.xml). have created drawable list <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/rocket_thrust1" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust2" android:duration="200" /> <item android:drawable="@drawable/rocket_thrust3" android:duration="200" /> </animation-list> now need know how place inside spinner. typical xml spinner looks this <progressbar android:id="@+id/spinner" style="?android:attr/progressbarstylelarge" android:layout_width="wrap_content" android:layout_height="wrap_content" a

uiviewcontroller - Changing UILabel with a button -

so, have popover can activated 4 viewcontrollers. inside popover, click on button , button changes 1 uilabel in viewcontroller activated popover. but, problem is: depending on viewcontroller actives popover, text different. my question: how can set 1 if clause know viewcontroller activated popover? here code changes uilabel, have implement if clause: - (void) escolheu1:(id)sender { [delegate menucontroller:self haspressedsomething: [nsstring stringwithformat:@"they panels composed odd numbers of layers, crossed each other in order obtain more strength."]]; } i guess gotta use iskindofclass method, maybe not, don't know. can guys help, please? thank you! well, have " sender " parameter being sent " escolheu1: " method (and while we're on subject, should declare " (ibaction) " , not " (void) "). and sender parameter, can determine button (in each of 4 view controllers) sent me

location - iOS - Determine User's country without using CLLocationManager -

i don't need precise location data, , don't want user see "this app wants determine location" alert. need determine user's country, assuming have internet connection via network or wi-fi. what best way this? there way use ip? this work if had carrier: cttelephonynetworkinfo *netinfo = [[cttelephonynetworkinfo alloc] init]; ctcarrier *carrier = [netinfo subscribercellularprovider]; nsstring *mcc = [carrier mobilecountrycode]; and nslocale not reliable in user can change in device settings. can't use device's language setting same reason. need country based on physically located. you user's ip address , use geolocation database guess location based on described here: https://en.wikipedia.org/wiki/ip_address_location . if concerned region, can find data @ regional internet registries ( https://en.wikipedia.org/wiki/regional_internet_registry ) websites you, since control ip addresses particular region.

override - Listening for when a method is called in a class, and then possibly overriding it (java) -

so, let's have 2 classes, foo1 , foo2, in separate library. foo2 class instantiated, , cannot correctly reinstintate subclass override method in foo2. is there way can listen method called in foo2, , possibly cancel execution of said method, , there create method. understand if i"m saying confusing, can :). class foo{ void x(){ if (foo2.x2().called){ //do stuff } } } class foo2{ void x2(){ //stuff done here... } } obviously, above code won't anything, simple example of looking for. if can't somehow subclass foo2 or modify existing lib (in worst case decompile/modify/recompile) use aspectj intercept calls. you'd want use load-time weaving purpose. check out general documentation load-time weaving here: http://www.eclipse.org/aspectj/doc/next/devguide/ltw.html . it's involved procedure add/configure aspectj though i'd recommend last resort

Use annotations to set test parameters on Java -

i'll start saying 1 of things don't understand java annotations. i come python background tend think of annotations modifiers on methods potentially (like decorators on python). now, have problem that, in terms of syntax, nice if solved using annotations, don't know if can done. basically, have different versions of api: v1, v2, v3, v4. , have junit4 tests each of versions. apiv1test.java @test public void featurex() { connection conn = new apiconnection("v1"); response = conn.request("x", "foo")'; assertequals("bar", response); } @test public void featurey() { connection conn = new apiconnection("v1"); response = conn.request("y", "foo_y")'; assertequals("bar_y", response); } apiv2test.java @test public void featurex() { connection conn = new apiconnection("v2"); response = conn.request("x", "foo")'; assertequals(&qu

How to POST multiple Variable in JavaScript inside PHP? -

i trying pass multiple variable using javascript , php, not being able that. echo "<a href=javascript:popcontact('btsdetails.php?uid=" . $row["bs_id_site"] . "&sid=" . substr($row['bs_id'], -1) . "')>" . $row['bs_id'] . "</a>"; therefore, trying post "uid" , "sid" using & sign, not working. accepting "uid". can me solve problem? here answer: <script type="text/javascript"> function popcontact(uid, sid){ window.location = "btsdetails.php?uid="+uid+"&sid="+sid; } </script> <a href="#" onclick="popcontact(<?php echo $row["bs_id_site"]; ?>, <?php echo substr($row['bs_id'], -1); ?>)"><?php echo $row['bs_id']; ?></a>

python - Selecting a value based on what range the value falls under -

i have problem dont know how solve. have julian day number (integer) , distance value (float) , have number julian day of interest (integer). want take actual julian day , fit julian day ranges (i.e julian day 1-14) can determine distance value specific julian day. julian day 10, fits in julian day range or 1 - 14, making distance = 0.9832. on appreciated. ve tried far use if else dont think work @ all. ideas welcome. (let me know if not clear m trying do!) julian day distance 1 0.9832 15 0.9836 32 0.9878 46 0.9878 60 99.0900 assuming you're expecting performance across multiple lookups, you're trying can achieved using binary search algorithm . in fact, searching "binary search" found a similar question . if performance isn't issue, simple loop through day-distances work. either way, i'd start of putting day-distances sequential data structure: day_

html - Javascript function not called when id and function name same -

i want know effect of id , function when both same. example: <tr> <td><img id='deleteauthor' onclick='javascript: deleteauthor(this)' src='images/close.png' /></td></tr>"; function deleteauthor(element){ alert(element); } output:typeerror: deleteauthor not function [break on error] <tr> <td><img id='deleteauthorbt' onclick='javascript: deleteauthor(this)' src='images/close.png' /></td></tr>"; function deleteauthor(element){ alert(element); } output:object htmlimageelement please why behave so? u have use different names id , function. same names both cause ambiguity

angularjs - Not able to run grunt-karma from jenkins -

i using grunt-karma launch angular unit test .when preform task on command prompt working fine when configure same jenkins not able open firefox window .can tell me issue .below config files --karma config basepath = '../'; files = [ mocha, mocha_adapter, 'test/lib/angular/chai.js', 'scripts/angular.js', 'scripts/angular-*.js', 'test/lib/angular/angular-mocks.js', 'scripts/controllerfortest.js', 'scripts/controllerfortestmodule.js', 'scripts/logloader.js', 'scripts/app.js', 'test/unit/**/*.js' ]; autowatch = false; singlerun = true; browsers = ['firefox']; junitreporter = { outputfile: 'test_out/unit.xml', suite: 'unit' }; grunt task -- karma: { unit: { configfile: 'config/karma.conf.js' } }, jenkins log -- e:\medicineshopinvetory\medicineshopinventory\medicineshopinventory>grunt

php - Switch case only displaying the first key in an array -

good afternoon, what i'm trying accomplish script program returns 3 relevant links based on selected areas of interest. on first page form use <input type="checkbox"> name attribute set interests[] store users selections in array. code block after jump form processing script echoes out links if form validates. i'm running trouble switch case function displaylinks(); displaying interests[0] after form processed though print_r shows array ( [0] => web development [1] => startups [2] => video games ) if multiple interests selected 1 in first position of array displayed. ideas? //success condition:: name interests if($_post["fullname"] != "" && (isset($_post['interests']))) { echo '<div class="interests">'; displaylinks();//links displayed when form validates echo '<a href="/exercise1">return start.</a>'; echo '</div>'

Batch loop for a duration of time -

i have batch file infinitely runs set of commands using goto label. turn loop runs predetermined number of minutes. best way under windows xp , up? parse time variable @ beginning , add desired minutes. need cheack in each loop if stop time reached. set "starttime=%time%" split time hour, minutes, seconds add desired minutes regarding overflows hour field. begin loop parse current time check if hours , minutes reached else restart loop

javascript - bug ScrollTop on Safari ipad -

i responsive website bootstrap anchor html in navigation. in nav bar have logo , when user click on , site scroll top. , works in desktop. in ipad safari when click logo scroll top , working once. , nav bar anchor bug after that. how fix that? my code : $(document).ready(function(){ $('.brand').bind('click',function(){ $('html,body').animate({scrolltop: 0}, 'normal'); }); }); update try "on" bind method as of jquery 1.7+ better approach use "on" method not bind. $(document).ready(function() { $(".brand").on("click", function () { $('body').animate({scrolltop: 0}, 'normal'); alert('image clicked') }); }); thanks ab

javascript - Mouse events not triggered after several clicks on element -

Image
i trying detect start/drop drags events on element. these events seem not triggered. source on jsfiddle . try holding down mouse in orange bar , dragging create intervals (in blue). in chrome, try 3 times. on 3rd time, notice always, mouseup event not triggered, making effect weird. when mouse not pressed, drag event still triggered video on screenr $ -> ismousedown = false isdragging = false $draggedinterval = undefined $test = $("#test") $test # code related attaching handlers trigger custom events .on "mousedown", -> ismousedown = true .on "mouseup", (evt) -> ismousedown = false if isdragging $test.trigger("x-stopdrag", evt) isdragging = false else $test.trigger("x-click", evt) .on "mousemove", (evt) -> console.log ismousedown, isdragging

r - Gene Set Enrichment Analysis -

i have used cummerbund function findsimilar() find 10 similar genes differentially expressed genes identified using cuffdiff. used jensen-shannon distance , produced ranked ordered gene list want test go enrichment. file looks this: "xloc_007917" 0 "xloc_008881" 0.00417099861122699 "xloc_017692" 0.0178758082512721 "xloc_008901" 0.0180682577435933 "xloc_014267" 0.0333227735282459 "xloc_013408" 0.0400392521794019 "xloc_013497" 0.0412541820119971 "xloc_010554" 0.0453928603025379 "xloc_000570" 0.0461264880687295 "xloc_010786" 0.0469577467848723 i first searched manually go terms each of similar genes i'd more robust analysis. trying run gsea, java application broad institute. i made ranked list file format (*.rnk) , have choose gene set database. i working on sponge species can't use database provided. how can create own gene sets database? should like?

Use excel cell in SQL query string (function) -

i want import data mssql database excel spreadsheet. works fine parameters. want use cell value in function query: example: select round(dbo.fn_geteffort(3484, 'project', 0, 1)/8,2) i want use cell value 3484! any idea? you mean value '3484' in cell , want include in query string? then: s = "select round(dbo.fn_geteffort(" & sheet.cells(rownumber, columnnumber) & ", 'project', 0, 1)/8,2)" or: s = "select round(dbo.fn_geteffort(" & sheet.range("a1").value & ", 'project', 0, 1)/8,2)"

python - OpenCv: cv2.HoughCircles inconsistent behavior -

Image
i testing cv2.houghcircles() ( opencv version 2.4.9 ) on simple image following parameters: cv2.cv.cv_hough_gradient, dp=1.7, mindist=180, minradius=55. i got 2 circles: 1 of radius 87.4696 , other 80.4787. then on same image, used again function same set of parameters time adding maxradius = 100 (which shouldn't matter in case since 2 detected circles having radius < 100). as result got 1 detected circle radius of 84.6768. gives? anyone having clue on might go wrong here? original image:

symfony annotations validation override entities/models -

i'm trying override entities validatation of forum bundle. this: category entity: //src/msd/forobundle/entity/category.php namespace msd\forobundle\entity; use herzult\bundle\forumbundle\entity\category basecategory; use doctrine\orm\mapping orm; /** * @orm\entity(repositoryclass="herzult\bundle\forumbundle\entity\categoryrepository") */ class category extends basecategory { } topic entity: //src/msd/forobundle/entity/topic.php namespace msd\forobundle\entity; use herzult\bundle\forumbundle\entity\topic basetopic; use doctrine\orm\mapping orm; use symfony\component\validator\constraints assert; /** * topic * * @orm\entity(repositoryclass="herzult\bundle\forumbundle\entity\topicrepository") * */ class topic extends basetopic { /** * @orm\manytoone(targetentity="category") */ protected $category; /** * @assert\notblank() * @assert\minlength(limit=4, message="just little short| ") * @assert\regex( * pattern="

php - $code .= mb_substr($this->charset, $rnum, 1,'UTF-8'); -

$code .= mb_substr($this->charset, $rnum, 1,'utf-8'); this code working in system, when i'm uploading onto server showing error. mbstring functions not enabled default, need compile php mbstring support (or install package has mbstring support). more info: http://es1.php.net/manual/en/mbstring.installation.php

Php remove html only tags -

it's seems quite simple - strip_tags($string); but repeat - html tags with use of strip tags example "this<thisthisthis" >> or $str = "you can write 'more' < sign" >> "you can write 'more' " or strip_tags("you know 5<8"); //cuts '8' and dont want it. i know basicly <everything> can tag in html, want remove default html tags so why don't use put tags want keep in string , call strip_tags $keep = '<a><div><span>'; $new_html = strip_tags($html, $keep);

c# - Is it possible to define an extension method on a generic type and return another generic type without defining two generic types in <> -

this question has answer here: generic methods in .net cannot have return types inferred. why? 5 answers is possible this: public static t convertto<t>(this tinput input) { and use: item.converttype<newobject>() or have this: public static tresult converttype<tinput, tresult>(this tinput input) { and use: item.converttype<originalobject, newobject>() it seems redundant have specify type extension method called on, missing something? no, basically. there few tricks can do, if important enough. you can like: var dest = item.convert().to<something>(); via like: static conversionstub<tinput> convert<tinput>(this tinput input) { return new conversionstub<tinput>(input); } where: struct conversionstub<t> { private readonly t input; public conversionstub(t input) { this.in

ios - Newsstand free subscription and Apple hosted content -

i working on newsstand app , plan on releasing soon. magazine issues hosted on apple servers via non-consumable in-app purchase products. understood in order pass apple store validation need set free or auto-renewable subscription product. concern is, how can link free subscription iap products? realise can't download these issues vie storekit api without purchasing them individually, making form of subscription useless?

android - base 64 png string to base 64 jpg using java or javascript -

i'm working on project developed in android phonegap , need draw items on screen , turn data pdf. to draw using html5 canvas element. to write pdf using library "jspdf." the problem that, on android, method canvas.todataurl ('image / jpeg') returns string of "image/png" type jspdf library reads images in base64-jpg format. i thought of 2 solutions: 1) use sort of "javascript encoder", found on internet, not find active link, transform canvas in base64-jpg format string. 2) create plugin "translate" base64-png string base64-jpg format. so....is there way in javascript or java make "translation"? or know way realize have explained? try one: http://web.archive.org/web/20120830003356/http://www.bytestrom.eu/blog/2009/1120a_jpeg_encoder_for_javascript after download jpegencoder insert code: var encoder = new jpegencoder(); var imagedata = encoder.encode(canvas.getcontext('2d').getimageda

internet explorer 8 - Easy Pie Chart IE8 -

is there option of getting pir chart: http://rendro.github.io/easy-pie-chart/ working in ie8? written goes, can't work. thanks! in version 2.0.0 you'll find demo ie7 , 8. tested on windows vm , worked. you need add excanvas , javascript polyfill function.bind in javascript.

mysql - How to: log and anlyze clicks, pageviews and sessions to optimize conversion -

we have medium size e-commerce site. sell books. on said site have promotions, user recommendations, regular book pages, related books, etcetera. quite similar amazon.com except ofcourse volume of site. we have traditional lamp setup, m still stands mariadb. tptb want log , analyze user behaviour in order optimize conversion. bottom line, each click has logged, think. (i fear) this add few million clicks every month. system has able go in time @ least 3 years. questions might asked system are: given page (eg: homepage), , clicks on promotional banner, color of said banner gives best conversion. split question new , returning customers. (multi-dimensional or a/b-testing) or, given view of book , b, books users buy next. range of queries going wide. aggregating data pointless. i have serious doubts mysql's ability provide platform storing, analyzing , querying data. store rows, feeding them mysql via rabbitmq avoid delays, query , analyze data efficiently might not op

actionscript 3 - How to deal with multiple referencing of movieclips -

im looking both efficient , effective way create, control , delete movieclips in effective manner. have thought doing create controller class handle creation , deletion of movieclip using arrays , script... private static var enemyships:array = new array(); public static function addenemy(ship:movieclip):void { enemyships.push(ship); trace(enemyships.length); ship.id = enemyships.length - 1; globals._stage.addchild(ship); } public static function getenemy():array { return enemyships; } public static function removeenemy(i:int):void { var ep:explosionparticle; for(var j:int = 0; j < 150; j++) { ep = new explosionparticle(enemyships[i].x, enemyships[i].y); globals._stage.addchild(ep); } globals._stage.removechild(enemyships[i]); updatepositions(enemyships, i+1); enemyships.splice(i, 1); } private static function updat

Linux Bash Scripting: Declare var name from user or file input -

hi following. ./script.sh some.file.name.dat another.file.dat filename1=$(echo "$1"|cut -d '.' -f 1,2) filename2=$(echo "$2"|cut -d '.' -f 1,2) tempfile_"$1"=$(mktemp) tempfile_"$2"=$(mktemp) i know code isn't working. need create these temporary files , use them in loop later, in input files , save output in these temporary files later usage. create variable names dependent on name of input files. i googled lot , didn't found answers problem. i thank suggestions you cannot since bash doesn't allow dots in names of identifiers/variables. both of arguments $1 , $2 have dots (periods) in them , cannot used in variable names you're trying create i.e. tempfile_$1 see this page details.

ios - Can't get EAAccessoryDidConnectNotification after connection -

i can detect mfi compliant chip in list of bluetooth devices (from iphone 5c) once connection established not notification eaaccessorydidconnectnotification ... use demo eademo proposed apple. can me issue ? i have test showbluetoothaccessorypickerwithnamefilter , , btm: connection service 0x00000080 on device "brain_wt12_2" 00:07:80:99:ee:4c succeeded. so, why don't eaaccessorydidconnectnotification notifications? here code : - (void)viewdidload { [[eaaccessorymanager sharedaccessorymanager] showbluetoothaccessorypickerwithnamefilter:nil completion:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(_accessorydidconnect:) name:eaaccessorydidconnectnotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(_accessorydiddisconnect:) name:eaaccessorydiddisconnectnotification object:nil]; [[eaaccessorymanager sharedaccessorymanager] registerforlocalnotifications]; ...

iphone - Things to keep in mind for smooth transition from Version 1.0 to 2.0 on iOS -

i planning develop application. app quite big in size, planning go version 2.0 in few months after release of version 1.0. i know things should careful of front. that, when release version 2.0, things go smooth on both development side , user experience side. svn - copy first version , save in folder , make changes in version 2 folder. analyze , remove unused design assets (like .png, etc) reduce app size. if have backend apis in version 1 app, let's create new apis version 2 development. make sure have takes backup db before move version 1 production. you should not add new updates in version1 prod api in db table well.

Display directory and its all sub directories in treeview using jquery -

need display directory , sub directories in treeview using jquery . display name directory name/file name , on click of ite open file $.ajax({ url: "./files/", success: function (data) { $(data).each(function () { }, error: function (jqxhr, textstatus, errorthrown) { //alert("error"); alert(errorthrown); alert(jqxhr.responsetext); } }); the problem ihave itrate success values.

javascript - route and $scope variable in angularjs -

i having few problems codes, created module demoapp example, following: <html ng-app="demoapp"> <head> <title>customer - order example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> </head> <body> <div ng-view=""></div> <script type="text/javascript" src="libs/angular.min.js"></script> <script type="text/javascript" src="libs/angular-route.js"></script> <script type="text/javascript"> var demoapp = angular.module('demoapp', ['ngroute']); demoapp.config(function($routeprovider){ $routeprovider .when('/order', { controller: 'usercontr

Plone collection with own fields -

i know possible in plone create content types own fields. so, possible create collection fields? i'm not sure achieve, answer question: yes it's possible create collection based type own fields. if using dx based collection type of plone.app.contenttypes can extend it. have register own view template, takes care of new fields. of course possible create new content type. check collection fti of plone.app.contenttypes you need basic knowledge dexterity

WebStart Application is not working in Java 7 u45 -

my eclipse rcp application ( launched webstart (.jnlp)) crashes on startup while launching java 7 u45 (working fine in java6). i've added manifest: permissions: all-permissions codebase: * trusted-library: true this removed error dialog popup. still have startup issue. see following messages (missing application-library-allowable-codebase) in java console while downloading many jarfs/plugins security: javaws apppolicy permission requested for: http://vspdlpd05.atldev.com/pdteller-v73allyusdev2ix/app/plugins/j2ee_1.6.0.jar ruleset: finding deployment rule set title: profile direct teller wrappering feature location: http:vspdlpd05.atldev.com/pdteller-v73allyusdev2ix/app/features/com.fnis.ally.teller.wrapper_2.0.0.jnlp jar location: vspdlpd05.atldev.com/pdteller-v73allyusdev2ix/app/plugins/j2ee_1.6.0.jar jar version: null isartifact: true ruleset: no rule applies, returning default rule network: created version id: 1.7.0.51 networ

python - Django - How to use custom template tag with 'if' and 'else' checks? -

this question has answer here: if..else custom template tag 2 answers i have made custom template tag permissions using python: register = template.library() @register.simple_tag def get_user_perm(request, perm): try: obj = profile.objects.get(user=request.user) obj_perms = obj.permission_tags.all() flag = false p in obj_perms: if perm.lower() == p.codename.lower(): flag = true return flag return flag except exception e: return "" then loaded , used in template this: {% load usr_perm %} {% get_user_perm request "add_users" %} which in return prints true. want use check if user has permission or not? how can use template tag if , else conditions? using this: {% if get_user_perm request "add_users" %}can add user{% else %} perm

vb.net - Comparing xml Attribute with String finds no match -

how can compare these 2 correctly if xanswer.@state = "error" , xanswer.@errormsg = **"der wert darf nicht null sein.& #xd;&#xa;parametername: xmlstruct (attributes country)"** < response state="error" errormsg="der wert darf nicht null sein.&#xd;&#xa;parametername: xmlstruct (attributes country)" xmlns=""></response > i believe doesnt jump if path because of & #xd;&#xa in xml attribute. means in xml attribute different in string. can approve this? tried replace & #xd;&#xa in string & vbcrlf & but didn't work if xanswer.@state = "error" , xanswer.@errormsg = "der wert darf nicht null sein." , xanswer.errormsg.@parametername = " xmlstruct (attributes country)" and if xanswer.@state = "error" , xanswer.@errormsg = "der wert darf nicht null sein." , xanswer.@errormsg = "parametername: xmlstruct (attributes c

mysql php handling no data after select -

i know how handle no data or error code 1329 after executing query. $stmt = $this->db->prepare('select username users device_id=?'); $stmt->bind_param("s", $device_id); $flag = $stmt->execute(); $stmt->bind_result($username); i'm expecting code come through since executes, flag true. i suggest doing this: $stmt = $this->db->prepare('select username users device_id=?'); $stmt->bind_param("s", $device_id); $stmt->execute(); $stmt->bind_result($username); if($stmt->fetch()) { echo "found $username"; } else { echo "did not find user"; } $stmt->close();

java - How to query the scheduled jobs from Quartz scheduler? -

i have scheduler object in application , add job s using schedulejob method. in code schedule job s instant trigger : triggerbuilder.newtrigger().startnow().build(); my question how tell job s scheduled scheduler ? there getcurrentlyexecutingjobs method seems unreliable far. the below code list quartz job associated scheduler (quartz 2.x.x) for (string groupname : scheduler.getjobgroupnames()) { (jobkey jobkey : scheduler.getjobkeys(groupmatcher.jobgroupequals(groupname))) { string jobname = jobkey.getname(); string jobgroup = jobkey.getgroup(); //get job's trigger list<trigger> triggers = (list<trigger>) scheduler.gettriggersofjob(jobkey); date nextfiretime = triggers.get(0).getnextfiretime(); system.out.println("[jobname] : " + jobname + " [groupname] : " + jobgroup + " - " + nextfiretime); } }

Write something over an image html -

how write text photo? <a href="/"><img src"photo.png" />text</a> i have css position absolute , relative? know works position absolute , relative way , how best way? if way position absolute , relative, position relative must main photo , position absolute content(text) ? you can <img src="http://upload.wikimedia.org/wikipedia/commons/5/5a/smirc-hi.svg" /><div style="position:relative; left:120px;top:-150px">text</div> for demo http://jsfiddle.net/5csej/

2 decimals in JavaScript with out regular expression and without rounding the numbers -

this question has answer here: format number show 2 decimal places 21 answers round @ 2 decimal places (only if necessary) 39 answers can give me code accepting 2 decimals using javascript. without regular expression , without jquery . number should not round. to fixed use tofixed(2); doing that var num = 2.4; alert(num.tofixed(2)); alert 2.40

python 2.7 - how to install scrapy on ubuntu? -

i know intall scrapy should install w3lib first,so install w3lib firstly,but when import scrapy in python ide,the program crashed. error: creating twisted.egg-info writing requirements twisted.egg-info\requires.txt writing twisted.egg-info\pkg-info writing top-level names twisted.egg-info\top_level.txt writing dependency_links twisted.egg-info\dependency_links.txt writing manifest file 'twisted.egg-info\sources.txt' warning: manifest_maker: standard file '-c' not found reading manifest file 'twisted.egg-info\sources.txt' writing manifest file 'twisted.egg-info\sources.txt' copying twisted\internet\_sigchld.c -> build\lib.win-amd64-2.7\twisted\internet creating build\lib.win-amd64-2.7\twisted\internet\iocpreactor\iocpsupport copying twisted\internet/iocpreactor/iocpsupport\iocpsupport.c -> build\lib.win-amd64-2.7\twisted\internet/iocpreactor/i ocpsupport copying twisted\internet/iocpreactor/iocpsupport\winsock_pointers.c -> bu

javascript - row open on onclick event which is initially hidden -

i want open row on onclick event when particular link clicked. having number of row each row below having hidden row, when click row below row display. code: <script> function toggle(number) { alert("toggle function called"+number); var simnum = number; if (document.getelementbyid(simnum).style.display = 'none') { document.getelementbyid(${dlist.simnumber}).style.display = ''; } else { document.getelementbyid(${dlist.simnumber}).style.display = 'none'; } } </script> <tr> <td></td> <td>${dlist.deviceaccount}</td> <td>${dlist.vehicleid}</td> <td><a href="#" onclick="toggle(${dlist.simnumber});">${dlist.simnumber}</a></td>

C compiler not found, Ubuntu -

i'm trying install wine on 64bits, followed : http://wiki.winehq.org/wineon64bit and when launch configure, have error : "configure: error: no acceptable c compiler found in $path" but whereis gcc says: "gcc: /usr/lib/gcc" what shoud now? run command: sudo apt-get install build-essential

r - Count missing values after first recorded measurement -

i have environmental data missing values. measurement of of these variables started @ different years. with script “sapply(df, function(x) sum(is.na(x)))" number of missing values each column. wish count missing values time point when @ least 1 measurement available. example o3 missing values should 3 time measurement of o3 started. n addition want extract first date when measurement available(example temp on 01-03-1990 , 03 on 09-03-1990). in short wish is: 1. extract first date of available measurement each column. 2. count number of missing values after @ least 1 measurement available. sample data follows > dput(df) structure(list(date = structure(c(7364, 7365, 7366, 7367, 7368, 7369, 7370, 7371, 7372, 7373, 7374, 7375, 7376, 7377, 7378, 7379, 7380, 7381, 7382, 7383, 7384), class = "date"), no2 = c(51.7008334795634, 33.8999998569489, 29.7854166030884, 29.0558333396912, 28.5108333031336, 31.9637500842412, 36.1283330917358, 24.6608331998189,