Posts

Showing posts from June, 2010

javascript - Multiple Table Update On (Hands On Table) -

Image
i using handsone table on 3 seperate instances of tables. i declare them can see here. when try save them, data each of tables. to surprise, consolidates of tables. in first picture filled settlement table. i expecting handsontable('getdata') should take data on table. not of data in of handsontable in page. there must cause of why happening? when initializing handsontables, using restarg 3 of instances. using same datasource? you may want have read " understanding binding reference ": http://handsontable.com/demo/understanding_reference.html

A better way to add apostrophes with SQL? - Access VBA -

i'm in middle of creating notepad application access - stay sharp. i've created form housing notepad , several buttons varied functions. notepad saved table called tblcontents memo - because of limit of 255 characters found text. i copied large amount of text , became aware of apostrophe problem. see when saving text table run sql statement which, when adding apostrophes, needs of syntax (which can't remember @ point) in order run. to maintain user entered, apostrophes , all, there way add using same sql? don't want loop through input , have remove apostrophes. here's code adding input user: 'save memo public sub savememo() 'examine memo object forms!frmnotepad!memo 'set focus memo in order length .setfocus if len(.text) > 0 'save table dim memocontents string memocontents = .text dim strsql string strsql = "insert tblcontents (contents)" & _

eclipse - Need to sign and zipalign apk project for android marketplace -

i'm new here , have been reading through of similar questions can't find i'm looking for. we have adroid app has been developed third party(outsourced) , when tried upload onto googleplay says file needs zipaligned. weren't involved in development of app can't seem sorted. i have imported apk file eclipse doesn't let me export android project - doesn't seem recognise it! any appreciated driving me mad now! command "zipalign 4 yourappname.apk" , or ask developer you.

javascript - store all value in variable with comma separate -

i try lat , long value url using ajax. this:- $(function() { var region = "rajkot,jamnagar,surat"; var cn ="in"; var array = region.split(','); for(var item in array) { var lat; $.ajax({ url: "http://services.gisgraphy.com//geocoding/geocode?address="+array[item]+"&country="+cn+"&format=json", async: false, datatype:'jsonp', success: function(data){ lat = data.result[0].lat; lng = data.result[0].lng; alert(lat); } }); } here got latitude , longitude value. want lat value in 1 variable comma seprate. , lng value in variable comma seprate. how possible. help. thanks.... var lat = new array(), lng =

firefox - How to inspect elements using Firebug while building a custom addon -

i building custom firefox addon,but unlike chrome can inspect html within extension cannot same ff. i need style html. clues on how can go this? you can inspect xul , html structure of add-on using dom inspector . to following: start extension , steps until want inspect html open dom inspector via firefox menu > web developer > dom inspector select document of extension via file > inspect content document or file > inspect chrome document then you'll see structure , should able inspect element inside of via inspector tool, accessible via button in upper right corner , works similar 1 in firebug clicking on element inside extension. this tool used firebug working group inspect html structures inside firebug.

java - general purpose Comparator for a TreeMap<Object, T>? -

i need treemap<object, hghandle> objects neither comparable nor there common comparator<object> . the order in tree beeing relevant tree itself, there general comparator use tree? info: want add trivial caching mechanism of database-like library, specialized bulk import. since memory-consuming task, prefer use tree-based map on hashmap, bulkimportcache becomes more space efficient , can grow , shrink required. in order able use treemap must able compare instances intend store in map . might have comparator knows different types of object can stored in map , delegates type-specific comparators based on type. way slice it, must provide comparison mechanism , 1 not exist non- comparable objects.

sql - mysql - MyISAM or InnoDB - Join speed vs Lookup speed -

read question before closing duplicate pls., because there many questions this, @ least didn't find looking for. what clear now: myisam faster @ searching strings (much faster) innodb faster @ joins (much faster) so problem this: have following setup: two tables, lets t1 having columns id , bla1 , bla2 , ..., blan ; , t2 having columns t1id , extra1 , extra2 , ..., extran . table 1 (t1) innodb (needs transactions on that's clear). table 2 (t2) used t1 (is data specific cases), there join between ever t2 appears. point innodb. thing after join search done (always) string inside 1 of columns. point myisam. time sum between join time , search time. problem if optimize 1 make other slower. bonus facts: tables really big, t2 never needs transactions, row lock or whatever impose innodb. what better choice? myisam or innodb? the way sure create 2 tables, load them sample data , measure queries. in general recommend use innodb: since mysql 5.6 full-

html - Horizontal scroll on mobile safari -

i want create page black box in middle, has 30px of padding on left , right hand side. the following code works on desktop browsers without having horizontal scroll, on mobile safari can scroll left , right. how prevent horizontal scroll? i have tried adding overflow: hidden body, outer div , inner div, doesn't seem help. <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>hello world</title> </head> <body style="margin:0;padding:0;"> <div style="padding:0 30px"> <div style="background-color:#000;height: 50px;"> </div> </div> </body> </html> ok, answer wrap div padding on div. <body style="margin:0;padding:0;"> <div> <div style="padding:0 30px"> <div style="background-colo

.net - how to extract string between two symbols -

this question has answer here: extract text between 2 given strings 2 answers i have string this *pmgfec« 1.1gurrala/kalpana*adt 2.1gurrala/bhargavsriram reddy*adt 3.1gurrala/tejasvi reddy*cnn 1 dl 32t 30may q atlams hk3 745p 1040a 31may f /dcdl*f9l4qb /e 2 kl 871n 31may f amsdel hk3 150p 130a 01jun j /dckl*7xzrbf /e 3 ai 560g 01jun j delhyd hk3 650a 850a /dcai*ych0f /e 4 9w 452w 08aug q hydbom hk3 605p 735p /dc9w*pyzjqh /e 5 dl 49t 09aug f bomams*hk3 110a 700a /dcdl*f9l4qb /e 6 dl9390t 09aug f amsdfw*hk3 1045a 155p /dcdl*f9l4qb /e operated klm royal dutch airlines 7 oth yy 09apr w g

java - Hibernate Illegal State Exception -

i new in hibernate , while using hibernate , encounters illegastateexception couple of times, exception not consistent don't know on particular condition happens, never happens happens, unable figure out how can resolved, please shed light on this. may 14, 2013 5:32:40 pm org.apache.catalina.loader.webappclassloader loadclass info: illegal access: web application instance has been stopped already. not load com.mysql.jdbc.profilereventhandlerfactory. eventual following stack trace caused error thrown debugging purposes attempt terminate thread caused illegal access, , has no functional impact. java.lang.illegalstateexception @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1600) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) @ com.mysql.jdbc.connectionimpl.realclose(connectionimpl.java:4412) @ com.mysql.jdbc.connectionimpl.close(connectionimpl.java:1564) @ org.hibernate.service.jdbc.

latex - EPS figures created with MATLAB, edited with Illustrator, Different Colors in after dvipdf prepared PDF -

i create figures in matlab, , export eps using normal file->save dialog box. added additions eps file using adobe illustrator cs6, , saved eps again. viewing eps file evince, looks normal. when adding these figures latex file, compiling normal, converting .dvi pdf using dvipdf, colors of illustrator modified eps come out different. ideas can done fix them? i solve problem following procedure. when save eps file in illustrator, not check "include cmpk postscript in rgb files". colors in compiled latex file won't in dull color.

jquery file upload error: has no method 'abort' -

i'm trying implement cancel action file upload plugin , have issue aborting jqxhr request. $('#filedd').fileupload({ datatype: 'json', url: "", progress: function (e, data) {}, add: function(e, data) { req = data.submit(); settimeout(function(){ req.abort(); }, 100) } ); and result req has not method 'abort' i've tried other options reject() it's ok, doesn't cancel upload (break request). any ideas wrong here?

java - Why is SQLException a checked exception -

can think of rational reason why sqlexception checked exception? yes, there syntax error in query yes, connection might have died yes, there might permission problem etc, etc blah blah blah but practically 100% of time (once you're running in production), there isn't problem. if there problem, calling code can't recover, reason should unchecked . being checked create masses of perfunctory try catch blocks throughout code, has been involved project uses jdbc attest. code clutter significant. because of esoteric nature of sql, myriad of reasons may sqlexception , complexity means can not recover, unless exception caused temporary network problem, in synchronous call, you're sunk anyway because can't wait indefinitely network problem resolved, you're going have fail transaction. typically, calling sql looks this: try { // make sql call(s) } catch {sqlexception e) { // log exception return; // , give } such code adds no value .

regex - PHP trim/rtrim/ltrim VS Regular expression -

i tend use rtrim , ltrim , trim strip off spaces @ end, left or right. use them strip off characters @ end or beginning of string. faster regular expression? there wrong following code? $string = " hello: "; $string = rtrim(trim($string), ":"); //hello would make difference if use regular expression in terms of performance? regular expressions make things slower, applied such small strings, due expression analysis overhead. assuming colon never appear on left side, eliminate rtrim() : $string = trim($string, ": "); // trim either space or colon on either side

extjs4.1 - How to add total row in grid footer in extjs -

i want add total row in grid footer. have total row record available in store. in grid user selects descending order, total row appears first row. can tell me how avoid this? i explain full problem: eg have grid view target target1 target2 getting webservice month target target1 target2 target(2-1) target% jan 500 1000 1001 1 0.99 feb 600 2000 2001 1 0.99 **total 1100 3000 3002 2 2*3002/100** need calculate total% i calculating value target(2-1) target% total value in store , bind store in grid. total column changes. in grid user selects descending order, total row changes. can tell me how avoid this? thanks you should use grid summary feature, instead of regular row. here fiddle demonstrates usage example, , custom summarytype function implements calculation target% total. this better method summary calculation record in store, not trouble sorting , filtering. ha

Running an SSIS Package as a SQL Server Agent Job doesn't copy files? -

i have ssis package can import integration services on server , run no problems. copy files directory on network server running on. when execute sql agent job says job ran no files copied. verify there files in source location , destination path exists. using absolute paths (no mapped drives). why doesn't copy files when run sql agent job? fyi - source directory on unix box , map drive location have enter user/password combination. i have feeling sql agent job runs nt service\sqlserveragent, not user has permission unix box. there way run sql job specific user? thanks in advance. you need create credential , sql agent proxy , , assign proxy account sql agent job step . proxy accounts specific each subsystem ( e.g powershell, cmdexec, ssis, etc. ) -- creating credential use [master] go create credential [superuser] identity = n'domain\account', secret = n'mypassword' go -- creating proxy cmdexec subsystem, adding principal use [msdb] go exe

ios - i have issues in posting a json object -

nsstring *username = @"user"; nsstring *password = @"password"; nsmutabledictionary *dictionnary = [nsmutabledictionary dictionary]; [dictionnary setobject:username forkey:@"user_email"]; [dictionnary setobject:password forkey:@"user_password"]; nslog(@".....%@....",dictionnary); nserror *error = nil; nsdata *jsondata = [nsjsonserialization datawithjsonobject:dictionnary options:kniloptions error:&error]; nsstring *urlstring = @"http://abcd.com/svcs/wsuserservice.svc/mobsignin"; nsurl *url = [nsurl urlwithstring:urlstring]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url]; [request sethttpmethod:@"post"]; [request sethttpbody:jsondata]; nsurlresponse *response = null; nserror *requesterror = null; nsdata *responsedata = [nsurlconnection sendsynchronousrequ

plsql - How do you search for PL/SQL code in Oracle forms fmb files? -

how find code if don't know form it's in. if know form can search pl sql if don't know form? for example know name of field used in code want see don't know code at. i highly recommend formstool - understands fmb, rdf , pll formats natively, can optionally search in object attributes code. shows code search results context (i.e. few lines before , after). http://www.orcl-toolbox.com/formstool/

wpf - IDataErrorInfo best practices -

i working in wpf project using mvvm . what's best practice validate errors using idataerrorinfo ? in model or viewmodel? whats best pattern use implement validation? p.s. using .net 3.5. i think there no right way or wrong way. depends on application , whether or not using different patterns or architectures or have specific needs within wpf application. if using different tiered architecture, put validation within business layer of application. if that's case, use this link . within applications, put validation within viewmodel. obviously, in cases this bad idea, example; if have firstname property within viewmodel, means limiting gui validate firstname property, if set other place. it comes down needs of application , requirements. speaking put them within viewmodel, quick , easy. best practices recommend read through link. i recommend read through following links give better understanding; how use model validation rules in wpf viewmodel or b

css - Float left, float right aren't working -

Image
as can see in jsfidle : .footer { background-image:url('/images/footer_bg.png') bottom repeat-x; height: 110px; } #footercontent { display:table-cell; vertical-align: middle; height:110px; } #leftfoot { float: left; font-family:maven; font-size: 15px; padding-left: 20px; } #rightfoot { float: right; } the #rightfoot right-floated divider isn't displaying on right of page, instead alongside #leftfoot , why this? this happening because #footercontent set display table-cell , has no parent width. width controlled content within. to resolve this, i've given parent divider set display table 100% width: <div id="footercontainer"> <div id="footercontent"> ... </div> </div> #footercontainer { display:table; width:100%; } to align #rightfoot content right, i've given text-align of right: #rightfoot { text-align:right; } jsfiddle .

Knockout.js select 'value' as js object from 'options' which comes from ajax request -

off-top: title pretty confusing, can't find correct words describe situation shortly, sorry that. if you'll find better, please suggest yours. guess i've done simple mistake, since i'm new knockout.js, can't find whole day. here's have: <select data-bind=" value: selectedpm, options: pmlist, optionstext: 'name'"></select> <b>selected pm:</b> <span data-bind="text: selectedpm().name"></span> javascript: function pmmodel(data) { this.name = data.name; this.company = data.company; this.division = data.division; this.empno = data.empno; } function viewmodel() { // data var self = this; self.pmlist = ko.observablearray([]); self.selectedpm = ko.observable(); // operations ko.computed(function () { $.getjson("/cumulativereport/getpmlist", function (alldata) { var mappedtasks = $.map(alldata, function (item)

javascript - Why does the "Column Chooser" icon in footer (navGrid) not visible? (jqGrid) -

i'm new on jqgrid, got started on last week. i'm bit stump on why column chooser not visible. tried 3 different column chooser scripts w/ no luck. downloaded latest jqgrid version w/ no luck. :-( seems not have enough knowledge of jquery , jqgrid work. thanks... <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <!-- force ie use latest version of html, css , javascript instead of being forced use 1 specific ie version --> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <title>blah</title> <link rel="stylesheet" type="text/css" href="css/jquery-ui-v1.10.3.themes/base/minified/jquery-ui.min.css" /> <link rel="stylesheet" type="text/css" href="css/jqgrid-v4.5.0/ui.jqgrid.css" /> <link rel="stylesheet" type=&quo

c++ - compile a Qt single file from command line: undefined reference to vtable -

i'd compile single file qt application command line, test in quick way features. see code of file below. i'm compiling with: qmake -project && qmake && make and i' getting error: togglebutton.o:togglebutton.cpp:function buttondialog::buttondialog(qwidget*): error: undefined reference 'vtable buttondialog' togglebutton.o:togglebutton.cpp:function buttondialog::buttondialog(qwidget*): error: undefined reference 'vtable buttondialog' togglebutton.o:togglebutton.cpp:function buttondialog::~buttondialog(): error: undefined reference 'vtable buttondialog' togglebutton.o:togglebutton.cpp:function buttondialog::~buttondialog(): error: undefined reference 'vtable buttondialog' i'm not c++ guru, i've tried google undefined reference vtable don't understad why i'm getting error 1 file.. someone can me in understaning undefined vtable error? /* * copyright (c) 2006-2007, johan thelin * * rights reserv

android - Issue on httpost, send multiple variables -

i have code here, now, i'm able send value parameter, can't send others. what should in order send other values of edittext type? i.e want able send : mbiemer httpost method...but how.. thanks public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.home_layout); value=(edittext)findviewbyid(r.id.edittext1); mbiemer=(edittext)findviewbyid(r.id.msgmbiemer); telefon=(edittext)findviewbyid(r.id.msgtelefon); adresa=(edittext)findviewbyid(r.id.msgadresa); ora=(edittext)findviewbyid(r.id.msgora); per=(edittext)findviewbyid(r.id.msgper); dyqan=(edittext)findviewbyid(r.id.msgdyqan); statusi=(edittext)findviewbyid(r.id.msgstatusi); btn=(button)findviewbyid(r.id.button1); pb=(progressbar)findviewbyid(r.id.progressbar1); pb.setvisibility(view.gone); btn.setonclicklistener(this); } @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.

teradata - How can "bad" views be identified? -

at workplace, have separate teradata databases manage tables versus views. "tables" database has tables data while "views" database has views. access 2 databases managed roles: "developers" have permission create tables in "tables" , create views in "views"; "consumers" have "read" access "views" databases. over time, views have become "bad" in base tables refer no longer exist. caused when developer dropped table @ end of analysis , forgot drop corresponding view. question: there "easy" way identify views no longer associated valid tables? i considering writing test script execute select count(*) on each view in "views" database; if test fails i'd know wrong view. know how (and work), thought i'd ask if there better way. i have written approach can used find broken views here . using stored procedure, couple of cursors, , prepare statement ca

java - CCTMXTiledMap not showing on Android screen -

i'm adding cctmxtiledmap android project it's not showing on screen. this tried. created map tiled, changed compression in base64 gzip rid of indexoutofbounds issue, , loading generic code: cctmxtiledmap map = cctmxtiledmap.tiledmap("sewer.tmx"); addchild(map); i tried different values in addchild method, such as addchild(map, 0) or -1, or 1, no luck. here's debug data: map = <instance of class org.cocos2d.layers.cctmxtiledmap| tag = -1> map bounding box d=((0.0, 0.0),(768.0, 768.0)) map bounding anchor point =(0.0, 0.0) map bounding position =(0.0, 0.0) map bounding content size =<768.0, 768.0> chidren =[<instance of class org.cocos2d.layers.cctmxlayer| tag = 0>] my tmx file: <?xml version="1.0" encoding="utf-8"?> <map version="1.0" orientation="orthogonal" width="32" height="32" tilewidth="24" tileheight="24"> <tileset firstgid=&

clojure - Examples for ipython backends in other languages? -

at pycon2013, found out possible ipython notebook used other languages bu writing different backend. in ipython docs, have seen page on protocol, , mention servers have been written perl , ruby. interested in 1 clojure. where find code sample non-python backend evaluate if clojure backend practical thing, in terms of time , expertise can devote it? ihaskell-notebook integrates haskell ipython. ihaskell wraps around ipython run haskell.

sqlite - timeseries database to use with python -

i have application written in python, stores values in text file in format of "datetime value". worked fine far. the problem need start retrieving data time intervals. have converted files sqlite database. find performance poor. ran queries like: select min(value) data dt > '2013-05-13 15:48:13' , dt < '2013-05-13 15:49:13' so lowest time interval 1m. but seems take abou 0.036s slow when need produce graphs small time intervals. what other approach suggest use problem. if don't have tooooo data, load memory pandas timeseries. import pandas pd ts = pd.timeseries(range(86400), index=pd.datetimeindex(start='2013-05-14 00:00:00', freq='1s', periods=86400)) creates timeseries 86400 values each second of today's day. the following line needs 2.72ms , returns value awaited: ts.between_time('2013-05-14 15:48:13', '2013-05-14 15:49:13').min() you can have different frequency , not equall

What is wrong with this use of Application context in Android? -

i abstract model this:first there class userinfo holds user information: public class userinfo extends application{ private int userid; public void setuserid(int id) { userid=id; } public int getuserid() { return userid; } } then in mainactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); ... userinfo=(userinfo)getapplication(); userinfo.setuserid(1354); .... intent intent=new intent(mainactivity.this,voteactivity.class); startactivity(intent); } public @override void onresume() { super.onresume(); textview text=(textview)mainactivity.this.findviewbyid(r.id.usernametext); text.settext(userinfo.getuserid()+" "); } and in voteactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_vote); userinfo=(userinfo)getapplication();

c# - Best datatype for storing html -

i need store html in 1 of varibles in class, datatype suggest? string ok or there special datatype can use kind of operation. string if you're storing raw html. if planning on storing object-representation of html, use object. however, if it's raw html string, you'd use string . there's nothing specially suited type of string content. actually, there kindof is, has specialist usage represent already-encoded html data should not encoded again (generally used output raw html in asp.net). isn't want, answer complete - htmlstring .

Store images/videos into Hadoop HDFS -

i store videos/images hadoop hdfs , heard hdfs accepts files text. to sure, can store videos/images hdfs? if yes, what's way or steps follow that? it absolutely possible without doing extra. hadoop provides facility read/write binary files. so, practically can converted bytes can stored hdfs(images, videos etc). hadoop provides called sequencefiles . sequencefile flat file consisting of binary key/value pairs. sequencefile provides writer, reader , sorter classes writing, reading , sorting respectively. so, convert image/video file seuencefile , store hdfs. here small piece of code take image file , convert sequencefile, name of file key , image content value : public class imagetoseq { public static void main(string args[]) throws exception { configuration confhadoop = new configuration(); confhadoop.addresource(new path("/hadoop/projects/hadoop-1.0.4/conf/core-site.xml")); confhadoop.addresource(new path("/hadoop/p

c++ - can't build example boost serialization -

i have tried build first example found here: boost serialization tutorial error: undefined symbols: "boost::archive::archive_exception::~archive_exception()", referenced from: void boost::serialization::throw_exception<boost::archive::archive_exception>(boost::archive::archive_exception const&)in main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<int>(int&)in main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in main.o void boost::archive::basic_text_iprimitive<std::basic_istream<char, std::char_traits<char> > >::load<float>(float&)in main.o boost::archive::basic_text_oprimitive<std::basic_

c++ - How to close a program while not in main -

this question has answer here: how make c++ console program exit? 11 answers how can close program in c? 4 answers is there line in c++ allows me terminate program while not in main()? for example, code if die have quit game? don't want rely on "trust" system. is there line in c++ allows me terminate program while not in main()? i not use word "line" here - better "function". normal termination, can use std::exit() (also see § 18.5/8 of c++11 standard): #include <cstdlib> void foo() { std::exit(exit_success); } int main() { foo(); } here live example .

delphi - Which midas.dll to use? 32bit datasnap/64bit server -

considering following: have 32 bit datasnap server installed on 64 bit windows server in embarcadero\rad studio\11.00\redist 2 folders : 32 bit , 64 bit, in each midas.dll. wich file should put where? in windows\system32 or windows\syswow64 ? never put in windows system directories (unless have very, very, reason write there). it's bad practice (dating windows 3.x times , poor developers skills, because dirs in search path) leading troubles (i.e. if application chnages dll own little or no checks). put dll in application folder. ensure application uses correct version of dll. or if have write elsewhere very, very, reason use 1 of techniques add directory search path or redirect dll loading. windows system directories must regarded operating system private ones. kind of practices windows doesn't forbids enough makes windows slow , unstable system. if you're application 32 bit, need 32 bit dll regarless of operating system.

html5 - Configuration file for mobile web app -

i'm creating web application in html5/phonegap. want have configuration file can specify ip addresses of servers have use in app , information user. how should this? thanks if developing application using phonegap framework can configure whole application using 2 ways. using user interface of phonegap account.go settings of application in phonegap account can configure application. using config.xml file there in application root folder.here link 1 example: config.xml

no jQuery on inserted HTML -

i have jquery loaded in head of page, on click of elements class. $(function(){ $(".addtocal").click(function(){ $(this).next('.addtocaloptions').fadein('fast'); return false; } ); }); it works .addtocal elements present on page. not bunch of similar elements inserted in page later jquery .load function. now i'm pretty sure have use "a delegated-events approachth" .on() function. right? this doesn't work, though: $(function(){ $("a").on("click", ".addtocal", function(){ $(this).next('.addtocaloptions').fadein('fast'); } ); }); i'm lost. thoughts? thanks! you use document delegate, because delegate have static (not dynamically added): $(function(){ $(document).on("click", ".addtocal", function(){ $(this).next('.addtocaloptions').fadein('fast'); } ); but better use closest static container instead of document.

Why is my JavaScript code behaving strange? -

could explain why delete works in second function not in first? var myfunction = (function (val) { delete val; return val; })(10); console.log(myfunction); var myfunction1 = (function () { myvar = "test" delete myvar; return myvar; })(); console.log(myfunction1); the delete operator deleting properties, not objects. in first function, val variable , can never deleted. in function2 myvar declared using shorthand create property on global object, , properties can deleted. in fact main purpose of delete operator. also delete operator returns boolean value. can use better understanding of how works eg: in case console.log(delete val); print false , console.log(delete myvar); print true. worth keeping in mind return value based on whether object exists afterwards, not whether delete successful.

Knockout.js - Multiple ViewModels per page; page-wide functions with different model contexts -

i building huge page multiple forms on user fill out in sequence. i want make each section own model , planning on having masterviewmodel imports submodels. each section, however, has edit & save buttons have same functions: edit toggles model edit mode save validates inputs, saves data (via ajax), , toggle state of model back the difference between sets of buttons model context. i'm having trouble making page-level save & edit function can reference different models using masterviewmodel/subviewmodels. does have guidance on this? thanks. if had function on root view model, can call anywhere click: $root.save . when knockout calls function set context (this) current data , pass first argument. so, first argument contain current model , can process there. here sample: http://jsfiddle.net/rniemeyer/v22gd/ var viewmodel = { one: { name: ko.observable("bob") }, two: { name: ko.observable("sue&

git - Bash Script to Backup MySQL databases starting with specified prefix -

obviously if google search, there tons of results bash scripts mysql database. couldn't find specific example though. say start new web projects @ dev.example.com/newprojectname i prefix tables project name, newprojectname_posts, newprojectname_pages, etc. everytime make change, want run command , specify database , table prefix so, command tablename prefix have .sql file git push thanks you can use script: #!/bin/bash tables=( $(mysql "$1" --silent -e "show tables '${2}_%'") ) t in "${tables[@]}"; mysqldump "$1" "$t" done then run this: command databasename newprojectname >backup.sql it backup tables starting newprojectname_ (note included underscore).