Posts

Showing posts from June, 2015

jquery - Responsive menu animation malfunction -

i've made responsive slide in menu. added code responsive view. it works this. default div.overlay , ul hidden. click on .triggerrm anchor, elements become class called .openrm , animates (with css-transition): .overlay makes black cover on body .triggerrm left position changed 0% 100% (with bit of margin , background change) ul right position gets changed 100% (hidden) 5em . all works charm on computer (win 7 + ff38). when looking android phone ul transition doesn't work. when button clicked, background pops @ end position without animation. the rest of animation work. any ideas?? here 's code: html <nav role="navigation"> <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></...

Oracle SQL - How can I write an insert statement that is conditional and looped? -

context: have 2 tables: markettypewagerlimitgroups (mtwlg) , stakedistributionindicators (sdi). when mtwlg created, 2 rows created in sdi table linked mtwlg - each row same values bar 2, id , field (let's call column x) must contain 0 1 row , 1 other. there bug present in our codebase prevented happening automatically, mtwlg's created during time bug present not have related sdi's, causing npe's in various places. to fix this, patch needs written loop through mtwlg table , each id, search sdi table 2 related rows. if rows present, nothing; if there 1 row, check if f 0 or 1, , insert row other value; if neither row present, insert them both. needs done every mtwlg, , unique id needs inserted too. pseudocode: for each market type wager limit group id check if there 2 rows id in stake distributions table, 1 column x = 0 , 1 column x = 1 if none create 2 rows in stake distributions table unique id's; 1 each x value if 1 create missi...

c - How to get and compare libcurl version? -

i using libcurl setting oauth 2.0 access token. since libcurl 7.33 curlcode curl_easy_setopt(curl *handle, curlopt_xoauth2_bearer, char *token); option added. need libcurl version , compare 7.33. in case version 7.33 or higher use curlopt_xoauth2_bearer otherwise else. know should somehow use curl_version_info_data *curl_version_info( curlversion type ); have no idea, how data in struct , how compare them 7.33 version. can me? if want detect version @ run-time, can use curl_version_info () in style this: curl_version_info_data *d = curl_version_info(curlversion_now); /* compare 24 bit hex number in 8 bit fields */ if(d->version_num >= 0x072100) { /* libcurl 7.33.0 or later */ printf("succcess\n"); } else { printf("a old version\n"); } if prefer detection build-time, can use preprocessor #if expression this: #include <curl/curl.h> #if libcurl_version_num >= 0x072100 /* 7.33.0 or later */ #else /* work-around older libcur...

android - Hide SubMenu and SearchView in the Actionbar -

Image
i trying hide both submenu , searchview in actionbar. using actionbarsherlock. @override public boolean oncreateoptionsmenu(menu menu) { //used put dark icons on light action bar boolean islight = samplelist.theme == r.style.theme_sherlock_light; //create search view searchview searchview = new searchview(getsupportactionbar().getthemedcontext()); searchview.setqueryhint("zong ol na..."); searchview.setonquerytextlistener(this); searchview.setonsuggestionlistener(this); searchview.setsuggestionsadapter(msuggestionsadapter); submenu sub = menu.addsubmenu("menu"); sub.add(0, r.style.theme_sherlock, 0, "topic"); sub.add(0, r.style.theme_sherlock_light, 0, "thuthlunghlui"); sub.getitem().setshowasaction(menuitem.show_as_action_always | menuitem.show_as_action_with_text); menu.add("search") .seticon(islight ? r.drawable.ic_search_inverse : r.drawable.abs_...

Modify PayPal Express Checkout custom parameter after payment -

i'm using paypal express checkout, recurring payments without trial. for first payment, i'm using doexpresscheckoutpayment api operation (nvp) , , store reference value in custom parameter. before making payment, don't have customer id, generated after payment made, i'm using reference value in custom parameter validating payments , register customer later is there way modify custom parameter later, set in doexpresscheckoutpayment ? want add customer id it, ease future ipn, reference id might not available later. no, cannot modified later. recommend create customer record in system prior sending user on paypal. create pending status or that, , update status once payment completed. way you'll have id need , can attach payment.

r - Time Series - Splitting Data Using The timeSlice Method -

referring post: createtimeslices function in caret package in r createtimeslices suggested option cross-validating when using time series data. understand how go selecting values 'initialwindow', 'horizon' , 'fixedwindow' in traincontrol. they defined within caret follows (?createtimeslices): initialwindow - initial number of consecutive values in each training set sample horizon - number of consecutive values in test set sample fixedwindow - logical: if false, training set start @ first sample. can please elaborate further on how go selecting right values initialwindow & horizon , actual implications of selecting true or false fixedwindow? initialwindow : size of training set/window first modeling iteration. how large should depends on complexity of model fitting, have research minimum sample size expected reliable fit. obviously, larger window needed more complex models, see example measuring forecast accuracy , p. 6. fixedwindow...

git - Cloning Dev environment for minimum configuration fuss. -

i've been using single user profile since year dot dev / personal / etc, , it's been ok. i've spent lot of time playing new / different techs , spending vast amounts of time resolving conflicts, setting configurations , on. there must easier way...cue lightbulb moment. i think if set virtual machine solely dev purposes solve problem, configure once , if needed different environment clone vm, update , move on. no mess involved. suspect vast majority of may common practice. i'm using osx , wondering if can still have shared pool of resources. i'd keep tools , res folder of main account , allow vms access save multiple downloads. i guess i'm hunting best practices , solutions, workflows etc. idea? -i've not played vms before other install(and not use) win via parallel. i think should check vagrant . store tools: more matter of personal taste guess. can have machines share folder host system keep resources in 1 place. can idea isolate...

c# - How to cache dynamically switched views by ViewModel-First approach using DataTemplates -

(i using galasoft.mvvmlight framework) i have views in mainwindow.xaml switching between them dynamically in run-time, user selection. these views using following technique bind corresponding view-model: mainwindow.xaml ... <window.resources> <datatemplate datatype="{x:type vm:control1viewmodel}"> <v:control1/> </datatemplate> ... // assume there more 1 datatemplate. every view has unique view-model. </window.resources> ... control1viewmodel.cs public class control1viewmodel : viewmodelbase { ... } the mainwindow.xaml using following technique switch between above views: mainwindow.xaml ... <contentcontrol content="{binding currentview}"/> // view appears. ... mainviewmodel.cs public class mainviewmodel : viewmodelbase { ... private viewmodelbase _currentview; public viewmodelbase currentview { { return _currentview; } private set ...

magento 1.9.1 please make sure your passwords match -

this seems weird when check mage model's customer class method there getpasswordconfirmation() , when check extension files there no trace of such method or getconfirmation() method. above error try place order. can give me suggestions or guesses? appreciated. thanks. extension it javascript validation message generated validation.js file: in validation.js file (probably around line 529) for: ['validate-cpassword', 'please make sure passwords match.', function(v) { if don't want validation remove validate-cpassword (pay attention letter c in cpassword!) html class definition of form in .phtml file (should billing.phtml ). in line: <input type="password" name="billing[confirm_password]" title="<?php echo $this->__('confirm password') ?>" id="billing:confirm_password" class="input-text required-entry validate-cpassword" />

postgresql - Postgres: Select all fields where json field array contains a particular value? -

let have users , companies table, 1 user can work multiple companies. in case model using json field. users - id: pk - jobs: json sample jobs field: [{"company_id": 1, "title": "engineer" }, {"company_id": 2, "title": "accountant"}] given company id, there way run 1 sql query (postgres 9.4) can extract user ids have worked in company? like: select id users map(jobs, "company_id") contains <?> might not best way it, works: select id (select id, json_array_elements(jobs) table) b a->>'company_id'='1';

asp.net - how to convert 44/5 in C# to get decimal values? -

this question has answer here: why integer division in c# returns integer not float? 8 answers how convert 44/5 in c# decimal values actual result 13.75 got 13 need 13.75 how tried many solutions not possible please find -----------tried methods-------------------- protected void txtbox_textchanged(object sender, eventargs e) { int cal= 55 / 4; //13 decimal cal= 55 / 4; //13 string cal= string.format("{0:0.00}", 55 / 4); //13.00 decimal cal= decimal.floor(55 / 4); //13 salesprice.text = cal.tostring(); } try doing: decimal cal = 55m/4;

jsf - Preprocess/postprocess a bean action method from p:remoteCommand inside composite -

i have following scenario: jsf composite component complex javascript, i'd refresh partially javascript new values backing bean (backing bean of page uses composite component, not backing component @facescomponent ). i don't want make full update because it's complex javascript plugin , unacceptably break ux . i values backing component @facescomponent using primefaces's <p:remotecommand> callback described here best method passing data java/jsf2 bean javascript/jquery components i know it's abuse of jsf encapsulate functionality in single unit , don't mess jax-rs if can advice nice solution how encapsulate such complex jquery plugin (for sake of clarity talking fullcalendar , know primefaces has own implementation of component functionality insufficient requirement so, need make own implementation) highly related on ajax callbacks parameters you're highly welcome share here. my question how update values in backing component @facescomp...

php mysql $_post does not work -

i have written code, not work , cannot find mistake. filters data mysql database. below pasted 1 code without $_post form , works fine. need filter due high volume of data. ` include "db_connect.inc.php"; $sql = "select versicherungsnamen, franchise, praemie praemien"; $sql .= " kanton = " . $_post["kanton"] . " , franchise = ". $_post["franchise"]; $sql .= " order praemie"; $res = mysqli_query($con, $sql); $num = mysqli_num_rows($res); if ($num==0) echo "keine datensätze gefunden"; while ($dsatz = mysqli_fetch_assoc($res)) echo $dsatz["versicherungsnamen"] . ", " . $dsatz["praemie"] . "<br />"; mysqli_close($con); ?> </body> </html>` but when try code without $_post option works fine <html> <body> <?php...

java - Talend tRESTClient requires Document data type in schema -

i'm using trestclient call rest service post json string (with records). trestclient component not allow me use custom schema matches string. says: the method getdocument() undefined type string it seems trying execute getdocument against schema input schema string not document data type. if use tmap try convert json string document, error: type mismatch: cannot convert string document how 1 convert string document? json string such this: {"names:[{"fname":"edgar"},{"fname":"jose"},{"fname":"peter"}]} you store string in json file , read data json file , use txmlmap component provide input trestclient tfileinputjson -> txmlmap -> trestclien hope :)

unity3d - When I give a 'function' type to onclick, it show me the exception InvalidCastException: Cannot cast from source type to destination type -

now i'm using uieventlistener add clicker.when write in 1 file, works right.like this: uieventlistener.get(popbutton).onclick = showpop; but when wrote 2 seprate files gives me error.first file: public class adapter{ var grid:gameobject; function additems(data:list.<printitem>, prefab:gameobject, func:function){ for(var i:int=0;i<data.count;i++){ var gameobject:gameobject = nguitools.addchild(grid, prefab); uieventlistener.get(gameobject).onclick = func; } } } second file: //i use funtion adapter.additems(list, go[0], hidepop); //the hidepop var hidepop:function = function(){ switchpopmenu(false); }; when run unity give me error invalidcastexception: cannot cast source type destination type. adapter.additems (system.collections.generic.list`1 data, unityengine.gameobject prefab, icallable func) (at assets/scripts/yhj/tools/adapter.js:12) try using eventdelegate.add(obj.onclick, func); . di...

html - border-bottom in panel-heading not displaying full width when window shrink -

how make border-bottom of panel-heading display full width when window shrink , horizontal axis appear below panel-body? border displayed when window maximized, display width same window when window shrink. here code: <section class="panel"> <header class="panel-heading" style="display:block;"></header> <div class="panel-body"> <table class="table table-hover table-bordered"></table> </div> </section> .panel-heading { padding: 10px 20px; color: #535351; font-size: 14px; font-weight: bold; min-height: 52px; border-bottom: 1px solid #e5e5e5; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel-body { padding: 15px 20px 15px 20px; border-bottom: 1px solid #e5e5e5; display: inline-block; } .table { width: 100%; margin-bottom: 20px; min-width: 1130px; max-width: 100%; background-color: transparent; border-collapse: collapse; border-spa...

ios - UITableView cell having different identifiers for three different cell design -

- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"reviews"; static nsstring *cellidentifier1 = @"recipes"; static nsstring *cellidentifier2 = @"easy_tips"; // configure cell nsstring *type = [[myaray objectatindex:indexpath.row]objectforkey:@"type"]; nslog(@"types====%@",type); uitableviewcell *mycell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; if (type == cellidentifier) { firstcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; nslog(@"first type %@", type); return cell; }else if (type == cellidentifier1){ secondtableviewcell *cell1 = [tableview dequeuereusablecellwithidentifier:cellidentifier1 forindexpath:indexpath]; return cell1; }else if (type == cellidentif...

com - Why does this operation break when turned into a function (AutoHotKey/AHK) -

the following operation works correcting inside ahk. replaces word ted word tom inside open word document. working code ; word constants vbtrue := -1 wdreplacenone := 0 wdfindcontinue := 1 return #ifwinactive, ahk_exe winword.exe ^7:: try oword := comobjactive("word.application") catch return findtext := "ted" replacewith := "tom" ofind := oword.selection.find ohyperlinks := oword.activedocument.hyperlinks ofind.clearformatting ofind.replacement.clearformatting while ofind.execute(findtext, vbtrue, false,,,,, wdfindcontinue,,, wdreplacenone) ohyperlinks.add(oword.selection.range, "http://www.autohotkey.com",,, replacewith) return however, when turn exact same code function not work. not work when written way, , not work if parameters removed , variables put script. broken code (with parameters) replaceandlink(findtext, replacewith) { ; word con...

php - how to send custom field to quickbooks? -

i'm using php_devkit_v3 send invoice quickbook. code working fine simple invoice when send custom field don't add custom field invoice. add custom field in quickbook->companysetting->sales->custom field. again failed add custom field code i'm using given below $customfield = new quickbooks_ipp_object_customfield(); $customfield->setname('pod'); $customfield->settype('stringtype'); $customfield->setstringvalue('dfsdfsfd'); $invoice->addcustomfield($customfield); if ($resp = $invoiceservice->add($context, $realm, $invoice)) { print('our new invoice id is: [' . $resp . ']'); } else { print($invoiceservice->lasterror()); } kindly guide me how can this? finally had done sending definition id qb below $customfield = new quickbooks_ipp_object_customfield(); $customfield->setdefinitionid(1); $customfield->setname('pod'); $customfield->settype('stringt...

add object to another array of objects in javascript -

can 1 please me how add objects array of objects myarray = [ { "a" :{ values }, "b" :{ values }, "c":{ values } } ] another object: { "d":{ values }, "e":{ values } } i want add next objects d , e array of first object. it shuold this [ { "a":{}, "b":{}, "c":{}, "d":{}, "e":{} } ] cna me 1 how add objects thanks in advance according understanding have 1 array of object i.e. myarray = [{"a" :{},"b" :{},"c":{}}] and want add property in object use myarray[0].d={}; myarray[0].e={}; console.log(myarray[0]); and if want add more objects in array use push method var obj={"a1" :{},"b1...

c# - How to hide this error on vstest.console.exe? -

Image
i have developed unit test project , executed with vstest.console.exe in console want show method pass or method fail.. how hide errors , trace ... here available command line options vstest.console.exe , none of them need. your best bet write custom logger implementing itestlogger microsoft.visualstudio.testplatform.objectmodel.dll , specifying /logger option. check this post more details.

c# - Is it preferable to use Html.RenderAction over HTML.Partial and nested View Models to render a partial view? -

i have viewmodel used view. within view, open partial view used 1 of html tabs i've put up. i use viewmodel partial view @ moment have parent viewmodel , have child viewmodel . is better or have separated instead of using @html.partial() , should use @html.renderaction ?

linux - What is file globbing? -

i wondering file globbing? have never heard of before , couldnt find definition when tried looking online... globbing * , ? , other pattern matchers may familiar with. globbing interprets standard wild card characters * , ?, character lists in square brackets, , other special characters (such ^ negating sense of match). for example of * operator, want copy files .jpg extension in current directory somewhere else: cp *.jpg /some/other/location here use * globbing pattern matcher match jpg files in current directory. note may similar, not same regular expressions. you can find more detailed information here , here

c# - Using IExtenderProvider to provide a Type property -

i trying add type property controls in winforms designer. ideally them serialised using typeof(mycompany.thetypeiused) (ala way bindingsource.datasource can serialized). putting aside fact have not specified designer type, appears if add iextenderprovider uses 'type', property not appear in property grid. if use int or string or other type works fine. is bug in iextenderprovider implementation or attributes etc required? [provideproperty("commandtype", typeof (control))] public class typeextender : component, iextenderprovider { private readonly dictionary<control, type> controlcommands; public typeextender() { controlcommands = new dictionary<control, type>(); } #region impl bool iextenderprovider.canextend(object target) { var control = target control; if (control == null) { return false; } return true; } [defaultvalue(null)] public type getc...

python - Can't pass values via command line -

i have write program reads file , writes analysis text file. program has take information via command line can't see, figure out given template. wrote test program see if succesfully pass command line input class. #!/usr/bin/env python3 ######################################################################## # commandline ######################################################################## class commandline() : ''' handle command line, usage , requests. commandline uses argparse, standard in 2.7 , beyond. implements standard command line argument parser various argument options, standard usage , help, , error termination mechanism do-usage_and_die. attributes: arguments received commandline using .add_argument avalable within .args attribute of object instantiated commandline. example, if mycommandline object of class, , requiredbool set option using add_argument, mycommandline.args.requiredbool name option. ...

Python: retrieve objects's value from a class object -

here problem, i'm creating tkinter gui , in class object call text tipped in textfield , make array of it but can't find how retrieve , use object later on in script. here script import pandas pd pandas import * import numpy np import tkinter tkinter import * pylab import * ttk import * import scrolledtext df = pd.dataframe(np.random.randint(100, 500, size = (10, 20)), index = list('abcdefghij')) mylist = df.index.values.tolist() rootwin = tkinter.tk() class graphgui(): def __init__(self, rootwin): self.textfield = scrolledtext.scrolledtext(rootwin, width=30, height=10) #add text: self.textfield.insert(insert, "replace") self.textfield.grid(column=0, row=4) self.button = button(rootwin, text="process!", command=self.clicked) self.button.grid(column=1, row=4) def clicked(self): etext = self.textfield.get('1.0', end) ...

pointers - What are difference between *a and **a in objective-c object? -

i write following code: nsarray *array = @[@1, @2]; how output *array , **array , , difference between them? there answers, think none of them real you, because describe technical meaning. let's have first declaration: nsarray *array …; when talks code, find statements array instance object of nsarray . every experienced objective-c developer knows real meaning of statement, wrong. correct statement? a. instance object of nsarray an instance object has state, set of data stored. so, needs memory, reserved while object creation. not deal directly that, done inside +alloc . done explicitly @ runtime while program running ("on heap", "heap allocation"). … [nsarray alloc] … // memory instance object of type nsarray you address such object solely via address, number of first memory cell of occupied memory area. (every memory cell has number, called address. yes, similar addressing inhabitants in house via number of house in street. the...

Encrypt in Javascript, decrypt in PHP, using public-key cryptography -

i'd encrypt in javascript, decrypt in php, using public-key cryptography. i've been trying find libraries can accomplish this, having issues. i looking @ openpgpjs , need support in browsers, , test page has errrors on listed supported browser (google chrome). notes final goal: the tcp connection protected ssl. main purpose of layer of protection defending against intentional or unintentional webserver logging, crash dumps, etc. on php side, temporary private key generated (it expire after short time). caller (in javascript) responsible asking new public key when expires. reason private key expiration prevent logged encrypted data decryption, in case server stores private key later compromised. servers compromised scenario: gets hands on backups machines except database server (and cannot access database due firewalling, if finds out user , password). since private key encrypted logged data no longer exists, there nothing attacker can do. i've used si...

javascript - Fixed header with scrolling content above? -

i building site family business , i'm putting in fixed navigation bar, want company logo , address (above nav bar) disappear when user scrolls, while nav bar stays in place. here link can see i'm talking about: http://lindseymotors.com i've tried using fixed css attribute causes address , phone number disappear when viewed in landscape orientation reason. know it's possible javascript, i'm hoping avoid , use css. a working example of i'm going can seen @ http://31dodge.com . notice says kernersville @ top, there nav bar below several buttons (menu, location, phone, car, etc.) - when scroll, kernersville area disappears navigation area remains top whole time, , on desktop version, kernersville logo gets smaller. i'm trying achieve without javascript if possible, if not, appreciate there because javascript efficiency isn't best anymore. i have changed fixed attribute absolute time being, problem isn't showing right , i'm thinking once ...

How can I have local file system access using embed Java application in HTML? -

i don't know right codes should put, tried many ways have access read , write. main goal when click button in java application, download start. you can't access local filesystem java sandbox applet. reading documentation what applets can , cannot do , see: sandbox applets cannot perform following operations: they cannot access client resources such local filesystem, executable files, system clipboard, , printers. they cannot connect or retrieve resources third party server (any server other server originated from). they cannot load native libraries. they cannot change securitymanager. they cannot create classloader. they cannot read system properties. see system properties list of forbidden system properties. if want bypass these restrictions have use priviliged applet: privileged applets not have security restrictions imposed on sandbox applets , can run outside security sandbox. for this, need sign jar , add following ...

angularjs v1.3.15 deep linking / routing / path no longer working with hashtag (Migrated from v1.2.3) -

i new angular , working on code wanted upgrade angular version 1.2.3 1.3.15 (which have never done before). when did, navigation links on index page stopped working; rather seems router.js falls through $routeprovider.otherwise case , redirects /home (you can see refresh in jumbotron). however, notice when click on links, url goes localhost:8888/home localhost:8888/home# or localhost:8888/home#home or localhost:8888/home#info , page routes don't work (the home page gets refreshed instead) - route appended /home , doesn't know do. when remove deep linking ( hash / pound / # ) links in index.html, code appears work again, don't understand why. it's highly i'm misunderstanding in breaking changes 1.2 1.3, documentation made seem using # still supported in 1.3. by "upgrading" replaced angular.js , angular-resource.js , , angular-route.js in project newer versions. using apache karaf, , tested in both chrome , firefox same results. shortened co...

c# - Adding User Controls at runtime via <script runat="server"> -

i have problem executing control inside <script runat="server"> tags in aspx page. the control works when defined declaratively in html section of page, not able make work when placed within script tag. at beginning of page register control with: <%@ register assembly="app_web_exemple.ascx.cc671b29" namespace="moncontrol" tagprefix="moncontrol" %> in html, call (successfully) following declaration: <moncontrol:exemple isbn="9782894646151" runat="server" /> when try add programmatically through <script runat="server"> , however, not able execute it. tried tags asp:text , asp:literal , follows, doesn’t work. in html part: <asp:text id="testcontrol" runat="server" /> in script part testcontrol.text = "<moncontrol:exemple isbn=\"9782894646151\" runat=\"server\" />"; to clarify, you're looking prog...

git - Reduce Repo Size on Bitbucket -

i've realised repo coming in @ on 1gb, seems .git folder weighs in @ 800mb. why , right ways go reducing this? any appreciated. in advance! instead of using git filter-branch manually, highly recommend using bfg ( https://rtyley.github.io/bfg-repo-cleaner/ ), since faster , can rid of larger files. instructions on page easy follow. however, note bfg removes large files .git history if not committed repo. before use bfg, should git rm --cached filename any large files (like large zips mentioned above). if don't need them anymore, can delete them completely. , remember add *.zip .gitignore!

json - Is there a way to set middleware in express (node.js) to have specific values return in every route? -

the situation referring involves use of json web tokens (jwt). example how automatically add middleware return new json web token if web token expired without duplicating code? sample code below show mean. var express = require("express"); var jwt = require('jsonwebtoken'); var router = express.router(); router.use(function(req,res,next){ var token = req.body.token || req.query.token; if (token) { jwt.verify(token,"secrettingz",{algorithms:["rs256"]},function(err,decoded){ if (err) { if (token.expired) { // how piece of code run every valid route needs new token without duplicating code? var token = jwt.sign({user:"milnerjenkins"},cert,{algorithm:"rs256",expiresinminutes:1}); req.token = token; next(); }else{ return res.json({message:"failed authenticate tok...

java - Sandbox for memory -

java supposed not have memory leaks it's still possible. when program has memory leak can fix (i hope). when third party packages have can do? practically nothing except don't using package. is there solution? idea of sandbox. allowed whatever want within area , "physical" don't have ability bother other outside of box. there way create such sandbox memory usage in java? imagine = create sandbox memory usage, allow package whatever does, take results , delete sandbox whatever garbage left here! no complications gc, no cleaning or disposition of memory. delete , forget it. is there way so? the best way launch jvm, communicate with socket(for example), , kill jvm after it's done. it'll interesting discuss whether can sandbox within same jvm. after done using 3rd party library, , no longer referencing objects library, garbage that's still lingering? their classes - though not referening of them, if loaded same classloader code, the...

scala - Override a function inside an Object inside of a Trait -

say have this: trait { object b { def dosomething = "test" } } class c extends { def out = print(b.dosomething) } class d extends { // override b.dosomething } how override function dosomething inside of object b ? this kind of duplicate, of 2 separate issues: first, objects not meant overridden . second, inheriting nested class straightforward class a{ class b{ def foo = 1 } } class c extends a{ class b extends super.b{ override def foo = 2 } }

ruby on rails - Using Twitter API to embed tweets with URL -

i'm trying embed tweets in app passing in tweets url. i'm inexperienced apis , need bit of guidance set up. twitter has documentation here , here on how using oembed. part i'm unclear on how make request: "make request following url each tweet id, {tweet_id} represents value changing in programmatic loop:" https://api.twitter.com/1.1/statuses/oembed .{format} also unsure on add api keys twitter gives me. sorry broad question, new @ this.

javascript - How to enable default link button after preventDefault() -

i want scroll top when user press login button. using link button login. here logic scroll top. <asp:linkbutton id="cmdlogin" resourcekey="cmdlogin" cssclass="dnnprimaryaction" text="login" runat="server" /> <script type="text/javascript"> jquery(function($) { var actionlinks = $("a[id$=cmdlogin]"); actionlinks.click(function(e) { e.preventdefault(); // e.stoppropagation(); $('html,body').animate({ scrolltop: 0 }, 'fast'); }); }); </script> the scrolling working fine code problem when click on login button got disable. can click again prevent default css code , button seems disable. not showing error message because of preventdefault(). please me how can enable default after using event.preventdefault(); thanks. replace .click( .one( "click", jqu...

assembly - INT 13h, get status of last op -

i'm writing bootloader bios in 16-bit real mode, using qemu emulator. i have code fails read hd. that's ok, bothers me when try status code operation using "get status of last drive operation". according this wikipedia resource , can set ah 1, , set dl desired drive (which i've verified 0x80). then, when invoke int 13h , al should have status code in it. however, when this, carry flag gets set, indicating attempt read status failed. other specifying wrong drive, don't see how possibly fail. so question is, what ways command (int 13h, ah 01h) possibly fail ? here's code: get_status: mov ah, 0x01 ; status fxn mov dl, 0x80 ; 0x80 our drive int 0x13 ; call fxn jc print_status_failure jmp $ print_status_failure: mov ax, fail_msg call print_string jmp $ then, when invoke int 13h, al should have status code in it. bios function 01h int 13h returns result in ah register. carry flag ...

tfs2013 - Download a specific TFS build from the command line -

are there tfs command-line utilities download .zip file specified build exists in tfs? know recent build can found in specified drop folder, let's wanted go arbitrary build. know can in web admin selecting build list, right clicking, , selecting "open drop folder". is possible command line? no, scrabble through api can call powershell. http://nakedalm.com/powershell-tfs-2013-api-1-get-tfscollection-and-tfs-services/ here example of how might achieved. need retrieve ibuilddetail object...

ios - Remove cells when searchBar text is above 0 -

i've created tableview first did set should use filtered array if searchcontroller active. want first when searchbar contain more 0 characters. not seem work. here i've done far in cellforrowatindexpath if (count(self.teamsearchcontroller.searchbar.text) > 0) { team = filteredtabledata[indexpath.row] team cell.textlabel?.text = team.name string } else { team = self.teamarray[indexpath.row] team cell.textlabel?.font = uifont(name: "helveticaneue-light", size: 20) cell.textlabel?.text = team.name string } updatesearchresultsforsearchcontroller func updatesearchresultsforsearchcontroller(searchcontroller: uisearchcontroller) { filteredtabledata.removeall(keepcapacity: false) let searchpredicate = nspredicate(format: "name contains[c] %@ or shortname contains[c] %@", searchcontroller.searchbar.text, searchcontroller.searchbar.text) let array = (teamarray nsarray).filteredarrayusin...

jquery mobile - simple page transition snaps -

while learning jquery mobile set basic page transition slide me page1 page2. regardless of library versions use, same error (via console - page hangs) within swipeleft/swiperight/click event try implement - uncaught referenceerror: menubuttonrounded not defined uncaught referenceerror: scaleimage not defined any suggestions why happen ? sample code below - <html> <head> <title>my page</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> </head> <body> <div data-role="page" id="page1"> <div data-role...

javascript - How to Show Value Of Button In TextBox With JQuery? -

im sorry if easy question, new scripting , html , jquery. trying make when 1 button pressed show value in box. acheived earlier element id trying jquery , confused why following code wont work. help! <html> <head> <title>page title</title> </head> <script> $(document).ready(function(){ $('#button1').click(function(){ var number1 = "1"; $('#output').html(number1); }); }); </script> <body> <input type="text" id="output"> <input type="button" name="one" value = "1" id="button1"> </body> </html> to button value jquery use $("#button1").attr("value") or $("#button1").val() in case set value of input text use $('#output').val($(this).attr("value")) the final code shoul <html> <head> <titl...

java - No X11 DISPLAY variable was set -

i running raspbian fadecandy server, using vncserver load x11 instance , running java app drive fadecandy controlled leds. need load during boot process. in /etc/init.d/ have bash script called fadecandy: #! /bin/sh # /etc/init.d/fadecandy # start fadecandy server sudo fcserver & sudo vncserver & export display=":1" /home/pi/fadecandy/runstopturn/runstopturn & runstopturn fails execute. if logon system , manually run error "no x11 display variable set..." by typing following @ prompt: export display=":1" runstopturn then works fine. i need setting display variable or passing java script on boot. hard without more logs, why running vncserver root ? start of problems. try running less-privileged user (create 1 if necessary), or if have to, run entire script root - mixing , matching users make environments , config hard right. edit: additionally, check /bin/sh points to. on small installs, less bash-like first t...

javascript - Angular UI-Router more Optional Parameters in one State -

how can allow optional parameters routes without using query string , using 1 route name? specifying each route 5 times allow combination of parts: all parts must optional. route must resolve variation. .state("login", { url: "/login", templateurl: "login.html", params: { a: null, b: null, c: null, d: null } }) .state("logina", { url: "/login/:a", templateurl: "login.html", params: { b: null, c: null, d: null } }) .state("loginab", { url: "/login/:a/:b", templateurl: "login.html", params: { c: null, d: null } }) .state("loginabc", { url: "/login/:a/:b/:c", templateurl: "login.html", params: { d: null } }) .state("loginabcd", { url: "/login/:a/:b/:c/:d", templateurl: "login.html" }) there must easier / cleaner / less ugly way. short answer.... .state('login', { url: '/login/:a/:b/:c/:d', templ...

java - How to fix my scanner in error if my .txt file is empty? -

i'm taking in strings file , places them linkedlist. program works fine when .txt file has data in it. however, when no data in .txt file seems throw error... exception in thread "main" java.util.nosuchelementexception @ java.util.scanner.throwfor(scanner.java:838) @ java.util.scanner.next(scanner.java:1347) @ task.main.main(main.java:85) would if/else statement fix this?? here's code i'm using, works if .txt file has data. //read in task data , place task data in ll string contentcomplete = new scanner(new file("completedata.txt")).usedelimiter("\\z").next(); linenumberreader lnr4 = new linenumberreader(new filereader(new file("completedata.txt"))); lnr4.skip(long.max_value); lnr4.close(); realsize = lnr4.getlinenumber(); sizeofin = ((lnr4.getlinenumber() + 1) / 4); //divide 2 because every 4 lines equal 1 input //--...