Posts

Showing posts from June, 2015

windows - Can you set WindowTitle in Launch4j where headerType==console? -

windows - Can you set WindowTitle in Launch4j where headerType==console? - i have launch4j config headertype=console. console displays nicely console output. title of console window total path executable launcher. there way set title of window , if how? eg if create batch file start "this window title" mylauncher.exe then console window this window title title. how can configure launch4j batch file not required? as far know there no setting within launch4j that. there windowtitle option, docs gui only. instead, think have few options. i'm going assume using windows since using batch , exe files. options: modify source launch4j add together phone call win32 api function setconsoletitle . you'd want recompile consolehead part , rebuild executable. utilize dev-cpp compiling. there similar project called winrun4j has alternative configuring console title , uses method. maybe launch4j owners can add together feature if requested, woul...

java - In intelliJ 13 ultimate, how do you increase the compiler maximum heap size? -

java - In intelliJ 13 ultimate, how do you increase the compiler maximum heap size? - i upgraded intellij thought 13 11. there used box under setting/java compiler on ride compiler maximum heap size. no longer there. stopping me compiling project "gc overhead limit exceeded." can tell me alternative or viable alternative? , info helpful. thanks. file -> setting -> compiler build process heap size (mbytes) java intellij-idea

sql - 3146 ODBC Call Failed - Access 2010 -

