Posts

Showing posts from January, 2014

jQuery .toggle() button only toggles every other element -

my code generates different elements on click of 1 button. 1 of elements generated buttons want toggle on , off parts of text generated. jquery .toggle() function works first element generated. works latest element generated , every other 1 before (say, 5 elements generated, work on 5, 3, 1 not 2 , 4). seems issue class, think, because can, web console in firefox use .toggle() command manually remove it. guess mean button not triggering. @ loss. here jsfiddle showing behaviour http://jsfiddle.net/jalbr/1/ here code: recursioncounter = 0 $(document).ready(function(){ $("#compute").click(function(){ //add toggle data $("#buttons").append("<input type=button value=\"toggle\" class=\"removebtn\" id=\"recursion" + recursioncounter + "\">") //add recursion counter div element $("#recursion" + recursioncounter).data("recurs", recursioncounter) //make new section togg

forms - Setting the label next to a textbos without using tables HTML\CSS -

i doing website personal use. need assistant on how set text-box next label without using tables. in own division tags <div id="outter"> <div class="1"> fill out , submit form below , contact a.s.a.p. </div> <div class="2"> <label> name: </label> </div> <div class="2"> <input name="name" type="text" class="3" > </div> </div> trying this: [input box 1] label 1 [input box 2] label 2 here link better details http://homework.genesee.edu/~dmead1/forms/table.html very simple solution of problem html <fieldset class="login"> <legend>fill out , submit form below , contact a.s.a.p. </legend> <div><label for="name">name</label> <input type="text" id="name" name="na

sencha touch - Interaction between two or more charts in ExtJS -

