Posts

Showing posts from January, 2013

html - Why View source of the page is different than Inspecting the element of the page -

okay i'm using producteev.com on projects, other day noticed on workspace page, source of page (ctrl+u) quite short , of page's items not in view source code. but of course if inspect elements of page see actual codes. i'm not sure if right place ask such question i'd know why happening , using technology maybe? , why use such techniques? viewing source shows source code. inspecting dom shows serialisation of current state of dom after html has been parsed, error corrected, normalised , (possibly) manipulated javascript.

Extract multiple strings using regex -

i want extract multiple strings 1 string based on regex. example: input string : 20140909 sample string 1 training complete useless string training complete useless string 2 training complete useless string 2 training complete 20120206 sample string 2 training complete i want extract strings between date string , training complete string. expected output of above string following 2 strings 20140909 sample string 1 training complete 20120206 sample string 2 training complete regex using: (\d{8})(.*?)training complete gives first required string, want required strings. you need use global modifier g online demo /(\d{8})(.*?)training complete/g g stands g lobal. matches , not on first match

excel - Trying to find all possible combinations -

Image
i have been trying work through following problem using excel , not sure start, have tried using combinations , permeation have basic understanding of them, how guys approach solving this? there 6 kinds of coffee , there 10 kinds of flavor shots , can put one, 2 or 3 shots in each kind of coffee. based on this, know (and list) unique flavor combinations , how long go without having same cup of coffee. very simple macros. the first thing note need combinations rather permutations. because {kona,vanella,chocolate} same {kona,chocolate,vanilla}. place 6 coffee a1 thru a6 place 10 flavors in b2 thru b11. leave b1 empty. enter , run following vba macro: sub coffeemixer() dim k long, _ long, _ j long, _ l long, _ z long z = 1 = 1 10 cf = cells(i, 1).value j = 1 11 fl1 = cells(i, 2).value k = j+1 11 fl2 = cells(k, 2).value l = k+1 11 ...

Swift: Property conforming to a specific class and in the same time to multiple protocols -

in objective-c, it's possible write that: @property(retain) uiview<protocol1, protocol2, ...> *myview; but how can write code in swift? i know how make property conform many protocols, not work using inheritance: var myview: ??? protocol<protocol1, protocol2, ...> edit: i use many uiview subtypes uiimageview , uilabel or others, , need use of uiview properties plus methods defined in protocols. in worst case create uiviewprotocol needed properties, know if possible in swift declare property/variable type , protocol conform with. you can generic class using where clause : a clause enables require associated type conforms protocol, and/or type parameters , associated types same. to use it, make class property defined in generic class type constraint check if type parameter property matches desired base class , protocols. for specific example, this: class myviewcontroller<t t: uiview, t: protocol1, t: protocol2>: uiview...

android - Unable to update APP on Google Play Store -

i had application in google play time now. tried update new version. when tried error message: you uploaded apk not zip aligned. need run zip align tool on apk , upload again. i think pretty obvious have key store , etc. should fix problem?

database - MySQL show used index in query -

for example have created 3 index: click_date - transaction table, daily_metric table order_date - transaction table i want check query use index, use explain function , result: +----+--------------+--------------+-------+---------------+------------+---------+------+--------+----------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | | +----+--------------+--------------+-------+---------------+------------+---------+------+--------+----------------------------------------------+ | 1 | primary | <derived2> | | null | null | null | null | 668 | using temporary; using filesort | | 2 | derived | <derived3> | | null | null | null | null | 645 | | | 2 | derived | <derived4> | | null | null ...

extjs - Sencha CMD Error "Did not locate framework package" -

i'm new sencha , installed sencha cmd. following sencha's instructions type following on command line: sencha generate app -ext myapp ./app but error message: c:\senchacmd\sencha>sencha generate app -ext myapp ./app sencha cmd v5.0.1.231 [wrn] did not locate framework package [err] java.lang.nullpointerexception @ com.sencha.util.pathutil.normalizepathcharacters ... ... @ com.sencha.command.sencha.main(sencha.java:141) i've searched internet error message , haven't found anything. try below command generate sencha app. sencha -sdk f:/touch-2.3.0 generate app test-app . (dot represent current directory) sdk path touch library. test-app app name.

sql - select query in Cursor taking too long -

