Posts

Showing posts from April, 2010

arrays - Combinatorial game in java -

i've got assignment computer science class. i've been thinking answer more 2 weeks without success decided give try in here. game consists of 4 cia agents using 4 adjacent telephone booths. arrive @ set of booths 1 @ time, following rules: 1 - agent chooses booth has 2 neighbouring booths unoccupied (this includes booths @ edges of set); 2 - if condition above isn't met, agent chooses booth has 1 neighbouring booth unoccupied; and 3 - if both conditions fail, agent chooses booth. there 8 different ways of occupying booths given 4 agents , 4 booths, according rules. example: agent #1 occupies first booth (the left edge one), agent #2 occupies third booth (from left right), agent #3 occupies fourth booth , agent #4 occupies second booth. we asked write code counts number of ways 19 agents occupy 19 booths, according these rules. my natural choice problem creating array of boolean, in false represents vacant booth , true represents occupied booth: public

Test Android PackageManager.getInstaller() -

maybe missing very obvious here: i wanted test packagemanager.getinstallerpackagename() . when test app through eclipse, or standalone apk, above method returns null expected. users install through google play or amazon appstore , returned value not null . my question how test before putting app production? ( eg. possible: upload draft in android developer console, , without moving production, somehow access through google play, maybe using device setup same account developer console account; , install , test on test device?) updated answer: if want able test actual install google play use alpha , beta programs. see here description of program. original answer: if want test handling of case, can use buildconfig.debug flag give dummy value when in debug mode. string installer; if (buildconfig.debug) { installer = "com.android.vending"; } else { installer = pm.getinstallerpackagenamge(mypackage); }

entity framework - ASP.NET MVC domain Models and Identity Models in same context - UserLogin has no key -

Image
i want application models in same dbcontext has identity model. inserted classes identitydbcontext this: public partial class applicationdbcontext : identitydbcontext<applicationuser> { public applicationdbcontext() : base("humantask") { } public virtual dbset<wfinstance> wfinstance { get; set; } public virtual dbset<wfservice> wfservice { get; set; } public virtual dbset<wftask> wftask { get; set; } public virtual dbset<wfworkflow> wfworkflow { get; set; } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<wftask>() .property(e => e.wftaskid) .isunicode(false); modelbuilder.entity<wfworkflow>() .property(e => e.name) .isunicode(false); } } } now, when try create new controller 1 of classes classes using

Error with Git SVN clone -

i migrating several projects svn git, , using git's 'svn clone' feature. trying run following: git svn clone --stdlayout --authors-file=authors.txt <path-to-svn-project> <local-git-repo-name> i have been able clone several smaller projects, when try , clone larger project gives following errors: couldn't truncate file @ /usr/lib/perl5/site_perl/git.pm line 1322. error removing .git/git_04wyzv @ /usr/lib/perl5/5.8.8/file/temp.pm line 890. i thought find quick fix in google search, instead looks unusual error. have clue how can past this? my versions pretty recent, , i'm trying run on windows 8.1: git: using version 1.9.4.msysgit.0 subversion: using version 1.8.9 git-svn: using version 1.9.4.msysgit.0 run git --version , ensure on version 2.4+. can't find link right now, in 2.2.x , before, there bug in git svn code cause fail @ various points through large repository migrations. ended working git developers on irc , using pat

javascript - Why does document.getElementById return an object that has a property called 'value'? -

i'm trying learn javascript , dom. based on examples on internet have created html: <input type="text" id="amount3"> then later in javascript code have line. document.getelementbyid("amount3").value= x; the code works well. i'm able change what's shown inside text input. i'm trying understand underlying code , how works. looked dom reference in https://developer.mozilla.org/en-us/docs/web/api/document.getelementbyid . i can see method should return object element . however, element not contain property called value. notice there sub-object called htmlelement has sub-object htmlinputelement. , object contains property called value. is code above somehow typecast child object? why value property work such? htmlinputelement inherits htmlelement which, in turn, inherits element . if object inherits object, have properties of object. this means expects deal element can given htmlinputelement instead (since

