Posts

Showing posts from July, 2015

Deleting Column in C# WPF Datagrid with Bindable Dynamic Dictionary -

i'm having rough time deleting column of data in datagrid , having deletion propagate data source. i've implemented solution binding data found in thread , , using code delete column: vizdatagrid.columns.remove(cell.column); what's happening ui shows column being deleted, when go add column, column thought had deleted appears (or @ least data inside column does). appreciated, i've been @ days (winforms simpler!). thanks! it because of autogeneratecolumns="true" . set false , add columns on own in code behind. please check post dynamically adding columns datagrid .

Is it possible to have one android XML layout with a menu footer and load content into it? -

i writing android application, , have decided use footer menu in application layout. there simple way insert footer menu layout? , important, having footer set, there way have 1 main layout , load relevant content every menu-option chosen? thanks!

java - Proxy pass based on authentication and authorization -

in application, downloading video remote video url. in spite of routing throw servlet, want download video doing proxy pass apache like.. proxypass /download http:///download now before passing remote server, want authentication , authorization in between, servlet used authentication (may url). based on url response, proxy pass should work otherwise request must drop error. how can it. there other module. please suggest. here can find list of authentication , authorization modules in apache. please go through list , choose whichever appropriate you! check link under other modules section

forms - Add validation constraints on mapped = false fields for a specific validation group -

i'd able add in form class additional validation constraints specific validation group. how ? since symfony 2.1, adding validation while building form looks : use symfony\component\validator\constraints\minlength; use symfony\component\validator\constraints\notblank; $builder ->add('firstname', 'text', array( 'constraints' => new minlength(3), )) ->add('lastname', 'text', array( 'constraints' => array( new notblank(), new minlength(3), ), )) ; sources is there way assign them validation constraint ? in case, have validation groups depending on submitted data thanks in advance suggestions ok, solution pretty straighforward actually. looking @ constraint class, noticed exposed $groups property , addimplicitgroupname(string $group) method. when know that, know it: $cv1 = new notblank(); $cv1->groups = array('mygroup'...

java - "Cannot reference Employee.DEFAULT_GENDER before supertype constructor has been called" Error -

i have following code public class employee { private string name; private string gender; private int age; final string default_gender = "male"; final int default_age = 18; public employee(string name,string gender,int age) { this.name = name; this.gender = gender; this.age = age; } public employee(string name) { this(name,default_gender,default_age); } } i getting following error cannot reference employee.default_gender before supertype constructor has been called i don't understand why saying employee.default_gender ? have not defined static! , why not allowing me call constructor 3 parameters? have defined default_gender , default_age ensure default values. need create employee object name(gender , age set default in case. no default constructor allowed). views of why happening? default_gender instance variable of class employee , cannot used until instance of class created. until constructor executes instance not constructe...

ios - Contact Usage permission request iphone -

my app rejected apple review team. according them reason is "17.1: apps cannot transmit data user without obtaining user's prior permission , providing user access information how , data used.specifically, app accesses users contacts out requesting permission first" but, have used **nscontactsusagedescription** key in info.plst specify reason of using contacts in app. what should have additionally permission? you have ask user whether application can access address book. feature implemented in ios 6.0 , above. you can try code snippet: #define system_version_greater_than_or_equal_to(v) ([[[uidevice currentdevice] systemversion] compare:v options:nsnumericsearch] != nsorderedascending) in - viewwillappear: // asking access of addressbook // if in ios 6 if (system_version_greater_than_or_equal_to(@"6.0")) { // request authorization address book addressbook_ = abaddressbookcreatewithoptions(null, null); i...

c# - run application in system tray and set hotkey for copy in clipboard -

i want have application without viewable form(for run in system tray only). now, when user pressed hot key(for example "f11") , copy selected texts application clipboard , want print texts in defined format . don't know how can that. please me... thanks lot you need use hooking contains 3 main part: a system hook allows insert callback function intercepts windows messages (e.g., mouse related messages). a local system hook system hook called when specified messages processed single thread. a global system hook system hook called when specified messages processed application on entire system. in addition requirement, need use global system hook. can use helpful link . update: i think it's simple side of story detect keyboard pressed key, or put formless app in system tray (trough link ), can set text clipboard using system.windows.forms.clipboard.settext("hello, clipboard"); but , text? that's point of interest. if wanna selec...

How to format a reusable code from normal jquery code -

