Posts

Showing posts from July, 2014

background - JavaFX2 : can not mix some "setStyle" on Pane -

Image
description on windows7 , jdk1.8.0_20, try display panes black border , given background color. using "setstyle" method that, following documentation http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#region . problem code within testpane class. see below full running code : package pane; import javafx.application.application; import javafx.scene.scene; import javafx.scene.layout.borderpane; import javafx.scene.paint.color; import javafx.scene.text.text; import javafx.stage.stage; public class borderpaneapp extends application { public static void main(string[] args) { launch(args); } @override public void start(stage primarystage) { primarystage.settitle("borderpane"); mainpane mainpane = new mainpane(); scene scene = new scene( mainpane, 400, 300, color.orange); // layout mainpane.prefheightproperty().bind(scene.heightproperty()); mainpane.prefwidthproperty().bind(scene.widthproperty()); primaryst...

ios - How to refer to navigation controller in Swift? -

i have created uinavigationcontroller object , set window's rootviewcontroller property. rootviewcontroller of uinavigationcontroller object class called uinavigationmenuviewcontroller . if want navigate uinavigationmenuviewcontroller uiuserprofileviewcontroller example, can use: navigationcontroller!.pushviewcontroller(userprofilevc, animated: true) as as navigationcontroller?.pushviewcontroller(userprofilevc, animated: true) the effect seems same. wondering what's difference. guess second way more secure, , in case forget embed uinavigationmenuviewcontroller object inside uinavigationcontroller , app not crash, comparing first case. guess it's called optionals chaining, not quite sure still learning swift. please give me advice. in case of doubt, it's safer favoring optional chaining rather forced unwrapping, reason mentioned: if variable nil, cause app crash. there cases crash debugging tool though. if having navigation controller set ...

c# - How to create a branch of TFS and copy the details of one branch to another branch -

scenario want copy of main branch details feature or release branch if pass path parameter in console application string uri ="http://portnumber0/tfs/dev"; connectbycredentialsprovider connect = new connectbycredentialsprovider(); icredentials icred = new networkcredential(@"username", "pwd"); connect.getcredentials(new uri(uri), icred); tfsteamprojectcollection tfsconnect = new tfsteamprojectcollection(new uri(uri), connect); tfsconnect.ensureauthenticated(); versioncontrolserver versioncontrol = (versioncontrolserver)tfsconnect.getservice(typeof(versioncontrolserver)); string sourcepath = "$/project/main"; string destinationpath = "$/project/features"; versioncontrol.createbranchobject(new branchproperties (new itemidentifier(sourcepath))); int changesetid = versioncontrol.createbranch( sourcepath, destinationpath, versionspec.latest); changeset changeset = versioncontro...

C++ Binary search like lower_bound -

