Posts

Showing posts from June, 2012

artificial intelligence - Game Maker: Studio - Make objects avoid other instances of same object with A* pathfinding -

artificial intelligence - Game Maker: Studio - Make objects avoid other instances of same object with A* pathfinding - i have game there multiple enemies must chase single player. have pathfinding set using gml a* pathfinding mp_grid , path. however, these enemies can walk on top of each other when seeking player. prepare this, told path ignore enemies mp_grid_add_instances, stop moving altogether because see obstacles, trapping within bounding box. there way can add together "all other enemies self" mp_grid_add_instances? here's grid creation code (in controls class initializing variables): global.zombie_ai_grid = mp_grid_create(0, 0, room_width / 50, (room_height - sp_dashboard.sprite_height) / 50, 50, 50); mp_grid_add_instances(global.zombie_ai_grid, obj_obstacle, false); this path initialization code (in zombie class): path = path_add(); alarm[0] = 5; this path creation code in alarm 0 (path updates every 2 seconds): mp_grid_path(global.zom

php - Mails from website with 2-step verification in Gmail -

php - Mails from website with 2-step verification in Gmail - in website utilize gmail send mails. utilize pear mail service in frontend , curl in backend. i have 2 mail service accounts managed gmail: 1 gmail business relationship , other has own domain managed google apps. i can send emails website 2-step verification using gmail business relationship , app specific passwords. cannot same other account. why? with both accounts can send email without 2-step verification, , my-own-domain business relationship can send emails 2-step verification using k-9 mail service android app , gmail app specific password. look here, have tried enable imap , pop in gmail of google apps ?: https://support.google.com/a/answer/105694?hl=en php email curl gmail email-verification

css - Bootstrap 3 Space between navbar-brand and navbar ending -

css - Bootstrap 3 Space between navbar-brand and navbar ending - i have issue bootstrap 3. don't know why, in mobile screen there space between navbar-brand , navigation bar ending. guess, because of navigation bar glyphicon doesn't fit navigation bar. how can solve issue? need remove empty space... desktop-size version: mobile-size version: html: <header class="top" role="header"> <div class="container"> <a href="../aplikacija/app.html" class="navbar-brand pull-left"> brand </a> <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="glyphicon glyphicon-align-justify"></span> </button> <nav class="navbar-collapse collapse" role="navigation">

java - Resolve a URL request containing .jsp in Spring -

java - Resolve a URL request containing .jsp in Spring - i have created spring web mvc project. want handle request with .jsp in url such request .jsp in url handled same controller. following url pattern using in web.xml <servlet-mapping> <servlet-name>project</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> the annotation in controller looks this @requestmapping("/welcome") with able resolve url of form http://localhost:8080/project/welcome but not 1 : http://localhost:8080/project/welcome.jsp that's uncommon requirement spring mvc controller, spring is versatile tool. you can seek (untested ...) : @requestmapping("/{name}.jsp") public modelandview jsphandler(@pathvariable("name") string name) { ... the controller *.jsp requests , find in name variable real name has been called java spring jsp spring-mvc

html - CSS for selecting first span in all td's -

html - CSS for selecting first span in all td's - i having problem visualizing css , trying reach td 's first span css, selecting first td . doing wrong? css .teamstats > tbody > tr > th:first-child { font-size: 20px; } html <table class="teamstats"> <tr> <th> <span id="stats0name"></span> <br /> <span id="stats0double"></span> <br /> <span id="stats0triple"></span> <br /> <span id="stats0quadra"></span> <br /> <span id="stats0penta"></span> </th> <th> <span id="stats1name"></span> <br /> <span id="stats1double"></span> <br /> &l

php - Can I use Facebook Session from another platform -

php - Can I use Facebook Session from another platform - my app has permission user in ios app. i have web service in php want utilize permission. how can fetch previous session, can utilize code: $request = new facebookrequest( $session, 'get', '/me/friends' ); php facebook facebook-graph-api

