Posts

Showing posts from July, 2013

python - Pandas Data Frame function application to a specific row -

i'm trying apply 1 function f1 rows ['utah,'texas'] , f2 other rows. don't want create separate df each function. example adjusted wes mckinney's python data analysis: mwe: import pandas pd import numpy np frame = pd.dataframe(np.random.randn(4, 3), columns=list('bde'), index=['utah', 'ohio', 'texas', 'oregon']) f1 = lambda x: (x-x.min())/(x.max() - x.min()) f2 = lambda x: (x-x.max())/(x.min() - x.max()) i've tried selecting row label: frame.loc['utah'].apply(f1,axis=1) . i can feel small i'm missing but... this creates 2d numpy.array each row application of 1 of 2 functions dataframe according rules specified row: np.where( np.array([frame.index.isin(['utah', 'texas']) _ in frame.columns]).t, frame.apply(f1, axis=1), frame.apply(f2, axis=1)) since didn't specify output fully, it's hard guess want furt...

javascript - Custom input date in html page -

Image
i have date field in html page : <input type="date" id="birth_date" name="birth_date" placeholder="dd/mm/yyyy" /> when launch application got result : i need know how can hide these controls ( right of image) using simplest way ? thanks, if understand correctly, there 4 things want remove input[type=date] on webkit browser: blue cross up arrow button down arrow button datepicker dropdown button (opens datepicker) this css rule hide them all: input[type=date]::-webkit-clear-button, /* blue cross */ input[type=date]::-webkit-inner-spin-button, /* */ input[type=date]::-webkit-outer-spin-button, /* down */ input[type=date]::-webkit-calendar-picker-indicator /* datepicker*/ { display: none; }

javascript - Jade block extend for each item in database? -

what doing wrong? test.jade doctype !!! 5 html(lang="en-us") head title test h1 information; body block testcontent form(method="post") input(type="button", value="refresh") testcontent.jade extends test append testcontent br p test #{title} routing handler; app.get('/search', function(req, res) { res.render('test'); }); app.post('/search', function(req, res) { table.find().sort({created:1}).toarray(function(err, items) { if(err) { console.log(err); } else { res.render('testcontent', {title:items._id}); } }); }); trying make write 'test' , title each item in database. click 'refresh' in page, nothing happens. when user sends post using refresh button, it's meant every entry's _id...

c# - Stopwatch application starts but won't stop -

for reason able start stopwatch, when try , click stop button, nothing happens. i have background in java programming assigned project make program in language didn't know picked c#. have knowledge c# appreciate if can me out problem. using system; using gtk; using system.threading; using system.diagnostics; using system.timers; public partial class mainwindow: gtk.window { stopwatch stopwatch = new stopwatch(); system.timers.timer timer = new system.timers.timer(); bool stopclicked = false; public mainwindow () : base (gtk.windowtype.toplevel) { build (); } protected void ondeleteevent (object sender, deleteeventargs a) { gtk.application.quit (); a.retval = true; } protected void onstartbuttonclicked (object sender, eventargs e) { thread thread1 = new thread(new threadstart(thread1)); thread1.start (); stopwatch.start (); console.writeline ("stopwatch started"...

android - Project has no project.properties file! Edit the project properties to set one and already error when create any project -

there many answers on question on site think non of them work me and here's errors: [2015-06-13 19:37:02 - appcompat_v7] project has no project.properties file! edit project properties set one. [2015-06-13 19:37:02 - appcompat_v7] project has no project.properties file! edit project properties set one. [2015-06-13 19:47:07 - appcompat_v7] project has no project.properties file! edit project properties set one. [2015-06-13 19:59:00 - moving] eclipse\moving\res\values\styles.xml:7: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light'. [2015-06-13 19:59:00 - moving] eclipse\moving\res\values-v11\styles.xml:7: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light'. eclipse\moving\res\values-v14\styles.xml:8: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light.darkactionbar'. [2015-06-13 19:59:06 - moving] eclipse\moving\res...

css3 - property nth-child seems not working in JSP CSS -

