Posts

Showing posts from August, 2013

Maximum flow in undirected graph with non-integer weights -

if want find maximum flow in undirected graph, how this? on wikipedia page http://en.wikipedia.org/wiki/maximum_flow_problem says algorithms require directed graphs (i convert each edge pair of edges) problem may have non integer weights (for example 0.5). is there existing algorithm suitable problem? the stoer-wagner algorithm job. dwells on duality of max-flow/min-cut. algorithm in vein of seminal ford-fulkerson (which fails on real-valued edge weights) edmonds-karp .

ios - object becomes null when passed to another view controller -

in ios application, need pass object 1 view controller , switch new view controller. goal relay information. however, object becomes null , devoid of information when next view showed up. what? reason? below part of code. #pragma mark - table view delegate -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { bidcourse *course = self.courses[indexpath.row]; nsstring *sub = course.subject; bidsubjectmaintwoviewcontroller *subjectcontroller=[[bidsubjectmaintwoviewcontroller alloc] init]; subjectcontroller.title = sub; subjectcontroller.course=course; [self.navigationcontroller pushviewcontroller:subjectcontroller animated:yes]; } bidcourse *course custom subclass nsobject , has nsstrings , , it's not nil, when pass onto next view controller, becomes null . i have met problem , when pass object viewcontroller , has been released. i think defect of arc , arc think subjectcontroller may no use , r

multithreading - .NET - Block main thread until there are any available threads -

i have process main thread reading file , splitting parts. parts require further processing. utilize available threads downstream processing utilizing cpu (or many cores) possible. don't want create excessive backlog main thread, need main thread wait add queue until there available thread. i see many articles vb.net 4.0: looking execute multiple threads, wait until threads completed before resuming , waiting all threads complete , whereas need any threads available is can tackle task parallel library , or should manually creating threads , monitoring threadpool? using reader new streamreader(filename) currentblocksize = reader.readblock(currentbuffer, 0, buffersize) runningbuffer &= new string(currentbuffer) if runningbuffer.contains(rowdelimiter) lineparts = runningbuffer.split(rowdelimiter) integer = 0 lineparts.count - 1 if < lineparts.count - 1 'make synchronous

ajax - Replace content of a div with an external php file in Laravel 3 -

