Posts

Showing posts from May, 2014

Proper include design practice in PHP -

Proper include design practice in PHP - i've started working on larger preexisting code base of operations (php) , has come attending lot of these files utilize includes/requires in unreadable way. includes/requires sort of cascade through file system, because every file in scheme includes/requires file called common.php. mutual file includes/requires every other file, seems when developer in doubt, included/required mutual , called good. this written professional web developers, , i'm still student, i'm curious if mutual practice in php. in php should there mutual file includes/requires everything, should each file included/required case case, or there different way mutual practice? on side note: i'm trying switch out api file new 1 (while keeping old compatibility testing), , hard me tell files utilize new api or old one. generally, includes should used view based material (html, smarty, perhaps xml or xslt) in mark used build view in mvc a

Ogre Error In Cmake -

Ogre Error In Cmake - while implementing cmake in code getting ogre error: /usr/bin/ld: cannot find -logre my cmakelists.txt file looks like: #specify version beingness used aswell language cmake_minimum_required(version 2.6) #name project here project(ecad) #sets cmake run moc when needed set(cmake_automoc on) #find requirements of projects find_package(qt5widgets) find_package(qt5core) find_package(ogre) find_package(ois) # find includes in corresponding build directories set(cmake_include_current_dir on) #sends -std=c++11 flag gcc compiler add_definitions(-std=c++11) qt5_wrap_ui(cmake_form_hdr resources/ui/mainwindow.ui) #this tells cmake main.cpp , name ecad add_executable(ecad main.cpp ${cmake_form_hdr}) #include subdirectory containing our libs add_subdirectory (gui) include_directories(gui) #link_libraries target_link_libraries(ecad qt5::widgets qt5::core ogre ois) i new this. please help me out solve problem the command find_package(ogre) ru

google cloud messaging - Send message from Server to Android device and vice versa -

google cloud messaging - Send message from Server to Android device and vice versa - i want implement chat application. have few questions, not solve searching internet. my requests are: of course of study can address each device individually server (makes sense chat app) i can create time delay between sending , receiving message the application should not require registration (this not must, nice) i wonder if gcm (google cloud messaging) appropriate solution me. have not yet worked it, have help. run troubles this? , important: registration required? you run troubles surely, gcm not creating chat applications . need xmpp.gcm kind of thing used broadcasting messages,which not guarantee delivery of messages instantaneously i.e real time requiring. see too: android , xmpp: available solutions android google-cloud-messaging

windows - How to execute a PostGre exe file with silent mode? -

windows - How to execute a PostGre exe file with silent mode? - hy, i install postgresql 9.1 on windows server 2012. want used powershell script. jdk executables file, utilize start-process "myfile" -argumentlist "/s" -wait argument \s don't work postgre executables file. have thought ? you can utilize install-postgres powershell module, it's on technet gallery. the install-postgresql powershell module following: creates local windows user postgresql use downloads postgresql installer provided enterprisedb installs postgres unattended using supplied parameters sets postgres windows user owner of postgres files , folders sets postgres windows service run under postgres local user creates pgpass.conf file in appdata copies configuration files info directory opens supplied port postgresql utilize in windows firewall usage import-module install-postgres install-postgres -user "postgres" -password "changeme!"

shell - Javascript to load putty to a specific ssh host -

shell - Javascript to load putty to a specific ssh host - i trying create website has links , depending on links load putty ssh connection specific host. ( used internally , ie 6) so far have ignore host <script language="javascript"> function connection(host) { oshell = new activexobject("wscript.shell"); oshell.run("putty.exe -ssh" + host + "22"); } </script> <a href="javascript:connection('@1.1.1.1')"> connection 1 </a> i managed perform need <script language="javascript"> function connection(host) { var oshell = new activexobject("wscript.shell"); oshell.run('"c:\\archivos de programa\\putty\\putty.exe" -ssh '+ host +' 22'); } </script> <a href="javascript:connection('@1.1.1.1')"> connection 1 </a> i needed pass location of putty executable (with escaped chars) adding spaces

javascript - directive communication and coupling -

javascript - directive communication and coupling - i have 2 directives, dropdown , panel. panels contain dropdowns. using require : "^panel", , specifying controller, can create both communicate. you can see illustration here http://plnkr.co/edit/rqbsz26jiqkzfmrpbmkd?p=preview class="snippet-code-html lang-html prettyprint-override"> <!doctype html> <html ng-app="app"> <head> <script data-require="angular.js@*" data-semver="1.3.0-rc2" src="https://code.angularjs.org/1.3.0-rc.2/angular.js"></script> <link rel="stylesheet" href="style.css" /> <script src="script.js"></script> <script> angular .module("app", []) .controller("ctrl", function($scope) { $scope.test = "welcome" }) .directive("dropdown", function() { home