i have 2 charts in 1 container, 1 bar column chart , radar chart. want make interaction between charts, when click on 1 of column of barcolumn chart radar show changes. made charts using extjs mvc. think have make function calls controller.. here controller.. ext.define('gamma.controller.controlfile', { extend : 'ext.app.controller', //define stores stores : ['barcolumn','radarview','voicecallstore','smscallstore','mmscallstore','gprsusagestore'], //define models models : ['barcol','radar','voicecallmodel','smscallmodel','mmscallmodel','gprsusagemodel'], //define views views : ['barcolumnchart','linechart','radarchart','voicepie','smspie','mmspie','gprspie'], refs:[{ ref:'radarchart', selector:'radar' }], init : function() { } }) please 1 me.... i think link looking th

Django Signals: How to signal for first entry in table -

i creating django applications(applications in django terminology) 1st application inserts data in table , 2nd application picks 1 item table, processes , remove table. continues until entries processed. when entries processed stops. start again when new entry made. consumer-producer problem. how can use django signals start 2nd application when first entry made table? solution problem django-celery mentioned in comment. django-celery provides task queue , process tasks without blocking request. while inserting new item if producer finds table empty, signals consumer post_save method , handler start task , stops when finished.

mysql - How to get near value from range in php -

how find nearest value mysql database table of give value, want is: case1: if giving input 2500 pincode retrieving record corresponding pincode value database. case2: if record not exits entered pincode(2500) , have nearest value of 2500 , corresponding records too. stored procedure calling case1 sp_findlocation('xxxxxxxx','2500',@addresss) delimiter $$ use `test`$$ drop procedure if exists `sp_findlocation`$$ create procedure `sp_findlocation`(in mobile varchar(20),in pincode varchar(20),out address varchar(100)) begin if(pincode not null , pincode!= '') set @c1 = ''; set @c2 = ''; set @c3 = ''; set @qry='select locality,store_name,contact_number @c1,@c2,@c3 test_upload pin=? limit 1'; prepare stmt @qry; set @c = pincode; execute stmt using @c; deallocate prepare stmt; if(@c1!='' || @c2!=''||@c3!='')

sql server - Check for duplicate records in sql database using vb.net -

assuming table consist of 2 columns id , name . and assume have stored procedure working on vb.net inserts rows database. but system needs check if id entered in textbox exists in database when add button click. create procedure addofficeequipmentprofile ( @oe_id varchar(11), @oe_category char(3) =null, @oe_subcategory char(3)= null, @oe_name varchar(35)=null, @oe_user varchar(35)=null, @oe_brand varchar(15)=null, @oe_model varchar(35)=null, @oe_specs varchar(1000)=null, @oe_serialno varchar(35)=null, @oe_propertyno varchar(35)=null, @oe_macaddress varchar(100)=null, @oe_static_ip varchar(15)=null, @oe_vendor varchar(35)=null, @oe_purchasedate smalldatetime, @oe_warrantyinclusiveyear int=null, @oe_warrantystatus char(2)= null, @oe_status varchar(15)=null, @oe_dept_code char(3)= null, @oe_location_code char(8)=

How to get a menu checkbutton to call a function in Python + Tkinter? -

so, i'm in personal project (just try myself) python + tkinter. encrypter, means gets piece of text , encrypts using famous cyphers (like numerical cypher, caesar's cypher, , others). now, wanted give user option save text encrypted, , encrypted text generated program. that, created 2 checkbutton on program's menu: 1 "save text" , other "save encrypted text". question is, tried attach function it's command option, so, guess should run function when option clicked. isn't happening. i'll explain funcitions shouls before passing code. should prompt question, asking user if he/she wants create text file text , encrypted text (this isn't database, it's user able read later text's he/she encrypted , encrypted version, if he/she wants to). so, code: encryptermenu = menu(menubar, tearoff=0) encryptermenu.add_checkbutton(label="save text", variable=v, command=savetext) encryptermenu.add_checkbutton(label="save encry

javascript - stopping a server side function in c# -

my code : <asp:linkbutton id="search" cssclass="button" runat="server" text='<%$resources:strings,search %>' onclick="search_click" /> server side : protected void search_click(object sender, eventargs e) { var script = "checkifitemselected()"; scriptmanager.registerstartupscript(this, gettype(), "myscript", script, true); } client side : function checkifitemselected() { var salesmanselecteditem = $find('<%= salesmangrid_grd.clientid %>').get_mastertableview().get_selecteditems().length; var productsselecteditem = $find('<%= salsemanproductsgrid_grd.clientid %>').get_mastertableview().get_selecteditems().length; if (salesmanselecteditem == 0 && productsselecteditem == 0) { $("#<%=errormsg.clientid %>").html("please select salesman @ least<br>please select product @ least");

java - Run function on JFrame close -

void terminate() {} protected jframe frame = new jframe(); how can frame run terminate function when press close button? edit: tried run this, reason doesn't print test (however, program closes). have idea problem? frame.addwindowlistener(new windowadapter() { public void windowclosing(windowevent e) { system.out.println("test"); frame.dispose(); } }); you can use addwindowlistener : frame.addwindowlistener(new windowadapter() { public void windowclosing(windowevent e) { ... //call terminate ... } }); see void windowclosing(windowevent e) , class windowadapter too.

how to send data to php webservice using GET method in JSON Format in C# -

i new webservice, , trying send json data .php webservice wp7 application created in vs2010. have used uploadstringasync method, method not working method. throwing exception while using method. please help. below c# code webclient postwithparamsclient = new webclient(); postwithparamsclient.headers["content-type"] = "application/json"; postwithparamsclient.uploadstringcompleted += new uploadstringcompletedeventhandler(postwithparamsclient_uploadstringcompleted); postwithparamsclient.uploadstringasync(url, "post", "{ \"latitude\": " + textbox2.text.tostring() + ", \"longitude\": " + textbox3.text.tostring() + " }"); below webservice <?php /*xml format <gpstrack> <latitude>30°n</latitude> <longitude>38°n</longitude> <mobtime>mobiletime</mobtime> </gpstrack> xml format*/ $xml = file_get_contents('php://input'); $finalarray =

Neo4j Enterprise Server 2.0.0M02 Fails to start -

i downloaded neo4j enterprise few backs ago , had set run on cloud (ec2). stored 50 nodes in span of 3 days, doing simple testing , playing database commands. today terminated , 'failed start'. on inspecting, message.log shows this: /usr/local/neo4j-enterprise-2.0.0/data/graph.db/neostore.relationshiptypestore.db.names non clean shutdown detected 2013-05-04 05:39:29.957+0000 info [o.n.k.i.n.s.storefactory]: [/usr/local/neo4j-enterprise-2.0.0/data/graph.db/neostore.relationshiptypestore.db.names] brickcount=0 bricksize=0b mappedmem=0b (storesize=38b) 2013-05-04 05:39:29.959+0000 info [o.n.k.i.n.s.storefactory]: /usr/local/neo4j-enterprise-2.0.0/data/graph.db/neostore.relationshiptypestore.db non clean shutdown detected 2013-05-04 05:39:29.960+0000 info [o.n.k.i.n.s.storefactory]: [/usr/local/neo4j-enterprise-2.0.0/data/graph.db/neostore.relationshiptypestore.db] brickcount=0 bricksize=0b mappedmem=0b (storesize=0b) 2013-05-04 05:39:29.960+0000 info [o.n.k.i.n.s.store

c - What do we have in the bytes beginning at the "Address of a function"?How to know how many bytes to consider? -

my brain gets numb imagining this.so bear me if question little wordy.so i've sliced question parts. 1) have @ at bits/bytes starting @ address of function ?i mean,at integer variable's address, visualize 4 bytes(for 32 bit systems) of 1's , 0's represent number in binary form.for character variable visualize single byte ascii value of character.for double visualize 8 bytes accordingly.but on earth should visualize @ bytes starting address of function?i know call stack created when function invoked,but function itself?at address have function's expressions, if s, loops , etc in binary form?are bits/bytes representing function complicated visualize human unlike integers ? 2) can use sizeof function?why or why can't we?if have no idea how determine size allocated function, how functions have addresses?as if have addresses,they must have size , since have pointers functions, how determined pointers how many bytes interpret starting pointer address?afte

persistence in hsqldb with spring -

i'm struggling persistence spring , hsqldb. checked out several questions couldn't manage find solution: threads checked out: no schema in file database after running program persisted hsqldb:file via hibernate hsqldb , hibernate/jpa - not persisting disk? hibernate doesn't save records in database however didn't far. everytime restart webserver changes gone , nothing written harddisk. hibernate configuration follows @bean public annotationsessionfactorybean sessionfactorybean() { properties props = new properties(); props.put("hibernate.dialect", hsqldialect.class.getname()); props.put("hibernate.format_sql", "true"); props.put("hibernate.show_sql", "true"); props.put("hibernate.hbm2ddl.auto", "update"); props.put("hibernate.connection.url", "jdbc:hsqldb:file:c:\\temp\\rvec"); props.put("hibernate.connection.username", "sa&q

python - How to pass a program argument via run configuration in Eclipse -

Image
i running python program , want pipe output file. in python command is "python myfile.py > output.txt" i'm running program via pydev in eclipse, how can pass in parameter " > output.txt " run configuration within eclipse ? there not seem option : when try above receive error : c:\python27\python.exe: can't open file 'output.txt': [errno 2] no such file or directory go run configuration of project -> open "common" tab -> find "standard input , output" tab. check "file" , select file want output go.

iphone - Implement multiple relationship using core data -

Image
here above shows er-diagram. it's easy implement to-many binary relationship using core data. confuse me how implement kind of multiple relationship. hope give hand. i not sure if understood problem correctly, wouldn't 2 one-to-many relationships (from course ta , student ta) describe model? each ta has 1 student , 1 course, each student , each course can related many tas.

Android facebook SDK 3.0 post using access token from webservice -

i creating app site. site has option sync there account facebook account. when person log in android app access token of user recived through webservice. how can use access token open sesson , post facebook using facebook sdk 3.0? there method opening session accesstoken-> session.openactivesessionwithaccesstoken(context, accesstoken, callback); it return session object, can use returned session object further operations.

.net - Using a form as the windows desktop background -

i have written program screen saver containing 3d engine rendering picture box (set size of form, set size of screen). nice as screen saver, adapt program instead of being screen saver, form placed behind desktop icons, in front of wallpaper? i have seen similar program existed on mac rendered 3d rotating earth, haven't found similar windows. i break 2 parts. part 1: program takes configuration setting file create rendered image use wallpaper background @ regular intervals. part 2: small winforms app alter configuration program in part 1.

mysqli - set the year before this year - Database - php -

working on since able find year has been there before. is, in 2015 must take have previous year. however, not grasp year in right moment. only to printf("<br>i år 2013 var der %d. brænde", $mebe->statistik("2013")); it took years 2014 @ 2013, 2015 had both 2013 , 2014 without had add them code somehow did not tackle year in. the roof database time , date: 2013-05-01 11:13:48 it must such checks year. function statistik($year=""){ $year=($year !="")? $year : date("y"); $row_cnt=0; if ($result = $this->mysqli->query("select melding, tidspunkt alarm year(tidspunkt)=$year")) { $row_cnt = $result->num_rows; /* close result set */ $result->close(); } return $row_cnt; } it find out year few years before year. there many ways accomplish this. example: $thisyear = date('y', time()); $previousyear = $thisyear -

jquery - Safe to use Javascript? -

i'm create huge website have lot of visitors. i'd add effect site jquery. problem that, i'm afraid lot of people have js disabled , they'll not able see content, or corrupted in way. can please tell me if safe use javascript nowdays, or should afraid of people don't have js enabled? i interested how internet users using js enabled browsers. yes, safe use javascript. less 1% of users have javascript disabled. report yahoo 2010: http://developer.yahoo.com/blogs/ydn/many-users-javascript-disabled-14121.html . in fact few browser stats not represent metric value irrelevant. web design practices should allow site content accessible if javascript disabled.

c# - How can I change a WebBrowser URL with a button? -

like, on button press changes webbrowser url google.com youtube.com i tried this, didn't work: private void button1_click(object sender, eventargs e) { newsfeedbox.url = ("youtube.com"); } try this: newsfeedbox.navigate("http://youtube.com");

linux - SSH with Javascript without GUI -

what want make operating system based on ubuntu use web i want make items clickable. if click on app-icon, application open. tried use websockets, are'nt easy use. i tried php, exec(), popen(), system() , tried ssh2 functions. doesn't work or slow. i can't use gui shellinabox, because want connect localhost , run commands 'firefox' or 'sensible-browser' or 'gedit'. that's why want help. i googled whole day , found nothing. i'm searching simple solution. connection , commands. no gui, simple things! thanks, amanush. -------------------------------------------[second question (edit)]------------ i made own protocol , it's working well! one last question. html: <html> <body> <a href="cloudje:firefox">open firefox</a> </body> </html> my .desktop file: [desktop entry] encoding=utf-8 version=1.0 type=application terminal=false exec=/usr/bin/cloudjerun -c gedit name[en_us]=g

set nobomb not removing byte oredr mark in vim -

i want remove ''\xef\xbb\xbf' marks (bom) file. it's text file fed python, , bom marks causing problems there. tried :set nobomb still there. how can solve problem , might have caused problem? update: file obtained combining (concatenating) may other file (using obabel software) each of has bom. so, set nobomb removes bom mark @ beginning of new file. in such casse, how can remove boms? if byte sequences embedded in buffer, a :%substitute/\%ufeff//g might trick.

attributes - BasicFileAttributes vs BasicFileAttributeView in Java -

what difference between these 2 interfaces? basicfileattributes vs basicfileattributeview i understand serve retrieve basic metadata file, differs each other? edit: meant in following example 2 interfaces used interchangeably. there difference @ all? besides fact in order access attributes view first have call .readattributes() method? basicfileattributeview bs = files.getfileattributeview(path, basicfileattributeview.class); basicfileattributes bfa = files.readattributes(path, basicfileattributes.class); interfaces nothing signatures describe. difference between these 2 interfaces are, demand methods of other signatures implemented. if have basicfileattributeview instance, can basicfileattributes using readattributes() . if don't have basicfileattributeview instance, can using files.getfileattributeview . guaranteed can one, if can't every instance of every subclass of fileattributeview. example: basicfileattributeview bfav = files.getf

Javascript newbie function doubts -

this question has answer here: var functionname = function() {} vs function functionname() {} 28 answers i learning javascript , never got idea of difference between creating function this: var justme = function(param1, param2) { code code code; }; and this: function justme(param1, param2) { code code code; } and why in second example semi-colon not requiered @ end, in first example? i'll give simply. function justme(param1, param2) { code code code; } here declaring function in it's original syntax. var justme = function(param1, param2) { code code code; }; here assigning function body variable , hence require end semicolon.

Mailing HTML content with PHP -

i mail content of web page looks like: <html> <body> <?php function sendpagecontenttoemail($destemail) { ob_start(); $buffer = ob_get_contents(); ob_end_clean(); $subject = 'subject name'; mail($destemail, $subject, $buffer); } ?> <div style="width:400px; margin:0 auto;"> <p> name: <?php print($customerdata['customer_name']); ?> </p> <p> .... </p> </div> </body> </html> <?php sendpagecontenttoemail($customerdata['customer_email']); //erase temp data session_destroy(); ?> $buffer empty (ob_get_content()) regardless of sendpagecontenttoemail() called. should function called (assuming right way it)? what ob_start start caching output, so, if output before calling it, part won't cached. just @ start, before <html>

ios - Close subview when the parent view is touched -

i have parentview , subview childview . childview positioned in middle of parentview , half it's size. i want close childview when user tap on parentview . my code follows creates uitapgesturerecognizer in parentview once childview open. my problem tap event triggered when user touches view, not parentview . thus, wondering how can make event happen if parentview touched or other possible close sub view if parent touched. - (ibaction)selectroutine:(id)sender { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"storyboard" bundle:nil]; createroutinepopupviewcontroller* popupcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"createroutinepopupview"]; popupcontroller.view.center = cgpointmake(self.view.bounds.size.width / 2, self.view.bounds.size.height / 2); _ass = popupcontroller; //tell operating system createroutine view controller //is becoming child: [self addchildviewcontroller:p

Spring - java.lang.NumberFormatException: For input string -

i'm trying list of users , associated objects using dto. far there error. model public class userentity @onetomany(cascade=cascadetype.all, fetch=fetchtype.lazy, mappedby="setter") private set<module> smodule = new hashset<module>(); @onetomany(cascade=cascadetype.all, fetch=fetchtype.lazy, mappedby="checker") private set<module> cmodule = new hashset<module>(); //getters , setters dto public class userentitydto { private list<module> smodule = new arraylist<module>(); private list<module> cmodule = new arraylist<module>(); controller @requestmapping(value = "/main/user/testing", method = requestmethod.get) public string getrecords(model model) { list<userentity> users = userservice.getuserentity(); list<userentitydto> usersdto = new arraylist<userentitydto>(); (userentity user: users) { userentitydto dto

Stop javascript from executing -

i know simple cant conditional if below work... this line below " if ( !$section.id == "no-transition" ) " not correct. i'm trying stop javascript working on section elements have id of "no-transition". can point me in right direction? function initevents() { $sections.each( function() { var $section = $( ); if ( !$section.id == "no-transition" ) { // expand clicked section , scale down others $section.on( 'click', function() { [code taken out shorten post...] if( !supporttransitions ) { $section.removeclass( 'bl-expand-top' ); } $el.removeclass( 'bl-expand-item' ); return false; } ); } } ); you should not have multiple elements same id on page. your if condition should modified to: ..

Perl timezone conversion - but only using core modules -

is possible timezone conversion 'arbitrary' date in future using perl core modules? lets have day:month:year, hr:min in timezone x (assume qualified timezone america/new_york) , need convert timezone y (say asia/kolkata) some notes: 1) osx (lion or above) 2) know how using datetime , datemanip, these not core modules, , require c compiler present installed. trying distribute program 'non technical' users - can perl module installs help, fall apart when trying xcode, command line tools etc working. have tried install datetime got caught in errors/dependencies , gave up. 3) tried using combination of tzset; , env tz - can't used arbitrary dates - works local time (which means, can convert 'now time' timezone) use posix core module. example: use posix; $env{tz} = 'europe/madrid'; $time_t = posix::mktime( 10, 30, 17, 4, 4, 113 ); print posix::ctime($time_t); #<-- prints: sat may 4 17:30:10 2013 $env{tz} = 'europe/lond

java - Lost item background color when scrolling listview -

i tried used solutions stackoverflow, without succesfull. so, set background color item after click - working. after scrolling (when item out off screen) , scrolling (item in screen), item lost background color. here part of code: public class rowadapter extends arrayadapter<filerow> { private final activity context; private final list<filerow> list; public rowadapter(activity context, list<filerow> list) { super(context, r.layout.browser_row, list); this.context = context; this.list = list; } @override public view getview(int position, view convertview, viewgroup parent) { view v = super.getview(position, convertview, parent); layoutinflater inflator = context.getlayoutinflater(); convertview = inflator.inflate(r.layout.browser_row, null); textview textview = (textview)convertview; textview.settext(list.get(position).getname()); if (!list.get(position).getname().contains("/")) {

iframe - Display more data in an HTML/ASP page without refreshing the page -

i've seen other sites it, i'm not sure it's called or begin... i want more content displayed on page, without having refresh (via browser refresh button or meta refresh tag on page). currently page html / classic asp , writes out data text file on server. text file being populated data command-line tool running on server (that's way, can't touch/redesign/re-code this). have .asp page when refreshed, uses realline method write what's in text file, , refresh .asp page in iframe every 3 seconds until last line appears (which know in advance) , when string found take away meta refresh cause i'm "done" displaying more info. what do, avoiding java (many won't have installed) or javascript (i suspect users have disabled), load page , have fill in more information text file appears. possible? how/what's called? appreciate code samples if available.

regex - PHP preg_match full string -

i'm trying verify string matches pattern. is, full string can written pattern. preg_match returns true , if substring matches pattern. (e.g. preg_match("#[a-z]*#, "333k") returns 1 , don't want to. in example i'd rather verify, whole string contains small latin letters.) you use start , end markers, ^ , $ respectively, indicate beginning , end of string in regular expression pattern. way can make expression match whole string, not kind of substring. in case this: preg_match("#^[a-z]*$#", "333k"); you can also, 1 these markers, specify pattern must match beginning or end of string.

Corona SDK Physics goes on and off while object is in motion -

below main file. happening collision working when "rect" object not moving move rect object, collision stops taking affect. think knows colliding not (like interaction objects @ all). have thoughts, why happening? , how fix it? local physics = require("physics") ; physics.start() ; physics.setgravity( 0,0 ) ; physics.setdrawmode( "debug" ) display.setstatusbar( display.hiddenstatusbar ) math.randomseed( os.time() ) physics.setvelocityiterations(10); physics.setpositioniterations(20); --set references , other variables local ox, oy = math.abs(display.screenoriginx), math.abs(display.screenoriginy) local cw, ch = display.contentwidth, display.contentheight --set collision filters local screenfilter = { categorybits=2, maskbits=1 } local objfilter = { categorybits=1, maskbits=14 } local fieldfilter = { categorybits=4, maskbits=1 } local magnetfilter = { categorybits=8, maskbits=1 } --set initial magnet pull local magnetpull = 0.25 --set world

themes - Masonry images overlapping -

so i'm working on tumblr theme right now. i'm using masonry have posts in 5-column grid , infinite scroll script load new images grid when i'm scrolling down. unfortunately, of time scroll down images overlapping. figured out problem may masonry triggering before images loaded, right have no idea how fix this. i'm using (window).load instead of (document).ready pictures keep overlapping nonetheless. here's full code snippet: <script type="text/javascript" src="http://static.tumblr.com/imovwvl/djwl20ley/jqueryformasonry.js"></script> <script type="text/javascript" src="http://static.tumblr.com/imovwvl/rsgl20lfv/masonry.js"> </script> <script src="http://static.tumblr.com/df28qmy/shulh3i7s/jquery.infinitescroll.js"></script> <script src="http://static.tumblr.com/thpaaos/llwkowcqm/jquery.masonry.js"></script> <script type="text/javascript">

jmonkeyengine - How to detect the intersections between 2 nodes in jMonkey -

i'm working on java project; "car game" , want detect collisions between car , object ("node"); such cones on road. similar tutorial; http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_picking the tutorial shows finding intersection between ray , node has boxes attached it. want replace ray car chassis intersection detection. assume have 2 collidables , b , want detect collisions between them. collision parties can geometries, nodes geometries attached (including rootnode), planes, quads, lines, or rays. important restriction can collide geometry vs bounding volumes or rays. (this means example must of type node or geometry , b respectively of type boundingbox, boundingsphere or ray.) the interface com.jme3.collision.collidable declares 1 method returns how many collisions found between 2 collidables: collidewith(collidable other, collisionresults results). code sample: // calculate detection results collisionresults results = ne

math - Time complexity of a function with time 1 + 8 + 27 + 64 + ... + sqrt(n)^3? -

i have been told that 1 + 8 + 27 + 64 + ... + (√n) 3 = θ(n 2 ) why case? to make sure understand you're saying, curious in why sum 1 3 + 2 3 + 3 3 + ... + (√n) 3 = θ(n 2 ) one way a formula sum of first m cubes . equal to (m(m + 1) / 2) 2 so let's plug in m = √n, gives 1 3 + 2 3 + 3 3 + ... + (√n) 3 = ((√n)((√n) + 1) / 2) 2 = ((n + √n) / 2) 2 = (n 2 + 2n√n + n) / 4 this final expression gives exact value of sum of first √n perfect cubes. note expression θ(n 2 ), because n 2 dominant term. hope helps!

jquery - How to load data as soon as welcome jsp gets loaded? -

i have index.jsp welcome page web application. now, hit url, need display table populated data coming backend services through ajax call. have mapped url using spring mvc , verified controller method getting hit.following jquery snippet, $(document).ready(function() { var body = $("body"); $.ajax({ url : "${pagecontext.request.contextpath}/admin/product/display", type : "get", success : function(data) { alert("alert"); } }); }) i have observed alert not working. dont know going wrong here.

ruby on rails - Using link_to make an image the link -

i need link image profile_path(thing.user) <%= image_tag thing.user.photo.url(:small), { :class=>"rounded_square" , style: "margin-left:8px; text-align:center; vertical-align:middle;" } %> link_to should take block if nothing helps: <%= link_to profile_path(thing.user) %> <%= image_tag thing.user.photo.url(:small), { :class=>"rounded_square" , style: "margin-left:8px; text-align:center; vertical-align:middle;" } %> <% end %>

c++ - LNK2019 unresolved ext symbol error (Project files included) -

i started learning c (watched first 30 vidoes of "buckys c++ programming tutorials " on youtube),after thought knew little basics went right tutorials on making d3d hacks(fleeps if know it) , on. so have source i'm trying write , works fine can't figure out why i'm getting "lnk2019 unresolved external symbol error" i'm pretty sure error main.cpp not being able read things i'm telling to. (i know googling , forum searching while.) "error 3 error lnk2019: unresolved external symbol "bool __cdecl comparecolour(struct tagrgbquad *,int,int,int,int)" (?comparecolour@@ya_npautagrgbquad@@hhhh@z) referenced in function "void __cdecl scanbmp(class scancontents *)" (?scanbmp@@yaxpavscancontents@@@z) c:\users\sherm\desktop\current project\color aimbot\color aimbot\main.obj color aimbot " that error. have checked include/lib's multiple times , main.cpp included in project. also:here proj

c++ - How to control memory allocation strategy in third party library code? -

previous header: "must replace global operators new , delete change memory allocation strategy in third party code?" short story: need replace memory allocation technique in third-party library without changing source code. long story: consider memory-bound application makes huge dynamic allocations (perhaps, available system memory). use specialized allocators, , use them everywhere ( shared_ptr 's, containers etc.). have total control , power on every single byte of memory allocated in our application. also, need link against third-party helper library . nasty guy makes allocations in standard way, using default operators new , new[] , delete , delete[] or malloc or else non-standard (let's generalize , don't know how library manages it's heap allocation). if helper library makes allocation big enough can hdd thrashing, memory fragmentation , alignments issues, out-of-memory bad_alloc s , sorts of problems. we can not (or not want) change

python - Pygame music queue -

so question may not have nice answer. know if possible use queue in pygame.mixer.music play multiple tracks 1 after another. have midi files concatenate, were, there ugly 0.1s or gap between them when use pygame.mixer.music.queue def play_music(): pygame.mixer.music.load(playls.get(0)) in playls.get(0,end): print pygame.mixer.music.queue(i) pygame.mixer.music.play(1) the playls tk listbox has names of files play. plays songs fine, there small gap between each know if can eradicate. has shown not mid files wavs, , think might in library, , not "padding" might in sound file.

How to pass parameter to module in angularjs -

i'm looking through angularjs examples, i've found example: // module cloud persistance in mongolab - https://mongolab.com angular.module('mongolab', ['ngresource']). factory('project', function($resource) { var project = $resource('https://api.mongolab.com/api/1/databases' + '/angularjs/collections/projects/:id', { apikey: '4f847ad3e4b08a2eed5f3b54' }, { update: { method: 'put' } } ); project.prototype.update = function(cb) { return project.update({id: this._id.$oid}, angular.extend({}, this, {_id:undefined}), cb); }; project.prototype.destroy = function(cb) { return project.remove({id: this._id.$oid}, cb); }; return project; }); i don't want using magic string static resource such https://api.mongolab.com/api/1/databases/angularjs/collections/projects/:id , instead have defined on server , later passed module. question is, how parametrize module, i.e.

database - Oracle SQL Trigger insert/update -

ok question should easy 1 think. learning triggers, , trying figure out homework question. have 3 tables, movies (title, year, length, genre, studioname, producer) starsin (movietitle, starname) moviestar (name, address, gender, birthdate) so need write trigger assuring @ times, star appearing in starsin appears in moviestar. need make trigger both insert , update events. update: ok changed statement little still can't figure out create or replace trigger movietrigger after update or insert on starsin each row when(new.starname not in(select "name" moviestar)) begin insert moviestar("name") values(new.starname) end; now getting error error report: ora-02251: subquery not allowed here 02251. 00000 - "subquery not allowed here" *cause: subquery not allowed here in statement. *action: remove subquery statement. i learned oracle not support subquery in when clause... trying figure out limited knowledge. if has clever way of

c# - Ambiguity error? -

so i'm rather newbie when comes programming in c# have error need with? so i'm trying create rpg system started out before else battle system barely began code store in form1.cs such using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); } public class variables{ public graphics character; private void form1_load(object sender, eventargs e){ } } private void form1_keydown(object sender, keyeventargs e) { switch (e.keycode) { case keys.up: player.top = player.top - 5; battle.steps = battle.steps + 10; break; case keys.down: player.top = player.top + 5; batt

.htaccess - remove directory after main url using htaccess -

with following url http://www.example.com/de/here/ want remove "de" directory (or whatever may in front of "here" directory, if in front of it) user directed http://www.example.com/here/ instead, directory exist. the url http://www.example.com/it/here/ or other combination of 2 letters. the url http://www.example.com/here/ in case don't want removed @ all. i have searched solution here cant seem make work correctly appreciated. you can use kind of htaccess : rewriteengine on rewritebase / rewriterule ^[a-za-z]{2}/(.*)$ $1 [l,r=301] example of redirections caused code : http://www.example.com/de/foo/ => http://www.example.com/foo/ http://www.example.com/de/ => http://www.example.com/ http://www.example.com/it/bar/ => http://www.example.com/bar/ http://www.example.com/fr/baz/ => http://www.example.com/baz/ please note won't able access language (de, it, fr...) anymore. another point, careful kind of url (the

Code Splitting in Dart -

is there way to kind of code splitting in dart? i'd defer loading of used code accelerate initial code download. in javascript, i'd inject new <script> tag, in gwt i'd call gwt.runasync() . there similar in dart? according this link , <script> injection won't work ("each html page can have @ 1 dart script tag", "we not support dynamically injecting tag loads dart code."). found this fixed issue claiming: "the initial 1 [use case] deferred loading, avoid massive downloads when code needed later, or perhaps needed in situations. have mechanism this.". unfortunately, couldn't find on how implement this. know this? update sep 2014: this has been fixed! dart supports deferred loading special import... deferred syntax. example: import analytics.dart deferred analytics void main(){ analytics.loadlibrary.then((_) { // future // code ready enableanalyticscontrol() }); } here an offic