Posts

Showing posts from January, 2012

Sortable Jquery table not working in new Jquery version -

i have table sorting function jquery version jquery-1.7.2. when upgrade jquery jquery-1.11.1 sorting function not working. how can solve this? here html code <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-1.7.2.js"></script> <script src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <table id="sort" class="grid table-bordered table-striped" title="kurt vonnegut novels"> <thead> <tr><th class="index">no.</th><th>year</th><th>title</th><th>grade</th></tr> </thead> <tbody> <tr><td class="index">1

How to Create A Simple Module display all Product in Magento -

im studying magento, cant find tutorials or documents create new module display product. me ? module creation tutorial : http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table to display products, in phtml file write below code: echo "<pre>"; $productcollection = mage::getmodel('catalog/product')->getcollection(); foreach($productcollection $product) { print_r($product->getdata()); //you can display in tabular structure } echo "</pre>"; hope helps !!

java - Print only the first occurrence in a matcher -

i use following code extract age of user in 1 document, age appears several times: pattern r = pattern.compile("(\\d{2})(?=-year-old)"); matcher matcher = r.matcher("he 55-year-old doctor. xxxxx. 55-year-old man xxxx. when 55-year-old , xxxx"); if(matcher.find()) { system.out.println(matcher.group(0)); } finally result: 55 55 55 how can print 55 once? thanks in advance. you can make non-greedy adding ? pattern r = pattern.compile("(\\d{2})(?=-year-old)?"); should work, click detail

python - flask-SQLAlchemy OperationalError: (sqlite3.OperationalError) no such table -

myapp.py from flask import flask app = flask(__name__) app.config.from_object('config') view import * if __name__ == '__main__': app.run(debug=true) view.py from flask import render_template myapp import app model import db,user @app.route('/test') def test(): aaa=user(username='admin',password='admin',email='xxx') db.session.add(aaa) db.session.commit() return 'commit user' config.py sqlalchemy_database_url="mysql://%s:%s@%s/%s" % ('root', 'root', '127.0.0.1:3306', 'blog') model.py from flask.ext.sqlalchemy import sqlalchemy myapp import app db=sqlalchemy(app) class user(db.model): __tablename__='user' id=db.column(db.integer,primary_key=true,unique=true) username=db.column(db.string(45)) password=db.column(db.string(45)) email=db.column(db.string(45)) def __repr__(self): return '<user %r>' % self.

android - Remove activites from the stack -

i have activities on stack a->b->c->d , want come activity b activity d removing activities between b , d (a->b). i have tried this: intent intent = new intent(this, b); intent.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_task); startactivity(intent); but doing delete activity stack. do know how handle that? thank you you can use intent intent = new intent(this, b); startactivity(intent); finish() on activities want remove stack

javascript - Loss of object prototypes in web worker -

i have algorithm lets users enter equations , graphs them in three.js surface. of data large ship work off web worker. worker solves equation , formats needed items show three.js model. however, creating vertices , faces , setting color in web worker seems moot point because prototypes vertices, faces, , colors lost when data sent main program. means have re-loop through data in main algorithm reset prototypes. is have live or there way keep object prototypes when passing them web worker?

windows - How to properly register a completion routine for an internal device control request for a lower filter disk driver? -

i'm writing lower filter disk driver capture scsi commands, , measure performance of each command. currently, driver capable of capturing scsi request, , passing down next driver. however, when tried register completion routine, following status: 0xc0000010(status_invalid_device_request). working code without completion routine: wdf_request_send_options_init(&options, wdf_request_send_option_send_and_forget); wdfrequestsend(request, target, &options); failing code completion routine: wdfrequestformatrequestusingcurrenttype(request); wdfrequestsetcompletionroutine(request, completionroutine, completioncontext); wdfrequestsend(request, target, wdf_no_send_options); any appreciated. thanks. notes: wdfrequestsend() failing routine. the code completion routine works, upper filter disk driver. as per discussion on ntdev , turns out if completionroutine null , must use wdf_request_send_option_send_and_forget option.

visual studio 2013 - How to create transparent Rectangle in Mfc c++? -