javascript - setTimeOut function not working as expected -

javascript - setTimeOut function not working as expected - i having hard time settimeout function .let me show code first. here code :- function submitform(loginurl, username, password) { seek { loc = new string(window.location); document.forms.frm_login.action = junctionurl; document.forms.frm_login.username.value = username; document.forms.frm_login.password.value = password; document.forms.frm_login.submit(); settimeout(gotohomepage,4000); } grab (e) { alert(e.message +"submit form"); } } function gotohomepage() { alert("test"); var url = "test.aspx"; window.location=url; } but here gotohomepage function not @ triggered after specified 4 seconds. what doing wrong here.please suggest . any help appreciated. thanks form submission redirecting result page unload ing current page. so, timer doesn't tick. use ajax or set targ

datepicker - Codename one Picker change date format -

datepicker - Codename one Picker change date format - is possible alter date format on codename 1 picker show year in total e.g 2014 or 1990 ? of has date format "m/d/yy" in turn gives date such "oct 15 2014" "10/15/14". there way alter date format? this looks differently on devices. picker implemented natively there. datepicker codenameone

Why does build fail with sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-pgp;0.8.2: not found? -

Why does build fail with sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-pgp;0.8.2: not found? - we getting failures on build server (typesafe , maven repos proxied through our internal nexus repo) project built sbt 0.13.5 (tried upgrading 0.13.6, still not working) ideas? edit: note, works fine when run locally [warn] module not found: com.typesafe.sbt#sbt-pgp;0.8.2 [warn] ==== local: tried [warn] /home/bisonadm/.ivy2/local/com.typesafe.sbt/sbt-pgp/scala_2.10/sbt_0.13/0.8.2/ivys/ivy.xml [warn] ==== typesafe-ivy-releases: tried [warn] https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.sbt/sbt-pgp/0.8.2/ivys/ivy.xml [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-pgp_2.10_0.13/0.8.2/sbt-pgp-0.8.2.pom [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: unresolved dependencies :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.typesafe.sbt#sbt-pgp;0.8.2:

linux - Are Win32 InterlockedIncrement and InterlockedExchange atomic across processes? -

linux - Are Win32 InterlockedIncrement and InterlockedExchange atomic across processes? - msdn says interlocked functions provide simple mechanism synchronizing access variable shared multiple threads. i not sure if work across threads of multiple processes if variable in shared memory of processes. similarly gnu gcc compiler intrinsic: __sync_add_and_fetch , __sync_lock_test_and_set? this question 2 questions 2 different answers. for __sync_xxx builtins in gcc reply yes. refer online doc this, described, these builtins issuing total barrier, preventing internal speculating loads within processor pipeline. every , multi-thread, multi-process, etc. shared memory safe them. i know nil windows interlockedxxx functions. msdn knows, , says: the threads of different processes can utilize mechanism if variable in shared memory so both answers "yes". linux windows gcc atomic atomic-swap

SAML Sample Identity Provider Certificate and Java Application for signing certificate -

SAML Sample Identity Provider Certificate and Java Application for signing certificate - i have java web application. , want implement saml sso login application. trying is, need 1 sample identity provider certificate create separate jsp application sign certificate , create assertion app. upload public key of certificate , save in keystore. whenever user tries login, assertion jsp application created , send web app. validate public key key in keystore , proceed further. please right me if wrong in this. also can find sample identity provider certificate? or may how create one? there sample jsp application can create assertion , send application? thanks. you can free business relationship @ pingone ping identity. after provided certificate , meta info utilize pingone identity provider. also can seek testshib or openidp. you can utilize keytool command manage certificates @ local system. if utilize jboss as/wildfly suggest using picketlink, can find

add tags to auto inserted joomla article? -

add tags to auto inserted joomla article? - i utilize tutorial adding joomla article: https://zunostudios.com/blog/development/204-using-the-joomla-api-to-add-articles-programmatically works , joomla article there, how can add together joomla tags articles pro grammatically? there helper (jhelpertags) have function add together contenttagmaps, don't know how can utilize that, tags article

elasticsearch - Lines splitting despite using multiline logstash filter -