i have problem binary search should work little lower_bound. gives me segfault in 5th run. can see problem ? thanks int binarysearch ( const char * a, int firstindex , int lastindex){ if (m_len == 0) return 0; //number of items in searched array if ( firstindex == lastindex ) return lastindex; int tmp = lastindex - firstindex; int pos = tmp/2; if ( tmp % 2 != 0 ) ++pos; if (strcmp(a,arr[pos]) < 0) return binarysearch(a,firstindex,pos-1); if (strcmp(a,name) > 0) return binarysearch(a,pos+1,lastindex); return pos; } int tmp = lastindex - firstindex; should be: int tmp = lastindex + firstindex; that because looking middle of indexes x , y (x+y)/2. your code's behaviour should unpredictable, possibly looping , causing segmentation fault.

How to execute shell cmd (python) using php and print all constant-updated outputs? -

i pretty new php actually. here's thing: want make simple web-shell well-known youtube-dl, made simple webpage , simple php page, trying use php execute youtube-dl , display outputs browser. i've try command thing , escapeshellcmd(), both of them can output first few lines of constant-updating outputs youtube-dl (and work other cmd "ls"), seems when first line, python script stop, no more updates, , there no downloaded video file on server. btw, it's on ubuntu 14 lts. so far, have tried these: <?php $command = shell_exec('youtube-dl https://www.youtube.com/watch?v=z456k6ybeo0'); echo "<pre>$command</pre>"; ?> and <?php echo `youtube-dl https://www.youtube.com/watch?v=z456k6ybeo0` > and <?php $command = escapeshellcmd('youtube-dl https://www.youtube.co/watch?v=z456k6ybeo0'); $output = shell_exec($command); echo $output; ?> both of them work...

c# - Why is my text box contained in a FlipView obscured by the soft keyboard when it pops up? -

Image
please consider following xaml: <page x:class="inputcontrolsinscrollviewer.windowsstoreapp.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:l="using:inputcontrolsinscrollviewer.windowsstoreapp" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d"> <page.resources> <style x:key="flipviewitemstyle" targettype="flipviewitem"> <setter property="background" value="transparent" /> <setter property="horizontalcontentalignment" value="stretch" /> <setter property="verticalcontentalignment" value="stretch" /> <setter property=...

jdbc - JBoss Module java.lang.ClassNotFoundException -

i'm trying deploy orientdb datasource jboss as7 using jdbc file, , keep getting [java.lang.classnotfoundexception: com.orientechnologies.orient.core.osignalhandler module "com.orientechnologies:main" local module loader @6f4051d1 (roots: /opt/jboss/modules) exception (link partial stack trace). thing - .class file in same jar class that's throwing error: cmdsl[/opt/jboss/modules/com/orientechnologies/main/] tue apr 14, 15:56:49|vagrant[788]$ ls module.xml orientdb-jdbc-2.0.7-all.jar orientdb-jdbc-2.0.7-all.jar.index cmdsl[/opt/jboss/modules/com/orientechnologies/main/] tue apr 14, 15:56:50|vagrant[789]$ jar tf orientdb-jdbc-2.0.7-all.jar | grep osignal com/orientechnologies/orient/core/osignalhandler.class i'm not sure why it's having trouble seeing that. server/boot logs don't seem provide additional errors. module.xml jar tf orientdb-jdbc-2.0.7-all.jar i've tried track down additional dependencies , expose separate modules, i'...

javascript - How to disable all parent and childs if one parent is selected? -

here in first condition able disbale parents except current parent selected. checkbox.js if (geolocation.id === 5657){ var getparent = geolocation.parent(); $.each(geolocation.parent(),function(index,location) { if (location.id !== geolocation.id) { var disableitemid = 'disabled' + location.id; // **strong text**the model var model = $parse(disableitemid); // assigns value model.assign($scope, true); } } ); at point trying disbale child parents disabled in above condition. how achieve task below code appreciated. so far tried code... $.each(geolocation.parent().items,function(index,location) { if(location.id !== geolocation.id){ var disableitemid = 'disabled...

Is there a way, using javascript, to check a website's server/database for changes that were sent and then implement a reload? -

so title says. can check website's server/database (or whatever called, sorry i'm new coding) changes made website can implement reload , implement code. in site's javascript can make small requests web server without reloading whole page, take action; e.g. change content on part of page, or maybe navigate somewhere else. can choose specific url request data from. common way structure things using rest , json . the regular part of site live @ www.example.com/myaccount, etc., , rest api live @ www.example.com/api/account/posts?dateafter=blah. can use client-side js libraries jquery send requests rest api, deserialize resulting json js objects, take action. on server side, various frameworks build apis, appropriate routing. depends kind of hosting, language expertise, etc. have.

c# - HTTP Error 405 Method not allowed while calling web api delete method? -

i trying call mvc controller application webapi applicaiton method. getting error 405 method not allowed. working fine while calling , post. mvc applicaiton: [httppost] public httpresponsemessage deleteservice(int id) { //code webapi } web api application: [httpdelete] public httpresponsemessage deleteservice(int id) { try { servicesmodel service = dbcontext.services.find(id); ienumerable<servicepropertiesmodel> serviceproperies = dbcontext.serviceproperties.where(x => x.serviceid == id); if (service != null) { foreach (servicepropertiesmodel s in serviceproperies) { dbcontext.serviceproperties.remove(s); } dbcontext.services.remove(service); dbcontext.savechanges(); } return request.createresponse(httpstatuscode.ok); } catch { return request.createresponse(httpstatuscode.badrequest)...

Phpmyadmin Session Start error on last version -

i've updated phpmyadmin 4.4.1 version 4.4.2 version , started error: warning in ./libraries/session.inc.php#101 session_start(): open(/var/lib/php/session/sess_bsv20h8gq58qq1ep33qbfrb7r62jtksi, o_rdwr) failed: permission denied (13) backtrace ./libraries/session.inc.php#101: session_start() ./libraries/common.inc.php#349: require(./libraries/session.inc.php) ./index.php#12: require_once(./libraries/common.inc.php) this happened on 2 different machines centos 6.6 installed. serber have apache 2.2, php 5.4 , nginx reverse proxy. in case, running nginx needed chown sessions directory nginx user , group... (by default, session folder in apache group). chown nginx:nginx /var/lib/php/session then force refresh phpmyadmin page , session permission related errors resolved. and if existing sessions, contents too:- chown -r nginx:nginx /var/lib/php/session

Python config parser raises exception for one value but not others -

i have following method: def populatestaticdetails(args): confparser = configparser.safeconfigparser() confparser.read(args.configfile) generator = '' emails = '' certtype = '' # ---- cert server check ---- # if args.generator none: try: generator = confparser.get('certificate generator', 'server').strip() except: log.fatal('no certificate generator server designated. please check configuration.') log.fatal('exiting.') exit(1) else: generator = args.generator # ---- cert type check ---- # if args.certtype none: try: certtype = configparser.get('application settings', 'cert').strip() except: print "unexpected error:", sys.exc_info()[0] log.fatal('no certificate type designated. please check configuration.') exit(1) else: certtyp...

How to add array in existing oracle sql cursor -

i dealing more 25 tables having association , need return simple array/cursor stored procedure. make simple question providing below example:- for mentioned below scenario want add subjects against each student means in existing emp_curr want add result of sub_cur. cursor emp_curr select st_id,st_name,st_surname student; begin n in emp_curr loop declare cursor sub_cur select sub_id,subject student_subjects st_id_fk=n.st_id; begin c in sub_cur loop -- here want store sub_cur values in existing emp_curr end loop; end; end loop; end; final output |-----------|--------------|----------|---------------|- |student id | student name |student id|student subject| |-----------|--------------|----------|---------------|- | 1 | prashant | 2 | maths | | 1 | prashant | 4 | english | | 1 | prashant | 3 | science | |-----------...

full text search - MySQL query to check if this is same product -

i'm working on price comparision program 3 website. each website can have same product other websites product name not same (ex: "asus x553ma-xx102h intel celeron n2930 4gb 1tb dvdrw 15.6 windows 8.1" , "asus x553ma 15.6 inch intel celeron 4gb 1tb laptop" 1 product name not same). i crawled data 3 website mysql table called crawledproduct(which has 3 columns: sourceurl, productname, price). please me write mysql query command find same product product name. ex: select * crawledproduct [similar 'asus x553ma 15.6 inch intel celeron 4gb 1tb laptop'] thanks help. i assuming name of product given input user or know product name wanna compare. need 'like' clause in query. suppose want search word 'axus': select name crawledproduct productname '%axus%' % called wildcard. tells dbms want search pattern. suppose want search "axus" in each row in column a: like '%axus' //this means give rows...

Regex in python. How to simplify my example? -

i'm new @ python programming. right i'm struggling simplifying existing code. here exercise: develop pattern match telephone number in format (xxx) xxx-xx-xx , xxx-xxx-xx-xx . i've come far: patt = "\(?\d{3}\)?\s?-?\d{3}-\d{2}-\d{2}" it works perfectly. problem obvious: if have optional pattern, say, "(specific-patter-ffddff445%$#%)--ds" before kind of fixed pattern, have put "?" symbol before every symbol in optional pattern. how can combine symbols , put 1 "?" mark? so have matches kinds of incorrect formats. example: 012)345-67-89 (012 345-67-89 what want option, regexes provide you: https://docs.python.org/3.4/library/re.html#regular-expression-syntax something preferable: patt = '(?:\(\d{3}\) |\d{3}-)\d{3}-\d{2}-\d{2}' this match either "(xxx) " or "xxx-" prefix "xxx-xx-xx". , not match either of error strings listed above. ? should used in event operat...

ios - UINavigationBar in UINavigationController rotations not acting as expected (items shifted up) -

i've been working on set of ios action extensions seem having problem way uinavigationbar being displayed in app if controlled uinavigationcontroller. the problem, in short navigation bar gets shifted when rotate portrait, landscape, , portrait again. problem exacerbated if rotate way around. wish provide images, cannot given rules of stackoverflow. regardless, tested using modified action app extension (modified lower target os, silence warning nsextensionactiviationrule, etc), both uinavigationbar embedded in uinavigationcontroller , not embedded, view in actionviewcontroller. when not in uinavigationcontroller, rotations expected, retains white patch around status bar (and navigation bar wider in landscape orientation), when put uinavigationcontroller, bar button items shifted up. this tested pretty thoroughly in 8.2, , running modified app, looks 1 expect. know going on here? why button shifted when use uinavigationcontroller in 8.3 , not 8.2? can't seem find docu...

Why is my client CPU utilization so high when I use a cassandra cluster? -

this follow-on question why cassandra throughput not improving when add nodes? . have configured client , nodes closely recommended here: http://docs.datastax.com/en/cassandra/2.1/cassandra/install/installrecommendsettings.html . whole setup not world class (the client on laptop 32g of ram , modern'ish processor, example). more interested in developing intuition cassandra infrastructure @ point. i notice if shut down 1 of nodes in cluster , run test client against it, throughput of ~120-140 inserts/s , cpu utilization of ~30-40%. when crank 6 nodes , run 1 client against them, see throughput of ~110-120 inserts/s , cpu utilization gets between ~80-100%. all tests run clean db (i delete db files , restart scratch) , insert 30m rows. my test client multi-threaded , each thread writes exclusively 1 partition using unlogged batches, recommend various sources schema mine (e.g. https://lostechies.com/ryansvihla/2014/08/28/cassandra-batch-loading-without-the-batch-keyword/ ). ...

python - OrderedDict for Parsimonious -

i'm using parsimonious parse csv. problem output generated not coming out in order expected. example, if input string load,file,sample then i'd expect get: import database sample what instead is: from sample import database this consistent problem every input try: first token last item in entry ordereddict can't figure out why. here's code: from parsimonious.grammar import grammar parsimonious.nodes import nodevisitor collections import ordereddict class entryparser(nodevisitor): def __init__(self, grammar, text): self.entry = ordereddict() ast = grammar(grammar).parse(text) self.visit(ast) def visit_alt(self, n, vc): self.entry['alt'] = "alter " def visit_load(self, n, vc): self.entry['load'] = "import database " def visit_app(self, n, vc): self.entry['app'] = "application " def visit_db(self, n, vc): self.entry['db...

scala - How to (properly) enrich the standard library? -

i define implicit conversion iterator[t] class have defined: proactiveiterator[a] . the question isn't how how properly, i.e. place method, transparent , unobtrusive possible. ideally should implicit conversion string stringops in scala.predef if conversion class in library other class, defined inside class, afaik that's not possible here. so far have considered add object containing these conversions , javaconversions , better options may possible. you don't have of choice. implicits must contained within sort of object, , imported wildcard import (you could import them individually, doubt want that). so you'll have sort of implicits object: package foo.bar object implicits { implicit class proactiveiterator[a](i: iterator[a]) { ... } } then must explicitly import wherever use it: import foo.bar.implicits._ in opinion, thing. reading code might not understand pimped methods coming from, explicit import helpful. you can p...

c# - UpdateCommand not working? -

so have code stores update query in string, parameter bind update query , execute , update it, code: string query = "update users set first_name = '@firstname' id = @id"; updateuserds.updateparameters.add("id", httpcontext.current.session["columnid"].tostring()); updateuserds.updateparameters.add("firstname", txt_firstname.text); updateuserds.updatecommand = query; updateuserds.update(); however when change string query to: string query = "update users set first_name = 'name' id = 44"; it works , updates table, guessing how have binded query, realise have gone wrong? btw: session["columnid"] being retrieved states 44 in stack trace remove single quotes @firstname : string query = "update users set first_name = @firstname id = @id"; updateuserds.parameters.addwithvalue("@firstname", first_name); updateuserds.parameters.addwithvalue("@id", httpcontext.curren...

javascript - Using window.location within an angular aplication -

i trying use window.location.pushstate change url without refresh in angularjs application. reason because whole logic behind routing on done on server side don't want use html5 mode. however, after using pushstate url changed required 1 , previous one. suspect because changing url outside angular $location service thinks should change before (since different). there ways around it?

java - Javafx Mediaview settings according to scene property -

i trying change media view height , width according media player window. please tell me how can adding scene.setonzoom(). in order re-size mediaview along scene, bind fitwidthproperty , fitheightproperty of mediaview scene's widthproperty , heightproperty respectively. mediaview.fitwidthproperty().bind(scene.widthproperty()); mediaview.fitheightproperty().bind(scene.heightproperty());

c# - Creating objects based on a string using Ninject -

i need create objects sharing common interface (ifoo) based on string database. have "a", need intantiate afoo, "b", need produce bfoo, etc. first thing tought of factory . objects created (afoo, bfoo) need have dependencies injected (and dependencies need more dependencies , arguments). injecting use ninject, seems fancy factory. create objects within factory inject ninject's kernel via constructor. desired way? interface ibar { } class bar : ibar { public bar(string logfilepath) { } } interface ifoo { } class afoo : ifoo { public afoo(ibar bar) { } } class bfoo : ifoo { } class foofactory : ifoofactory { private ikernel _ninjectkernel; public foofactory(ikernel ninjectkernel) { _ninjectkernel = ninjectkernel; } ifoo getfoobyname(string name) { switch (name) { case "a": _ninjectkernel.get<afoo>(); } throw new notsupportedexception("blabla"); ...

mongoose - Node.js rest api validate incoming json from url -

i have simple rest api excepts json in url through request. i have mongoose schema , validate incoming json in correct format. can mongoose alone? yes, can create document parsed json using model , validate . // assuming having parsed json yet var doc = mymodel(json.parse(json_from_url)); doc.validate(function(err) {...}); note: mongoose queries validate document before saving database.

process - C Programming: Fork() and IPC with Pipes -

so have problem, need create 3 processes (each handle different task). first process sends information on second (the first waits acknowledgement second). second sends information third (the second waits acknowledgement third). third processes final information... process supposed loop on , on until process 1 analyzes entire text file. far, tried writing communication between 3 processes pipes. i'm not sure how send acknowledgment process 2 process 1 , process 3 process 2. i'm not entirely sure how loop it. thanks! i have use stop , wait protocol... i'm not sure how done. #include <stdio.h> #include <string.h> #include <sys/wait.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { int c = 0, t = 0; int fd1[2], fd2[2]; char *thefile = "/users/desktop/thefile"; file *file = fopen (thefile, "r"); if (file == null) { perror("file not exist"); e...

struts2 - How to fetch checkbox (generated inside a iterator tag) values in Action Class -

background we have list of items , each item can selected checking checkbox. if submit button clicked after selecting necessary checkboxes. now, in our action class, values of checkboxes had been selected, can store selection check box values in database. environment: struts 2.3.20 when run below mentioned code, jsp creates dynamic checkboxes fine. when select checkboxes , hit save button below mentioned error. if has encountered similar issue can share experience on how resolved issue highly appreciated. error: null pointer exception @ line 54 of action class. ( com.testapp.struts2.actions.addproductsaction.execute(addproductsaction.java:54) addproducts.jsp : <s:form action="addproducts2campaign" method="post"> <s:iterator value="productslist" status="stat"> <tr bgcolor="<s:if test="#productstatus.odd == true">#999999</s:if><s:else>#ceddf4</s:else...

vb.net - Visual basic Kinect -

i trying set value of right hand joint label value remains 0 . label2.text = handright.position.x.tostring & "," & handright.position.y.tostring the value of x , y single is there way ? provided there actual values in handright.position, should work: label2.text = string.format("{0}.{1}", handright.position.x, handright.position.y)

actionscript 3 - Different versions of AIR and Flash being used in release and debug -

i making few http/https requests servers adobe air application. while monitoring network traffic (using fiddler web debugger), noticed when debugging, different version of air , flash being used when installed application (production) executed. here's differences:- **production** user-agent: mozilla/5.0 (windows; u; en-us) applewebkit/533.19.4 (khtml, gecko) adobeair/17.0 x-flash-version: 17,0,0,128 **debug - adt** user-agent: mozilla/5.0 (windows; u; en-us) applewebkit/533.19.4 (khtml, gecko) adobeair/3.1 x-flash-version: 11,1,102,58 how can ensure running application same version of air , flash while debugging, because difference in environments cause of concern. you can target specific flash players compiler options... swf-version=17 here docs using options

javascript - Observe when any Ember.ObjectController in Ember.ArrayController changes -

i'm trying set mass-action checkboxes (for delete selected items) in ember app. idea make mass-action dropdown show or hide if 1 of checkboxes selected. haven't put in dropdown yet since can't figure out how observe elements in array. how can i: set array controller observes client objects get number of checked items when changes also: on track conventions of how i'm approaching client itemcontroller? app/templates/clients.hbs <section id="clients"> <h4>my clients</h4> <ul> {{#each itemcontroller="clients/client"}} <li> {{input type="checkbox" name="markedfordeletion" checked=markedfordeletion}} {{#link-to 'clients.show' this}} {{clientname}} {{/link-to}} </li> {{/each}} </ul> </section> {{#link-to 'clients.new'}}add client{{/link-to}} {{outlet}} router.js import...

python - Find unsorted indices after using numpy.searchsorted -

i have large (millions) array of id numbers ids , , want find indices array of targets ( targets ) exist in ids array. example, if ids = [22, 5, 4, 0, 100] targets = [5, 0] then want result: >>> [1,3] if pre-sort array of ids , it's easy find matches using numpy.searchsorted , e.g. >>> ids = np.array([22, 5, 4, 0, 100]) >>> targets = [5, 0] >>> sort = np.argsort(ids) >>> ids[sort] [0,4,5,22,100] >>> np.searchsorted(ids, targets, sorter=sort) [2,0] but how can find reverse mapping 'unsort' result? i.e. map sorted entries @ [2,0] before: [1,3] . there few answers dancing around already, make clear need use sort[rank] . # setup ids = np.array([22, 5, 4, 0, 100]) targets = np.array([5, 0]) sort = np.argsort(ids) rank = np.searchsorted(ids, targets, sorter=sort) print(sort[rank]) # array([1, 3])

javascript - How could I check my regexp value it correct? -

i need check value provided user correct , correspond following format 47:vkqfauuz , 5:dkqdau3d . first path number , second part string of 7-14 length? edit : second part following symbols a-z, a-z, 0-9, _- try regex: ^\d{1,2}:[a-za-z0-9_-]{7,14}$ fiddle

Eclipse Generic Warning : Type safety: Unchecked cast from T to E -

how can avoid generic warnings in following code? eclipse generic warning : type safety: unchecked cast t e is there way improve code. putting , removing values stack. public static <t, k, e> void genericstack(t a, k b) { stack<e> st = new stack<e>(); st.push((e) a); st.push((e) b); b = (k) st.pop(); = (t) st.pop(); }

machine learning - GBM R function: get variable importance separately for each class -

Image
i using gbm function in r (gbm package) fit stochastic gradient boosting models multiclass classification. trying obtain importance of each predictor separately each class, in picture hastie book (page 382). however, function summary.gbm returns overall importance of predictors (their importance averaged on classes). does know how relative importance values? i think short answer on page 379, hastie mentions uses mart , appears available splus. i agree gbm package doesn't seem allow seeing separate relative influence. if that's you're interested in mutliclass problem, pretty similar building one-vs-all gbm each of classes , getting importance measures each of models. so classes a, b, c, & d. model vs. rest , importance model. model b vs. rest , importance model. etc.

Windows authentication not working properly on google Chrome -

i've been doing research while , still can't answer this. problem have web-app using windows auth, when user access using chrome works fine, after 2-3 min site prompts authentication again , time doesn't work. i've tried several things , nothing can fix this. same problem ? thanks in advance.

google apps script - Force Bootstrap to render mobile friendly -

i'm working on responsive design using google apps scripting , have run issues. site contents piped through iframe sandbox prevents me setting meta viewport. means no matter device view application on, it's treated desktop application. for example, viewing web app on galaxy s4 shows full 1080x1920 view. google creates sandbox iframe , sets resolution of device. don't let create meta element , creating via javascript won't can't modify contents outside of sandbox. once page has loaded, can scale window , elements resize expected, me no on mobile device. the best can come retrieve navigator.useragent after page has loaded , modify each element after fact. far ideal. so, there way trick bootstrap rendering mobile or stuck writing media queries , custom css? i had similar problem (within modal, not iframe) created pretty lengthy basic css page solve it: https://github.com/shawntaylor/bootstrap-force-device once add css file project, call ...

vb.net - How to save a txt file to a predetermined location in vb 2010? -

hi have textbox displays bunch of names on it. names within string called "strnames". i'm trying have save button saves names txt file in predetermined location. here code save button. creates file without list of names. please help! given fact strnames array of strings use file.writealllines , no need use streamwriter here private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click file.writealllines("c:\test.txt", strnames) end sub this has advantage against streamwriter approach if don't need particular processing input array before writing file, no foreach around array strings , don't need encapsulate streamwriter in using statement ensure proper release of system resources

ios - Segue to view with Navigation Controller -

my app has walkthrough @ start of it. it vc1 -> vc2 -> vc3 custom segues between each vc. the main view of app series of view controllers navigation controller. nav controller (root view of) -> vc4 (main) -> vc5 the app delegate determines whether initial view controller vc1 or nav controller my question how segue (or push) vc3 vc4 , have navigation controller work can push via navigation controller vc5? once app has segued vc4 never need go vc3. the nav bar hidden in entire app. cheers, andy create segue in between view controllers, not linked button, , set identifiers in storyboard different each one. can use code perform segues programmatically: [self performseguewithidentifier:@"youridentifier" sender:self]; using this, can control , when segues happen. question can't discern what want do, hope helps.

Using a Date in Excel Formula without using VBA -

i trying combine 4 formulas work independently 1 formula provide information users in regards status of task in excel (this have available work with). cell b6: project due date: 9/12/15 cell b7: document received date: filled in user the document must received -150 days of project due date formulas , result: if(and(b6="",b7=""),"","") this works if(and(b6="",b7<>"",today()=b7-150),"due today","") this works if(and(b6="",b7<>"",today()>b7-150),"overdue","") this works if(and(b6="",b7<>"",today()>=b7-155,today()<=b7-151),"approaching due date","") this works =if(b6<>"","complete","") this works unforunately can't have 5 cells determine status, naturally combine them 1 cell , can't come right formula. this have put #valu...

sharding - How to Insert a document to a specific shard in Apache Solr Cloud Mode -

is there way can add documents specific shard? for example, documents type inserted shard1 , document type b go shard2. i have tried using custom router not guaranty different prefix route different shard. ps. on solr 5 using cloud mode. a caveat: i'm using solrnet access solrcloud, , doesn't integrate zookeeper yet. java clients, might far easier. despite read here , here regard compositeid router , never work. @jay helped me figure out way use "implicit" routing achieve this. if create collection (leave out numshards parameter): http://localhost:8983/solr/admin/collections?action=create&name=mycol&maxshardspernode=2&router.name=implicit&shards=shard1,shard2&router.field=shard then add field schema.xml named "shard" (matching router.field parameter), can index specific shard adding shard field document being indexed , specifying shard name. @ query time, can specify shards search -- more here (i able spe...

css - WP Images not aligning as expected -

here's what's up. i've got post has images, , i'm trying them wrap paragraph text, it's not behaving way expect. insight? simple fix i'm missing. relevant styles img.alignright { float: right; margin: 0 0 1em 1em; } img.alignleft { float: left; margin: 0 1em 1em 0; } img.aligncenter { display: block; margin-left: auto; margin-right: auto; } .alignright, .alignleft { display:inline;} .alignright { float: right; } .alignleft { float: left; } .aligncenter { display: block; margin-left: auto; margin-right: auto; } .wp-caption {font-size:10px; max-width:100%;} page in question: http://dev.traction.media/mmsheeks/alice/i-spy/ any pointers? styles.css:91 .main p { font-family: 'source sans pro', sans-serif; font-size: 1.3em; /* float: left; */ margin: 1em auto; }

c# - How do you query for Array Tags using Proficy Historian 5.5 ihuapi.cs? -

array tags introduced in proficy historian 5.5. additionally, sample code provided access user api (ihuapi.dll). sample code comes in form of: 1) c++ header file (ihuapi.h) along sample programs. 2) c# wrapper file (ihuapi.cs) along sample programs. these files not contain same functionality. header file (ihuapi.h) contains references various data types (ihudatatype) including new array type ihuarrayvalue , c# file not. if compile of sample applications use ihuapi.cs , attempt query values array tag, receive exception, " unsupported valuedatatype ". because there no provision array data type in ihuapi.cs file. in addition getting exception message, api code tell how many data samples returned query , timestamps of samples. exception when try read values of samples. appears memory pointer unknown kind of structure behind pointer. how can ihuapi.cs file extended support querying array tags?

javascript - How to remove hover effect in Angular -

i trying build angular app , have 1 problem. i have this <div ng-class="{selectthis : item.pick}" ng-click="pickitem(item)" class="item">item name here<div> js controller: $scope.pickitem = function(item) { item.pick = true; } css: .item { color: red; …more css } .item:hover { color:blue; ...more css } .selectthis { color:blue; } it works on desktop hover effect remain on touch device when user touches div. know can add media query solve think that's outdated approach. there anyways can solve angular way? lot! you solve angular adding class when touch events fired: app.directive('touchclass', function() { return { restrict: 'a', scope: { touchclass: '@' }, link: function(scope, element) { element.on('touchstart', function() { element.$addclass(scope.touchclass); }); element.on('touchend', func...

asp.net mvc - MSBuild Publish and Compass Generated Sprites -

i'm using compass generate stylesheets , image sprites c# mvc .net project. great , works seamlessly. however, i'd able use msbuild "publish" functionality part of automated build. problem compass generated sprites change names time, , errors 1 when try build: c:\program files (x86)\msbuild\microsoft\visualstudio\v12.0\web\microsoft.web.publishing.targets(2972,5): error : copying file images\icons-s88f86b4a16.png obj\release\package\packagetmp\images\icons-s88f86b4a16.png failed. not find file 'images\icons-s88f86b4a16.png'. i'm not sure how work around this. there way automatically add new images csproject , remove old ones? has run similar? from personal experience, web deploy or publish visual studio pick files not part of solution long they part of web application on file system. for example: mvcsite -- images/spirtes.png if publishing copy of mvc site, contents of images folder replicated on web server if not included in pr...

java - Update database in one frame and show updated values in another -

i have created banking system user can deposit (for now). program uses ms access database. i've loaded database; working enough. except, when user makes deposit, while database being updated @ click of "deposit" button, user has log out , log in see updated balance (this in frame called "account details). is there way refresh database @ click of button refreshes throughout entire program? i've been looking @ arrays. can store database in array , call in account details window? if so, how can this? loaddata window loading database public static account accounts[] = new account[2]; public static customer people[] = new customer[2]; public static creditcard credit[] = new creditcard[2]; public static mortgage mortgage[] = new mortgage[2]; public static transaction trans[] = new transaction[100]; loaddata() { int = 0; try { //connect database connection conn = drivermanager.getconnection("jdbc:ucanaccess:///volumes/green gr...

javascript - Trying to redirect to page on click -

no expert when comes js/jquery, im trying use code, , once registration sign done correctly, , information stored, instead of alert box, wanna have redirect web page... ive got far, ive tried few things, none seem working... doing wrong, , how fix this? $(document).ready(function () { $("#register").click(function () { var name = $("#name").val(); var email = $("#email").val(); var password = $("#password").val(); var cpassword = $("#cpassword").val(); if (name == '' || email == '' || password == '' || cpassword == '') { alert("please fill fields...!!!!!!"); } else if ((password.length) < 8) { alert("password should atleast 8 character in length...!!!!!!"); } else if (!(password).match(cpassword)) { alert("your passwords don't match. try again?"); } else { ...

terminology - What's it called when a compiler faces a reference to a thing defined later in the code? -

there's common issue have deal when designing compiler: 1 line of code might refer defined on later line. example: function f() { return g(5); } function g() { something; } the first line refers function g hasn't been defined yet, compiler has keep track of reference g in current scope. when g gets defined on next line, compiler can determine previous line referred to. what called? i know there's term in compiler design, can't remember it. it called forward reference .

ios - UIImagePickerController Causes Autolayout Errors with Video Only -

i using uiimagepickercontroller can bring camera, photo album, or video controls. there no issues camera or photo album; however, when apple video controls brought ton of autolayout errors show in debugger. apple's stock view , not can control. here errors shows: unable simultaneously satisfy constraints. probably @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints) ( "<nslayoutconstraint:0x198b4b60 v:|-(11)-[camflipbutton:0x156d6300] (names: '|':cambottombar:0x1988e810 )>", "<nslayoutconstraint:0x1989c060 camshutterbutton:0x198a30b0.centery == cambottombar:0x1988e810.centery>", "<nslayoutconstrai...

c# - Bullet Physics - Step outside of body -

i have interesting little problem using bullet physics engine. in course of physics occurring, it's natural within engine rigidbody as 0.01 units inside of body. fine within simulation, knows not fall through each other. however, not moment call body.translate recorded position. while body entering body naturally physics engine fine, function call not. translating position entity in, body no longer remembers stay outside of body, , falls through. how go of following: stepping moved body outside any/all bodies it's touching. preventing body entering another anything else keep first body going through second (note: actual use case bit more complex described, what's going on. can provide more details if necessary).

ios - AFNetworking How to send a string of post request? -

afnetworking how send string of post request? //restrinbase64string nsstring ,program error [manager post:urlstring parameters:restrinbase64string success:^(afhttprequestoperation *operation, id responseobject) { } failure:^(afhttprequestoperation *operation, nserror *error) { }]; solve problem nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:[nsurl urlwithstring:urlstring]]; [request sethttpmethod:@"post"]; nsmutabledata *postbody = [nsmutabledata data]; [postbody appenddata:[restrinbase64string datausingencoding:nsutf8stringencoding]]; [request sethttpbody:postbody]; afhttprequestoperation *operation = [[afhttprequestoperation alloc]initwithrequest:request]; operation.responseserializer = [afhttpresponseserializer serializer]; [operation setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) { } failure:^(afhttprequestoperation *operation, nserror *error) { }]; [[nsoperationqueue mainqu...

assembly - IA86 ASM Code Reading -

i'm having hard time deciphering asm code below supposed do... direction great! pushl %ebp movl %esp, %ebp movl 8(%ebp), %ebx movl 12(%ebp), %esi movl $0, %ecx l1: movl (%ebx, %ecx, 4), %edi cmpl $100, %edi jl l2 movl $100, (%ebx, %ecx, 4) jmp l3 l2: cmpl $-100, %edi jg l3 movl $-100, (%ebx, %ecx, 4) l3: addl $1, %ecx cmpl %ecx, %esi jne l1 leave ret it's function takes 2 arguments - pointer array of integers , size. goes through array, , replaces values on 100 100, , ones below -100 -100.