Posts

Showing posts from May, 2015

PHP GET variable from another page -

i have following lines: if(isset($_get['search'])){ $search_query = $_get['user_query']; the problem not trying retrieve variable page, rather searchpage.php, different page located within same folder. user_query variable page instead. instance, in page have: searchpage.php?user_query=microsoft&search=search if need clarification, let me know. seems weird if must whats wrong redirecting searchpage.php page want parameter eg in searchpage.php header("location:the_other_script.php?user_query=".$_get['search']); and in the_other_script.php if(isset($_get['user_query']){ $user_query = $_get['user_query']; } begs question why not logic in searchpage.php? if want separate code out use function call in searchpage.php. edit: so have script file called functions.php.. in case require file in searchpage.php like.. require_once('the/path/to/functions.php'); and in searchpage.php if(is...

r - Manipulate a data frame - amending the last row name -

i'm building set of coordinates plot on ggmap code below. coords <- rbind(as.matrix(rte[,7:8]),as.matrix(rte[nrow(rte),9:10])) %>% as.data.frame() this generates data below. issue have end point (last point/row). i'm getting error there duplicate value (9.3) - need rename +0.1 of previous value i.e. 9.4. structure(list(startlon = c(-2.8812933, -2.8836377, -2.8846959, -2.883528, -2.8867415, -2.8878325, -2.8880098, -2.8895748, -2.8935501, -2.8971835, -2.8987187, -2.8989829, -2.8986408, -2.8989038, -2.897305, -2.8939165, -2.8932886, -2.8932332, -2.8932886, -2.891303, -2.8904392, -2.8896841, -2.8900902, -2.8896841, -2.8916631, -2.8908963, -2.889908, -2.889908, -2.8897949, -2.8877892, -2.8879832), startlat = c(53.1935042, 53.1934807, 53.1962441, 53.1968895, 53.1943495, 53.1938296, 53.1936907, 53.1943944, 53.1942666, 53.1939625, 53.1931411, 53.1930795, 53.1928816, 53.1926769, 53.1893671, 53.1898796, 53.1899857, 53.1899088, 53.1899857, 53.1903599, 53.1...

php - Displaying Database Values in Date Groups -

i have mysql database table called names follows: ======== ========== =========== date name1 name2 ======== ========== =========== 01/01/15 namea nameb 01/01/15 namec named 02/01/15 namee namef 03/01/15 nameg nameh 03/01/15 namei namej 03/01/15 namek namel 04/01/15 namem namen i want output values table follows: ============================================== 01/01/15 ============================================== namea nameb namec named ============================================== 02/01/15 ============================================== namee namef ============================================== 03/01/15 ============================================== nameg nameh namei namej namek namel ================...

sql server - T-SQL to get dates -

i've ssrs sales report need pass dates previous month's start date , end date able pass using below code. however, since sales report has data past year(2014) need pass dates last year well. below code gives startdate1 2015-02-01 , enddate1 2015-02-28. need dates past year 2014-02-01 startdate2 , 2014-02-28 enddate2 select dateadd(month, datediff(month, '19000201', getdate()), '19000101') startdate1, dateadd(month, datediff(month, '19000101', getdate()), '18991231') enddate1 since last day of month can vary, important thing first day of current month year. can calculate other 3 values. you expressions in parameters' default values instead. start of month =today.adddays(1-today.day) end of month =today.adddays(1-today.day).addmonths(1).adddays(-1) start of month last year =today.adddays(1-today.day).addyears(-1) end of month last year: =today.adddays(1-today.day).addyears(-1).addmonths(1).adddays(-1) but if want in...

sql server - Selects from multiple tables for Activities feed -

i have social app trying create friend activities feed using azure sql server. i have 3 tables want select from: songs -createdat -id -userid -trackname -etc comments -createdat -id -userid -songid -text likes -createdat -id -userid -songid i have users current user following stored in array named 'follows'. how go selecting 40 recent items 3 tables userid in each table in follows array? edit: function getactivities(userid) { var deferred = q.defer(); var follows = []; getfollowing(userid).then(function (results) { follows.push(userid); _.each(results, function (user) { follows.push(user.touserid); }); return; }).then(function () { var stringified = "'" + follows.join("','") + "'"; var querystring = "select * comments, songs, likes comments.userid in (" + stringified + ") or songs.userid in (" + stringified +") or likes.user...

javascript - Create a room system with different instances of node.js -

i created video game based on node.js , socket.io. now, there 1 "room" players can play together. create room system. but server code quite complex, , changing handle different game states difficult. so thought maybe can launch several instances of node on server, , every room connects different instance. is feasible? recommended, , have other ideas?

python - PyPDF2, Set PDF version -

i'm using pypdf2 1.4, , python 2.7: how can change pdf version input file output file? from pypdf2 import pdffilewriter, pdffilereader pypdf2.generic import nameobject, createstringobject input_filename = 'my_input_filename.pdf' # read input pdf file inputpdf = pdffilereader(open(input_filename, 'rb')) info = inputpdf.documentinfo in xrange(inputpdf.numpages): # create output pdf outputpdf = pdffilewriter() # create dictionary output pdf infodict = outputpdf._info.getobject() # update output pdf metadata input pdf metadata key in info: infodict.update({nameobject(key): createstringobject(info[key])}) outputpdf.addpage(inputpdf.getpage(i)) open(output_filename , 'wb') outputstream: outputpdf.write(outputstream) pypdf2 in current versions can't produce files pdf1.3 header; the official source code : class pdffilewriter(object): """ class supports writing pdf files o...

sql - Sqlite get max id not working (?) -

im using this: select * id=max(id) history; but query empty. have tried (this 1 works): select max(id) max_id history; but obviusly query contains max_id key. doing wrong first one? you need add level of select max , this: select * id=(select max(id) history) history; a better approach order id in descending order, , limit output single row: select * history order id desc limit 1

Set min date to current date in angularJS input -

in angularjs, how can set min attribute of input type="date" current date (today's) ? <input type="date" ng-model="data.startdate" name="startdate" min=?? /> edit1 i did suggested below , added in controller - $scope.currentdate = new date(); and in html - <input type="date" ng-model="data.startdate" name="startdate" required min="{{currentdate | date:'yyyy-mm-dd'}}" /> <span ng-show="form.startdate.$dirty && form.startdate.$invalid"> <span ng-show="form.startdate.$error.required">start date required</span> <span ng-show="form.startdate.$error.min">start date should not less current date</span> </span> now, year not allowing selected less 2015. also, if whole date less current date, no validation occuring. required validation working fine. .min correct way check field? thanks ...

java - AspectJ not weaving all classes -

i using aspectj run time weaving. agent loading ok, finds aspect , aop file. classes aren't weaved although third party classes weaved. this aop file <aspectj> <weaver options="-showweaveinfo -debug"> <!-- weave classes in package --> <!--include within="*.*"/--> </weaver> <aspects> <aspect name="wf.core.aspects.loginfocalleraspect"></aspect> </aspects> what causes this?

java - Accessing superclass variables from an enum -

is there way set variable held in enums parent/superclass within enum itself? (the following doesn't compile, illustrates i'm attempting achieve).... class myclass{ objecttype type; string somevalue; public void settype(objecttype thistype){ type = thistype; } enum objecttype { ball{ @override public void setvalue(){ somevalue = "this ball"; //some value isn't accessible here } }, bat{ @override public void setvalue(){ somevalue = "this bat"; //some value isn't accessible here } }, net{ @override public void setvalue(){ somevalue = "this net"; //some value isn't accessible here } }; public abstract void setvalue(); } } then, so: myclass myobject = new myclass(); m...

python - Is it possible to use pypyodbc with SQLAlchemy/alembic? -

i have misfortune of being stuck db2 on as400. fortunately, can connect pypyodbc on windows , linux (through unixodbc). i use alembic handle table migrations. of course there's no dialect db2 on iseries, plan on doing this: from sqlalchemy.sql import text conn = op.get_bind() conn.execute(text('''create table blah_blah (stuff );''')) though i'm not sure if alembic able create/insert stuff version table on database... is possible (without like, patching alembic/sqlalchemy)?

android - Multiple TextToSpeech instances with different languages -

i'm keeping 2 instances of texttospeech different languages in order make device pronunce in different languages depending on pressed button. i'm doing because changing language on same texttospeech long task , introduce remarkable lags. problem that, these 2 instances lag still remains! i want able pronunce word in different languages no delays, how can achieve that? i'm answering own question because, gabe's comment, i've done test , i've come conclusion not possible 2 load 2 different languages default android texttospeech because of large amount of memory requires.

c# - How do I bind a DataGridViewComboBoxColumn to the list property of the parent row's bound object? -

given following classes: public class shirt { public string description { get; set; } public list<color> coloroptions { get; set; } public int selectedcolorid { get; set; } } public class color { public int id { get; set; } public string label { get; set; } } why can't combobox show in datagridview using following code? list<shirt> foundshirts = _dbshirtrepo.getshirts(); var namecolumn = new datagridviewtextboxcolumn(); namecolumn.datapropertyname = "description"; namecolumn.headertext = "description"; var colorselectcolumn = new datagridviewcomboboxcolumn(); colorselectcolumn.datapropertyname = "coloroptions"; colorselectcolumn.displaymember = "label"; colorselectcolumn.valuemember = "id"; datagridview1.columns.add(namecolumn); datagridview1.columns.add(colorselectcolumn); datagridview1.datasource ...

sql - Insert into column without having IDENTITY -

i have table create table [misc] ( [misc_id] [int] not null, [misc_group] [nvarchar](255) not null, [misc_desc] [nvarchar](255) not null ) where misc_id [int] not null should have been identity (1,1) not , i'm having issues with simple form insert table since misc_id looking number user not know unless have access database. i know option create column make identity(1,1) , copy data. is there way able around this? insert misc (misc_group, misc_desc) values ('#misc_group#', '#misc_desc#') i have sql server 2012 you should re-create table desired identity column. following statements close. sql server automatically adjust table's identity field max(misc_id) + 1 you're migrating data. you'll need stop trying insert misc_id new records. you'll want retrieve scope_identity() column after inserting records. -- note: i'd recommend having ssms generate base create statement know didn't miss anything. ...

windows 8.1 - Unity3d opening in background -

when start unity5 (when open unity.exe) , select project, reason starts running in background , editor window doesn't show up. when check task manager, unity running, said it's in background , can't see window. happens projects i've tried. i'm trying fresh install , keeps happening. happened unity 4.6 too. i'm running windows 8.1 pro. my log: http://pastebin.com/aysjejjg what can causing it?

PHP strtotime with output from Bootstrap DatePicker -

bootstrap time picker gives me date in format: mon mar 16 2015 00:00:00 gmt-0500 (central daylight time) i use date object in php. i attempting use like: date("y-m-d h:i:s" , strtotime("mon mar 16 2015 00:00:00 gmt-0500 (central daylight time)")); but results in: 1969-12-31 18:00:00 which understand pretty close epoch. i'm thinking i'm either using wrong function, or formatted date() wrong. i using timepicker here . strtotime works on formats of can found here http://php.net/manual/en/datetime.formats.php mar 16 2015 00:00:00 gmt-0500 the above portion should return right time value you. either change way picker outputting date, without knowing picker assume 1 http://bootstrap-datepicker.readthedocs.org/en/latest/options.html#format or string manipulation on current date format picker (the first option simpler , easier read).

c - Print ellipse using characters -

the general equation rotated ellipse centered @ (h, k) has form a(x − h)^2 + b(x − h)(y − k) + c(y − k)^2 = 1, , c positive, , b^2 − 4ac < 0. i'm trying print out filled ellipse using formula, prints out *s on first line , \n's next 39 lines, loop breaks. dont why happening. here lines of code, i'm using input a=0.04, b=0.001, c=0.01, h , k =6. should print 5x10 ellipse, center 6, 6. int x=0, y=0, h, k; float a, b, c; printf("input "); scanf("%f", &a); printf("input b "); scanf("%f", &b); printf("input c "); scanf("%f", &c); printf("input h "); scanf("%f", &h); printf("input k "); scanf("%f", &k); while(1){ if(y>=40){ break; } if((a*((x-h)*(x-h)))+(b*(x-h)*(y-k))+(c*((y-k)*(y-k)))<=1){ printf("*"); x++; continue; } if(x>=80){ printf("\n"); y++; ...

rust - Grouping structs with enums -

in rust, how should 1 go grouping related structs function signature can accept multiple different types while refering concrete type inside method body? the following example contrived simplicity: enum command { increment {quantity: u32}, decrement {quantity: u32}, } fn process_command(command: command) { match command { command::increment => increase(command), command::decrement => decrease(command), }; } fn increase(increment: command::increment) { println!("increasing by: {}.", increment.quantity); } fn decrease(decrement: command::decrement) { println!("decreasing by: {}.", decrement.quantity); } fn main() { let input = "add"; let quantity = 4; let command: command = match input { "add" => command::increment { quantity: quantity }, "subtract" => command::decrement { quantity: quantity }, _ => unreachable!(), }; process_c...

delphi - How to read field values of a TDataSet descendant without having to move its cursor -

i see having ability read record values tdataset descendant without having move cursor big improvement people working database applications. i have searched long , hard on topic closest can find in xe7 tfdmemtable can read field values statements this: firstname := fdspeople.table.rows.itemsi[i].getvalues('firstname', true); where fdspeople = instance of tfdmemtable i = integer referring record index firstname string variable is there way achieve tdataset not aware of? if not, how can request feature ? you can clone cursor dataset other datasets, if dataset descendant supports feature ofcourse. (anydac - tadmemtable or firedac - tfdmemtable , , tclientdataset support feature). it means datasets can share data, have different cursors! (you can walk 1 dataset without disturbing other dataset recno) example: procedure myclonecursor(asourceds, adestds: tfdmemtable) begin adestds.fielddefs.assign(asourceds.fielddefs); adestds.createdataset; adest...

Android background service with background thread causing anr error -

i have implemented android service performs following long operations when screen goes off start recording accelerometer data. when data reaches 3000 samples write file. then perform data processing on after reading recorded data. then extract gait template data. then compute similarity score. i want keep service running long user explicitly not quit service. in case if screen goes on stop data recording , check if number of samples more minimum number of samples repeat steps 2-5. else drop recorded samples. i have broadcast receiver screen_on , screen _off broadcasts writing file works fine time taking part feature (or template generation) read android documentation a service runs in main thread of hosting process—the service not create own thread , not run in separate process (unless specify otherwise). means that, if service going cpu intensive work or blocking operations (such mp3 playback or networking), should create new thread within service work. using...

mysql - EclipseLink JPA Duplicate entry when persisting -

i have strange error when trying persist annotated object. this code: if (hashtags != null && !hashtags.isempty()) { tweet.sethashtags(new linkedlist<hashtag>()); (hashtag hashtag : hashtags) { hashtag hashtagentity = em .find(hashtag.class, hashtag.gettag()); if (hashtagentity == null) { logwrapper.logger.debug("h: " + hashtag.gettag()); em.persist(hashtag); tweet.gethashtags().add(hashtag); } else { tweet.gethashtags().add(hashtagentity); } } } i know if try persist existing object exception check before calling persist method. can not find primary key cause exception not in log file nor in mysql database , confusing me how exception indicating primary key value not exist in database in first place. edit those annotated classes show attributes , annotations: @entity public class tweet { @id @column(name = "id") private ...

php - Code organization with laravel and several git repositories -

i working on several projects each 1 connects rest web service. i've developed first 1 using laravel, , developed few classes useful communicate web services. i start second one, , of course, reuse classes developed rest connection. my problem is, company wants me use several git directories projects, , each 1 should uploaded different springloops project. springloops bit github, can upload code using git. how proceed avoid copy/paste , use same laravel code in different projects (and guess, in different locations)? i'm not sure i'm clear, don't hesitate ask me more information if need to. thanks. how creating own composer package , store in separate (private) git repo? far composer concerned it's other package, may want check out this section of docs : using private repositories exactly same solution allows work private repositories @ github , bitbucket: { "require": { "vendor/my-private-repo"...

I cannot change Android wallpaper using WallpaperManager -

i trying change android wallpaper using code. using wallpapermanager class, no prevail. used .png image in /drawable directory. getting error says, "expected resource of type raw". when run application(when method runs), crashes. must victim of stupid mistake. method changewallpaper() run after user taps button. here code: public void changewallpaper(view view) { try{ wallpapermanager wallpapermanager = wallpapermanager.getinstance(getapplicationcontext()); wallpapermanager.setresource(r.drawable.material_wallpaper); string successmessage = "wallpaper changes"; toast.maketext(this, successmessage, toast.length_short).show(); } catch (ioexception e) { e.printstacktrace(); string failedmessage = "operation failed"; toast.maketext(this, failedmessage, toast.length_short).show(); } } edit: there no "raw" folder in /res/ directory. if want stay drawable, can conver...

Import in C# bundle written in c++ (Unity3D project) -

i try use functions .bundle file inside unity3d every time when call functions error: dllnotfoundexception: libant connectant.start () (at assets/connectant.cs:13) this script use call library antlib.bundle in assets/plugin folder: using unityengine; using system.collections; using system.runtime.interopservices; public class connectant : monobehaviour { [dllimport("libant")] static extern bool ant_init(int ucusbdevicenum_, int ulbaudrate_); void start () { ant_init (1, 50000); } } in bundle function declared this: #ifdef __cplusplus extern "c" { #endif export bool ant_init(uchar ucusbdevicenum_, ulong ulbaudrate_); //initializes , opens usb connection module #ifdef __cplusplus } #endif this example 1 function bundle. if import functions in script don't error in unity. can me figure out? try this: [dllimport("antlib.bundle")] static extern int ant_init(byte ucusbdevicenum_, uint ulbaudrate_); there're 2 problem...

scala - Setting tagsToExclude in SBT -

scalatest allows setting of tags excluded via filter called tagstoexclude . how can configure sbt build set value? attempt 1 the cli of scalatest specifies -l flag tags exclude. sbt allows setting of cli params so: testoptions in test += tests.argument( testframeworks.scalatest, "-l", "datafiletest")` but seems have no effect (i.e. test still executes). for reference test looks like: object datafiletest extends org.scalatest.tag("com.mydomain.datafiletest") class mydatafiledependantspec extends funspec matchers beforeandafter beforeandafterall { describe("something") { it("reads file , things", datafiletest) { ... } } testoptions in test ++= seq(tests.argument(testframeworks.scalatest, "-l", "org.scalatest.tags.slow") this works. see if problem full path name of dat...

ios - Swift string formula into a real calculation -

i have several formulas stored in plist such * b. i'm trying figure out how take formula stored string in plist , use actual calculation formula. tried going route of making formula \(a) * \(b) , setting , b before trying use formula did not work. suggestions? example let = 5 let b = 2 println (formula) actually printed out "\(a) * \(b)" xcode 8.3.1 • swift 3.1 extension string { var expression: nsexpression { return nsexpression(format: self) } } let = 5 let b = 2 let intdictionary = ["a": a,"b": b] var formula = "a * b" if let timesresult = formula.expression.expressionvalue(with: intdictionary, context: nil) as? int { print(timesresult) // 10 } formula = "(a + b) / 2" if let intavgresult = formula.expression.expressionvalue(with: intdictionary, context: nil) as? int { print(intavgresult) // 3 } let x = 5.0 let y = 2.0 let z = 3.0 let doubledictionary = ["x": x, ...

html - using static images with django -

i trying upload static images website django. have been through settings.py , in there should because static css works. question how code if product id 1 shown show picture. have tried code below images don't show up. <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> {% load staticfiles %} <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title> book cove </title> <link rel="stylesheet" type="text/css" href="{% static 'screenstyle.css' %}"/> </head> <body> <div id = "content"> <div id = "header"><p class="heading"> book cove.</p></div> <div id="navbar"> <ul id="nav"> <li><a href=...

ruby on rails - Bootstrap sign in form integrated with Devise not not creating new user session -

i found nice looking bootstrap sign in form rails app using devise gem. converted rails form_for helper straight html using bootstrap classes. original form <%= form_for(resource, as: resource_name, url: session_path(resource_name)) |f| %> <div class="field"> <%= f.label :email %><br /> <%= f.email_field :email, autofocus: true %> </div> <div class="field"> <%= f.label :password %><br /> <%= f.password_field :password, autocomplete: "off" %> </div> <% if devise_mapping.rememberable? %> <div class="field"> <%= f.check_box :remember_me %> <%= f.label :remember_me %> </div> <% end %> <div class="actions"> <%= f.submit "log in" %> </div> <% end %> form_for converted html: <div class="container"> <div id=...

javascript - angular active link navigation -

angular beginner here. i'm trying have link active once i'm on given page. found quite couple of examples none of work, must i'm doing wrong. this i've been trying (controller) : angular.module('myapp') .controller('homectrl', ['$scope', function ($scope) { $('body').addclass('homepage'); $scope.isactive = function(route) { return route === $location.path(); } }]); html : <li "ng-class" = "{active:isactive('/') || isactive('/home')}"> home </li> <li "ng-class" = "{active:isactive('/about')}"> </li> <li "ng-class" = "{active:isactive('/contact')}"> contact </li> application : var app = angular .module('myapp', [ 'nganimate', 'ngcookies', 'ngresource', 'ngroute', 'ngsanitize'...

Find a value in json object using lodash methods flatten and find -

using lodash want find team id 3229. tried following not returning anything. var team = _.chain(data.teams) .flatten("divisionteams") .find({"id":3229}) .value(); here plunker code. http://plnkr.co/edit/udwzrkx3zkyjyf8uwo7i for json data please see file data.js in plunker. please note cannot change json data since calling test api. flatten doesn't take argument, see docs . need either map or pluck divisionteams . _.chain(data.teams) .pluck('divisionteams') .flatten() .find({id: 3232}) .value();

Python-search function -

i want write search function takes in value x , sorted sequence , returns position value should go iterating through elements of sequence starting first element. position x should go in list should first position such less or equal next element in list. example:>>> search(-5, (1, 5, 10))——0 >>> search(3, (1, 5, 10))——1 building list of every item bit of waste of resources if there big gaps in list, instead can iterate through each list item until input bigger value. in terms of code - def search(input,inputlist): in range( len( inputlist ) ): if inputlist[i]>input: return return len( inputlist ) print search(-5, (1, 5, 10)) #result: 0 print search(3, (1, 5, 10)) #result: 1 to insert list, work, split list in 2 based on index , add value in middle. def insert(input,inputlist): index = search(input,inputlist) #get value should inserted newinput = [input]+list(inputlist[index:]) ...

r - Add jitter to column value using dplyr -

i have data frame of following format. author year stages 1 1150 1 2 b 1200 1 3 c 1200 1 4 d 1300 1 5 d 1300 1 6 e 1390 3 7 f 1392 3 8 g 1400 3 9 g 1400 3 ... i want jitter each year , author combination small amount. want documents different authors in same year jittered unique values. example, tokens author b , c appear in same year, should jittered different amounts. tokens same author, example 2 tokens author g @ 1400 should jittered same amount. i've tried following, unique jitter amount each , every row. data %>% group_by(author) %>% mutate(year = jitter(year, amount=.5)) the output of code following. author year stages 1 1150.400 1 2 b 1200.189 1 3 c 1200.222 1 4 d 1300.263 1 5 d 1299.788 1 6 e 1390.045 3 7 f 1391.964 3 8 g 1399.982 3 9 g 1399.783 3 however, following, both tokens author g should shifted same amount. crucial difference...

javascript - Getting typeahead to work in an Angular template? -

i have partial html being routed to, template , custom controller. code snippet in angular template working is: <input type="text" typeahead=val val in getvalue($viewvalue)> however, never enters function getvalue(), while other functions in controller seem okay. when take typeahead out of angular template/partial, seems work. why , how fix it? you need have ng-model attribute use typeahead directive angularui , if don't need bind anything. change markup similar following: <input type="text" ng-model="typeaheadval" typeahead="val val in getvalue($viewvalue)">

java - Gradle DSL method not found: storeFile() -

i'm using android studio 1.1.0. when try sync gradle file, following error: gradle dsl method not found:storefile() here gradle configuration: apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { applicationid "skripsi.ubm.studenttracking" minsdkversion 16 targetsdkversion 21 versioncode 1 versionname "1.0" } signingconfigs { release { storefile (project.property("students_tracking_keystore.jks") + ".keystore") storepassword "####" keyalias "####" keypassword "#####" } } } can help? a couple of things note: the storefile dsl method has following signature: public defaultsigningconfig setstorefile(file storefile) i.e. expects file passed in. need place file constructor in co...

java - JavaFX TableView how to get cell's data? -

Image
i'm using method whole object. tableview.getselectionmodel().getselecteditem() how can data single cell? i mean s20bj9dz300266 string? assuming know selected, can do tableposition pos = table.getselectionmodel().getselectedcells().get(0); int row = pos.getrow(); // item here table view type: item item = table.getitems().get(row); tablecolumn col = pos.gettablecolumn(); // gives value in selected cell: string data = (string) col.getcellobservablevalue(item).getvalue();

html - css percentage width and height on header -

i want have fluid header used percentage. prerequisite: 1) call "basic" div containing essential link/img. take 15% in total width , resize depends on browser size. 2) rest call "nav" div. link , added on time. "nav" take left on width 85% (100%width - 15% basic) 3) "nav" link increases amount, push next line. 4) better off supported in i.e. 7 , above? 5) best not use float tried solution: 1) putting html comment line in-between div because html space mess alignment. 2) putting margin 0 , padding 0 check if reason. question: how have percentage header "basic" div take 15% , "nav" div take rest of 85% , when "nav" div's link overflow push next line? i have made jsfiddle following. jsfiddle you float div class="basic" float:left , div class="nav" have margin-left:15% . also, need remove width:85% div class nav. jsfiddle sample might not simple fix ...

direct3d - Strange D3D11 Error when creatng shader [SharpDX/MONOGAME] -

i'm true beginner in shader programming , i'm using monogame framework . i'm trying follow along examples in book packtpub 3d graphics xna game studio 4.0 but i've been hitting wall past 4 days trying make prelighting renderer works (chapter 3 if of know book) https://www.packtpub.com/books/content/advanced-lighting-3d-graphics-xna-game-studio-40 the code compiles fine , mesh le prelighting shader applied fails display 2.when drilling down shader in vs2013 locals , find kind of exceptions vertexshader 'this.depthnormaleffect._shaders[0].vertexshader' threw exception of type 'system.runtime.interopservices.sehexception' sharpdx.direct3d11.vertexshader {system.runtime.interopservices.sehexception} which dx native debugger tranlates d3d11 error: id3d11device::createvertexshader: shader must vs_4_0, vs_4_1, or vs_5_0. shader version provided: ps_4_0 [ state_creation error #167: createvertexshader_invalidshadertype] d3d11: break ...

Limit in mysql is timing out -

in nutshell, query returns 890738 entries select * `cms_question_report` `doa` < '2014-12-16 11:48:13' and in around 2 seconds after trying cut 4 chunks, query times out , produces error select * `cms_question_report` `doa` < '2014-12-16 11:48:13' limit 222684 here's error: error in processing request error code: 500 error text: internal server error in basic understanding shouldn't second 1 run faster has lower limit data it's fetching? another test: select * `cms_question_report` `doa` < '2014-12-16 11:48:13' limit 2 that worked smoothly no not run faster. db has first results , order them before applying limit. know seems waste of resource, why not stop after getting limit rows? because have ordered, when order implicit because have not specified explicit order. implicit order pk order of main table in query, clause means rows not automaticaly found in order. rows have found, ordered, limit...

security - Java Applet fails to run after JRE upgrade -

i had jre 1.6 updated 1.8.0_31. after update applet has stopped working , getting below error java.lang.exceptionininitializererror @ com.sun.deploy.net.protocol.https.handler.openconnection(unknown source) @ java.net.url.openconnection(unknown source) @ sun.net.www.protocol.jar.jarurlconnection.<init>(unknown source) @ sun.plugin.net.protocol.jar.cachedjarurlconnection.<init>(unknown source) @ sun.plugin.net.protocol.jar.handler.openconnection(unknown source) @ java.net.url.openconnection(unknown source) @ sun.misc.urlclasspath$jarloader.getjarfile(unknown source) @ sun.misc.urlclasspath$jarloader.access$600(unknown source) @ sun.misc.urlclasspath$jarloader$1.run(unknown source) @ sun.misc.urlclasspath$jarloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ sun.misc.urlclasspath$jarloader.ensureopen(unknown source) @ sun.misc.urlclasspath$jarloader.<init>(unknown source) @ sun.misc.urlclasspath$...

php - Can't connect Websocket when using vagrant envirionment -

i'm using vagrant box using puphpet , environment php 5.5 + ubuntu 12.04 + apache + mysql. vagrant vm ip: 192.168.11.11, local machine hosts points 192.168.11.11 reactphp.dev , , works. and, i'm using code: https://github.com/muuknl/phprealtimechat test websocket. then visit reactphp.dev in chrome browser, , start server script using: php bin/server.php , , after type in username got error: websocket connection 'ws://192.168.11.11:2000/' failed: error in connection establishment: net::err_connection_timed_out it works when changed websocket ip `ws://127.0.0.1:2000/', why not work if change vm's ip address? it's been while haven't used puphpet, when had troubles connecting through port (minus port 22), i've had issue command sudo ufw disable in vagrant machine. if uwf isn't managing firewall of vm, try sudo service iptables stop , or sudo iptables -f . perhaps they've changed behavior since then, it's still t...