elasticsearch - Lines splitting despite using multiline logstash filter - i used multiline logstash filter.it fails @ few instances. for illustration tried parsing study multiple blocks.i formed these blocks/paragraphs using multiline filter. page 1 date title author data................................................................................ .................................................................................... <delimiter> when tested using 100 blocks, every time doesn't append 1 or 2 blocks correctly. takes page 1 date title author as single message , parses , remaining part message. note: observation @ times, 1st part of block say page 21 date title author is parsed , followed by page 20 date title author data................................................................................ .................................................................................... <de

winapi - How can I (programmatically) tell if an overlay is loaded? -

winapi - How can I (programmatically) tell if an overlay is loaded? - i writing windows programme uses overlays (to show states of files). problem don't appear (without reboot), although logs ismemberof function executed successfully. i'm not sure if can forcefulness overlay display, if can't @ to the lowest degree display message saying icons don't work until reboot. it there anyway programmatically tell if icon overlays not loaded particular file/folder? all google searches have returned nil relevant. winapi overlay shell-extensions

.net - Accessing DataDirectory folder from a different project C# -

.net - Accessing DataDirectory folder from a different project C# - i have files in app_data folder @ project "b" , want utilize of these files project "a". from b can do appdomain.currentdomain.getdata("datadirectory") how can "b" datadirectory path project "a"? thanks! as per knowledge seek below code: string existingfilename = (server.mappath(string.format("/bproject/app_data/" + filename)); c# .net

Oracle apex alternating colors in report table -

