Posts

Showing posts from May, 2012

mysql - TCL HTML File Viewer -

mysql - TCL HTML File Viewer - i want convert info mysql html using tcl. the real problem converting mysql info html, showing html in tcl viewer, can host ie within tcl canvas or widget etc. want develop adhoc html-reporting module assignment. in short: want load/open/view html file in tcl. samples highly appreciated. while can't create ie render on canvas — many things interact in unpleasant ways create impossible — may able utilize optcl embed in window, can set in canvas if choose. here's informative illustration page: package require optcl optcl::new -window .htm {http://wiki.tcl.tk} .htm config -width 800 -height 600 pack .htm this manufacture instance of com object handling http url (in case, http://wiki.tcl.tk ) , embed in tk widget ( .htm ). if going embed in canvas, you'd do: package require optcl canvas .canv optcl::new -window .canv.htm http://wiki.tcl.tk .canv create window 0 0 -anchor nw -window .canv.htm pack .canv wel

node.js - simple server handling routes and giving error nodejs mysql -

node.js - simple server handling routes and giving error nodejs mysql - i'm trying write simple server using nodejs , have server ship different queries and/or custom headers/responses based on routes. however, in getusers() function error keeps getting nail , printing 'error querying' console instead of printing email rows. know server connected fine, because can homecoming query when utilize db , homecoming query createconneciton using sec example. help spotting error appreciated. thanks. what i'm trying done: var http = require('http'); var mysql = require('mysql'); var url = require('url'); var util = require('util'); var db = mysql.createconnection({ host : "*********", user : "*********", password : "*********", port : '****', database : '*********' }); db.connect(function(err) { console.log('connected'); if (err) console.

c# - Get documents for base class and inheriting classes in one query -

c# - Get documents for base class and inheriting classes in one query - i have mongo collection of taskbase documents. taskbase has 3 subclasses. created collection manager collection (from generic manager use). when create, update or retrieve subclass of taskbase right type , no exception. i created next method: public ienumerable<taskbase> gettasksbyappid(string appid) { var entityquery = query<taskbase>.eq(t => t.appoid, appid); homecoming this.mongoconnectionhandler.mongocollection.find(entityquery).tolist(); } when run exception element [some element existing in subclass] not property or fellow member of taskbase understand why getting exception, don't know it. collection of types of tasks associated app. you need show driver class hierarchy. there 2 options, first using bsonknowntypes , bsondiscriminator attributes, other using bsonclassmap . attributes decorate base of operations class specific derived classes want incl

excel - reading a csv file in r where the header have comas -

excel - reading a csv file in r where the header have comas - in excel when opening csv, can see column names separated comas e.g rabbit,8am,carrot fox,12am,fish(salmon) 1 2 4 4 2 3 . . . . . . when read type of file in r, reads as rabbit..8am.carrot fox...12am..fish.salmon.. 1 2 4 4 2 3 . . . . . . is there way read file can comas back. trying create variables column names splitting on commas. set check.names = false when using read.table . see ?read.table > foo <- read.t

osx - How to prevent the java process icon display in mac -

osx - How to prevent the java process icon display in mac - when start java process, display java icon in dock under mac. have added next line .profile, still not working export java_tool_options=-dapple.awt.uielement="true" anyone help ? either in java code, add together this: system.setproperty("java.awt.headless", "true"); or @ command-line, add together this: java -djava.awt.headless=true -jar myprog.jar java osx

c++ - Qt renderText() functions bug - text crashes -

c++ - Qt renderText() functions bug - text crashes - i utilize qglwidget draw graphics in qt, , need render text within widget. the problem after time, turns from: to this: and code looks this: glpushmatrix(); qglcolor(qt::white); rendertext(-29, 11.0, -8, "tablica wyników", qfont("arial", 12, qfont::light)); ... glpopmatrix(); what's wrong code/function? c++ qt qglwidget

css - HTML scrollable table header and body alignment -

css - HTML scrollable table header and body alignment - i've spent great deal of time , effort on toying , researching this, cannot figure out how align column headers scrollable table body in html. there other solutions , techniques posted on here , @ random places on web, yielded inconsistent results, random amounts of data. here's jsfiddle. note have custom css applied, bootstrap's css. please expand result panel big plenty html headers not wrap. to summarize html, there 2 tables - 1 column headers, 1 info cells. each wrapped in <div> , allows cells scrollable , sets width of columns. business relationship scroll bar showing (the info dynamic , have no thought how much info there be), <div> wrapper around table cells set show scroll bar, , wrapper around table headers has css applied: .grid-container .column-wrapper { width: calc(100% - 16px); /* 16px approximate width of scroll bar */ } this works on monitor when zoom 100%, on

javascript - Using cordova, can I use resolveLocalFileSystemURL to access a file that was in my build? -

javascript - Using cordova, can I use resolveLocalFileSystemURL to access a file that was in my build? - i'm building app need re-create pdfs within www folder shared device folder ( fileentry.tourl ) i'm not sure access these pdfs after app on device. if utilize resolvelocalfilesystemurl , can specify file path , re-create found file fileentry.tourl() folder... i'm not sure file path be. my file located www/media/pdf/testdocument.pdf - how access file after have done build? use 1.2.0 of file plugin. should able utilize cordova.file.applicationdirectory @ bundle. javascript xcode cordova

c# - How to use parameters in SQL query with column name -

c# - How to use parameters in SQL query with column name - i have next sql query takes header file , creates column same name header: sqlcommand createtable = new sqlcommand("create table " + tbxlstablename.text + " (" + dc.columnname + " varchar(max))", myconnection); it open sql injection attack decided utilize parameters this: string strcreatetable = "create table @tablenamecreatexls (" + dc.columnname + " varchar(max))"; sqlcommand createtable = new sqlcommand(strcreatetable, myconnection); createtable.parameters.addwithvalue("tablenamecreatexls", tbxlstablename.text); dc datacolumn object. i getting next error: incorrect syntax near @tablenamecreatexls how can resolve error? you can't utilize parameters table name , column names, can utilize sqlcommandbuilder.quoteidentifier method escape values. like: sqlcommandbuilder sqlbuilder = new sqlcommandbuilder(); string column

mysql - Query to find result with max rundate with max horizon -

mysql - Query to find result with max rundate with max horizon - table info looks like: eventid | mpid | rundate | horizon | otherdata 1 | 1 | 23-jun-2014 | 360 | other value 1 | 1 | 23-jun-2014 | 365 | pther value 1 | 1 | 23-jun-2014 | 300 | pther value 1 | 1 | 22-jun-2014 | 700 | pther value 1 | 2 | 23-jun-2014 | 400 | other value 1 | 2 | 23-jun-2014 | 340 | oth 2 | 3 | 23-jun-2014 | 360 | pther value 2 | 3 | 23-jun-2014 | 300 | pther value 2 | 3 | 22-jun-2014 | 365 | pther value i want select max rundate each event , marketplace grouping , select max horizon among grouping , print entire row. desired result : eventid | mpid | rundate | horizon | otherdata 1 | 1 | 23-jun-2014 | 365 | pther value 1 | 2 | 23-jun-2014 | 400 | other value 2 | 3 | 23-jun-2014 | 360 | pther value please allow me

Where are pointers in C++ stored, on the stack or in the heap? -

Where are pointers in C++ stored, on the stack or in the heap? - i trying understand difference between stack , heap memory, , this question on this explanation did pretty job explaining basics. in sec explanation however, came across illustration have specific question, illustration this: it explained object m allocated on heap, wondering if total story. according understanding, object indeed allocated on heap new keyword has been used instantiation. however, isn't the pointer object m on same time allocated on stack? otherwise, how object itself, of course of study sitting in heap accessed. sense sake of completeness, should have been mentioned in tutorial, leaving out causes bit of confusion me, hope can clear , tell me right understanding illustration should have 2 statements have say: 1. pointer object m has been allocated on stack 2. object m (so info carries, access methods) has been allocated on heap your understanding may correct, stat

excel vba - ACCESS VBA date format change when changing numbers -

excel vba - ACCESS VBA date format change when changing numbers - i have little vba code export access excel. did formatting number info type in code changes date format well. don't know syntax date format. 1 help me please. for reference, lvlcolumn = 0 recsetnxair.fields.count - 1 wrksheetnxair.cells(1, lvlcolumn + 1).value = _ recsetnxair.fields(lvlcolumn).name wrksheetnxair.cells(1, lvlcolumn + 1).entirecolumn.numberformat = sfromat next lvlcolumn this code works numbers , need date well. regards, jeeva i have formatted using dbinteger or dbdouble respective field type user-defined format. regards, jeeva vba excel-vba

php - Swear Word Filter - output from database -

php - Swear Word Filter - output from database - i have html form saves name , comment mysql database. name , comment entries displayed in table format on php page. i want have swear words comment field appear three asterisks when displayed in php outputted table. i got work follows: swear.php <?php $find = array("badword1","badword2","badword3"); //words don't want displayed $replace = array("***","***","***"); //the replacements ?> process.php <?php //connect database $dbc = mysqli_connect('host', 'username', 'password', 'db') or die('error connecting mysql server.'); //connect swear.php require("swear filter.php"); //process form & email $name = mysqli_real_escape_string($dbc, trim($_post['name'])); $email = mysqli_real_escape_string($dbc, trim($_post['

c# - How to add scrollview to the grid in xaml -

c# - How to add scrollview to the grid in xaml - adding scroll view next grid works rectangle @ bottom not visible fully,i want add together scroll view content panel grid can view rectangles if more 10 <grid x:name="layoutroot" background="white" margin="0,0,0,-45"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <!--titlepanel contains name of application , page title--> <stackpanel x:name="titlepanel" grid.row="0" margin="12,17,0,28"> </stackpanel> <!--contentpanel - place additional content here--> <grid x:name="contentpanel" grid.row="1" margin="12,0,12,0"> <scrollviewer > <grid> <rectangle fill="#ff283742" horizontalalignment="left&qu

asp.net - Access host nearest you -

asp.net - Access host nearest you - i have web application asp.net mvc hosted in europe. problem application used people both in , in china , ones in china experiencing site slow. dont think net connection slow response time application 400 - 500 ms is possible host asp.net webapplication on 2 hosts , when access application access host nearest you? asp.net iis

javascript - Chrome extension window listener - on minimized -

javascript - Chrome extension window listener - on minimized - i'm creating little chrome extension, , having problem figuring out should check whether window minimized or not. so far using chrome.tabs.onactivated , chrome.tabs.query hear tab alter , works expected, problem need know when browser window minimized. chrome.tabs.onactivated.addlistener(function() { chrome.tabs.query({currentwindow: true, active: true}, function(tabs){ //do }); }); i have looked @ onfocuschanged seems work multiple browser windows. how check browser window minimized? it's easy if have window id, can window object: chrome.windows.get(windowid, function(win){ if(window.state == "minimized") { /* ... */ } }); if need current window, utilize getcurrent instead: chrome.windows.getcurrent(function(win){ if(window.state == "minimized") { /* ... */ } }); javascript google-chrome-extension

computer vision - Problems with Image Classification -

computer vision - Problems with Image Classification - my objective classify images 1 of few predefined categories (sportshoes, shirts, heels, watches..) catalog (and later on homecoming similar images catalog). i using dense-sift feature extraction, representing each image using handbag of visual words , svm classification. training images taken catalog. the problem images querying pictures taken photographic camera , these different catalog images. example, heels/sportshoes in catalog contain right shoe taken @ 1 particular angle, whereas query image contains heel , part of foot well, , angle @ photo taken can vary (deviation catalog images). hence classification works when query(test) image image catalog (those have not used training), not images taken camera. how proceed? problem feature vector or training info itself? if cannot alter training data, there else can use? should utilize different approach (not bag-of-words) ? thanks computer-vision svm sift

ios - How to add image views to custom annotation view keep pin image on screen and take touches from it? -

ios - How to add image views to custom annotation view keep pin image on screen and take touches from it? - i have mapview pins show location of photo (coordinates taken coredata) , need show photo when pin selected (using url , afnetworking). i need save both pin image and photo image when pin selected. if next pin selected previous pin deselected remove photo screen , add together photo of corresponding pin. here image show particularly need: so pin on screen , photo on screen. problems: this task iphone usage of popover not available. i need maintain both image of pin , photo, not image instead of pin. that's why cannot utilize property 'image' of mkpinannotationview class - sets image instead of pin. mk has private classes views using search on touches problem. solution first , sec problem: i've made custom class of mkpinannotationview responsible adding imageview mkpinannotationview maintain both pin image , photo on screen. #im

Push values in an array jQuery -

Push values in an array jQuery - i need array stores selected values given options @ contiguous locations. when run code below, values stored @ same location(0) , rest of array empty. following html: <div> <table id="mytable"> <tbody> <tr> <th>robot by</th> <th>robot name</th> <th>status</th> <th>add</th> <th>remove</th> </tr> <tr id="col1"> <td>google</td> <td><em>googlebot</em></td> <td> <select class="myoption"> <option value="same default">same default</option> <option value="allow

shell - How to prevent php of loading a not requested page -

shell - How to prevent php of loading a not requested page - i had php page executing shellscripts untill added curl process, now, page instead of loading final result (print $output;) loads page of curl request, there way block page of loading , have original behaviour? this php code: <?php $thetext = $_post['thetext']; //unify orthography nmt //system("curl --data-urlencode 'contents=$thetext' http://www.chandia.net:8080/nmt"); //new code // curl resource $curl = curl_init(); // set options - passing in useragent here curl_setopt_array($curl, array( curlopt_returntransfer => 1, curlopt_url => 'http://www.chandia.net:8080/nmt', curlopt_useragent => 'codular sample curl request', curlopt_post => 1, curlopt_postfields => array( 'contents' => $thetext ) )); // send request & save response $resp $resp = curl_exec($curl); // close request clear resources curl_close($curl); //to

Plotting polygons in R when y range is character vector -

Plotting polygons in R when y range is character vector - i have plotting code i've used before info numeric or integer. have similar info except 1 column character data, ?polygon says can use. i've been wrestling , can't solve errors i'm getting. help, please! my info is: dem.plotting <- data.frame( group=c(1, 1, 1, 2, 2, 2, 3, 3, 3), year=c("2012", "dem", "non-dem", "2012", "dem", "non-dem", "2012", "dem", "non-dem"), mingdp=c(17.1, 17.3, 20.2, 19.8, 20.3, 21.7, 20.7, 21.7, 22.6), maxgdp=c(19.4, 20.3, 21.5, 20.5, 21.3, 21.9, 21.4, 22.5, 22.3), data=data.frame(group, year, mingdp, maxgdp)) this code i've used before isn't working now: yrange = range(dem.plotting$year) xrange = range(dem.plotting[,3:4]) plot(year~mingdp,data=dem.plotting,type="n",xlab="log(gdp)",ylab="year", ylim=yrange,xlim=

Getting multiple select checkbox value in android listview using Odoo mobile framework -

Getting multiple select checkbox value in android listview using Odoo mobile framework - i using odoo mobile framework. android app connect odoo server. fetch product server , display in listview. want multiple select value listview. here code. when click checkbox, checkboxs checked automatically. not sure due oelistadapter or wrong code. product_list.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <listview android:id="@+id/lvproductlistview" android:layout_width="match_parent" android:layout_height="match_parent" android:cliptopadding="false" android:paddingtop="?android:attr/actionbarsize" > </listview> </linearlayout>

c# - Update List Concatanate string -

c# - Update List Concatanate string - i have class public class roomavail { public int occupancy { get; set; } public int childcount { get; set; } public string childages { get; set; } } i have list of roomavail i.e list rooms; rooms = { new roomavail{occupancy =1,childcount =1,childages ="1" } new roomavail{occupancy =2,childcount =2,childages ="1,2" } new roomavail{occupancy =3,childcount =3,childages ="1,2,3" } } i have populated value of rooms. i have list listage = {12,13,14,14} my requirement : if occupancy in list =2 , should append value of listage in childages . final output: rooms = { new roomavail{occupancy =1,childcount =1,childages ="1" } new roomavail{occupancy =2,childcount =2,childages ="1,2,12,13,14,15" } new roomavail{occupancy =3,childcount =3,childages ="1,2,3" } } i want update rooms variable only. i doing:

java - check internet connection on android (eclipse) -

java - check internet connection on android (eclipse) - i need code algorithm in android eclipse programming : if net connection = connect open programme else show error_activity.xml create class connectiondetector , set below code in class: private context _context; public connectiondetector(context context) { this._context = context; } public boolean isconnectingtointernet() { connectivitymanager connectivity = (connectivitymanager) _context .getsystemservice(context.connectivity_service); if (connectivity != null) { networkinfo[] info = connectivity.getallnetworkinfo(); if (info != null) (int = 0; < info.length; i++) if (info[i].getstate() == networkinfo.state.connected) { homecoming true; } } homecoming false; } // ever want check net create object of class , phone call method below doing: // in activity define globals: boolean

access vba - DoCmd.OutputTo acOutputReport and OpenArgs Workaround -

access vba - DoCmd.OutputTo acOutputReport and OpenArgs Workaround - i have study used study yields 0 records. reports title tells process had 0 records. strnorecordopenarg global veriable main form code ** strnorecordopenarg = "imported ael's" docmd.outputto acoutputreport, "rpt_universal_no_records", acformatpdf, "c:\reports\imported ael's.pdf" strnorecordopenarg = "" report code ** private sub report_open(cancel integer) .txt_header_title.controlsource = "=""" & strnorecordopenarg & """" end sub what happens process completes no study generated. if rem out study code works study title #name. i utilize immediate window , value of strnorecordopenarg holding , should available open study process. all of automate process. if utilize docmd.openreport "rpt_universal_no_records", , "", "", acwindownormal, "imported aels&q

regex - Matching lines with an AND operator in Python -

regex - Matching lines with an AND operator in Python - i have written code below finding lines in infile matches of keywords in keyword file. problem is, want lines of infile contain of keywords. seems harder thought, beginner guess missing obvious. regex doesn't seem have straightforward 'and' operator however. import re infile = open('path/#input.txt', 'r') outfile = open('path/#output.txt', 'w') # read textfile containing keywords find # (and strip newline character '\n') keywords = [line.strip() line in open('path/#keywords.txt')] # compile keywords regex pattern pattern = re.compile('|'.join(keywords)) # see lines in infile match of keywords # , write lines outfile line in infile: if pattern.search(line): outfile.write(line) regular expressions not swiss regular army knife capable of solving every problem. aren't solution problem: there no way utilize one regexp operation

jquery - checkbox buttons hidden status after page refresh -

jquery - checkbox buttons hidden status after page refresh - i have form checkbox toggle buttons (using twitter bootstrap , rails) <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"> <input type="checkbox"> alternative 1 </label> <label class="btn btn-primary"> <input type="checkbox"> alternative 2 </label> </div> i click , take option 1 . refresh page. when page refreshed buttons reset , option 1 not selected more. if go ahead , submit form, option 1 sent server if selected (checked). bug? because of in cookie. if yes, how can check cookie , find ones should pressed , command alter status pressed. i have text fields ( <input type='text'> ) in form well. if write in text fields , refresh page, texts stay. seems somewhere behind scenes state of buttons remain checked, too, on display see them un-checked.

javascript - dom generated images sec by angular giving GET error because of jquery -

javascript - dom generated images sec by angular giving GET error because of jquery - i using angularjs , jquery. i have list of article generated images within : <li ng-repeat="thing in things"> <img src="thing.src" /> blablabal </li> i have error annoy me if doesn't influence user view : get http://localhost:3000/img/%7b%7b%thing.src%20%7d%7d 404 (not found) what ? change code there: <li ng-repeat="thing in things"> <img ng-src="{{thing.src}}"/> blablabal </li> javascript jquery angularjs

symfony2 - Query Builder where IN arrayCollection -

symfony2 - Query Builder where IN arrayCollection - how possible query homecoming results ? productcategory arraycollection of objects related formitemposition. $qb = $this->getquerybuilder('fi'); $items = $qb ->innerjoin('fi.formitemposition', 'fip') ->where('fip.productcategory in (:productcategories)') ->andwhere('fip.documentcategory = :documentcategory') ->setparameters(['documentcategory' => $documentcategory, 'productcategories' => $productcategories ]); symfony2 doctrine2

How to execute a program in linux when the path starts with ".." -

How to execute a program in linux when the path starts with ".." - i'm facing problem, , though might inquire dumb question! how can run programme in ubuntu when path relative current directory? assume i'm in /mydirectory , , programme run here ../otherdir/program , need run . ../otherdir/program . not work. have cd .. , ./otherdir/program !! you can either do ../your/path/./program where programme located in path folder, or execute regular path argument binary, illustration shell scripts sh ../your/path/program linux

FLOT use legend to toggle series -

FLOT use legend to toggle series - this has been marked answered , duplicated when asked again, solution provided in "answer" not utilize legend toggle series, uses different set of check boxes toggling, not legend. wish people here read questions , @ answers provided or accepted before deciding answered or duplicates. the reply accepted here not utilize legend toggle series: toggle info series clicking legend in flot chart? therefore, actual question has not been answered, user opted different solution. i'll inquire again, know of way toggle info series using legend. before asks code, have tried 20 different ways without success, there's no point in posting it. need simple illustration more 1 info set works. if need me provide basic flot chart 3 or 4 info sets can. flot

CSS: Background-Image Not Showing Up -

CSS: Background-Image Not Showing Up - i'm attempting design , create chatbox ui personal project, i've run problem something... i have div acts exit button chatbox. have .png want utilize main appearance of element. using css's background: url() , intended background button, doesn't appear showing up. i looked @ chrome dev tools, said recognized picture... linked properly, , other attributes showing, reason, wasn't appearing: html: <div class= "cb"> <div class= "cb-header"> <div class= "cb-buttons"> <div class= "cb-exit"></div> </div> <div class= "cb-name">ajeethen uthayakumaran</div> </div> ... </div> css: .cb { background-color: rgb(226, 226, 226); position:absolute; bottom:0; width: 260px; height: 350px; float:right; } .cb-header { background-color: rgb(0, 248, 66); width: 10

angularjs - Build URLs based on routes -

angularjs - Build URLs based on routes - is there way build url based on defined angular routes? symfony (http://symfony.com/doc/current/book/routing.html#generating-urls). here illustration of how used: app.config(['$routeprovider', function($routeprovider) { $routeprovider .when('/document/:documentid', { name: 'document', templateurl: 'partials/document.html', controller: 'documentcontroller' }); }]); then in templates utilize like: <a href="{ $router.build('document', {documentid: 4567}) }">view document</a> that compiled into: <a href="/document/4567">view document</a> i have user $stateparams (from angular-ui-router) this. .controller('mainctrl', function ($scope, $stateparams) { $scope.link = $stateparams.documentid; }); ui router wiki on github angularjs url

asp.net mvc - unable to change property value in httpcontext.current.user -

asp.net mvc - unable to change property value in httpcontext.current.user - unable alter property value in httpcontext.current.user. when user logged in getting user details , stored in httpcontext.current.user. below code. formsauthenticationticket authticket = formsauthentication.decrypt(authcookie.value); var s = new system.web.script.serialization.javascriptserializer(); user obj = s.deserialize<user>(authticket.userdata); userinformation currentuser = new userinformation(obj.userid); currentuser.userid = obj.userid; currentuser.firstname = obj.userfname; currentuser.lastname = obj.userlname; currentuser.roles = obj.securitygroupname; currentuser.defaultwhse = 14; httpcontext.current.user = currentuser; i used in global.asax. but user can alter currentuser.defaultwhse value @ time when changed value beloww

r - Looping Sum for Word-filled function -

r - Looping Sum for Word-filled function - i've set list: dow30 <- c("mmm","axp","t","ba","cat","cvx","csco","dd","xom","ge","gs","hd","intc","ibm","jnj","jpm", "mcd","mrk","msft","nke","pfe","pg","ko","trv","utx","unh","vz","v","wmt","dis") i want each of items (individually, in quotes) looped through function, sumprofitonly, , (numeric) returns each item summed together. this longhand method gets me final reply i'm looking ... print(sumprofitonly("dis") + sumprofitonly("mmm") + sumprofitonly("axp") + sumprofitonly("t") + sumprofitonly("ba") + sumprofitonly("cat") + sumprofitonly("cvx") + sumpr

urllib2 - Python - HTTPRedirectHandler doesnt always get redirects -

urllib2 - Python - HTTPRedirectHandler doesnt always get redirects - i using urllib2's httpredirecthandler redirects of url. code looks this: import urllib2, cookielib class httpredirecthandler(urllib2.httpredirecthandler): def redirect_request(self, req, fp, code, msg, headers, newurl): newreq = urllib2.httpredirecthandler.redirect_request(self, req, fp, code, msg, headers, newurl) if newreq not none: self.redirections.append(newreq.get_full_url()) homecoming newreq def getlistofredirecturls(adurl): urllist = [] h = httpredirecthandler() h.max_redirections = 100 h.redirections = [adurl] opener = urllib2.build_opener(h) response = opener.open(adurl) redirect in h.redirections: urllist.append(redirect) homecoming urllist this works great bulk of urls. however, time time, gives me , first url , not final page (or in between). example, advertisement link : 'http:/

sql - Replace statement -

sql - Replace statement - im trying build replace statements i'm getting error: the replace function requires 3 argument(s). incorrect syntax near keyword 'with'. if statement mutual table expression, xmlnamespaces clause or alter tracking context clause, previous statement must terminated semicolon. sql script: select ccc.*, replace(replace(replace(replace(replace(bbb.text, '[change]',convert(varchar,cast(coalesce(ccc.change,0) decimal(10,2)))), '[currentamount]','$'+convert(varchar,cast(coalesce(ccc.currentamount,0) money),1), '[increase]',convert(varchar,cast(coalesce(ccc.increase,0) decimal(10,2))))+ '%', '[amountincrease]',convert(varchar,cast(coalesce(ccc.amountincrease,0) decimal(10,2))))+ '%', '[amountdecrease]',convert(varchar,cast(coalesce(ccc.amountdecrease,0) decimal(10,2))))+ '%' ) status ccccheck ccc (nolock) inner bring

java - Array nullpointerException ERROR -

java - Array nullpointerException ERROR - here partial code: `private instrumento[] repinst; public repositorioinstrumentos(){ instrumento[] repinst = new instrumento[20]; } private int getpos(int id){ int pos= -1; for(int i=0; i<tam; i++){ if (repinst[i]!=null&&repinst[i].getid()==id){ pos=i; i=tam; } } homecoming pos; }` i maintain getting null poiter exception in line: `if (repinst[i]!=null&&repinst[i].getid()==id){` all positions of repinst null. thought putting " if " skip , homecoming pos = -1. why isn't working? repinst local varible in constructor private instrumento[] repinst; public repositorioinstrumentos(){ repinst = new instrumento[20]; } private int getpos(int id){ int pos= -1; for(int i=0; i<tam; i++){ if (repinst[i]!=null&&repinst[i].getid()==id){ pos=i;

From Python program to excel data -

From Python program to excel data - we made programme on raspberry pi in python tells in how many seconds nail button. need know how process info excel sheet, or else clear. can help us? let's you've collected timing info in list button_pushes . let's each entry in list tuple format (datetime_start, datetime_end) . datetime instances can converted string in number of ways, let's you're using isoformat() . let's don't care excel format specifically, tabular info excel can read, csv. import csv out_filename = 'timings.csv' open(out_filename, 'wb') f: author = csv.writer(f) item in button_pushes: writer.writerow(( item[0].isoformat(), item[1].isoformat(), )) you have file, timings.csv, contains rows of when button pressed, , when released. python excel raspberry-pi

ruby on rails - require 'dalli' returns false in the console, although it is in the gemfile -

ruby on rails - require 'dalli' returns false in the console, although it is in the gemfile - following https://devcenter.heroku.com/articles/memcachier#ruby i added memcachier , dalli gems, , did bundle install then ran console and typed require 'dalli' and returns false and can't tell why, in staging , production environment if want test in irb try: gem install dalli gem install memcachier and after require them: require 'dalli' require 'memcachier' if want test in app console, don't need require them that: cache = dalli::client.new cache.set("foo", "bar") ruby-on-rails ruby-on-rails-4 gem dalli memcachier

Socket error when installing eclipse using chef -

Socket error when installing eclipse using chef - i trying install eclipse on ubuntu 12.04 using chef. got cookbook next site https://github.com/geocent-cookbooks/eclipse i have downloaded dependencies eclipse cookbook showed chef_handler, windows , ark. have downloaded these using "knife cookbook download site" command. when run eclipse cookbook next socket error. working behind proxy. , have set proxy correctly. other cookbooks working fine except eclipse. please find error log below. [2014-06-17t05:38:15+05:30] info: forking chef instance converge... [2014-06-17t05:38:15+05:30] warn: chef client 306 running, wait finish , run. [2014-06-17t05:38:43+05:30] warn: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ssl validation of https requests disabled. https connections still encrypted, chef not able observe forged replies or man in middle attacks. prepare issue add together entry configuration file: ``` # verify https co

Orthogonal Array Testing -

Orthogonal Array Testing - i'm newbie software testing. can pls help me understand "orthogonal array testing" i went articles mentioning , it's kind of blackbox testing technique". need more info on it. pls provide that. orthogonal array testing strategy (or "oats") test case selection approach selects highly-varied set of test scenarios in order find many bugs possible in few tests possible. powerful test design approach gaining in popularity because has proved increment efficiency , effectiveness of testing in many different types of testing contexts. disclaimer: created hexawise, tool generates orthogonal array-like sets of software tests may biased benefits of test design approach). using oats, testers can strategically identify manageable number of high-priority tests in situations there might thousands, millions, billions, or gazillions of possible permutations take from. oats based on knowledge vast bulk of defects in prod

java - Parent pane should get resized to outer bounds of rotated child pane -

java - Parent pane should get resized to outer bounds of rotated child pane - i want pane resized rotated kid pane. problem: code: public class test extends application { public void start(final stage stage) throws exception { pane p1 = new pane(); p1.setbackground(new background(new backgroundfill(color.cyan, null, null))); p1.setprefsize(100, 100); p1.setminsize(100, 100); p1.setmaxsize(100, 100); p1.setrotate(45); pane p2 = new pane(p1); p2.setbackground(new background(new backgroundfill(color.red, null, null))); p2.setlayoutx(150); p2.setlayouty(150); grouping root = new group(p2); scene scene = new scene(root); stage.settitle("pane test"); stage.setscene(scene); stage.setwidth(400); stage.setheight(400); stage.setresizable(false); stage.show(); } public static void main(string[] args) { launch(a

Get the count of female/male guests of a Facebook Event without Facebook API -

Get the count of female/male guests of a Facebook Event without Facebook API - i want create web application shows amount of female , male guests of public facebook event. tricky part want accomplish without help of "facebook app". maybe possible through open graph api? greetings this how public event looks not authorized user: and when click on guests: so no, can't. facebook events

wso2esb - WSO2 ESB 4.8.1 does not use Proxy configuration -

wso2esb - WSO2 ESB 4.8.1 does not use Proxy configuration - i using wso2 esb 4.8.1 configured utilize local proxy (squid 3.1.20) passthru transport. seems wso2 esb not utilize proxy retrieve wsdl uri when creating proxy based wsdl. keeps trying retrive wsdl uri straight remote without going through proxy every time click on "test uri" button. how possible configure wso2 esb utilize configured http proxy outgoing requests? give thanks you you seek java start parameters : -dhttp.proxyhost=hostname -dhttp.proxyport=portnumber wso2esb

javascript - how should I define a path in jsp where my .js & css is located in different location -

javascript - how should I define a path in jsp where my .js & css is located in different location - i have bunch of jsp files, js files , css files. these files placed in tomcat server in webapps directory. presently in current project have jsp's located in 1 location , js, css located in different location shown in below image. can help me how include js path relative path. so please give me suggestions path should in relative. thanks in advance i solved it, specifying below in jsp. /... when specify / goes root directory. here code snippet. <link href="/resource2/765432/myproject/css/myproject.css" media="screen" rel="stylesheet" type="text/css" /> thanks helping , if needs help on this, ready help. javascript css jsp jsp-tags jspinclude

c++ - Why call basic_string::substr with no arguments? -

c++ - Why call basic_string::substr with no arguments? - if s1 , s2 strings, (as far can tell) s1 = s2.substr(); means same as s1 = s2; why want phone call substr() without arguments? edit: way phrase same question: why standard define substr thus: basic_string substr( size_type pos = 0, size_type count = npos ) const; rather thus: basic_string substr( size_type pos, size_type count = npos ) const; the reply is, heck of it. rightly noticed, has no advantage (and speed disadvantage) creating copy. speculating why first argument defaulted @ all, guess meant way forcefulness un-sharing of ancient cow strings (not allowed current standards). or over-zealous when adding default arguments. happens best of us. c++ stdstring

html - RewriteRule to redirect to php file not working -

html - RewriteRule to redirect to php file not working - i want simple redirect clean url's on site. e.g. want ajhtestserver.com/registration/ redirect ajhtestserver.com/registration.php should easy , have used .htaccess rewrites on other sites reason not work me today. rewriteengine on # turn on rewriting engine rewriterule ^registration[/]$ registration.php [nc,l] # handle requests "registration" i sure simple missing copied have on other sites work fine me confused why refuses work me here (gives me the requested url /ajhtestserver/registration/ not found on server. error). 1 of days :( any help appreciated. thanks, adam if utilize apache ,first should enable rewrite_mode in http.conf or ...\ rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^registration/(.*)$ registration.php/$1 [l] check .htaccess syntax or rewrite mode. php html .htaccess mod-rewrite rewrite

Italic inline citation in CSL + Pandoc -

Italic inline citation in CSL + Pandoc - i using csl style under http://www.zotero.org/styles/chicago-author-date pandoc. have authors' names in italics style when citing them in text. how can accomplish this? give thanks help. edit: more precise, have in-line citations without parentesis, fisman (2001). have tried add together font-style="italic" <text macro="contributors-short"/> , works when using parenthesis-style citations [@fisman2001] . minimal working illustration provided here. you'll have modify csl style. there various ways of getting want, easies modify line 513 of style from <text macro="contributors-short"/> to <text macro="contributors-short" font-style="italic"/> see e.g. here general instructions on editing csl styles, though edit file in text editor. pandoc citations csl

jquery mobile page swipe fires only once -

jquery mobile page swipe fires only once - absolute newcomer jquery mobile. i'm trying create 'mock up' e-magazine using jquery mobile , page swipe move between pages. the initial 'swipe' works after nothing. can't go forwards or back. i've been going on code can't see i'm missing. can see test site here. any help or advice appreciated. jquery-mobile

how to install or get php 5.5.9 COM extention -

how to install or get php 5.5.9 COM extention - i'm using php 5.5.9. in php.ini file, com extension not available. how add together com extension? [php_com_dotnet] extension=php_com_dotnet.dll in php file shows below error: include(com.php): failed open stream: no such file or directory. php