Image
i created program fill in table data of table called usuarios property nth-child seems not working rows have same color, greenyellow; . using netbeans , glassfish <%-- document : basededatos created on : 14/06/2015, 01:23:57 author : fernando --%> <%@page import="java.sql.*"%> <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp page</title> <style type="text/css"> .tftable{ width:100%; border-collapse:collapse; } .tftable td{ padding:7px; border:#4e95f4 1px solid; } /* provide minimal visual accomodation ie8 , below */ .tftable tr{ background: red; }...

python - to access the filter query result passed to templates in django -

i want pass filter query result templates in django. details of each field of row returned presented in form of readable form , every row. using django 1.8 this urls.py url(r'^pendingregistrations/$',views.pendingapproval, name ='pendingapproval') this views.py from django.shortcuts import render_to_response django.http import httpresponse django.template.context_processors import csrf django.views.decorators.csrf import csrf_protect django.core.mail import send_mail django.core import mail fcui.models import * django.db.models import q import urllib django.template import context @csrf_protect def pendingapproval(request): if request.method == 'post' : return httpresponse("post done") elif request.method == 'get' : data = request.get.get('id') decode = urllib.unquote_plus(data) encryptdata import encryption, decryption ...

python - Jumbled out put of RFID Tags -

i working on project, in have interface multiple rfid readers (i'm using em 18, serial out) raspberry pi. i'm using usb ttl converter connect em 18 raspberry pi. i've connected 2 rfid readers using usb ttl adapter. code 1 station code import serial, time while true: try: print 'station 1 ready!! please show card' card_dataa = serial.serial('/dev/ttyusb0', 9600).read(12) print card_dataa continue except serial.serialexception: print 'station 1 down' break my issues are i readings both rfid readers in same program simultaneously. i've 2 programs above code, station1.py , station2.py. station1.py usb0 , station2.py usb1. executing programs in different terminal simultaneously. for example station1.py in terminal 1 , station2.py in terminal 2. program executes fine, readings jumbled. example, 6e0009d2cc79 , 4e0070792760 tag id's i'm using testing. if i'm exec...

c++ - Header-Only circular dependency -

i having problems circular dependency in head-only library c++ have not been circular dependency problem when using source files instead of making header-only. the situation equal this: there 4 files 2 classes , b. every class has got header file (e.g. "a.hpp") , implementation file (e.g. "a.tpp"). the dependencies follows: a's header requires b' header a's impl requires b's header b's header requires nothing forward declaration a b's impl requires a's header so in source-based library fine following order of source file inclusion , compilation: b.hpp a.hpp a.tpp or b.tpp (order here not important) my files structured in way: file content a.hpp: #ifndef a_h #define a_h #include "b.hpp" class { ... }; #include "a.tpp" #endif file content a.tpp: #ifndef a_h #error "do not include file directly." #endif // ... implementations a.hpp file content b.hpp: #ifndef b_h #defin...

Find PHP application external calls -

let's have monolithic , huge codebase project written in php in localhost is there service can report on runtime external calls made? code may using php directly or using curl instead. maybe right approach not php application this, kind of daemon can give information operating system. using mac os x. any ideas? you can make use of observer pattern , classes exist in spl classes \splobserver , \splsubject . when have big project, surely have abstracted of , have wrappers curl calls , database etc (if not, should consider going according design patterns!). class yourcurlwrapper implements \splsubject { public function setobservers($observers) { $this->observers = $observers; return $this; } //notify observers(or of them) public function notify() { foreach ($this->observers $value) { $value->update($this); } } } see classes splobserver , splsubject . http://php.net/manual/de/class.splo...

make GDI drawing more efficient C# -

at moment code takes 10% of cpus power. how can make more efficient , less flickerish? code: private void timer1_tick(object sender, eventargs e) { drawlocal(); thread.sleep(17); picturebox1.invalidate(); } private void drawlocal() { int localreadx = readaddress("hl2", "client.dll+0xbfff00 364 0"); int localready = readaddress("hl2", "client.dll+0xbfff00 368 0"); byte[] bytesoflocalx = bitconverter.getbytes(localreadx);//converts float byte[] bytesoflocaly = bitconverter.getbytes(localready);//converts float float localx = bitconverter.tosingle(bytesoflocalx, 0)/10;//converts float float localy = bitconverter.tosingle(bytesoflocaly, 0)/10;//converts float graphics localp = picturebox1.creategraphics(); localp.fillrectangle(new solidbrush(color.red), localx, localy, 5, 5); graphics localname = picturebox1.creategraphics(); localname.drawstring(" local", new font("arial...

python - How to find out what function I am calling -

i calling function this: classifier = naivebayesclassifier.train(training_set) and debug code inside train() function. problem if add print statements or pdb calls nothing changes. i importing this: from nltk.classify.naivebayes import naivebayesclassifier but if change in nltk/classify/naivebayes.py nothing happens. can delete content of file , still have working output. suppose function calling somewhere else, cannot find it. is there way check function call going? quite confused. step in function using pdb. use pdb.set_trace() before calling train method. something this import pdb; pdb.set_trace() classifier = naivebayesclassifier.train(training_set) when debug. stop @ line calling train method. press s step in function. take inside train function. there can debug normally.

java - choosing data structure in which first search need to be done in key items in order to retrieve corresponding value -

this question has answer here: how implement map multiple keys? [duplicate] 27 answers i have choose 1 data structure need below explaining conditions there following values abc,def,rty,ytr,dft map row r1b1 (actully key combination of r1+b1) abeerc,dfffef,rggty map row r1b1 (actully key combination of r1+b2) key value abc,def,rty,ytr,dft ---> r1b1 abeerc,dfffef,rggty ---> r1b2 now example lets if ytr able retrieve r1b1 or lets value rggty able retrieve r1b2 case matters of search , complexity , time taken things have go in sequence for example first pick first line search ytr , first match abc not match have match def not again match match rty not match match ytr , find key r1b1 finally similarly if second string need searched lets rggty scan first row in not find value search continue second row , in second row in th...

c - Can I free only a part of a string? -

i filling string of characters , double size time time. when finish, free unused memory. void fun (char **str, size_t *len) { size_t lsi; //last_significant_index //filling str , reallocating time time. //*len storing total size of allocated memory @ point // idea #1 free((*str)[lsi + 1]); // idea #2 for(size_t = lsi + 1; < *len; i++) { free(&(*str)[i]); } } none of these ideas seem work however is possible it? if so, how? details: i using function reallocate strings: static void increase_list_size(char **list, size_t *list_len) { size_t new_list_size = (*list_len + 1) * 2; // not allocating list @ declaration, *list_len equals 0. char *new_list = malloc(sizeof(char) * new_list_size); (size_t = 0; < *list_len; i++) { new_list[i] = (*list)[i]; } if (list != null) // don't want free empty list (it wasn't allocated @ declaration! { free(*list); } (*list) = new_list; *list_len = new_lis...

What is up with this in ColdFusion's DecimalFormat() function? How do I get the correct result? -

<cfset number1 = 20.5/80 * 100 /> <cfset number2 = 18.125 /> <cfset number3 = 6.875 /> <cfoutput> decimalformat(#number1#): #decimalformat(number1)#<br /> decimalformat(#number2#): #decimalformat(number2)#<br /> decimalformat(#number3#): #decimalformat(number3)# </cfoutput> outputs: decimalformat(25.625): 25.62 decimalformat(18.125): 18.13 decimalformat(6.875): 6.88 rather outputing: decimalformat(25.625): 25.63 decimalformat(18.125): 18.13 decimalformat(6.875): 6.88 it seems variable result of mathematical calculation makes decimalformat() behave differently. quick fix, without digging java? i think problem not decimalformat() , typical floating-point rounding errors. see: precisionevaluate()

javascript - Intermittent failure to load images - ERR_CONTENT_LENGTH_MISMATCH -

the problem my website fails load random images @ random times. intermittent failure load image following error in console: "get example.com/image.jpg net::err_content_length_mismatch" image either doesn't load @ , gives broken image icon alt tag, or loads halfway , rest corrupted (e.g. colors screwed or half image greyed out). setup litespeed server, php/mysql website, html, css, javascript, , jquery. important notes problem occurs on major web browsers - intermittently , various images. i forcing utf-8 encoding , https on pages via htaccess. hosting provider states permissions set correctly. in access log, when image fails load, gives '200 ok' response image , lists bytes transferred '0' (zero). it images fail load maybe 5% of time css file or javascript file. problem occurred after moving servers apache litespeed , has been persistent on several weeks. gzip , caching enabled. this error definite mismatch between ...

ios - "Include of non-modular header inside framework module" in C header of SSZipArchive -

Image
i'm trying use ssziparchive objc library in swift ios project. what did: created objective-c "cocoa touch framework" followed this guide import ssziparchive's objective c , c files it. changed c headers public per this answer change build settings allow non-modular includes per this answer the framework compiles fine. i'd manage use objective c libraries in swift projects using way before guess steps correct? the problem right when try import sszip in project , try compile, gives "include of non-modular header inside framework module" errors each of c header files of ssziparchive , i've tried possible solutions can find online no success. seems problem centers on zlib.h please help.. i'm stuck more week , couldn't find alternatives unzip file in swift. i got work. need move #includes causes problem out .h file , put them in .c file instead. after clean , recompile , error goes away , works.

c++ - Cannot find -lgtk-x11-2.0. Also, some modules are not found by cmake, though they are installed -

i trying run opencv on fedora 21 64-bit arm-compilers. tried configuring cmake 3.0.2 gui , got this: the cxx compiler identification gnu 4.5.1 c compiler identification gnu 4.5.1 check working cxx compiler: /opt/friendlyarm/toolschain/4.5.1/bin/arm-linux-g++ check working cxx compiler: /opt/friendlyarm/toolschain/4.5.1/bin/arm-linux-g++ -- works detecting cxx compiler abi info detecting cxx compiler abi info - done check working c compiler: /opt/friendlyarm/toolschain/4.5.1/bin/arm-linux-gcc check working c compiler: /opt/friendlyarm/toolschain/4.5.1/bin/arm-linux-gcc -- works detecting c compiler abi info detecting c compiler abi info - done detected version of gnu gcc: 45 (405) performing test have_cxx_fsigned_char performing test have_cxx_fsigned_char - success performing test have_c_fsigned_char performing test have_c_fsigned_char - success performing test have_cxx_w performing test have_cxx_w - success performing test have_c_w performing test have_c_w - success performing te...

How declare in a record a member with generic list of records in F# -

i'm stuck in how pass generic list of records around. wanna this: type tabulardata<'t>= array<'t> type table = {title:string; data:tabulardata<'t>} //this of course not work type cpu = { name:string; load:int; } type memory = { name:string; load:int; } //f# not let me pass cpu or memory i wanna create list of records of type, , pass around serialize json p.d: more info issue. i have forgott add main problem. using generics spread vast rest of functions. need tag generic signature, possible more general , say: "i can have kind of records here?" you need make table type generic too: type table<'t> = {title:string; data:tabulardata<'t>} and because 2 records have same fields, can use cpu.name explicitly creating table cpu values: { title = "hi"; data = [| { cpu.name = "test"; load = 1 } |]}

java - Prevent hiding of contextmenu after selecting CheckMenuItem -

i have contextmenu on textfield (opens on focus) 2 checkmenuitems. selecting 1 menuitem leads hide contextmenu. how can prevent contextmenu hiding after selecting item (to allow more selections) exampleapp: public class contextmenutest extends application { @override public void start(stage primarystage) { contextmenu contextmenu = new contextmenu(); checkmenuitem item1 = new checkmenuitem("test1"); checkmenuitem item2 = new checkmenuitem("test2"); contextmenu.getitems().addall(item1, item2); textfield textfield = new textfield(); textfield textfield1 = new textfield(); textfield.focusedproperty().addlistener((object, oldval, newval) -> { if(newval) contextmenu.show(textfield, side.top, 0, 0); }); vbox root = new vbox(); root.getchildren().addall(textfield, textfield1); scene scene = new scene(root, 300, 250); primarystage.setscene(scene); primarystage.show(); } public stat...

django admin view on site don't use get_absolute_url -

i'm using default django admin. registered models in admin.py,i define get_absolute_url in models, when i'm on editing form of model button view on site redirect me basic localhost:8000 no metter writing in get_absolute_url, appears admin didn't use @ all. class products(models.model): name=models.charfield(max_length=30,unique=true) slug=models.charfield(max_length=30) description=models.textfield(max_length=200) price=models.floatfield() created_at=models.datetimefield() modified_at=models.datetimefield(blank=true,null=true) def __unicode__(self): return (self.name) def get_absolute_url(self): return '/foo/bar/' decision: def get_absolute_url(self): products.views import single_product return reverse(single_product, args=[self.slug])

Php Mysql: Retrieving 2 usernames via 2 user id -

hi have 1 problem cant solve. doing pair generator tournament. i have 2 tables. first table contains usernames , userids. second table contains match_id, round, user1_id, user2_id table 1 user_id username 21 john 22 peter 23 ana 24 dan table 2 match_id round user1_id user2_id 1 1 21 22 2 1 23 24 3 2 21 23 4 2 24 22 . . . and want echo round 1 john - peter ana - dan round 2 john - ana dan - peter round 3 ... round 4 ... can done 1 sql code can both usernames table1 user1_id , user2_id? to retrieve 1 username via user_id had no problem , working great: $sql = "select table1.username, table3.won table1 inner join table3 on table1.user_id=table3.user_id;"; i know instead of using user_ids in table2 use usernames, way explained above. select concat((select username table1 t1 t.user_id=t1.user_i...

jquery - What is faster/more efficient - $(".selector").height() vs $(".selector").eq(0).height() -

i have 20 x element.selector same ( 100px ) height , need height ( 100px , not 2000px ). what faster/more efficient do? $(".selector").height() or $(".selector").eq(0).height() i raced them you. run 1 run 2 run 3 run 4 with_eq: 1956.769ms 1875.220ms 1930.814ms 1895.359ms no_eq: 1851.168ms 1861.596ms 1804.347ms 1829.207ms and seems, not using eq(0) faster. it's obvious, because save function call on jquery object. not calling faster call. this test case: // noprotect console.time('with_eq'); (var = 0; i<40000; i++) { $(".foo").eq(0).height(); } console.timeend('with_eq'); console.time('no_eq'); (var = 0; i<40000; i++) { $(".foo").height(); } console.timeend('no_eq'); .foo { height:100px } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery...

wpf - XAML Rotate and Fade Out Animation Together -

i have following code image rotation animation : <image source="/resources/collage5.jpg" name="myimage"> <!--code rotation animation--> <!--rendertransformorigin="0.5, 0.5">--> <image.rendertransform> <rotatetransform/> </image.rendertransform> <image.triggers> <eventtrigger routedevent="loaded"> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetproperty="(rectangle.rendertransform).(rotatetransform.angle)" to="360" duration="0:0:5" repeatbehavior="forever"/> </storyboard> </beginstoryboard> </eventtrigger> </image.triggers> and following code fade out animation: <stackpanel> <image name="myrectangle" source="/resources/collage5.jpg...

Showing RAW Form on HTML webpage -

this question has answer here: how display html tags plain text 9 answers i cant figure out how show form plain raw text on html webpage, keeps giving me form on page not raw text code. <form name="myform" action="demo_form.asp" onsubmit="return validateform()" method="post"> name: <input type="text" name="fname"> <input type="submit" value="submit"> </form> to prevent html code being executed use &lt; , &gt; symbols replace < , > : https://jsfiddle.net/x5704lw3/ html &lt;form name="myform" action="demo_form.asp" onsubmit="return validateform()" method="post"> <br>name: &lt;input type="text" name="fname"&gt; <br>&lt;input type="submit...

github - How to correctly work on a GreaseMonkey userscript using git? -

Image
i working on userscript firefox, use greasemonkey . moreover, facilitate development, use git update different versions of code. now, let me try explain issue. when add greasemonkey userscript local git directory, new files created in gm_scripts folder of firefox profile. greasemonkey use these files source , not git directory, if want modify code , test stuff, have change files inside gm_scripts. means can not commit modification, first have copy files gm_scripts git directory. unconvenient. there solution. can modify script git directory, , re-install greasemonkey using bookmark pointing these local files. once again, not handy @ all. what thought third define folder inside gm_scripts git directory. unfortunatly, project contains many files ordered folders, , want keep clean. adding userscript greasemonkey makes files extract folder. moreover, git project not contains userscript folder, there other stuff. not idea declare gm_script's directory source git, putti...

Visual Studio Express 2012 - TeamCity Add in not found? -

i installed "teamcity-9.0.4.exe" downloaded jetbrains.com. http://localhost teamcity's web ui, under settings & tools> visual studio add-in... tried install teamcity's visual studio addin. first attempt chose "teamcity vs add-in part of jetbrains .net tools bundle". no installation error, can't find team city menu visual studio express 2012 (windows 8 64 bit). 2nd attempt tried "legacy version of teamcity vs add-in". also, no installation error. however, can't find teamcity add-in anywhere visual studio express 2012. suggestion?

PHP and MYSQLI with LIKE array: does not echo all content correctly -

i have come far , seem stuck on trivial output issue, apologies in advance. the $getexhibitions array , works when aspect of code running. have added $results based on keyword link intended array within array. my problem output supposed show $getexhibitions->title list of each $results->sponsor underneath. java creates drop down specific sponsor information. repeat preceeding 8 years so. as can see code getting stuck , feel though may div or { problem or may more array code. in advance. http://tenmoregirls.com/tenmoregirls/sponsors.php <?php $current_url = base64_encode($url="http://".$_server['http_host'].$_server['request_uri']); $query_getexhibitions = $mysqli->query("select * exhibitions order year desc"); if ($query_getexhibitions) { while($getexhibitions = $query_getexhibitions->fetch_object()) { echo "<a>$getexhibitions->year | $getexhibitions->title</a>",...

java - Having an error when saving imageview width and height must be > 0 -

i want save imageview sd card following exception (some times not always) when try bitmap imageview. can please me? in advance caused by: java.lang.illegalargumentexception: width , height must > 0 @ android.graphics.bitmap.createbitmap(bitmap.java:922) public static class saveimagetosd extends asynctask<string, void, string> { context context; imageview mimageview; progressdialog progressdialog; public saveimagetosd(context context, imageview iv, string name) { this.context = context; this.mimageview = iv; } @override protected void onpreexecute() { progressdialog = progressdialog.show(context, "", context.getresources().getstring(r.string.please_wait), true); } @override protected void onpostexecute(string result) { } @override protected string doinbackground(string... x) { file projectfolder = new file(environment.getexternalstoragedirectory() + file.separator + se...

angularjs - Apache Cordova backbutton event not fired on Windows Phone (universal) -

i've creeated apache cordova project single page application. on start page there list of items. when click on item navigate details page with window.navigate("#/details/" + id); angular.js displays details template when use hardware backbutton on windows phone suspends application instead ov navigating back. tried hook backbutton event function ondeviceready() { // handle cordova pause , resume events document.addeventlistener('pause', onpause.bind(this), false); document.addeventlistener('resume', onresume.bind(this), false); document.addeventlistener("backbutton", onbackbutton, false); } but event isn't fired when click button. use winjs , tried winjs.application.onbackclick doesn't work. so how can handle button on windows phone universal? this looks bug in windows phone runtime target cordova. in silverlight cordovapage.xaml.cs file hooks windows phone backbutton event handling , forwards cordo...

actionscript 3 - AS3 - Score counter -

i making simple math game 4 frames. in first frame can choose math operation want practice. in second frame presented randomly generated math question. if enter correct answer, application outputs "correct answer", , skips frame one. 1 point every correct answer. simplest way of keeping score, , output on screen? to honest, answer pretty every question includes "...with ... frames..." asks simplest/best/sane way "without frames". whenever switch frames, code on frame executed. if visit frame again, code executed again. if set score 0 on first frame, whenever go frame again, reset score 0. the simplest way, far score goes, initialize once. according things mentioned above, means should never visit frame, sets score 0 again. you can in 2 ways: split first frame 2 frames: both looking same, first 1 initialisation , whenever want "go frame 1", go second frame you don't use multiple frames: take content of each of frames , p...

javascript - Check when the page is loaded AND opening animation has finished -

i'm in front of conceptual problem. @ beginning of site have opening animation (in sostitution of loader) want show all, beginning end, of course. when page loaded i'll show page. now there 2 different situations: first: fast internet -> page loaded before animation over second: slow internet -> opening finish before end of loading what want achieve show entire opening , if page loaded close opening/loader , or if page not loaded wait until end of loading close opening/loader . i thought use $(windows).load("close loader") in case of loading fast loader closed before end of animation. what tried $(window).load(function(){ if( done ){ console.log("bar done"); $("#openingloader").addclass("done"); } done = true; }); and in callback of opening animation if( done ){ console.log("opening done"); $("#openingloader").addclass(...

doctrine2 - Doctrine Many to Many join error -

i trying create many many join products categories tables in zf2 using doctrine 2. in categories entity have /** * @var \doctrine\orm\persistentcollection * * @orm\manytomany(targetentity="application\entity\products", inversedby="categories") * @orm\jointable(name="product_to_category", * joincolumns={@orm\joincolumn(name="category_id", referencedcolumnname="category_id")}, * inversejoincolumns={@orm\joincolumn(name="product_id", referencedcolumnname="product_id")} * ) */ private $products; and in products entity have /** * @var doctrine\orm\persistentcollection * * @orm\manytomany(targetentity="application\entity\categories", mappedby="products") */ private $categories; but keep getting error fatal error: uncaught exception 'doctrine\orm\mapping\mappingexception' message 'the column category_...

php - How to store array data of drag and drop form builder -

i want know what's best way store array data of dynamic form builder in mysql databse , retieve them based on each value? as saying array dynamic , want store mysql . you can define 1 column in db purpose. store the json encoded array output via json_encode() field. and when want retrieve values, read , decode via json_decode() otherwise there no sense create new columns dynamically via code.

sublimetext - Sublime Text: how to enable text replacement -

in notepad++ when select text , type something, automatically deletes selected text , replaces i'm typing now, if i'm typing quote characters. in sublime, if type quote characters inserts these around text instead of replacing it. is possible have sublime text behave notepad++ , replace text no matter i'm typing? in opinion thing can set "auto_match_enabled" property false. can find setting in setting - default of sublimetext preferences. // controls auto pairing of quotes, brackets etc "auto_match_enabled": false,

jquery - Send array data to another page using javascript? -

i want send data page using javascript. using "next" button onclick function. want when click button data in textboxes on page send displayed on page using javascript. <table border="1" id="bill_table" width="50%" align="center" style="border-collapse: collapse" cellspacing="3" cellpadding="5"> <tr style="display:none;"> <td class="style2">&nbsp;</td> <td class="style2"> <div id="name_div"> <input name="item[]" type="text" id="item" size="20" style="width:100px;"/> </div> </td> <td class="style2"> <input name="job[]" type="text" id="job" size="20" style="width:100px;"/> </td> ...

Generate Google Maps with dynamic values of latitude and longitude in javaScript -

i gone through many tutorials , google developer site, everywhere way create google maps particular latitude/longitude given.e.g. function initialize() { var mapoptions = { center: { lat: -34.397, lng: 150.644 }, zoom: 8 }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); } google.maps.event.adddomlistener(window, 'load', initialize); does know javascript code create map based on dynamic values lat/long? mean not specific values -34.397 etc. function initialize pass latitude , longitude arguments , generate map. can please tell me how it? if you're going pass in values lat/lng arguments initialize function couldn't do: function initialize(lat, lng) { var mapoptions = { center: { lat: lat, lng: lng}, zoom: 8 }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); } google.maps.eve...

hadoop2 - YARN log aggregation on a per job basis -

can properties such yarn.log-aggregation-enable , yarn.log-aggregation.retain-seconds applied on per job basis? not enabled @ cluster-wide scale few tasks. currently, there no way aggregate logs specific yarn applications. https://issues.apache.org/jira/browse/yarn-85 seems have attempted provide feature issue still unresolved.

ios - NSMutableData to NSDictionary returning null -

i'm writing program uses instagram api , i'm running issues nsmutabledata , nsdictionary. since have make multiple calls api, decided create nsmutabledata object , append smaller nsdata objects , turn whole thing nsdictionary. however, after make second call nsmutabledata appenddata nsdata, when turn nsmutabledata nsdictionary , dictionary returns null. here's of code. nsmutabledata *userdata = [[nsmutabledata alloc]init] nsdata *feed = [nsdata datawithcontentsofurl:[nsurl urlwithstring:[nsstring stringwithformat:@"https://api.instagram.com/v1/users/17636367/media/recent?access_token=%@",accesstoken]]]; [userdata appenddata:feed]; nsdata *moardata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:[nsstring stringwithformat:@"https://api.instagram.com/v1/users/17636367/media/recent?access_token=%@&max_id=%@",accesstoken, maxid]]]; [userdata appenddata:moardata]; nsdictionary *dicttwo = [nsjsonserialization jsonobjectwithdata:userdat...

python - xmlrpclib error 'module not found' when trying to access gandi api -

i trying set ds record in gandi api describded in gandi api support doc it states 'import xmlrpclib' error 'module not found' (full text reproduced below). i found page use 'from xmlrpc import client', in context, gandi api none responsive. python3 session: >>> import xmlrpclib traceback (most recent call last): file "<pyshell#69>", line 1, in <module> import xmlrpclib importerror: no module named 'xmlrpclib' >>> xmlrpc import client >>> api = xmlrpclib.serverproxy('https://rpc.gandi.net/xmlrpc/') traceback (most recent call last): file "<pyshell#71>", line 1, in <module> api = xmlrpclib.serverproxy('https://rpc.gandi.net/xmlrpc/') nameerror: name 'xmlrpclib' not defined >>> api = xmlclient.serverproxy('https://rpc.gandi.net/xmlrpc/') traceback (most recent call last): file "<pyshell#72>", line 1, in ...

node.js - nodejs & express delete session from sessionStore -

i need check whether user has logged in pc , if terminate previous session. the following code not throw errors when executes, unable end first session either calling destroy() on session store or deleting session id session store using delete. how can terminate session of user using session id ? function test(user_id){ var ss = sessionstore.sessions; for(var sid in ss){ var ses = json.parse(ss[sid]); if(ses.user_id==user_id) { console.log('kill:'+sid) delete ss[sid]; sessionstore.destroy(sid,function(x){}); } } } try this: req.session.destroy(); this works in 4.x express. so in case ss[sid].destroy();

javascript - AngularJS Upload a file and send it to a DB -

i've been trying ngfileupload working can upload images , have them sent db–in case mongolab db accepts json objects can post ed syntax this: $http.post('mymongoname/mydb/mycollection/mytable', {'key': 'value'}) fairly simple. however, i'm confused on how send images uploaded using ngfileupload db. i'm using familiar syntax introduced on ngfileupload's documentation page: $scope.upload = function (files) { if (files && files.length) { (var = 0; < files.length; i++) { var file = files[i]; console.log(file); upload.upload({ url: mymongolaburl, fields: {'sup': 'sup'}, file: file }) }).success(function (data, status, headers, config) { console.log('file ' + config.file.name + 'uploaded. response: ' + data); }); ...