Oracle apex alternating colors in report table - is there way in oracle apex have study tables have different color every other row? example, this. colors alternate readability (the user improve know line he/she reading). you can include css in oracle apex application. show how simple can done. see sample here easy way edit page in css-> inline section come in code: table.apexir_worksheet_data tr.odd td { background-color: #def !important; border-bottom: 1px solid #cef !important; } now can take new level adding custom css application. see here how to. oracle oracle-apex

javascript - Adding functions to bison/jison calculator language -

javascript - Adding functions to bison/jison calculator language - i'm trying expand jison calculator example simple functions. i'm rather new parsing , bison/jison, bit of have far: /* lexical grammar */ %lex %{ var funcs = { pow: function(a, b) { homecoming math.pow(a, b); }, test: function(a) { homecoming a*2; } } %} %% \s+ /* skip whitespace */ [0-9]+("."[0-9]+)?\b homecoming 'number' [a-za-z]+ homecoming 'name' "," homecoming ',' "*" homecoming '*' "(" homecoming '(' ")" homecoming ')' <<eof>> homecoming 'eof' . homecoming 'invalid' /lex %start expressions %% /* language grammar */ expressions : e eof { homecoming $1; } ; expression_list : expression_list '

angularjs - Accessing parent scope from a child controller with ControllerAs syntax -

angularjs - Accessing parent scope from a child controller with ControllerAs syntax - this question has reply here: accessing inherited scope controller approach 2 answers how can accomplish next using controller-as approach: app.controller("parentctrl", function($scope){ $scope.parentobj = {prop1: "not set", prop2: "something"}; $scope.dosomething = function(){...} }) .controller("childctrl", function($scope){ $scope.parentobj.prop1 = "changed"; }); <div ng-controller="parentctrl"> {{prop1}} <div ng-controller="childctrl"> {{prop2}} <button ng-click="dosomething()">do</button> </div> </div> without making assumptions how parent controller aliased in view, i.e. no {{pc.prop2}} . in other words, benefit scope inheritance wh

php - how to get one specific entry in multi dimensional array -

php - how to get one specific entry in multi dimensional array - this print_r of array array ( [0] => array ( [displayorder] => 3 [menuname] => accounting module [menuurl] => [menuflag] => 1 [menuid] => 3 ) [1] => array ( [displayorder] => 4 [menuname] => profile [menuurl] => myprofile.php [menuflag] => 0 [menuid] => 4 ) [2] => array ( [displayorder] => 6 [menuname] => hr module [menuurl] => [menuflag] => 1 [menuid] => 2 ) [3] => array ( [displayorder] => 9 [menuname] => administrator [menuurl] => [menuflag] => 1 [menuid] => 1 ) ) i want create status when have menuid input menuname of array of menuid found solution: $myarray[0]['menuname']; here but gets menuname of first array how can create dynamic? create function passing multi array , menu id parameter it, homecoming desired value multi-array, like: function getmenunamebyid($yourarr, $menuid)

how to reach database fields from default.ctp in Cakephp -

how to reach database fields from default.ctp in Cakephp - i'm unable show db field value in default.ctp , unreaded messages or username , maintain getting undefined variable: user, or message how reach them default.ctp ? since default layout application wide, need process info in appcontroller.php in beforefilter method, this in appcontroller.php : public function beforefilter() { //for example, want read messages //import model $this->loadmodel('message'); $all_messages = $this->message->find('all'); //or whatever need info $this->set('all_messages', $all_messages); } then in default.ctp,call variable: $all_messages cakephp

android - Get resource ID from URI or Bitmap -

android - Get resource ID from URI or Bitmap - is there anyway can find resource id bitmap, uri, file path or file name of image? these images written app. there chance can find resource id? basically, have gif images stored in sd card (which created app). want load images viewer. that, using gif film view library. in file, setmovieresource() expecting int (resource id). have other info bitmap, absolute path. resource ids automatically generated android files within resource folder ( /res ) only. out of folder, there no such thing called "resource id". some android components (such view s) do have id , can set manually. however, manually-set id not listed within r.java , collection of resource ids generated android. but in case, generated images don't have id, it's impossible doesn't exist beforehand. regarding library, there function set image source without resource id: public void setmovie(movie movie) { this.mmovie = movie;

http post - API controller can't work with new constructor -

http post - API controller can't work with new constructor - i have method api controller public class photocontroller : apicontroller { public iphotoservice _photoservice; public photocontroller() { _photoservice = new photoservice(); } [httppost] [route("photo/upload/{photo}")] public bool uploadpicture() { seek { var httprequest = httpcontext.current.request; jobject param = jobject.parse(httpcontext.current.request.params["photo"]); var path = "../" + utils.randomgenerator() + utils.randomgenerator() + "." + httprequest.files[0].filename.split('.').last(); var postedfile = httprequest.files[0]; var filepath = httpcontext.current.server.mappath(path); postedfile.saveas(filepath); _photoservice.uploadphoto(param, path); homecoming true; } grab (exceptio

apache as reverse proxy to tomcat -

apache as reverse proxy to tomcat - i have apache configured reverse proxy tomcat: proxypass /demo/ ajp://demoserver.local:8009/demo/ proxypassreverse /demo/ ajp://demoserver.local:8009/demo/ works great. cant come in http://webserver.local/demo/ , tomcat app's page. i need create alter in url: http://webserver.local/demo123/. changed configuration of proxy way: proxypass /demo123/ ajp://demoserver.local:8009/demo/ proxypassreverse /demo123/ ajp://demoserver.local:8009/demo/ i can't working though. happens tomcat app sends redirect /demo/login.htm , web browser tries fetch url web server. web server fires 404 error since /demo/ not pointing anywhere. could perchance solve without touching tomcat's app, modifying apache config? apache tomcat proxy ajp

version control - Mercurial: Branching for releases? -

version control - Mercurial: Branching for releases? - previous history: lastly couple of years used svn. releasing new version of software project included next steps: creating branch new release: /repo/branches/0.1 getting code release-worthy state there creating tag release candidate: /repo/tags/0.1-rc1 creating branch rc1 prepare bugs: /repo/branches/0.1-rc1 creating tag new release candidate: /repo/tags/0.1-rc2 {...} creating tag v0.1 lastly rc: /repo/tags/0.1 merging 0.1 trunk as far got mercurial sees branches , tags different svn , leads question: do create branches (and tags) releases? , if not: else wants mercurial me doing archive similar described development pattern/cycle? you can maintain using method. i'm not sure you'd need separate rc1 branch for, guess there reasons. there bit of annoyance in way tags stored in mercurial, versioned file listing them 1 one. result tag creation constitutes changeset. should strive maintain such tag-cre

python - Merge Columns and Remove Duplication -

python - Merge Columns and Remove Duplication - i have input file has info in 2 columns. need merge both columns , remove duplication. suggestions how start ? ! input file 5045 2317 5045 1670 5045 2156 5045 1509 5045 3833 5045 1013 5045 3491 5045 32 5045 1482 5045 2495 5045 4280 5045 1380 5045 3998 expected output 5045 2317 1670 2156 1509 3833 1013 3491 32 1482 2495 4280 1380 3998 to maintain order: from itertools import chain open("in.txt") f: lines = list(chain.from_iterable(x.split() x in f)) open("in.txt","w") f1: ind, line in enumerate(lines,1): if not line in lines[:ind-1]: f1.write(line+"\n") output: 5045 2317 1670 2156 1509 3833 1013 3491 32 1482 2495 4280 1380 3998 if order not matter: from itertools import chain open("in.txt") f: lines = set(chain.from_iterable(x.split() x in f)) open("in.txt","w") f

qt - Hidden sort indicator on column in QTreeView -

qt - Hidden sort indicator on column in QTreeView - i have qtreeview , setsortenable = true it, , of column show sort indicator, want lastly column not show sort indicator, lastly column. have thought or solution issue..:( please help thanks qheaderview draws sorting indicator on column when info sorted column (if setsortindicatorshown true ). that why way prohibit drawing of indicator prohibit sorting of column left-click. to prohibit sorting column need: 1. create new class inherited qheaderview (or utilize event filter) 2. reimplement mousereleaseevent , mousepressevent 3. utilize logicalindexat indicate user clicked on column 4. phone call setsectionsclickable(false) before calling base of operations method , setsectionsclickable(true) after it. example: void headerview::mousereleaseevent(qmouseevent* e) { const int index = logicalindexat(e->pos()); if (index == 3) setsectionsclickable(false); qheaderview::mousereleaseevent(e);

google app engine - X-Appengine-Inbound-Appid header not set -

google app engine - X-Appengine-Inbound-Appid header not set - i have 2 appengine modules, default module running python , "java" module running java. i'm accessing java module default module using urlfetch. according appengine docs (cloud.google.com/appengine/docs/java/appidentity), can verify in java module request originates module in same app checking x-appengine-inbound-appid header. however, header not beingness set (in production deployment). utilize urlfetch in python module follows: hostname = modules.get_hostname(module="java") hostname = hostname.replace('.', '-dot-', 2) url = "http://%s/%s" % (hostname, "_ah/api/...") result = urlfetch.fetch(url=url, follow_redirects=false, method=urlfetch.get) note i'm using notation: <version>-dot-<module>-dot-<app>.appspot.com rather notation: <version>.<module>.<app>.appspot.com which reason results in 404 respo

Ansible: Passing evaluated variables to includes -

Ansible: Passing evaluated variables to includes - i have ansible playbook makes phone call playbook passing in parameters. works fine, when seek pass in variables, ansible blows up. here playbook: --- - name: toplevel play orchestration hosts: nogroup vars: customer: mycustomer sudo: yes - include: amazon.yml application=fooserver instance_type=t2.micro instance_count=1 customer={{ client }} - include: amazon.yml application=barserver instance_type=t2.micro instance_count=1 customer={{ client }} i seek run: ansible-playbook orchestration.yml -e "customer=othercustomer" and error: traceback (most recent phone call last): file "/usr/local/cellar/ansible/1.7.2/libexec/bin/ansible-playbook", line 5, in <module> pkg_resources.run_script('ansible==1.7.2', 'ansible-playbook') file "/system/library/frameworks/python.framework/versions/2.7/extras/lib/python/pkg_resources.py", line 492, in run_scrip

branch - How do I drop a Mercurial bookmark with all its changesets? -

branch - How do I drop a Mercurial bookmark with all its changesets? - i utilize git @ work because git team's choice. however, prefer mercurial personal projects. it's not secret git , mercurial branching models differ, , bookmarks in mercurial branches in git. git branches , utilize mercurial branches rarely, when need it, preferring mercurial bookmarks. however, miss git branch -d in mercurial, because deleting bookmark in mercurial removes bookmark , preserves immutable history. possible drop bookmark in mercurial of changesets changeset bookmark has been diverged from? in general: hg strip revisions_to_drop for problem: hg strip 'not ancestors(heads(all()) - bookmark(name_of_bookmark))' (i.e. "strip revisions not ancestors of heads other bookmarked head") assuming sufficiently recent version of hg: hg strip -b name_of_bookmark mercurial branch

Yeoman generator: how do I access user supplied options? -

Yeoman generator: how do I access user supplied options? - i'm building yeoman generator. prompt user name project this: simplesitegenerator.prototype.askfor = function askfor() { var cb = this.async(); console.log(this.yeoman); var prompts = [{ name: 'sitename', message: 'what want phone call site?' }]; this.prompt(prompts, function (props) { this.sitename = props.sitename; cb(); }.bind(this)); }; further on, build file system: simplesitegenerator.prototype.app = function app() { this.mkdir( 'app'); this.mkdir('app/templates'); this.mkdir( 'img'); i'd build filesystem within directory given same name project. how user-supplied alternative , pass app ? you need create empty global variable, assign value of users reply so var projectfoldername = ''; this.prompt(prompts, function (props) { this.sitename = props.sitename;

modal dialog - Ajax calls duplicate in jQuery loop -

modal dialog - Ajax calls duplicate in jQuery loop - the function creates popover (bootstrap) $(document).ready(function() { //loop there pages more 1 popover $('.pop').each(function() { var $elem = $(this); $elem.popover(param); //triggers popover $elem.on('click', '.add_to_top', function() { top_modal.modal('show'); //opens modal form //inside modal form $(top_modal).on('click', '.add_top_submit', function() { //this submits form ajax phone call }); }); }); }); the issue if example, submit form button clicked , throws error, resubmitted ajax requests sent twice. everytime .add_top_submit clicked on modal triggered different popover, ajax phone call made 1 time more. if there more 1 popover on page , modal triggered 2 different popovers, ajax requests go

want a calculation result instead of <bound method ...Python 2.8 -

want a calculation result instead of <bound method ...Python 2.8 - i have tried finding in docs don't quite it. starting work classes, when seek result, instead of actual 'width' maybe need get not sure.. sounds complicated result. can advise? i have: class rectangle(object): def __init__(self, pt_ll, pt_ur): self.ll = pt_ll self.lr = point(pt_ur.x, pt_ll.y) self.ur = pt_ur self.ul = point(pt_ll.x, pt_ur.y) def width(self): """returns width-float of rectangle.""" w = self.ur.x - self.ll.x homecoming w then phone call it: r = rectangle(point(0,0), point(10,10)) print r.ur.x print r.ll.x print r.width and output: 10.0 0.0 <bound method rectangle.width of <__main__.rectangle object @ 0x000000000b5cbc50>> print r.width this returns width method itself, see in output. want phone call method need instead this: print r.width

elisp - Emacs: Set writeroom mode as default -

elisp - Emacs: Set writeroom mode as default - i new emacs , wondering if can set writeroom-mode on. want on start emacs , open new buffers or switch between them. all help highly appreciated! so you've provided link (albeit in your other question), can see library provides global minor mode turns on specific configurable set of major modes. the next redefine function makes decision, if writeroom-major-modes nil (empty list), turn on any major mode. i changed existing test check derived mode match, rather exact match. way default value of '(text-mode) match not text-mode , every mode derived text-mode . not strictly relevant question, perhaps useful if find "all modes" approach overkill. class="lang-el prettyprint-override"> (eval-after-load 'writeroom-mode '(defun turn-on-writeroom-mode () "turn on `writeroom-mode'. function activates `writeroom-mode' in buffer if buffer's major mode fellow membe

java replace arraylist of strings -

java replace arraylist of strings - i can't seem figure out how replace array list of strings. arraylist<string[]> records so within loop want replace record can maintain getting error. the method set(int, string[]) in type arraylist not applicable arguments (int, string) (int = 0; < records.size(); i++) { (int j = 0; j < 2; j++) { if (j == 0) { if(!validaterecords(records.get(i)[j].tostring())) { logging.info("records not parsed " + records.get(i)[j].tostring()); records.set(j, "couldnotbeparsed"); }else { logging.info(records.get(i)[j].tostring()+ " has been sanitized"); } } } } what proper way replace record using records.set() ? since not replacing entire array, changi

sql - C# insert statement -

sql - C# insert statement - i kinda new c# , .net applications. work visual studio , have table : create table [dbo].[table] ( [id] int not null, [meno] nvarchar (50) null, [datum] datetime null, [cas] int null, primary key clustered ([id] asc) ); and have simple insert public void nahrajskore(string cas) { using (var con = new sqlconnection(cns)) { con.open(); var inset = new sqlcommand("insert table values(@name,@date,@res)", con); inset.parameters.add("@name", sqldbtype.varchar); inset.parameters.add("@date", sqldbtype.datetime); inset.parameters.add("@res", sqldbtype.int); inset.parameters["@name"].value = _hrac.menohraca; inset.parameters["@date"].value = datetime.today; inset.parameters["@res&

android - Changing the text size of a spinner -

android - Changing the text size of a spinner - i beginner in android programming. i trying alter text size of spinner mentioned in question here. have created my_spinner_style.xml in res/values/ below: <textview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinnertarget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="#000000" android:textsize="13sp" /> and used adapter this: spinner = (spinner)findviewbyid(r.id.spinner); arrayadapter<charsequence> adapter=arrayadapter.createfromresource(this,r.array.answers,android.r.layout.my_spinner_style); spinner.setadapter(adapter); spinner.setonitemselectedlistener(this); and tried creating style.xml in layout folder. adapter not recognize my_spinner_style . have placed in wrong directory? it should r.layout.my_spinner_style , remove android @ start,

How can i parse json into a html table using PHP? -

How can i parse json into a html table using PHP? - i have table in website. , have info table "http://west.basketball.nl/db/json/stand.pl?szn_naam=2014-2015&cmp_id=373" i've tried lot of thing nil works.... <!doctype html> <html> <head> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <?php $json=file_get_contents("http://west.basketball.nl/db/json /stand.pl?szn_naam=2014-2015&cmp_id=373"); $data = json_decode($json); if (count($data)) { // open table echo "<table>"; // cycle through array foreach ($data $stand) { // output row echo "<tr>"; echo "<td>$afko</td>"; echo "<td

ios - Bug in Swift array subscript indexing? -

ios - Bug in Swift array subscript indexing? - i've isolated swift code project can pasted playground. produces error "could not find overload '+' accepts supplied arguments" both in normal xcode editing , playground. error refers lastly (non-trivial) line. import uikit allow points = 40 allow max = points-1 allow l = 10.0 allow deltat = 0.01 allow deltax = l/double(points) var = [double](count: points, repeatedvalue: 0.0) var b = [double](count: points, repeatedvalue: 0.0) var c = [double](count: points, repeatedvalue: 0.0) in 1..<max-1 { //let iplus1 = i+1 //let temp = 0.5*deltat/deltax c[i] = 0.5*(a[i+1] + a[i-1]) + 0.5*deltat/deltax * (b[i+1] - b[i-1]) } if uncomment line "let iplus1..." , create next edit, swift accepts code. { allow iplus1 = i+1 //let temp = 0.5*deltat/deltax c[i] = 0.5*(a[iplus1] + a[i-1]) + 0.5*deltat/deltax * (b[i+1] - b[i-1]) } if uncomment line "let temp..." , c

SQL Connection Query to join multiple MS access Tables in crystal Report 9 -

SQL Connection Query to join multiple MS access Tables in crystal Report 9 - i've working without problem below of sql command linking select `linkaccess`.`plpon`, `taxaccess`.`crddate`, `taxaccess`.`duedate`, `supplierlist`.`term`, `linkaccess`.`plline`, `linkaccess`.`stkcode`, `linkaccess`.`stkdesc`, `linkaccess`.`psno`, `linkaccess`.`qty` `linkaccess` `linkaccess` inner bring together (`taxaccess` `taxaccess` inner bring together `supplierlist` `supplierlist` on `supplierlist`.`suppcode`=`taxaccess`.`suppcode`) on `linkaccess`.`plpon`=`taxaccess`.`plpon` order `linkaccess`.`plpon` but failed load after replace inner bring together left outer bring together command, can right me if know, need create left outer bring together taxaccesss , using inner bring together join supplierlist wth fields suppcode. appreciate kindful help. error meesages: "failed open rowset. details: ado error code : 0x80040e14 source: microsoft office access d

php - Statement returning an empty string -

php - Statement returning an empty string - i confused why when create ajax phone call php script, returns empty string. believe checking in php , if empty should trigger notif msg. triggering success msg if string coming empty. in post section of firebug, can see inputs beingness posted right values , if alert serialize data, beingness posted correctly. how can check if php receiving data? have tried print_r, var_dump nil displayed in console. grateful if point out error. many thanks jquery $(function() { $.validator.setdefaults({ errorclass: 'form_error', errorelement: 'span', ignore: ":hidden:not(select)", errorplacement: function(error, element) { error.appendto(element.siblings('span')); } }); $("#usrrecycle").validate({ rules: { rcyrequested: { required: true }, rcyservice: { required: true }, rcydept: { required:

jquery - form input date picker not showing on ajax page -

jquery - form input date picker not showing on ajax page - i've been trying utilize jquery datepicker on ajax page fails load.am developing web app on laravel framework , ajax when seek utilize jquery datepicker works if form on master page.but 1 time click on link loads new page div datepicker doesnt work there.and console isnt throwing errors.any thought might bee doing wrong. here illustration on jquery website followed. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jquery ui datepicker - default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <

angularjs - Capture the original value of an Angular model for in-place editing -

angularjs - Capture the original value of an Angular model for in-place editing - i built simple in-place editing solution profile info in app. problem is, if edits field , modify text of field take "cancel," instead of save, because of angular's bindings, text alter still displayed in ui. i thinking when "edit profile," capture original value of field if nail cancel, restore original text. $scope.editprofile = -> $scope.editstate = true $scope.originaldescription = $scope.user.profile.description of course, doesn't work. want capture $scope.user.profile.description @ time editprofile function called. any suggestions strategies here? what can do, is: angular.copy($scope.user.profile.description, $scope.description.backup) and if need restore original values: angular.copy($scope.description.backup, $scope.user.profile.description) angularjs

How do I get certain values of a HTML attribute in Javascript? -

How do I get certain values of a HTML attribute in Javascript? - i take value of attribute, process , replace php variable value receive @ end. the info attribute data-id , need assistance getting value of data-id javascript on click event , rest can do. an example: person clicks tag data-id set as, say, 7. i'd need extract 7 html code , javascript variable can work said value. i hope clear enough try this $('#someelement').click(function(){ $(this).data('id'); }); javascript html

Why doesn't Java have true multidimensional arrays? -

Why doesn't Java have true multidimensional arrays? - the tl;dr version, don't want background, next specific question: question why doesn't java have implementation of true multidimensional arrays? there solid technical reason? missing here? background java has multidimensional arrays @ syntax level, in 1 can declare int[][] arr = new int[10][10]; but seems not 1 might have expected. rather having jvm allocate contiguous block of ram big plenty store 100 int s, comes out array of arrays of int s: each layer contiguous block of ram, thing whole not. accessing arr[i][j] rather slow: jvm has to find int[] stored @ arr[i] ; index find int stored @ arr[i][j] . this involves querying object go 1 layer next, rather expensive. why java this at 1 level, it's not hard see why can't optimised simple scale-and-add lookup if allocated in 1 fixed block. problem arr[3] reference of own, , can changed. although arrays of fixed size, write arr[

uitableview - iOS-8 Uitableviewcontroller with uitextfield keyboard appears while rotating device -

uitableview - iOS-8 Uitableviewcontroller with uitextfield keyboard appears while rotating device - using uitableviewcontroller to create login form. in 2 of uitableviewcells login user name , password uitextfield fields. the keyboard closed (never tapped text field) , device rotated, keyboard appears moment , disappears bottom of screen. is ios8 bug? there work around? looks strange.. never ios8 bug. might setting first responder in - (void)layoutsubviews or - (void)viewwilllayoutsubviews uitableview rotation ios8 uiinterfaceorientation uikeyboard

internet explorer - Where is "Allow website caches and databases" checkbox Registry key? -

internet explorer - Where is "Allow website caches and databases" checkbox Registry key? - i can't find checkbox in registry can have desktop authorization write whatever needs to unchecked. i have perused many forums address changing of flag/option on first tab, ie stack article: how modify net explorer temporary net settings registry? butttt want checkbox in screenshot turned off (in caches , databases tab): further googling did not offer went through registry 1 1 until found key in spot different net settings. key location: [hkey_current_user\software\microsoft\internet explorer\browserstorage\appcache] "allowwebsitecaches"=dword:00000000 setting 1 or 0 changes checkmark within net settings. silly me, thinking same options panel have registry keys in same spot! thanks! internet-explorer registry

neo4j EXTRACT with multiple items -

neo4j EXTRACT with multiple items - i running demo illustration , query seems give error. match p = (node0:movie) node0.title = "apollo 13" homecoming extract(n in nodes(p) | (id(n),label(n) )) is there changed in community version 2.1.4 2.0.0 extract syntax? the error is: invalid input ',': expected whitespace, '.', node labels, '[', "=~", in, is, '^', '*', '/', '%', '+', '-', '<', '>', "<=", ">=", '=', "<>", "!=", and, xor, or or ')' (line 1, column 96) "match p = (node0:movie) node0.title = "apollo 13" homecoming extract(n in nodes(p) | (id(n),label(n) ))" ^ actually if want create tuples can utilize collection or map literals: btw. have no path, si

java - Cannot create tables and load data in H2 using JPA -

java - Cannot create tables and load data in H2 using JPA - i have jpa project uses hibernate , h2. next maven pom dependency list: class="lang-xml prettyprint-override"> <dependency> <groupid>com.h2database</groupid> <artifactid>h2</artifactid> <version>1.4.181</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>4.3.6.final</version> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <version>4.3.6.final</version> </dependency> the next project structure: the next content of blood_donor_create.sql : class="lang-sql prettyprint-override"> create table if not exists `blood_type` (