Posts

Showing posts from September, 2014

jquery - Javascript only works with alert (); -

Image
my code works perfect if use alert(); in between. if don't use it, part after // alert() ; doesn't executed. function playerleer() { $('#pplay').css('background', 'url("images/play.png")'); $('#player').get(0).pause(); $('#player').attr('src',null); $('.song').html(null); alert(); $('#seekslider').val(0); $('#curtimetext').html('0:00'); $('#durtimetext').html('0:00'); } what do? thanks responds :) janik have tried using chrome debugger or javascript debugger? basically if type debugger in script so function playerleer() { $('#pplay').css('background', 'url("images/play.png")'); $('#player').get(0).pause(); $('#player').attr('src',null); $('.song').html(null); debugger; $('#seekslider').val(0); $('#curtimetext').html('0:00'); $(...

c# - 'System.OutOfMemoryException' was thrown when there is still plenty of memory free -

this code: int size = 100000000; double sizeinmegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomnumbers = new double[size]; exception: exception of type 'system.outofmemoryexception' thrown. i have 4gb memory on machine 2.5gb free when start running, there enough space on pc handle 762mb of 100000000 random numbers. need store many random numbers possible given available memory. when go production there 12gb on box , want make use of it. does clr constrain me default max memory start with? , how request more? update i thought breaking smaller chunks , incrementally adding memory requirements if issue due memory fragmentation , doesn't i can't past total arraylist size of 256mb regardless of tweaking blocksize . private static irandomgenerator rnd = new mersennetwister(); private static idistribution dist = new discretenormaldistribution(1048576); private static list<double> ndrandomnumbers = new list<double>(); private s...

Emacs use variable if set in grep-find -

i'm looking way launch grep-find specific location if variable set. i'm thinking like: launch emacs /home/user/mycode/ open file(s) in e.g. /home/user/mycode/a/b/c/ run grep-find /home/user/mycode/ i know works if first open /home/user/mycode/ directory , runs grep-find want stored variable instead. (if variable not set fine search current location) my grep-find looks this: (setq grep-find-command "find . '(' -type f ')' -print0 | xargs -0 -e grep -n -e ") it seems me benefit projectile. it need. has recursive grep command launches parent directory (it can use git-grep or ag, lot faster grep), , offers lot more. can work multiple projects @ once (projectile smart way). you can @ projectile here: https://github.com/bbatsov/projectile it available via melpa if not want use (or similar alternatives), advise wrapping recursive grep command in custom function this: (defun rgrep-at-repo-base (...) (interactive) (with...

How do I disable the enabled feature when I enable a new feature in togglz? -

say have features a , b , c , , a enabled default. b , c disabled. when enable b want disable a : 1 feature should enabled @ time. you'll need implement custom version of staterepository interface. information on can found on togglz documentation next override setfeaturestate(...) function required functionality. disable active features (query via featuremanager or feature enum - may need implement custom versions of these classes desired functionality) enable feature being set.

Android custom camera setFocusAreas and setMeteringAreas not work on Samsung Devices -

maybe question duplicate question, others have not found solution. i'm trying write custom android camera , camera works fine on device(htc one).i tried different devices, , works in 1 of them. i'm having problems on samsung devices. not turn off autofocus feature on device. therefore, device can not change focus area. touch event. @override public boolean ontouchevent(final motionevent event){ camera.parameters cameraparameters = camera.getparameters(); if (event.getaction() == motionevent.action_up){ focusareas.clear(); meteringareas.clear(); rect focusrect = calculatetaparea(event.getx(), event.gety(), 1f); rect meteringrect = calculatetaparea(event.getx(), event.gety(), 1.5f); focusareas.add(new camera.area(focusrect, 800)); meteringareas.add(new camera.area(meteringrect, 800)); cameraparameters.setfocusareas(focusareas); cameraparameters.setmeteringareas(meteringareas); cameraparameters...

Expanding/Collapsing CardView with click or swipe gesture (Android)? -

i'm looking solution allow me expand cardview see more information , collapse it. google keep has examples of cards this. know how this? create 2 versions of cardview (one collapsed , 1 expanded) , use animator class coupled gesture methods transition between 2 views? i'm using recyclerview hold cardviews. i found if @ relevant: http://developer.android.com/training/animation/layout.html <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.cardview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <linearlayout android:layout_width="match_parent" android:orientation="vertical" android:animatelayoutchanges="true" android:layout_height="match_parent"> <linearlayout ...

javascript - jQuery append adding extra qoute -

my code: $("#thescreenshots").append("<img class='screenshotthumbnails' onclick='openscreenshotmodal('"+datareturned['screenshots'][i]+"')' src='/assets/screenshots/"+ datareturned['screenshots'][i] +"'>"); is outputting: <img class="screenshotthumbnails" onclick="openscreenshotmodal(" 'img_0203.png')'="" src="/assets/screenshots/img_0203.png"> why add weird qoute? , how can fix this? you need escape of quotes. try this: $("#thescreenshots").append('<img class="screenshotthumbnails" onclick="openscreenshotmodal(\''+datareturned['screenshots'][i]+'\')" src="/assets/screenshots/'+ datareturned['screenshots'][i] +'">'); it output this: <img class="screenshotthumbnails" onclick="openscreens...

CSS – Blurring image with un-blurred text -

Image
i have div elements 200px tall , 200px wide, , filling each div element image of person. upon hovering on image, want image blurred, simultaneously want text appear on image (unblurred) gives description of are. know how this? so far, getting: here css code: .mem1 { height: 200px; width: 200px; margin: 0px 31px; display: inline-block; border-radius: 10px; border: solid; border-width: thin; border-color: #d6d6d6; background-image: url(members/giles.png); } .mem1 p { text-align: center; position: absolute; margin: 70px 30px; visibility: hidden; } .mem1:hover { -webkit-filter: blur(2px); } .mem1:hover p { text-align: center; position: absolute; margin: 70px 30px; color: #ffffff; text-shadow: 1px 1px #000000; -webkit-filter: blur(0px); visibility: visible; } it sounds text child of element blurring. can't that. need this: <div class="container"> <div class="blurredphoto"></div...

In Perforce, how to find files with certain filetype+attribute? -

Image
files stored in p4 depot decorated file type , optional attributes: the above example <binary+s4> . how can search depot tree files have <binary+s4> ? i want audit these files , change attributes of of them <binary+s10> . from command line (i'm on windows using cygwin's version of "grep" , "cut", should work on mac/unix too): p4 -f %type%:%depotfile% files //... | grep ^binary+s4 | cut -d: -f2- | p4 -x - edit -t +s10

python modify builtin string functions -

is possible in python modify, or - @ least - deny of execution builtin functions? need, educational purpose, make sure strings split unavailable. for example, want, if call 'a,b,c'.split(',') to throw exception or returned inputed string. i want force write own version of function. possible? thanks in advance! built-in types (str in case) , methods cannot monkey-patched, since implemented in c (for cpython implementation). however, can define subclass , redefine method: >>> class mystr(str): ... def split(self, *args): ... raise exception("split not defined") ... >>> mystr("test").split(",") traceback (most recent call last): file "<stdin>", line 1, in <module> file "<stdin>", line 3, in split exception: split not defined

Disabling HTTP/2 / SPDY in HTTP.SYS and IIS in Windows 10 -

when testing on windows 10 seeing lots of browser incompatibilities hadn't seen before earlier windows versions. browsers work, others report err_spdy_protocol_error. quick search problem showed not alone. my app uses wwsapi , http.sys https (tls). know how disable spdy / http/2 in wwsapi (which using http.sys) on windows 10? i'd love full up-to-date windows 10 list of registry settings http.sys. see below answer this. hope helps others too. mark (op gave helpful answer, in question. moved answer): i did work around http/2 problem configuring windows 10 http.sys in registry disable http/2. given didn't find info anywhere, thought i'd share solution problem here too. find way of doing through wwsapi though. if turned off spdy support in client browser, work wanted turn off @ server side (http.sys on windows 10) wouldn't negotiate http/2 use older more compatible http(s). discovered 2 new registry settings http.sys in:...

jquery - Tabs with <script> removeClass & addClass -

i'm trying add videos inside tabs here example <script data-config="//config.playwire.com/17003/videos/v2/3745040/zeus.json" data-css="//cdn.playwire.com/bolt/js/zeus/skins/default.css" data-height="480" data-width="853" src="//cdn.playwire.com/bolt/js/zeus/embed.js" type="text/javascript"></script> my problem everytime change tab doesn't show video with iframes videos working here i've tried far: jquery: $('document').ready(function() { $("#sidebar").tabs({ event: "click", activate: function (event, ui) { console.log(ui); var _tab = ui.newtab; $('#sidebar li').removeclass('active'); $(_tab).addclass('active'); }, }); }); html: <div id="sidebar"> <ul> <li><a href="#tabs-1">video1</a></li> <li...

java - What is the different between using TextChangeEvent getText() and TextField getValue() in TextChangeListener -

i new vaadin, try filter out data on table. add textfield declared isocode , add textchangelistener it. when use isocode.getvalue() value filter string, didn't work. but when use textchangeevent event.gettext() value work perfectly. can explain me tell why? final textfield isocode = new textfield(); isocode.setinputprompt("iso code"); isocode.addtextchangelistener(new textchangelistener(){ private static final long serialversionuid = 1l; simplestringfilter filter = null; @override public void textchange(textchangeevent event) { /** * code not working * if(isocode.getvalue().trim().length() > 0){ filter = new simplestringfilter("iso code", event.gettext(),true, false); appn0010form.removeallcontainerfilters(); appn0010form.addcontainerfilter(filter); } */ /** * code working */ if(event.gettext().trim().lengt...

zsh - bindkey vi-cmd-mode causes other bindings to be unrecognized after exiting command mode -

i in zsh, , have used bindkey -v use vi key mappings in zsh. use <c-w> delete previous word, when type <esc> go normal mode/vi-cmd-mode, go insert mode i or a , can no longer use bindings <c-w> until run new command. there anyway can still use bindings bindkey after going normal mode insert mode? thanks! this output of bindkey : "^a"-"^c" self-insert "^d" list-choices "^e" "^[a ^[dbxxa" "^f" self-insert "^g" list-expand "^h" vi-backward-delete-char "^i" expand-or-complete "^j" accept-line "^k" self-insert "^l" clear-screen "^m" accept-line "^n"-"^p" self-insert "^q" vi-quoted-insert "^r" redisplay "^s"-"^t" self-insert "^u" vi-kill-line "^v" vi-quoted-insert "^w" vi-backward-kill-word "^x"-"^z" self-insert "^[...

python: subprocess.Popen and postgresql driving me batty -

a simple little arrangement: psql = '/usr/bin/psql' database = 'mydb' script = 'foo.sql' p = subprocess.popen([psql, '-d', database, '-f', script], shell=true, stdout=subprocess.pipe, stderr=subprocess.pipe) stdout, stderr = p.communicate() exit = p.returncode but fails, saying fatal: database "user" not exist if it's running under user user , ignoring -d flag. what gives?

spring - component-scan get in the way of bean initialization? -

i encounter problem while trying duplicate simple spring oauth project, sparklr2. source code here https://github.com/spring-projects/spring-security-oauth/tree/master/samples/oauth2/sparklr the source code runs perfectly, when debug tomcat, initialize @bean inside webmvcconfigureradapter, including controllers. noted @componentscan() not being used. then create own mvc project, copy 100% of code, using webapplicationinitializer instead of abstractdispatcherservletinitializer. use webapllicationinitializer because have learned way code mvc. then run project, @bean initialized. check /login browser, 404. caused spring not knowing have controllers, add @componentscan configuration class, /login shows up. weird thing is, @bean related controller, not initialized. so, when call method controller, since attributes not initialized, gives me no object or null exception. so, point is, how sample works, mean controller , jsp correctly handle , response without using @componentscan?...

javascript - Finding difficulty in loading a form on click of a button -

i have grid panel , contains add button . on clicking button, pop of form should displayed. getting error continuously. http://localhost:8080/extservlet/myapp/widget/student-form.js?_dc=1438244873178 404 (not found) here list.js file contains grid ext.define('myapp.view.main.list', { extend: 'ext.grid.panel', xtype: 'mainlist', require: [ 'myapp.view.student.studentform' ], title: 'student records', scrollable: true, margin: 20, layout: { type: 'vbox', align: 'stretch' }, reference: 'studentgrid', frame: true, collapsible: true, store: 'studentstore', collapsible: true, columns: [ { text: 'name', dataindex: 'name', flex: 1 }, { text: 'address', dataindex: 'address', flex: 1 }, { text: 'phone', dataindex: 'phone', flex: 1 }, { text...

Azure Storage CORS configuration -

how can configure azure storage cors without programmatically ? need install visual studio , configure myself. current situation right i'm created linux instance vps in digital ocean. i'm running wordpress web application , integrated azure cdn. i'm getting http origin not allows font file, knew deal cors azure storage. how can configure best way ? cors configuration configurable via rest api's - not bound vs @ all. if running linux can configure using java or node.js. resources: - cors overview pointers rest docs http://blogs.msdn.com/b/windowsazurestorage/archive/2014/02/03/windows-azure-storage-introducing-cors.aspx - java client library - https://github.com/azure/azure-storage-java - node client library - https://github.com/azure/azure-storage-node

parsing - Splitting a file into a dictionary in Python -

i'm beginner python user apologies if rather simple question. have file containing 2 lists divided tab. store in dictionary, each entry associated corresponding entry after tab, such that: cat hat mouse bowl rat nose monkey uniform dog whiskers elephant dance would divided into {'cat'; 'hat', 'mouse' ; 'bowl') etc. etc. it's long list. this tried: enhancertad = open('tad_to_enhancer.map', 'r') list = enhancertad.split() entry in list: key, val = entry.split('\t') et[key] = val print et here's recent attempt, , error message below: enhancertad = open('tad_to_enhancer.map', 'r').read() et = {} lst = enhancertad.split("\n") entry in lst: key, val = entry.strip().split(' ',1) et[key] = val enhancergene = open('enhancer_to_gene_map.txt', 'r').read() ge = {} lst1 = enhancergene.split("\n") entry in lst1: key, val = entry.strip()...

Define Haskell type with multiple contained types -

my goal replace signature like execute :: [instruction] -> state -> pointer -> state with execute :: program -> state i created type synonym type program = [instruction] -> state -> pointer when define implementation (e.g. execute [] s _ = s ), receive following compile error: couldn't match expected type ‘state -> pointer -> state’ actual type ‘[int]’ equation(s) ‘execute’ have 3 arguments, type ‘program -> state’ has 1 without replacing [instruction] -> state -> pointer program , compiles. appears attempt match program type first argument. there way match program type on first 3 arguments? your type synonym function type (of 2 arguments, uncurried). when have function fun :: programm -> state fun p = ... that p function needs 2 arguments, namely 1 [instruction] , 1 state produce pointer . function, not needed instructions nor state. (and no pointer, if can computed instructions , state, why ha...

R Checking if data table values are same level -

suppose have data table, g, looks this: g <- read.table(file = textconnection('id answers questions aa 1111111 222222222 aa 2222222 333333333 bb 3333333 444444444 bb 4444444 555555555 bb 5555555 666666666 cc 6666666 777777777'), header = true) nlevels(g$id) # 3 for every different id, want create random hexcolor , assign variable, in case there three, given loop: for(j in 1:nlevels(g$id)) { rcolor <- paste(sample(0:255,size=3,replace=true),collapse=" ") assign(paste0("idcolor", j), rcolor) } idcolor1 # [1] "50 25 197" # <--corresponds aa idcolor2 # [1] "131 255 58" # <--corresponds bb idcolor3 # [1] "242 100 72" # <--corresponds cc so there 3 variables each of 3 levels, aa, bb, , cc. i want output each of rows correct hex color, don't know how check value in g[,1] corresponds idcolor variable. have right trying paste every row variable m. m <- "" for(i in 1:nrow(...

Issues with Drop Down Menu size and overlap CSS/HTML -

i having trouble drop down menu, second level items overlap each other , each item has different width. have searched site , tried fixes similar problems, haven found works. not programer, trying add website. here code: #menu ul, #menu li, #menu span, #menu { margin: 0; padding: 0; position: relative; } #menu ul { list-style: none; position: absolute; top: 1.1em; } #menu { position: relative; background: #171e35 url('images/menubg.gif') repeat-x top left; height: 3.5em; padding: 0em 1.0em 0em 1.0em; margin-bottom: 10px; } #menu ul > ul > li { float: left; } #menu ul ul { display: none; position: absolute; top: 36px; left: -1px; width: 100px; text-align: left; *width: 100%; /* ie7 hack*/ } #menu li:hover ul { display: block; } #menu:after, #menu ul:after { content: ''; display: block; clear: both; } #menu ul li { position: relative; display: inline; } #...

java - Maven not working on windows -

when ran mvn -v , didn't version. got following c:\>mvn -v usage: java [-options] class [args...] (to execute class) or java [-options] -jar jarfile [args...] (to execute jar file) options include: -cp <class search path of directories , zip/jar files> -classpath <class search path of directories , zip/jar files> ; separated list of directories, jar archives, , zip archives search class files. -d<name>=<value> set system property ...... i believe set path correct. here path c:\>path path=c:\java7\bin;c:\maven\apache-maven-3.3.3\bin c:\>echo %java_home% c:\java7 c:\>java -version java version "1.7.0" java(tm) se runtime environment (build pwa6470sr8fp10-20141219_01(sr8 fp10))ibm j9 vm (build 2.6, jre 1.7.0 windows 7 amd64-64 compressed references 20141216_227497 (jit enablebled) any idea did wrong? set following enviro...

excel vba - Converting Dos Text Files to Unix in VBA fails -

i've followed suggestion in prior question , grabbed code don't useable file out of it. i've looked @ , don't see problem. public enum converttype dos2unix = 0 unix2dos = 1 end enum public function convertfile(originalfile string, newfile string, econverttype converttype, _ optional deleteoriginal boolean = false) dim openfilenum, savefilenum integer dim newfilebuffer string ' function open file , convert ' txt file format usable under *nix or dos on error goto error_found openfilenum = freefile ' grab first free file open originalfile input #openfilenum ' open unix file savefilenum = freefile ' free file write open newfile binary #savefilenum ' open/create save file while not eof(openfilenum) line input #openfilenum, newfilebuffer ' retrive text (if unix file, entire text on 1 line) if econverttype = dos2unix ' check type of conversion ...

javascript - How to output a reverse string using innerHTML? -

i'm trying reverse string , output results using innerhtml. nothing output when click button. <input type="text" id="text"> <button id="reversal">reverse</button> <div id="results"></div> <script type="text/javascript"> var input1 = document.getelementbyid("text").value; var button = document.getelementbyid("reversal"); var result = document.getelementbyid("results"); var reversals = function(string) { result.innerhtml = string.split("").reverse().join(""); } button.onlclick = function() { reversals(input1); } </script> this should do. input1 = document.getelementbyid("text").value; should assigned within onclick handler. var button = document.getelementbyid("reversal"); var result = document.getelementbyid("results"); var reversals ...

xcode - Using iOS 6 Event kit to work with reminders -

Image
hello guys i'm trying make reminder app iphone school , keep having errors don't know causing can here me these errors? ( http://prntscr.com/7u0hh6 ) ekeventstore class. trying compare class nil, makes no sense. looks have not declared _eventstore.

android - How is it possible to pass the getFilesDir() to Files object :as getFilesDir() returns path of the dir? -

i new java ,so please explain me stuff: res = getresources(); try { io.transferfiles(getfilesdir(),res); } catch (ioexception e) { } the above code in oncreate() . class io{ public static void transferfiles(file base, resources res) throws ioexception { //statement } }} so question is, happen if pass getfilesdir() method file object (here base ). (please provide links if can learn more) ref: example returns absolute file path of internal storage of device no permission required. when u want read file using or write file need declare <uses-permission> in manifest file. example internal , external file storage

Java cast base class to an extended class -

i have class used in project sort of field holder. like: class { private string field = null; private string field2 = null; private string field3 = null; // , generic getters , setters } in part of code need add additional fields class. did class b extends { private string fieldinb = null; // , getters , setters } in function thought public void foo( a ) { b b = (b)a; } and have fields written in a object , set field in b , use it. seams common problem, don't know how except ugly approach: public b( a ) { // copy fields 1 @ time } you use dozer . allows map bean property values 1 bean class another.

python - How to write a list of path names on separate rows in csv file? -

i have list of pathnames: li = [u"c:\\temp\\filea.shp", u"c:\\temp\\fileb.shp", u"c:\\temp\\filec.shp"] i trying write each path on separate line in txt file. have done far: import csv li = [u"c:\\temp\\filea.shp", u"c:\\temp\\fileb.shp", u"c:\\temp\\filec.shp"] open(r'c:\temp\myfile.csv', "wb") f: wr = csv.writer(f, delimiter=',', quoting=csv.quote_none) wr.writerows([li]) which yields list of files on same row: c:\temp\filea.shp,c:\temp\fileb.shp,c:\temp\filec.shp how can tweak pathnames each on own row? following after: c:\temp\filea.shp c:\temp\fileb.shp c:\temp\filec.shp easy need add \n witch means new import csv li = [u"c:\\temp\\filea.shp", u"c:\\temp\\fileb.shp", u"c:\\temp\\filec.shp"] open(r'c:\temp\myfile.txt', "wb") f: wr = csv.writer(f + '\n', delimiter=',', quoting=csv.quote_none...

oauth 2.0 - OAUth2 ASP.NET invalid_grant -

i trying implement oauth2 web application though signing in application works, refresh tokens result in http 400 "invalid_grant". specifically, project asp.net webapi owin oauth provider. has been killing me days without luck appreciated :) have correctly set oauthauthorizationserveroptions.refreshtokenprovider ? if need sample, katana's sandbox project contains minimal implementation showing how can configure protect , serialize refresh tokens using data protection block (machine keys on iis): https://github.com/jchannon/katanaproject/blob/master/tests/katana.sandbox.webserver/startup.cs#l169-l173 app.useoauthauthorizationserver(new oauthauthorizationserveroptions { refreshtokenprovider = new authenticationtokenprovider { oncreate = createrefreshtoken, onreceive = receiverefreshtoken, } }); private void createrefreshtoken(authenticationtokencreatecontext context) { context.settoken(context.serializeticket()); } private void...

winapi - How to use RegDeleteTree to delete KEY_WOW64_64KEY key? -

i have tested regdeletetree() in 32bit program. delete key_wow64_32key key. there function regopenkeyex() specify key_wow64_32key or key_wow64_64key ? i have tired code: hkey key = null; if (regopenkeyex(hkey_local_machine, _t("software\\asd"), 0, key_read | key_wow64_64key, &key) == error_success) { long d = regdeletetree(key, null); if (d != error_success) { cout << "error" << d; } else { cout << "success"; } } the output success key still exits in registry. i'm running on windows 7 vs 2013 , compiled win32 program not x64. use regopenkeyex key_wow64_64key open 64 bit view of key. call regdeletetree passing returned key. regarding update. ask read access when opening key. documentation regdeletetree states: the key must have been opened following access rights: delete, key_enumerate_sub_keys, , key_query_value. the fact call succeeds anyway make...

java - Binding modelAttribute from jsp to controller -

this controller class: @controller @sessionattributes({"list", "selectedcompany"}) public class prospectcontroller { protected static logger logger = logger.getlogger("controller"); @resource(name = "prospectwebservicetemplate") private webservicetemplate prospectwebservicetemplate; @resource(name = countrywebservicetemplate") private webservicetemplate countrywebservicetemplate; @resource(name = "companywebservicetemplate") private webservicetemplate companywebservicetemplate; /** * handles , retrieves subscribe page */ @requestmapping(value = "/addprospect", method = requestmethod.get) public string getaddprospectpage(@modelattribute("prospectattribute") prospectdto prospectdto,model model) { logger.debug("received request show add prospect page"); final getallcountriesrequest request = new getallcountriesrequest(); getallcountriesresponse response = (getallcountriesresponse) ...

Delete Maskined Region from Revit Document using C# -

i want delete maskined region revit document using c#. error : modifying forbidden because document has no open transaction. exception: modificationoutsidetransactionexception you have 2 options: change transactionmode automatic @ class attribute [transaction(transactionmode.automatic)] open transaction within command transaction tr = new transaction(commanddata.application.activeuidocument.document); tr.start("command name here"); // code tr.commit(); also posted here .

multithreading - JavaFx and Concurrency -

i've got following code: the controller.class of project: private task<observablelist<payment>> allentrietask= new task<observablelist<payment>>(){ @suppresswarnings("unchecked") @override protected observablelist<payment> call() throws exception { list<payment> list = (list<payment>) sqlexecutor.listallentries(payment.class); observablelist<payment> payments = (observablelist<payment>) fxcollections.observablelist(list); fxcollections.sort(payments); return payments; } }; private task<observablelist<payment>> revenueentrietask= new task<observablelist<payment>>(){ @suppresswarnings("unchecked") @override protected observablelist<payment> call() throws exception { list<payment> list = (list<payment>) sqlexecutor.listentries(payment....

c# - Application stops generating login cookies -

i've been searching answer while problem seems quite complex , i'm struggling find answer. i'm beginner software developer working start company , have completed first version system use multiple users. locally testing software had no problems, since publishing software windows 2012 server on iis have found major problem login system. when program uploaded multiple users can log in , use program no problems, (seemingly) @ random login system stops functioning on computers logged out. logged in can logout , log in account or other, logged out @ moment complete lose access system. when using developer tools on chrome appears these computers stop generating cookie created when logging in , redirect login screen. the systems still recognise incorrect logins , happens different computers each time upload program. i appreciate vague question, i'm pulling hair out on it! as said beginner , new hosting on business servers , don't have experience identity or ...

Pentaho ETL : Database Join vs Table Input -

i need write database table data text file transformation. there 2 steps available retrieve data table, namely table input , database join. don't see difference between them except "outer join?" option (correct me if understood wrongly). better use? environment: database : oracle pentaho spoon : 5.3.* (community edition) thanks in advance. table input step in pdi used read data database tables. query executed once , return result set. check wiki . database join works different. allow execute query based on data received previous step. every row coming in previous step, query in step substituted , executed. check wiki . the choice of using above steps depends on requirement. if need fetch data set database table, should use table input step - best choice. in case, need run query in database every row fetch result, use database join - best choice. hope helps :)

sql - Handling dynamic (user supplied) column names -

when writing applications manage data, useful allow end user create or remove classes of data best represented columns. example, i'm working on dictionary building application; user might decide want add, say, "alternate spelling" field or data, represented column. usually, name column based on whatever user called ("alternate_spelling" in case); however, user-defined string isn't explicitly sanitized database identifier bothers me. since column names can't bound values, i'm trying figure out how sanitize column names. so question is: should doing? can away quoting things? there's lots of questions asking how bind column names in sql, , many responses saying 1 should never need to, never explaining correct approach handling variable columns. i'm working in python specifically, think question more general. it depands on database using... according postgresql: "sql identifiers , key words must begin letter (a-z, let...

javascript - PHP - Append New Value to Form Data for Ajax Post -

i have formdata going sent php file using ajax post. var formelement = document.getelementbyid("form-id"); var form_data = new formdata(formelement); var csrf_arr = csrf.split("="); form_data.append(csrf_arr[0],csrf_arr[1]); $.ajax({ type: "post", url: "your-url", data: form_data, processdata: false, contenttype: false, datatype: "json", success: function(data) { alert(data.message); }, complete: function(data) { location.reload(); } }) what i'm trying here append new single data inside form_data from assumption, make doing this form_data.append("key","value"); but not sent through ajax post or not appended form_data part of formdata. am making mistake here or there rule that? please give help. in advance! dear of friend, i'm sorry. mistake myself. i have fix myself , found mistake right inside code. -- javascript code --...

angularjs - How to use ngoption to list all city for a state from the given JSON object -

$rootscope.states = [{state : 'chhattisgarh', city : ['raipur', 'bhilai', 'bilaspur', 'raigarh', 'korba', 'jagdalpur']}, {state : 'orissa', city : ['anugul', 'bhubaneshwar', 'cuttack', 'jharsuguda', 'sambalpur', 'rourkela']}]; i want use 1 selector group states one thing note ngmodel required ngoptions work. check http://plnkr.co/edit/sts6lvtqmjofkikykfyd?p=preview

jquery datetimepicker disable today -

i want allow selection of weekends excluding today (if today weekend). however, following code allows selection of today. trying: jquery('.datetimepicker').datetimepicker({ timepicker:false, mindate:'+1970/01/01', maxdate:'+1970/01/10', defaultdate:'+1970/01/01', format:'d/m/y', beforeshowday: disableweekdays, closeondateselect: true }); function weekendsonly(date) { var day = date.getday(); return [(day > 0 && day < 6), '']; } function disableweekdays(date) { var weekenddate = weekendsonly(date); var disableweek = [!weekenddate[0]]; return disableweek; } this using: http://xdsoft.net/jqplugins/datetimepicker/ also, mindate doesn't seem work @ all. try - mindate = tomorrow.setdate(today.getdate() - 1); var today = new date(); var tomorrow = new date(); tomorrow.setdate(today.getdate() - 1); $("#mindate").datepicker({ showon: "no...

c++ - How to implement static virtual member function -

tl/dr: there (more convenient) way implement such functionality? i have invoke same static code both class-type , class-instance represented reference base: int main() { // invokes on class bar<c1>(); // invokes c1::foo() bar<c2>(); // invokes c2::foo() // invokes on instance bar(c1()); // invokes c1::foo() bar(c2()); // invokes c2::foo() } but problem can't implement without code duplication. each derived class have write both static , virtual methods. static - because can't invoke virtual method on class, , virtual, calls static - because there's no way distinguish object behaviour except virtual methods: template<typename t> void bar() { t::foo(); } void bar(a const &r) { r.foo(); } thus, workaround solve problem of duplicating code: #include <iostream> class { public: virtual void foo() const = 0; }; template<typename derived_t> class b: public { public: virtual void foo() cons...

3 element array for java, i need help understanding it -

hi can explain me question asking? don't quite 3 element array in java. full question. declare 3-element array of characters chararr, , initialize values '*' your requested create array of type char 3 elements , initialize this: char[] mychararray = new char[] {'*', '*', '*' }; update: or shorter: char[] mychararray = {'*', '*', '*' }; // or {'\'', '*', '\'' }

How to use AND/OR in if else PHP statement -

how shorting codes if(stristr($a,'erorr email')){ echo 'error login'; } elseif(stristr($a,'erorr password')){ echo 'error login'; } i want add 'and' if , delete 'elseif' .. if(stristr($a,'erorr email') || stristr($a,'erorr password')){ echo 'error login'; } and read link learn more: php operators

opengl es - Segmentation fault due to attempt to launch native gles2/egl app on android, without native activity -

sorry english, i'm not native speaker. i'm trying launch simple gles2/egl app on android (galaxy s4, jelly bean) without native_activity. i have next main.c: #include <stdio.h> #include <stdlib.h> #include <egl/egl.h> #include <gles2/gl2.h> int main( void ) { egldisplay dpy; printf( "hello world.\n" ); dpy = eglgetdisplay( egl_default_display ); printf( "egl dpy: %p.\n", dpy ); return 0; } and next android.mk: local_path := $(call my-dir) include $(clear_vars) local_module := hello_world_gr local_src_files := main.c # have found libglesv2.so , libegl.so libraries , appropriate header files in ndk. local_ldlibs := -l/home/ila/programs/android-ndk-r10e/platforms/android-18/arch-arm/usr/lib -lglesv2 -legl local_c_includes := /home/ila/programs/android-ndk-r10e/platforms/android-18/arch-arm/usr/include include $(build_executable) i have chosen 18-th ndk-supported api level due have 4.3 (jelly bean) andr...

subset - Getting variable names of desired values in R -

my data (group) has 300 variables showing group belong in second row..there total of 6 groups 2017 2766 1737 1745 1747 1883 1884 1821 1900 ...... 3 4 6 3 3 3 3 3 3 ...... if this: group=="6" it show if variables true or false if belong group 6 below 2017 2766 1737 1745 1747 1883 1884 1821 1900 .............. false false true false false false false false false .............. i trying list out variables belong individual group. example want ask variables belong group 6 i tried gave null results: names(group=="6") i want save names csv. try colnames(group)[which(group=="6")] when group data.frame or else names(group)[which(group=="6")]

php - getting permission denied in amazon aws -

i trying connect amazon s3 using aws credentials file have done following things i have created credentials.ini file @ .aws\credentials . have valid awsaccesskeyid , awssecretkey [default] awsaccesskeyid=somekey awssecretkey=somesecretkey i doing following use key , list object . $s3 = new aws\s3\s3client([ 'version' => 'latest', 'region' => 'us-west-2' ]); $result = $s3->listbuckets(); var_dump($result); and getting error warning: parse_ini_file(c:\users\user\.aws\credentials): failed open stream: permission denied in c:\xampp\htdocs\aws\vendor\aws\aws-sdk-php\src\credentials\credentialprovider.php on line 216 fatal error: uncaught exception 'aws\exception\credentialsexception' message 'error retrieving credentials instance profile metadata server. (curl error 28: connection timed out after 1000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html))' in c:\xampp\htdocs\aws\vendo...