Posts

Showing posts from September, 2014

android - Selecting from two tables -

i have following query in android query = "select docid _id," + key_id + "," + key_name + "," + " " + filter + " " + key_search + " match '" + txt + "';"; it selects the table depend on filter what wanna have filter "all" select 2 tables 1 query how can ? thanks please using preparedstatements ( http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html ). inlining variables way allow sql injections. to answer question, use inner join (implicit or explicit).

ios - confusion in data storage into nscache -

i know im doing mistake here coz cant run project im trying build , im trying here parsed data xml save nsdata , put data cache when run project doesnt load data. @implementation viewcontroller { nscache *mycache; } - (void)viewdidload { mycache = [[nscache alloc] init]; } //saving data cache nsstring *imageurl = [currentdata.imagelink]; nsurl *url = [nsurl urlwithstring:imageurl]; nsdata *data = [nsdata datawithcontentsofurl:url]; data = [imagescache objectforkey:@"key"]; [imagescache setobject:imagelinks forkey:@"key"]; a few things: data downloads should done on background thread. it's best have own object in cache, , object should download image , cache both image , save image disk. when cache gets purged should remove image , reload disk if required. this code: nsdata *data = [nsdata datawithcontentsofurl:url]; data = [imagescache objectforkey:@"key"]; [imagescache setobject:[nsdata datawithcontentsofur

php - Codeigniter join() not working -

i trying run query using codeigniter framework. want avoid using clause, , instead have included condition part of on clause in join statement of query. far more efficient since join statement executed before clause. here code: $this->db->select('sql_calc_found_rows projects.id, projects.project_name, projects.date_modified, projects.last_modifier, projects.status, project_users.permission', false)-> from('projects'); $this->db->join('project_users', 'project_users.id = projects.id , project_users.user_id = ' . $this->user_id); if ($orderby !== false) { $this->db->order_by($orderby, $direction); } if ($limit !== null) { $this->db->limit($limit, $offset); } $query = $this->db->get(); when attempt load page, receive sql error. seems codeigniter not including condition after and: select sql_calc_found_rows projects.id, proj

javascript - writing a custom function inside d3.json -

i trying add numbers tag. using d3.json reference file. mixing jquery in , think not going well. how should this? once sum mathematical operations on reduce value of consumption_gj_ can pass radius circle this. here how code looks like: var sum = 0; //adding values function radiusdata(d){ +sum = d.consumption_gj_; alert(sum) } //here trying append total div $('.test').append(sum); right doing d.consumption_gj_ / 10000 come reasonable number not working out. here fiddle http://jsfiddle.net/sghoush1/vn7mf/9/ you need loop iterate on values , add them sum: data.foreach(function(d) { sum += +d.consumption_gj_; }); modified jsfiddle here .

html - What does this total width mean actually -

Image
i read book called "bulletproof web design" , don't understand. says "while have declared width of 720px #nav, indent tabs we're assigning left padding of 46px. since padding added width of element, navigation's total width equals 766px." #nav { float:left; width:720; margin:0; padding:10px 0 0 46px; background:#ffcb2d; } i mean width 720px defined in #nav selector , padding 46px. don't know book mean total width. have never heared expression before. total width common term equal width + padding? if @ graphic below, you'll see padding contributes total width of block: also, author using short-hand notation padding, breaks down to: top-padding: 10px; right-padding: 0px; bottom-padding: 0px; left-padding: 46px; the horizontal padding contributing to total width.

jboss7.x - Cleaning JBoss AS 7.1 Standalone.xml -

i couldn't find answer in other questions , wanted see if knew. i'm using jboss 7.1 on kepler eclipse, , wondering if there way change standalone.xml while server running , have jboss push change. cleaning server this? you can't edit raw xml files , see runtime changes. in fact there chance changes overwritten server. the best way make runtime changes either via web console or cli environment. don't know if jboss tools has kind of cli type of client can used.

c++ - De-duplication of NSString & unichar constants -

