Posts

Showing posts from May, 2015

javascript - AngularJS - ng-repeat to display empty cell/s when data is not available when using slice twice -

i have simple ng-repeat loops through json file list of countries , details country e.g. currency, population particular set of months (24 in case) my ng-repeat loops through first 12 months successfully, , displaying corresponding text when ng-switch criteria met. additionally, first 12 months, if there no data available, 'empty' displayed in cell. however, using 2 ng-repeats , slice , cant seem getemptycells function work/display empty months greater 12. html: <div ng-app=""> <div ng-controller="eventcontroller"> <table> <tr ng-repeat="country in countries"> <th>{{country.countryname}}</th> <td ng-repeat="countrydetails in country.details.slice(0, 12)" ng-switch="countrydetails"> <span ng-switch-when="11">medium</span> <span ng-switch-when="22">large</span> <span ng-s...

indexing - jquery get instance of parents class -

i'm dynamically adding links page each link launches modal. i need find instance of link launched modal display right info. so have <div class='linkholder'><a href='#' data-toggle='modal' data-target='#mymodal' class='modallink'>view</a>" i'm trying find link on page getting occurance of class linkholder. with this: function testindex() { var test = ($(this).parent('.linkholder').index()); alert(test); } clicking link launches alert -1 / not found thanks as adding these links dynamically, attach click event using on in document load such: $(document).on('click', 'a.modallink', function(e) { e.preventdefault(); alert($(this).parent('.linkholder').index()); }); example the problem function have not passed this doesn't know $(this) is edit as per comment, if looking index linkholder can in div try this: $('.linkhold...

Sqlite Full Text Search Query Puzzle -

