Posts

Showing posts from May, 2011

jquery - Correct Javascript syntax for concatenation -

i trying pull locations using foursquare api, , seemingly not writing syntax correctly. address = '<p><a href="http://maps.google.com/?q="' + venues.location.address + '">' + venues.location.address + '</p>'; although not throwing error, results in following code: <a href="http://maps.google.com/?q=">correct business name</a> the point is, query string google maps uses missing, , showing correctly in link text. doing wrong concatenation / syntax? try this: address = '<p>' + '<a href="http://maps.google.com/?q=' + encodeuricomponent(venues.location.address) + '">' + venues.location.address + '</p>';

plugins - Coding numerous instances of jQuery underlines -

i'm using custom jquery plugin creates customisable text underlines script. plugin creates these underlines on mouseover events. far have managed customise underlines permanent , load web page struggling create numerous instances of underline on 1 web page, reason despite use of classes, 1 underline can exist @ time. here jquery; (function($){ $.fn.underline = function(options) { var defaults = { width: 1, distance: 0, color: '#000', durationon: 250, durationoff: 250, extend: 2, }; var options = $.extend(defaults, options); $('body').append('<div class="underlineline"></div>'); $('.underlineline') var position = $(this).offset(); var top = position.top; var left = position.left;

android - NullPointerException while opening database through a fragment -