i having function repeated on in site jquery $(function() { //check enabled state on load if(!$(".notifyowner").is(':checked')){ $(".ownerday").attr("disabled", "disabled"); $(".ownerdaytype").attr("disabled", "disabled"); } //toggle enabled state when checkbox clicked $(".notifyowner").click(function() { if($(this).is(":checked")) { $(".ownerday").removeattr("disabled"); $(".ownerdaytype").removeattr("disabled"); $(".owneractive").removeclass("disabled"); } else { $(".ownerday").attr("disabled", "disabled"); $(".ownerdaytype").attr("disabled", "disabled"); $(".owneractive").addclass("disabled"); } }); }); i tried make reusable code below function selecttoggle(obj, dayclass, daytypeclass, txtactive){...

asp.net mvc - How to avoid jQuery validator firing on textbox tab out -

i have following jquery validator in mvc4 scenario. working fine. need validation when user clicks button; not when user change textbox focus. how make change? jquery $(function () { jquery.validator.unobtrusive.adapters.add ("lijovalidator", ["param"], function (options) { options.rules["lijovalidator"] = options.params.param; options.messages["lijovalidator"] = options.message; }); jquery.validator.addmethod("lijovalidator", function (value, element, param) { alert(value); alert(param); alert(element); alert($("#" + param).val()); return false; }); }(jquery)); client validation in selctedvaluecheckattribute public ienumerable<modelclientvalidationrule> getclientvalidationrules(modelmetadata metadata, controllercontext context) { modelclientvalidationrule mcvr = new modelclientvalidationrule(); mcvr.validationtype = ...

javascript - knockout validating multiple levels deep observable array -

hi need create custom validator aplyed each element of observable array using knockout validation plugin. structure of object when post server: var viewmodel = { evaluationformdatacontract: { studentassignmentinstanceid: value, evaluationtype: value, categories: array[ categoriesonevaluationdatacontract1 = { memo: value, categoryid: value, title: value, // fields needed validation hasmemo: value, memoismandatory: value questions: array[ questionsonevalcategorydatacontract1 = { memo: value, grade: value, hasgrade: value, hasmemo: value, showonlymemo: value }, questionsonevalcategorydatacontract2 = { memo: value, grade: value, hasgrade: value, hasmemo: value, showonlymemo: value }] ...

highcharts - Highstock limit max zoom out -

i using highstock component display stock history data goes in range of years. require (if possible) set max zoom range (the opposite of minrange does) limit user zoom out on several years...say limit zoom range maximum of 1 year. thanks in advance support. unfortunately there isn't specific option that. however, can achieve using aftersetextremes callback. in callback can compare event.min , event.max , set new extremes if timespan bigger max.

load part of html using php/jQuery -

i'm trying figure out way load 1 single tab(tabs jquery) without reloading others. issue have submit button , dropdown create new form, , when on new form 'ok' or 'cancel' clicked, has original form back. the code load part of page found this: $("#tab-x").load("managetab.php #tab-x"); but know how use in combination $_post variable , submit-button clarification: i have .php(managetab.php) contains several tabs , contents i have in each of these tabs dropdown containing database-stored information(code these dropdowns stored in other pages) for each of these dropdowns, there exists submit button aditional information out of db based on selection, , put these informations in new form editing this new form ideally able submitted without reloading except owning tab. greetings <script> $(document).ready(function() { $("#form1").submit(function(){ event.preventdefault(); $.post('data.php',{data : ...

jquery - SCRIPT5007: Unable to get property 'settings' of undefined or null reference -

create function [dbo].[pmurp_func_parsearray] (@array varchar(1000),@separator char(1)) returns @t table (extractwords varchar(50)) begin --declare @t table (col1 varchar(50)) -- @array array wish parse -- @separator separator charactor such comma declare @separator_position int -- used locate each separator character declare @array_value varchar(1000) -- holds each array value returned -- loop work need separator @ end. -- left of separator character each array value set @array = @array + @separator -- loop through string searching separtor characters while patindex('%' + @separator + '%', @array) <> 0 begin -- patindex matches pattern against string select @separator_position = patindex('%' + @separator + '%',@array) select @array_value = left(@array, @separator_position - 1) -- process values passed. insert @t values (@array_value) -- replace select statement processing -- @array_value holds value of element of array -- replaces proces...

filesystems - awk part string compare -

i trying extract part of string using bash or awk. i think can solve problem using read or awk. my input_file below cat ./input_file in_size=1 # out_size=2 so, out_size=$(awk '{if($2=="out_size=2"){ blabla ; print output}' ./input_file) i don't know how solve problem. and, how can set multiple field separator fs empty space , tab. there example like fs='[/=]' how can use 4 fs / = " " "\t" ?? thanks in advance. use posix-style character class [:blank:] includes horizontal whitespace characters. awk -f '=|[[:blank:]]+' '{ (i=1; i<nf; i++) { if ($i == "out_size") { print $(i+1) exit } } }' filename unless know it's 2nd word: awk -f '=|[[:blank:]]+' '$2 == "out_size" {print $3; exit}' filename

passwords - PHP password_hash error -

i have been trying understand password salting , hashing project working on. responses previous question saw php manual password_hash way start. however, when trying out code on page, error haven't been able resolve. code: <?php /** * note salt here randomly generated. * never use static salt or 1 not randomly generated. * * vast majority of use-cases, let password_hash generate salt randomly */ $options = [ 'cost' => 11, 'salt' => mcrypt_create_iv(22, mcrypt_dev_urandom), ]; echo password_hash("rasmuslerdorf", password_bcrypt, $options)."\n"; ?> error: parse error: syntax error, unexpected '[' in /home/content/##/######/html/testingfolder/hashnsalt.php on line 8 according manual - the above example output: $2y$11$q5mkhsbtlsjcnevsyh64a.acluzhngog7tqakvmqwo9c8xb.t89f. line 8 $options = [ can here explain why getting error - since have copied , pasted test page php manual itself? still in stages of...

Cygwin Output problems -

i have script cut -d "|" -f 8,9,13,23 info.txt > result.txt when open result.txt looks this: r s l t = r c 2 6 8 | r w t = r c k r d d m c e s r t w o s x n n e when should this: rslt=rac268|rawt=rickard adam cesar 2 6 9 it works in console, guess problem within output operator.

javascript - How to Link a Script In WordPress -

my script doesn't work in wordpress. i'm trying convert html page wordpress theme.. ive got css linked.. <link type="text/css" rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/min/mycss.css" /> but script doesn't connect.. <script type="text/javascript" src="min/myjs.js"></script> i tried same , using <?php bloginfo('template_directory'); ?> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/min/myjs.js"></script> help? don't include scripts , stylesheets way. use wp_enqueue_scripts . assuming custom theme, add code functions.php file. add_action( 'wp_enqueue_scripts', 'theme_scripts_styles' ); function theme_scripts_styles() { // enqueue scripts , styles here } in function use wp_enqueue_script , wp_enqueue_style queue files (should ...

PHP string comparison, === or strcmp not working -

i have hash map contains keys sorted versions of values. example, $hash = array( "abc" => "cab", "aas" => "sas" ); i have array of sorted strings($sorted_words) , want compare these strings keys of above hash map , if match found, store corresponding value in string. use === , strcmp(), neither works. says strings didn't match. here code : foreach($sorted_words $sc) { foreach($hash $key => $value) { if(strcmp($sc, $key) == 0) { // or if($sc === $key) $string_match .= $value; // store corresponding value matched key. } } } but comparison fails strcmp() returns greater 1 , '===' never returns true. can tell what's wrong ? i'm pretty sure there strings match. try : $string_match = ""; foreach($sorted_words $sc) { if(array_key_exists($sc, $hash)){ $string_match .= $hash[$sc]; } }

java - How to differentiate String and Integer in ArrayList? -

i have array list this arraylist list = new arraylist(); list.add("somethingold"); list.add(3); list.add("somethingnew"); list.add(5); now if print list output like: [somethingold, 3, somethingnew, 5 ] here want fetch integer elements. i want output like, if integer put in other list, else in 1 more list. this want: [3,5] [somethingold, somethingnew] have tried this?: if(list.get(0) instanceof integer) { // integer } else if (list.get(0) instanceof string) { // string } looping through each element in list for loop: for (int = 0; < list.size(); i++) { if (list.get(i) instanceof integer) { // stuff } if (list.get(i) instanceof string) { // stuff } } for-each loop: for (object obj: list) { if (obj instanceof integer) { // stuff } ... }

Strippin an element in xml and replacing the value of an element based on certain condition using xslt -

i getting stuck @ point need remove element input xml: <message xmlns="http://www.origoservices.com" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" > <m_control> <control_timestamp>2013-06-06t14:55:37</control_timestamp> <initiator_id>asl</initiator_id> </m_control> <m_content> <b_control> <quote_type>single company</quote_type> <quote_or_print>quote , print</quote_or_print> <generic_quote_ind>yes</generic_quote_ind> <tpsdata> <tps_quote_type>comparison</tps_quote_type> </tpsdata> </b_control> <application> <product> <tpsdata> <service_type>quickquote</service_type> <quote_type>standard</quote_type> </tpsdata> </product> </application> </m...

override - add event listener for kendo grid command button -

i working on asp.net mvc4 application.in using kendo ui controls. i using kendo grid.and want add event listener on kendo grid toolbar's "add new item" button. below piece of code of grid command button: .toolbar(commands => { commands.create(); commands.save(); }) and want overrides click event.actually want check condition on click event.and if condition returns true want button should enable otherwise should disable. i have tried overrides of below codes not worked. example: 1) '$(".k-button.k-button-icontext.k-grid-add").bind("click", function () { alert('add link event'); }); 2) $(".k-grid-add").on('click',function () { alert("hello"); }); 3) $(".k-button.k-button-icontext.k-grid-add").on("click", function () { alert('add link event'); }); ' but none of ab...

android - Upload photo from gallery or take from camera in Webview -

my application webbased , need upload photos, website have file input button, made work wv = new webview(this); wv.setwebviewclient(new webviewclient()); wv.getsettings().setjavascriptenabled(true); wv.getsettings().setallowfileaccess(true); wv.setwebchromeclient(new webchromeclient() { public void openfilechooser(valuecallback<uri> uploadmsg, string accepttype, string capture){ muploadmessage = uploadmsg; intent = new intent(intent.action_get_content); i.addcategory(intent.category_openable); i.settype("image/*"); mainactivity.this.startactivityforresult( intent.createchooser( i, "file chooser" ), mainactivity.filechooser_resultcode ); } but shows gallery pick photos, need take camera @ same time. i tried solution upload camera photo , filechooser webview input field opening camera, not uploading taken photo in example wv.setwebviewclien...

Adding php code in javascript function -

i have php code want execute on button click event in function. tried in various way no luck. it's easy new not do. <?php session_start(); $appid = '----'; $appsecret = '----'; // facebook app secret $return_url = 'dev01.dev/fb/facebook-php-sdk/examples/'; //path script folder ?> <!doctype html> <html xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en-gb" lang="en-gb" ><head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <title>js/ajax facebook connect</title> <script> function ajaxresponse() { alert("hi"); } function lodinganimate() //show loading image { $("#loginbutton").hide(); ajaxresponse(); } </script></head><body> <?php if(!isset($_session['logged_in'])) { ?> <div id="results"> </div> ...

redirect - Remove point after domain name in nginx -

i have detected site accessible using domain name point @ end. example "sim-portal.ru.". works , found form of domain name according w3c. need domain automatically redirected normal domain (without point) example "sim-portal.ru", because cookies don't work in "pointed" domain , links looks wrong. i've redirected www.-prefixed domain (like www.sim-portal.ru) basic domain using next rule: server { listen 80; server_name www.sim-portal.ru; rewrite ^ http://sim-portal.ru$request_uri? permanent; #301 redirect } but same rule doesn't work post-pointed domain: server { listen 80; server_name sim-portal.ru.; rewrite ^ http://sim-portal.ru$request_uri? permanent; #301 redirect } what doing wrong? i've found solution myself. rule added both server {} blocks (either www.sim-portal.ru , sim-portal.ru) solve issue: if ($http_host != 'sim-portal.ru') { return 301 http://sim-portal.ru$request_...

javascript - Three.js: no luck updating cube textures on runtime with r59 -

i created cube using canvas renderer r59 of three.js. cube has different textures on different sides. renders okay. can tween cube's position , rotation, it's fine. here's want do: a) cube has image texture on it's front side. b) move cube out of camera's view. c) change image texture on cube. d) move cube original coordinates becomes visible again. so far, steps a, b , d working. when try implement step c, stops working. here relevant code parts... <body> <script src="build/three.min.js"></script> <script src="js/libs/tween.min.js"></script> <script> var container; var camera, scene, renderer, group, particle; var cubemesh; var matcollection = []; var materials = []; init(); animate(); function init() { container = document.createelement( 'div' ); document.body.appendchild( container ); ...

data structures - grid representing as graph -

i thinking of grid , suppose in grid '#' represents way blocked , '.'(dot without quotes) represents there way.so if inside grid can walk inside when found way(.) e.g., ####### ##a#### ##.#.## ##.#.## ##...## ####### for above example, found way , reaches other place below in picture: ####### ##.#### ##.#a## ##.#.## ##...## ####### if thinking problem graph how represent grid graph ? how represent adjacency list ? new graph stuided bfs only, please answer in easy words each cell have edges 4 neighbouring cells. every cell appear in adjacency lists of 4 neighbouring cells. actually don't need explicitly construct graph, can work on grid itself. represent specific node, can use coordinates of applicable cell , go neighbour, can increase / decrease x / y one. i hope clear enough.

php - Sending a template email from Mandrill using API is empty -

i trying send email using mandrill api json , php through curl. can send text based email , basic html formatting, when try send template php not work. however, when copy , paste json poststring mandril api page ( https://mandrillapp.com/api/docs/messages.html ) works , sends correctly! missing website adding? { "key": "xxx", "template_name": "temp-name", "template_content": [ { "name": "example name", "content": "example content" } ], "message": { "subject": "welcome our website", "from_email": "xxx@gmail.com", "from_name": "name", "to": [ { "email": "xxx@gmail.com", "name": "name" } ], "important...

java - How to resize font of a gridview in onCreate method, in android? -

how can resize font size of gridview?? i've searched on internet can't understand them (i new in android application programming). here link says how resize font of gridview: change font size, color in gridview while loading in 1 place says: please set code in getview method in gridview adapter: how create getview method?? gridview adapter??/ please guys me!!!

css - Detecting :first-letter by javascript -

i need know if element styled :first-letter style, , should general solution won't depend on class names or special style attributes. there way? example: <p class="initial">first</p> <p>second</p> .initial:first-letter { float: left; font-size: 1.5em; font-weight: bold; } $('p').click(function(){ // how determine if :first-letter applied current paragraph? }); if css self-hosted, can: get list of css blocks filter out css blocks not contain :first-letter in block's selector iterate on list of remaining css blocks, , run matchesselector() target element receiver , current css block's selector argument. if matchesselector() returns true , current css block's rules affect target element's first letter. otherwise move on next css block in list if css isn't self-hosted , cdn doesn't send cors headers, cannot read css file source due privacy issues , cannot done. i have left out figuri...

c++ - Exception thrown in handler functions -

i reading following text in applied c++ book. can exceptions thrown within our handler functions? answer yes, error can indeed thrown. problem exception must in every exception specification may tranversed until exception caught. if not done, application call std::terminate(). large system, amounts adding exception specification every function , unless understand dynamics of application perfectly. important cath exceptions within destructor; otherwise, std::terminate() called in case. in above text have following questions , need in understanding. what author mean "exception must in every expection specification may traversed" ? my understanding destructor cannot use exceptions. author mean catch exceptions within destructor. request clarify simple examples thanks time , help. generally, exception specifications bad idea, because produces lot of refactoring , scale problems (the problems wich autor talks about) when modify specifi...

php - Using Dynamic URL for PayPal Redirect -

i have orders form, in following variables chosen: price, currency, quantity (+ others). form submitted through jquery: $("#paypal_form").submit(); everything fine , transaction goes on normally, in end paypal doesn't redirect specified url in form. let me know correct setting paypal is, because in paypal's options choice fill in url (otherwise won't allow set auto return setting), url dynamic , changed based on transaction id. looks this: <input type="hidden" name="return" value="myreturnurl.php?orderid=88273882717a72734"> here form (fields filled in js): <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" id="paypal_form"> <p> <input type="hidden" name="cmd" value="_xclick" /> <input type="hidden" name="charset" value="utf-8" /> <input type="hidden" ...

Windows 8.1 Bing Food & Drink app hands free mode, is there an API? -

in new bing food & drink app there cool feature, has hands-free cooking mode, allows follow recipes step step device waving hand across camera. is there sort of api such "camera gestures" ? there nothing on web that, , api interesting. i believe said @ build created scratch.

Clear Select Based on Uncheck using Javascript -

using jsfiddle this question able see how can clear input box form check box. question how alter javascript clear select (in case 'addbasepfo14') instead specific name instead of clearing input found in form without disrupting existing onchange event? $(document).ready(function(){ $('#chk').live('change',function(){ if(!$(this).is(':checked')) $('input').val(''); }); }); <form> <input type="checkbox" id="chk"> <select id="addbasepfo14" name="addbasepfo14" onchange="calculatetotal()" /> <option value="0">none</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">...

Sending packets with Scapy within Python environment -

i playing around scapy , want use within python script sending packets seem problem. here code. scapy shell: send(ip(src="10.0.99.100",dst="10.1.99.100")/icmp()/"hello world") this works fine , sends packet. python script: #! /usr/bin/env python scapy.all import sr1,ip,icmp p=sr1(ip(src="10.0.99.100",dst="10.1.99.100")/icmp()/"hello world") this runs fine when tries send packet get: warning: no route found ipv6 destination :: (no default route?) begin emission: .finished send 1 packets. ....^c received 5 packets, got 0 answers, remaining 1 packets when run in python environment using sr1 function. sr1 function send packet , wait answer, keeping count of received packets. see more here - http://www.secdev.org/projects/scapy/doc/usage.html#send-and-receive-packets-sr to behavior desire, need use send function, did when using scapy shell. #! /usr/bin/env python scapy.all import send, ip, icm...

Should a beginner learner start from Rails 3 or Rails 4 -

i want ror , got learning rails 3 book version 4 of rails out, i've been looking @ in ruby on rails tutorial . question is: should learn rails 3 before jumping 4? what's difference between them? you can jump rails 4 straight away. ruby on rails tutorial michael hartl place start.

NHibernate OrderBy a correlated subquery -

i have parent has collection of property . each property has propertyclass , value . want return list of parent ordered value of attached attached property given propertyclass let's parent represents car, there exists property propertyclass "color". want return list of cars ordered value of "color" property. in straight sql, easy, order correlated subquery. select * [parent] order (select [value] [property] [propertyclass] = 'color' , [parentid] = [parent].[id]) but not know how accomplish @ in nhibernate. i've gotten far creating subquery projection , setting order-by of query using it: var dc = detachedcriteria.for<core.property>() .add(restrictions.eq("propertyclass", sortbyproperty)) .setprojection(projections.property("value")); var query = basequery.orderby(projections.subquery(dc)); but order-by clause generated misses correlated subquery part- [parentid] = [parent].[id] , invalid s...

jquery - Check toggle state -

i want check toggle state. when check console log of browser, visible value true , doesn't change false. why happening? , how can fix it? <html> <head> <script src='~/scripts/jquery-1.4.1.min.js' type="text/javascript"></script> <script type="text/javascript"> $(function () { $('#divupdateform').click(function () { $('#divupdatecontent').slidetoggle(); console.log($('#divupdatecontent').is(":visible")); }); }); </script> </head> <body> <div id="divupdateform" runat="server" class="panel" >update panel state</div> <div id="divupdatecontent" runat="server"> ... content </div> </body> </html> you need check before slide element, during slide, element visible: $(function () { $('#divupda...

rest - Dojo EnhancedGrid Scrolling with JsonRestStore -

i using dojo 1.6 enhancedgrid jsonreststore shown in snippet below. have 15000 records of data. when vertical scrollbar grid dragged down in order scroll, takes long time data visible in grid. after debugging, noticed single act of scrolling sends 4-5 requests server. is there better way solution this, or there way insure last request sent server? able capture onscroll event, wasn't sure how prevent request being sent. store = new dojox.data.jsonreststore({ target:"myurl", idattribute: 'id', allownotrailingslash: true}); mygrid = new dojox.grid.enhancedgrid({ id: 'mygrid', queryoptions: {ignorecase: true}, sortinfo: '3', store: store, structure: my.grid.structure, selectionmode: "extended", autoheight: 12, plugins: {indirectselection: true}, fastscroll: false },document.createelement('div')); dojo.byid("datagrid").appendchild(mygrid.domnode); // start ...

amazon web services - Failed to start Elastic Beanstlk -

i'm trying first elastic beanstalk configuration, , failed that's did: mkdir .ebextensions vi 01installation.config config: packages: apt: apache2: [] libapache2-mod-wsgi: [] git: [] apache2-threaded-dev: [] commands: 01_download_apache_mod_dumpost: command: sudo git clone https://github.com/danghvu/mod_dumpost.git 02_command: command: alias apxs2=apxs 03_change_log_level: command: sudo sed -i 's/loglevel warn/loglevel debug/' /etc/apache2/apache2.conf 04a_install_mod_dumpost: command: sudo make 04b_install_mod_dumpost: command: sudo make install next downloaded aws-elastic-beanstalk-cli , created alias eb: alias eb="python2.7 ~/aws-elasticbeanstalk-cli-2.4.0/eb/linux/python2.7/eb" than in working directory did: git init . git add . git commit -m "initital setup" than did: eb init eb start after answered question in cli, got this: waiting environme...

android - how to change switch imput text color in xml? -

Image
my text in switch defined in xml file won't change it's color stay black activity background. tried textcolor option without success. ideas? my xml file <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000"> <linearlayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="hôte : " android:textcolor="#ffffff"/> <edittext android:background="#4...

java - JPA ManyToMany relation infinite loop -

i have 2 entity objects ,whose fields are: operation--> {id, name, applications} application-->{id, name, operations} as u can see, both of these objects can include each others list, @manytomany(cascade={cascadetype.all},targetentity=operation.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore) @jointable(schema="rbmcore", name="t_rbm_opscreens_ops_apps", joincolumns={@joincolumn(name="app_id", referencedcolumnname="id")}, inversejoincolumns={@joincolumn(name="op_id", referencedcolumnname="id")}) other @manytomany(cascade={cascadetype.all},mappedby="operations",targetentity=application.class) @lazycollection(lazycollectionoption.false) @notfound(action = notfoundaction.ignore) each of them has definition this(vice versa join column part). when gives exception "sessions not exist or closed" . whe...

php - Loose coupling with data source -

first of sorry not able provide details , question might sound general. i working on small project requirement of project bit wired. have make data source switchable. if using database data source in future might able use web service or files. i don't have clue on how implement models can switch data source without making major changes application. is there design pattern or design practices can use deal situation? i planning on using zend framework. thanks in advance. take @ dao s (data access object). it's existing in j2ee world simple, thin , usefull. first define interface whatever function need: <?php interface daointerface { public function insert($object); public function remove($object); public function create($object); } then create concrete implementation of it. implementation exchangeable dependecy injection (di). can have several different ways of storing data now. you'll use interface + di. one interface ->multip...

xml - Aligning fields based on position using XSLT -

i have xml document records have separate fields subject tags in english , spanish. individual tags separated semicolons. <collections> <collection name="anycollection"> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0001</field> </record> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0002</field> </record> <record> <field name="materia">comida; bebida; fiesta</field> <field name="subject">food; drink; party</field> <field name="recordid">abc0003</field> </record> <...

graphics - Rendering a 3D model in matlab -

i have searched lot, there seems no solution problem. thought in community here might have answer this. i trying render these models in matlab can sample them , use shape research work. my question that: there way render 3d models, used in different 3d graphics engines, in matlab? i have found similar loads obj mesh. update: have found answer uses opengl function in mex file access graphics of figure , depth buffer. trying render model within matlab figure. take at: http://www.openu.ac.il/home/hassner/projects/poses/ i understand it's still not stable, they're working on it. anyway, lets render matrix , whatever (imshow it, imwrite it, etc.) good luck!

java - JTextArea Transfer Focus -

i'm trying transfer focus 1 jtextarea when user hits tab. i'm using code: public void keytyped(keyevent e) { if(e.getkeychar() == keyevent.vk_tab){ entertextarea.transferfocus(); } } this appears work - focus moves , type in next jtextarea - text stills gets appened first textarea, meaning performing gettext() on second textarea returns "" . how make text typed go second jtextarea rather appended first? edit: on further inspection behavior caused separate bug. no further needed. you can transfer text 1 2 using gettext on first one. public void keytyped(keyevent e) { if(e.getkeychar() == keyevent.vk_tab){ entertextarea.transferfocus(); string firstfield = textfield1.gettext(); secondfield.settext(firstfield); } } that way save first text area, , put second one. hope helps!

directx - C++ indicates my highest Shader Model is 3 -

i'm trying detect what's highest shader model graphics card has in c++ using if(caps.vertexshaderversion < d3dvs_version(i, 0)){return false;} shader model want check, can 3. the problem i've checked graphics card (gigabyte geforce gtx 470) , has directx 11 shouldn't have shader model 5? or there wrong way i'm checking shader model? direct3d 9, api you're using, not aware of direct3d 11's existence, therefore, reports highest supported shader version supported in d3d9.

javascript - Switching from a region to another in Marionette, views are not rendered correctly -

i'm working marionette , have following problem. i've created layout 2 different regions. on initialize layout loads 2 views in 2 regions of layout. viewa , viewb . within viewa event triggered. event consumed layout switch , other 2 views injected. viewc , viewd . whenever switching performed, viewc , viewd not have same style (also css) applied them. in particular, jquery mobile styles not applied. advice? here code comments highlight important parts. onconfirm : function() { this.leftview = new viewc(); this.rightview = new viewd(); this.leftregion.show(this.leftview); this.rightregion.show(this.rightview); // fix calling trigger('create') seems fix problem. why? correct? this.$el.trigger('create'); }, initialize : function() { // listen event triggered viewa // e.g. gloabalaggregator.vent.tri...

Unity3d Prime31 Google Play Game Services Tutorial -

Image
does know of resources on web prime31 google play game services plug in work unity3d? its been 3 days, don't seem making progress testing game play services in game. i using sha1 ~/.android/debug.keystore - believe the right sha1 unsigned version uses. tried using published build in order game center come up. i tried prime31 documentation, doesnt seems helping. believe app correctly setup in game service area of developer console. any information great. thank you. it turned out after importing game center package , ended 2 manifest files. had prime[31] admob in project, comes manifest file. way normal. after talking support service directed me use "generate androidmanifest.xml file..." under prime[31] drop down menu inside unity3d. merges 2 files single manifest. problem got solved. i had upgrade latest files, downloading them manually, prime[31] web site. after 2 steps able game center work properly. i hope help , posting interaction pri...

Ruby Tutorial Chapter 5.7 -

on guide: http://guides.rubyonrails.org/getting_started.html on topic 5.7 showing posts, after creating show.html.erb file supposed error: activemodel::forbiddenattributeserror when submiting form, instead nomethoderror in posts#show . can tell me doing wrong, or solution this? def postscontroller < applicationcontroller def new end def create @post = post.new(post_params) @post.save redirect_to @post end private def post_params params.require(:post).permit(:title, :text) end def show @post = post.find(params[:id]) end end your show method private, move above private keyword in controller , should set. below.. def postscontroller < applicationcontroller def new end def create @post = post.new(post_params) @post.save redirect_to @post end def show @post = post.find(params[:id]) end private def post_params params.require(:post).permit(:title, ...

c# - Dynamic multidimensional Arrays (Lists?) -

from reading online, i've seen answers solving dynamic arrays such use list. i'm bit confused how perform list operations on multidimensional array. maybe if can understand how implement piece of code such below, i'd able grasp them better. public void class class1(){ string[,] array; public void arrfunction() { array=new string[rand1,rand2]; int rand1=somerandnum; int rand2=somerandnum2; for(int i=0; i<rand1; i++){ for(int j=0; j<rand2; j++){ array[i][j]=i*j; } } } your method work fine, need declare , initialize rand1 , rand2 variables before using them, , access array correctly: public void arrfunction() { int rand1=somerandnum; int rand2=somerandnum2; array=new string[rand1,rand2]; // don't use these until they're set for(int i=0; i<rand1; i++){ for(int j=0; j<rand2; j++){ array[i, j]=i*j; // use [i, j],...

Angularjs what is the differences of handling ajax from success/error and promise? -

i'm not sure should handle response of ajax request. there 2 flavours. handle via success/error callback $http. handle via then() method promise result. both responds expected. but, suppose there 'catch' use each one. google didn't show me way. , angular.js source code kinda... cryptic me. notice: example (1) responds first , (2) responds next. think because localhost latency null , both async method. $http({ method: 'post', url: 'ping.php', headers: {'content-type' : 'application/json'} }). success(function(data, status, headers, config) { console.log("flavour 1 success"); }). error(function(data, status, headers, config) { console.log("flavour 1 error"); }).then(function() { console.log("flavour 2 success"); }, function() { console.log("flavour 2 error"); }); according angular documentation, {httppromise} –...

internet explorer - IE table with multiple rowspan leads to extra white space in cells -

Image
for project need use tables. simplified part of project. important me able build type of table structures. problem is, ie in cases adds white space after , before table cells. in ie: in safari/chrome/firefox correct: thanks help! balint my code: <table cellpadding="0" cellspacing="0" border="1" width="656px"> <tr> <td rowspan="1" colspan="1"> <table style="width: 164px; height: 20px;" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#ffff99" width="100%" height="100%"> </td> </tr> </table> </td> <td rowspan="2" colspan="2"> <table style="width: 328px; height: 40px;" bgcolor=...