i have data in format yyyy-mm-dd hh:mm:ss. stored text. i want query matches given day( yyyy-mm-dd ). e.g select * test test match '2014-03-30*' when try that, returns data excluding of march 2014. if try select * test test match '2014-04-30*' it returns data excluding of april 2014. i puzzled!...i getting opposite of want! any reason strange behavior? this full code....testing date pattern public list <transactions> gettransactionsvirtual(string token) { list<transactions> trans = new arraylist<transactions>(); sqlitedatabase db; string sql= " select " + message + "," + tdate + ","+ service_provider + " " + table_name_virtual + " "+ table_name_virtual + " match " + "?" + " order " + tdate + " desc"; //check entered string...if date string strip .. string pattern="^(19|20)\\d\\d[- /.](0[1-9]|1[012])...

c# - ASP.NET: Buttons not working after inserting 'namespace' -

using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data.sqlclient; using system.configuration; using system.data; namespace localhost_54355 { public partial class ui : system.web.ui.page { protected void page_load(object sender, eventargs e) { sqlconnection con = new sqlconnection("server=pc\\sqlexpress;data source=dbo\\employeedatabase;integrated security=true;"); sqlcommand cmd = new sqlcommand("insert tableemployees(username,email,password,job,firstname,lastname,location,phone) values (sdfsd,sdfsdfds, 123456, xcvxcv, xcvxcvcxvx, dfgdfgd, cvbcbcbcb, 123645);", con); cmd.commandtype = commandtype.text; try { con.open(); cmd.executenonquery(); } catch (exception ex) { response.write("er...

c# - Multiple distinct instances of object graph in Castle Windsor -

Image
this simplified version of setup. have application consumes library, , library provides client accessing web service. application wraps in xyzservice provides higher level operations. the library provides parameterised windsor installer, registers webapiclient , dependencies. installer takes configuration object (amongst other things) specifies uri web service. this fine long ever want talk single instance of web service. in case there 2 different instances of web service, , not interchangeable. @ startup want app constructed references 2 distinct instances of xyzservice, first object-graph configured access (say) http://server.green/ , second object-graph configured access (say) http://server.red/ . here's diagram: on left if have 2 constructor parameters of type ixyzservice. 2 instances of webapiclient (since it's got transient lifetime), both share same configuration (since installer created instance , registered that). on right want. i'm not sure how pr...

Bootstrap Collapse/Expand with image -

collapse/expand work not properly. once collapse , expand 1 item , if expand one, first 1 gets collapsed again. images - + , vice versa not working. please help. <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#info2"> <div class="row"> <div class="col-md-12"> <label class="bold">info 2 </label> <label class="aa-dark-red"> deferred 300300 sta dfw 24 mar 14 </label> <span class="pull-right"> <i class="glyphicon glyphicon-minus"></i></</span> </div> </div...

code metrics - Does McCabe formula consider data flow? -

when using mccabe formula m = e-n + 2c does take consideration if data restricted flowing in 1 direction? seems graphs show data flowing in many directions, regardless if happens or not. a codebase has 1 direction of data flow vs (very similar) code base in data can go , forth less complex. this article facebook, mvc , flux great example of i'm asking about: http://www.infoq.com/news/2014/05/facebook-mvc-flux . had data going forth mvc (from view model , vice versa). once switched out mvc flux, data flowed in 1 direction. the article linked replacing 1 (misapplied) architectural pattern another. concept of "data flow" not defined, doesn't matter question. the mccabe formula examines program flow - informally see measure of number of decisions made. measured looking @ every control statement, scale of measures finer grained scale of architectural changes propose. let's go "the mccabe formula doesn't measure data flow"...

javascript - Updating the content of a div using jquery waypoints -

i using waypoints.js in html given below, when waypoint of hardware class reached should update content of <div> having class number content of div.current within div.hardware . my html: <div class="number"></div> <div class="hardware"> <div class="current">1</div> </div> <div class="hardware"> <div class="current">2</div> </div> <div class="hardware"> <div class="current">3</div> </div> <div class="hardware"> <div class="current">4</div> </div> i have this: $(function() { $('.hardware').waypoint(function() { var addnumber = $(this).find('.current').content(); $('.number').content(addnumber); }); }); but doesn't work me. the jquery method contents() , not content() $(function() { $(...

android - Pre-loading multiple videos on a page -

do apps vine or instagram pre-load videos play quickly? i want show 5 video thumbnails on screen @ time, play full screen in fragment when clicked. i'm wondering if pre-loading 5 videos bad idea or inefficient? these videos 5-10 seconds in length. thank in advance!

java - GridBagLayout: component in multiple grid squares -

Image
is possible have single jcomponent spread on multiple grid squares, , if how achieve this? yes possible. read more how use gridbaglayout , find sample code well. in below screenshot long-named button 4 spread across 3 columns , 5 in spread across 2 columns.

android - Trying to get map from fragmentManager always return null -

i'm trying android applications uses viewpager. in third page have map instantiate inside xml of fragment: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" android:orientation="vertical"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" class="com.google.android.gms.maps.supportmapfragment" /> ... </relativelayout> so when try map after onstart() of class extends fragment id of map nullpointerexception . public void onstart() { supportmap...

how can i read output from console in asp.net -

i trying read output .exe file of c++ program , trying use output further use in asp.net web application isn't working have done far system.diagnostics.process myprocess = new system.diagnostics.process(); myprocess.startinfo.createnowindow = true; myprocess.startinfo.useshellexecute = false; myprocess.startinfo.redirectstandardoutput = true; myprocess.startinfo.workingdirectory = "c:\\users\\hussain\\documents"; myprocess.startinfo.filename = "demo.exe"; myprocess.startinfo.arguments = "myargument"; myprocess.start(); string s = myprocess.standardoutput.readtoend(); system.io.streamwriter file = new system.io.streamwriter("c:\\users\\hussain\\documents\\123.txt"); file.writeline(s); file.close(); myprocess.waitforexit(); myprocess.close();

How do I turn off the tabindex in visual studio C# WFA? -

i making simple app, kinda flappy bird, cooler. basic idea is, move , down arrow keys "up" , "down". have 3 buttons on screen, while game running. , down keys conflicting tabindex on buttons. can't seem find function can remove buttons tabindex list. any suggestions?

browser detection - Website showing up as older version of Internet Explorer in IE 11 -

Image
i built website client that located here it using child theme of twenty-thirteen , wordpress 3.9.1. the problem on ceo's computer website showing incorrectly in internet explorer. using ie v.11.0.9600.1704 (update version 11.0.7). slider not showing up, alignment off, social media buttons don't display correctly, , padding in footer incorrect (amongst other things). here screenshot: in other browsers, website looks fine on computer (chrome, firefox, etc.). i installed advanced browser check plugin give warning people using older browsers , warning window does appear on computer in ie 11 though set show if using ie 8 or below. i can not replicate problem on other computer far. have tested on 4 or 5 computers including others in office ie 11 , on various versions of ie on own computer. time happens in ie 8 , below in tests. does have idea why happening? seems not picking of modern css or slider. missing plugin on internet explorer 11 (javascript, etc)? why b...

Displaying dynamic JSON array using AngularJS -

hi have angularjs application. connecting server , getting json array data. dynamic data , not sure how content is. i want display table. how json looks like. response 1 { "success": true, "statusmessage": null, "responseobject": { "sourcecontent": { "classification": [ "new feature", "bug", "bug", "improvement", "improvement" ], "criticalitycode": [ "2", "1", "4", "6", "9" ], "title": [ "title1", "title2", "title3", "title4", "title5" ], "description": [ "description 1", "description 2", "description 3", "descripti...

How to group numeric data into ranges in Rails -

in rails 3.2 app have following model create_table "people", |t| t.integer "height" end the height attribute person's height in cm. i want group data in table 5cm height classes, , return count each height class. e.g., {"height_classes":[150-155, 155-160, 160-165],"height_counts":[1, 3, 11]} how can group classes this? so far i've used following: step = 5 data = people.all.sort_by &:length height_classes = data.map{ |d| d.height - (d.length % step) }.uniq height_counts = height_classes.map{ |hc| data.select{ |d| d.length - (d.length % step) == l }.count} but not meeting needs. achieve is: the height_classes run minimum maximum values in height column (but adjusted 5cm class - i.e. if minimum value 172 grouping should 170-175) any empty classes should included, count of zero the height_classes should string displaying range of values is possible?

ios - UITableView scrolling get disturbed because of NSTimer -

inside 1 class have added uitableview , nstimer . when i'm trying scroll uitableview freezing . if nstimer not added, uitableview working fine. here's code adding nstimer if (self.timer != nil) { [self.timer invalidate]; self.timer = nil; } self.timer = [nstimer scheduledtimerwithtimeinterval:0.0 target:self selector:@selector(updateclock) userinfo:nil repeats:yes]; [[nsrunloop currentrunloop] addtimer:self.timer formode:nsrunloopcommonmodes]; please suggest me solution , did wrong. you should call timer @ least .1 second above or 1 second tableview of application not struck

postgresql - postgres pg_restore pbl with windows shell mode -

the following "c:\program files (x86)\pgadmin iii\1.14\pg_restore.exe" --host localhost --port 5432 --username "postgres" --password "postgres" --dbname "base_nationale" --verbose "e:\dump\ff_d01_2011.dump" gives error message: pg_restore: many command-line arguments (first "--host" why doesn't fuctionne? you can't specify value --password . switch forces password prompt , should never needed. just remove part --password "postgres" . if password needed, pg_restore automatically prompt it. if want run command without password prompt, need .pgpass file or use environment variable pgpass details in manual: http://www.postgresql.org/docs/current/static/libpq-envars.html http://www.postgresql.org/docs/current/static/libpq-pgpass.html or question: how specify password psql non-interactively?

java - XPath XML namespace Issue -

i have read xml has prefixes namespaces not defined example <department:employee xsi:schema="www.abcd.com abcd.xsd" > <emp:name> john </emp:name> </department:employee> i using xpath in java is possible create dynamic namespace , bind document object regards if want use dom api read input, you'll have fix first. regular expressions can help. write function following: read file text. make sure use correct character encoding. regex-search "xmlns:([^\\s:]+)=" find declared prefixes, store them in map. regex-search "<([^\\s:]+):" find used namespace prefixes. determine prefixes used, not declared: every used prefix find if it's in map. for each remaining prefix, replace first "[^\\s?-]>" in document " xmlns:" + prefix + "='http://tempuri.org/" + prefix + "'$0" try toad resulting string dom api, return document. the namespace uri depar...

How to emulate 4-bit integer in Python 3? -

i'd emulate overflow behavior of unsigned 4-bit integers, this: >>> x, y = int4(10), int4(9) >>> x + y int4(3) >>> x * y int4(10) inheritance of builtin int seems work. possible implement int4 class without overriding operator methods __add__ ? no, subclassing int not automatically re-use type when applying arithmetic it: >>> class int4(int): ... def __new__(cls, i): ... return super(int4, cls).__new__(cls, & 0xf) ... >>> x, y = int4(10), int4(9) >>> x + y 19 >>> type(x + y) <type 'int'> you have override __add__ , etc. methods cast int4() when this. if ever want support type (e.g. not support converting other numeric types in process), can generate of these: from functools import wraps class int4(int): def __new__(cls, i): return super(int4, cls).__new__(cls, & 0xf) def add_special_method(cls, name): mname = '__{}__'.format(name)...

How to pass PHP value to Javascript and redirect to other page? -

why cant pass value php code onclick function on button javascript function depcheck2()? redirect 2 different pages depending on value carries. please me? <html> <head> <?php $company_id = $_get['cont']; $query = "select count(department_id) countdep department company_id=$company_id"; $result = mysql_query($query, $db) or die(mysql_error($db)); $row = mysql_fetch_array($result); extract($row); ?> <script> function depcheck2(x){ var countrow = '<?php echo "$countdep";?>'; if (countrow>0){ window.location.assign("editevent.php?id="+x""); } else{ window.location.assign("editevent.php2?id="+x""); } } </script> </head> <body> <?php include("config.php"); $company_id = $_get['cont']; $query = "select * event_details company_id=".$company_id." order eventd...

android - How to avoid exception "Only the original thread that created a view hierarchy can touch its views"? -

i using asynctask for downloading video file update views inside asynctask exception arises "only original thread created view hierarchy can touch views". here sample code. please check , suggest me need correction. the exception arises @ these lines. tvpercent.settext((int)per + "%"); tvspeed.settext(networkspeed+"kbps"); asynctask class public class downloadfilefromurl extends asynctask<string, string, string> { progressbar progbar; textview tvspeed; textview tvpercent; int downloadedsize = 0; int totalsize = 0; private long networkspeed; private long previoustime; private long totaltime; // public downloadfilefromurl(progressbar pb) // { // progbar = pb; // // } public downloadfilefromurl(progressbar pb, textview speed, textview per) { progbar = pb; tvspeed = speed; tvpercent = per; } @override protected void onpreexecute() { ...

java - Retrieve contact name and phone after startActivityForResult() -

this question has answer here: android contacts display name , phone number(s) in single database query? 3 answers i have started new intent activity result code: intent contactpickerintent = new intent(intent.action_pick, phone.content_uri); startactivityforresult(contactpickerintent, 1); and want phone , number: protected void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == 1) { if(resultcode == result_ok){ uri contacturi = data.getdata(); string[] pn = {phone.number}; string[] pna = {phone.contact_id};//idk cursor cp = getcontentresolver().query(contacturi, pn, null, null, null); cp.movetofirst(); cursor cpa = getcontentresolver().query(contacturi, pna, null, null, null); cpa.movetofirst(); int num...

java - dropwizard 0.7 @Session annotation -

i'm trying dropwizard working sessions. i've read in 0.7, dropwizard added session support. release notes: "added support http sessions. add annotated parameter resource method: @session httpsession session have session context injected." i have sample resource class, gets user/password http request, , want save user name in session: @get public response auth(@queryparam("user") string user, @queryparam("password") string password, @session httpsession session) throws urisyntaxexception { uri rooturi = getapplicationrooturi(); if(!user.equals(config.getuser()) || !password.equals(config.getpassword())) { return response.temporaryredirect(rooturi).build(); } session.setattribute("user", user); return response.temporaryredirect( new uri("/../index.html")).build(); } when trying log in app i'm getting: error [2014-05-17 10:33:45,244] com.sun.jersey.spi.container.containerrequest:...

html5 - Validation of text field in HTML using javascript -

i want validate text field "username" of form per below pasted code. validation make username text field mandatory. the problem facing here text fields not getting validated , onclick of submit button directly moving next page "index.html" . can suggest me how can correct in below code? want validation happen first , then if passing validation, user can move next page . my code: <html> <head> <script> //validation username mandatory field function validatecontactform() { var name = document.contactform.userid; if (userid.value == "") { window.alert("please enter name."); name.focus(); return false; } </script> <title> login page </title> </head> <body> <h1 style="font-family:comic sans ms;text-align="center";font-size:30pt; color:#00ff00;> <strong>welcome</strong> </h1> <form name="login"> ...

performance - Reshape three column data to matrix in C++ -

i have file containing 3 columns want reshape matrix. this question answered in link using r: reshape 3 column data frame matrix ("long" "wide" format) since input file big want use c++ purpose. how can create matrix in c++ have fast access element? after can read big file 3 columns line line , put value in right place using hash key or indexing. i think map form std lib can 1 dimensional array. usually when want matrix algebra (since give link r suppose want mathematics data) best use mathematics library. example if use eigen library easy read matrix. after reading matrix there plenty of functions can apply these data. (check benchmarks of library here http://eigen.tuxfamily.org/index.php?title=benchmark ) speaking if want linear algebra or vector manipulation best use libraries used/tested/optimized rather use own std::vector<> or std::map<> , write own loops / functions in order manipulate data. linear algebra code not optimize...

java - App crashes when trying to implement a custom list Adapter ( NullPointerException ) -

error: 05-17 11:27:39.986: e/androidruntime(5172): fatal exception: main 05-17 11:27:39.986: e/androidruntime(5172): process: com.example.yevsnap, pid: 5172 05-17 11:27:39.986: e/androidruntime(5172): java.lang.nullpointerexception 05-17 11:27:39.986: e/androidruntime(5172): @ com.example.yevsnap.messageadapter.getview(messageadapter.java:46) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.abslistview.obtainview(abslistview.java:2240) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.listview.makeandaddview(listview.java:1790) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.listview.filldown(listview.java:691) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.listview.fillfromtop(listview.java:752) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.listview.layoutchildren(listview.java:1630) 05-17 11:27:39.986: e/androidruntime(5172): @ android.widget.abslistview.onlayout(abslistview.java:2091) 05-17 11:27:39.986:...

Comparision of abstract machines for execution of Prolog -

i'm looking research paper or other publication compare different abstract machines (more one) execution of prolog prolog interpreters not based on abstact machines. i've seen far majority of implementations seems base prolog interpreters on warren abstract machine although other abstract machines proposed (eg. vienna abstract machine , tree-oriented abstract machine ) , there no general comparision. i'm interested in comparision of efficiency ( not features), although compared interpreters should allow constraint-logic programming. you can build constraint logic programming on top of ordinary prolog if introduce primitives trailed constraint store , primitives unification hooks. e.g.: sicstus prolog: attributed variables http://sicstus.sics.se/sicstus/docs/3.7.1/html/sicstus_17.html jekejeke minlog: little solver http://www.jekejeke.ch/idatab/doclet/prod/en/docs/15_min/10_docu/02_reference/04_examples/05_solver.html http://www.jekejeke.ch/idatab/docle...

uiimage - Xcode 5. I am scaling picked images. How do I get the size in bytes of the new image in displayed in the console? -

in image picker scaling picked image after picked want see difference between resulting image , original. there nslog statement can throw in there it? it nice know original images numbers in contex: cgsize targetsize = cgsizemake(150,150);t heres code using scaling: -(void) imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { [picker dismissviewcontrolleranimated:yes completion:nil]; uiimage *sourceimage = [info objectforkey:@"uiimagepickercontrolleroriginalimage"]; cgsize targetsize = cgsizemake(150,150); uigraphicsbeginimagecontext( targetsize ); [sourceimage drawinrect:cgrectmake(0,0,targetsize.width,targetsize.height)]; uiimage* targetimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); self.lookpik.image = targetimage; you can test size of uiimage in bytes this: nsdata *imagedata = uiimagejpegrepresentation(yourimage, 1); nslog(@"size of image %d bytes...

mysql - PHP Session Array values -

i struggling script pull values out of session array , call information table in database. i can values store in session no problem , looks when print it: array ( [0] => 17 [1] => 18 [2] => 19 [3] => 20 [4] => 20 [5] => 19 [6] => 17 ) i have below php pull values out of array , pull records database appears breaking somewhere , unfortunately still quite noob @ php. ?php $action = isset($_get['action']) ? $_get['action'] : ""; if($action=='removed'){ echo "<div> removed cart.</div>"; } if(isset($_session['cart'])){ $ids = ""; foreach($_session['cart'] $id){ $ids = $ids . $id . ","; } // remove last comma $ids = rtrim($ids, ','); $query = "select * events eventid in ({$ids})"; $stmt = $con->prepare( $query ); $stmt->execute(); $num = $stmt->rowcount(); if($num>0){ echo ...

The first formal parameter in an Ada procedure -

from ada2012 reference manual: arm2012.html/rm-4-1-3.html a selected_component not expanded name shall resolve denote 1 of following: a view of subprogram first formal parameter of tagged type or access parameter designated type tagged: why significant have first formal parameter? please explain examples. the definition in 4.1.3 selected components, 9.1/2 provides prefixed notation , allows 1 invoke primitive operations of tagged type without mentioning enclosing package explicitly. related example seen here .

convert two dimensional array to one dimensional in C -

i have 2 dimensional array this: ptr = (int **) malloc(size); (i = 0; < len; i++) { ptr[i] = (int *) malloc(size); } is there simple way create int *intptr array such can access values in row major order? e.g.: if ptr points n*n array, want first item of second column this: *(intptr + n) i need conversion pass 2 dimensional array cuda kernel, want avoid pass 2 dimensional array kernel because seems quiet complicated. no. if had allocated true 2d array of int s: int a[size][size]; then answer might yes though result not portable. refer this article more array type punning information. but accessing element in row of array requires explicitly dereferencing pointer.

Neural Network on Windows Phone 8.0 -

i trying neural network application on windows phone 8. , writing below code: activationnetwork network = null; //global variable network = new activationnetwork( new bipolarsigmoidfunction(2), //aktivation func. 9, //input count 20, //hidden layer count 1 //output count ); this code working on desktop project.(c#) not working windows phone 8. this aforge framework's function. installed via nuget. when clicked run getting error. error code: an exception of type 'system.typeloadexception' occurred in panoramaapp2.dll not handled in user code additional information: type 'aforge.neuro.bipolarsigmoidfunction' assembly 'aforge.neuro, version=2.2.5.0, culture=neutral, publickeytoken=2094f4ea39731d4f' attempting implement inaccessible interface. what problem? how can succeed? thanks in adva...

visual studio 2013 - Can't add Local Database to project -

this might dumb question... in vs2013 when trying add local database windows forms application project option shown in c# items menu. db available service-based db. understand, related sql compact edition have sql server 2012 installed. ideas? or there significant differences between local db , service-based db? a service-based database database accessed through server. uses mdf data file, sql server format. able connect sql server database sql server service must running, because it's that processes requests , access data file. a local database 1 local application only. uses sdf data file, sql server ce (compact edition) format. there no need install server access sdf database. distribute dlls constitute ssce along app , access data file directly. you'd use ssce if data accessed app , there relatively small amount of data. project use sql server. testing purposes can use free express edition. when deployed might still use ssee or might use full version of sql ...

vbscript - how to make exporting of file in hta and saving to disk -

i working on hta app have made app u can enter text , voice plugin reading want code can make sound exported , saved disk set objvoice = createobject("sapi.spvoice") set objstream = createobject("sapi.spfilestream") line="hello there" objstream.open "c:\users\hellothere.wav", 3, vbfalse set objvoice.audiooutputstream = objstream objvoice.speak line

java - Netbeans Servlet not progressing after a certain point -

the application i'm developing based on java ee , target build web-based airline application enters new tours in derby database , displays when requested. manually added table field , right want display field information on webpage. jsp page takes tour id user: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp page</title> </head> <body> <form action="tourplanservlet" method="post"> tour id:<input type ="text" name = "tourid" > <input type = "hidden" name = "action" value ="recordentry"> <p>press submit find tour</p> <p><input type="submit" name="submit" value="submit"></p> </form> </body> servlet takes int input jsp: private static tourplanfacaderemote tpfr1; ...

javascript - DurandalJS how to redirect without rendering the page? -

is possible navigate page hash , logic , redirect without rendering new page/module refresh one, navigating from? actually want logic , refresh same page without showing splash screen. for example have simple html link: <a class="language-link" href="#language/en-us"> in language.js have simple code getting data in "activate" function: define(['plugins/router', 'jquery'], function (router, $) { return { activate: function (culture) { return $.post("api/language", { '': culture }, function () { router.navigateback(); }).then(function () { return false; }); }, viewurl: 'settings/loading' }; }); buty problem is, short period of time, loading.html viewurl property showing up. right after i'm going previous page. i want prevent loading.html page rendering. how that? i'm travelling through durandal documentacion , searching in google, cannot find hel...

javascript - Making 'scroll-sneak' work -

i've been trying make javascript code 'scroll-sneak' ( http://mrcoles.com/blog/scroll-sneak-maintain-position-between-page-loads/ ) work few weeks now. code stops 'page jump' (to top) when anchor link clicked, , without disabling functionality of link. i'd have page not move top when navigation link in table row below clicked. works on developer's demo page, none documented. takers tacking this? <tr id="tabs"> <th><a href="index.htm">information</a></th> <th><a href="plan.htm">research</a></th> <th><a href="councils.htm">sources</a></th> <th><a href="university.htm">institution</a></th> <th><a href="contact.htm">contact</a></th> </tr> <script> (function() { var sneaky = new scrollsneak(location.hostname), tabs = document.getelementbyid('tabs'...

php - Ajax Javascript Last data inserted -

i want last data inserted table in realtime, using ajax refresh data every 5 seconde. first of calling php script current last id, , place in variable "last" variable "last" undefined if global variable var last = 0; var ischanged =0; window.setinterval(function(){ alert(last); $.post( "controller/ajaxcomment.php", { act: "getlastcommentid", id_post: params.id }, function(data) { data = data.tostring(); if(ischanged == 0) { last = data; ischanged = 1; } // alert("data" + data + "last" + last); last = 3 ; if(last != data) { var last = data; $.post( "controller/ajaxcomment.php", { act:"getlastcomment" , id_post: params.id }, ...

c++ - Reasoning behind CFReadStreamCreateForHTTPRequest in OSX/IOS -

i have written asynchronous http client in c++ ios/osx. confused why headers not arriving in cfhttpmessageref response object until realised there object lurking property of stream contains headers (after handling kcfstreameventbytesavailable event). so copy headers property response object during notification of stream ending, before calling event handler. (code available on request, there's quite lot of it) the apple documentation characteristically silent on subject , wondering if out there knows reason design decision apple. keen know in case have fundamental misunderstanding somewhere? edit: documentation says this: after schedule request on run loop, header complete callback. @ point, can call cfreadstreamcopyproperty message response read stream however there seems no indication name or value of event mask is. edit: having done experimenting, see stream creates own response object time after sending kcfstreameventopencompleted notification , befo...