i trying populate listfragment 1 of columns in database. trying use @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); db.open(); db = new notesdatabase(getactivity()); c = db.getallrows(); getactivity().startmanagingcursor(c); string[] fromfield = new string[] { notesdatabase.key_title }; int[] toview = new int[] { r.id.item_title }; simplecursoradapter mycadapter = new simplecursoradapter(getactivity(), r.layout.list_item, c, fromfield, toview, 0); setlistadapter(mycadapter); } but dont know why getting nullpointerexception on db.open(); , c = db.getallrows(); db.open() public notesdatabase open() { db = mydbhelper.getwritabledatabase(); return this; } db.getallrows(); public cursor getallrows() { string = null; cursor c = db.query(true, database_table, all_keys, where, null, null, null, null, null)

sql - Updating a record on another table that corresponds to the same record -

i trying update record on table. have first table infodetailstable has bunch of records 1 of values being kitnumber . in infodetailstable table updating checkboxes, , when change supposed update reason value of table, infotable . i'm not quite sure how work update statement can update specific infotable record based on record changed in infodetailstable . here code: currentdb.execute " update infotable set reason = 'blah' kitnumber = " & infodetailstable.kitnumber so infotable has reason , kitnumber while infodetails has kitnumber because in relationship kitnumber on infotable primary key. if great. thank you edit: here more code maybe help. if usbcheck = true , threewaycheck = true , car1check = true , car2check = true currentdb.execute " update infotable set reason = '' kitnumber = " & infodetailstable.kitnumber elseif usbcheck = false or threewaycheck = false or car1check = false or car2check = false cur

c# call child method from parent list -

i have following problem: have list of usercontrols wizard application , need call child method list<usercontrol> steps = new list<usercontrol>(); steps.add(new step1()); steps.add(new step2()); steps.add(new step3()); steps.add(new step4()); all have stoptimeout() method. how can call: steps[0].stoptimeout(); ? thank you. well, did it: steps[0].stoptimeout(); just declare in base class of step classes stoptimeout method protected or public example: public step : usercontrol { .... public virtual void stoptimeout() { //base implementation } } public step1 : step { public override void stoptimeout() { //child implementation } } public step2 : step { public override void stoptimeout() { //child implementation } } .. and in code: list<step> steps = new list<step>(); steps.add(new step1()); steps.add(new step2()); ..

python - Any way to speed up this pandas comparison? -

i have python script slurping odd log files , putting them pandas.dataframe can stat analysis. since logs snapshot of processes @ 5 minute intervals, when read each file checking new lines against data entered last file see if same process before (in case update time on existing record). works okay, can surprisingly slow when individual logs on 100,000 lines. when profile performance, there few stand-outs, show lot of time spent in simple function, comparing series against rows carried-over previous log: def carryover(s,df,ids): # see if pd.series (s) matches rows in pd.dataframe (df) given indices (ids) id in ids: r = df.iloc[id] if (r['a']==s['a'] , r['b']==s['b'] , r['c']==s['c'] , r['d']==s['d'] , r['e']==s['e'] , r['f']==s['f'] ): return id return none i'd figure pretty eff

c# - To inherit or not to inherit? Some professional opinions wanted -

i designing c# asp.net web application uses lot of common functionality , right way deal seems through inheritence. plan make base class (person) , inherit in other classes employee , vendor, , in turn inherit employee manager, etc. way don't have define common properties such firstname, lastname, phonenumber, etc. on each 1 of them. the second part of questions this: if use inheritence , use entity framework's codefirst entities, understand inheritence? how data stored in tables? each table have firstname , lastname column, or ef smart enough make them common table? i hoping real object oriented programmer out there can me clear up. have gotten lot of conficting information , need actual experience on ef projects give me guidance. understanding inheritence right? if not, getting wrong? appreciated. thanks, bert this not easy question, cases it's better choose composition instead of inheritance. should not derive cash dispenser calculator because calcul

When should I use quotes in git? -

for sake of example, presume have directory/ nameoffile.txt nameofdirectory/ ... i have been using format git add directory/nameof* in different documentation, have seen git add 'directory/nameof*' . just tried git add "directory/nameof*" , worked. also tried git commit -m message no quotes , worked too. so git allow no quotes/quotes interchangably or circumstances or versions? beyond allow, standard protocols no quotes, single, , double quotes? this question has nothing git , shell. most shells "tokenize" command line -- is, split sequence of discrete elements -- using whitespace. so, example... rm 1 file ...will attempt remove file named one , file named file , whereas... rm 'one file' ...will attempt remove single file named one file . examples, using quotes or not doesn't particularly matter, because none of filenames contains spaces. 1 exception commit example; if message

Browsing into a folder in Hadoop -

Image
i ssh debvox hadoop , if saay hadoop fs -ls lot of files including drwxr-xr-x - root hadoop 0 2013-07-11 17:49 sandeep drwxr-xr-x - root hadoop 0 2013-04-10 14:13 testprocedure drwxr-xr-x - root hadoop 0 2013-04-03 13:56 tmp i need go inside tmp folder, took @ hadoop shell commands in here still didn't find command it. http://hadoop.apache.org/docs/r0.18.3/hdfs_shell.html so what's command go folder? specify directory name, follows: hadoop fs -ls tmp sample output demo vm: hadoop fs -ls [cloudera@localhost ~]$ hadoop fs -ls found 12 items -rw-r--r-- 1 cloudera supergroup 46 2013-06-18 21:18 /user/cloudera/filewrite.txt -rw-r--r-- 1 cloudera supergroup 13 2013-06-18 15:34 /user/cloudera/helloworld.txt drwxr-xr-x - cloudera supergroup 0 2013-07-01 22:07 /user/cloudera/hiveext drwxr-xr-x - cloudera supergroup 0 2012-06-12 15:10 /user/cloudera/input -rw-r--r-- 1 cloudera super

osx - Java errors on MacOS 10.8.4 using MatLab2013a -

i experiencing numerous problems java in matlab 2013a, example while using pmode, matlabpool, creating stand alone applications etc. sometimes there work-around not case. does has solution problem. there patch or downgraded java version works you? i believe different java disaster 1 @jamesgrammatikos pointed out. had figure out myself on r2012b. see this bug report @ mathworks. apply workaround, read , follow directions didn't try hard make patch sort of installer. once, applied, works again, looking @ patch code, there's still room other stuff break.

PayPal recurring payments profile with initial amount - potential 24 hour delay even for initial amount? -

we're setting recurring payment initial amount specified. want give subscriber pretty immediate access content, want give user access content if initial payment successful. the paypal documentation says recurring payments profile may take 24 hours activate. does mean initial payment may not come through 24 hours? mean should not use method of charging first period if want give user immediate access content? what best way forward? amount of optional transaction. required when optionaltrx=s. optionaltrx defines optional authorization validating account information or charging initial fee. if transaction fails, profile not generated.hope system check whether transaction sucessfull

sql server - T-SQL: Filter with Dynamic Comparison Operator (=, <=, >=, ...) -

this question has answer here: passing operand sql parameter 3 answers i'm creating reporting tool user can pick operator , 2 values filter on. my basic table: userid username ------------------------------- 1 user1 2 user2 3 user3 4 user4 5 user5 the user can choose operator i'd translate this: option sql operator ------------------------------ between column between x , y column '%' + x + '%' greater column > x less column < x equal column = x not equal column <> x i thinking of similar to: ... column = isnull(@parameter, column) in sense if pass or nothing, still query correctly. here's tsql i'm playing (** not work * ): declare @bwvalue1 varchar(200) = '2', --between value 1 @bwvalue2 varchar(200) = '

MySQL CASE not working in Stored Procedure -

this works fine. if change @unit_type variable. correct unit type comes out in calculation. set @unit_type = 'kilometers'; set @lat = 50; set @lon = 100; set @lat2 = 51; set @lon2 = 101; select (case @unit_type when 'feet' 20000000 when 'miles' 3696.1 when 'meters' 6979100 when 'kilometers' 6979 end * acos( cos( radians(@lat) ) * cos( radians( @lat2 ) ) * cos( radians( @lon2 ) - radians(@lon) ) + sin( radians(@lat) ) * sin( radians( @lat2 ) ) ) ) distance; this however, not. when try run stored procedure, return in kilometers every time. , if delete case kilometers, result null. create procedure `anothertest`(in `lat` bigint, in `lon` bigint, in `lat2` bigint, in `lon2` bigint, in `unit_type` text) language sql not deterministic contains sql sql security definer comment '' begin select (case @unit_type when 'feet&#

jquery - Get DIV's height with overflow-y:scroll and updated content -

i have regular empty div overflow-y:scroll; update div content via $(elem).html(new_content); now lost. need height of entire div new content. it'd done through scrolltop setting problem $(elem)[0].scrollheight zero!! how solve issue? update: solved issue. turns out call in callback function of jquery ui effect. call function supposed bring div visible. somehow though it's callback function div still not visible. so, had settimeout 10 ms , worked!!! use .height() , check every time update div function newcontent(){ $('#test').html(new_content); var h = $('#test').height(); console.log('new height ' + h); } here's working jsfiddle: http://jsfiddle.net/f5k6h/

python - How to load an object into memory for entire django project to see? -

i'd assume loaded settings.py, , object imported settings, wanted know if there more standard or recommended way this. people load items entire project needs see? ex. # settings.py ... something_large = json.loads(...) # whatever models.py, views.py, etc project.settings import something_large #is proper way it? thanks. you load in, say, data module in app make cleaner. (i'm showing how load file same directory module in.) project/ settings.py ... myapp/ __init__.py data.py huge_static_data.json models.py ... myapp/data.py : with file(os.path.join(os.dirname(__file__), "huge_static_data.json")) in_f: something_large = json.load(in_f) myapp/models.py : from myapp.data import something_large python's import system ensures data loaded once, when module first imported.

html - Horizontal Scroll bar appearing on website -

this question has answer here: hide html horizontal not vertical scrollbar 8 answers there horizontal scroll bar appearing here on chrome: http://www.marketingagencyleeds.co.uk/ i not quite sure causing this. any appreciated. thanks it's appearing because container widths 1200px , if screen width less that... you'll scroll bar. if want hide scroll bar, add overflow-x: hidden body element

Selecting Some Hashes From Set of Hashes Based On Value In Ruby -

overall problem i'm solving: i'm pretty new ruby , working on creating search method app in user searches name of 1 model, foo, may have many instances of name, , return results of related instances of model, day. however, each foo has multiple versions of day associated (there 4 different versions total can associated with. display versions through foo, , foo contains them in booleans: include_in_standard, include_in_v1, etc.). i need search method let me know versions foo included each day, can display search results accordingly. also, days available different kinds of users. i've gotten i'm passing information on days , versions out of model controller, however, in controller, i'm having problem getting days available current user. the structure of code: in model day, have search method returns following: results={:result_case=>result_case, :days_set=>days_set, :term0=>term0, :term1=>term1} result_case integer, term0 , term1 strings.

excel vba - how to copy whole rows (absolute references) -

i have make macro copies, whole rows of excel sheet (incluiding absolute references or formulas), , pastes them in lower part acording comparison. mean have copy not content of cell, absolute reference or formula, if cell modified change reflected on part had copied cell. rows copied acording comparasion made between text in string , on cells of row going copied. tricky part far has been how copy absolute reference or formula here code have far... sub foo() dim long, imatches long dim atokens() string atokens = split("dcv-", ",") each cell in activesheet.range("i1:i104") if (len(cell.value) <> 0) = 0 ubound(atokens) if instr(1, cell.value, atokens(i), vbtextcompare) imatches = (imatches + 1) activesheet.rows(cell.row).copy activesheet.rows(imatches + 105) 'sheets("dp_pa 9.70 rev").rows(cell.row).copy sheets("dp_pa 9.70 rev").

java - problems with R - ANDROID -

when create layout called " main.xml ": <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="10dip" android:layout_width="fill_parent" android:layout_height="wrap_content"> <button android:id="@+id/button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/button" /> <spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </linearlayout> when go main create button " button = (button) findviewbyid(r.id.button); " have error , cant find button in r.id , same spinner id dont exist in r.id help me plz

python - Creating api tokens for third parties -

i'm working on application third parties interested in integrating us. create token each user , wondering efficient , common way in django? tried find one, , found looks promising: https://github.com/jpulgarin/django-tokenapi obviously out of box wont work, can implement similarly. above project uses sha hashing algorithm. safe use or md5 api tokens? appreciated! when you're choosing api keys, 2 factors you're looking are infeasable guess. mean key must appear random , long brute force is unique. means no 2 users can accidentally same api key. can enforce database uniqueness constraints. remember, if you're using 1 key, must enable ssl on of api endpoints. having keys stolen in transit bad, m'kay? now, implementation, if you're using own custom views serve api, https://github.com/jpulgarin/django-tokenapi should work you. if, you're using tasypie or similar, may want use built-in authorization code, including api-key managemen

ios - Dereferencing a __weak pointer is not allowed inside block -

apple docs can avoid strong reference cycle capturing weak reference self, this: - (void)configureblock { xyzblockkeeper * __weak weakself = self; self.block = ^{ [weakself dosomething]; // capture weak reference // avoid reference cycle } } yet when write code, compiler tells me: dereferencing __weak pointer not allowed due possible null value caused race condition, assign strong variable first yet doesn't following code create strong reference cycle, , possibly leak memory? - (void)configureblock { xyzblockkeeper *strongself = self; self.block = ^{ [strongself dosomething]; } } you should use one: eg: __weak xyzblockkeeper *weakself = self; self.block = ^{ xyzblockkeeper *strongself = weakself; if (strongself) { [strongself dosomething]; } else { // bummer. <self> dealloc before run code. } }

jquery validate showing previous errors for valid field -

just started using jquery validate , i'm getting multiple errors fields invalid. moved error container , can see errors still there after field corrected. end bunch of errors stacked on top of each other. see "current" errors. you can see mean here: http://opiemedia.com/dev/lo/sv/varb/ this im using form validation $(document).ready(function() { $("#evalfrm").validate({ rules: { name: { required: true, minlength: 2, }, company: { minlength: 2, }, email: { required: true, email: true, }, phone: { required:true, minlength: 7, } }, errorlabelcontainer: "#evalerr", errorclass: "error label label-warning" }); }); this html <div class="span8 well" style="margin-left:0;"> <form id="evalfrm action="#" method="post" class="evalfrm" name="evalfrm">

android - EditText field displaying data on different tabs -

Image
i'm having pretty strange issues app. have edittext element, lets call display, in reused fragment each tab. every time launch app see following initial behaviour when click button sends text output display. not use system keyboard, buttons send display. the best way think of web browser tabs, can edit url in each tab independently, , buttons, live below in other 2 sections, supply input. it's not web browser, analogy works. don't click on -> text drawn in b tab click on b -> text drawn in c tab click on c -> text drawn in c tab click on b -> click on c -> app crashes i might running fencepost error i'm not sure. can text draw in a's output after click or two. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.container); midpager = (viewpager) findviewbyid(r.id.function_container); toppager = (viewpager) findviewbyid(r.id.top_container); mi

java - HoloColorsGenerator and ActionBarSherlock crashing -

here did: create new android project added actionbarsherlock added action bar color generator files tested application - running on 2.x , 4.x action bar colors create files through holo color generator added holo color generator files project did not change theme or anything. of right now, application should still run, didn't change themes in manifest or styles. tested application - tried running on 2.x , 4.x crashes every time i don't understand how application can crashing if never set new styles/theme. i same crash on every device version. logcat: 07-23 23:32:31.942: e/androidruntime(13026): fatal exception: main 07-23 23:32:31.942: e/androidruntime(13026): java.lang.runtimeexception: unable start activity componentinfo{com.example.whatthe/com.example.whatthe.mainactivity}: android.view.inflateexception: binary xml file line #1: error inflating class android.widget.relativelayout 07-23 23:32:31.942: e/androidruntime(13026): @ android.app.activitythr

java - JPanel, instantiate an array of JButtons -

i having trouble putting panel class main class. can't seem instantiate , register buttons actionperformed method. project suppose use grid layout 9 input buttons (3 other buttons enter, space, , clear) display the input on jtextarea. believe have panel class set correctly, having problems putting jbutton array, , registering actionperformed method. pointers appreciated. (side question, how copy , paste code being taken in code block?) import java.awt.dimension; import java.awt.gridlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jscrollpane; import javax.swing.jtextarea; public class textbuttons extends jframe implements actionlistener { private jbutton[] buttons; private jtextarea textarea; private final int enter; //index of enter button in buttons private final int space; //index of space button in buttons private

dom - document.location.href got javascript:window["contents"] -

the return value of document.location.href become javascript:window["contents"] sometimes. when happened? how avoid it? i found out code placed in iframe without src url. <iframe id="google_ads_iframe_/21202031/ltn-000-03-home-120x600-display_0" name="google_ads_iframe_/21202031/ltn-000-03-home-120x600-display_0" width="120" height="600" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" src="javascript:&quot;<html><body style='background:transparent'></body></html>&quot;" style="border: 0px; vertical-align: bottom;"></iframe> as have suspected, indeed has (i)frames , more specifically, way scripts/libraries work frames. it a technique avoid referenceerror (in ie) in cases when loading external javascript (that loaded asynchronous) holds/provides variables/objects used in frame's inline

c++ - Rectangle Bounce collision detection -

i've created program using sdl in rectangle continuously collides within walls of program, collision checking not working properly. here code:` int main(int argc, char *argv[]){ //variable initialization] width = height = 45; srcx = srcy = 0; desty = destx = 0; vlc = 1; sdl_init(sdl_init_video); screen = sdl_setvideomode(640, 480, 32, sdl_swsurface); sdl_wm_setcaption("bouncing balls","./ball.jpg"); backg = img_load("./back.png"); ball = img_load("./ball.jpg"); while (checkbounce){ //increase velocity destx += vlc; desty += vlc; //collision checking if (destx < 0){ destx = 0; vlc = -vlc; destx += vlc; } if (desty < 0){ desty = 0; vlc = -vlc; desty += vlc; } if (desty + height > 480){ desty = 480 - height; vlc = -vlc; } if (destx + width > 640){

c++ - Why does Implicit DLL Linking need relevant Lib file but Explicit Linking does not? -

in windows environment, when tried link dll program explicitly (using loadlibrary), first need define function pointers according each function signature inside dll. then function addresses using 'getprocaddress' , assign them pointers. when tried link dll program implicitly (using header file) first need relevant header file function signatures. then needs relevant lib file generated dll. my questions are why implicitly linking need lib file well? what information need retrieve 'lib' file cannot dll or header file ? if there question 2, how information retrieved when explicitly loading? i've gone trough this question. cannnot understand worthy reason. please, explain in simple terms. thank you. why implicitly linking need lib file too. the .libs have import information of dll, can check information using dumpbin command included in windows/visual studio sdk. this link information of recv inside ws2_32.lib example:

html - Keeping background image fixed with responsive design -

if take here: https://quirktools.com/screenfly/#u=http%3a//logan-gabriel.com&w=1600&h=900&a=1&s=1 there's small white margin on right side of screen. shouldn't case, background image should fixed right right edge. if try other smaller resolutions, you'll notice behavior. once screen gets large of width (1600px), fails. any ideas why happening? thanks guys. hey set image width auto #image { width:auto;//you have set 40% causes issue }

python - What's the simplest way to assign list members to different variables? -

the way was: var1 = list[0] var2 = list[1] var3 = list[2] var4 = list[3] ... is there simpler way? var1, var2, var3, var4 = l this assumes l 4 elements long. of time, want that, if don't, var1, var2, var3, var4 = l[:4] will ignore elements.

indexing - SML: get index of item in list -

i'm new sml , i'm attempting index of item in list. know using list.nth give me value of item @ index position, want index value. there may built in function i'm not aware of. in case, list not contain duplicates if item in list index, if not returns ~1. here code have far. works, don't think clean: val l=[1,2,3,4,5]; val m=length l-1; fun index(item, m, l)=if m<0 ~1 else if list.nth(l, m)=item m else index(item,m-1,l); to elaborate on previous comment, suggest changes implementation fits better in ml idiom: fun index(item, xs) = let fun index'(m, nil) = none | index'(m, x::xr) = if x = item m else index'(m + 1, xr) in index'(0, xs) end the individual changes are: have index return value of type int option . none means item not in list, some i means in list, , index of first occurrence i . way, no special values ( ~1 ) need used , function's intended usage can inferred type. hide parameter m

How to set Margin Left ,Margin top,Margin right and Margin Bottom alignment for popup window dynamically in android -

i doing android application contains popup window named mypopup. contains image button , 4 textviews. want align popup window dynamically margin top,margin bottom,margin left , margin right parameters..in code setmargin method not working..please me this... it depends layout using. below example places relativelayout in linearlayout. linearlayout linearlayoutparent; relativelayout relativelayout; relativelayout.layoutparams margin = new relativelayout.layoutparams(relativelayout.layoutparams.fill_parent, relativelayout.layoutparams.wrap_content); margin.setmargins(0, 0, 0, 7); //7px bottom margin //create linear , relative layouts //...add other stuff here... // add view margins linearlayoutparent.addview(relativelayout, margin);

HTML/CSS layout - dynamic width -

i'am quite new in web developement , i'm facing following problem: i have parent div width , height unknown , i'd divide div 4 parts follows: +-------------------------------------------------------------------------+ |+---------------+ +--------------------+ +------------+ +---------------+| ||div 1 | |div 2 | |div 3 | |div 4 || ||width: n px | |widht: n px | |width: 50px | |width: n px || |+---------------+ +--------------------+ +------------+ +---------------+| +-------------------------------------------------------------------------+ so div1, div2 , div4 need have same width whereas div3 has static width of 50px. until have achieved using helper containers: diva = "position:absolute; width:66.6%" divb = "position:absolute;left:0px;right:50px" div1 = "width:50%" div2 = "width:50%" div3 = "pos

javascript - DIV "hiding" when changing dropdown value -

this related previous question asked: hide / show multiple divs i have code in place previous question , seems work ok apart when change value in dropdown "after" ticket selection made. i have number of javascrpts in place wondering if there clash somewhere? first bit of code in head of document. <head> <script type="text/javascript"> $(function() { $('.cat_dropdown').change(function() { $('#paymethod').toggle($(this).val() >= 2); }); }); </script> <script type="text/javascript"> $(document).ready(function () { $(".paymentmethod").click(function () { $(".paymentinfo").hide(); switch ($(this).val()) { case "credit card authorisation": $("#pay0").show("slow"); break;

MATLAB, turning numbers off on plot -

i'm pretty familiar of axis properties matlab plot, can't seem find of them effect displaying numbers or not. have plot numbers pretty meaningless, they're there visual representation of i'm working on. so, better if have numbers gone compeltely. there way this? thanks. (no not tick marks or of that, actualy numbers! =)) it's not tick marks you're after tick labels. set them empty lists: set(gca,'xticklabel', [], 'yticklabel', [])

mysql - Rows are deleted without using delete query -

i have strange problem in database. rows deleted when updated. don't use delete query anywhere. have history log logs data updation. can find particular row after updation on log (i have old data , updated data). after happens. can't figure out. particular row missing. i have update trigger: if (new.plandatevisite<>old.plandatevisite)then begin -- insert reportplanhisto (report_id,plandatevisite) values(old.id,new.plandatevisite); -- commented end; end if; please help. in advance

html - unable to populate 2 dropdownlists using javascript -

i trying populate 2 dropdown lists using javascript. 2nd 1 empty, , filled depending on selection of first one. the content of lists rendered using django, , javascript code notice if has fill 2nd dropdownlist or not depending on rendered value of "op". the problem find works fine until 2nd list needs filled, never happens. if hard-code first list @ html , comment part of javascript filled, after selection of item @ first list, second 1 filled. is there problem in adding twice options different dropdownlists @ same execution? javascript function window.onload = function foo() { var makeslist = document.getelementbyid('make'); var modelslist = document.getelementbyid('model'); var makestxt = "{{ makestxt }}"; var makes = makestxt.split("%"); var op = "{{ op }}"; (i=0; makes.length; i++){ var makesvals = makes[i].split("$"); var option1 =

Unable to load more than 79 RTDLLs using LoadLibrary in C++ RTX environment -

rtdlls rtss objects can dynamically loaded , unloaded using standard microsoft loadlibrary , freelibrary calls. automatically unloaded memory when last rtss process referencing them terminates. but right facing problem while trying load more 79 rtdlls using loadlibrary in c++ rtx environment. getting error while calling loadlibrary method. how load more 79 rtdlls using loadlibrary in c++ rtx environment?

objective c - re-declaring readonly property in class extensions -

i reading document learn objective-c: https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/programmingwithobjectivec/customizingexistingclasses/customizingexistingclasses.html#//apple_ref/doc/uid/tp40011210-ch6-sw1 i topic "use class extensions hide private information" (page 73 of pdf) says: class extensions used extend public interface additional private methods or properties use within implementation of class itself. it’s common, example, define property readonly in interface, readwrite in class extension declared above implementation, in order internal methods of class can change property value directly. what dont understand in statement since can change readonly property within private method defined in class extension without property being re-declared readwrite in class extension, achieve re-declaration of property readwrite? you can change property through instance variable ( _ivar = ... ), won't able change using dot-prop

php - Form is failing to update mysql table -

so i'm working form admin can select multiple users database via tickbox system, change welcome message or general message client when log in: <?php session_start(); include_once("isadmin.php"); ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>update client message</title> <link href="loginmodule.css" rel="stylesheet" type="text/css" /> </head> <body> <?php if( isset($_session['errmsg_arr']) && is_array($_session['errmsg_arr']) && count($_session['errmsg_arr']) >0 ) { echo '<ul class="err">'; foreach($_session['errmsg_arr&#

How to make asynchronous HTML requests with Javascript that include cookies? -

i make multiple html requests happening @ same time (not 1 after another) javascript. add cookies requests. seems ajax way go i'd see example code includes cookies , asynchronous aspect. i'd use plain javascript open solutions using jquery or other frameworks. any request browser, including ajax, automatically carry cookies set target domain.

python - How to prevent downloading HTML/text pages as .png -

http://puu.sh/3krct.png my program generates random links service hosts images, , grabs , downloads random images. program makes lot of requests, , has go through proxies. well, when program started, give path fresh large proxy list; however, proxies not connect website , return custom html page - or image service return message on page "you don't have permission view image." although, program still save request , download page .png extension and html/text pages saved .png files: http://puu.sh/3krxm.png http://puu.sh/3krgn.png is there way can prevent downloading of these pages, , download actual images? thank you. if self.proxy != false: #make our requests go through proxy self.opener.retrieve(url, filename) else: urllib.request.urlretrieve(url, filename) i think should change logic. if proxy returns error getting page asked, uses http status code != 200 you should check in order: the http status != 200 the content-type he

c++ - Cocos2d-x How do i enable / disable ccTouchMoved events? -

i have ccsprite received cctouchmoved event , can dragged on screen want enable user to: 1. move 5 or 10 pixels cctouchmoved 2. cctouchmoved event disabled means user couldn't drag it 3. animation x or y direction depending drag direction continue 100 pixels ccmoveby action 4. when animation done enable cctouch events the important me how enable / disable cctouch events p.s not give me code question , need know command use thanks you can go remove touch delegate (i,e object takes touches) ccdirector::shareddirector()->gettouchdispatcher()->removedelegate(yourobject); else, better use boolean variable inside class. check before processing touches inside delegate methods.

wpf - Bind a button to the selected item -

i have button , want change click handler every time change tabs. hoping perform binding. <window x:class="bwcrenameutility.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vpan="clr-namespace:bwcrenameutility.view.versionpanels" title="mainwindow" height="526" width="525"> <grid> <dockpanel> <textblock text="foo" dockpanel.dock="top" textwrapping="wrap" padding="10" /> <grid dockpanel.dock="bottom"> <!-- not correct, how perform binding correct? --> <button content="export..." horizontalalignment="right" margin="10" click="{binding selecteditem.content.performexport,elementname=tabcontrol}" />