Posts

Showing posts from March, 2015

jquery - JavaScript Calculate total price of items -

please me type total price of selected items. here jsfiddle <section id="items"> <div class="item">monitor <span class="price">100$</span></div> <div class="item">mouse <span class="price">20$</span></div> <div class="item">keyboard <span class="price">60$</span></div> </section> <section id="basket"> <p>total price:<span class="total_price"></span></p> </section>` check demo var total = 0; $("#items").on('click', ".item", function() { $(this).appendto("#basket"); gettotal() }); $("#basket").on('click', ".item", function() { $(this).appendto("#items"); gettotal() }); function gettotal(){ total = 0;

javascript - 'Range.detach' error at injecting loopback angular sdk -

i have automatically created services library loopback angular sdk when call angular app keeps in blank page , in javascript console have next error: "'range.detach' no-op, per dom ( http://dom.spec.whatwg.org/#dom-range-detach )." take @ link .it addresses similar error , discusses fix related github page.

aql - Arangodb removing subitems from document -

how 1 remove subitems document. have document called sales each sale has sale.item contains {name,price,code}. i want remove each item not valid, checking code blank or null. trying below fails errors, not sure if need use sub-query , how. for sale in sales item in sale.items filter item.code == "" remove item in sale.items another attempt for sale in sales let invalid = ( item in sale.items filter item.code == "" return item ) remove invalid in sale.items let removed = old return removed the following query rebuild items each document in sales . keep item code not null , not empty string: for doc in sales let newitems = ( item in doc.items filter item.code != null && item.code != '' return item ) update doc { items: newitems } in sales here test data used: db.sales.insert({ items: [ { code: null, what: "delete-me" }, { code: &quo

javascript - Pass variable to .txt file -

i trying pass variable html form .php script , .php script .txt file variable value stored. problem is, when test scripts instead of posting variable number posts variable name "numbervariable". html/javascript <form id="payment-form" action="chargecard.php" method="post" name="payment-form"> <input onkeypress="return isnumberkey(event)" type="text" name="amount" id="amount" /> <input type="hidden" id="numbervariable" name="numbervariable" value="numbervariable"/> <!--this try pass variable .php script--> <input type="image" src="button1.png" id="custombutton" value="pay" alt="button"/> </form> <script type="text/javascript">

ruby - How do I make sure that gems get installed in the correct location? -

setup fresh ubuntu 14.04.2 lts install (in hyperv snapshot first reboot) sudo apt-get update official rvm install both single , multi-user rvm install [ruby] 2.1 , 2.2 separately (on fresh installs) gem_home: /home/me/.rvm/gems/ruby-2.2.1 (for 2.2 install) pre gem update gem location example: /home/me/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.4 post gem update gem location example: /home/me/.rvm/gems/ruby-2.2.1/gems/bundler-1.9.2 after first gem update --system , gem update attempt gem clean always ends errors updated gems' previous versions not installed in gem_home. everything else i've tested rvm/ruby setup functioning (single or multiuser installs).

regex - How to find which group is matched in NSRegularExpression -

i have regex statement multiple capture groups separated | operator. how can find out capture group matched? way can think of -for example- counting number of characters if matched. var string = "1234567897" var pattern = "(^\\d{9}$)|(^\\d{10}$)|(^\\d{13}$)|(^[a-za-z]{2}\\d{9}[a-za-z]{2}$)" var myregex = nsregularexpression(pattern: pattern, options: nil, error: nil)! if let mymatch = myregex.firstmatchinstring(string, options: nil, range: nsrange(location: 0, length: string.utf16count)) { println((string nsstring).substringwithrange(mymatch.rangeatindex(0))) } i wrote code worked example. sure can written better way works now. swift 2.3 var string = "123456789" var pattern = "(^\\d{9}$)|(^\\d{10}$)|(^\\d{13}$)|(^[a-za-z]{2}\\d{9}[ww]{2}$)" var myregex = try! nsregularexpression(pattern: pattern, options: []) if let mymatch = myregex.firstmatchinstring(string, options: nsmatchingoptions.init(rawvalue: 0), range

jsf - All tabs of tabpanel refreshed, when event happens in any one of the tab (Richface 3.3.4) -

we have tabpanel has multiple tabs. when event performed in of tabs (e.g. click 'ajaxsubmit' button in tab1) tabs refreshed causing performance issues (e.g. getter of 'table' value invoked tab3). we tried wrap content of each tab in <a4j:region> , getters of components in tab3 still invoked. please find sample code snippet below: <r:tabpanel id="tabworkingpanel" styleclass="ottmcontainer" selectedtab="#{tabhandlerbean.activetab}"> <rich:tab id="tab1"> <h:commandbutton value="ajaxsubmit"/> </rich:tab> <rich:tab id="tab2" /> <rich:tab id="tab3"> <rich:datatable id="table" value="#{bean.somevalue}">...</rich:datatable> </rich:tab> </r:tabpanel> i think should using rerender relevant tabs refreshed. think should wrap contents of each tab in form not submitted on ea

ruby - Converting JSON hash into URL to be used in rails view -

i using api has url in response (a json hash). i'm trying take response, parse url , use url in link_to helper in rails view. current json parsing isn't doing trick. # response {"url":"https://demo.foobar.net/t=54e85a9f-008b-481c-986d-69881208713e"} # controller action parse @url = json.parse(response.to_json) # rails view <%= link_to "sign document", @url %> # rendered html <a href="/?url=https%3a%2f%2fhttps://demo.foobar.net/t=54e85a9f-008b-481c-986d-69881208713e">click here!</a> i need parse json hash ensure output of rails link_to helper is: <a href="https://demo.foobar.net/t=54e85a9f-008b-481c-986d69881208713e">click here!</a> why converting response json , parsing again. u can value of url @url = response["url"]

ruby on rails - ActiveMerchant Get Braintree ClientToken -

i trying use activemerchant braintree dropin ui , unable find correct methods create client token pass javascript sdk. current setup is: # config/environments/development.rb # activemerchant configuration. activemerchant::billing::base.mode = :test config.gateway = activemerchant::billing::braintreegateway.new( merchant_id: '', public_key: '', private_key: '' ) and have controller needs send client token part of api request: # app/controllers/v1/orders_controller.rb def token @client_token = ...generate client token... respond_with @client_token end i don't know how generate token through activemerchant api. i work @ braintree. if have more questions, suggest email our support team . activemerchant isn't compatible v.zero. use drop-in ui or other v.zero features, you'll need use braintree ruby client library directly. see braintree "getting started" guide instructions.

angularjs - ng-show not working with ng-repeat -

i have variable set true in ng-click div underneath not displaying. i've followed this post looks doesnt work in maybe ng-repeat ? here's plunker: http://plnkr.co/edit/90g1kax9fmf2sgrs5gyk?p=preview angular.module('myappapp', []) .controller('mainctrl', function ($scope) { $scope.notes = [{ id: 1, label: 'first note', done: false, somerandom: 31431 }, { id: 2, label: 'second note', done: false }, { id: 3, label: 'finished third note', done: true }]; $scope.reach= function (id) { //the assignment below works //$scope.flag = true; alert("hello there"); }; }); <div ng-app="myappapp"> <div ng-controller="mainctrl"> <div ng-repeat="note in notes">

How can i get all the list of directories and files in a drive in java. (All files in C:\) -

i writing gui program java fx. user can choose directory in system. unfortunately, directory chooser let user choose drive too. can list out files , folders in directory using file.listfiles(). happens if user choose drive. listfiles() failing there null pointer exception. is there way can list of files , directories in drive in java? //get files user computer public void getfilenames(file folder) { (final file file : folder.listfiles()) { if (file.isdirectory()) { getfilenames(file); } else { if (filenameutils.isextension(file.getname().tolowercase(), videoformatset)) { //don't consider video files less 100 mb final long filesizeinmb = file.length() / 1048576; if (filesizeinmb < 100) { continue; } final string filename = filenameutils.removeextension(file.getname());

My virtualenv does not work after installing zsh -

i installed zsh, oh-my-zsh. , made zsh default shell. when try activate virtualenv source bin/activate there no effect. mean no errors , not in virtual environment. entered earlier bash shell , tried activating did not help? updated when create new virtualenv works well. how can activate older ones?

matrix - How to get the Q from the QR factorization output? -

dgeqrf , sgeqrf lapack return q part of qr factorization in packed format. unpacking seems require o(k^3) steps (k low-rank products), , doesn't seem straightforward. plus, numerical stability of doing k sequential multiplications unclear me. does lapack include subroutine unpacking q, , if not, how should it? yes, lapack indeed offers routine retrieve q elementary reflectors (i.e. part of data returned dgeqrf), called dorgqr . describtion: * dorgqr generates m-by-n real matrix q orthonormal columns, * defined first n columns of product of k elementary * reflectors of order m * * q = h(1) h(2) . . . h(k) * returned dgeqrf. a complete calculation of q , r a using c -wrapper lapacke (a fortran adaption should straight forward) : void qr( double* const _q, double* const _r, double* const _a, const size_t _m, const size_t _n) { // maximal rank used lapacke const size_t rank = std::min(_m, _n); // tmp array lapacke const std::uni

comparing python datetime to mysql datetime -

i'm complete beginner, have test mysql db set up. trying check if backup start time listed in database before 12pm on current day. time entered table using following: update clients set backup_started=now() id=1; what trying is: now = datetime.datetime.now() today12am = now.replace(hour=0, minute=0, second =0,) dbu.cursor.execute('select id, company_name, backup_started,\ backup_finished clients backup_started>' + today12am) data = dbu.cursor.fetchone() print (data) i understand trying compare datetime.datetime string , having problems. question best way accomplish this? error: typeerror: cannot concatenate 'str' , 'datetime.datetime' objects make query parameterized : dbu.cursor.execute(""" select id, company_name, backup_started, backup_finished clients backup_started > %s""", (today12pm, ))

c# - URL Extension in MVC 4 Not working after update -

i've updated mvc 3 mvc 4 however url extension methods not binding. not seems think url has method psurl() . still in same name space.. method: public static string psurl(this urlhelper url) view: @url.psurl() does mvc4 have different way of extending? cant seem find on it. the updates must have removed name space views web.config (note: there 2 web.configs, check 1 inside views folder!) re-adding line use extensions, resolves again. <pages pagebasetype="system.web.mvc.webviewpage"> <namespaces> <add namespace="myproject.extensions" />

'npm install' extremely slow on Windows -

for me npm install extremely slow. i'm using windows 8.1 latest npm version. connection speed around 100mbit/s. the project i'm trying install has around 20 packages/dependencies , takes around 30 minutes install dependencies ... does have clue? i've been facing same issue while. trying out following npm typescript live-server --save-dev the install stuck @ forever. adding -verbose flag worked fine.

java - JBPM6: How to resume a process from the last successful node after the server crash? -

i'm trying implement failover strategy when executing jbpm6 processes. setup following: i'm using jbpm6.2.0-final (latest stable release) persistence enabled i'm constructing instance of org.kie.spring.factorybeans.runtimemanagerfactorybean type singleton ksession start/abort processes , complete/abort work items all beans wired spring 3.2 db2 used database engine i use tomcat 7.0.27 in positive scenario working expect. know how resume process in case of server crash. reproduce started process (described bpmn2 file), got @ middle step , killed tomcat process. after see uncompleted process instance in process_instance_info table , uncompleted work item in work_item_info table. there session in session_info table. my question is: show me example of code take remaining process , resume starting last node (if possible). update forgot mention i'm not using jbpm-console, i'm embedding jbpm javaee application. if initialize runtimemanager on

regex - Pattern matching for strings independent from symbols -

i have need algorithm can find pre-defined patterns in data (which present in form of strings) independent actual symbols/characters of data , pattern. care relations between symbols, not symbols themselves. legal have different pattern symbols same symbol in data. thing pattern matching algorithm has enforce multiple occurences of same symbol in pattern preserved. give example: the pattern abca , first , last letter same. application, equivalent way write 1 2 3 1 , digits variables. data have thistextisatest . resulting algorithm should give me 2 correct matches here, text , test . because in these 2 cases, first , fourth letter same, in pattern. as second example, pattern abcd should return 12 matches (one each position in thistextisat). since no variable in pattern repeated, trivially matched everywhere. in case of text , test , because legal variables a , d of pattern map same symbol. the goal of algorithm should detect similarities in written language. imagine havin

Output hash-table without @{var=...} when parsing .xml files in Powershell -

i'm new powershell, , trying parse .xml file using code below: [xml] $alloc_macro = get-content ".\allocation_macro.xml" $newlist = @() foreach ($layer1 in $alloc_macro.dmob.module.macro.block[4].block) { $condition = ($layer1 | select condition) foreach ($layer2 in $layer1.for) { $var = ($layer2 | select var) $in = ($layer2 | select in) $newlist += new-object -typename psobject -property @{ condition = $condition; var = $var; in = $in } } } $newlist here's result: condition var in --------- --- -- @{condition=@[allocationflag]} @{var=allocationnumber} @{in=*[eq](##personalnonpersonal##,"personal",@[a... @{condition=*[not](@[allocationflag])} my question is, can this: con

sapui5 - How can I add onfocus() functionality in text field in sap ui5 instead of liveChange() -

how can add onfocus() functionality in text field in sap ui5 instead of livechange(), have tried using onfocusin(), not working, suggest more functionalities. use attachbrowserevent method: oyourtextcontrol.attachbrowserevent("onfocus", function(oevent) { // whatever }); https://openui5.hana.ondemand.com/#docs/api/symbols/sap.ui.core.control.html#attachbrowserevent

javascript - Keeping slideshow on top with page below visible -

i have pretty big intranet site @ work, there detailed work descriptions. there links in procedure bring pics, , i'm using highslide. default behavior bring gallery , dim background. when click outside gallery closes. of users keep gallery up, on top can follow procedure. of keep having bring gallery up. have pop on section of page pops modal html in it(i have calculators popping up). behaviors of these stay on top of page until close them. i'd same behavior gallery, possible? a highslide gallery/image can stay open highslide html popup. need do, removing hs.dimmingopacity setting gallery. since haven't seen page, can't tell find setting in gallery setup.

ios - NSUserDefaults in App Groups Not Working -

i trying use app groups entitlement in app nsuserdefaults handling data between iphone app , watchkit extension. i went capabilities in iphone target, , turned on app groups, , made sure group.com.316apps.iprayed selected. went watchkit extension target , did same capabilities. on iphone side of app put in following code: pfuser *me2 = [pfuser currentuser]; nslog(@"username%@", me2.username); nsuserdefaults *testdefaults = [[nsuserdefaults alloc] initwithsuitename:@"group.com.316apps.iprayed"]; [testdefaults setobject:me2.username forkey:@"username"]; [testdefaults setobject:me2.password forkey:@"password"]; [testdefaults synchronize]; in watchkit interfacecontroller, have following, nslog shows 'null' nsuserdefaults *testdefaults = [[nsuserdefaults alloc] initwithsuitename:@"group.com.316apps.iprayed"]; nsstring *theiruser = [testdefaults objectforkey:@"us

Android - Application crashes with Out Of Memory when selecting very large image -

this question has answer here: strange out of memory issue while loading image bitmap object 39 answers in below code, getting exception "out of memory on byte allocation" large size images in function "getscaledbitmap" when processing decodefile second time in code. below function being called 4 times, processing 4 different images on screen. please guide on this. private bitmap processimage(string picturepath){ bitmap thumbnail =null; thumbnail=getscaledbitmap(picturepath,500,500); matrix matrix = null; try { exifinterface exif = new exifinterface(picturepath); int rotation = exif.getattributeint(exifinterface.tag_orientation, exifinterface.orientation_normal); int rotationindegrees = bal.exiftodegrees(rotation); matrix = new matrix(); if (rotation != 0f) {

javascript - AngularJS $scope issues in tabset -

i have problem trying watch in controller collection generated filter in view. i store filtered data in variable : <table class="table"> <tr ng-repeat="item in filteredcollection = (mycollection | filter: txtsearch)"> <td ng-bind="item"></td> </tr> </table> and subscribe changes of 'filteredcollection ' in controller : $scope.$watchcollection('filteredcollection', function() { if (typeof($scope.filteredcollection) != 'undefined') console.log('results changed : ' + $scope.filteredcollection.length); }); i have set this jsfiddle show issue : watch function never called. fun fact, works when remove <tabset> <tab> tags in html. think messed $scope, don't why. maybe tabset create new $scope child or something. i hope guys find out going on here, cheers try put filteredcollection in object, change correct scope prop

python - Django: migration to NullBooleanField fails with IntegrityError "contains null values" -

i'm working in django 1.7 , trying migrate database field called is_dispensing existing booleanfield nullbooleanfield . my migration file: # -*- coding: utf-8 -*- __future__ import unicode_literals django.db import models, migrations class migration(migrations.migration): dependencies = [ ('frontend', '0007_practice_is_dispensing'), ] operations = [ migrations.alterfield( model_name='practice', name='is_dispensing', field=models.nullbooleanfield(), preserve_default=true, ), ] running manage.py migrate fails error: django.db.utils.integrityerror: column "is_dispensing" contains null values the field in models file: is_dispensing = models.nullbooleanfield(blank=true) previously was: is_dispensing = models.booleanfield(null=true, blank=true) and when added it, asked provide default value, set none. i find message confusing -

ruby on rails - Format Active Record Data before rendering as JSON -

i have data table going convert ajax , have format json values right formats. in example how format tables.created_at time-stamp mm/dd format... tables = table.where(:state => "missouri") respond_to |format| format.json { render json: tables } end in dom loop through data , needed it: chronic.parse(s.created_at.to_date).strftime("%m/%d") and can see have alot of additional formatting data before returned json: <% if @load_search.nil? %> <tr></tr> <% else %> <% @load_search.each |s| %> <tr id="row_<%= s.id %>"> <td align="center"> <%= s.id %> </td> <td class="count" align="center"> <%= s.results %> </td> <td align="center"> <%= chronic.parse(s.created_at.to_date).strftime("%m/%d&qu

c# - ServiceStack.Text DynamicJson fails to parse an array -

running following code: var s = @"{ ""simple"": ""value"", ""obj"": { ""val"":""test"" }, ""array"": []"; var dyn = dynamicjson.deserialize(s); console.writeline(dyn.simple); console.writeline(dyn.obj); console.writeline(dyn.obj.val); console.writeline(dyn.array); prints: "value" {"val":"test"} base {system.dynamic.dynamicobject}: {"val":"test"} "test" "[]" which means dyn.obj returns object can continue navigate through dyn.array returns string . meaning cannot iterate through list of objects inside. what missing? edit i think have found issue. looking in github in pcl.dynamic.cs method yieldmember following: private bool yieldmember(string name, out object result) { if (_hash.containskey(name)) { var json = _hash[name].tostring(); if (json.

ember.js - User authentication and login flow with Ember and JSON web tokens -

i'm trying figure out how best authentication , login flow ember. i'll add first web app i've built it's bit new me. i have express.js backend protected endpoints using jwts (i'm using passport, express-jwt , jsonwebtoken that) , works. on client-side, i'm using ember simple auth jwt authenticator. have login flow working (i'm using login-controller-mixin) , correctly see isauthenticated flag in inspector after successful login. the thing i'm struggling after login: once user logs in , gets token, should make subsequent call user details, e.g. /me, can have representative user model client side? these details let me transition appropriate route. see this example in repo example of how add property session provides access current user.

mysql - Google App Engine API - Failed to Load Databases - Cloud SQL -

i have google app engine php website mysql database. the website works , database works correctly. have connected database instance application , can access mysql client (and can perform queries). but when access google cloud sql api via google app engine developers console (on google developer console website) database fails load. for example: i select correct application/database instance. go on 'google cloud sql' api , 'sql prompts' get: failed load databases. any reasons why happening? , how load database? or why won't database load in first place? are trying access link [1] load database in browser.if yes might browser issue or multiple login problem. [1] https://console.developers.google.com/project/app-id/sql/instances

php - Varnish does not cache multiple wordpress -

i have setup varnish on high end dedicated server whm running around 10-13 websites, on wordpress. i'm seeing hit rate low , miss rate high in "varnishhist". also, when varnishtop -i txurl , see "/" url (and not each website url) being requested apache @ higher rate. below excerpt: 4.02 txurl / 1.00 txurl /wp-content/uploads/2014/12/034kj343.jpg 0.96 txurl /wp-content/uploads/2014/12/dfkkj30434.jpg 0.96 txurl /wp-content/uploads/2014/10/3403402022.jpg i believe varnish must cache home page of every single site , send client rather requesting backend. suggestions please? ok. managed find solution. here current vcl file works good. sub vcl_recv{ if (req.http.cookie && req.http.cookie ~ "(wordpress_|phpsessid)") { return(pass); } if (req.url ~ "wp-admin|wp-login") { return (pass); } else{ unset req.http.cookie; } #since can not unset all, leave wp-admin } sub vcl_backend_response

ruby - How do I convert a hash's values into lambdas recursively? -

i have hash looks this: { :a => "700", :b => "600", :c => "500", :d => "400", :e => "300", :f => { :g => "200", :h => [ "test" ] } } my goal iterate on hash , return copy have values wrapped in lambda, similar this: https://github.com/thoughtbot/paperclip/blob/dca87ec5d8038b2d436a75ad6119c8eb67b73e70/spec/paperclip/style_spec.rb#l44 i went each_with_object({}) best can wrap first level, tried check when meet hash in cycle ( :f in case, it's key's values should lambda unless hash well) , treat it, it's becoming quite troublesome. def hash_values_to_lambda(old_hash) {}.tap |new_hash| old_hash.each |key, value| new_hash[key] = if value.is_a?(hash) hash_values_to_lambda(value) else lambda { value } # or -> { value } new

statsmodels - Is there model selection score for GEE models besides the scale? -

i need compare different repeated measure or random effect models parameters have been inferred gee. however, there no model-selection variable besides scale. has implemented aic alternative gee proposed pan? http://50.28.42.145/faculty/wp-content/uploads/2012/11/rr2000-013.pdf other options model welcome

android - Changing the fragmentmanager not recognize the buttons and fails -

very good. met problem had when declaring buttons on other fragments contain fragment. forum , @shudy solve problem. last post: when declaring buttons different fragments not recognize but needs had change way had embedded fragment of buttons , when run app. error not how fix. this code modified public class grp1fragment extends fragment { private int contarrayask = 0; private int contright = 0; private int contfailed= 0; private button buttontrue; private button buttonfalse; private button buttonnextask; private button buttonsharescore; private view view; string[] arrayfragmentaresultsgrp1 = new string[]{"0","1","0","1","0","1","0","1","0","1",}; private fragment[] fragmentschangeask = new fragment[]{ new grp1fragmentp1(), new grp1fragmentp2(),

Android Studio gradle takes too long to build -

Image
my android studio project used build faster takes long time build. ideas causing delays? have tried https://stackoverflow.com/a/27171878/391401 no effect. dont have anti virus running interrupt builds. app not big in size (around 5mb ) , used build within few seconds not sure has changed. 10:03:51 gradle build finished in 4 min 0 sec 10:04:03 session 'app': running 10:10:11 gradle build finished in 3 min 29 sec 10:10:12 session 'app': running 10:20:24 gradle build finished in 3 min 42 sec 10:28:18 gradle build finished in 3 min 40 sec 10:28:19 session 'app': running 10:31:14 gradle build finished in 2 min 56 sec 10:31:14 session 'app': running 10:38:37 gradle build finished in 3 min 30 sec 10:42:17 gradle build finished in 3 min 40 sec 10:45:18 gradle build finished in 3 min 1 sec 10:48:49 gradle build finished in 3 min 30 sec 10:53:05 gradle build finished in 3 min 22 sec 10:57:10 gradle build finished in 3 min 19 s

javascript - update by id not working in mongoose -

i have code in making new connection using mongoose , using schema also. connection made , im getting attributes collection. after want update in collection, , not working.. have following code console.log("id : "+content._id); alert.findbyidandupdate(content._id, { $set: { status: true } }, function(error, result) { console.log(result); if (error) console.log(error); else { console.log('alert updated'); } }); it shows alert updated status remains false.. result 1st console id : 55096a5f91169c8e1673af20; , 2nd console alert updated thanks , regards in advance your code looks perfect, id looks it's correct , code don't return erros, so, have checked schema see if contains "status" field? looks can create , edit new documents schema not equal on both sides, application data layers. more info here: https://github.com/automattic/mongoose/issues/1060 hope i've helped.

azure - Cache part of experiment in AzureML same as SPSS modeler? -

i want cache part of stream executed (marked tick) in azure ml next time run start same point onwards. appreciable. i believe azure ml this. when run second time, if nothing upstream tick has changed should load results previous run. may take few seconds azure ml recognize cached , reload it.

java - Apache POI Evaluate Formula in SXSSF workbook -

in project use sxssfworkbook (apache-poi 3.9) class manage large spreadsheet. need evaluate formulas cells, tried formulaevaluator this ... sxssfworkbook streamingworkbook = new sxssfworkbook(100); ... formulaevaluator fe = streamingworkbook.getcreationhelper().createformulaevaluator(); ... fe.evaluateincell(cell); but doing so, exception thrown java.lang.classcastexception: org.apache.poi.xssf.streaming.sxssfcell cannot cast org.apache.poi.xssf.usermodel.xssfcell @ org.apache.poi.xssf.usermodel.xssfformulaevaluator.evaluateincell(xssfformulaevaluator.java:177) @ org.apache.poi.xssf.usermodel.xssfformulaevaluator.evaluateincell(xssfformulaevaluator.java:44) ... the direct cause of error clear: method .evaluateincell takes cell object, internally casts cell xssfcell . since i'm passing instead sxssfcell exception thrown. so question is: there way implement formula evaluation in streaming workbooks (sxssf)? tl;dr - support need isn't in older 3.9

php - Have a time seperator : within a input field -

Image
is possible have : separator in form input field manual time input? following example: <p> <div class='field'> <label for='$time_in'>time in</label> <input type='text' name='time_in' id='time_in' size='10' maxlength='5' /></div> </p> using "internet explorer" you can take 2 seperate fields like <p> <div class='field'> <label for='$time_in'>time in</label> <input type='text' name='time_in1' id='time_in1' size='10' maxlength='2' /> : <input type='text' name='time_in2' id='time_in2' size='10' maxlength='2' /> </div> </p> and handle them separately in code, work!

java - Extract files from *.gz extension -

i have extracted *.gz *.tgz , have no idea how extract final files *.tgz . there options using custom packages that's not option me, i need use standard java packages only . what tried using same function use *.tgz *.gz doesn't work. java.util.zip.zipexception: not in gzip format 1.gz here function extracting *.tgz files. public string extractfile(string path) { try { file newfile = new file(this.getfullpathwithoutextension(path) + ".gz"); gzipinputstream gstream; fileoutputstream outstream; try (fileinputstream filestream = new fileinputstream(path)) { gstream = new gzipinputstream(filestream); outstream = new fileoutputstream(newfile); byte[] buf = new byte[1024]; int len; while ((len = gstream.read(buf)) > 0) { outstream.write(buf, 0, len); } } gstream.close(); outstream.close(); newf

jquery - passing datatable page number to webservice -

i'm working datatables , jquery. i populating table result of web service. web service needs have limit clause in associated query there many results page takes long load. so goal use page numbers in webservice call where: if click page 2, posting 20,40 limit, if click page 3 posting 30,50. so the: page number clicked * 10 starting range , page number clicked * 10 + 20 finishing range of limit clause. however pagenumbers displayed based on number of results, , if post webservice limit of 0,20 there 20 results , page numbers @ bottom of table not have 2,3,4 etc. options 20 rows returned. is there way around this? is there better way of implementing want achieve? some code: $(document).ready(function() { tableallocation('<?php echo $_session['authcode']?>'); $('#table_id').datatable( { "pagelength" : "20", "order": [[ 0, "asc" ],[1, "asc"]] }); }); where

html - Can't get my CSS to Float right -

i'm following udemy complete web development course. i'm supposed making clone of bbc website i'm having couple of issues. first of font bigger this, set same 0.75em. h1 tag seems to right of tag guessing i've messed flow somewhere can't see how. http://jsbin.com/yowoyohaja/1/edit?html,output from can gather, header above date? if that's case move h1 tag above date in html , ensure open tags closed, h1 tag left open. see updated jsbin: http://jsbin.com/cetokibuva/1/edit

javascript - Where does ForerunnerDB save its Database? -

i write html file supposed run in browser locally, create , modify database (forerunner db) , , show results. i wrote below , should find database file ? below enough "once page loaded " sse db or there "save" command ? <!doctype html> <meta charset="utf-8" /> <title>ouch</title> <body> <p id="out">testing..</br> > </body> <script src="c:\users\n17263\node_modules\forerunnerdb\js\dist\fdb-all.min.js" type="text/javascript"></script> <script> var db = new forerunnerdb('db'); var customers= db.collection('customers'); var suppliers= db.collection('suppliers'); var items= db.collection('items'); var s_itmes= db.collection('s_items'); var purchase_invoices= db.collection('purchase_invoices'); var sales_invoices= db.collection('sales_invoices'); var orders= db.collection('orders'); customers.

.htaccess - Website URL redirects to name/%20/auth/login -

i have website hosted on godaddy. when enter url thehotkey.in, url redirects thehotkey.in/%20/auth/login gives me blank page. when go : thehotkey.in/auth/login, gives me distorted login form. every button click on , example, if click on register button on login page, redirects thehotkey.in/%20/auth/register gives me blank page. if go thehotkey.in/index, gives me blank page well. there sort of mis-redirection cant figure out how tackle it. here my.htaccess more help: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] rewriterule ^index.php/(.*)$ [l] </ifmodule> ( didnt write code, bought code) any suggestion appreciated. the base url in fx_cpnfig file had space @ end of url address. due this, sae %20 in every redirected url . alright after removing space.

python - How can i execute the following code using pycurl -

curl https://api.smartsheet.com/1.1/sheets -h "authorization: bearer 26lhbngfsybdayabz6afrc6dcd" -h "content-type: application/json" -x post -d @test.json if new coding, don't use pycurl considered obsolete. instead use requests can installed pip install requests . here how equivalent requests : import requests open('test.json') data: headers = {'authorization': 'bearer 26lhbngfsybdayabz6afrc6dcd' 'content-type' : 'application/json'} r = requests.post('https://api.smartsheet.com/1.1/sheets', headers=headers, data=data) print r.json if must use pycurl suggest start reading here . done (untested) code: import pycurl open('test.json') json: data = json.read() c = pycurl.curl() c.setopt(pycurl.url, 'https://api.smartsheet.com/1.1/sheets') c.setopt(pycurl.post, 1) c.setopt(pycurl.postfields, data) c.setopt(pycurl.httpheader, ['

tomcat - Getting 403 error with Curl for calling java web application with jsessionId -

i running curl command in centos release 6.4 (final) line below, , requested pages java web application pages hosted on tomcat7. curl http://10.1.1.140:8080/tmp/tmp2000 in response sessionid request next page this: curl http://10.1.1.140:8080/tmp/pages/next;jsessionid=71a6fc0d190ab25a63938dfcbee26025?cbb0fc79382a4f039e6f8eb5fef8b1cd=success.filled but in response this: <html><head><title>apache tomcat/7.0.26 - error report</title><style><!--h1 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:22px;} h2 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:16px;} h3 {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;font-size:14px;} body {font-family:tahoma,arial,sans-serif;color:black;background-color:white;} b {font-family:tahoma,arial,sans-serif;color:white;background-color:#525d76;} p {font-family:tahoma,arial,sans-serif;background:white;color:black;f

how to get value from hidden input type array using jquery -

how value hidden input type array input below , trying code <input type="hidden" name="position[]" value="10"> var arr= $('input[type="hidden"][name="position[]"]').val(); try code var arr = $('input[type="hidden"][name="position[]"]').map(function(){ return this.getattribute("value"); }).get();

Unable to connect to HTTP server and fetch json string in android -

i trying fetch json string, url: http://ip-api.com/json . got io exception while try fetch json string. package www.howdy.com; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.io.unsupportedencodingexception; import java.util.list; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httpget; import org.apache.http.client.methods.httppost; import org.apache.http.client.utils.urlencodedutils; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; import org.json.jsonexception; import org.json.jsonobject; import android.util.log; public class serverhandler { static inputstream = null; static jsonobject jobj = null; static string json =

javascript - gzip and minify server route response in meteor and iron-router -

i used meteor , iron-router , set many server route return html node.js response object. now want minify , enable gzip in response. how this? this route code: router.route('/', function () { var res = this.response; var html = "<!doctype html>\n" + "<html>\n" + " <head>\n" + " </head>\n" + " <body>\n" + " test\n" + " </body>\n" + "</html>"; res.end(html); }, { where: 'server' }); this page result: <!doctype html> <html> <head> </head> <body> test </body> </html> i want minified version below: <!doctype html><html><head></head><body>test</body></html> i deploy test project in url: http://gzipminify.meteor.com/ and can test gzip suppo

android - How to set fixed width and height in an alertBox? -

i have alertbox alertdialog = new alertdialog.builder(instructions.this); layoutinflater inflater = this.getlayoutinflater(); view view = inflater.inflate(r.layout.alert_dialog_layout, null); alertdialog.setview(view); final alertdialog newdialog = alertdialog.create(); i try this: newdialog.getwindow().setlayout(width, height); it not work! what have do? thanks you have use line : alertdialog.getwindow().setlayout(width, height); after alertdialog.close line , not before. hope helps.

javascript - IE 11 "An error has occurred in the script on this page" at the end of the line -

Image
i trying test legacy web site intended work on ie8 in ie11. i error "an error has occurred in script on page." on code when accessing page on ie11 (it works fine on ie8). line number stated here last line of clientcxmldocument.js file , don't see issue in code case issue. on ie11 in internet options, if uncheck "disable script debugging (internet explorer)", no longer error more interested know causing error. there lot of api featured removed , replaced in ie11 listed in documentation: https://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx for example, use of document.selection no longer work in ie11 javascipt code may contain of these , use corresponding replacements. in meantime while fixing code, might want use ie x-ua tag specify ie8 legacy document mode <meta http-equiv="x-ua-compatible" content="ie=8" />

bitbucket - How to receive notifications about all activities on the repos I have an access to without subscribing to each one manually -

how receive notifications activities (new repos created, new branched created, new commits, new pull requests, etc) on repos have access (my own , team-related) without subscribing each 1 manually? there built-in way achieve such behavior or should create own application using bitbucket rest api? in latter case best way it? methods should for? thanks in advance.

node.js - How can I select specific columns from a joined table in Knex.js? -

i have worked 20 years sql databases , seem have trouble understanding knex way map queries. can me correct code? i have sql query want use in nodejs application: select p.id, p.project_number, p.project_name, p.start_date, p.end_date, o.name, o.email_addr, c.company, c.email_addr company_email, c.first_name, c.last_name projects p inner join owners o on o.id = p.owner_id inner join clients c on c.id = p.client_id knexjs (0.7.5) documentation shows example query: knex.from('projects').innerjoin('owners', 'owners.id', 'projects.owner_id') .innerjoin('clients', 'clients.id', 'projects.client_id'); there couple of things cannot find in documentation: 1) how select columns want include? projects, clients , owners each have 20 50 columns , not interested in of them. selecting columns main table clear (using select() or column() ) how select columns joined tables? 2) columns have identical names. how can a