i have designed cursor run stats against 6500 inspectors taking long. there many other select queries in cursor running okay following select running very slow. without cursor select query running fine. requirements: number of visits each inspectors visits has uploaded document (1 or 2 or 13) tables: inspectors: inspectorid inspectionscope: scopeid, inspectorid (fk) visits: visitid, visitdate scopeid (fk) visitsdoc: docid, doctype, visitid (fk) cursor code: declare @curinspid int, @datefrom date, @dateto date; select @dateto = cast(getdate() date) ,@datefrom = cast(getdate() - 90 date) declare @inspectorid int, @totalvisits int; declare @report table ( inspectorid int, totalvisits int) declare curlist cursor select inspectorid inspectors ; open curlist fetch next curlist @curinspid; while @@fetch_status = 0 begin select @curinspid = s.inspectorid ,@totalvisits = count(dis...

html - <meta name="viewport" content="width=device-width, initial-scale=0" /> not working -

i'm making responsive website bootstrap 3, , works when resize browser. when open website mobile (nokia lumia 920 internet explorer), not responsive @ all. bootstrap columns not working, breakpoints not working. i've googled it, changing breakpoints did not help. here html <!doctype html> <html class="no-js" data-placeholder-focus="false"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=0" /> <meta name="mobileoptimized" content="0" /> <title>index</title> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta name="author" content="constr" /> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" hr...

java - Different output from mks-integrity xmlapi -

i want see if else had same experience mksapi.jar using java in comparison command line. running on windows. my problem using option --xmlapi cli or using com.mks.connect.abstractcmdrunner.executewithxml(string[] cmd) java api gives different output node response//workitems//workitem//field//value while cli has additional node tokenvalue containing value of "value", java api gives value part of value node. example: <field name="projecttype"> <value datatype="string"> <tokenvalue>variant</tokenvalue> </value> </field> vs. <field name="projecttype"> <value datatype="string">variant</value> </field> i wonder if 1 of has explanation - or better solution align both outputs whatever version. this example part of result si sandboxinfo --xmlapi there no guarantee 2 provide same results. the --xmlapi option unpublished option, it...

design - when should one actually go for DDD and when it is considered an overkill? -

i need practical examples/comparatives when can/should use ddd , when can't/shouldn't use ddd? like many other "good" programming practicies ddd cares of achieveing of maximum gain allowing deal difficulties. knowledge , experience. ddd (as 1 uses principles , patterns benefits) can applied when: it's necessary support large , complex domain model, containing difficult business rules , lots of classes. developers have enough skills in both oop , ddd. every person working on project have understand importance of model, domain knowledge , domain language. whole team should "move to" deeper understanding of domain , correctly implement knowledge. developers have enough tecnical skills opportunity concentrate on how model implemented. project considered long-lived. project owner (or manager) should understand additional costs incorporating of ddd , benefits. project uses oo main developing paradigm. ddd not usefull or cannot applie...

why this php global doesn't echo in Wordpress plugin -

i'm new php , i'm not sure why doesn't work. have done page said http://php.net/manual/en/language.variables.scope.php (example #1 using global)... why not working? it's frustrating. this first attempt on wordpress plugins. first file contains: function pp_sa_menu(){ add_menu_page('shadow accounts search', 'shadow accounts', 'manage_options', 'shadow_accounts', 'pp_sa_search'); } add_action('admin_menu','pp_sa_menu'); function pp_sa_search(){ include('shadow-accounts/admin/sa-admin.php'); } then sa-admin.php file problem happens <?php $sandbox = true; $phost = 'localhost'; $pus = 'user'; $ppas = 'pass'; $pus = 'hello world'; function testfunc(){ global $phost; return $phost; } echo testfunc(); //empty function getforumaccounts(){ global $pus; echo $pus; // empty echo 'test'; // shows 'test' echo $p...

android - FileNotFoundException when calling HttpURLConnection getInputStream -

i have app want update private server. code below should download new apk file server , write sdcard app can update from. i'm getting filenotfoundexception. file exist on server. any ideas why may happening? thanks public void updateapp(string version){ try { version = version.trim(); string urlwithversion = "http://cfweb.yourofficeanywhere.co.uk/entryactivityv" + version + ".apk"; url url = new url(urlwithversion); httpurlconnection c = (httpurlconnection) url.openconnection(); c.setrequestmethod("get"); c.setdooutput(true); c.connect(); log.e(tag, " httpurlconnection = connected"); string path = environment.getexternalstoragedirectory() +"/"; file file = new file(path); file.mkdirs(); log.e(tag, "mkdirs()"); file outpu...

ios - UIScrollView Delegate Method Is Not Firing -

i have added scrollview subview , confirm delegate. contentview = [[uiscrollview alloc] initwithframe:cgrectmake(0.0, 0.0, frame.size.width, frame.size.height)]; contentview.showshorizontalscrollindicator = no; contentview.showsverticalscrollindicator = no; contentview.delegate = self; [self addsubview:contentview]; all working fine. when scroll fast , rapidly, delegate methods not fired. scrollviewdidenddecelerating: scrollviewdidendscrollinganimation: scrollviewdidenddragging:willdecelerate: don't know why happening?

html - Div is not overlapping div below it -

i have 2 divs 1 of them navigation menu , other div under it, these divs touching each other. main menu has sub menu papers when hover of , works , doesn't move divs around or getting hidden div under main menu how fix it? html <div id="mainmenu"> <ul id="yw2"> <li><a href="/photoshop/index.php?r=home">home</a></li> <li><a href="/photoshop/index.php?r=site/page&amp;view=about">about us</a></li> <li><a href="#">portofoloio</a> <ul> <li><a href="#">photography</a></li> <li><a href="#">videography</a></li> </ul> </li> <li><a href="/photoshop/index.php?r=home/#">wedding services</a></li> ...

Android MediaPlayer play m3u8 only audio streamming not worked -

hi every 1 write code play fm radio waves. in code there progressbar , 2 buttons 1 of them play , stop. when click play button not happen. how can solve problem? or there suggest me play audio m3u8 files? code i'm using is: public class main extends activity implements onclicklistener { private progressbar playseekbar; private button buttonplay; private button buttonstopplay; private mediaplayer player; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); initializeuielements(); initializemediaplayer(); } private void initializeuielements() { playseekbar = (progressbar) findviewbyid(r.id.progressbar1); playseekbar.setmax(100); playseekbar.setvisibility(view.invisible); buttonplay = (button) findviewbyid(r.id.buttonplay); buttonplay.setoncl...

Integer to string length in python? -

i trying create function takes integer (n) , returns string n-amount of hashes. ex: if n 5, string : ##### if n 2 string : ## here's such function: def f(n): return '#' * n usage: >>> f(5) '#####' >>> f(2) '##'

Instead of toggling a Jquery-Selectable on and off, how can I add another toggle option -

i've been scouring web solution on how this, i'm not getting leads @ all. of terms keep overlapping others; (e.g. html-select, adding-options, jquery-multiselect). figured it's common too, @ least posted on blog, tricky find. the issue: wanna able add class selectable rotation in jquery selectable. right rotation of know toggling "ui-selected" on/off. [there ui-selecting, i'm referring end result]. ultimately, i'm trying add additional grouping. (e.g. "none-selected", "selected-with-a-click", "selected-with-two-clicks"). when serialize application, have 2 lists send. //note: not real syntax color styling &ltli class="hlight ui-selectee"/> *no click* &ltli class="hlight ui-selectee ui-selected" style="blue"/> *one click* &ltli class="hlight ui-selectee ui-alt-selected" style="green"/> *two-clicks the research: far i've f...

