Posts

Showing posts from August, 2014

I want to know how to repeat a process in python? -

print "you've entered wording system!" print "what words want?" while false: word1 = raw_input('enter word:') word2 = raw_input('enter word:') print word1 print word2 if len(word1)>len(word2): word_difference = len(word1) - len(word2) print word1, "is", word_difference, "letters longer than", word2 elif len(word2)>len(word1): word_difference = len(word2) - len(word1) print word2, "is", word_difference, "letters longer than", word1 elif len(word1) == len(word2): print word1, "has same number of letters as", word2 repeat = raw_input("would enter 2 more words?(y/n)") if repeat == "y": y == false so want create code repeat word1 = raw input repeat = raw_input(asking fort 2 more words) if question ask "would enter 2 more words" == y , if no == bye! just put all code in loop, iterates long repeat (ini...

Random inputs and loops in python -

from random import randint r x = r(1, 100) y = r(1, 10) def rannum(x,y): if (x==y): m = 2*y else: z = x * y print z rannum(x,y) i have value of x , y randomly generated , have function has 2 condition. how construct loop meet x==y condition? how know home many times ran loop meet condition. new programming , got stuck point. please suggest/recommend me way achieve result. have made range of smaller there high probability of selecting same number.thankyou i don't know why doing it, below understand question. from random import randint r def rannum(x,y): if (x==y): m = 2*y print m else: z = x * y print z count=0 while true: count=count+1 x = r(1, 100) y = r(1, 10) if (x==y): print "x equal y after count=",count rannum(x,y) break

how do i populate data on table using dropdown in Rails 4.1 -

i have following dropdown: <%= select_tag 'category', options_from_collection_for_select(@categories, "id", "name"), prompt: "select category"%> i new in rails.i want show data on table when click on category dropdown.is there way in ruby code. make following changes in view: <%= form_tag search_path, :method => 'get' %> <%= select_tag 'category', options_from_collection_for_select(@categories, "id", "name"), prompt: "select category"%> <%= submit_tag "search", :name => nil %> <table> <% @object_for_table.each |object| %> ----your table data here--- <% end %> </table> changes action responsible above view: def search @object_for_table = params[:category].blank? ? model.all : model.where(category_id: params[:category]) end finally make changes in js submit form on category selection. $(document).ready...

php - Optimistic Locking with Laravel 4 -

we kicking new project , starting use laravel 4. know if has support optimistic locking out of box? seems not found no reffrences , talkback on http://www.sitepoint.com/whats-new-in-laravel-4/ if has added , can share guidelines implementation great. thanks, avi still doesn't support. had issue on github, issues down laravel: https://www.google.com.br/search?sourceid=chrome-psyapi2&ion=1&espv=&ie=utf-8&q=laravel%20optimistic%20locking%20github

php - using static variable in different controller -

i'm making application i'm saving user information in user controller of code igniter application inside static variable, want access static variable in other controller, how can approach that? code here <?php class user extends ci_controller{ public static $user_data = array(); public __construct() { parent::__construct(); self::$user_data = array('value'); // values model } } // can user static variable view in controller class friends extends ci_controller{ public __construct() { parent::__construct(); if(user::$user_data->isfriends) { redirect('person/'.user::$user_data->id); } } } // how can access functionality in codeigniter? gives error undefined class user not found static::$user_data = array('value') shouldn...

calling asmx service from php using cURL or similar? -

i call webservice page : http://badmintonpeople.dk/dbf/holdturnering/stilling/ through php, can id's of teams present in sportsclub. the service url is: http://badmintonpeople.dk/sportsresults/components/webservice1.asmx/getleaguestanding and if push "søg" button on page, see variables send are: {"callbackcontextkey":"a99dadc1f9e901007e51592e8c0838916cf337e7613986982b4649b3efba0844d2dc6b4a5be1fa47827e6036cb6a819e","subpage":"6","seasonid":"2014","leaguegroupid":"","agegroupid":"","regionid":"","leaguegroupteamid":"","leaguematchid":"","clubid":"1617","playerid":""} i've tried fetch data returned service through curl , soapclient, can't seem figure out :-( can solve puzzle me, grateful, cause me looks have give :-/ thank in advance! seems there...

jquery - glyphicon for facebook not showing up -

i want use glyphicon facebook, how do that? have: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> html: <ul> <li><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://myurl" ><span class="glyphicon glyphicon-facebook"></span></a></li> </ul> but nothing shows up. i downloaded free glyphicons, include facebook, don't know how include them. edit - right i'm using free glyphicons http://glyphicons.com/ site , using them in img tag. glyphicon-facebook not native bootstrap icon, calling though one. see bootstrap icons @ http://g...

Laravel unit test how to test Event with email without send an email -

how can test snippet without send email ? public function forgot() { $isvalid = $this->updateform->valid(input::only('email')); if ($isvalid) { $result = $this->user->forgot($this->updateform->data()); if (isset($result['user']) && ($result['success'] > 0)) { event::fire('user.mail.forgot', array('data'=>$result['user'])); return response::json(array('success'=>1),200); } $error = isset($result['error'])?array_pop($result):trans('user.generror'); return response::json(array( 'success'=>0, 'errors' => array('error'=>array($error))), 200); } return response::json(array( 'success' => 0, 'errors' => $this->updatef...

Retrieve value for selected radiobutton in ListView asp.net -

i send guid should associated each radio button eventargs when user clicks checkout. able achieve functionality radiobuttonlist cannot use here rest of fields pulled database. there numerous questions dealing type of topic not find 1 addresses trying achieve. i have below list <asp:content id="subscriptioncontent" contentplaceholderid="maincontent" viewstatemode="enabled" runat="server"> <asp:panel id="subscriptionpanel" cssclass="shopping-cart" viewstatemode="enabled" runat="server"> <asp:listview id="newsubscription" runat="server"> <layouttemplate> <table class="table"> <thead> <th>select subscription</th> <th>subscription level </th> <th>descrip...

fortran - Undefined symbols for architecture x86_64: gfortran -

hi i'm trying compile fortran code written else in believe f77 (.for extension). error i'm getting is: undefined symbols architecture x86_64: "_random_", referenced from: _pms_ in ccx1qzwd.o ld: symbol(s) not found architecture x86_64 collect2: error: ld returned 1 exit status i'm not posting code i've been searching online error means can start searching solution can't find helpful information. have no previous fortran experience! on meaning of error appreciated. i'm using mac , section includes "random" part of subroutine: double precision random 1 j=1,m w(j)=dw+real(j*2-1)*dw/2.0 w1=w(j)*w(j)*w(j)*w(j)*w(j) vel1=vel*vel*vel*vel*w1/w(j) vel1=-6844.0697/vel1 gw(j)=0.77898/w1*exp(vel1) phi(j)=random()*8.0*atan(1.0) 1 continue i using: gfortran seasim.for compile thanks in advance advice! ok, looks you're not providing linker library containing implementation of random...

search api of bing azure marketpalce with java -

tring use search api of bing azure marketpalce java have code : import org.apache.commons.codec.binary.base64; import org.apache.http.client.responsehandler; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.basicresponsehandler; import org.apache.http.impl.client.defaulthttpclient; public class bingapi2 { public static void main(string[] args) throws exception{ bingapi2 b = null; b.getbing(); } public static void getbing() throws exception { httpclient httpclient = new defaulthttpclient(); try { string accountkey = "myaccountkey="; byte[] accountkeybytes = base64.encodebase64((":" + accountkey).getbytes()); string accountkeyenc = new string(accountkeybytes); httpget httpget = new httpget("https://api.datamarket.azure.com/data.ashx/bing/search/web?$query=%27datamarket%27&$format=json...

c# - Detecting paypal subscription cancel on login asp.net -

i building asp.net web app involves paypal subscriptions. need check if user has cancelled on login possible , if how? have seen other posts on subject situation different since i'll checking on login. thinking maybe can batch dump of data paypal nightly , check against set flag on users cancelled. not sure best way is.. if want check whether user has accepted or cancelled agreement after logging paypal yes can check using express checkout token . need call getexpresscheckoutdetails api on token after buyer log in paypal account , variable billingagreementacceptedstatus in response . billingagreementacceptedstatus=0 means buyer has not accepted agreement or clicked on cancel after logging paypal account . billingagreementacceptedstatus=1 , means has clicked on "agree , continue" after logging paypal . i have included sample response . for rejection after log in : nvp response: token=ec-0rc04801ku663840m **billingagreementacceptedstatus=0** chec...

c# - Switching from Windows to forms authentication -

i've got windows authentication in 1 of web projects i've been working on. due other have forms authentication, want implement in particular project. i've followed article http://www.codeproject.com/articles/37558/windows-authentication-using-form-authentication , added new login page, after running project i've got redirected same default page used before. here's changes made web.config: <authentication mode="forms"> <forms loginurl="login.aspx"></forms> </authentication> <authorization> <deny users="?"/> </authorization> what possible mistakes? when switching forms authentication windows authentication , you'll need disable windows authentication in iis application. doesn't automatically when enable forms authentication in web.config. you have both forms , windows authentication enabled in iis on application. believe iis default windows authentication in cas...

sql - MVC Get value of a column in a row in a table where checkbox is checked and store in list using JQuery -

i'm working on first large mvc project , i'm having trouble working out how value of date column, each row in table, rows check box checked/selected , store in list (preferably in homecontroller) i found : getting id of table row when checkbox checked which lead me trying number of changes below $("#thechecked").click(function(){ var closesttr = $(':checkbox:checked').closest('tr'); alert(closesttr); }); but [object object] my table (can have several thousand rows): <table class="table"> <thead> <tr> <th></th> <th>date</th> <th>test type</th> </tr> </thead> <tbody> @foreach (var item in model) { <tr> <td> <input type="checkbox" class="checks"> </td> <td> @html.displayfor(modelitem => item.creationdatetime) ...

ios - Swift Framework <-> ObjC interoperation -

i've got dylib framework uiview subclasses made in swift i've done use new @ibdesignable , @ibinspectable stuff. so lets i've got uitextfield subclass in there named mytextfield.swift this: mytextfield.swift @ibdesignable class mytextfield: uitextfield { // properties etc. // content irrelevant } now compiles , works in interfacebuilder far good. need import special subclass objective c implementation of controller set property in code @ runtime. the framework (named myviews ) has header called myviews.h able import controllers header this: myviewcontroller.h: @import myviews; #import <uikit/uikit.h> #import "myviews.h" @interface myviewcontroller : uiviewcontroller @property(weak, nonatomic) iboutlet mytextfield *txtname; // <-- problem! @end this i'm stuck! class mytextfield unknown imported headers. myviews.h automatically generated. i've tried import bridging-headers in there without success. myvie...

php - Preventing Preg_Replace from changing <A> element contents -

i have link replacement function wrote finds keywords , turns said key words links related content. it has been working far, except on occasion, link adds in contains keyword. this issue has resulted in keywords being turned mess of hmtl code , unworking links wherever occurrence happens. what plan 1 final check before replace verify if keyword within element . is possible determine if content between tags? if so, how done? these current patterns using find keywords. $pattern = "/\b $kw \b/"; $pattern2 = "/\b $kw. \b/"; $pattern3 = "/\b $kw, \b/"; firstly patterns can merged one: $pattern = "/\b $kw[.,]? \b/"; i question whitespaces there. don't want them. $pattern = "/\b$kw[.,]?\b/"; and voodoo black magic of regex doom! $pattern = "/<a\b.*?<\/a>(*skip)(*fail)|\b$kw[.,]?\b/"; but beware the pony , consider using parser instead.

javascript - Adding Meta Data to socketio-file-upload -

i have socketio-file-upload plugin upload photos on server nodejs, work, when try use plugin functionnalaty add data upload, script stuck. client side var uploader = new socketiofileupload(socket); uploader.listenoninput(document.getelementbyid("upload")); uploader.addeventlistener("start", function(event){ event.file.meta.hello = "world"; }); sever side var fileupload = require("socketio-file-upload"); fileupload.listen(app); io.on('connection', function(socket){ var upl = new fileupload(); upl.dir = "img"; upl.listen(socket); upl.on("start", function(event){ console.log(event); }); }); the error comes client side event argument has no meta object, , when decide create 1 server side doesn't receive it the documentation of socketio-file-upload on adding meta data

javascript - setTimeout not working, other methods of queuing in a for loop? -

code below (the divs shaded in real example, want sequentially decrease opacity 0 each disappears, in order. i tried doing without using settimeout, of divs disappeared simultaneously - know part of code changes opacity works, cant seem them work sequentially. when try use settimeout (which presume implementing incorrectly),nothing happens! any appreciated this, i'm new javascript , haven't touched in while , tutorials haven't been able me. <body> <div id="div1"></div> <div id="div2"></div> <div id="div3"></div> <div id="div4"></div> <script type="text/javascript"> // divs want cycle through named here. var divs = ["#div1", "#div2", "#div3", "#div4"]; var divslength = divs.length; (var = 0; < divslength; i++) { settimeout(function(){ $(d...

FAKE build a project with unsafe flag -

i trying build solution 1 of projects needs build unsafe flag on, set correctly in project when building error: "unsafe code may appear if compiling /unsafe" this target @ moment target "compileapp" (fun _ -> !! @"***.csproj" |> msbuildrelease builddir "build" |> log "appbuild-output: " ) i tried adding msbuildparams not sure how use them yet (ie there doesnt seem option in msbuildrelease add this let setparams defaults = { defaults verbosity = some(quiet) targets = ["build"] properties = [ "allowunsafeblocks", "true" "configuration", "release" ] } also best option here create 2 different targets projects safe , unsafe code, of there better way? i found allowunsafeblocks=true element defined under debug|anycpu , release|anycpu ...

hadoop - Comparison on Hive, Impala, HBASE and SQL for "order by" -

i totally new hive, impala, hbase. doing full text search application. got painful step of sorting relevance using order in sql on oracle platform. wonder if change in hadoop ecosystem or not. wish can this. in advance. if want use full text search in hadoop should consider using apache solr ( cloudera search if use cloudera)

javascript - angular position fix inside a controller (angular modal?) -

this sort of weird problem mix of css , angular. i have div item in main content area of app has few smaller div containers in side of it. basically, inside of 1 of these sub divs want able click , have modal come , position fix until it's closed. the problem having is have put in body fix float in center of screen, , feel have control on items (within controller in sub div container). if jquery/javascript append modal body position fixed. questions how deal in angular in scenario? how can control modal have append body correct position fixed effect inside controller that's tucked bunch of divs. thanks! have looked @ angular ui bootstrap? have modal component there: http://angular-ui.github.io/bootstrap/

ruby on rails - Devise - No route matches [GET] "/users/sign_out: Any alternatives to requiring jquery-ujs, setting config.sign_out_via = :get, or using button_to? -

i using devise large app multiple engines , looking alternative solution 3 options given below destroy user's session path: require jquery-ujs change config.sign_out_via = :delete config.sign_out_via = :get use button_to instead of link_to i'm require jquery-ujs , able log out, prefer not have use dependency solution. = link_to 'log out', destroy_user_session_path, method: :delete i settle require jquery-ujs if necessary, hoping out there knows solution. thanks! you can add additional route app point standard devise log out action. devise_scope :user '/users/sign_out', to: 'devise/sessions#destroy' end then you'll have log out via both delete , get

SQL Server : nesting elements with FOR XML PATH -

i want nest each of xml elements. take following example: declare @temptable table ( [column1] char(10), [column2] char(10) ); insert @temptable([column1], [column2]) values ('some value', 'some value'), ('some value', 'some value'), ('some value', 'some value'), ('some value', 'some value') select ( select * @temptable xml path('row'), type) xml path('parentrow'), root('root') which return following xml: <root> <parentrow> <row> <column1>some value</column1> <column2>some value</column2> </row> <row> <column1>some value</column1> <column2>some value</column2> </row> <row> <column1>some value</column1> <column2>some value</column2> </row> <row> ...

array address - Expression must be modifiable lvalue -

typedef struct state1_s { u8 size; u8 state; } state1_t; typedef struct state2_s { u8 size; u8 state[2]; } state2_t; typedef struct state3_s { u8 code; u8 count; }state3_t; i have these 3 structures. when following state1_t comp[8]; state2_t *avail; state3_t *health; &comp = (state1_t *)(&(avail->state[2])+1); i expression must modifiable lvalue error. i same error when &comp = (state1_t *)(&(heaalth->count) +1); how fix this? want address of comp @ end of 1 structure. how do that? state1_t comp[8]; in declaration comp array of 8 struct's state1_t base address of array being comp cannot modifiable. hence modifiable lvalue error when try changing address of comp .

Eclipse Web development tool: How to easily find the definition of an object, whose constructor is in .js file -

i newbie of web development. following tutorial step 4 of webrtc codelab has index.html, includes adapter.js in order follow definitions of functions, objects, etc, build empty static web development in eclipse. , copy whole folder of step4 in webrtc codelab tutorial code. file structure is: webcontent js lab adapter.js index.html sever.js now in index.html, highlight word " rtcpeerconnection " in sentence: window.localpeerconnection = new rtcpeerconnection(servers, {optional: [{rtpdatachannels: true}]}); i push "f3", supposed lead me definition of rtcpeerconnection. nothing happened. i wonder: how can find definition of rtcpeerconnection in easy way, way in java projects? or should use other tools?

hadoop - YARN Application Master unable to connect to Resource Manager -

i have 4 node cluster (1 namenode/resource manager 3 datanodes/node managers) i trying run simple tez example orderedwordcount hadoop jar c:\hdp\tez-0.4.0.2.1.1.0-1621\tez-mapreduce-examples-0.4.0.2.1.1.0-1621.jar orderedwordcount sample/test.txt /sample/out the job gets accepted ,the application master , container gets setup on nodemanager see these logs 2014-09-10 17:53:31,982 info [servicethread:org.apache.tez.dag.app.rm.taskschedulereventhandler] org.apache.hadoop.yarn.client.rmproxy: connecting resourcemanager @ /0.0.0.0:8030 2014-09-10 17:53:34,060 info [servicethread:org.apache.tez.dag.app.rm.taskschedulereventhandler] org.apache.hadoop.ipc.client: retrying connect server: 0.0.0.0/0.0.0.0:8030. tried 0 time(s); retry policy retryuptomaximumcountwithfixedsleep(maxretries=10, sleeptime=1000 milliseconds) after configurable timeout job fails i searched problem , pointed yarn.resourcemanager.scheduler.address configuration. in resource manager...

properties - can i use wildcards in msbuld property methods -

i using string.replace msbuild method modify strings in property, can use wildcards ( . ? *) and/or other regular expressions? no, not string.replace, cause .net method doesn't allow use wildcards. same way calling string.replace() - can call regex.replace, opens full power of .net regex engine, not wildcards ;).

mysql - Separate tables or differentiating fields? -

i have 2 websites run both subscription-based service. both of sites allow subscribers make "subusers" can use subscriptions have different login (for security , logging purposes). each website has different way of implementing this. separate table the first system has separate table called subsusers . each subuser linked (via foreign key) user . setup requires additional code in login scripts anywhere user info needs accessed. differentiating fields the other site not have subusers table. instead, field in users table points user "parent", signifying subuser. requires less coding in login , user info scripts. both of these setups functional , work fine. wondering though: advantages , disadvantages of each (speed, coding, hassle)? option 1: pros: if set keys correctly, can implement cascading deletes/updates more easily. if users cancels, example, deleting them automatically delete other users, via foreign key. if need update user accou...

html - responsive div width in a responsive page without using another media query -

i have section in html page has ground image, title text @ left , sign form right. i using media queries make responsive. facing problem before media queries triggered. when screen size 768+px (as in fiddle, before form slips next line), width of title fine @ 15% (as avoids overlap woman's face in image , form). screen size enlarged, seems less , lines can in same line. this happens when there media query screen sizes between 506px , 768px. is there way can fix without having use anotehr media query? any appreciated. thanks, <section class="imageform"> <div class="container"> <div class="title"> <h1> title title title title </h1> <h3> title title title, title title </h3> </div> <form class="signup_form"> <label for="name"><strong> name:</strong></label> <input type="text" id="name_first" name="name_first...

java - Spring Security Preauthorization Reauthentication -

using spring security 3.2.5 , spring 4.0.6. spring security configured preauthentication using http header. spring security works correctly grabbing header, looking user, , getting authentication roles database. the problem when user logs out , logs in new user, spring security not detect changed header , still returns logged in user. 1 - log in user#1 through external application (siteminder) 2 - spring security correctly reports user#1 logged in 3 - outside of application, log out of siteminder 4 - through siteminder log in user#2 5 - in web app spring security incorrectly reports user#1 logged in when siteminder providing header information user#2 in spring-security.xml tried adding directive spring security not cache users got exceptions in application. <security:http create-session="stateless" /> applicationeventmulticaster not initialized - call 'refresh' before multicasting events via context: root webapplicationcontext: startup dat...

java - After upgrading from Spring Boot 1.1.5 to 1.1.6, gradle build fails with "Duplicate library commons-io-1.3.2.jar" in the :bootRepackage task -

i upgraded spring boot 1.1.5 1.1.6, , after that, (multi-project) build fails with: failure: build failed exception. * went wrong: execution failed task ':admin:bootrepackage'. > duplicate library commons-io-1.3.2.jar all other tasks seem have been successful (compilejava, compilegroovy, processresources, classes, jar, , distjar). have 1 explicit dependency on commons i/o library in build.gradle file: compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2' i'm using gradle 2.1, trying build 2.0 makes no difference. ran gradle dependencies didn't reveal particularly interesting. has else seen since upgrading? reverting 1.1.5 solves issue, i'm guessing it's related new dependency in spring boot jar(s) 1.1.6. hints resolution appreciated. it sounds you've found bug caused fix this issue . can please open issue details of dependencies can track down?

Why do browsers use different css rules when they work and are defined almost identically? -

i've used lot of css , how use it. understand why have put properties in order different browser same thing. question is: why don't browsers implement of more common properties? example: i need text not selectable, add this: -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; nearly of them user-select , last one, 1 seems should supported on multiple browsers, not supported @ all. does know why @ least browsers don't start migrating universal standard? if has same thing, perhaps browsers can put effort fixing this? i understand if mozilla got rid of -moz-user-select, pages break, doesn't mean can't add user-select more pages work. any ideas? browser prefixed properties meant used beta/trial/demonstration/experimental/{inser more adjectives here} , not implemented or part of property standard documentation isn't finished/approved/done. when f...

.htaccess - Url rewrite and trim url -

i need precious help. i have url: http://domain.com/v/12345 my ht access set pass 12345 php script like: htaccess: rewriterule ^v/([a-za-z0-9_-]+)$ /script.php?v=$1 [l] script php: http://domain.com/script.php?code=12345 and works perfectly but.. , there but, write url so: http://domain.com/12345/my-dog-is-very-fat can change htaccess works so? because if use /my-dog-is-fat or / 404 error. i try explain better: i share link seo keywords in url, example mydomain.com/alphanumericcode/thi-is-my-dog-article where alphanumericcode of myscript.php?v= this htaccess: rewriteengine on rewriterule ^view/([a-za-z0-9_-]+)$ /view.php?v=$1 rewriterule ^folder/([a-za-z0-9_-]+)$ /filefolderlist.php?f=$1 rewriterule ^home$ /index.php [l] rewriterule ^report$ /report.php [l] rewriterule ^play/([a-za-z0-9_-]+)$ /play.php?v=$1 [l] ###added anubhava rewriterule ^v/([\w-]+)/?$ /script.php?v=$1 [l,qsa] rewriterule ^([0-9a-z]+)/.+$ /...

AutoHotKey: How to access array with counter variable -

; declare window_title_array window_title_array%1% = 3270 display - window_title_array%2% = 3270 display - b window_title_array%3% = 3270 display - c window_title_array%4% = 3270 display - d window_title_array%5% = 3270 display - e window_title_array%6% = 3270 display - f counter := 1 my_string := window_title_array%counter% msgbox, %my_string% how string array counter variable? tried counter = 1 , counter := 1 . both of them failed access array. not sure mistake. thank you! ps: version have quite outdated - version 1.0.47.06 i believe it's in how you're creating array. putting percent signs around array indexes, you're saying want use first file-level input parameter (in case of using %1%). blank, ends looking variable named "window_title_array" take out percents. should use this: window_title_array1 = 3270 display - window_title_array2 = 3270 display - b window_title_array3 = 3270 display - c window_title_array4 = 3270 display - d windo...

node.js - Streaming large files causing server to hang -

i have feature in web app allows users upload , download files. serve app express, files stored in different server, proxy requests server. here's proxy code using request library: module.exports = function(req, res) { req.headers['x-private-id'] = getid(); var url = rewriteurl(req.url); var newrequest = request(url, function(error) { if (error) console.log(error); }); req.pipe(newrequest).on('response', function(res) { delete res.headers['x-private-id']; }).pipe(res); }; this works fine of requests, including downloading file. however, run issues when 'streaming' file. , streaming, mean use fancybox display video using video tag. video displays fine first few times. but if close fancybox , reopen enough times (5 specifically), quits working after that; video no longer shows up. entire express server seems hang, unable process more requests. if restart server, ok. me seems sockets proxy requests...

java - How do I edit the property file that my osgi managed service implementation uses? -

i using apache felix osgi framework implementation. have class implementing managedservice in order properties file using configadmin service. able manually edit properties file , receive updates in managed service. how edit properties in file managed service? editing dictionary update method has no effect. the configurationadmin service has 2 parts: the managedservice, component receives configuration. the configurationadmin service, can used set , update or delete configuration. in other words, if want change own configuration, need talk configurationadmin service that. by way, in spec there "file" holding configuration. configurationadmin decide how persist (in file, database, whatever). management of configurations goes through configurationadmin service.

algorithm - How to create a log log plot -

i'm doing algorithm analysis , create log log plot in excel/google docs or anywhere that's good. i've tried in excel can't seem work, , can't seem find material anywhere, here know how done? just in case don't have access search engine...using excel... select data insert in plot (for example scatter plot) right click plot axes , select 'format axis' check logarithm scale tick box

Which remote branch is my git subtree tracking? -

let's there remote master, dev branch, , added subtree: $ git remote add rem [url] $ git fetch rem $ git subtree add -p=./sub rem/dev now every time run git subtree pull -p sub , branch rem/dev fetched , merged sub. ok but lets later on i forgot whether added master or dev branch. other inferring comparing git logs, there way git tell me branch of rem subtree in sub/ tracking? subtrees tricky... there .gittrees file in root of working directory, content such as: [subtree "sub"] url = git://example.com/repo.git path = sub branch = master

properties - Variables in SAP MII -

basically, looking variable/property holds value outside of transaction execution facilitating use in next rounds of execution, similar counter in programming language until reset explicitly. as seen in sap mii, local , transaction properties reset on completion of transaction execution, leaving properties initial state, without giving opportunity use stored/assigned value in previous transaction. global properties not such requirement read-only. did 1 use such property/tried work around? thanks you can use session variables this to store variable: /xmii/propertyaccessservlet?mode=store&propname=<name>&propvalue=<value> and read variable: /xmii/propertyaccessservlet?mode=retrieve&propname=<name>

java - Writing to KDB using qJava -

i'm not kdb ( in case question sounds stupid). i'm trying use kdb ( disk not memory) load data database. i've asked question upserts , figured how upsert console , save disk q)dspricing:([id:`int$(); date:`date$()] open:`float$();close:`float$();high:`float$();low:`float$();volume:`int$()) q)dspricing:([id:`int$(); date:`date$()] open:`float$();close:`float$();high:`float$();low:`float$();volume:`int$()) q)`dspricing insert(123;2003.03.23;1.0;3.0;4.0;2.0;1000) q)`dspricing insert(123;2003.03.24;1.0;3.0;4.0;2.0;2000) q)save `:dspricing q)`:dspricing upsert(123;2003.03.25;1.0;3.0;4.0;2.0;1500) now i'm trying in java , have following code public class loadds { sqlsession session; private datastreammapper mapper ; public static void main(string args[]){ final qconnection q = new qbasicconnection(args.length >= 1 ? args[0] : "localhost", args.length >= 2 ? integer.parseint(args[1]) : 5001, "user", "pwd"); ...

actionscript 3 - Edit Border Around ComboBox -

i trying remove border around combobox. want set borderstyle="none" combobox doesn't have "borderstyle" option. found located using adobe flash debugger. nesting looks this mycombobox --> styledeclaration --> stylemanager --> stylesroot --> borderstyle now borderstyle set "inlet" , want "none". deepest have been able stylemanager. stylemanager doesn't allow me access stylesroot. wondering how stylesroot in order change "borderstyle" property. the code used stylemanager looks following: var mycsssd:cssstyledeclaration = stylemanager.getstyledeclaration("combobox"); or var mycsssd:cssstyledeclaration = mycombobox.styledeclaration; any ideas how can borderstyle property great. in advance. flex controls have setstyle method. here

eclipse - java externals jars not included when using maven? -

folks, i new java. have seen including external jars , compile that. external jars contains lot of class files. when include these external jars in project , if create new jar, can see these external jars included part of jar file. but have seen cases in these external jars not included part of jar file when using maven ? why ? (example, when write hadoop map reduce programs in java, referring lot of external jars none of these external jars included in final jar create project.) thanks, john if want external libraries packaged in jar, need use tool onejar. there maven plugin onejar @ https://code.google.com/p/onejar-maven-plugin/ .

scala - SBT custom task to debug forked JVM -

i want know how make 'debug' task in sbt forks jvm in suspended state allow me attach debugger ide. i got code far: lazy val debug = config("debug") extend(test) describedas("debug running forked jvm") lazy val debugsettings: seq[setting[_]] = seq( fork in debug := true, javaoptions in debug ++= seq("-xdebug", "-xrunjdwp:transport=dt_socket,server=y,suspend=y,address=127.0.0.1:5005"), test in debug <<= test in test ) the problem seems 'javaoptions' setting not being picked 'test' task when run "debug:test". how can make 'debug' command work?

java - Comparator not sorted my class with dates -

i have class day,month. insert random dates , after sorted looks that? why? 1/9 2/9 3/9 7/9 9/9 10/9 5/9 11/9 i getting "time" getting database , return data arraylist code: public arraylist<clockmodel> getday(string workname){ try { open(); arraylist<clockmodel> list = new arraylist<clockmodel>(); cursor c = null; c = mydb.query(table_day, null,"workname = ?", new string[] {workname}, null, null, null); while (c.movetonext()) { clock clock = new clock( c.getint(0), //id c.getstring(1),//workname c.getint(2), //dateday c.getint(3),//datemouth c.getint(4),//dateyear ); collections.sort(list,datecompare); list.add(clock); } return list; ...

java.lang.IllegalStateException Exception, when creating bufferstrategy -

i'm trying develop own game engine, i've run java.lang.illegalstateexception exception. when call graphic class main, should create buffer strategy , set java's graphics , on, it's not doing create buffer strategy part. instead it's giving me illegalstateexception. here's code: public class graphic extends canvas{ private graphics g; public graphic() { bufferstrategy bs = getbufferstrategy(); if(bs == null) { createbufferstrategy(3); return; } g = bs.getdrawgraphics(); g.drawstring("hello", 2, 2); g.dispose(); bs.show(); } }

PHP generate javascript objects with multiple properties -

i did function generates php array javascript object, instance $this->routes = array( 'module' => array( 'route1' => $renderer->url('route1', array('lang' => $lang_short)), 'route2' => $renderer->url('route1', array('lang' => $lang_short)), ) ); my function generate javascript object {static: {module: {route1: 'route1', route2: 'route2'}}} so can access in js static.module.route1 the "problem" method made handles arrays 2 nested arrays, not more. nice , easy way achieve this? use native json_encode function, instead of custom function.

dependencies - rpmlib(FileDigests) dependency error on SuSE -

doing yum install a-3.6.0 on both suse 11.2 (64-bit) , centos 5.8 (64-bit) following installation requirements error popped up: error: failed dependencies: rpmlib(filedigests) <= 4.6.0-1 needed a-3.6.0-1.noarch rpmlib(payloadisxz) <= 4.6.0-1 needed a-3.6.0-1.noarch needed a-3.6.0-1.noarch googling error shows others have run problem on suse , centos, i'm unable find resolution problem. know i'm might find rpmlib rpm download , rpm -i ? or there suse and/or centos solution? or url rpmlib source lives , suse , centos package. your package built newer version of rpmlib have on centos , suse systems, 1 has xz support (available in centos 6 , presumably newer version of suse). do not try system "fixed" break something. find package appropriate distributions instead.

css - chrome scroll bar overflow:hidden not working, appears only on mouseover -

i've found , attempted several different solutions chrome scroll bar issue have been posted on here , elsewhere on web. seems everyone's solution different thought i'd post problem too. the #mainheader on left side of page @ http://www.billyjacksdesign.com/design-work using inspect element found scroller , added hidden property. #scroller { padding-bottom: 0px; overflow: hidden !important; } still doesn't work. tried find other instances of overflow , made sure hidden. i've been trying scrolling="no" has not been working anywhere, i'm not sure how use particular property. i'm happy post more code snippets i'm not sure ones help. any ideas? in advance. edit here's video https://www.youtube.com/watch?v=zaic4kbkpec of issue happens.

html - jQuery an aspect ratio of an image with 100% width for responsive height -

i'd have slideshow fill screen height , width, keep it's aspect ratio vertical slide effect. have crop of (very wide) width on smaller screens , stretch both ways on large screens. there calculation determine height of #slideshow window , keep aspect ratio? verbose media queries getting tiresome , reduce height much. can see problem scale window @ http://apurch.jvonhausen.com . i saw close answer at: image size calculation keeping aspect ratio different screen resolutions , think java, not script.

c++ - How to separate one input into multiple by the spaces -

i new c++ , trying write program can sort set of names (in alphabetic order) input i'd make can input names @ once; have coded sorting , have tested multiple names fine right have push enter after every name signify new one. searched way separate input based off spaces in input found separates first 2 words/names: int main(){ string input; getline(cin, input); string temp1; string temp2; (int = 0; < input.length(); i++){ if (input[i] == ' ') { temp1.append(input.substr(0, i)); temp2.append(input.substr(i + 1, input.length() - 1)); break; } } cout << temp1 << endl; cout << temp2 << endl; } i have played around parts appear separate code , tried make them repeat every space can't work. said, i'm new c++ if please steer me in right direction or suggest better way accomplish i'm trying great. thanks, -...

php - Notify of new files with inotify -

i need make script notifies log file when new file enters directory. use inotify shell script or php, examples have found in c. can give me example of this? in addition, can inotify know when file done being copied? this shell command write logfile whenever file created in /path/to/dir : inotifywait -m -e create /path/to/dir >>logfile explanation: -m tells inotifywait keep running. default exit after first event -e create tells inotifywait report on file create events. /path/to/dir target directory watch. subdirectories not monitored unless recursive option, -r specified. >>logfile tells shell redirect output file logfile . if leave part off, output directed stdout , can watch in real time files created. monitoring more events inotifywait report on several different events. example, ran inotifywait in 1 window while writing file window: $ inotifywait -m . setting watches. watches established. ./ open myfile ./ modify myfile ./ mo...

c++ - working with parameter from the constructor -

i have following problem: whats best way work on object got parameter constructor? don't want work copy because, initial object won't change. obj obj; myclass::myclass(obj& obj) { this->obj = obj; //copy } void myclass::dosometh() { obj.add(....); //working copy } my solution use pointer: obj* obj; void myclass::myclass(obj& obj) { this->obj = &obj; } void myclass::dosometh() { obj->add(....); } or obj* obj; myclass::myclass(obj* obj) { this->obj = obj; } void myclass::dosometh() { obj->add(....); } what thing solution? or there better solutions? there nothing wrong using pointer member-variable avoid making copy. need confident object being pointed to, obj , outlive myclass contains pointer. also, recommend using constructor initializer list initialize pointer directly: class myclass { private: obj* obj_; public: myclass(obj* obj) : obj_(obj) { } }; in similar...

ios7 - Auto-Renewable In-App Purchases in iOS -

i stuck implementing iap app. here basic information on how works i offering one-year auto-renewable subscription service. user pay iap , they'll have access service. it should possible user purchase multiple subscriptions. possible (although unlikely) user want connect 2 different services, should able pay 2 subscriptions @ same time that's basic idea, sounds pretty simple. have followed apple's instructions great success, until point paymentqueue:updatedtransactions gets called skpaymenttransactionstatepurchased state. here, several questions arise. apple's documentation shows should store transaction.transactionreceipt in nsuserdefaults. i'm storing array of these (since want support multiple, simultaneous subscriptions). problem has been deprecated in ios7, don't know use instead. the next problem don't know data. once app killed , re-started, know size of array in nsuserdefaults (e.g. there 2 receipts, 2 subscriptions have been purcha...

angularjs - Overcoming UI blocks when updating ng-repeat data -

so yes, apparently possible have long grid lots of rows built angular. problem comes data updates. you see if (let's 10 000 rows) , render them in grid - works. takes few seconds initially. , a) don't have date front b) need grid responsive immediately. i can throwing let's 100 rows @ beginning, , update data becomes available. , turns out problem. everytime push new rows $scope.data - blocks ui. need smart these updates. maybe should set interval , update data every few seconds? that seems not working maybe should somehow watch mouse movements , once stops moving - start/resume adding rows, once mouse-movement detected seize adding rows , wait chance? - what if user never stops moving mouse? (say sort of psycho) experimenting _.throtle , _.debounce didn't me anywhere. you guys have ideas? upd: here's crazy one: if? instead of waiting till angular updates dom, create entire dom structure in memory, right before digest cycle (with no data) , ins...

ios - call view controller segue from within tableView delegate class -

i have separated tableview delegate , data source tableview controller. far working great. however, have come place need implement didselectrowatindexpath delegate method. when method called need perform segue view controller, dont have reference view controller inside delegate class call method [myviewcontroller performseguewithidentifier... whats proper way handle this? add property delegate store view controller? not seem idea since view controller has reference delegate already. how can reference vc? thinking post notification there has better way that. ive used view controller delegate have never had deal before. this question seems strange me because if create segue in storyboard, push segue tableview cell viewcontroller, when tableview cell tapped segue automatically triggered. can other things in - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender as add property delegate store view controller it's ok. because @...

How can I left justify text in a pandas DataFrame column in an IPython notebook -

i trying format output in ipython notebook. tried using to_string function, , neatly lets me eliminate index column. textual data right justified. in [10]: import pandas pd columns = ['text', 'value'] = pd.dataframe ({'text': ['abcdef', 'x'], 'value': [12.34, 4.2]}) print (a.to_string (index=false)) text value abcdef 12.34 x 4.20 the same true when printing dataframe. in [12]: print (a) text value 0 abcdef 12.34 1 x 4.20 the justify argument in to_string function, surprisingly, justifies column heading. in [13]: import pandas pd columns = ['text', 'value'] = pd.dataframe ({'text': ['abcdef', 'x'], 'value': [12.34, 4.2]}) print (a.to_string (justify='left', index=false)) text value abcdef 12.34 x 4.20 how can control justification settings individual columns? if you're willing use library, tabulate - ...

c# - ConcurrentDictionary.Where very slow for filtering based int array (Key field) -

i have following var links = new concurrentdictionary<int, link>(); which populated around 20k records, have array of strings (list) turn int array using following. var intpossible = nonexistinglistingids.select(int.parse); //this fast need done which pretty fast. create new list or filter out "links" in intpossible array matches key element of concurrentdictionary. i have following using clause takes 50 seconds actual filtering slow want do. var filtered = links.where(x => intpossible.any(y => y == x.key)).tolist(); i know intersect pretty fast have array of ints , intersect not working against concurrentdictionary how can filter links little faster instead of 50 seconds. you need replace o(n) inner lookup more speedy hashset offers o(1) complexity lookups. so var intpossible = new hashset<int>(nonexistinglistingids.select(int.parse)); and var filtered = links.where(x => intpossible.contains(x.key)).tolist(); this...