Posts

Showing posts from September, 2014

Java Runtime String Parsing -

i using java execute python command, i.e. ctool run <cluster_name> <nodes> <command> so runs <command> in given nodes of cluster. example: ctool run my_cluster 'rm -rf /home/tester/folder' this runs 'rm -rf /home/tester/folder' on 'all' nodes of 'my_cluster' runs fine terminal when running java runtime string, taking option -p , -r , etc. in <command> ctool option , throwing usage error. i assuming has how string parsing command. there way can fix issue? this should work: process process = new processbuilder("rm","-rf","/home/tester/folder").start(); inputstream = process.getinputstream(); inputstreamreader isr = new inputstreamreader(is); bufferedreader br = new bufferedreader(isr); string out; while ((out = br.readline()) != null) { system.out.println(out); }

How can we create event class using php artisan in laravel 4.1? -

i want create event class in laravel 4.1 using "php artisan" command. have found 5.1 version unable dump 4.1 version. laravel 4 doesn't have feature has generators package extend artisan commands: generate:model generate:view generate:controller generate:seed generate:migration generate:pivot generate:resource generate:scaffold you can find in: https://github.com/jeffreyway/laravel-4-generators

integer - Using == operator in Java to compare wrapper objects -

i'm reading scjp java 6 kathy sierra , bert bates , book confusing me much. on page 245 state following code below. integer i1 = 1000; integer i2 = 1000; if(i1 != i2) system.out.println("different objects"); //prints output different objects then on next page have following code integer i3 = 10; integer i4 = 10; if(i3 == i4) system.out.println("same objects"); //prints output same objects i'm confused! when try out on own seems cannot use == compare same way use equals() method. using == gives me 'false' if integer variables set same value (i.e. 10). correct? using == compare same integer object (with same values) result in 'false' the key answer called object interning . java interns small numbers (less 128), instances of integer(n) n in interned range same. numbers greater or equal 128 not interned, hence integer(1000) objects not equal each other.

javascript - Why do you reset an objects constructor when a subclass extends superclass? -

question: why example set rectangle.prototype.constructor rectangle when subclass extends superclass? best practice? illustrate gets reset? because example works regardless. function shape() { this.x = 0; this.y = 0; } // superclass method shape.prototype.move = function(x, y) { this.x += x; this.y += y; console.info('shape moved.'); }; // rectangle - subclass function rectangle() { shape.call(this); // call super constructor. } // subclass extends superclass rectangle.prototype = object.create(shape.prototype); rectangle.prototype.constructor = rectangle; var rect = new rectangle(); console.log(rect); console.log('is rect instance of rectangle? ' + (rect instanceof rectangle)); // true console.l...

php array strtotime query -