Ant task to automatize spring roo operations? -

i need automatize spring roo tasks ant build.xml . somehow possible? maybe there ant task lib job? using ant instead of maven/gradle/... isn't decision , can't it. calling roo shell exec task last resort, want solution don't need step out jvm of ant process. roo shell executes on osgi environment , requires run (uses osgi dependency injections component in runtime). so, ant runs simple java application, no way run roo shell ant task bug use ant exec task (as comment). sorry.

Powershell regex replace only first hit -

i'm trying use regular expression replace first character after single hit, while using powershell. no matter how try, can't seem make work. here's i'm talking about: code: $info = 'ab/f/*zxcvbn/mtf/ ---' $regex = [regex]'/*' $regex.replace($info,"/c",1) $regex output: /cab/f/*zxcvbn/mtf/ --- i'm trying replace /f in expression /c , fails every time. i'm using /* since don't know character find after first / that's want replace in end of day. i pretty sure pretty simple but, can see, i'm, not familiar enough regular expressions. ok, rather comment guess i'll add answer. can use negative lookbehind make sure there no /'s before matching, match first one. also, noah stated * not wildcard, . is. match / plus 1 character not have / anywhere before in string: "(?<!/.*)/." so in context code, this: $info = 'ab/f/*zxcvbn/mtf/ ---' $regex = [regex]"(?<!/)...

excel - Use of INDEX MATCH to find absolute closest value -

i've long sought method using index match in excel return absolute closest number in array without reorganizing data (since match requires lookup_array in descending order find closest value greater lookup_value , ascending order find closest value less lookup_value ). i found answer in this post . xor lx's solution: =index(b4:b10,match(true,index(abs(a4:a10-b1)=min(index(abs(a4:a10-b1),,)),,),0)) worked me, don't know why. can rationalize of can't figure out part index(abs(a4:a10-b1)=min(index(abs(a4:a10-b1),,)) can explain part? hate blinding using , know it'll useful in future. i guess makes sense me explain it, then! actually, didn't employing technique designed circumvent having enter formula array formula, i.e. cse. although considered plus accounts, think wrong employ here, , wouldn't again. the technique involves inserting index functions @ appropriate places within formula. forces other functions, without array-en...

wpf - How to pass reference parameters in a wcf method and listen to the current value of the parameter in a timer? -

i have wcf method connects tfs server , downloads files based on rootpath remote machine. so have 17k files , takes 20 minutes download , want progressbar report current status after every for loop present in wcf service. ref parameters don't updated unless entire method completed when passed in wcf method. is there other way it? want report status of current for loop iteration happening in wcf method progressbar present in local wpf application.

haskell - is it possible to stack cabal sandboxes? -

is possible "stack" cabal sandboxes or specify "package.d" search path? i'd install used packages common sandbox projects can use don't update. there world-file parameter in cabal.sandbox.config file, couldn't find reference in cabal source. i believe world-file refers optional function cabal-install maintain plaintext list of packages requested install, perhaps modeled on gentoo's /var/lib/portage/world , similar systems. cabal doesn't use file anything. your proposed "nested sandboxes" might cause same problems global or per-user installations: various packages have have consistent set of dependencies. it's possible share single sandbox between projects --sandbox=dir parameter cabal sandbox .

Change text color and horizontal color for preference category in android -

Image
i change color of preference category , change default horizontal line blue. possible? i tried setting theme preference settings following: <style name="mypreferencetheme" parent="@style/appbasetheme"> <item name="android:textcolor">@color/blue</item> </style> but got following output: my preference.xml looks this: <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android" > <preferencecategory android:title="account" > <preference android:key="googleaccount" android:summary="" android:title="google account" > </preference> <preference android:key="signoutmenu" android:summary="" android:title="sign out" > </preference> </preferencescreen> can me fix issue show in screenshot above? thanks! you ...

javascript - Hide/Unhide an image using jquery on hover -

i have 3 <a> tags in html , each contain 2 images. grescale images displayed , other ones set none. i want hide greyscale image when hover mouse on grescale image , display colored one. , when un-hover want colored image hidden again. how can using jquery? <a class="mylink" href=""> <img src="img/thumbnails/colored-1.jpg" class="color-image"/> <img src="img/thumbnails/greyscale-1.jpg" class="greyscale-image"/> </a> <a class="mylink" href=""> <img src="img/thumbnails/colored-2.jpg" class="color-image"/> <img src="img/thumbnails/greyscale-2.jpg" class="greyscale-image"/> </a> <a class="mylink" href=""> <img src="img/thumbnails/colored-3.jpg" class="color-image"/> <img src="img/thumbnails/greyscale-3.jpg" class="gr...

java - PDFBox TextPosition x, y and width, height off by factor of 2 -

i wrote short library extract position of anchor text pdf document can later render image bufferedimage , layer html form on it. works, have scale x, y , width , height 2 in order make work correctly. testing rendering image bufferedimage , drawing bounding boxes in red. basically...why off factor of 2...and can count on factor constant? , naturally, realize if size of image changes x,y coords , width, height scale appropriately. convert image perhaps scaling it? here code: anchortextripper.java import java.awt.rectangle; import java.io.ioexception; import java.util.hashmap; import org.apache.pdfbox.util.pdftextstripper; import org.apache.pdfbox.util.textposition; public class anchortextripper extends pdftextstripper { protected enum scanstate { init, searching, found_possible, scanning_anchor, done } protected hashmap<string, rectangle> anchors = new hashmap<string, rectangle>(); // scanning variabl...

java - Warning with List<String> on Android -

i want solve warning. in part of code have warning: type safety: unchecked cast object list<string> string preferences = pprefs.getstring(sharedpreferences); objectmapper mapper = new objectmapper(); byte[] bytetemp = mapper.readvalue(preferences, byte[].class); bytearrayinputstream in = new bytearrayinputstream(bytetemp); objectinputstream = new objectinputstream(in); list<string> numbers = (list<string>) is.readobject(); how can do? thank all. objectinputstream::readobject returns object . readobject you casting list<string> without first checking if list<string> . far compiler knows, can kind of object (a string , integer , , on...)

c++ - initializing const fields in the constructor -

const fields in c++ must initialized in initialization list, makes non trivial computation of interdependent values constructor parameters. what is(are) best way(s) translate, example, piece of java code c++ ? public class someobject { private final string some_string; private final int some_int; public someobject(final string input_filename){ somereader reader = new somereader(input_filename); some_string = reader.getstring(); some_int = reader.getint(); reader.close(); } } i thought of encapsulating sub-object in someobject, shifting problem; or constructing object using static method: class someobject { private: const std::string some_string; const int some_int; public: static someobject unserialize(const char * input_filename){ somereader reader = new somereader(input_filename); string str = reader.get_string(); int = reader.get_int(); reader.close(); someobject obj(str, i); return obj; ...

java - SWT Spy doesn't seem to be fully installed -

i'm trying use eclipse plugin swt spy swt development tools. installed it, , seems installed correctly (ie, see on list of installed software), when try show view, there no swt tools category , typing swt doesn't show anything. is known issue? i uninstalled swt tools, ran eclipse administrator, , reinstalled tools. when restarted after that, able see view.

java - how to getChildname from a vbox -

Image
this question has answer here: getting corresponding filename of image once button pressed 4 answers i need filename of imageview within vbox upon pressing button?? here file arraylist has been added vbox, vbox gridpane possible using vbox.getchildren()?? or else how should proceed. here's screenshot better understanding: here's code: private arraylist<button> btnar; private vbox vb; private button downloadbtn; @fxml private scrollpane displayscroll; private gridpane gridpane; public homeui_2controller() { platform.runlater(new runnable() { @override public void run() { gridpane = new gridpane(); displayscroll.setcontent(gridpane); btnar = new arraylist<>(); (int = 0; < filelist2.size(); i++) { downloadbtn = new button("download"); btnar.add(downloadbtn); ...

Python Time 'Lag' Effect in URL -

my server's timezone , data have fetched via following span 2 consecutive hours. once hour changes, hour python syntax getting not found on server providing content, since server jumps next hour while data not processed yet. in case wondering data in question weather model data in .grib2 format. i have following code now: # /usr/bin/python import time # save url variable: url = time.strftime("http://nomads.ncep.noaa.gov/pub/data/nccf/nonoperational/com/hrrr/para/hrrr.%y%m%d/hrrr.t%hz.wrfnatf04.grib2") # save string file: open('hrrr/hrrrf4.txt', 'a') f: f.write(url+'\n') is there way 'lag' &h variable in above url 1 hour, or method delay ensure smooth data processing desired hours? thank taking time answer question. the code below print out datetime of now, , offset subtracting 1 hour, add hour, or minutes, seconds, etc.... scrape lots of forums in different timezones scraping server , that's how adjust anyw...

php - on the same mysql host how do I transfer wordpress posts from on database to another? -

on same mysql host how transfer wordpress posts on database another? what scripts or tools recommend? for migrating wordpress databases (content) 1 database (regardless if on same host or across world), should take @ wp-migrate-db-pro. i've been using professional wp work on year, , has saved me tons of time. easy use too. note: don't paid them promote it...though nice to! https://wordpress.org/plugins/wp-migrate-db/ <- free version think https://deliciousbrains.com/wp-migrate-db-pro/ <- use , highly recommend.

forms - output array to template -

i'm trying add custom form series of radio buttons. need output list template can loop over. when run code nothing gets output. if add text inside loop it's output once. in page_controller class public function outputarray($array){ $dl = datalist::create("dataobject"); foreach ($array $it) { $do = new dataobject(); $do->value = $it; $do->write(); $dl->push($do); } return $dl; } public function numlist(){return $this->outputarray(array("0","1","2","3","4","5"));} in template <% loop numlist() %> $value <% end_loop %> you there. how write it: public function outputarray($array) { $dl = new arraylist(); foreach ($array $it) { $dl->add(array('value' => $it)); } return $dl; } and in silverstripe template: <% loop $numlist %> $value <% end_loop %> if use...

c# - Read a file into a list by a class does not working -

i wrote android app xamarin in c#, , made application class manage file data wich want load in list. the app class: namespace soroksar_sc_stat { [application] public class getdataclass : android.app.application { public getdataclass (){} private string filename = path.combine(system.environment.getfolderpath(system.environment.specialfolder.applicationdata),"playerdata.txt"); private directoryinfo di = directory.createdirectory(system.environment.getfolderpath(system.environment.specialfolder.applicationdata)); private filestream myfile = new filestream(path.combine(system.environment.getfolderpath(system.environment.specialfolder.applicationdata),"playerdata.txt"), filemode.create); public list<string> getlist() { streamreader myreader = new streamreader(this.myfile); string line; list<string> list = new list<string>(); while((line = myreader.readline()) != null) { ...

c++ - How to scale 2D object periodically? -

i attempting have variable scale factor, each frame scaling changes + or - .05, gives growing/shrinking animation aspect. my scaling factors (scale_x, scale_y, , scale_z) initialized 1.0. want happen each frame rendered, each scale factor grow or shrink fixed value (like .05). ideally, @ first should keep subtracting .05 every frame until reaches fixed value, 0.2. start growing 0.2 1.0 again. it should give illusion of shrinking , growing on time. i'm struggling coming way this. thinking of using sort of boolean value "grow" tells me whether or not should grow (add .05 each factor), or shrink (subtract .05 each factor). // these global vars. float rotate_x, rotate_y, rotate_z; float scale_x = 1.0f; float scale_y = 1.0f; float scale_z = 1.0f; ... void update_scale() { // can go here? } void animate() { // calculate new transformation values update_rotation(); update_scale(); //apply transformations glrotatef(rotate_x, 1, 0, 0); glrotatef(rotate_y, 0, 1, 0); g...

jquery - Strange behaviour with loop in Javascript -

i've got table-like structure text inputs in trying make entire row removed children, first passing values of cells 1 one in rows below keep ids numbering structure. the table structure this: <table cellpadding=0> <tr id="myrow1"> <td id="#r1c1"> <input class="mycell"> </td> <td id="#r1c2"> <input class="mycell"> </td> <td id="#r1c3"> <input class="mycell"> </td> <td id="#r1c4"> <input class="mycell"> </td> </tr> <tr id="myrow2"> <td id="#r2c1"> <input class="mycell"> </td> <td id="#r2c2"> <input class="mycell"> </td> ...

angularjs - Angular UI Bootstrap Typeahead -

i using angular js first time. here code , not working. typeahead intellisense showing 'unknown attribute'. <div class='container-fluid' ng-controller="homecontroller"> <h4>search state</h4> <pre>model: {{selected | json}}</pre> <input type="text" autocomplete="off" ng-model="selected" typeahead="state state in states | filter:$viewvalue | limitto:8" class="form-control"> </div> function homecontroller($scope, $http) { $scope.selected = undefined; $scope.states = ['alabama', 'alaska', 'arizona', 'arkansas', 'california', 'colorado', 'connecticut', 'delaware', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'm...

javascript - Responsive height for single page website -

i'm trying understand how build single-page website layout, made of series of pages, each occupying whole viewport: height: 100%; width: 100%; for example, layouts 1 in bootstrap template: http://startbootstrap.com/templates/freelancer/ actually, problem it, height of each page: while it's acceptable resolutions, wanna sure each page same width , height viewport has. i don't mind using javascript, in fact, suspect that's impossible achieve without kind of js (maybe "listening" resize events, too) adjusting page-divs height. obviously, only-css solution better. suggestions? to make work, can use giving height:100%;width:100% body , html. then create container div , give height: 100 * <number of pages> % . on each page, give them height: 100 / <number of pages> % . since percent-based, work in any resolution. here complete html+css: <html> <head> <style type='text/css'> ...

spring - Getting java.lang.NumberFormatException when displaying data in JSP page -

i using hibernate , spring mvc. trying fetch information 2 tables , display in jsp page . here tables: table name : student student_id studentname 1. jason stathum table name : studentdetails studentdetailsid fathername mothername student_id 1 mr.x mrs. y 1 in jsp page trying display data this: sl# student father mother 1 jason stathum mr.x mrs.y when run application see data following error message: http status 500 - exception occurred processing jsp page /web-inf/views/studentlist.jsp @ line 29 root cause java.lang.numberformatexception: input string: "fathername" java.lang.numberformatexception.forinputstring(unknown source) java.lang.integer.parseint(unknown source) java.lang.integer.parseint(unknown source).... , many other lines... i have included codes below, please tell me doing wrong? thank much entity: student @entity @table(name = ...

c# - LINQ group by and return all results -

i have troubles finding solution this. know had lot of topics here, none of (which found) works me. question, have this: list<products> testlist = new list<products>(); this list have 2 fields, price , stock. want group stocks condition still show results. i'm grouping values this: var stocks=testlist.where(item=> item.stock== "stocksfr1:").groupby(item=> item.stock); this works fine. want iterate through results, , i'm failing. have tried join, don't know on attribute can join these values. anybody? thanks! update: (example of input list:) stock: price: stocksfr1: 14.55 stocksfr1: 3.4 stocksfrf: 1.1 stocksfra: 13.3 and group, want have output: stock: price: stocksfr1: 14.55, 3.4 stocksfrf: 1.1 stocksfra: 13.3 okay, disregarding of have , looking @ example data, seems want this: var grouped = testlist.groupby(item=> item.stock); var eachs...

java - Reading a KeyDown only once in while loop (Like KeyListener in Swing) -

in while loop opengl program have this: if (keyboard.iskeydown(keyboard.key_w)) { ... } now of course if getting checked multiple times per button press. there way let detect button once per press? example keylistener in java swing does. i handle movement speed elapsedtime variable, maybe can use problem too? keep track of when comes down first time , when goes up, ideally boolean not defined in local scope of method called 60 times second, @ higher scope. if (wkeyup && keyboard.iskeydown(keyboard.key_w)) { wkeyup = false; onnewwkeypress(); } else if (wkeyup == false) { wkeyup = true; }

css - How find out which stylesheets were applied (check via javascript)? -

if have 2 stylesheets set media queries: <link rel='stylesheet' media='only screen , (min-width: 64.1em)' href='desktop.css' /> <link rel='stylesheet' media='only screen , (max-width: 64em)' href='mobile.css' /> and i'm looking class in document.stylesheets , how able ignore non-active stylesheet? for example: //pseudo-code ( var = 0; < document.styelsheets.length; i++ ) if ( document.styelsheets[ ].isapplied ) ... is there way know? there's nice js feature called window.matchmedia() , can used test if media query matches viewport, example: if(window.matchmedia('only screen , (min-width: 64.1em)').matches) { //match } else { //don't match } if can iterate through link tags, test each media attribute , check if applied. mdn .matchmedia() docs

visual studio 2010 - “MSVCP100.dll is either not designed to run on Windows or it contains an error” -

i built application in c++ using visual studio 2010 express. when tried run on computer today got error: myapplication.exe - bad image c:\path application\msvcp100.dll either not designed run on windows or contains error. try installing program again using original installation media or contact system administrator or software vendor support. the dll mentioned 1 of visual c++ redistributable dlls. application’s installer used launch microsoft’s installer dlls tweaked install msvcp100.dll , msvcr100.dll alongside application. new way worked fine on handful of other computers, though can’t rule out possibility that because dlls had been installed @ system level on other computers. what causing sudden dll mismatch? that's status_invalid_image_format, machine property in dll header doesn't match architecture of application. do keep in mind have two copies of dll on build machine, x86 , x64 version. later versions of vs have 3rd copy, arm version. h...

ios - Swift getter override non-computed variable -

in objective-c, easy , nice able do - (uibutton *)backbutton{ if(!_backbutton){ _backbutton = [uibutton new]; } } in swift however, when override property getter, it's called computed variable , every time self.backbutton accessed, variable recomputed. following example illustrates nicely: private var backbutton: uibarbuttonitem { let button = uibutton(frame: cgrect(x: 0, y: 0, width: self.view.frame.size.width*0.06, height: self.view.frame.size.width*0.06)) button.setimage(uiimage(named: "back_arrow"), forstate: uicontrolstate.normal) button.rac_signalforcontrolevents(uicontrolevents.touchupinside).subscribenext { (next: anyobject!) -> () in self.navigationcontroller?.popviewcontrolleranimated(true) return () } println("recalculating button") let item = uibarbuttonitem(customview: button) return item } the println statement called every time access self.backbutton. addt...