sql - 3146 ODBC Call Failed - Access 2010 - please reference code below... private sub save_click() on error goto err_i9_menu dim dba database dim dba2 database dim rst recordset dim rst1 recordset dim rst2 recordset dim rst3 recordset dim sql string dim dateandtime string dim filesuffix string dim folder string dim strpathname string dim x integer x = instrrev(me!listcontents, "\") phone call myprocess(true) folder = dlookup("[folder]", "locaton", "[loc_id] = '" & forms!frmutility![site].value & "'") strpathname = "\\reman\plantreports\" & folder & "\hr\paperless\" dateandtime = getdatetime() if nz(listcontents, "") <> "" set dba = currentdb filesuffix = mid(me!listcontents, instrrev(me!listcontents, "."), 4) sql = "select extension tbl_forms type = 'i-9'" sql = sql &...

tableview - How to send didSelectRowAtIndexPath back to view controller in swift -

tableview - How to send didSelectRowAtIndexPath back to view controller in swift - i have 1 viewcontroller , 1 tableviewcontroller in swift. can send nsmutablearray viewcontroller populate tableviewcontroller using segue. not know how send selected row view controller. code far: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { println("you selected cell #\(indexpath.row)!") // missing code sending selected row self.dismissviewcontrolleranimated(true, completion: nil) } any ideas? you can utilize delegation pattern. create protocol: protocol mydatadelegate { didselectrow(row: nsindexpath, data: mydata) } in table controller, add together property: var mydatadelegate: mydatadelegate? and in didselectrowatindexpath phone call delegate method: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { println("you selected cell #\...

famo.us - How do you blur an image using the famous framework? -

famo.us - How do you blur an image using the famous framework? - how blur image in famous? css equivalent of -webkit-filter: blur(5px); . bonus points illustration of how within famous/angular combination. i hoping like: <fa-modifier fa-blur="5"> <fa-image-surface fa-image-url="coolimage.png" fa-size="[640,320]"> </fa-image-surface> </fa-modifier> after actions i'd love able animate blur "un-blurred". so far way i've found utilize css. <fa-image-surface class="{{blurclass}}" fa-image-url="coolimage.png" fa-size="[640,320]" fa-click="imageclick()"> </fa-image-surface> in controller $scope.blurclass = "blur-in"; // start no blur $scope.imageclick = function() { $scope.blurclass = "blur-out"; // animate blur } in .css .blur-out { -webkit-filter: blur(8px); -webkit-transition:...

Xcode - Push Notification Json -

Xcode - Push Notification Json - i send force notification app in json format containing custom data, don't know how extract info it, or if json format correct. ( think because parse sends successfully) json parse: { "aps": { "badge": 1, "alert": "test", "sound": "" }, "url": "http://www.google.com" } appdelegate: func application(application: uiapplication, didreceiveremotenotification userinfo: nsdictionary!) { var notificationpayload: nsdictionary = userinfo["url"] nsdictionary! if (notificationpayload["url"] != nil) { var url = notificationpayload["url"] string var feed: feedtableviewcontroller = navigation.viewcontrollers[0] feedtableviewcontroller feed.messages.append(url) feed.sections.append("url") }else { pfpush.handlepush(userinfo) } } try instead: ...

css - Update Embedded Resource at runtime -

css - Update Embedded Resource at runtime - in asp.net mvc application, want update css file or js file contents embedded within dll dynamically @ runtime without restarting application. the reason application huge 1 take more time restart. in development phase changes in js or css don't want rerun application , wait minutes. please provide solution asap. embedded resources compiled item within assembly , cannot modified in run time @ all. same cannot modify bytes (compiled source code) within assembly in run time. may need think different architecture application wont need update embedded resource @ runtime. by way, may find link useful: programmically embed resources in .net assembly css asp.net asp.net-mvc embedded-resource

Read a part of a string and count how many times it appears bellow in bash -

Read a part of a string and count how many times it appears bellow in bash - i have file this: userid1,username2,group1,other userid2,username2,group2,other userid3,username3,group1,other userid4,username4,group3,other what need count how many user in group1 , in group2 , etc. but problem don't know names of groups. need create variable each time found need grouping , increment +1 each time found grouping all-ready has variable. , using bash. you using awk: $ awk -f, '{++a[$3]}end{for(i in a)print a[i], "users in group", i}' file 2 users in grouping group1 1 users in grouping group2 1 users in grouping group3 -f, sets input field separator comma. 3rd field used key array a , separate counts kept each group. 1 time file has been processed, value each key reported. string bash file count

extjs - Sencha Architect not reflect with changes -

extjs - Sencha Architect not reflect with changes - i'm using sencha architect building sencha touch application. architect not reflect code changes in it. don't inquire me "this file has been modified program....do want reload it" does archtiect back upwards function ? how enable ? no, architect not back upwards feature. changes source code must done within sencha architect. even if seek edit files, first comment lines say: /* * file auto-generated each , everytime save project. * * not hand edit file. */ the reason when create changes code, architect changes construction in it's meta folder components , properties show in right places right seetings. editing hand may break functionality leaving project broken , unable loaded within architect. extjs sencha-architect

javascript - Getting an Uncaught TypeError in ChromeAPI.js on every page I load -

javascript - Getting an Uncaught TypeError in ChromeAPI.js on every page I load - every page load in chrome (version 38.0.2125.101) throws error in console: uncaught typeerror: cannot read property 'bind' of undefined (chromeapi.js:1) full stacktrace: uncaught typeerror: cannot read property 'bind' of undefined chromeapi.js:1 initapi chromeapi.js:1 (anonymous function) coreapi.js:1 q.execcb cajon.js:1 b.check cajon.js:1 (anonymous function) cajon.js:1 (anonymous function) cajon.js:1 (anonymous function) cajon.js:1 each cajon.js:1 b.emit cajon.js:1 b.check cajon.js:1 (anonymous function) cajon.js:1 (anonymous function) cajon.js:1 (anonymous function) cajon.js:1 each cajon.js:1 b.emit cajon.js:1 b.check cajon.js:1 b.enable cajon.js:1 b.init cajon.js:1 h cajon.js:1 q.completeload cajon.js:1 (anonymous function) cajon.js:1 n.onreadystatechange cajon.js:1 as suggest...

php - Loading a single file for all pages -

php - Loading a single file for all pages - i running apache webserver, goal have loader (in php) gets loaded urls. illustration if head website.com/test/, website.com/page.php or website.com/ load website.com/index.php how can accomplish this? you can create .htaccess file rewrite url not file or directory on server , redirect index.php file. additionally can have original url attached query string can work in script if need be. <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.*)$ index.php?$1 [l,qsa] </ifmodule> php apache

javascript - Using jQuery to rearrange page elements -

javascript - Using jQuery to rearrange page elements - i'm relatively new jquery , javascript, , think understand causing issue, i'm not sure how prepare it. i'm using simpleweather.js , moment.js, , moment.js timezone current time , weather 4 cities. have info want on page, want move each city's time sec paragraph in each city's div. ideas on how working current code or there more efficient way of producing result? http://jsfiddle.net/ljd144/p6tpvz1r/ here's js: $(document).ready(function () { $('.weather').each(function () { var city = $(this).attr("city"); var woeid = $(this).attr("woeid"); var degrees = $(this).attr("degrees"); var continent = $(this).attr("continent"); $.simpleweather({ zipcode: '', woeid: woeid, location: '', unit: degrees, success: function (weather) { ...

android - Switching appcompat & buildtools to v21, aapt.exe has stopped working -

android - Switching appcompat & buildtools to v21, aapt.exe has stopped working - i'm trying switch project api20 api21. when changing gradle files utilize appcompat-v7 com.android.support:appcompat-v7:21.0.0 , buildtoolsversion "21.0.0" windows error dialog popups saying aapt.exe has stopped working . download latest build tools 21.1.1 , work android android-studio

php - hwioauth Dynamic client_id Symfony2 -

php - hwioauth Dynamic client_id Symfony2 - i used hwioauthbundle , fosuerbunlde connect twitter, seek alter client_id , client_secret dynamic, , have thought overwrite service: hwi_oauth.abstract_resource_owner.oauth1, no execute overwrite : my service.yml : parameters: my_user_provider.class: wf\deckbundle\security\core\user\fosubuserprovider services: my_user_provider: class: "%my_user_provider.class%" #this place properties passed userprovider - see config.yml arguments: [@fos_user.user_manager,{twitter: twitterid }] arguments: [@doctrine.orm.entity_manager] security_handler: #este no es necesario class: company\bundle\handler\securityhandler arguments: [@router] test_service: class: wf\deckbundle\services\testservice arguments: ['@service_container'] deck_user_manager: class: wf\deckbundle\services\deckusermanager arguments: [@security.encoder_fact...

javascript - CSS3 radial gradient rendering in Google Chrome -

javascript - CSS3 radial gradient rendering in Google Chrome - i animating radial gradients jquery when noticed unusual (check out this jsfiddle). when mouse pointer moved on left side of element position animation smooth, when far right isn't smooth @ (notice jumps in position if move mouse enough). this feels kind of rounding error, i'm not sure why happens. ideas? have tested on google chrome time beingness , happens in horizontal direction. css html { background: #fff; } html, body { width: 100%; height: 100%; } body { background: #000; } javascript $('body').on('mousemove', function(event) { var x = event.pagex; var y = event.pagey; $(this).css('background', '-webkit-radial-gradient(' + x + 'px ' + y + 'px, transparent 10%, #000 5%)'); }); can replicate or happen me? edit: works fine in safari. i replicate it: it's said in this answer, it's not smooth because it...

c++ - Passing many variables from a function in one class to a function in another class -

c++ - Passing many variables from a function in one class to a function in another class - i creating chess engine using bitboards , have 2 classes: class board , class evaluation . there many variables in board class want pass function in evaluation class. class evaluates position of board , returns number. want pass bitboards class. around 15 in number , may increase. i creating object of evaluation class in board class , board class calling boardevaluation function. function want pass these bitboards. one way take 15 arguments in function want pass variables to. however, prefer not using approach since not sound appealing. is there other way pass many variables 1 class function in class? create class boarddata , utilize in both board , evaluation . responsibility of boarddata store 15 variables - , maybe provide basic operations on them. in way design simplified without circural depependencies. c++

javascript - How can I control an image's size -

javascript - How can I control an image's size - i skilled database / application programmer pc. ignorant html / javascript / web programmer. i creating documentation .net assemblies our intranet. ideally display image total size if browser window can fit it. if not cut down , toggle between little version , total size version click. dependency chart , can different sizes different pages. prefer single function handle beingness our utilize none of requirements mentioned set in stone. create work nil mandatory. i read lot of stuff couldn't find matched wanted. first tried (after few iterations): <img src='dependancy charts/rotairaorfq.png' width='100%' onclick='this.src="dependancy charts/rotairaorfq.png";this.width=this.naturalwidth;this.height=this.naturalheight;' ondblclick='this.src="dependancy charts/rotairaorfq.png";this.width="100%";'> it has problems. first off enlarges lit...

PERL graph query (GD::Graph) -

PERL graph query (GD::Graph) - i using illustration found online , editing see different options gd::graph module gives. code using. #!/usr/local/bin/perl -w # alter above line point perl binary utilize cgi ':standard'; utilize gd::graph::bars; utilize strict; # both arrays should same number of entries. @data = (["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], [23, 5, 2, 20, 11, 33, 7, 31, 77, 18, 65, 52]); $mygraph = gd::graph::bars->new(1000, 1000); $mygraph->set( x_label => 'month', y_label => 'number of hits', title => 'number of hits in each month in 2002', bgclr => 'black', ) or warn $mygraph->error; $myimage = $mygraph->plot(\@data) or die $mygraph->error; print "content-type: im...

pdo - Laravel using non-existent DB settings and failing with PDOException (1045). How? Why? -

pdo - Laravel using non-existent DB settings and failing with PDOException (1045). How? Why? - i'm starting aravel4 project needs connect pre-existing database. i've set env 'local' => array('*.dev') , , hitting project via http://my.project.dev/products. my app/config/database.php intentionally incomplete, , looks exactly this: 'mysql' => array( 'driver' => 'mysql', 'host' => '192.168.1.250', 'database' => '', 'username' => '', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => 'm3_', ), my app/config/local/database.php looks this: 'mysql' => array( 'driver' => 'mysql', 'host' => '192.168.1.250...

Workaround for getting variables from Selenium Server without using "Echo" or an additional langauge -

Workaround for getting variables from Selenium Server without using "Echo" or an additional langauge - our company sells testing suite able run selenium tests, among several other protocols. to utilize it, end user installs both our application , selenium server file. when users write test cases based on commands utilize in ide, every command works on selenium server, except echo command. apparently known limitation of selenium server, every ide command works except echo. this apparently intentional configuration: echo command not found while testing selenium phpunit we can't seem figure out way our application variables out of selenium server 1 time stored... since echo command works on ide returns error selenium server. there selenium server bindings several languages, not our application. since our application , selenium server beingness distributed end users in windows environment -- no 3rd party languages installed on systems default, java, c-sha...

command line - Driver class compilation error - hadoop Mapreduce -

command line - Driver class compilation error - hadoop Mapreduce - i have 3 .java file 1) mapper.java 2) reducer.java 3) driver.java i trying compile hadoop mapreduce programme @ command line using driver class showing below error driver.java:39: error: cannot find symbol job.setmapperclass(mapper.class); ^ symbol: class mapper location: class driver driver.java:40: error: cannot find symbol job.setreducerclass(reducer.class); how can solve above error.below run method in driver class public boolean runnerparsing(string inputpath, string outputpath) throws ioexception, classnotfoundexception, interruptedexception { configuration conf = new configuration(); job job = new job(conf, "parsing"); job.setjarbyclass(driver.class); job.setoutputkeyclass(text.class); job.setoutputvalueclass(text.class); job.setmapperclass(mapper.class); job.setreducerclass...

javascript - BBC EMP (Embedded Media Player) "Content appears not to be working..." -

javascript - BBC EMP (Embedded Media Player) "Content appears not to be working..." - background we have been embedding emp (http://news.bbc.co.uk/1/hi/help/7277283.stm) in quadrant on our bespoke mi wall boards months successfully. code uses div host iframe: <div id="emp1" class="player" style="float: left; width: 100%; height: 100%;"> <p>in order see content need have both <a href="http://www.bbc.co.uk/webwise/askbruce/articles/browse/java_1.shtml" title="bbc webwise article enabling javascript">javascript</a> enabled , <a href="http://www.bbc.co.uk/webwise/askbruce/articles/download/howdoidownloadflashplayer_1.shtml" title="bbc webwise article downloading">flash</a> installed. visit <a href="http://www.bbc.co.uk/webwise/">bbc&nbsp;webwise</a> total instructions</p> </div> and bunch of javascript populate it: ...

Release Management Server Installation Issue - object already exists -

Release Management Server Installation Issue - object already exists - i getting next error while configuring rm server: object exists in windows server 2008 r2 enterprise. please find log. i, 2014/10/29, 08:18:40.108, variable : key = defaultlogin, value = gap-release\builduser i, 2014/10/29, 08:18:40.124, variable : key = defaultadmin, value = gap-release\builduser i, 2014/10/29, 08:18:40.124, variable : key = databasename, value = releasemanagement i, 2014/10/29, 08:18:40.124, variable : key = defaultlocalservice, value = nt authority\local service i, 2014/10/29, 08:18:53.384, database releasemanagement, version 12.0.30723.0 installed successfully. i, 2014/10/29, 08:18:53.399, created release management database. e, 2014/10/29, 08:18:53.462, received exception : system.security.cryptography.cryptographicexception: object exists. @ system.security.cryptography.cryptographicexception.throwcryptographicexception(int32 hr) @ system.security.cryptography.utils._createcsp...

javascript - Removing event listeners -

javascript - Removing event listeners - i have canvas element in draw using webgl. depending on drawn adding event listener. now when redrawing canvas, want remove old event listener , add together new one. simply doing not work: canvas.removeeventlistener("click", function(event){ colorbarclicked(event, viewdata); }, false); canvas.addeventlistener("click", function(event){ colorbarclicked(event, viewdata); }, false); i think because colorbarclicked function has changed (maybe because parameters have different values?) , not matching old 1 want remove more. so problem each time redrawing event listeners added , hence doubled. colorbarclicked function depends on drawn in canvas, need alter it. you need remember function used when adding, , utilize same function 1 time again when removing:...

Accessing struct variables outside of function in C -

Accessing struct variables outside of function in C - i having problem understanding scope of variables within struct. example: struct class { const char *name; int hitdice, str_dice, dex_dice, con_dice, int_dice, wis_dice, cha_dice, skill_points, level; double bab_type; struct class *next_class; }; void setname() { struct class setname; setname.name = "thomas"; } int main() { } is variable *name set "thomas" within void setname()? how create if give value struct variable that value accessible globally. if print out variable name within int main() blank, how create print out "thomas"? or doable within function setname()? is variable name set "thomas" within void setname() ? yes. that's essence of how local variables work how create if give value struct variable that value accessible globally? make struct class setname; global declaring outside setname function. suggest giving different name - say, t...

Rails asset pipeline - referencing vendor/lib plugin manifest files from the application manifest files -

Rails asset pipeline - referencing vendor/lib plugin manifest files from the application manifest files - theory the rails guides can this http://guides.rubyonrails.org/asset_pipeline.html 2.2.2 using index files sprockets uses files named index (with relevant extensions) special purpose. for example, if have jquery library many modules, stored in lib/assets/library_name, file lib/assets/library_name/index.js serves manifest files in library. file include list of required files in order, or simple require_tree directive. the library whole can accessed in application manifest so: //= require library_name this simplifies maintenance , keeps things clean allowing related code grouped before inclusion elsewhere. error so i'm trying have manifest files plugin in vendor folder. it's not working, saying in browser couldn't find file 'multipurpose_bookshelf' code this originates application.js manifest ...

Is there a standard page size (data, in bytes) attribute that I can access via JavaScript? -

Is there a standard page size (data, in bytes) attribute that I can access via JavaScript? - i create accurate page loading bar on website. 1 way load single script page , handle requesting rest of resources via script, measuring bar as: the number of loaded resources / number of total resource requests and update bar's width each time new resource finished loading. this require me re-structure page's code though, , find people here know improve ways of doing things. save myself problem time: this similar question asked 5 years ago, , i'm unsure if reply still accurate is there standard built-in page size (data size, in bytes) attribute can access via javascript? i don't see how knowing current page size help know how big other unloaded elements are. , there's no way know size of other elements on server without asking server. can you read file size on server using server side language , build loading script dynamically? if other element...

db2 - Is it possible to obtain the actual values of a primary composite key with a SQL statement? -

db2 - Is it possible to obtain the actual values of a primary composite key with a SQL statement? - i have table named f0911 (jd edwards erp system) in db2 on as400. table has primary key, f0911_pk, defined composite of 7 columns: gldct, gldgj, gldoc, glextl, gljeln, glkco , gllt i trying replicate table bi application , go easier if obtain actual values of primary key, ideally statement like: select f0911_pk, [other columns] f0911 ... is such thing possible? guessing index values have been calculated , integers. possible @ raw values using sql statement? the primary key logical construct; there no "actual values of primary key", apart values in columns comprises. if mean key values of index backs primary key constraint, may or may not simple concatenation of binary representation of each column value; in case these values have no meaning or utilize outside physical construction of index file. db2

ios - Auto layout: changing a view's center x alignment programatically -

ios - Auto layout: changing a view's center x alignment programatically - i have image view x centered label above it. after tapping button, want image view x centered label. tried connecting constraint outlet , replacing new nslayoutconstraint (since cannot modify sec item) calling layoutifneeded on parent view, doesn't seem change. [self.tabsview layoutifneeded]; self.tabindicatorcenterxalignment = [nslayoutconstraint constraintwithitem:self.tabindicatoriv attribute:nslayoutattributecenterx relatedby:nslayoutrelationequal toitem:_tabsbtnarray[pagenumber] attribute:nslayoutattributecenterx multiplier:1.0 constant:0]; [uiview animatewithduration:0.5 animations: ^{ [self.tabsview layoutifneeded]; }]; ...

xcode - BMI calculator compiler error swift -

xcode - BMI calculator compiler error swift - var bmivalue = (weighttextfield*703)/(heighttextfield*heighttextfield) my error: cannot invoke '/' argument list of type '(($t5), ($t11))' i had made effort on making simple bmi calculator function have typed out brings compiler errors. can please help me. give thanks much. this solution , converts uitextfields text floats , assign bmi value float variable. var weight = (weightltextfield.text nsstring).floatvalue var height = (heighttextfield.text nsstring).floatvalue var bmivalue = (weight*703)/height hope helps . xcode swift

html - CSS Before Selector and Margin issues -

html - CSS Before Selector and Margin issues - i'm trying utilize before selector mimic behavior of list item when applied elements. can't utilize list items have able styles work. here fiddle showing issue: http://jsfiddle.net/7g6ncg7u/ .container { width:300px; } .up:before{ content:'\25b2'; color:green; padding-right:10px; margin:1px; } .down:before{ content:'\25bc'; color:red; padding-right:10px; margin:1px; } what want have happen 2nd line of 2nd span align text above it, not start of line presently doing. you can utilize float this: .down { clear:both; } .down:before{ content:'\25bc'; float:left; /**add this**/ color:red; padding-right:10px; margin:1px; } check snippet below class="snippet-code-css lang-css prettyprint-override"> .container { width: 300px; } .down { clear: both; } .up:before { content: '\25b2...

normalization - Deal with normalisation of a binary digit -

normalization - Deal with normalisation of a binary digit - binary 0010 0001 0110 (note: floating point 8 bit mantissa , 4 bits exponent) correctly represents 16 ½ not in normalised form. i need convert normalised form(start 01) 16.5. try mantissa: 0.1000010 exponent: 0010 moved 2 points exponent 2. but reply should 16.5 mantissa 0100 0010 , exponent 0101, going wrong 16.5 decimal 10000.1 binary. move binary-point right of leading 1 : 1.00001 exponent 4 exponents represented in "biased" form (instead of two's complement). 4 bits, bias should 7 . 4 + 7 = 11 , in binary 1011 . getting rid of leading 1 in significand (which assumed), putting 8 bits , putting after exponent yields: 1011 00001000 but unusual floating point representation have no sign bit. leading sign bit, 4 bit exponent , 7 bit significand becomes: 0 1011 0000100 normalization

python-style class variables in javascript -

python-style class variables in javascript - it can hard find these kinds of questions since can phrased many different ways, please forgive me if duplicate. i'd define class variables on backbone model in such way still available on instances. done so: var foo_base = { foo: bar }, foomodel = backbone.model.extend(foo_base, foo_base); but quite ugly involves feeding same object both instance , class prototype. there simpler way involves 1 utilize of foo_base or foo ? http://backbonejs.org/#model-extend backbone.model.extend(properties, [classproperties]) i unable understand why want send same object instance properties & classproperties. to create model without instance properties classproperties, can like var foo_base = { foo: bar }, foomodel = backbone.model.extend({}, foo_base); javascript class backbone.js

hadoop - How to store streaming data in cassandra -

hadoop - How to store streaming data in cassandra - i new in cassandra, confused.i know cassandra write speed fast.i want store twitter info coming storm.i googled, every time got create sstable , load cluster. if every time have create sstable how possible store twitter info streaming in cassandra. please help me. how can store log data, generated @ 1000log per second. please right me if wrong i think cassandra single node can handle 1000 logs per sec without mass loading if schema good. depends on size of each log. or utilize cassandra's copy csv command. for need create table first. here's illustration datastax website : create table airplanes ( name text primary key, manufacturer text, year int, mach float ); re-create airplanes (name, manufacturer, year, mach) 'temp.csv'; you need specify names of columns based on order in stored in csv. , values comma(,) enclose them in double quotes (") or utilize differe...

html5 - Paypal hybrid app -

html5 - Paypal hybrid app - i have managed integrate donate paypal button in cordova app: <form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_top'> ... </form> all works fine except when button pressed, new window appears , completly covers app webview making impossible user go app (the way killing app process), think bad user experience. things i've tried: target='_blank' : same result target='myiframename' : cross-domain problem post form via ajax , set result in div: form must calculated on fly error (with $http.put in ionic, haven't tried jquery) please, solution? the best 1 have paypal window within current webview not covering header, place back button there (something iframe solution work cross domain) placing link go in paypal donate page. haven't investigated deeper enought paypal plugin @ location: https://github.com/paypal/paypal-cordova-plugin. knows if work? (i...

python - Passing variables to templates in Django -

python - Passing variables to templates in Django - i have seen similar questions , answers none address problem. i want view perform user grouping check , pass via variable template. template utilize appear differently different user groups. my views.py: def cans(request): is_canner = request.user.groups.filter(name='canner') #check if user grouping = canner can_list = can.objects.order_by('name') context = {'can_list': can_list} homecoming render(request, 'cans/cans.html', context) #need homecoming is_canner variable here and in template utilize variable so: {% if is_canner %} canner stuff goes here {% endif %} i'm unsure how pass variable, thought used context send so: return render(request, 'cans/cans.html', context({"is_canner": is_canner})) but gives me errors - context not callable. context not function, argument render function, e.g. context = {"is_canner":...

android - Gigya SDK - Comments Plugin nicknames -

android - Gigya SDK - Comments Plugin nicknames - i'm having problems regarding gigya comments plugin @ mobile sdks. need display user nicknames instead default combination "firstname + lastname". did know how can alter user names displayed in gigya's comments plugin? i've tryed "templates" alternative might work in normal js phone call of module nil on mobile sdks. the gigya comments plug-in utilize user's "displayname" parameter if set. if not set, revert using "firstname lastname". if want user's nickname appear in comments plug-in, should ensure "displayname" parameter populated user's nickname. you can programmatically set user's diplayname when login if empty, making phone call accounts.setaccountinfo sets displayname nickname. as long displayname has value on account, used plugin. there no other logic perspective of gigya comments plugin should need, since handled info ...

c# - How to customize error message of OAuthAuthorizationServerProvider? -

c# - How to customize error message of OAuthAuthorizationServerProvider? - we using oauthauthorizationserverprovider class authorization in our asp.net web api app. if provided username , password invalid in grantresourceownercredentials , call context.seterror( "invalid_grant", "the user name or password incorrect." ); produces next json result: { "error": "invalid_grant", "error_description": "the user name or password incorrect." } is there way customize error result? create consistent default error message format used in other parts of api: { "message": "some error occurred." } is possible accomplish oauthauthorizationserverprovider ? this how did it. string jsonstring = "{\"message\": \"some error occurred.\"}"; // work around overcome unknown internal bug. // in future releases of owin, may remove this. context.seterror...

javascript - find target's target i.e friend of friend in force directed graph -

javascript - find target's target i.e friend of friend in force directed graph - i using d3.js libraries forcefulness directed graph, i using next code find target nodes graph.links.foreach(function(d) { linkedbyindex[d.source.index + "," + d.target.index] = 1; linkedbyindex[d.target.index + "," + d.source.index] = 1; }); }); function neighboring(a, b) { homecoming a.index == b.index || linkedbyindex[a.index + "," + b.index]; } how can find , highlight target's target ? can help me ? edit: solved problem in next way: first created adjacent matrix: var adjmat=null; var adjmatsq=null; adjmat=new array(graph.nodes.length); for(var = 0;i < graph.nodes.length; ++i) { adjmat[i]=new array(graph.nodes.length); for(var j = 0; j < graph.nodes.length; ++j) { adjmat[i][j] = 0; }...

symfony2 - SF2 - Sonata: How to get parameter from parameter.yml in entity -

symfony2 - SF2 - Sonata: How to get parameter from parameter.yml in entity - i used sonata admin bundle. how can create entity engage parameters.yml to? either straight or via service .... i have tidying work in postremove, need here disclosures paths, access info , more. not write hard entitiy, parameters.yml pick from. timo entity class not place putting business logic. far know can't define entity service. what want should solved creating event listener can define service , pass value parameters.yml . listener should hear on postremove event. your services.yml : services: service_name: class: acme\your\listenerclass arguments: [%your_parameter_from_yml%] tags: - { name: doctrine.event_listener, event: postremove } your listenerclass: class listenerclass { public function __construct($your_param_from_parameters) { $this->param = $your_param_from_parameters } /** * @param lifecycleeventargs $arg...

serialization - What local-storage tooling does WebSharper provide? -

serialization - What local-storage tooling does WebSharper provide? - in looking @ documentation websharper's local storage, setitem item string * string -> unit (and getitem string -> string ). this means i'll need convert want store strings , reverse retrieve them. or, set in way, i'll need serialize , de-serialize them. there way utilize behind-the-scenes conversion websharper rpc calls, or stuck using server-side library fspicker? not built in yet, have been using helper module create local storage usable same way ref cell: open intellifactory.websharper // helper handling localstorage, making stored value work ref cell. [<javascript; autoopen>] module localstorage = open intellifactory.websharper.html5 allow localstorage = window.self.localstorage type ivalue<'t> = abstract value: 't get, set allow [<inline>] ( ! ) (x: ivalue<_>) = x.value allow [<inline>] ( := ) (x: iv...

uitableview - Indentation of UITableViewCell changes after rotation only on iOS 8 -

uitableview - Indentation of UITableViewCell changes after rotation only on iOS 8 - i have uitableview 3 dynamic rows. when displaying uitableviewcontroller first time works fine. after rotation rows have info in indentation despite set setlayoutmargins zero. cannot reproduce issue in project until now. appearing in ios 8 but on 1 table. same source table working in test project without problems. difference here is in container other views. i checked auto layout constraints, rotation methods, commented things out - without success. alter of indentation occurs between willrotatetointerfaceorientation , didrotatetointerfaceorientation or after viewwilltransitiontosize . updated ios 8.1 same results. has expeerienced similar behavior? ps: i've noticed when setting layout margins 0 on ios 8 animation not smooth default values (with indentation). on ios 7 animation smooth. edit: i tracked things down. if uitableviewcontroller embedded uinavigationcontroller inde...

mysql - Does creating an index on two columns x and y makes queries faster when searching on column x only? -

mysql - Does creating an index on two columns x and y makes queries faster when searching on column x only? - does creating index on 2 columns 'x' , 'y' makes queries faster when searching on column x only? illustration have table columns 'id', 'x' , 'y'. , have 2 questions: when create 2 separate indexes 'x' , 'y', help (make things faster) query this: select * `table` x=1 , y=2 ? believe not. not sure. when create 1 index on 2 colums 'x' , 'y' help query like: select * `table` x=1 ? is, searching on 1 of these columns. it might speed query. there exists feature called "index merge", can merge 2 separate indexes fulfill needs of 1 query. explain show if used. if not, 1 must add together combined index. when 2 indexes can merged depends heavily on used mysql version. whereas 5.1 not , ignored (a lot?) cases, feature more mutual used in e.g. version 5.6. this depends o...

javascript - Angular: Filter Multiple Items -

javascript - Angular: Filter Multiple Items - i'm new angular , i'm having issues filtering function. first of all, content getting pulled in json file. pretty simple: [ { "id":"0", "animal":"cat", "breed":"siamese", "name":"kevin", "photo": "/images/kevin.jpg" }, { "id":"1", "animal":"dog", "breed":"pug", "name":"barney", "photo": "/images/barney.jpg" } ] and forth. html on page. nav points come own json files have nil data, meant create menus , pass value: <ul> <li ng-repeat="item in animal_data"> <a href="" ng-click="filterdata(item.animal)">{{item.animal | uppercase}}</a> </li> </ul> <ul> <li ng-repeat="item in breed_data...

Does PayPal Standard automatically retry to charge the client if a payment fails? -

Does PayPal Standard automatically retry to charge the client if a payment fails? - i have integrate paypal standard payments in saas monthly subscription. i found few tips in paypal documentation using api it's not case. if after few months payment fails because client has no money, automatically retry charge client in next days or should set custom field? there variable sra when set 1 , paypal seek collect payment 2 more times before canceling subscription. more info on recurring payments reattempts how paypal reattempts failed recurring payments paypal reattempts collect recurring payments 3 days after day on recurring payments fail. if first reattempt collect recurring payment fails, paypal waits 5 days reattempt sec time. if sec reattempt fails, paypal cancels subscription. paypal paypal-subscriptions

Calculation the difference between 2 dates in SQL Server and DB2 -

Calculation the difference between 2 dates in SQL Server and DB2 - i know there lot ways calculate difference between dates in different databases. problem need way that work in both sql server , db2 using same sql query. on yearly basis can use current_timestamp - [birthdate] agethisyear but want know persons age in decimal form i.e. 34,4 depending on persons birthday , current date. in sql server columntype [birthdate] datetime , in db2 column type date . the format yyyy-mm-dd is there way this? regards, alfred i think way can write function work in both databases utilize year() , month() , , day() , or write functions yourself. there not much overlap in date functions between 2 databases. for instance, total years between 2 dates, use: select (year(current_timestamp) - year(birthdate) + (case when month(current_timestamp) * 100 + day(current_timestamp) < month(birthdate) * 100 + day(birthdate) -1 else ...

virtual destructor in c++ -

virtual destructor in c++ - in code below, why ~derived() destructor called automatically? #include<iostream> using namespace std; class base of operations { public: virtual ~base() { cout << "calling ~base()" << endl; } }; class derived: public base of operations { private: int* m_pnarray; public: derived(int nlength) { m_pnarray = new int[nlength]; } virtual ~derived() { cout << "calling ~derived()" << endl; delete[] m_pnarray; } }; int main() { derived *pderived = new derived(5); base of operations *pbase = pderived; delete pbase; homecoming 0; } because base of operations class destructor virtual virtual ~base(); the phone call delete on pointer base of operations class results in virtual phone call destructor , virtual phone call dispatched matching function in derived class. not good, necessary: otherwise be...

ssl - Error: Could not run: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A -

ssl - Error: Could not run: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A - i trying re-create current puppet master server on 1 domain , move another. im finding hard seek alter config remanence. there easy way this, or step step best practice? have grepped of old fqdn name , changed new one, yet when delete certs, , re-issue new ones on master, wants maintain pulling cert old fqdn. edit 1: have resolved many of issues getting. can not past ssl issue life of me. [root@puppet lib]# puppet resource service apache2 ensure=running error: not run: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed: [unable local issuer certificate /cn=puppet.foundry.test] i have attempted purge certs master, using link, , regenerate all. still maintain getting same errors: error: not run: ssl_connect syscall returned=5 errno=0 state=sslv3 read finished now im not sure if having puppet ssl issues, or ssl issues in gene...

php - Fetch html content from different domain which is injectedt by javascript -

php - Fetch html content from different domain which is injectedt by javascript - it possible fetch html content domain in php via "file_get_contents" or curl e.g. http://davidwalsh.name/curl-download . how can fetch when dom elements injected via javascript? and if not possible on server level, although have no experience in selenium, , guess: can somehow utilize selenium (+rc?) on local machine , access webpage 3rd party domain? -i should add together elements seem added onload , not bounded triggers. if wanna on server-side, simply $contents = file_get_contents('url page'); echo $contents; if wanna on client-side $.ajax({ 'url' : 'url here', 'type' : 'get', 'success' : function(data) { $("#contents").html(data); } }); note: client-side work if the appropriate access command origin headers sent (most websites don't allow them) javascript...

java - Access H2 Database from application contained in a JAR File -

java - Access H2 Database from application contained in a JAR File - i have application uses h2 database , next connection string: connection connection = drivermanager.getconnection("jdbc:h2:file:data/sample", "sa", ""); it works quite under eclipse, if bundle java desktop application in jar file, cannot find h2 database in data/sample more. here running directory: application.jar info | sample.h2.db and here how seek execute application: java -classpath .; -jar application.jar a sqlexception raised no tables found. hint how have connection running eclipse , within jar file ? please note requirement should not utilize absolute path database relative path, because database folders unzipped along jar files application installer. there possible causes of error can think : the database empty. might have populate when building application under eclipse when launching jar file, nail empty 1 : command using h2 cons...

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates -

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates - using c# selenium 2.39 , before, able interact chromeoptions , desiredcapabilities directly. so, if wanted emulate android device on modern version of windows, code snippet might this: // define chromeoptions create chrome deed mobile device chromeoptions options = new chromeoptions(); options.addargument("--user-agent=mozilla/5.0 (linux; android 4.0.4; galaxy nexus build/imm76b) applewebkit/535.19 (khtml, gecko) chrome/18.0.1025.133 mobile safari/535.19"); options.addargument("--disable-sync-passwords"); capabilities = desiredcapabilities.chrome(); //needed find win7 vm rather linux or mac capabilities.setcapability("platform", "vista"); //cef apps tested using selenium2 , grid. //a version of "real" has ...

Pass PHP Variable into WHERE/AND MySQL Query -

Pass PHP Variable into WHERE/AND MySQL Query - i'm trying pass value query takes in variable before sql query , compares result against field table. can't seem figure out syntax. $topname = $row_rsadmindetails['fullname'] ; $testquerytwo = "select * participants, admin admin.over_id = participants.fk_over_id , participants.dr_over_names '%$topname%'"; $testresult2 = mysql_query($testquerytwo) or die(mysql_error()); the php output i'm looking do: <?php // print out contents of each row while($row_testresulttwo = mysql_fetch_array($testresulttwo)){ echo $row_testresulttwo['username']. " - ". $row_testresulttwo['participant_name']; echo "<br />"; } ?> problem on line: while($row_testresulttwo = mysql_fetch_array($testresulttwo)){ should while($row_testresulttwo = mysql_fetch_array($testresult2)){ // have no $testresulttwo variab...

c# - Queryhistory for a range of changeset in TFS for specific info -

c# - Queryhistory for a range of changeset in TFS for specific info - i trying utilize c# , tfs release log out of comments of changesets in tfs. i have code: const string tfsurl = "http://dev.ger.test.com:8080/tfs"; var tpc = new tfsteamprojectcollection(new uri(tfsurl)); versioncontrolserver vcs = (versioncontrolserver)tpc.getservice(typeof(versioncontrolserver)); var tp = vcs.getteamproject(@"mycollection"); var path = tp.serveritem; path += @"/project/subproject"; var q = vcs.queryhistory(path, versionspec.latest, 0, recursiontype.full, null, null, null, 1, true, true, false, false); foreach (var item in q) { console.writeline(item); logger(item.tostring(), false); } which works, returns latest changeset , info within changeset. so questions are: how specify range of changeset in queryhistory versionspec.1000 versionspec.lates...

bluemix - Watson api using node.js -

bluemix - Watson api using node.js - i trying utilize node.js code utilize watson api in ibm cloud bluemix in our ios app. can tell me code doing , provide reply how utilize watson service our app. var express = require('express'); var https = require('https'); var url = require('url'); // setup middleware var app = express(); app.use(express.errorhandler()); app.use(express.urlencoded()); // back upwards url-encoded bodies app.use(app.router); app.use(express.static(__dirname + '/public')); //setup static public directory app.set('view engine', 'jade'); app.set('views', __dirname + '/views'); //optional since express defaults cwd/views // there many useful environment variables available in process.env. // vcap_application contains useful info deployed application. var appinfo = json.parse(process.env.vcap_application || "{}"); // todo: application info , utilize in app. // defaults dev ou...

named query - How can I use JPQL in a NamedQuery to cerate an entity having a calculated transient attribute? -

named query - How can I use JPQL in a NamedQuery to cerate an entity having a calculated transient attribute? - i have sql statement: select x.speed, (6371 * acos(cos(radians(16.65555))) * cos(radians(latitude)) * cos(radians(longitude) - radians(54.55555)) + sin(radians(16.65555)) * sin(radians(latitude))) dist my_table x having dist <= 50 order dist how can set namedquery within java entity class in way calculated value set entity transient attribute called distance? for time beingness have tried this: select vsle, (:distance_unit * func('acos', func('cos', func('radians', :latitude)) * func('cos', func('radians', vsle.geoposition.latitude)) * func('cos', func('radians', vsle.geoposition.longitude) - func('radians', :longitude)) + func('sin', func('radians', :latitude)) * func('sin', func('radians',...

rails console fails to find installed gem -

rails console fails to find installed gem - $ bundle install |grep chunk using chunky_png 1.3.3 $ rails c not find chunky_png-1.3.3 in of sources run `bundle install` install missing gems. i've tried removing gems rvm gemset , re-running bundle twice, doesn't help. ideas? this on ubuntu 13.10 machine. same code base of operations on mac osx machine works fine. usually, happens because bundler , rails running different versions of ruby. check, run bundle env , rails runner 'puts ruby_version' . if doesn't solve it, please add together output of both question. ruby-on-rails ruby-on-rails-4 bundler

JavaScript closure inside loops – simple practical example -

JavaScript closure inside loops – simple practical example - var funcs = []; (var = 0; < 3; i++) { // let's create 3 functions funcs[i] = function() { // , store them in funcs console.log("my value: " + i); // each should log value. }; } (var j = 0; j < 3; j++) { funcs[j](); // , let's run each 1 see } it outputs this: my value: 3 value: 3 value: 3 whereas i'd output: my value: 0 value: 1 value: 2 what's solution basic problem? well, problem variable i , within each of anonymous functions, bound same variable outside of function. what want bind variable within each function separate, unchanging value outside of function: var funcs = []; function createfunc(i) { homecoming function() { console.log("my value: " + i); }; } (var = 0; < 3; i++) { funcs[i] = createfunc(i); } (var j = 0; j < 3; j++) { funcs[j](); ...