i have 2 simple constants: nsstring and unichar , defined follows: static nsstring * const string = @"\u2022"; static unichar const character = 0x2022; i'd want have number 0x2022 defined in 1 place. i tried lot of combinations ( # , ## , cfstr macro) no success. can done? (using ideas how concatenate twice c preprocessor , expand macro in "arg ## _ ## macro"? ): #define stringify(_x_) #_x_ #define unichar_from_hexcode1(_c_) 0x ## _c_ #define unichar_from_hexcode(_c_) unichar_from_hexcode1(_c_) #define nsstring_from_hexcode1(_c_) @"" stringify(\u ## _c_) #define nsstring_from_hexcode(_c_) nsstring_from_hexcode1(_c_) #define mycharcode 2022 static unichar const character = unichar_from_hexcode(mycharcode); static nsstring * const string = nsstring_from_hexcode(mycharcode); preprocessed output: static unichar const character = 0x2022; static nsstring * const string = @"" "\u2022"; (note @&quo

php - file_get_contents() and preg_match_all issue -

i using file_get_contents($url) turn entire webpage string. use preg_match_all change words /user/ /member/ feature members. example: $url = "http://www.example.com/profile.php"; $page = file_get_contents($url); preg_match_all('/user\/(.*?)/i', $page, $search); $total = count($search[0]); for($i=0; $i<$total; $i++) { if($search[1][$i] == 1) { $user_type = '/member/'.$search[1][$i]; } $page = str_replace($search[0][$i], $user_type, $page); } my problem is, if place above codes /profile.php, page keep loading forever. how should do? please help!

java - Why will nothing paint on my screen? -