i have unordered list of movies being displayed rotten tomatoes api in page called browse (using laravel framework). trying use ajax load content div separate file have setup route called movie when user clicks on anchor. in routes file have this: route::get('browse', array('as'=>'browse', 'uses'=>'browse@index')); route::get('movie', array('as'=>'movie', 'uses'=>'browse@movie')); browse view located @ /application/views/browse/index.blade.php $movies = $search_results->movies; echo '<div id="browse">'; echo '<ul class="movieresults">'; foreach ($movies $movie) { echo '<div class="moviecard">'; echo '<li><img src="'. $movie->posters->detailed .'"</li>'; echo '<li class="moviecardinfo"><a href="movie" class=&quo

jpa - Controller Bean not picking up the username -

i'm in grave problem this. of sudden working code has stopped working. have no clue ever why!!!! , worst of have deploy project today :( . don't know if right or not of started 2 days after adding primefaces in build path. can please direct me right direction. great help! i have following configuration: glassfish v3 mojara 2.1.6-fcs jpa eclipselink controller bean public list<usergroupdetail> getusergroupdetail_list() { list<usergroupdetail> myusergroupdetail = new arraylist<usergroupdetail>( lodbn.listusergroupdetail(loginbean.getusername())); system.out.println("username found is:" + loginbean.getusername()); return myusergroupdetail; } for getting complete list of data jpa pojo usergroupreport public list<usergroupreport> getgroupid_list() { list<usergroupreport> myallgroupids = new arraylist<usergroupreport>( lodbn.findallgroupidbyuser(loginbean.getu

magento - Transaction could not be captured by ePay: -1007 -

i doing automatic subscription through epay payment gateway magento. the epay responses transaction id after payment, in magento shows under status history: "transaction not captured epay: -1007" please, me mean? if epay can't payment, can't response transaction id. shows error? thanks in advance bratati -1007 there differences in amount captured / available. please examine amount of captured / credited against amount authorized / captured. note if there euroline transaction , transaction captured, can credited following day. check epay responses , compare in code

c# - Rounding a number with special conditions -

i need create function rounds numbers this: 33120->34000 21001->22000 here no decimal points if there exist number other 1 in last 3 digits 4th digit must incremented , last 3 digits should set 0. i need optimized, don't want traverse each digit of each number since have on 800,000 number. thanks in advance! var result = math.ceiling((double) x/1000)*1000;

PHP datetime value not passing in as a argument -

i using datetime object in php range of dates however unable pass in value of datetime object function. when try assigning variable, variable empty code belows $date1 = new datetime('2013-04-11'); $test = $date1->settime($i, 59); echo $test; anyone idea how assign $date1 variable? that returns datetime object doesn't have tostring method. the above generate fatal error (you should enable errors ): catchable fatal error: object of class datetime not converted string in /code/khcgos on line 7 php catchable fatal error: object of class datetime not converted string in /code/khcgos on line 7 you should like: echo $test->format('h:i:s d-m-y'); more info: http://codepad.viper-7.com/tnhglj note: on production machine should have error reporting enabled, instead of displaying them should log them

java - Multiple Jpanel keylistener space -

i have frame contains 4 different panels.one panels contains music player on pressing space key start playing music while other 3 panels contains textfields , submit buttons.now problem while typing text in of textfield it's taking input whenever try give space in textfield it's playing music instead of typing space in textfield. i have frame contains 4 different panels.one panels contains music player on pressing space key start playing music while other 3 panels contains textfields , submit buttons.now problem while typing text in of textfield it's taking input whenever try give space in textfield it's playing music instead of typing space in textfield. and the listener attached music panel , not else add keybindings jframe (contains 4 jpanels) output should swing action override setenabled in swing action add jcomponents (for users input only) array add focuslistener or jcomponents (for users input only) on focusgained a

mysql - PHP PDO date time formats -

so using php pdo load class have created called 'user' mysql. object contains several fields including 3 date fields. reason, when dump object (using var_export) can see dates stored differently. 1 unix time , others date strings here dump; 'createdtime' => '2013-04-19 09:36:42', 'logintime' => '2013-04-25 01:32:50', 'lastactiontime' => '1366880785', all 3 fields defined in mysql datetime, don't understand why has occured. any ideas? my php code is; $sth = $dbh->prepare('select * user id=:id'); $sth->bindparam(':id', $id); $sth->execute(); $sth->setfetchmode(pdo::fetch_class, 'user'); $user = $sth->fetch(); i must have done wrong somewhere, what?

indexing - How to access index.php page when index.html has priority -

i have wordpress site using index.php page. now website not live yet, added index.html page temp page - users not see index.php page, yet. but cannot access index.php file when visiting: http://mysite.com/index.php - redirects me straight http://mysite.com , serves index.html page how can view index.php page? note: htaccess file has following: directoryindex index.html index.php if remove this, default page people see index.php, don't want them see. want able view index.php file thank you i in same situation , couldn't find way see index.php file on server. i recommend create directory wordpress installed on while developp website. once have done need (create pages, create custom theme, etc) export content using export function built in wordpress , import on public wordpress. same thing goes plugins , theme, have manually since there no export function those. if don't have enough space on server, can on own computer using easyphp . install

bash - How to find which file contains a string from many files in a directory? -

for example, have directory contains many files(say f1.dat, f2.dat ... , f100.dat). , want find out file contains string( string "error"). how it. you can do: grep -l "your_string" /your/dir/f*.dat -l list files match grep. f*.dat refers files name f[something].dat . if want check files in directory, can useful: grep -l "your_string" /your/dir/

Force JSF to bean-validate ALL fields of my bean, not only those bound to an input field -

i working apache myfaces core 2.1 library , hibernate validator 5. have simple javabean annotations. form input fields map javabean. however, if annotate field constraint (e.g. @notnull or @min(value = 1000)) not use input field in form, fields of javabean valid. can force jsf lifecycle validate fields of may javabean, not input field? no cannot. integration of jsf bean validation uses validator.validatevalue validate each input field on own. not using validator.validate in order validate whole bean. if want full bean evaluated need on layer (eg jpa if using it).

Can I bind asp.net dropdownlist using javascript/jquery? -

can bind asp.net dropdownlist using javascript/jquery? data jquery ajax web method want avoid postback @ point. still want postback , save data using server side code (i.e. still able dropdownlist1.selecteditem.text ) after binding using clientscripts. is possible , can explain me how can done? thanks, use json ajax syntax: $.ajax({ datatype: "json", url: url, data: data, success: success }); see simple example json: <script type="text/javascript"> $(document).ready(function () { var msgbox = $("#status"); $("#button1").click(function () { $.ajax({ type: "post", //page name (in method should called) , method name url: "beginjson.aspx/checkdatetime", // if want pass parameter or data server side function can try line // data: "{}",

ruby on rails - Which database should be chosen in Heroku? -

i want migrate database heroku . old database exported json files, don't know how select database in heroku. my issue is: the data increasing, in future, there lot of data. database available this? i can json files old database. can imported heroku database? my users in america. database in heroku whether lead user's access speed or not? my project using ruby on rails . what should do? first of all, heroku provides postgresql default database. might following reasons use it. postgresql powerful, open source object-relational database system. heroku postgres sql database service run heroku provisioned , managed add-on . heroku postgres accessible language postgresql driver including languages , frameworks supported heroku: java, ruby, python, scala , play, node.js , clojure . for more can refer http://www.postgresql.org/about/advantages/ .

jquery - Easiest way to paginate a large table - circa 3000 rows -

im working on web-app project , on 1 of pages have large table, circa 2000 rows. im looking simplest way provide pagination feature table allow 50 or 100 rows viewed @ time. have looked @ http://www.datatables.net/ doesnt seem working me, are there other simple options out there? cheers

c# - Removing a usercontrol by clicking a button on it -

Image
i have gridview shows items in it. each item has edit button it, pressing edit button loads usercontrol next item. usercontrol has close button it, pressing close button removes usercontrol. blue color rectangles represent items in gridview. on clicking pink add button red color usercontrol loads up. on clicking close button on red rectangle should remove red color item , revert original state. have added usercontrol using template selector , working fine. close button not remove it. have tried following approach removing : (gridview)this.parent).items.remove(this); on adding breakpoint , checking found this.parent null. stuck.how proceed? using c#, xaml, winrt, visual studio 2012 if need work visual tree, try this: var _parent = visualtreehelper.getparent(sender usercontrol) gridview; _parent.items.remove(sender usercontrol); but removing items gridview should done manipulating observablecollection bound itemssource of gridview in viewmodel. not this, probab

typeahead - Having trouble to typeaheadjs -

i have used following script : <input class="typeahead" type="text" id = "input"> $('#input').typeahead([{name: 'name',remote: 'planets.json',}]); json file {"name" : {"value" : ["4729", "siva", "prakash"]},"planets" : {"value" : ["mercury", "venus", "pluto"]}} while typing on input box , display 2 json array name value[name , plants]. anyway in code have mention name 'name' only. has return value 'name' json array ? in planets.json name->value, or planets->value. init typeahead instead : <input type="text" id="input" data-provide="typeahead"> $.getjson("planets.json", function(json) { $('#input').typeahead({ source : json.name.value }); }); or json.planets.value , if want planets

ruby - Redmine on Passenger (nginx) won't start -

i followed following tutorial: http://redminecrm.com/boards/4/topics/448-installing-redmine-2-2-passenger-nginx-rvm-on-ubuntu-12-04 at first, had problems mysql2 fixed editing gemfile , running bundle update. after which, ran new problem. attached below traceback. hope me one. i'm using ruby 2.0.0p0, passenger-4.0.0.rc6, nginx 1.2.7. no such file load -- iconv (loaderror) /var/data/redmine/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on' /var/data/redmine/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on' /var/data/redmine/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency' /var/data/redmine/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' /var/data/redmine/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:438:in `each' /va

diff - R how can I calculate difference between rows in a data frame -

here simple example of problem: > df <- data.frame(id=1:10,score=4*10:1) > df id score 1 1 40 2 2 36 3 3 32 4 4 28 5 5 24 6 6 20 7 7 16 8 8 12 9 9 8 10 10 4 > diff(df) error in r[i1] - r[-length(r):-(length(r) - lag + 1l)] : non-numeric argument binary operator can tell me why error occurs? diff wants matrix or vector rather data frame. try data.frame(diff(as.matrix(df)))

objective c - "Show Obj-c Only" flag hides all the content of call tree on xCode Instruments -

Image
i'm following this tutorial instruments. tutorial provides sample project test steps described on it. the problem that, when check "show obj-c only" , "hide system libraries" flags, lines in call tree list hidden, code in project written in obj-c. there have change in configuration see project lines in tutorial? call tree list image taken tutorial showing how must be: screenshot of instruments execution: ok, don`t know happens here, works. how? what did: erase app in device kill xcode ( using activity monitor ) restart computer ( restarting xcode didn't work ) restart device. clean project try again. may not best answer, worked me. [update] issue there again, try this: xcode 4 instruments doesn't show source lines and works!

Ruby, pry: Can I add something to the command `pry example.rb` so pry automatically goes interactive when it finishes executing the script? -

pry goes interactive mode if encounters exception (eg if put undefined variable 'x' @ end of script). (also if, inside script require 'pry' , put binding.pry @ point want go interactive at.) but i'm wondering: there's kind of flag/option/argument thingy can add pry example.rb command when enter @ command prompt, go interactive when reaches end of executing any example.rb script, regardless of what's inside? (assuming no exceptions before end, of course.) (this useful use editors can run external programs notepad++, see this , this .) not yet, file issue , i'll add :)

facebook - Get page access token by app access token -

i not user page access token. have enabled manage_pages in permission of application settings. when access graph api got blank data, no access token. /page_id?fields=access_token i having understanding can user page access token configuring manage_page permissions. https://developers.facebook.com/docs/reference/api/page/#page_access_tokens

linux - Memory allocation by threads in c -

how reduce memory used threads in c? although thread takes 8 10 mb of memory, there way reduce memory? yes can set size of thread stack. pthread_attr_t attribute; pthread_t thread; pthread_attr_init(&attribute); pthread_attr_setstacksize(&attribute,size); // size may defined u 1024,2048,etc pthread_create(&thread,&attribute,fun,0); ................................................ void *fun(void *arg) { .... }

redirect - Rewrite URL's in Joomla menus -

my group , working on school project joomla. have custom php list "articles" our database, , php getting data $_get (from url.) skip question: this have: example.com/articles/menu we want: example.com/articles/menu?q=something+something how rewrite / add text url, format? using school server, have no admin-rights on server. have tried mod_rewrite rules in .htaccess, without success. server running windows. using joomla 2.5 rewriteengine on rewriterule ^index.php/articles/menu?q=something+something$ /index.php/articles/menu [l] try this: rewriteengine on rewriterule ^/articles/menu$ index.php/articles/menu?q=something+something [qsa,l] and job. hey way, try google bit, there tons of answers such simple things ;) checkout right documentation qsa directive: http://httpd.apache.org/docs/current/rewrite/flags.html#flag_qsa

java - Xuggler stream[0] is not video -

this first time asking question on form . question has 2 parts . first please see code below extract audio video file using xuggle . imediareader reader; file f; reader = toolfactory.makereader("e:\\netbeanworkspace\\repo\\videosamples\\one.mp4"); f = new file("e:\\netbean workspace\\repo\\videosamples\\"+"one"+".wav"); imediawriter mediawriter =toolfactory.makewriter(f.getabsolutepath(), reader); int samplerate = 44100; int channels = 2; mediawriter.addaudiostream(0, 0, icodec.id.codec_id_adpcm_ima_wav, channels, samplerate); reader.addlistener(mediawriter); mediawriter.setmasklatestreamexceptions(true); while( reader.readpacket() == null ); i following error on files , files work fine . java.lang.illegalargumentexception: stream[0] not video @ com.xuggle.mediatool.mediawriter.encodevideo(mediawriter.java:754) @ com.xuggle.mediatool.mediawriter.encodevideo(mediawriter.java

python 2.7 - Alternative of visibility of element located in selenium 2.0 that checks the presence of an element on the DOM? -

i have problem in framework instead of using static sleeps try wait visibility of element. thing visibilty of element checks presence of element on dom, return true in system page not loaded yet. happens true when checking visibility of element set values. these values reset when actual page loaded. my question can use instead of static sleeps wait actual page (not dom) loaded visibility of element not working me? p.s. i'm using selenium webdriver python 2.7 /adam the expected_conditions.visibility_of_element_located(locator) method check both - presence of element in dom, , visibility (element displayed height , width greater zero). ideally, driver.get(url) method should automatically wait full page loaded before moving on next line. however, might not behave expected, in case, web application being tested uses ajax calls/actions (as although page has loaded ajax actions still in progress). in such scenario, can use below wait stability before performing act

html - Unable to position an element -

Image
i'm trying position 'about me' box unable posiition down. can move left or right using margin-left or margin-right properties i'm not able move top or down. have used float:right position sidebar. used clear:both on header. still remains stationary. the following images understand problem. the code of page here (jsfiddle) <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="description" content="description"> <link rel="stylesheet" media="screen" href="style123.css"> <!--[if ie]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <title>my first page</title> </head> <body> <div id="wrapper"> <ul id="nav"> <li><a href="#">home</a></li>

javascript - when to define a module and when to only require files using requireJS -

i'm struggling requirejs work properly. page running fine, think i'm doing things in oh-so wrong way. for example, on page xzy i'm adding following javascript @ end of page (the js must stay on page now, no external js-files possible) <script type="text/javascript" language="javascript"> //<![cdata[ (function () { require([ 'async!http://maps.google.com/maps/api/js?v=3&sensor=false', 'maps/jquery.ui.map.full.min.js', 'maps/jquery.ui.map.extensions.min' ], function() { // ... stuff google maps } ); }()); //]]> </script> doing makes google.map , $.().gmap method globally available, shouldn't available globally. questions: should convert requirejs module? why? if so, module available on other pages or "re-define" on page 123 , dependency files have been cached? and - have convert code inside require call module.meth

c# - How to improve Linq-To-Sql code -

Image
using stackexchange.profiling.miniprofiler class profile asp.net mvc application linq-to-sql orm. i'm trying reduce 1 action 1 sql, don't have duplicates anymore. changed linq-to-sql code accordingly, didn't have positive effect on speed. then checked time needed sql. this shows miniprofiler: when fire exact same sql in management studio super fast: here code: from t in type let tdoc = (from d in context.documents d.key == t.no && d.rtype == (int)rtype.art && d.atype == (int)atype.doc select d).firstordefault(d => d.useforthumb) select new time { id = t.id, //... more simple mappings here // complex one: docscount = context.documents.count(d => (d.key == t.id.tostring() && d.rtype == (int)rtype.type && d.atype == (int)atype.doc) || (d.key == t.no && d.rtype == (int)rtype.art && d.at

javascript - JQuery - reuse data after load -

i have function: // ajax messages showing show_msg.on('click', function(e){ var $this = $(this), url = $this.attr('href'), url_info = url + ' .basic_info > *', url_msg = url + ' .contact_messages > *'; basic_info.slideup('fast', function(){ basic_info.empty().load(url_info, function(){ basic_info.slidedown('fast'); }); }); contact_messages.slideup('fast', function(){ contact_messages.empty().load(url_msg, function(){ contact_messages.slidedown('fast'); }); }); return false; }); it working, using load 2 times, , guess not effective way this. there way load data once , select need data? you do: (function(){ var basicinfoloaded = false, contactmessageloaded = false; // ajax messages showing show_msg.on('click', function(e){ var $this = $(this), url = $this.attr('hre

java - Is it possible to set a Calendar c equal Calendar c2? -

i have: calendar c = calendar.getinstance(); c.set(calendar.hour_of_day,1); c.set(calendar.minute,23); c.set(calendar.second,22); calendar c2 = calendar.getinstance(); c2 = c ; // is last statement correct if want set calendar c2 equal calendar c ? although c2 = c appear work, that's not want: both variables pointing same calendar instance. result of assignment, changes made c in c2 well, , vice versa. you can use clone() method make copy of calendar object, this: calendar c= (calendar)c2.clone();

java - Working with multiple panels in one frame -

i have problem want program switch between multiple panels in same frame. problems encountering can't set layout when panels switch , after switch content lowering pixel pixel. here code. import java.awt.dimension; import java.awt.eventqueue; import java.awt.flowlayout; import javax.swing.jframe; public class main { public static boolean logged_in = false; public static int width = 200, height = 400; public static void main(string[] args) { eventqueue.invokelater(new runnable() { public void run() { try { dimension d = new dimension(width, height); first frame = new first(); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setsize(d); frame.setlocationrelativeto(null); frame.setvisible(true); frame.setresizable(true); frame.setlayout(new flowlayout());

github - How to create a clean theme branch in git which only has one commit (and no pulls from upstream) -

forking prezto i forked sorin-ionescu/prezto ( upstream ) github github account (nasenatmer/prezto) ( origin ), cloned locally , started configuring it, adding files, while committing , pushing changes github repo. configuring local repo among other things, modified prompt theme want give project , i'd create pull request`. learning github "using pull requests" , tutorial on gun.io, tried create theme branches, commit changes can forward them pull requests on github. however, in meantime, there updates in upstream. so had following commit history: original checkout - - many "private commits" - - - pull upstream changes creating theme repo so in order create theme repo, created branch @ earliest clone upstream called pristine , won't customise myself. pulled upstream bring pristine up-to-date. from point branched off prompt_jakob_setup (that's name of prompt file) , committed file it. the problem of many commits now, if go gith

c# - Infinite objects declaration in script -

Image
i have script in unity holds checkpoints in racing game. don't know how many checkpoints on racetracks. limited 5: but, allow map makers insert more checkpoints. doesn't work: public list<gameobject> checkpoints = new list<gameobject>(); so best way this? wouldn't defining array of checkpoints work? public gameobject[] checkpoints; i don't have access unity @ moment, should allow enter (reasonable) number of gameobjects via inspector checkpoints array. this on unity answers similar question: http://answers.unity3d.com/questions/245024/public-array-of-gameobjects.html taking wild guess here, error list1' not found ? in case you'll have add using system.collections.generic; able use c# lists.

c - printf debugging to trace a function -

i'm trying port software microcontroller (so can't step through code e.g. gdb) , crashes unpleasantly. identify reason this, want insert printf() before every statement, echoing said statement, e.g. void foo(int c) { bar(); for(int i=0; i<c; ++c) { baz(i); } very_long_function(&with, &arguments, \ on->several(lines)); } would become void foo(int c) { printf("bar();\n"); bar(); printf("for(int i=0; i<c; ++c)\n"); for(int i=0; i<c; ++c) { printf("baz(i)\n"); baz(i); } printf("very_long_function(&with, &arguments, \ on->several(lines));\n"); very_long_function(&with, &arguments, \ on->several(lines)); } is there script this? it still requires fair bit of setup can make tracking down location of crash bit less painful defining macro prints file

How does Zurb Foundation Switch control work -

i started using zurb foundation 4 asp mvc website , don't quite understand how switch control supposed work. docs don't http://foundation.zurb.com/docs/components/switch.html <div class="switch"> <input id="x" name="switch-x" type="radio" checked> <label for="x" onclick="">off</label> <input id="x1" name="switch-x" type="radio"> <label for="x1" onclick="">on</label> <span></span> </div> i'm using example code, when click on switch, there no change in html. figured "checked" attribute go on second input, not case. how can detect radio button has been clicked ? when post form, "switch-x" variable contains value "on" no matter position switch in. i tried adding onclick event on label, it's not getting fired seems overlapping label. i'm using f

python - pycurl subprocess in a separate Thread -

i need output pycurl, i'm trying run in subprocess. output i'm trying put in queue , pull queue out in different class. unfortunately, right have no output =( import threading import random import time import queue import urllib2 import sys import simplejson, pycurl import sys, signal queue = queue.queue() keep_running = true user = "username" pswd = "pass" class mythread(threading.thread): def __init__(self, queue): threading.thread.__init__(self) self.queue = queue def run(self): curl_path = '/usr/bin/curl' curl_list = [curl_path] args = ('curl', 'https://stream.twitter.com/1/statuses/filter.json?track=java', '-u', 'user:pass') arg in args: curl_list.append(arg) child = subprocess.popen( curl_list, shell=false, #stdout=subprocess.pipe)

vb.net - data type mismatch in criteria expression in asp.net -

i trying delete row ms access database using vb.net. getting above mentioned error. fields text in database. here code : dim deleterow() datarow deleterow = ds.tables("ccc").select("question = '" & questionlist(x).text & "'") deleterow(0).delete() da.update(ds,"ccc") vishal.... of questions(x).text values contain single quote? single quotes cause error select statement. e.g. if question what's name? select statement select(question = 'what's name>?') this error @ 's - i'm not sure if close bracket cause error in example above have select(question = '390) computer ?') this may error @ first close bracket.

jquery - Does this javascript pattern encourage memory leaks? -

i finding myself rather confused regarding javascript garbage collection , how best encourage it. what know related particular pattern. not interested in whether pattern considered or bad idea, interested in how browsers garbage collector respond, i.e references freed , collected or cause leaks. imagine pattern: test = { init : function(){ this.cache = { element : $('#element') }; }, func1 : function(){ this.cache.element.show(); }, func2 : function(){ test.cache.element.show(); }, func3 : function(){ var self = this; self.cache.element.show(); },

asp.net membership - Entity Framework 5 - Insert data into UsersInRoles Many to Many table -

i have scenario need manually insert user, roles & usersinroles entries database without using asp.net membership. when try insert many many relation usersinroles following exception invalid column name 'role_roleid'. i'm using ef 5, database first approach pocos. have defined association in edmx should ok ... here model entities /// <summary> /// no metadata documentation available. /// </summary> [datacontract(isreference = true)] [knowntype(typeof(user))] public partial class user : iuser { #region primitive properties /// <summary> /// no metadata documentation available. /// </summary> [datamember] public virtual system.guid applicationid { get; set; } /// <summary> /// no metadata documentation available. /// </summary> [datamember] public virtual system.guid userid { get; set; } /// <summary> /// no meta