nlp - Extracting (subject,predicate,object) from dependency tree -

nlp - Extracting (subject,predicate,object) from dependency tree - i'm interesting in extracting triples (subject,predicate,object) questions. for example, transform next question : who wife of president of usa? in : (x,iswifeof,y) &wedge; (y,ispresidentof,usa) x , y unknows have find in order reply question (/\ denotes conjunction). i have read lot of papers topic , perform task using existing parsers such stanford parser. know parsers output 2 types of info : parse construction tree (constituency relations) dependency tree (dependency relations) some papers seek build triples parse construction tree (e.g., triple extraction sentences), approach seems weak deal complicated questions. on other hand, dependency trees contain lot of relevant info perform triple extraction. lot of papers claim that, didn't find of them gives explicitely detailed procedure or algorithm. of time, authors analyze dependencies produce triples according rules

javascript - When does JS interpret {} as an empty block instead of an empty object? -

javascript - When does JS interpret {} as an empty block instead of an empty object? - i reading reply question (about "wat" video) , said: {}+[] interpreted empty block of code, unary plus , empty array. first part nothing, array converted comma-separated string of it's elements (empty string empty array), number (empty string converted 0), hence 0. i learning js "the definitive guide" seek understand things that. my question is, when js decide interpret {} empty block of code, instead of empty object? also, there inconsistencies between node.js , firebug understand. firebug: node.js: let's @ language grammar, shall we? section 12, statements: statement : block variablestatement emptystatement expressionstatement ...lots of other stuff... that's fancy way of saying statement can block, variable statement, empty statement, look statement, or lots of other stuff. notice first alternative there &

javascript - Need help on very simple if statement in function -