i have following code finds oldest date in array, , displays 'available now' if date today or earlier, or 'mixed availability' if date in future. im trying modify if 1 valid date (not null or 1970-01-01 being imported if date blank) found in array, display date, or if date today or before today display 'available now'... id appreciate help! many in advance! <?php $avail = array($this->item->extrafields->roomonedateavailable->value, $this->item->extrafields->roomtwodateavailable->value, $this->item->extrafields->roomthreedateavailable->value, $this->item->extrafields->roomfourdateavailable->value, $this->item->extrafields->roomfivedateavailable->value, $this->item->extrafields->roomsixdateavailable->value, $this->item->extrafields->roomsevendateavailable->value, $this->item->extrafields->roomeightdateavailable->value, $this->item->extrafields->roomn...

python - Giving indices to list entries -

i have python list looking this: a1 = ['a','a','a','foo','c','d','a','e','bar','bar','bar','e','d','d'] i want transform this... a2 = [1,1,1,2,3,4,1,5,6,6,6,5,4,4] ...where entries in a1 taken in order , given incremental index in a2. is there straight forward way in python? one of ways of doing can be. >>> a1 = ['a','a','a','foo','c','d','a','e','bar','bar','bar','e','d','d'] >>> ref = [] >>> in a1: ... if not in ref: ... ref.append(i) ... >>> [ref.index(i)+1 in a1] [1, 1, 1, 2, 3, 4, 1, 5, 6, 6, 6, 5, 4, 4] logic we remove duplicate values in original list (whilst preserving order). find index of individual items in list respect original list. advantages simple concepts/ beginner lev...

javascript - how to provide functionality for cut,copy,paste,undo,redo,delete buttons in an web based application -

Image
hi creating web based application created buttons cut,copy,paste,undo,redo,delete options.i wanted make these buttons work according functionality after clicking button how can implement in application? using html design , javascript , jquery functionality. application screen shot you can use iframe , set iframe.document.designmode = "on"; using javascript. then use iframe.document.execcommand(acommandname,ashowdefaultui,avalueargument); find out more here link

tomcat - Apache CXF + Spring Java config + replace beans.xml -

i try replace beans.xml javaconfig (spring). in beans.xml have following configuration: <bean id="testwebservice" class="at.test.testwebservice" /> <jaxws:endpoint id="test" address="/testwebservice_v100" implementor="#testwebservice" /> <jaxrs:server id="testrestservice" address="/rest/test" name="testrestservice"> <jaxrs:servicebeans> <ref bean="testwebservice" /> </jaxrs:servicebeans> <jaxrs:providers> <ref bean="jsonprovider" /> <ref bean="datehandler" /> </jaxrs:providers> </jaxrs:server> at moment have config.java class contains beans beans.xml. config.java: @configuration public class config { @bean public testwebservice testwebservice() { return new testwebservice(); } all beans configured @controller , resources marked @autowired. @we...

javascript - How to add JSON objects to an array in another JSON file -

i have json file : var info = [{ "place": "turkey", "username": "jhon" }, { "place": "dubai", "username": "bruce" }, { "place": "italy", "username": "wayne" }]; i have html form : <!doctype html> <html> <body> <form onsubmit="addtojson();"> first name:<br> <input type="text" id="place"> <br> last name:<br> <input type="text" id="username"> <br><br> <input type="submit" value="submit"> </form> <script src="data.json"></script> <script> function addtojson(){ alert("inside js"); var x = document.getelementbyid('place').value; var y = document.getelementbyid('username').value; var obj = { place: x, username: ...

r - Shiny generate random values every time press button -

i new shiny , simple shiny application, generates iid normal variables , prints histogram. input has: 2 numericinput fields, mu , sigma actionbutton output tabsetpanel: tab1: 5 generated values tab2: histogram so not work. tried lot variants , insufficiently working solution this. here code ui.r library(shiny) library(xtable) meaninput1 <- numericinput("id1", "$$mean \\ of \\ x_1$$", 1, min = -10, max = 10, step = 1) meaninput2 <- numericinput("id2", "$$sd \\ of \\ x_2$$", 1, min = -10, max = 10, step = 1) tabpanel1 <- tabpanel("generated values", tableoutput("table1")) tabpanel2 <- tabpanel("plot", plotoutput("plot1")) shinyui(fluidpage( withmathjax(), titlepanel("title"), sidebarlayout( fluid=true, sidebarpanel( meaninput1, meaninput2, actionbutton("gobutton", "go!") ...

sql - Determining who owns a transferrable item in MySQL -

i working on game users can buy virtual items virtual currency, , give items away other users. need able track history of item (who bought it, gifted to, etc) , current owner. i'm struggling of table design. my thinking have (with table design simplified , constraints/keys/etc omitted space): table order id int not null auto_increment, buyer_id int not null, paid int unsigned not null, owned_item_id int not null, ------------------------------------------------------ table owned_item id int not null auto_increment, store_product_id int not null, owner_id int not null, ------------------------------------------------------ table gift id int not null, giver_id int not null, receiver_id int not null, owned_item_id int not null, with idea being when item purchased, both order , owned_item created item. if item gifted, new entry in gift table created , owner_id fie...

ios - Can we create multiple ChatDialogs for same opponent? (In 1-1 Quickblox chat) -

below code var qbchatdialog = qbchatdialog() qbchatdialog.occupantids = [stropponentquickbloxid] qbchatdialog.type = qbchatdialogtype.private qbchatdialog.data = ["class_name": "hqcustomclass", "game_id": strgameid] //qbchatdialog.name = "\(strgameid)holy" //can use field in 1-1 chat? //create dialog qbrequest.createdialog(qbchatdialog, successblock: { (qbresponse, newdialog) -> void in println("***** new dialog \(newdialog)*******\n\n\n\n") }, errorblock: { (qberrorresponse) -> void in println("***** dialog error \(qberrorresponse)*******\n\n\n\n") }) always getting same quickblox chatdialog. it's impossible create many 1-1 dialogs same opponent use type qbchatdialogtype.group this.

asp.net - How to use C# 6 with Web Site project type? -

updated existing web site project type visual studio 2015, changed framework 4.6. i expected have new features available in code behind files. unfortunately i'm getting errors like: error cs8026: feature 'expression-bodied property' not available in c# 5. please use language version 6 or greater. or e.g.: error cs8026: feature 'interpolated strings' not available in c# 5. please use language version 6 or greater. i did quick google check , found a guy posting comments in blog posting of scottgu (search "8026" on page). since not understand solution, plus want have solution more visible, i've created posting. my question: how can have visual studio 2015 project of type web site (i.e. not web application ) recognize c# 6 features? i've tested asp.net mvc 5 (tested 5.2.3), , mileage may vary other web frameworks, need add roslyn codedom| nuget package codedom providers .net compiler... replacement cod...

android - How to make the FAB avoid being moved in ViewPager, yet be a part of the fragment within? -

background according material design guidelines ( here ), if use viewpager has fab (floating action button) fragments within, fab shouldn't move part of fragments, either disappear or replaced another, or animate else. in short, instead of this: https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0b6okdz75tqqsnvrkv3fzmktvmwc/components-buttons-fab-behavior_06_xhdpi_009.webm you should this: https://material-design.storage.googleapis.com/publish/material_v_4/material_ext_publish/0b6okdz75tqqsvlhxngjcnteznfu/components-buttons-fab-behavior_04_xhdpi_009.webm the problem i don't see example or tutorial of what's best way perform this. i mean, having fab each fragment (or of them) in viewpager, while each controlled fragment (logic , how looks), yet fab won't move part of fragment while sliding between fragments in viewpager. even example apps, don't see behavior anywhere. contacts app has same fab both fragments...

azure - List of reasons that this error can occur: OAuth2::Error, invalid_grant: AADSTS65001 -

we have implemented microsoft azure oauth2 on our web app, , trying address common errors users have when using oauth method. the error: oauth2::error, invalid_grant: aadsts65001: no permission access user information configured '...' application, or expired or revoked. resembles 82% of our errors azure oauth flow. here's our configuration: # ==> office 365 oauth2 config.omniauth :azure_oauth2, client_id: '...', client_secret: '...', tenant_id: '...', resource: 'https://outlook.office365.com/', setup: lambda { |env| params = rack::utils.parse_query(env['query_string']) options = env['omniauth.strategy'].options case params['state'] when 'calendar' options[:prompt] = 'login' when 'select_account' options[:prompt] = 'login' end } we know error can caused using non office 365 account. since our resource ' https://ou...

c# - Build XPath for node from XmlReader -

i writing application parses dynamic xml various sources , traverses xml , returns unique elements. given large size of xml files using xmlreader parse xml structure due memory constraints. public idictionary<string, int> discover(string filepath) { dictionary<string, string> nodetable = new dictionary<string, string>(); using (xmlreader reader = xmlreader.create(filepath)) { while (!reader.eof) { if (reader.nodetype == xmlnodetype.element) { if (!nodetable.containskey(reader.localname)) { nodetable.add(reader.localname, reader.depth); } } reader.read(); } } debug.writeline("the node table has {0} items.", nodetable.count); return nodetable; } this works treat , nice , performant, final piece of puzzle eludes...

ios - Swift-How do I add Tab Bar AND Navigation Bar to a single view controller? -

Image
using xcode, , either through code or through storyboard, can please explain me how add both tab bar , nav bar view controller while keeping both visible? thanks much. in storyboard, should drag out tab bar controller , use initial view controller. then, should embed each of view controllers attached tab bar controller inside navigation controllers (editor menu: embed in > navigation controller). afterward, storyboard should this: the tab bar controller holds tab bar , manage switching between other views attached it, while navigation controllers place navigation bars @ top of each tab , manage navigation within tab.

Recursively change black to white in image with numpy -

Image
what's best way remove large shadowed regions greyscaled images. i'm struggling write method takes 2d numpy array , entry (x,y) in a, , "crawls" through array changing (x',y') entry "connected" (x,y) 0 255. mean connected there's path of 0 valued entries (x,y) (x',y'). here's picture of mean. the black region @ bottom should set grayscale 255. i'm positive algorithm should recursive, there fast way in numpy, or using pil? edit: ok advice, here's i've been able come with; def creep(data, x, y): data[x, y]=255 (i,j) in [(1,0),(-1,0),(0,1),(0,-1)]: x, y = x + i, y + j try: if data[x, y]==0: return creep(data, x, y) except: pass return data def crop_big_region(data): """ looks black regions in image , makes them white """ n, m = data.shape r = int(0.012*min(n,m)) num_samples = int(0.0001...

window - Adding geometric tolerance in Autocad using Autolisp -

i attempting draw geometric tolerances using autolisp script. however, have found (command "tolerance") pull geometric tolerance window. know how add more arguments? goal draw parallelism symbol tolerance. maybe don't need draw geometricaly. maybe it's enought set symbol text unicode? propably symbol of parallelism has code /u+2225 it's need t o find font containing symbol

python - Flask/SQLAlchemy Relationships -

so reading database relationships , seem puzzled this below code of miguel grinberg in blog from app import db class user(db.model): id = db.column(db.integer, primary_key=true) nickname = db.column(db.string(64), index=true, unique=true) email = db.column(db.string(120), index=true, unique=true) posts = db.relationship('post', backref='author', lazy='dynamic') def __repr__(self): return '<user %r>' % (self.nickname) class post(db.model): id = db.column(db.integer, primary_key = true) body = db.column(db.string(140)) timestamp = db.column(db.datetime) user_id = db.column(db.integer, db.foreignkey('user.id')) def __repr__(self): return '<post %r>' % (self.body) correct me if understanding wrong posts = db.relationship('post', backref='author', lazy='dynamic') the posts attribute having relationship post model posts attribute b...

c# WPF Change the check color of a CheckBox -

Image
<checkbox background="white" ischecked="{binding isselected, updatesourcetrigger=propertychanged}"/> i need change color of check. figured forground did since background changed background color no avail. any ideas? surly there way directly change check color. tried googling solution found make own checkbox class. where property change checkbox check color? i found 1 answer with <path visibility="collapsed" width="7" height="7" x:name="checkmark" snapstodevicepixels="false" strokethickness="2" data="m 0 0 l 7 7 m 0 7 l 7 0"> <path.stroke> <solidcolorbrush color="{dynamicresource glyphcolor}" /> </path.stroke> </path> but not work since cannot add child element. if worked, change much. want white background black checkmark. grey on grey terrible looking. isn't there built in way change...

javascript - How to parse an email signature to get the details separately? -

i have requirement project parse signature of mails gmail account. , signature have fetch first name, last name, mail id, etc. [only sender's]. can please let me know start from? ("where start from" in sense, there thing in-place already?) i have gone through question , question speaks removing signature stuff, opposite requirement. answer not solve problem. i know can use regex done. don't want miss out mails not follow netiquettes of mail signatures removing "--" before signature, trailing hyphens. and if possible please let me know of open source javascript projects provide functionalities. thanks in advance. update: signatures looking business related contain html content or vcards directly. update: need strip each line of signature , details these lines. there several potential parts answering question. signatures within gmail interface within gmail interface, signatures easy grab. wrapped in <font color="#888888...

sql server - Sql Closest 2 Days to Today -

i have product table , join ordertracking table product productcode productname manufacturercode price etc... ordertracking productcode orderid ammount deliverydate shippingnumber etc... select product.productcode, product left outer join ordertracking on product.productcode=ordertracking.productcode group productcode there past , future order infos of products in ordertracking table. goal if there future orders of product want list first 2 of them(closest 2 orders today) in same row. if there no order in future, columns null or if there 1 order in future, second column null. example row that: productcode 1stclosestdeliverydate 1stclosestorderamount 1stshippingnumber 2ndclosestdeliverydate 2ndclosestorderamount 2ndshippingnumber select product.productcode, 1stclosestdeliverydate,1tclosestorderamount, 1stshippingnumber,2stclosestorderdate, 2stclosestdeliveryamount, 2stshippingnumber product left outer joi...

swift - String nil inside NSURLSession -

i declare string in beginning var teststring: string? let task = nsurlsession.sharedsession().datataskwithurl(url!) {(data, response, error) in let xml = swxmlhash.parse(data) teststring = xml["root"]["schedule"]["date"].element?.text } but outside nsurlsession, teststring nil. how can make not become nil , can use value? for example, want use println (teststring) after method block. nil the reason variable nil because closures executed asynchronously. means rest of code after network request continue called normal, code containing parameters data, response , error called when network request finished. to work around this, try putting whatever trying variable inside closure, println(teststring) inside curly brackets.

reporting services - SSRS Row visibility based on another row's visibility -

my ssrs report has requirement filter report based on cashier's variance balancing 0. variance calculation based on 2 different datasets , values within data sets. i've used custom code in order pull of data second data set , use reportitems! expressions calculate variance combined in 1 chart. requirement show cashiers off balancing more +/-$10. i've tried put reportitem! expression in filter tablix, filters won't take reportitem! expression. next thought hide rows don't meet criteria, when 1 of toggled rows unhides because it's parent hidden based on row visibility expression. possible hide child rows of hidden rows? ideally, i'd turn parameter end user can change range of data at. did try hiding group instead of rows? if there's child within group hidden, child hide too...

android - inflate view in adapter -

in code have condistion. if inmobi ads reqeust success show inmoby ads if failed show google ads. here code @override public view getview(int positioninlist, view convertview, final viewgroup parent) { if (adsfreq != 0 && positioninlist > 0 && (positioninlist + 1) % adsfreq == 0) { mconvertview = convertview; if (mconvertview == null) { mconvertview = vi.inflate(r.layout.banner_inmobi_container,parent,false); } imbanner banneradview = (imbanner)mconvertview.findviewbyid(r.id.bannerview); adutils.getinstance().loadinmobibanner(banneradview, new iadlistener() { @override public void onfail() { mconvertview = vi.inflate(r.layout.banner_container, parent, false); adview madview = (adview) mconvertview.findviewbyid(r.id.adview); madview.loadad(adutils.getadmobrequestforcurrentuser()); } }); return mconvertview; } } when inmobi request inmob ads shows...

android - How to detect changes set by adb setprop during run time in C++ -

i have set property using adb setprop . while app running, if user dynamically updates property value want detect , change behaviour of app based on new value. i use properties.h --> property_get function value everytime code executes whether value has changed or not. i not want keep reading property file everytime tough - want react on change. there way achieve using c++?

jquery - How to get first date and last date of month view -

Image
for first instance, question looks duplicate not! i trying find first , last date of given month in calendar.(shown in attached image yellow highlighted) example: in attached image input : month july result : first date:28th june 2015 last date: 8th august 2015 i tried below code var days = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday'], months = ['jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec']; date.prototype.getmonthname = function() { return months[this.getmonth()]; }; date.prototype.getdayname = function() { return days[this.getday()]; }; date.prototype.getpreviousdate = function(beforedays) { if (!days) { beforedays = 0 } return new date(ne...

html - DBI->Connect failed(install_driver(Oracle) failed: Can't locate DBD/Oracle.pm) -

i running cgi script onclick event in html. html <button onclick="self.location='http:**link**/test.cgi?myfield=prd7-qf_p7';">click me</button> test.cgi script use dbi; use cgi::carp qw(carpout fatalstobrowser); begin { $env{'oracle_home'}='/data/softs/oracle/10.2.0.3/'; $env{'ld_library_path'}='/data/softs/oracle/10.2.0.3/lib'; } $cgi = cgi->new; #my $parameter = $cgi->param("myfield"); print "content-type: text/html\n\n"; $version = "2.1"; $cgi = cgi->new; $parameter = $cgi->param("myfield"); print "content-type: text/html\n\n"; print "this test perl script\n\n"; print "parameter=${parameter}\n"; $connection_details = dbstringtoconnection($parameter); $amdora_tns_fm = @$connection_details[0]; $amdora_user_fm = @$connection_details[1]; $amdora_password_fm = @$connection_details[2]; $amdora_schema_fm = @$connection_details[3]; $...

javascript - Bootbox HTML Render -

what proper method render html bootbox callback function? the problem i'm running i'm trying make html email on callback , none of html tags rendering properly. callback: function () { var text = "greetings,<br /><br />" + thanks in advance. try use blaze.renderwithdata or blaze.render load template containing html inside bootbox. here example bootbox.dialog({ message: "<div id='dialoganchor'></div>",//i not sure if found. //you can set anchor div in parent document title: "such nice modal!", animate: true, buttons: { danger: { label: 'cancel', classname: "btn-default", callback: function() { } }, success: { label:'done', classname: "btn-success...

unit testing - Can I run just tests inside a subfolder of the test folder in Rails (Minitest)? -

hard believe hasn't been asked before, couldn't find it. i trying run capybara tests inside own folder test/integration/capybara . tried bundle exec rake test test/integration/capybara runs tests under test . in rails guides says can invoke integration tests rake test:integration works. rake test test:integration:capybara doesn't. possible go deeper 1 level? you can build own rake task. add lib/tasks/test_capybara.rake : namespace :test namespace :integration rake::testtask.new('capybara') |t| t.libs = ['lib','test'] t.pattern = 'integration/capybara/**/*_test.rb' t.verbose = true end end end then run rake test test:integration:capybara .

javascript - Redirect to URL after form submit in PHP or JS -

is better redirect 'thank you' page when form submitted in php or js. not concerned text being displayed on page before redirect. i providing code provide phi , js below reference. will below header work expected after bcc header? header('location: nextpage.html'); php <?php if(empty($_post['name2']) || empty($_post['email2']) || empty($_post['message2'])) { return false; } $name2 = $_post['name2']; $email2 = $_post['email2']; $message2 = $_post['message2']; $to = 'lindsay@domain.com'; // email submissions sent email // create email $email_subject = "message domain 8.1"; $email_body = "you have received new message. \n\n". "name2: $name2 \nemail2: $email2 \nmessage2: $message2 \n"; $headers = "from: lindsay@domain.com\r\n"; $headers .= "reply-to: $email2\r\n"; $headers .= "bcc: dan@domain.io\r\n"; mail($to,$em...

java - Selemium webdriver: How many times does a driver try to find element with an implicit wait timeout? -

say have code this: webdriver driver = new chromedriver(); driver.manage().timeout().implicitwait(10, timeunit.seconds); driver.findelement(by.id("nothing")); i have trouble understand line in selenium doc: implicit wait tell webdriver poll dom amount of time when trying find element or elements if not available. so mean driver wait 10 seconds before first try find element? or mean driver find element first, if nothing found, wait 10 seconds, find again, if not found throw timeoutexception? driver tries find element twice in total? you can clear things logging json wire protocol commands chrome service logs . let's have python code (for sake of example): from selenium import webdriver driver = webdriver.chrome(service_log_path="/tmp/log") driver.get("http://www.google.com") driver.find_element_by_css_selector("strange.non.existing.element") driver.quit() here nosuchelementexception instantly , in /tmp/log have: ...

dplyr - group summary error in R -

my data quantity revenue event 1 72.00 100.80 regular 2 72.00 111.60 regular 3 72.00 111.60 promo 4 72.00 111.60 regular 5 72.00 111.60 regular 6 72.00 111.60 regular class(test$event) returns "character" when run dplyr::summarize(dplyr::group_by(test, event), qty=sum(quantity)) i following error error: invalid 'type' (character) of argument i did try plyr::ddply(test, "event", summarise, quantity=sum(quantity)) and same error. not sure went wrong. need fix this.

c# - Create insert statement to insert varbinary blob -

i want export data db , create insert-statement insert data db c#. i made script working (and -type) when try use in 1 of tables wich has field named contentos of type varbinary(max) can't work. now have select data, realised using method converts system.binary[] (wich getting when reading column) hex-string. but unfortunately i'm failing when comes inserting data... i'm trying this: insert [my.cool.dba].[dbo].[documentos] ([id], [someid], [name], [contentos], [lastchange], [lastchangeid]) values ('693c9644-f2b5-4c74-a633-f4942fc1d8e5', 'bca2ac27-71e0-4641-a4b0-3c3e39916e71', 'whats that', [--> here goes content <--], '07.08.15 11:18:34:383', '693c9344-f8b5-4d74-a633-f4942fc1d8e5'); the content (for example): '504b03041400000008091043e288e9e0d9ec7c1ceb6cf6a7e9290d5a4b04179e2a1b8fe350341542ea67dccd96dc5e682fd14e7a61e70000002a0300000000' result: cannot implicitly convert type varchar varbinary(m...

amazon web services - AWS Elasticache - increase memcached item size limit -

Image
im using memcached module on aws elasticache in python flask app (with flask-cache ) when try set file less 1mb need repeatedly access cache, have no issues. when file size increases more mb (the file text file/csv/xlsx etc), following error error: error 37 memcached_set: success im guessing because of size limit on memcached item capped @ 1mb. how increase item limit 5-6 mb in aws elasticache ? are there issues in increasing item size limit in memcached ? this page lists parameters can tinker in memcached http://docs.aws.amazon.com/amazonelasticache/latest/userguide/cacheparametergroups.memcached.html if not specify parameter group memcached cluster, default parameter group (default.memcached1.4) used. cannot change values of parameters in default parameter group; however, can create custom parameter group , assign cluster @ time. create new cache parameter group either aws console or using aws cli , set max_item_size size fits needs. reboot cache c...

Configuring Castle Windsor using xml/app.config -

i building sample application using castle windsor. motto use xml/app.config switch method interception on/off. had used fluent api earlier , worked charm. next step, trying replace fluent api xml. the gist of code follows: class called randomoperations 2 virtual methods. loggingaspect class implements iinterceptor. myinterceptorsselector class implements imodelinterceptorsselector program.cs had fluent api syntax earlier , uses make calls methods of randomoperations class. app.config section called has xml syntax of registering components. when use fluent api, able intercept method calls unable using xml/app.config registration. please throw light on being missed? the classes follows: randomoperations.cs public class randomoperations { public virtual int myrandommethod(int x) { return x * x; } public virtual void writer(string x) { console.writeline(x); } } loggingaspect.cs public cla...

ebay - Magento M2E Pro Listing Error -

struggling following error on final stage of submitting listing ebay magento v1.9.0.1 using m2e pro v6.3.4. parse error: syntax error, unexpected t_function in /public_html/app/code/community/ess/m2epro/block/adminhtml/ebay/listing/view/ebay/grid.php on line 825 any appreciated! i had happen on both 6.3.4 , 6.3.2. never figure out why, guessed using older version of php didn't support trying do. noticed code causing parse error sorting list of products, , decided comment out. can't if affected anything, never used code working, been using software no issues.

Automatically save Spotify's Discover Weekly Playlists -

spotify's new discover weekly feature kind of killed week i'd keen set script of description autosave playlist every tuesday. first, possible either applescript or web api? , second, docs me started? this great idea, , web api has functionality need build this. (applescript doesn't.) firstly, should read through authorization guide since you'll need access token when making requests. you'll find there 3 flows , , 1 pick depends bit on how application going work. how find user's discover weekly playlist? the discover weekly playlist's uri has format spotify:user:spotifydiscover:playlist:{id} , , saved default @ top of user's list of playlists. can retrieve list using get list of user's playlists endpoint . however - there's absolutely no guarantee playlist user's discover weekly playlist. may user has followed user's discover weekly playlist , might have unfollowed own discover weekly. also - note discover weekly pla...

javascript - Quintus - dynamic sprite stacking order -

i'm using html5 quintus js game library. according http://www.html5quintus.com/guide/sprites.md#.va7fbpmznn4 p.z can used change sprite's stacking order. doesn't seem me. have insert multiple sprites in same scene. sprite setup this: q.sprite.extend("test", { init: function(p) { this._super(p,{ asset: "smallship_1x2.png", x: 150, y: 300, z : 0, dragging : false, offset : { x:0, y:0 } }); this.on("drag"); }, drag: function(touch) { this.p.dragging = true; this.p.x = touch.origx + touch.dx; this.p.y = touch.origy + touch.dy; this.p.z = 10; } }); i added few of test sprites in same stage, when drag sprite, want have higher stacking order (so sprite appear on top of others in case drag across other sprites), seems setting p.z doesn't anyth...

swift images stacking / duplicating - iOS -

i've started coding , first attempt ios game, part of game i'm working on has following elements. scrolling foreground , background cat jumps when clicked missile raining down above. i've managed spawn missile every few seconds in doing think i've messed something. now have 2 errors, first cat, foreground , background images duplicating , stacking on screen , other build error under override func update(currenttime . i've commented out cat's z rotation otherwise game wont build. if can me work out how fix i'd grateful. sorry if it's overkill, here code.... import spritekit class gamescene: skscene, skphysicscontactdelegate { var cat = skspritenode() var crow = skspritenode() var crowtexture1 = sktexture() var skycolor = skcolor() var moveandremovecrow = skaction() var spawn = skaction() var lastmissileadded : nstimeinterval = 0.0 let missilevelocity : cgfloat = 5.0 override func didmovetoview(view: skview) { self.addmissile()...

mysql - The selected Stored Procedure returns No Columns using My SQL -

i getting error 'the selected stored procedure returns no columns' in entity framework. i have created following procedure in mysql: create procedure `getcustomersbyname`( p_name varchar(50) ) begin select id,name,categoryid customers ; end now using add import function import procedure. getting error. please provide me solution of problem.

redirect output of editcap to tcpdump -

i want filter first 100 packets inside pcap file , show result on stdout. filtering first 100 packet used below command: editcap -r test.pcap output.pcap 1-100 for showing result , filtering packet further purpose want used tcpdump. tcpdump -tttt tcp , host ip 192.168.1.1 -r inputfile.pcap i want redirect output of editcap tcpdump, this: editcap -r test.pcap - | tcpdump -tttt tcp , host ip 192.168.1.1 -r - but in command couldnt filter first 100 packets. possible so?? if not possible rediredt output of editcap ram , tcpdump read ram ?? thanks in advanced. p.s way, don't want use below command, because command read packet inside file. need command read packets inside pcap file , shows finished job. tshark -r ~/test1.pcap -r "frame.number<20 , frame.number>10" but in command couldnt filter first 100 packets i.e., don't see packets? try doing editcap -f pcap -r test.pcap - 1-100 | tcpdump -tttt tcp , host ip 192.168.1.1 -r ...

.net - Ask confirmation message only once from user in C# Window Appliaction -

i built windows application using c# . on form closing event wrote code ask confirmation form user... private void approve_user_formclosing(object sender, formclosingeventargs e) { if (messagebox.show("do want quit application...?", "confirmation", messageboxbuttons.yesno, messageboxicon.question) == dialogresult.yes) { application.exit(); } else { e.cancel = true; } } sometimes ask 4 times , upto 5 times.... i want once if user press yes application should exit. i need , suggestions. in advance. apparently subscribing approve_user_formclosing event in place execute few times. if subscribe 4,5 times execute 4,5 times. if want capture application exit event have @ this thread. edit you need below achieve weird requirement. private bool isexiting = false; private void approve_user_formclosing(object sender, formcl...

python 3.x - Python3, map-function -

i'm trying optimize piece of code speed (and correctness, of course) in python3: from math import log timeit import timer def groffle_slow(mass, density): total = 0.0 in range(10000): masslog = log(mass * density) total += masslog/(i+1) return total i've been amazed @ how map speeds things up, so... def groffle_faster(mass, density): total = 0.0 masslog = log(mass * density) return map(sum, (masslog/(i+1) in range(10000))) looking @ difference in time of execution, there's no comparison. groffle_faster() waaay faster, it's returning map object. map object should contain sum float. anyway can float out of map object? thanks! it's waaay faster because it's not doing anything; , if were, wouldn't work. >>> mass = 1.2 >>> density = 2.3 >>> masslog = math.log(mass * density) >>> map(sum, (masslog/(i+1) in range(10000))) <map object @ 0x7feccaf1fc18> ...