i want create rectangle total transparent try code. idea how that? bool chtmldlgtestdlg::pretranslatemessage(msg* pmsg) { if (pmsg->message == wm_mousemove && (pmsg->wparam & mk_lbutton)) { cpoint p = pmsg->pt; screentoclient(&p); crect r(10, 15, 380, 50); cdc* pcdc = getdc(); pcdc->rectangle(r); cbrush brush; brush.createsolidbrush(rgb(255, 255, 0)); pcdc->fillrect(&r, &brush); if (r.ptinrect(p)) { releasecapture(); sendmessage(wm_nclbuttondown, htcaption, 0); sendmessage(wm_nclbuttonup, htcaption, 0); return 1; } } return cdhtmldialog::pretranslatemessage(pmsg); } this mfc c++ code example. first: how hell want create transparent rectangle, if created solid brush , after did fillrect it?

html - Why does "overflow: hidden" cause the text to change size and shape? -

under following html , css: here fiddle of below: /*css*/ .header { margin: 0px; padding: 0px; width: 100%; } .headertable { padding: 0px; margin: 0px; width: 100%; border-spacing: 0px; } .headertabletr { width: 100%; padding: 0px; margin: 0px; } .logoanimation { text-decoration: none; color: black; } .logoanimation p { display: inline-block; margin: 0px; } .logodisapear1 { overflow: hidden; width: 0px; -webkit-transition: 0.2s linear; -moz-transition: 0.2s linear; -o-transition: 0.2s linear; transition: 0.2s linear; } .logoanimation:hover .logodisapear1 { width: 23px; } .logoanimation:hover .logodisapear2 { width: 56px; } .logodisapear2 { overflow: hidden; width: 0px; -webkit-transition: 0.4s linear; -moz-transition: 0.4s linear; -o-transition: 0.4s linear; transition: 0.4s linear; -webkit-transition-delay: 200ms; -moz-transition-delay: 200ms; -o-transition-dela

html - Once form is submit on the same page, its not submitting again using jquery until i refresh page -

i trying submit form on same page using jquery. when form submitted , again try submit failed. , when refresh page , submit works fine. whats problem? $('#csvfile').change(function(){ $("#senderinfoform").submit(); }); this code use trigger submit form in .change() $('#csvfile').on('change',function(){ $('#senderinfoform').trigger('submit'); }); be sure #senderinfoform form id not submit button id .. , submit form $('#senderinfoform').on('submit',function(){ // code here });

sony - Unable to retrieve data using generated accesstoken. everytime got 403 error code -

i able generate access token , store it. unable data using access token. suggest me how set access token in header field. developing application in android. time when request profile endpoint gives me 403 error. my code setting authorization header follow: con.setrequestproperty("authorization","bearer "+accesstoken); con urlconnection object. and apart headers need set con object make successful request. any type of appreciated. in advance. here tha class getting profile data: public class profilerequestactivity extends activity { myutility utility=new myutility(this); string urlstring="https://platform.lifelog.sonymobile.com/v1/users/me"; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); log.d("profile request", "true"); getprofile(); } public void getprofile() { req

ruby on rails - What is localhost and where is it defined? -

i changed thin puma @ recommendation of heroku. when start rails app using puma server responds: => booting puma => rails 4.2.2 application starting in development on http://localhost:3000 => run `rails server -h` more startup options => ctrl-c shutdown server puma 2.11.3 starting... * min threads: 0, max threads: 16 * environment: development * listening on tcp://localhost:3000 if go http://0.0.0.0:3000 in browser, old localhost thin server, not respond. however, if open http://localhost:3000 , works. appears definition of localhost has changed. so, localhost ? in particular, sort of object it, how defined, how see actual ip address, , why puma change it? if you're trying rails bind different ip, way -b option. bind 0.0.0.0 instead of rails-default localhost you'd want run along lines of rails s -b 0.0.0.0 note: explicit, may not bad idea throw -p 3000 option in there (sets port), though default not change. more info on available option

recursion - Common Lisp: Using (let) for evaluating recursive function -

so wrote returns maximal subset sum given list of positive integers. however, use (let) make code more efficient. know if or how possible. (defun subset-sum1 (numbers capacity) (subset-sum numbers capacity 0)) (defun subset-sum (numbers capacity counter) (cond ((null numbers) counter) ((= counter capacity) counter) ;; return if counter 'hits' capacity ((< capacity (+ (car numbers) counter)) (subset-sum (cdr numbers) capacity counter)) ;; cdr if car branch exceeds capacity ((<= (subset-sum (cdr numbers) capacity counter) (subset-sum (cdr numbers) capacity (+ (car numbers) counter))) (subset-sum (cdr numbers) capacity (+ (car numbers) counter))) ;; choose car (t (subset-sum (cdr numbers) capacity counter)))) ;; choose cdr the above code works fine in common lisp. but, below, because feel using let make code better. wrote goes infinite loop :( assignment introductory ai class... out novice please!

javascript - ng-animate child element inside ng-repeat -

i trying animate child element inside ng-repeat. have now. using css animate if know different better method please tell. index.html <div class="container slider" ng-controller="sliderctrl"> <div ng-repeat="slide in slides" class="slide" ng-include="'/partials/slider/' + slide.image + '.html'"> </div> </div> 01.html (included inside ng-repeat) <div class="slider-message-1"> <span>message</span> </div> <img class="slide-image" ng-src="assets/img/img00.jpg" /> sass file .slide{ &.ng-hide{ .slider-message-1{ display: block!important; visibility: hidden; } } &.ng-hide-remove { .slider-message-1{ animation: fadein 2s; -webkit-animation: fadein 2s; } } &.ng-hide-add { .slider-message-

r - rgdal::readOGR versus readOGR namespace issue? -

i trying load shapefile using the rgdal package. why command fails: plot(rgdal::readogr(dsn=system.file("vectors/up.tab", package = "rgdal")[1],layer="up")) with error: error in as.double(y) : cannot coerce type 's4' vector of type 'double' while 1 suceeds library(rgdal) plot(readogr(dsn=system.file("vectors/up.tab", package = "rgdal")[1],layer="up")) my guess is has hidden plot method spatialgdal. how uncover going on behind scenes plot ? i trying call readogr after "importing" rgdal within package writing. in effort avoid namespace conflicts using importfrom rgdal readogr .

angular - Dynamic Component selection in Angular2 -

this question has answer here: angular 2 dynamic tabs user-click chosen components 3 answers given model page section contains multiple fields , populated data such this: { "fields": [ { "id": 1, "type": "text", "caption": "name", "value": "bob" }, { "id": 2, "type": "bool", "caption": "over 24?", "value": 0 }, { "id": 3, "type": "options", "options" : [ "m", "f"], "caption": "gender", "value": "m" } ] } i have generic

ruby - Rail Action View Page: Missing Rails Console -

i got new computer @ work , have rails , running no problems. but oddly missing useful rails console pops whenever run error in rails. @ bottom of page , black. does know how appear? thank you! i think after: group :development gem 'web-console', '~> 2.0' end then use in view: <% console %> reference: https://github.com/rails/web-console

java - Jetty WebSocketException: RemoteEndpoint unavailable -

i have 2 threads in application - server (main) , service, inform user coordinate changes. when page reloaded have error: exception in thread "timer-1" org.eclipse.jetty.websocket.api.websocketexception: remoteendpoint unavailable, current state [closing], expecting [open or connected] @ org.eclipse.jetty.websocket.common.websocketsession.getremote(websocketsession.java:252) @ service.myservice.run(myservice.java:67) @ java.util.timerthread.mainloop(timer.java:555) @ java.util.timerthread.run(timer.java:505) and thread closed. how solve it?

ruby on rails - Soundcloud Embed: Uncaught TypeError: Layer must be a document node -

i have rails app uses embedded soundcloud players. player loaded in iframe includes basic rails view containing html used load player: <iframe width="100%" height="300" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<%= @id %>&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe> every , then, when loading site, player fails render , following error: uncaught typeerror: layer must document node d @ widget-6dc4a288.js:21 we tried replacing raw html js code sc sdk, still experienced same error: <script src="//connect.soundcloud.com/sdk-2.0.0.js"></script> <script> sc.initialize({ client_id: "<%= secret_key %>" }); sc.oembed("<%= @id %>", {auto_play: true, height: 300}, function(oembed){ documen

mongodb - Import to MongoLabs DB service hosted on Bluemix -

looking way import data command line. have mongolab db in ibm bluemix environment, , want import data db. have installed mongodb server package, have access mongoimport command. expecting issue command looks this: mongoimport --h hostname_on_ibm_bluemix --db calendar --collection users --file users.json --jsonarray is possible? how determine hostname in bluemix environment? when connecting instance of mongolab on bluemix, talking account on mongolab bluemix interfaces with. bluemix not host data - mongolab , talks bluemix. click on mongolab service in bluemix , see button opens mongolab website. your best bet accomplishing 1 of many methods documented in mongolab documentation on migrating data . create 2nd instance of mongolab in bluemix , interface between them using mongolab methods - included in methods command line interface can use. i hope makes sense - if not, comment below. thanks

debugging - Grails 2.4.4 Intellij debug mode -

hi had issue when run application on debug mode, seems not load plugins required , error. no suitable driver found jdbc:teradata://databaseurl i tried modify fork on configuration file if uncomment , run grails.project.fork = [ run: [maxmemory:2048, minmemory:64, debug:true, maxperm:512] ] the application never loads , keep listening socket |environment set development ................................. |packaging grails application ............................................................. |running grails application listening transport dt_socket @ address: 5005

Android share Intent with clickable link -

Image
i have looked around web have yet find solution fits specific need. looking way share information share intent provides clickable link, like: check out news article via jimmy's news app i have set share intent in android app looks this: intent shareintent = new intent(); shareintent.setaction(intent.action_send); shareintent.putextra(intent.extra_subject, "subject text"); shareintent.putextra(intent.extra_text, "check out news article" + "\n\n" + getresources().gettext(r.string.shared_via)); shareintent.settype("text/plain"); startactivity(intent.createchooser(shareintent, "share article with...")); my string resource looks this: <string name="shared_via">via <a ref="http://google.com">jimmy's news app</a></string> the sharing functions should when shared in email, twitter, etc. link ignored , tweet shows plain text this: i tried playing around mime type, still no

ssh - Bluemix VM Login using Putty -

after creating virtual machine in bluemix, process access vm via ssh? where credentials located? what login/pwd used? there way download image? it confusing find , there no clear documentation. as explained hubert wagner. need have ssh product putty , puttygen. first thing need create ssh private , public key. required when create bluemix vm. check link:- http://www.ng.bluemix.net/docs/starters/index-gentopic4.html#vms puttygen generate private , public key. https://www.digitalocean.com/community/tutorials/how-to-create-ssh-keys-with-putty-to-connect-to-a-vps you have specify passphrase during key generation . once create vm , started. start putty , specify connection details ssh connection under connection -> ssh -> auth , browse , specify private key generated using puttygen. then click open , asked login enter ibmcloud , ask passphrase enter during key creation. i hope helps. thanks, charles.

javascript - Multiple custom filters in AngularJS -

i want put 2 customs filters on data. each filter working independently, when put 2 on same data, have error message (typeerror: input.replace not function), if comment this, have error message (error: [$sce:itype] attempted trust non-string value in content requiring string: context: html) the 2 customs filters gobold take no argument, , limithellip takes maximum length of string argument. thanks lot, here code : angular.module('appfilters', []). filter('gobold', function($sce) { return function (input) { input = input.replace(' filter ',' <strong>word filtered</strong> '); return $sce.trustashtml( input ); } }). filter('limithellip', function($sce) { return function (input, limit) { console.log(limit); if( input.length > 100 ) { input = input.substring(0,100); var index = input.lastindexof(" "); input = input.substring(0,index) + "&hellip;";

crash - Xcode 6.3.2 unexpectedly crashing on App Store submission -

i submit app testflight testers , xcode has crashed 6th consecutive time , still crashing , i'm hanged in middle . suggestions ? thank in advance help. process: xcode [1917] path: /applications/xcode.app/contents/macos/xcode identifier: com.apple.dt.xcode version: 6.3.2 (7718) build info: ideframeworks-7718000000000000~2 app item id: 497799835 app external id: 812404257 code type: x86-64 (native) parent process: ??? [1] responsible: xcode [1917] user id: 501 date/time: 2015-06-19 01:33:40.608 +0530 os version: mac os x 10.11 (15a178w) report version: 11 anonymous uuid: 57e10c47-e9ab-1e21-571f-0266bdeb40a0 sleep/wake uuid: 5bca9bd6-143d-4ad5-99f6-aa65136e904e time awake since boot: 5500 seconds time since wake: 1000 seconds crashed thread: 12 dispatch queue: nsoperationqueue 0x7f9c3d58d7d0 ::

python - flask-SQLAlchemy + postgres unique constraint error -

i trying achieve 2 points right here: 1.- sort users bestfriend name 2.- sort users number of friend this wrote: class monkey(db.model): __tablename__ = 'monkey' __table_args__ = ( db.uniqueconstraint('best_friend'), ) id = db.column(db.integer, primary_key=true) name = db.column(db.string(64), index=true, unique=true) age = db.column(db.integer) email = db.column(db.string(128), index=true, unique=true) best_friend = db.column(db.string, db.foreignkey('monkey.name')) password = db.column(db.string(128)) is_admin = db.column(db.boolean) number_friends = db.column(db.integer) def __init__(self, name, age, email, password, best_friend=none, is_admin=false): self.name = name self.age = age self.email = email self.password = generate_password_hash(password) self.best_friend = best_friend self.is_admin = is_admin def number_friends(self):

bash - Linux - How to find files changed in last 12 hours without find command -

i need find files modified in last 12 hours. however, directory quite large using usual find command takes way long. anyone have ideas doing quicker? thinking listing files, using head top 20 , check files only. i'm not sure. any help? update: of chosen answer, have figured out can find file without using find command. trick timestamp file names, use following code latest one: ls -1 /directory/files*.txt | sort -nr | head -1 the file modification time stored in inode. whatever command use has read inodes files in directory. can make own script checking mtime, won't faster. listing directory contents (filenames only) fast, try ls -1 ( ls minus one ).but listing file attributes mtime slow: ls -l ( ls minus little l ). the file list in directory read in "random" order filesystem (the order depends on many things, static). can't use stopping after x number of files. ls -t lists files sorted mtime, has read mtime of files in order sort them

sql - Join without specyfing primary and foreign key -

is possible (ex. in ms sql) perform join in way this: select p.* person p join order o by default db engine relation between tables , use without writing additional: on p.id = o.fk_person no need specify join clause in on of 2 ways. implicit join notation: select p.* person p, order o p.id = o.fk_person or explicit join notation: select p.* person p inner join order o on p.id = o.fk_person if won't specify join order, no server join anything. it's defined in sql standard.

applet - Java: How to activate a button only if a textfield has a specific value? -

i making applet in people have enter 4-number pincode can withdraw sum of money. however, withdraw button deactivated default, , activated when single code entered in pin textfield. best way this? you need create listener , attach textfield. listener fire e time contents of textfield changes. have listener test contents of textfield, , if correct activate button. documentation of textfield should give need know.

vba - How do I count how many times a specific value shows up in excel? -

i'm searching "***" in column, need know how many times appears can loop code many times. can't seem find out how it. help! if cells have "***" in them , it's not else, can invoke worksheet function countif application.worksheetfunction.countif(activesheet.range("a:a"), "~*"&"~*"&"~*") edited per tmh8885's comment , asterisk being wildcard. tilde seem work.

Git Merge Specifics Commits -

suppose have several tasks , every 1 developed in branch. have 3 branchs too: develop , qa , production . merge every ticket develop when ready . how can merge qa , production tasks need branch develop ? example: i have task1 , task2 , task3 , merge develop task1, task2, task3. delete 3 tasks branchs. need merge commits of task1 qa . how can that? in future, not delete task branches if wish merge them qa (though recommend different workflow altogether, git flow ). if have indeed deleted task branches, can restore them following: git branch task1 abc^2 , abc commit merged task1 develop . merge task1 qa.

Nim: how can I make it closer to Python syntax? -

i know it's not idea want make nim more "pythonic". examples: 1) instead of proc , use def 2) instead of echo , use print 3) instead of readline , use input 4) instead of parsejson use json.loads and on. yes, may not possible change behavior of functions , statements, i'd - @ least - look "good old" python ones. honestly, please don't explain me why think it's bad idea. want play , try it. no animals harmed, blah-blah. any ideas? thank you! for echo , readline , , parsejson can definitions in system.nim , json.nim , define own procs. should work: import json proc print*(x: varargs[expr, `$`]) {.magic: "echo", tags: [writeioeffect], sideeffect.} proc input*(f: file): taintedstring {.tags: [readioeffect], benign.} proc loads(p: var jsonparser): jsonnode = parsejson(p) regarding def , don't think possible same syntax proc . if want to, can come def macro, generates ast of proc. far can see, resu

javascript - Angular focus on input using ng-click -

this question has answer here: how set focus on input field? 31 answers set element focus in angular way 6 answers i attempting make input focused on when user clicks on element. i have following angular bootstrap modal pop following content: <div ng-hide="thedata.input"> <div ng-click="showtheinput()">click me</div> </div> <div ng-show="thedata.input"> <input id="focus_me" type="text" required /> </div> here controller code reason, can't input focus. $scope.thedata = { input: false } $scope.showtheinput = function() { $scope.thedata.input = true; $("#focus_me").focus(); } could me out? know using jquery doesn't work. or guidance appreciat

c# - Checkbox checked event not firing in wpf -

hi in form(adminentitylist.xaml) file contains code below <resourcedictionary xmlns:local="clr-namespace:iwatch.administration" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" xmlns:my="clr-namespace:iwatch.uilibrary;assembly=uilibrary" xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:cmd="clr-namespace:iwatch.uilibrary;assembly=uilibrary&q

Load an HTML partial into a div using jquery -

help! i have main page (index.html), , few partial pages (just html files). i'm trying load 1 of partials div on index.html page when clicking link in nav bar. thought jquery best this, partial never loads , error message "cross origin requests supported protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource." i'm not sure what's causing this-- seems pretty straightforward code. here's have: html: <head> <link rel="stylesheet" type="text/css" href="css/style.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> </head> <body> <div id="nav"> <ul> <li><a href="partials/art.html">art</a></li> <li><a href="partials/design.html"> design</a></li> <li>

javascript - Clipping Magic API -

i trying use api clippingmagic running problem defining callback function. here code have it. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script src="https://clippingmagic.com/api/v1/clippingmagic.js" type="text/javascript"> </script> <script type="text/javascript"> var errorsarray = clippingmagic.initialize({apiid: ####}); if (errorsarray.length > 0) alert("sorry, browser missing required features: \n\n " + errorsarray.join("\n ")); clippingmagic.edit({ "image" : { "id" : ######, "secret" : "#############" } }, callback); </script> if has worked api , can me, appreciated. where defining callback variable? don't see callback resolve function you've defined. clippingmagic.edit({ "image

Implement Doctrine2 Caching with PHP Google App Engine? -

i know gae supports symfony: https://cloud.google.com/appengine/docs/php/symfony-hello-world , using doctrine2 without symfony. have read in doctrine docs not use arraycache in production, has else been able use memcache or apccache? based on http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html if set $isdevmode false when calling setup::createyamlmetadataconfiguration should automatically fall memcache on gae.

java - error trying to get errors with scala Try function -

i'm trying catch errors try , i'm getting error dont know why, code: class application extends controller { val ds: datasource = csvdatasource val purchaseds = purchaseinfo.fromdatasource(ds)_ def index = action { implicit request => ok(views.html.index()) } def redirecttoindex = action { redirect(routes.application.index) } case class csvuploaddata(clienturl: string) val csvuploadform = form( mapping( "clienturl" -> nonemptytext)(csvuploaddata.apply)(csvuploaddata.unapply)) def uploadcsv = action.async(parse.multipartformdata) { implicit request => csvuploadform.bindfromrequest.fold( formwitherrors => { future { redirect(routes.application.index).flashing( "error" -> formwitherrors.error("clienturl").get.message) } }, userdata => { request.body.file("csvfile").fold(future { redirect(routes.applic

Java exam prep - Recursion task -

this task: use recursion find 13th member of array every member multiplication of last 2 members minus second member. first 2 members 3 , 3. this came with: public class zadatak2 { int array[] = {3,3,0,0,0,0,0,0,0,0,0,0,0}; public zadatak2(){ find13(2); } public int find13(int index){ if (index == 13){ system.out.println("member 13: " + array[index-1]); return 0; } else{ array[index] = array[index-1] * array[index-2] - array[1]; system.out.println(index + " : " + array[index]); return find13(index + 1); } } } console output see index in array : value : 2 : 6 3 : 15 4 : 87 5 : 1302 6 : 113271 7 : 147478839 8 : 1947758222 9 : 465247871 10 : 818773103 11 : -459621106 12 : 383828239 member 13: 383828239 but pretty sure made mistake or there better solution. appreciated. as kevin w. said in comment, in future, "if want

c# - Refreshing an entire Linq to SQL DataContext -

i maintaining application in c# instantiates datacontext @ outset , uses throughout. finding when 1 user makes changes, changes not reflected on user's system when reload forms (it's winforms app). think root problem data being cached on second user's system due perpetually open datacontext. given application cannot rewritten use granular datacontexts (which correct solution), i'm looking @ refresh() method way work around problem. problem results want, refresh entire datacontext. obviously, that's not provided option, can effect? refresh() method cascade? thanks. you can use unitofwork pattern in scenario. perform action transaction.

swift - How to properly Pin in Parse localDataStore? -

i have parse.enablelocaldatastore() in app delegate before parse.setapplicationid then have var newposts = pfobject(classname: "post") global variable. then want 1,000 latest objects "post" table localdatastore enabled earlier this: var getnewposts = pfquery(classname: "post") getnewposts.fromlocaldatastore() getnewposts.limit = 1000 getnewposts.orderbydescending("createdat") getnewposts.findobjectsinbackgroundwithblock { (downloadedposts, error) -> void in if downloadedposts != nil && error == nil { println(downloadedposts) // getting table no data } } but empty data rows. if comment out getnewposts.fromlocaldatastore() line results fine. i understand missing critical pinning step not sure parse documentation hoe , implement it. can please help? you getting no data.... reasons be... wrong name of class (class names case sensitive) data not there in local storage try sy

Extract Text from Javascript thumbnails in Excel -

what trying take javascript hyperlink text in existing thumbnail, , extract 1 piece of information different cell. editing hyperlink or hovering on thumbnail shows this: javascript: copyexistingcampaign('1234567890'); i'd extract number using vba macro enabled function, called campnum() i'm having trouble turning thumbnail data in cell. i've seen on stackoverflow doing things like: function url(rg range) string dim hyper hyperlink set hyper = rg.hyperlinks.item(1) url = hyper.address end function and can use in worksheet, this: =url(b4) can me figure out how translate pulling number? i'm close, still far. ._______. piece calls out number in argument?

python - Scrapy Spider not Following Links -

i'm writing scrapy spider crawl today's nyt articles homepage, reason doesn't follow links. when instantiate link extractor in scrapy shell http://www.nytimes.com , extracts list of article urls le.extract_links(response) , can't crawl command ( scrapy crawl nyt -o out.json ) scrape homepage. i'm sort of @ wit's end. because homepage not yield article parse function? appreciated. from datetime import date import scrapy scrapy.contrib.spiders import rule scrapy.contrib.linkextractors import linkextractor ..items import newsarticle open('urls/debug/nyt.txt') debug_urls: debug_urls = debug_urls.readlines() open('urls/release/nyt

r - Error with durations created from a data.table using lubridate & dplyr -

i'm trying aggregate data stored in data.table , , create durations (from lubridate ) aggregated data. when try that, however, error. here's reproducible example: library(lubridate) library(data.table) library(dplyr) data(lakers) lakers.dt <- data.table(lakers, key = "player") durations <- lakers.dt %>% mutate(better.date = ymd(date)) %>% group_by(player) %>% summarize(min.date = min(better.date), max.date = max(better.date)) %>% mutate(duration = interval(min.date, max.date)) # source: local data table [371 x 4] # # player min.date max.date # 1 2008-10-28 2009-04-14 # 2 aaron brooks 2008-11-09 2009-04-03 # 3 aaron gray 2008-11-18 2008-11-18 # 4 acie law 2009-02-17 2009-02-17 # 5 adam morrison 2009-02-17 2009-04-12 # 6 al harrington 2008-12-16 2009-02-02 # 7 al horford 2009-02-17 2009-03-29 # 8 al jefferson 2008-12-14 2009-01-30 # 9 al thornton 2008-10-29 2009-04-05 # 10 alando tucker 2009

Azure Reserved IP Address Inconsistency -

i had need add additional public ip addresses azure vm , found working solution here: azure vm: more 1 public ip essentially creates reserved ip in azure , adds reserved ip cloud service. once it's bound cloud service can mapped vm endpoint. this works great there 1 bit don't understand - ip address of reserved ip , resultant vm endpoint don't match. have set dns point ip address of endpoint make work. there not doing right, or way reserved vms work? it looks unanswered question same issue: azure reserved ip vm diffrent given thanks! the "azure cloud service" container provides internet connectivity "azure vms". thus, assign internet facing public ip cloud service. article relatively @ explaining relationship: azure cloud services from above link: here’s definition of azure iaas cloud service make easy understand in context of azure infrastructure services: a cloud service network container can place virtual machines. all