javascript - Need help on very simple if statement in function - i maintain getting "syntaxerror: unexpected identifier" here code: var sleepcheck = function(numhours){ if numhours >= 8 { homecoming "string 1"; else { homecoming "string 2"; } } sleepcheck(10) what doing wrong? you need wrap assessment in parentheses: var sleepcheck = function(numhours){ if (numhours >= 8) { homecoming "string 1"; else { homecoming "string 2"; } } sleepcheck(10) for single-statement if / else omission of curly braces legitimate: var sleepcheck = function(numhours){ if (numhours >= 8) homecoming "string 1"; else homecoming "string 2"; } sleepcheck(10) as semi-colons (unfortunately); parentheses obligatory. javascript

google apps script - Global variable defined in function appears not defined? -

google apps script - Global variable defined in function appears not defined? - i'm writing script google spreadsheets, want have headers index available globally throughout script. according theory, should able define global variables within function. function testfunc() { testvar = 1; // `testvar` global variable } in code looks more or less this: function getheaders() { var sheet = spreadsheetapp.getactivesheet(); var info = sheet.getdatarange().getvalues(); var headers = data[0] headeridindex = headers.indexof("id") headernameindex = headers.indexof("first-last") } however, later on in code, when phone call variable headernameindex , appears undefined: function tellmenames() { var sheet = spreadsheetapp.getactivesheet(); var info = sheet.getdatarange().getvalues(); (var = 1; < data.length; i++) { logger.log("name: " + data[i][headernameindex]) } } so doing wrong? thanks. well, g

joomla - Virtumart 2.6 paypal payment currency should be current currency selected by user not default vendor currency -

joomla - Virtumart 2.6 paypal payment currency should be current currency selected by user not default vendor currency - hi using virtuemart ecommerce application. have used currency selector module of virtuemart give user facility alter currency accordingly. everything working fine on product checkout page total product cost showing in currency selected user in total payment currency showing default vendor currency. i want create user pay payment in currency selected them not default vendor currency. please help. here screenshot. in screenshot user selected inr payment should in inr not in gbp for have store currency choosen user in session , retrieve on payment page. joomla paypal joomla2.5 virtuemart

do static variables survive instances in objective-c? -

do static variables survive instances in objective-c? - i understand static in objective-c different static in java. question objective-c static variables. have static variable in objective-c. if set in 1 instance of class. value visible if create new instance of class after variable set? yes, that's point of static variables. not instance variables. static variable exists 1 time in scope. initialized 1 time well. this true static variables declared outside of method static variables declared within method. objective-c static

php - Include a class that contain use command in another class -

php - Include a class that contain use command in another class - i have 2 php file: facebook.php (for retrieve user info ) , myclass.php provide restfull service. facebook.php <?php require_once( '../libs/facebook/src/facebook/httpclients/facebookhttpable.php'); require_once( '../libs/facebook/src/facebook/httpclients/facebookcurl.php' ); require_once( '../libs/facebook/src/facebook/httpclients/facebookcurlhttpclient.php' ); require_once( '../libs/facebook/src/facebook/entities/accesstoken.php' ); require_once( '../libs/facebook/src/facebook/entities/signedrequest.php' ); require_once( '../libs/facebook/src/facebook/facebooksession.php' ); require_once( '../libs/facebook/src/facebook/facebookredirectloginhelper.php' ); require_once( '../libs/facebook/src/facebook/facebookrequest.php' ); require_once( '../libs/fa

Can't get an image to load to a webpage using PHP with MySQl -

Can't get an image to load to a webpage using PHP with MySQl - there's couple questions need answered. first can't o images mysql populate when log loggedin.php page. i'm getting broken link. i've seen people asking question, i've done page in such way when seek way i've seen, can't work correctly. second, in $updatequery , not succeed alter image @ all. i've looked around , found youtube video didn't help me. thanks in advanced. <!doctype html> <head> <html> <meta charset="utf-8"> <title>untitled document</title> <!-- latest compiled , minified css pulled bootstrap--> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <!-- optional theme pulled bootstrap--> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"&g

Highlighter in lucene.net not working for wildchard and fuzzy search -

Highlighter in lucene.net not working for wildchard and fuzzy search - highlighter using lucene.net ( 3.0.3) not working below code. if searching word "dealing" highlighter showing if searching word wildchar "deal*" there no highlighting protected void btnindex_click(object sender, eventargs e) { string indexpath = @"d:\temp\luceneindex1"; lucene.net.store.directory directory = fsdirectory.open(indexpath); analyzer analyzer = new standardanalyzer(lucene.net.util.version.lucene_30); indexwriter author = new indexwriter(directory, analyzer, indexwriter.maxfieldlength.unlimited); indexreader reddish = indexreader.open(directory, true); int totdocs = red.maxdoc; red.close(); //add documents index string text = string.empty; text = "one thing may of interest, if dealing vast quantites of info may want create static field fields , reuse them rather crea

c# - Asp.net- Mvc Complex Model Binding -

c# - Asp.net- Mvc Complex Model Binding - i have 2 poco class in c# , hotel , rate , 1 - many relationship in hotel create action in controller have viewbag populate drop downwards list bellow viewbag.hotel_rate = new selectlist(db.hotel_rate, "id", "rate"); and have blow code in view populate drop downwards list @html.dropdownlist("hotel_rate", null, new { @name = "hotel_rate.rate", @id = "hotel_rate.rate" }) every thing shoud right here , drowpdown list populate datebase , displayed in view , when post model controller model validated id of hotel rate 0 ,so entityvalidationerrors' wrong binding ? dont want utilize custome model binding class , default model binder in asp.net able handle , how? public partial class hotel { public hotel() { } public int id { get; set; } public string name { get; set; } public virtual ho

Android Launching Map Activity takes long -

Android Launching Map Activity takes long - ive created app loads map allot of content set map. the app takes while start , resume because of content. what options letting user know app isnt frozen? ive thought of using progress dialog while map loads have been unsuccessful in getting working. also read can show gray blocks of map while other content loads. how do this? what best solution? regards jared here ways know in can this: use thread , start loading map app begins , other things in app's main thread. use service: create service runs in background when user not using app. , utilize service maintain maps in background. refer vogella, have tutorials both threads , services. best android google-maps

Projects quota for Google Developers Console -

Projects quota for Google Developers Console - when seek add together new projects developer console, message: you have exceeded quota project creations per day. i have similar error when accepting new project invitation: you have no more apps available take invitation. we have created or invited 25 projects, , software company need more that. there way lift limitation? google-api-console

python - Format data for survival analysis using pandas -

python - Format data for survival analysis using pandas - i'm trying figure out quickest way survival analysis info format allow time varying covariates. python implementation of stsplit in stata. give simple example, next set of information: id start end x1 x2 exit 1 0 18 12 11 1 this tells observation started @ time 0, , ended @ time 18. exit tells 'death' rather right censoring. x1 , x2 variables constant on time. id t age 1 0 30 1 7 40 1 17 50 i'd get: id start end x1 x2 exit age 1 0 7 12 11 0 30 1 7 17 12 11 0 40 1 17 18 12 11 1 50 exit 1 @ end, signifying t=18 when death occurred. assuming: >>> df1 id start end x1 x2 exit 0 1 0 18 12 11 1 and: >>> df2 id t age 0 1 0 30 1 1 7 40 2 1 17 50 you can do: df = df2.copy() # start df2 df['x1'] = df1.ix[0

javascript - How to get the response from the ajax request in another method after the response has been generated? -

javascript - How to get the response from the ajax request in another method after the response has been generated? - i want response generated method request has been sent , need generated response in method. please, refer below code farther reference. function foodlog(){ var data={ servings : $('#demo_vertical').val(), calories : $('#calories').text(), carbs : $('#carbs').text(), }; $.ajax({ type : "post", contenttype: "application/json; charset=utf-8", url : "/fitbase/foodlog/create", datatype: "json", info : json.stringify(data), success : function(response) { }, error : function(e) { alert("object" +e); } }); }; the response generated after success need in below method. wrote belo

How to upload image to SQL Server using C# -

How to upload image to SQL Server using C# - i had info type image column in database set image, have since changed varbinary(max). however, when effort run code , upload image store in column, every record showing null. believe database fine , problem must how passing image info sql query. question this: need modify image uploaded database in right format? image retrieval planned implemented. here database looks like. included column name, info type, , results when selecting rows. no errors returned when attempted upload image. while column allow null values, each of records attempts upload image. below code "add" button handles communicating database. have made effort cutting out unrelated problem, such closing form. private void addbutton_click(object sender, eventargs e) { string strconnect = @"server=mainserver\sqlexpress; database=inventory; integrated security=sspi;"; sqlconnection con = new sqlcon

asp.net mvc - Kendo globalization: different cultures for widgets -

asp.net mvc - Kendo globalization: different cultures for widgets - i have kendo grid incell editing mode , decimal column rate . @(html.kendo().grid(model.contractcurrencyclauses) .name("contractcurrencyclauses") .columns(columns => { columns.bound(p => p.rate).clienttemplate("...").width(200); }) .editable(editable => editable.mode(grideditmode.incell)) .datasource(datasource => datasource.ajax() .model(model => { model.id(u => u.contract_id); })

ios - performSelectorinBackground in certain time -

ios - performSelectorinBackground in certain time - i'm new ios programming , made little game. i have sprites in background of scene want move left right. right i'm doing in mainscene: [self performselectorinbackground:@selector(dobackgroundanimation:) withobject:sprite]; and method in animation takes place looks this: -(void)dobackgroundanimation:(ccnode *)sprite { while (//sprite still in scene) { //move sprite little bit right } } this solution not looking for, since time takes run through while-loop varies device device. is there way create sure animation takes exact amount of time e.g. 5 seconds? like: performselectorinbackground:@selector(dobackgroundanimation:) withobject:turtle intime:5.0 thank help! it's been while since did game stuff have adjust distance move sprite according time since lastly update of screen. have var called speed * time since lastly refresh , move sprite distance. there methods in sprite kit deal

visual studio 2010 - Download all .net PDB's to my computer? -

visual studio 2010 - Download all .net PDB's to my computer? - in order utilize source stepp debugging : and utilize navigation sources , in resharper : –i must have pdb's. but vs downloads every time specific module. i downloaded 50mb zip file : http://referencesource.microsoft.com/ but contains project no pdb. question is there centralized place can download pdb's visual studio ? ( wont need download every time) .net visual-studio-2010 debugging pdb-files reference-source

table - MS Word correct when printing, not when viewing document -

table - MS Word correct when printing, not when viewing document - i have word document generated external tool (birt 4.3.0) contains 2 parallel tables. the problem 2 table should aligned on top, they're not always. if @ below picture, can see table cell isn't positioned @ same place both tables. however, problem when viewing document, document 100% right when printing it. also, we're not seeing problem on machines (we're using both word 2010 , 2013). we tried alter lots of printer setting, printer driver, word options, couldn't find way have 2 tables top aligned when looking @ doc. we're pretty sure issue related printer setting and/or "hidden" word alternative ... did see similar behavior? i solve issue applying next prepare : http://support.microsoft.com/kb/822005 table printing ms-word export

asp.net mvc 4 - Control creation based on model value in MVC4 -

asp.net mvc 4 - Control creation based on model value in MVC4 - in database, have column called control_id consists value 1,2,3,4. based on value, have generate controls text box, dropdownlist , check box. (for example, if control_id 1, has generate text box, , 2, dropdownlist , on) new mvc. can point me in right direction implement scenario? create enum command types public enum controltypes { textbox = 1, dropdown = 2, checkbox = 3, label = 4 // define other command types } create baseclass handling command types. public class dynamiccontrolsbase { public virtual string fieldlabel { get; set; } public string controlvalue { get; set; } // dropdown public virtual list<selectlistitem> valuelist { get; set; } // likewise implement other required property command uses } create view model each control, textbox // textbox deriving class public class textboxviewmodel : dynamiccontrolsbase {

html - How to have select and textfields appear inline and scaling upon scaling the parent container? -

html - How to have select and textfields appear inline and scaling upon scaling the parent container? - in fiddle show form devided 2 parts (horizontally). left part problematic one. there select element in line 2 textfields sharing available width percentally. i'd have give select , middle textfield defined percentual width , have right textfield take rest span right container border. layout must remain behaving upon scaling container. also, select element must remain readable. @ moment content getting partially hidden upon scaling. i cannot figure proper formatting achive this. here's code: <style> .unseen { display: none } form { background: maroon; margin: 0; display: flex; } [class*="span5"] { background: olive } [class*="span7"] { background: pinkish } #salutation { width: 12%; min-width: 50px } #firstname { width: 30% } #lastname { width: 40% } </style> <div class="container&quo

java - How to transfer checkbox values to MySQL? -

java - How to transfer checkbox values to MySQL? - i working on java frame. have created questionnaire in utilize number of ckeck boxes. check boxes labelled 1-15. wish collect info on checkboxes selected , transfer them db in mysql. for radiobuton, manage because can create buttongroup , : int marital = 0 ; if (jradiobutton3.isselected() == true) marital = 1; if (jradiobutton4.isselected() == true) marital = 2; and on sql side, column have value 1 or 2 depending on radio box chosen. however, multiple checkboxes there possibility of multiple choices. each checkbox has own method. question this: how should collect info on check boxes selected. should transfer vector or 15 single values? on sql side, should have 15 columns or 1 column can take vector? thank precise information. no, assign value each check box item. and when receive value , seek insert in mysql, insert value button. it approach you. java mysql swing checkbox

python - Creating a lib directory in Google App Engine and adding it to sys.path -

python - Creating a lib directory in Google App Engine and adding it to sys.path - i'm writing google app engine project in python flask. here's directory construction hello, world! app (contents of 3rd party libraries ommitted brevity's sake): project_root/ flask/ jinja2/ markupsafe/ myapp/ __init__.py simplejson/ werkzeug/ app.yaml itsdangerous.py main.py here's main.py : from google.appengine.ext.webapp.util import run_wsigi_app myapp import app run_wsgi_app(app) and myapp/__init__.py : from flask import flask app = flask("myapp") @app.route("/") def hello(): homecoming "hello, world!" since flask has many dependencies , sub dependencies, thought nice tidy directory construction putting 3rd party code in subdirectory (say project_root/lib ). of course, sys.path doesn't know find libraries. i've tried solutions in how modify sys.path in google app en

R - Generating dynamic text for Select Argument in Subset Function -

R - Generating dynamic text for Select Argument in Subset Function - i'm having problem using subset() within function i'm writing. myfun <- function(arg1="", arg2="", arg3="") { temp.frame <- subset(master.frame, == arg1 & b == arg2 & c == arg3) } this works fine if specifies arguments, if 1 or more of arguments isn't specified subset function doesn't work (as missing values in column vector passed null values in function calling) i want work such if argument not specified, not included in subset() goes looking for. so if input: function1(arg2=5, arg3=6) in function1, subset command temp.frame <- subset(master.frame, b == 5 & c == 6) any suggestions? r arguments

How to reset a jquery multiselect checkbox dropdown -

How to reset a jquery multiselect checkbox dropdown - i have below code. per functionality, when user chooses first radio button, no action required when user chooses sec radio button, multiselect jquery dropdown shown up. user can select checkboxes. fine. after user checks checkboxes , click on first radio button, dropdown should disappear , values should reset or in other words, checkboxes should unchecked. able create disappear using hide(), values not getting unchecked. when come back, still see old values. <div id="radiobutton" data-role="fieldcontain" style="display: none"> <label for="flip-1">choose </label> <fieldset data-role="controlgroup"> <input type="radio" name="radio-choice-2" id="radio-choice-1" value="choice-1" /> <label for="radio-choice-1">all business catergories</label> <input

sql server - Generate MSSQL database script using command line -

sql server - Generate MSSQL database script using command line - i have database on server don't have rdp access. need create backup of data, stored procedure , functions of database on server. tried "generate script" fails saying there "transport layer error" occurred. is there way can generate script of database on server using command line or other tool. thanks check if can utilize xp_cmdshell. if yes backup database , re-create bak file use master exec xp_cmdshell 'copy c:\sqlbackup\db.bak \server2\backups\', no_output sql-server database sql-server-2008 command-line backup

monotouch - How to draw a linear gradient along an arc in Xamarin iOS -

monotouch - How to draw a linear gradient along an arc in Xamarin iOS - i'm trying create colour selector tool, similar colour wheel in shape of horse shoe. i need draw linear gradient follows arc. this the problem is a) how create gradient follow curve, instead of going in 1 direction, and b) how fill stroke of arc , not area enclosed arc i've managed on android have far failed working in ios, advice appreciated. ios monotouch xamarin

c++ - Potential evaluation of inline function bodies and instatiation of template members -

c++ - Potential evaluation of inline function bodies and instatiation of template members - when expressions contained within function marked inline considered 'potentially evaluated'? a.cpp template <typename t> const t& foo(const t& arg) { homecoming arg; } inline void dead() { int x(21); x = foo(x); } b.cpp #include <iostream> template <typename t> const t& foo(const t&); int main(int argc, char *argv[]) { std::cout << foo(12) << std::endl; } if expressions considered 'potentially evaluated' inline function defined, template should instantiated, , expect $(ccc) -c a.cpp; $(ccc) -c b.cpp; $(ccc) a.o b.o -o bin link successfully. if instead expressions within function declared inline become 'potentially evaluated' when such function becomes odr-used, expect $(ccc) -c a.cpp; $(ccc) -c b.cpp; $(ccc) a.o b.o -o bin fail during link step. thus far have tested xl c++ 12 (which lin

java - Invert last bit -

java - Invert last bit - how can invert lastly bit in int ? int = 11; system.out.print(a + " " + integer.tobinarystring(a)) //11 1011 int b = invertlastbit(a); system.out.print(b + " " + integer.tobinarystring(b)); //10 1010 i wrote this: static int invertlastbit(int i) { string s = integer.tobinarystring(i); if (s.charat(s.length()-1) == '0'){ s = s.substring(0,s.length() - 1); s = s+"1"; }else if (s.charat(s.length()-1) == '1') { s = s.substring(0, s.length() - 1); s = s + "0"; } homecoming integer.parseint(s, 2); } but how should rewrite invertlastbit() ? you can utilize bitwise xor : int x = 5; // 101 x = x ^ 1; // 100 using original illustration : int = 11; system.out.println (a + " " + integer.tobinarystring(a)); //11 1011 int b = a^1; system.out.println (b + " " + integer.tobinarystring(b)); //10 1010 java

three.js - OrthographicTrackballControls vs. TrackballControls -

three.js - OrthographicTrackballControls vs. TrackballControls - i've implemented scene utilize both orthographic , perspective cameras, , respective trackball controls. feels they're out of sync. sometimes results of switching between them expected, while other times output wrong. in image below, rotated model in perspective mode, took snapshot, checked box set in ortho mode, , took sec snapshot. there no other manipulation done scene between switching cameras. here is working expected after slight rotation in perspective mode: and here after random rotations while in perspective mode: (i know have zooming issues well--i'm working on one.) of course, i'm open thought i'm 1 doing wrong--it has been ages since i've worked ortho cameras, might forgetting concepts, fact works sometimes makes me think i'm @ to the lowest degree on right track, , need nudge in right direction. i've tried combinedcamera, didn't behave orthographictr

Ruby printing PS after reading file -

Ruby printing PS after reading file - i wondering happening output. when run code work fine, pass in file name (ex15_sample.txt) , print out. after done printing out file prints out 2 additional characters "ps". thought on why is? i'm running ruby 2.0.0p576 (x64) on windows 8 64 bit machine. here code: # prompts user input on filename print "what name of file printed? " # takes command line argument , assigns variable filename = gets.chomp # declares variable , initializes opening file stored in variable filename txt = open(filename) # prints out string interpolated string puts "here's file #{filename}:" # prints out file stored in variable txt print txt.read # closes file txt.close() edit: side note, if open file, read , print using irb not characters. if utilize command ruby ex15.rb ps powershell prompt. gets printed powershell after every command. has absolutely nil whatsoever ruby. seek running dir , print ps.

java - Spring-Batch/JPA : Share Persistence Context between reader,processor and writer -

java - Spring-Batch/JPA : Share Persistence Context between reader,processor and writer - we're on web application have batch processing. we're facing performances problems. we're using spring batch , jpa (with hibernate implementation), no ejb's. for moment we're using hibernatecursoritemreader load info , jpaitemwriter create updates. i'm searching while best pattern optimize our batch. i've seen many give-and-take , documentation people unadvise utilize extended persistence context many problems getting outofmemory error, non threadsafe object... but in our case, talk batch processing there 1 persistence context @ 1 time. planed flush , clear entitymanager after each chunk, wich persist item 1 1 (commit size = 1). so don't see why not utilize 1 persistence context reader, processor , writer. thought avoid many select (at to the lowest degree 1 per item) reattach detached item between reader , author (so entitymanager can me