i working on 2d platformer using swing in java, , developing framework game. testing reapaint() , draw functions, not function , clueless. here code: window.java import javax.swing.jframe; import javax.swing.swingutilities; public class window extends jframe { public window() { this.setdefaultcloseoperation(exit_on_close); this.setsize(1000, 1000); this.setvisible(true); this.settitle("infiltrator"); this.setlocationrelativeto(null); this.setcontentpane(new framework()); } public static void main(string[] args) { swingutilities.invokelater(new runnable() { @override public void run() { new window(); } } ); } } panel.java import java.awt.graphics; import java.awt.graphics2d; import javax.swing.jpanel; public abstract class panel extends jpanel { public panel() { this.setdoublebuffered(true); this.setfocusable(true); /* * if(false) { bufferedimage bl

oracle - Query returns different results between PL/SQL Developer and PHP -

i have made small intranet website collect , store data used expedite our logistics processes. i'm in process of adding search functionality which, if records found match criteria, allow user select parts of data pre-populate new shipping request data (e.g, user types 'mar' in recipient name input textbox , '109' in street address input textbox , query returns 2 records: {"mary smith", "1090 south central st"} , {"mark swanson", "109 e. 31st st."}). at moment, when search criteria entered , submitted, data returned query in php 100% accurate if , if single criteria entered (such recipient name). when attempt use 2 different search criterias in php, record results not match results when running same query in oracle pl/sql developer. if 3 different search criterias used, query ran in php return 0 records. in 3 of aforementioned scenarios, query executed without error in oracle pl/sql developer. the following code php sea

vb.net - How to Access DataTable Information Filled By a Module From a Form -

Image
i have dataset named billmat.xsd when application loads, module fills dataset's datatable correct information. my question ... how can access datatable's filled information form? here's how tried access on 1 of forms: dim view new dataview view.table = billmat.tables("dtbillheader") but following error: if create new instance of dataset , store in variable, i'll able rid of error message rid of data in dataset's datatables ... there way access datatable's information form? you need fix both forms referencing same dataset or datatable object. if 1 "child" form of other, such dialog, can pass parent child via property. otherwise, ideally, same data object injected both forms third object created both of forms. short of that, create singleton or global variable, please don't!

bash - How to convert this Python script to a shell script? -

this python script. with open('a') f: a, b = f a, b = a.strip(), b.strip() it opens file "a" , first line becomes a, second line becomes b now can use , b anywhere in python script. example: print print b i need code bash. set permision execution , add @ first line #!/usr/bin/env python

javascript - Output a result array with a grouped count of unique elements for a given array -

this question has answer here: array value count javascript 4 answers if have array how can loop through , push counts a new array? wlcomed! var products = [ ['product a'], ['product a'], ['product a'], ['product a'], ['product a'], ['product b'], ['product b'], ['product b'], ['product b'], ['product b'], ['product b'], ['product b'], ['product b'], ['product b'], ['old product b'], ['old product b'], ['old product b'], ['old product b'], ['old product b'], ['old product] ]; end goal : var uniqueproducts = [ ['product a',5], ['product b',6], ['old product b',9] ]

css - Formula to match a div to a specific "3D" location in a background image -

Image
i trying liven background image little using css 3d transformations, idea take proverbial "landing page full screen background image laptop has screenshot (in coffee shop)" , make more dynamic: instead of screenshot, put iframe actual live html page, , make fit photographed item in background image (e.g. laptop screen). this has 2 challenges: ability calculate location of points in background image solely based on screen size ability 3d rotation match laptop screen in background image this how background defined: .splash { text-align: center; background-position: 50% 20%; background-size: cover; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background-image: url(/assets/themes/twitter/bootstrap/img/scala_tutorials_screenshot2.jpg); } background image size is: 1280 x 850 i've managed somehow overcome of these requirements in brute force way, left position in fixed % worked, due fact it's width larger it's height

c# - DocumentCompleted firing multiple times - accepted StackOverflow answer not working -

i test if webbrowser completed with: webbrowser2.documentcompleted += (s, e) => { // stuff } the webpage accessing tons of js files , iframes , stuff, use below function make sure it's actual page that's completed loading. webbrowser2.documentcompleted += (s, e) => { if (e.url.absolutepath != (s webbrowser).url.absolutepath) { return; } // stuff } however, still doesn't appear working. doing wrong or syntactically correct , there's other error in code? documentcomplete may fired multiple times many reasons (frames, ajax, etc). @ same time, particular document, window.onload event fired once. so, perhaps, can processing upon window.onload . answered related question on how can done.

Php Array - String Using -

i want use array string. how can this? shared results , strings i used code: var_dump($result); and result returned string: "{ "_": { "id": "tracked" }, "success": true, "requesttime": "2013-08-19t13:08:36-07:00", "test": "sometextshere", "data": { "news": { "1": "hello", "13": "new text", }, "date": "2013-08-19t13:08:36-07:00" } }" the results you've posted json encoded. first need decode it: $decoded = json_decode($result); you can either return results object or array. default object , can retrieve results using point-to syntax. want string in test: echo $decoded->test; you can chained point-tos traverse object properties: echo $decoded->data->news; if prefer work arrays, can add optional

css3 - Black transparent overlay on image hover with only CSS? -

i'm trying add transparent black overlay image whenever mouse hovering on image css. possible? tried this: http://jsfiddle.net/zf5am/565/ but can't div show up. <div class="image"> <img src="http://www.newyorker.com/online/blogs/photobooth/nasaearth-01.jpg" alt="" /> <div class="overlay" /> </div> .image { position: relative; border: 1px solid black; width: 200px; height: 200px; } .image img { max-width: 100%; max-height: 100%; } .overlay { position: absolute; top: 0; left: 0; display: none; background-color: red; z-index: 200; } .overlay:hover { display: block; } i'd suggest using pseudo element in place of overlay element. because pseudo elements can't added on enclosed img elements, still need wrap img element though. live example here -- example text <div class="image"> <img src="http://i.stack.imgur.com/sjsbh.j

c++ - Why is my base class variable undefined at runtime? I'm initializing it from child classes -

i have parent class has variable populate child classes. @ runtime, expression seems never populated. isn't null. it's random thing ide says "expression cannot evaluated." i've stepped through initialization code, , seems initialize correctly. when call variable later @ runtime, throws it's hands in air , says has no idea is. the base class: namespace events { class messagereceiver; class messagejoint { public: messagejoint( ogre::string id, messagereceiver* receiver ); void fireevent( messagereceiver* ); void setdata( boost::any d ){ data = d; } void setidentifier( ogre::string id ){ identifier = id; } virtual void handleevent( boost::any ) = 0; void tunein( messagereceiver* r ) { listeners.push_back( r ); } ogre::string getidentifier(){ return identifier; } messagereceiver* owner; std::vector< messagereceiver* > listeners; boost::any d

html - How to force a DIV to have height of specified percentage? -

i have html: (i want header 15% of screen height) entire dom tree .header div defined height percentage. header div height wrap it's content less 15% of screen. <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="css/index.css"> <title> </title> </head> <body onload="pageload();"> <div class="header"> </div> <div id="tempdiv" style="visibility:hidden"></div> <div class="page-body"> </div> <div class="footer"> </div> <script> $(".footer").load("footer.html");</script> </body> </html> the css is: html { -webkit-touch-callout: none; -webkit-text-size-adjust: none; -webkit-user-select: none; background-color:black; background-image:url('../res/bg.pn

php - How to have conditional database seeding in Laravel? -

can create seed groups? instance have seeds want executed of time. how can add flag when executing php artisan migrate --seed --group1 what options such feature? well, create multiple seeder extended classes, , having each 1 of them running $this->call() on specific group of tables , specify 1 want using --class flag. this: class grouponedatabaseseeder extends seeder { public function run() { eloquent::unguard(); $this->call('usertableseeder'); $this->call('roletableseeder'); } } and call way: php artisan db:seed --class="grouponedatabaseseeder" well, or extend seedcommand add functionality via methods instead of classes.

java - Dynamic web procject creation error with eclipse? -

failed while installing dynamic web module 3.0. java.lang.string cannot cast oracle.eclipse.tools.weblogic.weblogicserverinstall install eclipse java ee developer tools, eclipse java web developer tools, java server faces tools, eclipse faceted project framework, eclipse faceted project framework jdt enablement. can install these eclipse itself. go , install new software. wont give error again.

Scanning till EOF in python -

one way know how while 1: try: n=int(raw_input()) except: break any other way shorter ? by shorter mean consumes lesser number of characters. for following code, read() call block until eof encountered: import sys sys.stdin.read() or line @ time consume less memory: import sys line in iter(sys.stdin.readline, ''): pass

Chrome dev channel features list -

where can find list of features either completed or in development in chrome developer channel? i'am pretty sure, i've come across such list before , can't find again after spending hour searching. i've looked @ http://www.chromium.org/getting-involved/dev-channel not find related link. found link finally. seems have changed location. http://www.chromestatus.com/features

web scraping - Pretend Firefox instead of Phantom.js -

when try scrap this site phantomjs, default, phantomjs send following headers server: "name":"user-agent", "value":"mozilla/5.0 (unknown; linux i686) applewebkit/534.34 (khtml, gecko) phantomjs/1.9.1 safari/534.34"} and status 405 "not allowed" response. i read in phantomjs api reference in order imitate request coming other browser, should change user-agent value. on wikipedia found value should use pretending firefox under ubuntu : 'name': 'user-agent', 'value': 'mozilla/5.0 (x11; ubuntu; linux i686; rv:16.0) gecko/20120815 firefox/16.0' in part of phantomjs should put properties? should insert them - inside page.open , or inside page.evaluate , or @ top of it? actually, on page.settings . before open . here example using against page linked: var page = require('webpage').create(); page.settings.useragent = 'mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (k

angularjs - Angular.js memory issue with add & removing nodes, graph attached, ng-repeat -

Image
i'm adding , removing html elements make , infinity scroll.. angular doesnt seem garbage collecting straight away.. please have @ graph. it climbs , climbs , drops while scrolling.. and here sample of code: $scope.items = , array of lots of items. $scope.itemsview.push($scope.item[i]); $scope.itemsview.splice(theindex,1); any ideas? it's not angular garbage collecting, it's responsible removing html elements dom. can't see graph whether angular doing job or not. did try forcing gc pressing garbage bin icon @ bottom of chrome dev tools? chrome gc when deems necessary , not instantly since it's costly operation.

javascript - BackBone Model - > Collection -> Model -> Update - does not trigger change on root model -

i'm having this serverinfomodel = backbone.relationalmodel.extend({ relations: [ { type: backbone.hasmany, key: 'data', relatedmodel: 'data', collectiontype: 'datacollection', reverserelation: { key: 'id', includeinjson: 'id' } } ] }) data = backbone.relationalmodel.extend({ }); datacollection = backbone.collection.extend({ model: data }); now have view associated serverinfomodel. if change value model data within collection, "change" not triggered on serverinfomodel, triggered on datacollection; how can pass "change" event serverinfomodel datacollection ? i found out how it, listen 'data' change , trigger 'change' futher serverinfomodel = backbone.baserelationalmodel.extend({ url: function () { return "/examples/serverinfo.json" }, setu

ios - selectedIndex UItabBarController not working -

i know gonna easy fix, reason when try fix issue other solutions, doesnt work. in app set push notifications, , i'm trying set functionality of opening app tabbaritem when app opened notifications. here code have far, please tell me if i'm using right method. i'm not experienced appdelegate.m please forgive me if wrong. appdelegate.m #import <corelocation/corelocation.h> @interface appdelegate : uiresponder <uiapplicationdelegate,uitabbarcontrollerdelegate,cllocationmanagerdelegate>{ cllocationmanager *locationmanager; } @property (strong, nonatomic) uiwindow *window; @property(nonatomic,readonly) uitabbar *tabbar; @property(nonatomic,strong) uitabbarcontroller *tabbarcontroller; @end appdelegate.m - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { uiapplication* app = [uiapplication sharedapplication]; app.networkactivityindicatorvisible = yes; [[uiapplication sharedapplication] r

java - How to send a directory of files -

i need change code send directory of image files @ moment sends 1 file, main goal have ask directory , send of files in directory (image files) server need display how data sent code have is: client: package sockets; import java.net.*; import java.io.*; public class client { public static void main (string [] args ) throws ioexception { int filesize=1022386; int bytesread; int currenttot = 0; socket socket = new socket("127.0.0.1",6789); byte [] bytearray = new byte [filesize]; inputstream = socket.getinputstream(); fileoutputstream fos = new fileoutputstream("copy.txt"); bufferedoutputstream bos = new bufferedoutputstream(fos); bytesread = is.read(bytearray,0,bytearray.length); currenttot = bytesread; system.out.println("the size of data transferred " + bytesread + " bytes"); { bytesread = is.read(bytearray, cu

How do I reset the value of variables in a loop? (Python 3.1.1) -

when run code , battle part of game, random values assigned characters attack, defense, damage , health. however, after first turn, keep getting same values , can't reset. for example, user's attack random number 4 11. program "rolls" 5 , assigns variable useratk useratk = random.randint(4,11) i assumed everytime loop ran, generate new value. not, , every time print variable same value first assigned. missing something? below code import random # variables # # # variable user's character name username = input("brave warrior, name? ") # variable used in input function pause game enternext = ("press enter continue...") # variable used format user input prompt # battle text prompt = ">>>>> " # variable used add new line string newline = "\n" # variable used display message when hero dies herodeadmsg = username + " has fallen!" # these variables represent dragon's stats (hp, atk

ios - Copying single iPhone view controller to iPad view controller gives lock icon/ doesn't work -

i had iphone app converted universal. followed excellence advice in question copy on storyboard. converting storyboard iphone ipad now, created new custom uiviewcontroller new feature app. did in iphone storyboard. result, want copy uiviewcontroller ipad storyboard. can follow above steps again, seems overkill. want copy , paste iphone storyboard ipad storyboard. when this, see large lock icon , nothing happens. assume have setting messed can't figure out (localization locking set nothing). @koregan's advice has worked me. 1) duplicate iphone-storyboard , rename mainstoryboard_ipad.storyboard 2) open file text editor. 3) search targetruntime="ios.cocoatouch"and change targetruntime="ios.cocoatouch.ipad" 4) save , reopen xcode -> ipad-storyboard contains same iphone-file everyting disarranged

php - Why doesn't this code render the time in addition to the date? -

this code renders date (month, day, year) not time. being used on php upload site. grateful suggestions. thank you. <time datetime="<?= date( 'm-d-y', strtotime( $file->added ) ) ?>"><?= date( 'm.d.y', strtotime( $file->added ) ) ?> you need add request output time parameter 1 of date() function. <time datetime="<?= date( 'm-d-y h:i:s', strtotime( $file->added ) ) ?>"><?= date( 'm.d.y h:i:s', strtotime( $file->added ) ) ?>

linux shell: prepend or append text to next line after matching line -

using shell script in linux (bash or csh). find lines match given text pattern, , each line prepend or append (depending on application) text following line. for example, file containing lines this: header 1 12345 header 2 12345 header 1 12345 header 2 12345 if searching "header 1", , append text "abcde", output this: header 1 12345 abcde header 2 12345 header 1 12345 abcde header 2 12345 i have cases want abcde preceding 12345. i have been trying understand usage of sed purpose, feel stymied. pointers appreciated. try command: sed '/header 1/{n;s/$/ abcde/}' input.txt this logic: for each line in 'input.txt' if line matches /header 1/ read next line append string ' abcde' endif endfor

css float - CSS 3 Column Footer Layout (Columns are offset) -

Image
so i've written simple 3 column footer layout should work. i'm getting different results in different browsers. the css: #footer{ width:980px; height: 150px; padding: 10px; font-size: 12px; background-color: #94171b; color: #fff; } #footer_left{float:left; width:300px; text-align:left; border: 1px solid;} #footer_middle{width:300px; text-align:left; border: 1px solid;} #footer_right{float:right; width:300px; text-align:left; border: 1px solid;} the html <div id="footer"> <div id="footer_left"> <b>site navigation</b><br> <a href="/dev/site/">home</a><br> <a href="/dev/site/about.php">about</a><br> <a href="/dev/site/dining.php">food</a><br> <a href="/dev/site/drinks.php">drinks</a><br> <a href="/dev/site/">contact</a> </div>

c++ - C: Initializing struct variables after declaration -

i encountered not figure out why language allow b = c; below , fail b = {3, 4}. there issue allowing latter ? struct t { int x; int y; }; int main() { t = {1, 2}; t b; b = {3, 4}; // why fail ? t c = {3, 4}; b = c; // works return 0; } it fails because {3, 4} , though it's valid initializer, not expression (at least isn't in c; see below more c++). every expression in c has type can determined examining expression itself. {3, 4} potentially of type struct t , or int[2] (an array type), or of myriad of other types. c99 added new feature called compound literals use similar syntax initializers, let specify type, creating expression: b = (struct t){3, 4}; note (struct t) not cast operator; it's part of syntax of compound literal. for more information on compound literals, see section 6.5.2.5 of draft c11 standard . compound literals introduced 1999 iso c standard (c99). if compiler doesn't support c99 or b

java - Quartz Scheduler and NextFireTime -

i using quartz scheduler ,it's working fine. have following cron job: <job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/jobschedulingdata" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.quartz-scheduler.org/xml/jobschedulingdata http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd" version="1.8"> <schedule> <job> <name>sendsmseveryminute</name> <group>everyminutegroup</group> <description>run job every minute</description> <job-class>com.sk.model.sendsmsmain</job-class> </job> <trigger> <cron> <name>dummytriggername</name> <job-name>sendsmseveryminute</job-name> <job-group>everyminutegroup</job-group>

php - Single row explode with loop -

i have data stored in single column mysql db this: 1-yizle-smallpic-this pretty cool-2-user-smallpic-testing!1-yizle-smallpic-this pretty cool-2-user-smallpic-testing!- now want output data in loop , need loop every 4 hyphens, data output be $uid,$username,$userpicurl,$comment.. the code have far, works, returns first occurrence. foreach($result->fetch_assoc() $v){ list($uid, $username, $userpicurl, $comment) = explode("-", $v); print "$uid $username $userpicurl $comment"; } foreach($result->fetch_assoc() $v) { $parts = explode("-", $v); ($i = 0; $i < count($parts); $i+=4) { list($uid, $username, $userpicurl, $comment) = array_slice($parts, $i, 4); print "$uid $username $userpicurl $comment"; } }

Is javax.servlet.http.HttpResponse deprecated by Java 7.0? -

as title goes, cannot find class javax.servlet.http.httpresponse in oracle's official document java 1.7, can find in java 1.6 , lower edition. why? it part of javaee not javase. see javaee 6 , 7 docs below. not deprecated. javaee 6: http://docs.oracle.com/javaee/6/api/javax/servlet/http/httpservletresponse.html javaee 7: http://docs.oracle.com/javaee/7/api/javax/servlet/http/httpservletresponse.html edit: noticed class name in post. there no javax.servlet.http.httpresponse , perhaps mean javax.servlet.http.httpservletresponse . if see above, otherwise you'll have figure out class need.

debian - Missing en_US locale required for python -

i'm not sure if place ask error. somehow seem not have locale on debian linux system. basically, became aware of when python program trying run executed line locale.setlocale(locale.lc_all, 'en_us') . error: traceback (most recent call last): file "", line 1, in file "runserver.py", line 4, in site = tarbellsite(os.path.dirname(os.path.abspath( file ))) file "/home/brian/.virtualenvs/tarbell/src/flask-tarbell/tarbell/app.py", line 36, in init self.projects = self.load_projects() file "/home/brian/.virtualenvs/tarbell/src/flask-tarbell/tarbell/app.py", line 59, in load_projects project = imp.load_module(name, filename, pathname, description) file "/home/brian/code/contrib/tarbell/base/config.py", line 28, in locale.setlocale(locale.lc_all, 'en_us') file "/home/brian/.virtualenvs/tarbell/lib/python2.7/locale.py", line 547, in setlocale

php - how to Insert multiple rows from array saved in a session into table? -

this question exact duplicate of: insert multiple rows array saved in session table? 1 answer i'm passing multiple state values stored in session variable, mysql table via php using 1 insert command , i'm wondering if possible insert each state value different row. have id saved in variable insert each state. $campaign_id each state stored in session variable. print_r($_session['stateslist']); assuming have 2 states saved in $_session['stateslist'] (ny, ca) , campaign id 5, database this campaign_id state 5 ny 5 ca i know similar insert multiple rows via php array mysql having problems inserting each state saved in session campaign_id. there several ways pass along variables 1 script another, if want use session vars that, guess should: cast key-value array associative array $myvar=array(&

Opencart .htaccess config issue -

i know there similar issues unable resolve problem i've been having. i using opencart 1.5.5.1. updated website links different have 301 redirected large number of links. problem is, aren't working. this .htaccess file looks like: # 1.to use url alias need running apache mod_rewrite enabled. # 2. in opencart directory rename htaccess.txt .htaccess. # support issues please visit: http://www.opencart.com options +followsymlinks # prevent directoy listing options -indexes # prevent direct access files <filesmatch "\.(tpl|ini|log)"> order deny,allow deny </filesmatch> # seo url settings rewriteengine on # if opencart installation not run on main web folder make sure folder run in ie. / becomes /shop/ rewritebase / rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^download/(.*) /index.php?route=error/not_found [l] rewritecond %{request_filename} !-f

playframework - Play integration test with browser that supports WebSocket -

i trying simple integration tests websocket code using withbrowser: class applicationcontrollerspec extends specification{ "application controller" should { "do something" in new withbrowser{ browser.goto("http://localhost:3333") browser.pagesource must contain("hello") } } } when long error part of says: webdriverexception: com.gargoylesoftware.htmlunit.scriptexception: referenceerror: "websocket" not defined. is there alternative webdriver have websocket implemented? alternatively, there way have open firefox or chrome? i appreciate advice on how test websocket code, looks there unanswered question here . i using play 2.1.3. i test websockets firefox: https://github.com/schleichardt/stackoverflow-answers/commit/13d5876791ef409e092e4a097f54247d851e17dc#l8r14 withbrowser supports first argument browser, see doc . so like class applicationcontrollerspec exte

c# - Why do I get this error when using a thread? -

so, got program working, becomes unresponsive when run it, decided run in thread. now, kept same, instead of using button run code directly, i'm using button run thread contains code. program doing creating request webpage, getting cookie webpage, run through list of numbers, using numbers create different post requests using cookie log in. working: private void button3_click(object sender, eventargs e) { string cookie = webbrowser1.document.cookie; list<string> removals = new list<string>(); foreach (string s in listbox1.items) { //do stuff } } not working: thread th; public void thread() { string cookie = webbrowser1.document.cookie; list<string> removals = new list<string>(); foreach (string s in listbox1.items) { //do stuff } } private void button2_click(object sender, eventargs e)

asp.net - dropdownlist not retaining values on submit -

<asp:dropdownlist id="ddl1" runat="server" autopostback="true" width="110px"> <asp:listitem>test1</asp:listitem> <asp:listitem>test2</asp:listitem> <asp:listitem>test3</asp:listitem> </asp:dropdownlist> <asp:dropdownlist id="ddl2" runat="server" width="110px"> </asp:dropdownlist> <asp:button id="btnsubmit" runat="server" text="submit" /> i trying add list items ddl2 on ddl1.selectedindexchanged based on selected index. ddl2.items.insert(0, new listitem("please select", "-1")) ddl2.items.insert(1, new listitem("value2", "1")) ddl2.items.insert(2, new listitem("value3", "2")) protected sub ddl1_selectedindexchanged(byval sender object, byval e eventargs) handles ddl1.selectedindexchanged ddl2.items.clear() if (ddl1.selectedindex

c# - ProcessStartInfo input during execution -

assume execute program processstartinfo: processstartinfo startinfo = new processstartinfo(); startinfo.filename = @"program"; startinfo.arguments = "start"; process.start(startinfo); during execution, program asking input user. how can provide input c#? thanks in advance. if know arguments should given process, before starting it, should change (second) application uses arguments in main. explanation can found here . if still want possibility enter manually data while process running (when started manually) these arguments , when not present, ask them user instead of returning application , stopping.

python - Library for searching through mysql or pgsql? -

i know of whoosh , doesn't work on sql such mysql , postgresql . any library search on any, or both, python ? it recommended use standard python bindings mysql , postgreasql fetch data out of database , index these in format need. both these databases support full text search (a functionality provided whoosh) natively - i.e. wont need 3rd party libraries full text search within mysql or postgresql. hence use sql facilities within these databases full text search within db environment also, may aware - full text search engines index data efficient search , retrieval. never crawl file systems or data stores on own - means have write own file system crawler or database crawler extract data files / tables , store them within search schema defined using whoosh . i recommend taking @ pylucene python port of lucene powerful text search engine. of course, remember appears setting pylucene bit involved , never tried within projects.

jquery - Change the text in Javascript alert -

is possible change text in javascript alert after appeared? for example possible create timer inside of alert? ┌────────────────────────┐ │ x seconds passed... │ │ <ok> │ └────────────────────────┘ ...where x changed 0 passed seconds value. i know can use modal or something, want know if it's possible change text alert box after appeared. i guess it's not possible, it's better ask. after bit of preliminary searching, seems it's impossible want. due security reasons, think. it not recommended use alert box because ( webplatform ): this synchronized method call. meaning, calling method pauses scripting execution of window method called, until user closes displayed dialog. also, depending on cross tab/window usage, can pause scripting executions of other windows/tabs same domain. calling method in browsers prevents user interacting entire browser, or browser window (along of tabs), until dialog clos

asp.net - Want String in XML body no other strings -

i have function can return me xml tag want hustget string passed not other tag in body can edit function. [servicebehavior] public class helloservice : ihelloservice { public string greet(string name) { return "hello ," + name; } } public class consolemessageinspector : iclientmessageinspector, idispatchmessageinspector { public message createmessage(message message) { messagebuffer buffer = message.createbufferedcopy(int32.maxvalue); var messagecopy = buffer.createmessage(); console.writeline(messagecopy.tostring()); return buffer.createmessage(); } } xml want string in body no other tag possible.. {<s:envelope xmlns:s="schemas.xmlsoap.org/soap/envelope/">; <s:header> <action s:mustunderstand="1" xmlns="schemas.microsoft.com/ws/2005/05/addressing/none">http:/…; </s:header> <s:body&g

iphone - Test to Understand Objective-C Vs Pointers -

i have wrote test code understand objective c vs c pointers. here code.. eg: nsmutablearray *array = [[nsmutablearray alloc] init]; nsmutablearray *sec_mut; if (array) { [array addobject:@"my"]; [array addobject:@"name"]; [array addobject:@"is"]; [array addobject:@"bob"]; sec_mut = [[nsmutablearray alloc] init]; if (sec_mut) { (id obj in array) { // allocating new object , adding or points existing memory (just adding address)? [sec_mut addobject:obj]; } } } [array removeobjectatindex:0]; (id obj in sec_mut) { nslog(@"str %@\n",obj); } output: str str name str is str bob even though i've deleted object @ index 0 4 object displaying in new array, not pointing , having own object, right? or dangling pointer? thanx when inserting objects cocoa col

ios - Error uploading zip file on dropbox -

-(void) uploadtodropbox { nsstring *targetfile = path_zip_file; dropboxlistingview *dropboxview = [[dropboxlistingview alloc] initwithpath:@"/" withdelegate:self mode:importexportmodeexport]; dropboxview.uploadfiles = [nsarray arraywithobject:targetfile]; uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:dropboxview]; [self presentviewcontroller:navigationcontroller animated:yes completion:nil]; } i'm getting warning [warning] dropboxsdk: error making request /1/files_put/dropbox/currentdocument.zip - (403) forbidden

java - Weblogic Leaked Connection timeout -

if database query call made using connection obtained weblogic datasource, never returns within connection inactive timeout, cause connection leak. example, connection inactive timeout 500 seconds , db call takes 600 seconds return will cause connection leak ? when query takes more time defined in connection transaction properties, sqlexception occur (transactiontimeout) , execution aborted. if have many such concurrent queries, may result in bad weblogic state , need restart application server (maybe datasource restart sufficient).