Posts

jquery - Insert row if not exists otherwise update sqlite - JavaScript -

i know there have been lot of questions on in past, seem unable utilise answers. have tried, don't seem work. i have table stores 2 user inputted values: name , email. when enter name , e-mail, gets stored single row of table. i want able update same row different name , email if user types other values, or insert these values if there weren't previous values. my code here: db.transaction(function(transaction) { transaction.executesql('insert details(name,email)\ values(?,?)',[$('#entername').val(), $('#enteremail').val()], nullhandler,errorhandler); }); and table creation here if needed: db.transaction(function(tx){ tx.executesql( 'create table if not exists details(id integer not\ null primary key,name,email)', [],nullhandler,errorhandler); },errorhandler,successcallback); i have tried using insert or replace, creates new row new details , leaves previo...

linux - Searching all files that begin with 's' and end with '.conf' with grep -

using grep command search string ip in files beginning s (case sensitive) , ending .conf in /etc directory. redirect output /usr/local/thirdrock/grep1.txt . you should 8 lines of output. this question i've been given practical exam review, far have grep "ip" s*.conf /etc but returned "no such file or directory" . my question how search in files beginning s , ending .conf in /etc directory. grep "ip" s*.conf /etc searching string "ip" in files in current directory matching s*.conf , "file" /etc, directory. grep "ip" /etc/s*.conf should want. you can redirect standard output using > , wasn't part of question, won't spoil it.

xamarin - How does Mono for Android work and what's the relation between C# and Dalvik? -

i'm trying find information on how c# implementation of android works. is c# -> java -> bytecode -> dalvik: i.e. c# converted java before process happens between bytecode , dalvik? or c# -> dalvik? your guess wrong. more similar .net/com interop wrappers used acrosss boundary. @ runtime there 2 vms, dalvik , mono clr running @ same time, mono android http://tirania.org/pictures/android-dalvik-mono.png there far more information can dig miguel's blog such http://tirania.org/blog/archive/2011/apr-06.html the c# dalvik solutions exist, such dot42 , remobjects c# .

python - EOL while scanning string literal -

this code , following error message: line 8 sepfile=readfile.read().split('\') syntaxerror: eol while scanning string literal me? thanks. import matplotlib.pyplot plt import numpy np x=[] y=[] readfile = open (("/users/sun/desktop/text58.txt"), 'r') sepfile=readfile.read().split('\') readfile.close() plotpair in sepfile: xandy=plotpair.split(',') x.append(int(xandy[2])) y.append(int(xandy[1])) print x print y plt.plot(x,y) plt.title('tweet') plt.xlabel('') plt.ylabel('') plt.show() \ special character in python string literals: starts escape sequence . to fix problem, need double backslash: sepfile=readfile.read().split('\\') doing tells python using literal backslash rather escape sequence. also, for , keywords in python, needs lowercase: for plotpair in sepfile:

.net - Is it possible to use BizTalk Rule Engine independently from BizTalk Server? -

currently i'm involved in project lots of rules in it. there's idea use biztalk's business rule composer rule creation. question1. possible use independently? question2. if so, how can subscribe change of different fact source types .net objects , databases ? fyi, i'm using biztalk server 2013. well, run rules composer need have biztalk engine installed, can't separate them, in such case end pay license of biztalk have rules engine composer. why not use product? think there products concerned business rules engines can use , workflow well. if want free 1 can have worlflow 4.0 microsoft (doesn't include business rules engine can implement 1 using specification pattern - code). other paid products such k2 blackpearl might check them out.

Scale the x axis only in octave plot -

i using octave plot function plat 2d graph. want scale x axis 2x (no change y axis). i.e. distance between each unit in x axis doubled. how do in octave? set(gca,'dataaspectratio',[2 1 1])

opencv - Image alignment error -

i have 2 images, 1 of misaligned. need align images. calculate feature points using surf , match them using bfmatcher , find homography , apply warpperspective . here code for these inputs : input1 , input2 , getting distorted image . i doing wrong. points? first suspect should swap trainidx , queryidx. and try draw matches, in experiments, rather random. for quick test try use same image, or transform little bit first image , use second one.