java - How can I use Assert in Unit Testing? -

package htmlunit; import org.junit.assert; import com.gargoylesoftware.htmlunit.webclient; import com.gargoylesoftware.htmlunit.html.htmlpage; public class test { public static void main(string[] args) throws exception { final webclient webclient = new webclient(); final htmlpage page = webclient.getpage("http://htmlunit.sourceforge.net"); assert.assertequals("htmlunit - welcome htmlunit", page.gettitletext()); final string pageasxml = page.asxml(); assert.asserttrue(pageasxml.contains("<body class=\"composite\">")); final string pageastext = page.astext(); assert.asserttrue(pageastext.contains("support http , https protocols")); if(assert.asserttrue(pageastext.contains("support http , https protocols"))){ system.out.println("true"); } else { system.out.println("false"); } sy

python - scrapy how to import the settings to override it -

this code class test(spider): self.settings.overrides['jobdir']= "seen" i got: file "c:\python27\lib\site-packages\scrapy\spider.py", line 46, in settings return self.crawler.settings file "c:\python27\lib\site-packages\scrapy\spider.py", line 41, in crawler assert hasattr(self, '_crawler'), "spider not bounded crawler" assertionerror: spider not bounded crawler i extending spider , not using crawler because don't have links nor rules follow i guessing problem because didn't import settings , need please in order change settings in spider can: class testspider(spider): def set_crawler(self, crawler): super(testspider, self).set_crawler(crawler) crawler.settings.set('jobdir','seen') # rest of spider code

html - W3Layouts Theme Not Working? -

alright downloaded theme http://w3layouts.com , , css not working @ all. have edited title. here's header html: <!doctype html> <html> <head> <title>orb security | affordable security systems america | orb security inc.</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link href='http://fonts.googleapis.com/css?family=open+sans:400,700,800,600,300' rel='stylesheet' type='text/css'> <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/font-awesome.css" rel="stylesheet" type="text/css" media="all" />

php - Retrieve uplaoded photo laravel -

so managed upload multiple images need display in page tried code below says "unidentified variable: photo" <img class="img-responsive" src="/images/{{ $photo->filename }}" > here's upload code, updated code. route::post('space/add', array('before' => 'auth', function() { $data = input::all(); $provider_id = auth::user()->id; $spaces = space::where('provider_id', '=', $provider_id)->get(); $space = new space; .... $space->save(); $file = input::file('image'); $provider_email = auth::user()->email; // $space = space::find($id); $rules = array( 'file' => 'required|mimes:png,gif,jpeg' ); $validator = \validator::make(array('file'=> $file), $rules); if($validator->passes()) { foreach(input::file('image') $file)

windows 8 - Complete function in WinJS.UI.Pages.IPageControlMembers method -

how can complete function in init before call ready method. code: winjs.namespace.define("data", { source: "" }); var page = winjs.ui.pages.define("/html/page.html", { init: function (element, options) { createdatasoucre(); }, ready: function () { document.getelementbyid("result").innerhtml = data.source; } }); function createdatasoucre() { //blah blah (calculate thousands of calculations) data.source = result; } when run, page doesn't render "result" tag. try use promises doesn't work me: init: function (element, options) { return new winjs.promise.as(createdatasoucre()); } thanks time. i tried code in simple test project follows: (function () { "use strict"; winjs.namespace.define("data", { source: "" }); function createdatasource() { data.source = "<ul><li>item

java - How to serialize a lambda? -

how can elegantly serialize lambda? for example, code below throws notserializableexception . how can fix without creating serializablerunnable "dummy" interface? public static void main(string[] args) throws exception { file file = files.createtempfile("lambda", "ser").tofile(); try (objectoutput oo = new objectoutputstream(new fileoutputstream(file))) { runnable r = () -> system.out.println("can serialized?"); oo.writeobject(r); } try (objectinput oi = new objectinputstream(new fileinputstream(file))) { runnable r = (runnable) oi.readobject(); r.run(); } } java 8 introduces possibility cast object intersection of types adding multiple bounds . in case of serialization, therefore possible write: runnable r = (runnable & serializable)() -> system.out.println("serializable!"); and lambda automagically becomes serializable.

java - Download function with overwrite -

i doing function download files android device, works fine want if downloaded file exists in device overwrite it. here code: class downloadtask extends asynctask<string, integer, string> { private context context; private powermanager.wakelock mwakelock; public downloadtask(context context) { this.context = context; } @override protected void onpreexecute() { super.onpreexecute(); // take cpu lock prevent cpu going off if user // presses power button during download powermanager pm = (powermanager) context.getsystemservice(context.power_service); mwakelock = pm.newwakelock(powermanager.partial_wake_lock, getclass().getname()); mwakelock.acquire(); mprogressdialog.show(); } @override protected void onprogressupdate(integer... progress) { super.onprogressupdate(progress); // if here, length known, set indeterminate false mprogressdialog

java - how do i add a number to an integer every second -

i'm making cookie clicker sort of game , want thing every second number let's 5 added number. every second integer variable going 5. how create sort of time measuring method measures time can add number number. public class timetesting { // i've put method here create // timer thing void timer() { } public static void main(string[] args) { // original number int number = 1; // number want added on original number every 5 seconds int addednumber = 5; } } if you're targeting android platform use countdowntimer, allows execute code every amount of time duration. aware android doesn't work main method j2se does. anyway, if you're looking foward program android game, i'd highly recommend start here: android development

playframework 2.0 - Play-Java OSGi Embeddable? -

context i have set of bundles implemented myself running on felix (an implementation of osgi framework). bundles written in java. question with above scenario decided implement mvc application using play framework java, question is, how can use bundles running on felix? bundles represent libraries need develop application. i though putting play app inside felix, doesn't seem possible? had problem before? thanks. i believe question vague....any way, try answer had understood. using maven[i took assumption]. create parent maven project , should server application frame. create maven modules under parent modules, libraries.. start osgi embedded framework inside application frame expose api in application frame install , update , stop bundles. create bundle activators in each libraries modules. use bnd tool create bundle then start application. install bundle , enjoy.....

jQuery- How to get the GET variable from a URL -

in js file, outputting hyperlinks based on data pulled api: output += '<a class="reg_link" href="'+regobj.href+'?reg='+value+'" title="'+regobj.title+'" target="_blank">'; this works fine. however, later want find out ?reg= value is. $(".reg_link").each(function() { // how get variable url? }); i'm trying grab whatever value of variable is. how do that? from how can query string values in javascript? you don't need jquery purpose. can use pure javascript: function getparameterbyname(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new regexp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeuricomponent(results[1].replace(/\+/g, " ")); } usage: var reg = getparameterbyname('reg')

deleting rows from sql through jsp -

i developed small web page allows user register user , login. have admin login wherein admin can see users in database , able delete or edit user. so, created 2 jsps 1 redirected when admin logs in , other when clicks delete. due reason not getting directed delete page admin page. admin.jsp <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@page import="java.sql.*" import="com.javadbproject.util.dbconnectionmanager" import="javax.servlet.http.httpservlet"%> <%@ page language="java" contenttype="text/html; charset=us-ascii" pageencoding="us-ascii"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=us-ascii"> <title>home page</title>

javascript - How to tell if key is held down at click -

this question has answer here: check ctrl / shift / alt keys on 'click' event 9 answers i want able tell if user holding down "shift" key (or key, really) when user clicks something. i'm able tell if user clicks (by using .click() method on element in directive) , if user presses key, can't figure out how tell if user holding down key @ click time in angular. any appreciated. try use ngkeydown directive. calling on view this. ng-keydown="myfunct($event)" myfunct this. $scope.myfunct = function(keyevent) { if (keyevent.which === 16) {// 16 == shift. guess; $scope.shift_is_been_pressed = true; } } so. same ngkeyup directive. ng-keyup="myfunct($event)" $scope.myfunct = function(keyevent) { if (keyevent.which === 16) {// 16 == shift. guess; $scope.shift_is_been_pressed = fal

How to Block IP DDOS in nginx -

this result ddos command http://upanh.biz/images/2014/08/18/untitled.jpg please ! the ngx_http_access_module module allows limiting access client addresses. access can limited password or result of subrequest. simultaneous limitation of access address , password controlled satisfy directive. location / { deny 192.168.1.1; allow 192.168.1.0/24; allow 10.1.1.0/16; allow 2001:0db8::/32; deny all; } the rules checked in sequence until first match found. in example, access allowed ipv4 networks 10.1.1.0/16 , 192.168.1.0/24 excluding address 192.168.1.1, , ipv6 network 2001:0db8::/32. in case of lot of rules, use of ngx_http_geo_module module variables preferable. source: http://nginx.org/en/docs/http/ngx_http_access_module.html

php - Cannot send table format to gmail using PHPmailer. -

i used msghtml() function send mail body. ishtml enabled in mailer script. html tags rendered in mail, inline style worked. table not rendered in gmail. inbox showing plain text. images displayed clearly. php code $pd_details.=' <table > <th>prod no |</th> <th>prod name |</th> <th>prod price |</th> <th>prod quantity |</th> <th>prod image |</th> <tr><td>'.$c.'</td><td>'.$pname.'</td><td>'.$total.'</td><td>'.$quant.'</td<td>'.$pdimg.'</td></tr> </table> total price : '.$sum.' '; try this... $from='sender details'; $to='receiver email address'; $headers .= 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1'

python - How to get a widget position inside it's layout in Kivy? -

i have gridlayout , added image widgets on after adding of images want draw rectangle in each image using canvas couldn't because don't know exact image widgets positions on gridlayout. code: http://paste.ofcode.org/3bdp9yhjrcrzmsztbu9hqp4 http://paste.ofcode.org/3az3gx4fxzr9dlhe2ami97c in last line of python code : rectangle(pos = (child.x - 2.4, child.y + 467), size = (70, 70)) how draw rectangle in child(my method not good^), also why gridlayout not coming in center after setting it's pos_hint = {"center_x" : .5}? if understand question right, try use such methods to_local() , to_parent() , to_widget() , to_window() . try substract position of gridlayout widgets' positions.

javascript - Bootstrap Modal Background Scrolling Issue -

when bootstrap modal window open, have been unable stop background scrolling main page. followed directions given in stackoverflow question, have been unsuccessful far: prevent body scrolling when modal opened on left side, near top of page, after loads, see button says "large modal". if click it, open modal window. after open, if scroll , down, see background moving. http://gettinmobile.com/home.html i have added css directed in stackoverflow question linked above: body.modal-open { overflow: hidden; } i have added javascript shown on same stackoverflow question, though not sure done correctly: <script type='text/javascript'> $("#mymodal").on("show", function () { $("body").addclass("modal-open"); }).on("hidden", function () { $("body").removeclass("modal-open") }); </script> any appreciated, maybe can see i'm doing wrong... thanks!

docusignapi - Senders Notifications -

i have following json request, if not use senders notifications, works if add senders notifications not, why? { "usersettings":[ { "value":"false", "name":"allowsendonbehalfof" } ], "signeremailnotifications":{ "envelopeactivation":"false", "envelopecomplete":"false", "carboncopynotification":"false", "certifieddeliverynotification":"false", "envelopedeclined":"false", "envelopevoided":"false", "envelopecorrected":"false", "reassignedsigner":"false", "purgedocuments":"false", "faxreceived":"false", "documentmarkupactivation":"false", "agentnotification":"false" }, "senderemailnotifications":{ "envelopecomplete

jquery - Accessing request parameters which are not from <form> in RESTful web services -

i trying request parameters in post method of rest service. getting null value. have tried different techniques using @formparam , request.getparameter("message") no success. have used jquery ajax client: $("#temp1").click(function () { var msg = $("#temp1").attr('href'); var jsonobject = {"message":msg}; var datastring = json.stringify(jsonobject); $.ajax ({ type: "post", url: "http://localhost:8080/getsomerest/webresources/getfile/1", contenttype: 'application/json', data: datastring, datatype: 'json', cache: false, success: function (data) { var msg_data = data; $(msg_data).appendto("#content"); $('#buttn').show(); } web service method: @path("1") @post @consumes("application/json") @produces("text/p

java - Path requests must specify a user by using UserEnvironment -

i getting "path requests must specify user using userenvironment" error using environment.getexternalstoragedirectory().getpath() i traced code , found in java.io.environment there function produce error : private static void throwifuserrequired() { if (suserrequired) { log.wtf(tag, "path requests must specify user using userenvironment", new throwable()); } } i searched in web , found solution here environment.setuserrequired(false); but solution not working me because cannot access "setuserrequired" method of environment. compilation error. searched function in environment class , found : /** {@hide} */ public static void setuserrequired(boolean userrequired) { suserrequired = userrequired; } can me how can access external storage of phone? solution ? emergency. lot you need use userenvironment , path user. int userid = userhandle.myuserid(); scurrentuser = new userenvironment(useri

How to host large files on Google-App-Engine -

i server runs on google app engine host large files such audio scripts , images, possible store them column in database? if not, mechanisms may use? you have 2 options: blobstore (currently available in java, python , go). google cloud storage (currently available in java, python , php).

C# xsd xmlreader, how to count attribute names -

this simple guys, need able count attribute names within xml document when validating xml against schema using c#. duplicate attribute names (not valid). if xsd has these in it: <xsd:schema> <xsd:complextype name="scheduleevent"> <xsd:all> <xsd:element name="basic" type="mybasic"/> </xsd:all> </xsd:complextype> <xsd:complextype name="mybasic"> <xsd:choice minoccurs="0" maxoccurs="unbounded"> <xsd:element name="descriptor" type="descriptor" maxoccurs="1"/> <xsd:element name="descriptor1" type="descriptor1" maxoccurs="1"/> </xsd:choice> </xsd:complextype> <xsd:complextype name="descriptor"> <xsd:attribute name="test" type="typ:test"/> </xsd:comp

javascript - kendo ui crud operations using only jquery and Ajax -

i developing web application deals interactive grids. using kendo ui displaying grids , doing crud operations. new kendo ui. performing database calls using jquery, ajax . able make read data database , display it. stuck @ crud operations. how event specific row or specific single data changed , perform update. please me understand how crud operations. couldn't find in detail anywhere . there 8 parameters in first column. user should able change rest of data except parameters . following code grid. createwbdgriddata triggers database service call , creates table . gridsource json data getting database after converting through json convert function. $(document).ready(function() { var param ="hole_diameter|4.875_casing_id|5.5_gravel_pack|net_perf_thickness|perf_diameter|perf_gravel_perm_@19k|gravel_beta_factor_@19k|shot_density"; $.when(getwbdgriddatabywell(param)).then(function (data) { }); }); function createwbdgriddata(gridsource) { if (gridsource == undefin

ios - getting error in EChart library [__NSCFString value] -

i using echart library, trying make bar chart in ipad. did make in demo project getting error : -[__nscfstring value]: unrecognized selector sent instance 0x8bba220 2014-08-18 08:28:44.684 stat_v2_ipad[19187:70b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfstring value]: unrecognized selector sent instance 0x8bba220' and here error code after debugging : /** highest value among whole chart*/ - (ecolumndatamodel *) highestvalueecolumnchart:(ecolumnchart *) ecolumnchart{ ecolumndatamodel *maxdatamodel = nil; float maxvalue = -flt_min; nslog(@"after flt_min : %.f",flt_min); (ecolumndatamodel *datamodel in mergedarr) { nslog(@"data.value = %f",datamodel.value); if (datamodel.value > maxvalue) { nslog(@"inside ifd"); maxvalue = datamodel.value; maxdatamodel = datamodel; } } nslog(@"finished max %.f",maxdata

java - How create table with spring data cassandara? -

i have created own repository that: public interface myrepository extends typedidcassandrarepository<myentity, string> { } so question how automatically create cassandra table that? spring injects myrepository tries insert entity non-existent table. so there way create cassandra tables (if not exist) during spring container start up? p.s. very nice if there config boolean property without adding lines of xml , creation beanfactory , etc. :-) overide getschemaaction property on abstractcassandraconfiguration class @configuration @enablecassandrarepositories(basepackages = "com.example") public class testconfig extends abstractcassandraconfiguration { @override public string getkeyspacename() { return "test_config"; } @override public schemaaction getschemaaction() { return schemaaction.recreate_drop_unused; } @bean public cassandraoperations cassandraoperations() throws exception {

android - Animation in seekbar to go to initial point once thumb is dragged to its end -

how animate seekbar 1 drags thumb seekbar max value thumb automatically goes initial point.i begginer plz if possible give elaborated answer sb.setonseekbarchangelistener(new onseekbarchangelistener() { @override public void onstoptrackingtouch(seekbar seekbar) { // todo auto-generated method stub } @override public void onstarttrackingtouch(seekbar seekbar) { // todo auto-generated method stub } @override public void onprogresschanged(seekbar seekbar, int progress, boolean fromuser) { value = sb.getprogress(); if (value == 50) { drawable drawable = getresources().getdrawable(

php - Opencart multiple product template based on stock status -

i want create 1 or 2 more product templates products in opencart store. supplier has restrictions on products can , can't sold online. some products allowed sold online , prices can displayed some products can have price online, no add cart button , display "available in-store only" some products can't have price or add cart would possible make 2 product templates change depending on assigned stock status? op in linked post, want can changed in options menu. opencart - view alternate product template based on arbitrary product field you can make specific template products don't want sell without price or add cart button. there way, can make specific template each product. need edit /catalog/controller/product/product.php , find line: if (file_exists(dir_template . $this->config->get('config_template') . '/template/product/product.tpl')) { $this->template = $this->config->get('config_template

javascript - Capture value on page submit -

i web developer, in application have form , text box. if type text in text box , when submit value not getting captured, taking default value. <form class="form-search" onsubmit="myfun();return false;" name="myfrm"> <input type="text" name="search" id="search" style="width:225px" style="height:5px" placeholder="enter city or area..." value="jayanagar,bangalore" > <input type="submit" value="search" class='btn btn-default'> </form> <script> myfun(){ window.location.reload(); } </script> it should capture textbox value before refreshing.    and captured data passed api parameter.  i unable capture data. in firefox working expected. how can this? text box value can captured.. <form class="form-search" onsubmit="myfun();re

objective c - iOS Encrypted Notification sounds -

i trying develop alarm clock app lot of custom sounds. know these have in aiff-format , want them encrypted aren't accessible (and downloadable) through tools ifunbox or similar . right now, can encrypt files can't work notifications. so basically, when app open ( uiapplicationstateactive ), decrypt them before playing them through avaudioplayer , can't pass these files soundname local notifications. (because encrypted , notifications doesn't know should decrypted first. does know way either achieve sort of protection without encrypting these files or way let notifications use these encrypted files? thanks in advance! sorry, there no way achieve that. sound file must read system without app running, , thus, being able decrypt sound file.

c# - update-database to dll in EntityFramework -

update-database executed on class library in solution. have configuration:dbmigrationsconfiguration<testcontext> class in data.dll , add reference data.dll on other project example console app , want set update-database in package manager console.how can that?

c# - Retain time stamp of a downloaded file in FTP -

i'm able download file ftp server. want save file retaining time of file in ftp server. how can in c#? example: file name: file1.gz date: 8/16/2014 8:00:00 am i'll download file1.gz today 8/18/2014 want save date of download 8/16/2014 8:00:00 am. what mean how can save make file date same file date in ftp server. you can set creation date of file this: file.setcreationtime("file1.gz", somedate); more usage , example can found here .

post - $_POST["variable"] in PHP is not remembered in all the pages in my project -

Image
i having 3 pages : page1.php , page2.php , page3.php . page1.php registration form , action of form page2.php in page2.php want display entered value of registration form in page1.php type: as see in page2.php have tag makes go page3.php in page3.php have code: http://s28.postimg.org/4fruiudt7/page3.jpg but gives me following error messages: notice: undefined index: username in d:\xampp\htdocs\test\page3.php on line 3 username: notice: undefined index: passwd in d:\xampp\htdocs\test\page3.php on line 4 password: my question is: how make page3.php remember $_post variables. and how make rest of php files in directory of page1.php , page2.php , page3.php remember values of $_post variable too. i suggest should using $_session kind of stuff. can assign value it, , remembered. think problem current script not "post" page3.php via forms, therefore php won't find in variables.

Atom Editor: Fold selection onto single line -

is there way in atom fold entire selection on new line? i'm trying make package lets me select multiple lines of code , fold them. markup this: /* text colors */ .text-red { color: red; } .text-green { color: green; } .text-blue { color: blue; } /* typography */ h1 { font-size: 30px; } and when fold it, this: /* text colors */ [...] /* typography */ h1 { font-size: 30px; } this way can view looks of sections in code @ same time. i've tried using foldselectedlines unfortunately ends folding this: /* text colors */ .text-red {[...] /* typography */ h1 { font-size: 30px; } its ctrl - alt - f on linux & windows or ctrl - ⌥ - ⌘ - f on mac. also in atom press ctrl - shift - p (or ⌘ - shift - p on mac) open command palette , type fold list of possible fold options , related keyboard shortcuts.

quickbooks - Creating an Invoice with LineItemRef does not automatically fill the line item description -

when try create invoice line item ref without providing line item description, qbo doesn't prefill product description line item description. have checked same via apiexplorer , confirmed behaviour. here's sample create request xml: <invoice xmlns="http://schema.intuit.com/finance/v3"> <line> <amount>15</amount> <detailtype>salesitemlinedetail</detailtype> <salesitemlinedetail> <itemref>36</itemref> </salesitemlinedetail> </line> <customerref>378</customerref> </invoice> is there anyway can ask qbo prefill description line item if no description field specified part of create request? thanks, ravi no, not possible. need explicitly set description value. thanks

C# management a grants -

i have problem management grants user enabled two/three different areas, example, user profile don't have problems: user = foo area = east level = 2 instead, user profile: user = pluto area = east area = west level = 2 the statement users() performs access control on table of authorized users according area of membership , expected level (0, 1 , 2) takes account west area user pluto, rather enable both area east , west. my code below. any appreciated, in advance. protected void users() { using (odbcconnection conn = new odbcconnection(configurationmanager.connectionstrings["cn"].connectionstring)) { sql = " select * "; sql = sql + " tblusers "; sql = sql + " (email = ? "; sql = sql + " , degree not null); "; using (odbccommand command = new odbccommand(sql, conn)) { try { command.parameters.a

sql server - SQL required data based on date -

i have been working on report required output. scenario block manufacturing firm having multiple orders of same client delivers orders on credit on different dates , clients pays amount partially irrespective of orders. have been stuck in these 2 tables: orders_master, do_no client_id site_id order_date amount 1 1 1 2013-10-27 50000 2 1 1 2013-10-29 47000 3 1 1 2013-10-15 10000 client_payments, p_id client_id site_id p_date amount 1 1 1 2013-11-05 30000 2 1 1 2013-11-10 67000 3 1 1 2013-11-20 10000 i need write query gives following output rows both tables, do_no client_id site_id order_date p_date order_amount payment_amount 1 1 1 2013-10-27 null 50000 null 2 1 1 2013-10-29 null 47000 null null 1 1 null

c - Unable to start the int correctly and keep the number back from the function -

first @ sorry english, try best. well, here's problem, making c program learning, program students manager, wanted add final function in user prompted id remove , after inserting id student eliminate database, problem is... when data inserted in first case there's added subroutine automatically adds id , int in struct,problem shows random int number "43405" or thought start integer 1, problem when function re-called again id 1 , don't work. p.d:i read of guys told me make code more readable, can give me nice "tutorial" or make that? function: int insertar_notas(struct alumnos notas[20], int n,int id_alumno){ char resp[3]; system("cls"); puts("\n \a insercion del alumno\n"); while (!strstr(resp,"no")){ fflush(stdin); printf("\nel id de este alumno sera: %d\n", id_alumno); notas[n].id=id_alumno; id_alumno++; puts("\ndime el

asp.net: ListView on the masterpage -

i have asp.net pages. i used masterpage implement common control. there listview on masterpage. and there label on contentpage. i want implement below. when user select node on listview of masterpage, the label text on contentpage changed text of node. how can implement this. could give me advice or link question? thank in advance. on master1.master , used itemcommand event on listview <form id="form1" runat="server"> <asp:listview id="list1" runat="server" onitemcommand="list1_itemcommand"> <itemtemplate> <p> <asp:label id="itemlabel" runat="server" text="<%#container.dataitemindex %>" /> <asp:linkbutton id="itemlink" runat="server" commandname="selectitem" text="select" /> </p> </itemtemplate> </a

json rpc - How to store blocks in Objective C? -

i started writing simple json rpc tcp library in objective c. have method invokes rpc method: - (void)invokemethod:(nsstring *)method withparameters:(id)parameters requestid:(id)requestid success:(void (^)(id responseobject))success failure:(void (^)(nserror *error))failure { nsassert(nsclassfromstring(@"nsjsonserialization"), @"nsjsonserialization not found!"); nsdictionary *requestobject = @{@"jsonrpc": @"2.0", @"method": method, @"params": parameters, @"id": requestid}; nserror *error = nil; nsdata *jsonddata = [nsjsonserialization datawithjsonobject:requestobject options:0 error:&error]; if (error){ return failure(error); } [self->callbacks setobject:@{@"success": success ? [success copy] : [nsnull null],

android - Smaller notification on the watchface -

Image
how in watchface set attribute (a flag?) make notification appear in "small notification mode" - below: instead of such: it possible since release of new android wear watchface api. in our activity extends canvaswatchfaceservice on oncreate() call: setwatchfacestyle(new watchfacestyle.builder(analogwatchfaceservice.this) .setcardpeekmode(watchfacestyle.peek_mode_short) ... .build()); and setcardpeekmode(watchfacestyle.peek_mode_short) key there. can show bigger peek card - watchfacestyle.peek_mode_variable .

ios - Push parameter in controller is always null -

i'm having tableview. , in didselectrow right object want pass next controller. this code: id<navigatedelegate> strongdelegate = self.delegate; nsdictionary * dictionary = [_dataarray objectatindex:indexpath.section]; nsarray * array = [dictionary objectforkey:@"data"]; poi * poi = [array objectatindex:indexpath.row]; nslog(@"%@", poi); nslog(@"category %@", poi.rank.name); [tableview deselectrowatindexpath:indexpath animated:yes]; detailsviewcontroller * detailscontroller = [[detailsviewcontroller alloc] init]; detailscontroller.details = [[nsdictionary alloc] initwithobjectsandkeys:poi.name, @"name", poi.address, @"address", poi.details, @"details", poi.title, @"title", poi.url, @"url", nil]; if ([strongdelegate respondstoselector:@selector(navigatefromto:to:)]) { [strongdelegate navigatefromto:self to:detailscontroller]; } then in de

c - LPC1788 microcontroller intermittently not sending USB messages -

i'm developing code nxp lpc1788 microcontroller, , part of work making product based on usb-compatible. of legwork done , in general communication on usb works on can. however, 1 of issues i've been encountering that, when producing constant output of usb messages microcontroller sent pretty close together, of these messages dropped. i'm using custom driver wrote based on winusb receive messages on pc side, , suspected problem on receiving end of things. however, using usblyzer i'm confident problem on sending side - usblyzer logs match logs produced out of winusb_readpipe() . the lpc1788 uses usb 2.0 full speed protocol , i've confirmed information being sent , received @ around 12 mhz using probe, should be. the device configured make use of 2 endpoints: logical endpoint 2 in , logical endpoint 2 out. both of these configured bulk transfer maximum packet size of 64 bytes. i think messages being sent around 500-600 microseconds apart @ least (i'v