Posts

Showing posts from February, 2010

Calling a web service from store procedure in Informix -

is there way call web service store procedure in informix? or make call http? from informix stored procedure, can run command line system commands. if want make rest api call, can use "curl" command line tool/library. curl standard package , available on linux distributions , macos default. here nice article started in curl here informix documentation shows how can use system command run command line commands within spl routine.

prestashop - Cant add module to my own hook -

i have problem since 3 different modules in same hook. i've made new hooks separete modules, problem can't add modules position new hooks. when click on modules can choose 5 or 6 default hooks. can help? :) add manually in table ps_hook . appear in hook positions in backend.

Python script for controlling ASCOM CCD camera? -

i want control ccd astronomical camera in python using ascom driver, haven't found example script show how it's done. i'd see how basic control of camera done - set exposure length, start exposure, download image data. can post example python script can use starting point?

python 2.7 - Using SciPy to find probability in case of non-Normally Distributed Curve -

i have percent array, failed normal test using scipy. means cannot use z_score calculated using array's average , standard deviation , use stats.norm.cdf(z_score) this give incorrect probability z_score per normal distributed curve. how pass array percent_data scipy, such creates distribution curve internally , how pass z_score corresponding function returns correct probability ?

java - Generating all permutations of a given string -

what elegant way find permutations of string. e.g. ba , ba , ab , abcdefgh ? there example java implementation? public static void permutation(string str) { permutation("", str); } private static void permutation(string prefix, string str) { int n = str.length(); if (n == 0) system.out.println(prefix); else { (int = 0; < n; i++) permutation(prefix + str.charat(i), str.substring(0, i) + str.substring(i+1, n)); } } (via introduction programming in java )

plot - Matlab. One script cell returns two figures -

Image
i'm trying make scriptfile various script cells in it, separated %% . following code, returns 1 old figure , 1 circle. want clear figure window 1 figure when execute 1 particular script. % rita tan(x) x=((-pi/2)+0.01:0.01:(pi/2)-0.01); y=tan(x); plot(x,y) grid on %% % exempel 1 x=linspace(0,8); y=x.*sin(x); plot(x,y) title('f(x)=sin(x)') %% % plot circle t=linspace(0,2*pi); x=cos(t); y=sin(t); subplot(1,2,1) plot(x,y) title('utan axis equal') subplot(1,2,2) plot(x,y) axis equal title('med axis equal') %% % funktionsytor x=linspace(0,5,50); y=linspace(0,5,50); [x,y]= meshgrid(x,y); f=x.*cos(2*x).*sin(y); surf(x,y,f) %% what is: how 1 of them? use clf (clear figure) delete graphic objects current figure. since seems you'd executing scripts in random order, use clf @ beginning of each section stated reason. if you're executing script in same sequence shown in question can add clf @ start of section after subplots.

Using Z3 to minimize makespan in scheduling problems -

i trying model job shop scheduling problems using z3. let's have set of tasks each of may have other task dependencies. wish minimize time of scheduling last tasks i.e. makespan. since there can more 1 job has dependencies on other jobs no forward dependencies (i.e. no job depends on one), simple minimize operation in z3 may not suffice. , z3 doesn't admit max function on list. hence solve this, considering adding fake job depends on such jobs , minimizing time of scheduling job. wonder if approach scalable need add constraints many jobs. is approach or there other more elegant means? you can define max using chain of ite calls yourself; assuming know how many jobs there are. see here: use z3 , smt-lib maximum of 2 values

php - What user runs by default - HTTP Error 500.0 in IIS 10? -

i cannot figure out life of me user iis 10 running as. here's i've tried: <hostname>\iis_iusrs <hostname>\iusr gave them read + write + execute on c:\php and c:\inetpub\wwwroot and still error: http error 500.0 - internal server error fastcgi process has failed recently. try request again in while (this happens when trying open localhost\phpinfo.php ) and yes, followed steps manual install section in https://technet.microsoft.com/en-us/library/hh994592(v=ws.11).aspx except skipped wincache part because host on sourceforge; have gotten php 5.6 (x86) non-threaded run without wincache... time not work edit found error in c:\inetpub\logs\* looks this #software: microsoft internet information services 10.0 #version: 1.0 #date: 2017-09-11 21:14:43 #fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(user-agent) cs(referer) sc-status sc-substatus sc-win32-status time-taken 2017-09-11 21:14:43 ::1 /phpin

python - Application names aren't unique, duplicates: accounts -

i'm attempting run python manage.py makemigration command, i'm greeted following error message: django.core.exceptions.improperlyconfigured: application labels aren't unique, duplicates: accounts i attempted add following accounts.apps.py from django.apps import appconfig class accountsconfig(appconfig): name = 'accounts' label = 'my_accounts' but, gives me following error message: django.core.exceptions.improperlyconfigured: application names aren't unique, duplicates: accounts my security.settings.py installed apps following: installed_apps = [ 'accounts', 'accounts.apps.accountsconfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] is error message because have 'accounts', , accounts.apps.accountsconfig

laravel - FormRequest prevents controller method's exceution -

here form request class categoryrequest extends formrequest { /** * determine if user authorized make request. * * @return bool */ public function authorize() { return true; } /** * validation rules apply request. * * @return array */ public function rules(request $request) { if ($this->method() === 'post') { $parameters = $this->route()->parameters(); $category = null; if (isset($parameters['category'])) { $category = $parameters['category']; } $id = $category ? $category->id : null; $required = $id ? 'required' : 'nullable'; return [ 'name' => 'required|string|max:256', 'slug' => $required . '|string|max:256|unique:categories,slug,' . $id ]; } retu

forms - &validate=`workemail:blank` is not behaving properly -

i've tried using example stop page getting spam on it, when test out , put text in field, submit button still sending form out. use formit websites. the idea create hidden field if spambot enters info hidden field, no email sent out. example in question https://docs.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.using-a-blank-nospam-field snippets of code <input type="hidden" name="workemail" value="" /> [[!formit? &validate=`workemail:blank`]] i'm using exact code there, , code below field - i've made sure field within tags. <input type="hidden" name="workemail" value="[[!+fi.workemail]]" /> my formit code looks like [[!formit? &hooks=`spam,formitsaveform,email,redirect` &redirectto=`122` &formname=`contact form` &formfields=`fname,title,company,email,options,subject,message` &emailtpl=`fi-contact_e

c# - Why is my view not updating on a view model change? -

parent view model command method in possalesviewmodel know might have broken concept of mvvm code below i'm new , improvement appreciated. private void addproduct(productdto productdto) { var ctx = (possalesdetailsviewmodel)((possalesdetailsview)tabitems[_selectedtabindex].content).datacontext; ctx.productlines.add(new productline() { product = productdto.description, quantity = 1, producttradechannelid = productdto.producttradechannelid, amount = productdto.amount }); } child view model possalesdetailsviewmodel below collection reached view not being updated public observablecollection<productline> productlines { => _productlines; set { set(ref _productlines, value); } } here child view binding collection <datagrid x:name="producttypesdatagrid" itemssource="{binding productlines, mode=twoway}" autogeneratecolumns="false" canusersortcolumns="true" ca

php - Can't get a typo3 template to work -

so have few days make typo3 site, , since not familiar it, decided install template , change around bit. whenever try import .t3d file instructions in .txt of template 2 errors: when upload it, "file not contain data 'files_fal'" i have been unable find out means or message saying: the reference uid file (sys_file_reference) has numeric. uid given: "c:/xampp/htdocs/site/typo3temp/var/transient/xxxxx.tmp xxx being name of .tmp file gets created every time try this. how fix this? it's on side, have not been able find out what. edit: @kevinappelt current typo3 version 8.7.4- should newest. template downloaded site realised 2014. seem incompatibility think it. kind of silly did not notice, thank pointing out. figure out rest on own. transfering complete configuration t3d-files not state of art. assume have old tutorial t3d file , new version of typo3 not match well. (you should give more information versions , maybe sources of info

How get string from skip in DOORS DXL -

i using following code string skip function. getting integer numbers. appreciate if can me out. int csvtoskip(string csv, skip skip, char delimeter) { int = 0 int j = 0 int index = 0 (i = 0; < length(csv); i++) { if (csv[i] == delimeter) { put(skip, 0, "1") j = + 1 } else if (i == length(csv) - 1) { put(skip, 1, "2") } } return(index) } skip myskip=create; string test="hi test;for test"; char delimiter =';'; int x=csvtoskip(test, myskip, delimiter ); print x; svalue in myskip { print (int key myskip) " " svalue "\n"; } this giv

google compute engine - googleComputeEngineR not connecting in R - Error 400 -

example code : https://cloudyr.github.io/googlecomputeenginer/ library(googlecomputeenginer) sys.setenv(gce_auth_file="auth.json" gce_default_project_id="dev-example" gce_default_zone="us-west1-a") gce_auth() gce_get_project("dev-example") request status code: 400 error in checkgoogleapierror(req) : json fetch error: invalid value 'dev-example'. values must match following regular expression: '(?:(?:[-a-z0-9]{1,63}.)*(?:a-z?):)?(?:[0-9]{1,19}|(?:a-z0-9?))' the auth.json user credential download. any suggestion working opened json file , found correct project_id

Visual Studio Cordova iOS Remote Build Release Mode Error Code 70 -

Image
i'm trying build cordova app , ios .ipa file publishing on app store. i'm using phonegap-plugin-push plugin requires cocoapods . plugins , pods installed successfully. debug build successful , i'm able run app on simulators. when i'm trying build release mode getting .ipa file, receive error: build failed error code 70 ... i think problem remote builder trying build .xcodeproj file. when i've opened project in xcode .xcodeproj file , tried build it, i've got same error , problem missing cocoapod plugin. when opened app .xcodeworkspace file in xcode , built it, build successful (cause cocoapod plugins included). any ideas how fix release mode remote build in visual studio when using cocoapods?

javascript - How to change a react state immediately by setTimeout after setState? -

new in react here, don't know if it's right on setstate callback this? settimeout(()=> { this.setstate((state, props) => ({ activatelightcolorforred: true }), () => { settimeout(()=> { this.setstate(()=> ({ activatelightcolorforred: false })) }, 500); red.play(); }) }, towait); or maybe this? this.setstate((state, props) => { this.setstate((state, props) => { activatelightcolorforred: true }); settimeout(() => { activatelightcolorforred: false },500) }) are state on setstate callback updated? weird happening in components, it's rendering multiple times. not sure think it's because i'm doing first sample? your question not seem follow pattern of regular react app. should using lifecycle events react state being changed. should not making multiple, nested, confusing callbacks (like seems want do).

HTML Table cannot export to Excel using javascript -

we have linux server perl/html create webpages users access information on our oracle db. of pages rendered using oracle db packages sending straight html code server. have page allows user download html table excel spreadsheet. works until user on windows 10/ie 11 workstation , export not work. using f12 console, there no error written. original function written in vbscript: <script language="vbscript"> sub exportbutton_onclick dim fso, shtml, oexcel, obook, osheet, osheet2, osheet3, filepath shtml = document.all.item("reportdata").outerhtml set fso = createobject("scripting.filesystemobject") filepath = fso.getspecialfolder(2) & "\myexportedexcel.xls" fso.createtextfile(filepath).write(shtml) set oexcel = createobject("excel.application") oexcel.workbooks.open(filepath) oexcel.workbooks(1).worksheets(1).name = "certification report" oexcel.visibl

firefox - how to validate dhparams in apache <=2.4.6 - Server Fault

how can validate i've setup apache 2.4.6 server custom 2048-bit (or 4096-bit) dhparams config? following weakdh.org sysadmin guide , created own dhparams.pem file openssl dhparam -out dhparams.pem 2048 . guide says add apache mod_ssl config sslopensslconfcmd dhparameters "{path dhparams.pem}" , valid apache >= v2.4.7. i'm using centos 7, uses apache v2.4.6. according this server fault question , solution in apache v2.4.6 append certificate file. did cat /etc/pki/dhparam/dhparam.pem >> /etc/letsencrypt/live/openbuildinginstitute.org/cert.pem (and cat /etc/pki/dhparam/dhparam.pem >> /etc/letsencrypt/live/openbuildinginstitute.org/fullchain.pem` && restarted apache. but how verify client-side (my browser) config in effect? this issue use let's encrypt, want make sure our 90-day cert renewals include step, , want able verify browser. i tried downloading certificate firefox's "view certificate" -> "details&qu

rest - Github Passport strategy for Composer -

i'm trying configure user authentication via rest api using github strategy per documentation at: https://hyperledger.github.io/composer/integrating/enabling-rest-authentication.html i installed passport-github strategy executing - npm install -g passport-github but noticed install did not create needed ( "authpath": "/auth/github" ) folder on vm. i read on github website: https://github.com/cfsghost/passport-github the author of passport-github has not maintained original module long time. features in module don't work since github upgraded api version 3.0. forked , re-published npm new name passport-github2 can confirm if needs correction? , if exact steps need follow? if check age of last commit, see original repo jaredhanson/passport-github shows following last commit: latest commit c103215 on feb 3, 2016 the new repo cfsghost/passport-github has readme.md update 21 days ago (mid august 2017) , before last commit on:

image processing - Custom halftones algorithm on laser printers -

excuse naivety possible hack laser printer driver/firmware implement custom dithering instead of embedded default ones? if postscript laser printer might able use sethalftone operator use different threshold array screens. if want use dithering or instead need 'hack' code. i've no doubt possible, enormously difficult , mind pointless. if don't technique in printer use ghostscript render postscript grayscale image, apply technique like, wrap resulting 1 bit per pixel image postscript , send printer. because image monochrome no further screening applied. if talking colour can same, you'll have produce separated output , recombine halftoned images one. i should point out printer manufacturers expend reasonable degree of effort in getting passable quality output, taking characteristics of print technology account. won't impossible better, you'll have have idea doing.

version control - Commit changes missing from git merge -

i have 2 branches, a) develop , b) feature i work on b, , ready merge b a. has had lot of work done, lot of other feature branches merging in via pull requests. pull latest head of , testing purposes, let's merge in b (note, same behavior going both directions, i'm trying figure out problem is). i merged in b, have lot of compiler errors after resolving merge conflicts. noticed there code included in not making on b. causes build fail, , there many things missing (it's @ least 1 large commit's worth of code). i tracked down commit i'm having issues "merging" b. it's not it's not merging though, see when type "git log" when b checked out after merge. reason actual changes associated commit disappear. there no merge conflicts regarding code in question, , i'm never touched section while working on b else happen. regarding "missing" commit (even though see in branches log), supposed recover actual changes? u

r - How can I attach a list of custom color palettes to a list of ggplot objects without printing each plot object to the screen? -

Image
i have data frame in r in several of columns factors. i'd create series of bar charts showing relative sizes of each of factor levels. want associate own customized color palettes each of factors, , customize final layout of of bars , legends using gridextra package. i wrote example script think should achieve that, however, obtained rather surprising result: library(ggplot2) library(grdevices) library(gridextra) # define dummy data , put in data frame fruit <- factor(c("apple", "orange", "pear", "pear", "pear", "orange", "apple", "apple", "apple", "pear")) cheese <- factor(c("cheddar", "mozarella", "gruyere", "gruyere", "gouda", "parmesan", "gruyere", "gouda", "mozarella", "cheddar")) mydata <- data.frame(fruit, cheese) mydata$

arkit - Scenekit - add red tint to camera -

is possible add red tint given camera in scenekit? accomplish without (what consider be) hacky solution of trying shove red object < 1 opacity in front of camera. solution haven't had great success in scenekit showing object right in front of camera. also, ideally, fade red tint in , out using scnaction or other way. finally, perfect solution work in arkit, , give red tint whole world around you. have more red scenekit light. scncamera's colorgrading property can (that efficient option). using scntechnique apply custom post process work requires additional pass. both options faster blended node in front of camera, or red-ish spritekit overlay or uiview on top of scnview.

elasticsearch - Elastic search aggregation on map - on each key -

i have following kind of documents. document 1 { "doc": { "id": 1, "errors": { "e1":5, "e2":20, "e3":30 }, "warnings": { "w1":1, "w2":2 } } } document 2 { "doc": { "id": 2, "errors": { "e1":10 }, "warnings": { "w1":1, "w2":2, "w3":33, } } } i following sum stats in 1 or more calls. possible? tried various solution works when key known. in case map keys (e1, e2 etc) not known. { "errors": { "e1": 15, "e2": 20, "e3": 30 }, "warnings": { "w1": 2, "w2": 4, "w3": 33 } } there 2 solutions, none of them pretty. have point out option 2 should preferred way go since option 1 uses experiment

jsf - p:defaultCommand is autofired in Chrome -

i have strange behavior p:defaultcommand in chrome browser. in form password field, have p:commandbutton ajax="false" (to let browser show 'remember password') , p:defaultcommand allows send h:form enter key. the problem appears when: enter username , password. send form (click on button or press enter) remember password (browser prompt) now, when try access view, browser fill both fields (that ok, because have remebered credentias) in chrome, without clicking on button or pressing enter, form automatically send. why? in firefox , ie works well: form send when user click button or press enter, if field remebered browser. the following code shows saying. the view: <!doctype html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com

php - not receiving email after sending on localhost -

iam trying send account verification email localhost doesnt send. php.ini [mail function] smtp=smtp.gmail.com smtp_port=587 sendmail_from = [redacted]@gmail.com sendmail_path = "\"c:\xampp\sendmail\sendmail.exe\" -t" sendmail.ini [sendmail] smtp_server=smtp.gmail.com smtp_port=587 error_logfile=error.log debug_logfile=debug.log auth_username=[redacted]@gmail.com auth_password=[redacted] force_sender=[redacted]@gmail.com

python - LCA between two nodes -

can code on how find least common ancestor between 2 nodes on binary search tree. did following need on question4 function. want implement efficient solution without creating tree , adding nodes it. appreciated. here original question; find least common ancestor between 2 nodes on binary search tree. least common ancestor farthest node root ancestor of both nodes. example, root common ancestor of nodes on tree, if both nodes descendents of root's left child, left child might lowest common ancestor. can assume both nodes in tree, , tree adheres bst properties. function definition should question4(t, r, n1, n2), t tree represented matrix, index of list equal integer stored in node , 1 represents child node, r non-negative integer representing root, , n1 , n2 non-negative integers representing 2 nodes in no particular order. example, 1 test case might be question4([[0, 1, 0, 0, 0], > > [0, 0, 0, 0,

android - Manifest Problems -

i have tiny problem manifest errors. had add_contact class , add cardview layout .i wanna make add_contact , show_contact apis upper 14... debuger errors write in below: plz me. error:execution failed task ':app:processdebugmanifest'. > manifest merger failed : attribute meta-data#android.support.version@value value=(26.0.0-alpha1) [com.android.support:design:26.0.0-alpha1] androidmanifest.xml:27:9-38 present @ [com.android.support:cardview-v7:25.3.1] androidmanifest.xml:24:9-31 value=(25.3.1). suggestion: add 'tools:replace="android:value"' <meta-data> element @ androidmanifest.xml:25:5-27:41 override. can post dependencies build.gradle ? hard without more information, looks of support libraries aren't using same versions. error saying have both 26.0.0-alpha1 25.3.1 cardview. of right now, 26.0.2 latest release. recommended using of support dependencies.

ios - Preset a UIView with constraints above a Navigation Bar and Tab Bar -

i have uiview using container view other subviews display above uinavigationbar , uitabbar . i've tried using: self.edgesforextendedlayout = uirectedgenone; as setting constraint constants 0. but can still see uinavigationbar , uitabbar . how can achieve this?

forms - Blur an image on MouseClick in C# -

so have form picturebox on it, idea blur image around cursor when click it. ideas? it worked on pc when had blur whole image, , added mouse location stuff , doesn't seem anything. public partial class form1 : form { bitmap newbitmap; image file; int bluramount = 5 ; public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { dialogresult dr = openfiledialog1.showdialog(); if (dr == dialogresult.ok) { file = image.fromfile(openfiledialog1.filename); newbitmap = new bitmap(openfiledialog1.filename); picturebox1.image=file; } } private void form1_mouseclick(object sender, mouseeventargs e) { (int x = e.location.x-25; x < e.location.x+25; x++) { (int y =e.location.y-25; y < e.location.y+25; y++) { try {

Roblox PointsService:AwardPoints() local testing -

locally, in single play mode, pointsservice:awardpoints() fails silently. wrapping inside pcall() not give me anything, success nor error. lines after 1 not executed , function returns. i'm guessing not work locally? behavior weird , don't know how develop/test it. i've been banging head hours, maybe long , i'm missing obvious? edit: after more testing, avoid adding more comments, realized expected error returned ( processing pointsservice:awardpoints error: http 0 (http 403 (http/1.1 403 forbidden)) ) after restart studio , during first local run (play). hit stop , play again, errors no more returned , behavior described. also, appears work in test mode. i'm guessing "cleanup" button helps, while "stop" in single play mode doesn't. still, quick testing single play mode not possible , slows down development lot this happening 2 reasons: you're trying award playerpoints while in play solo, restricted. - or - you

javascript - Canvas window.addEvent error when running on gh-pages -

i have html5 canvas project allows uploading of image canvas. variously drawn on. i can run project locally with $ http-server running locally, don't errors. the project on github the issue in gh-pages error, uncaught typeerror: window.addevent not function @ (index):22 line 22 is, window.addevent('load', function() { this problem when trying run snippet tool. <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bo

How to optimize for loop in c by using square root (perfect, abundant, deficient) -

note: left out irrelevant code so working on ccc 1996 p1, , whole purpose of problem able compute whether integer input perfect, deficient, or abundant number. code have listed above works however, think slow. code, iterates through every number in order find perfect divisors, think inefficient. anyway, have been thinking awhile, cant seem come ways optimize code. i read online replace < n, < sqrt(n) , switch line in score added s += + (n/i), or of sorts, however, doesn't seem work me. suggestions on more efficient code , decrease run time, because currently, program runs long before reaching output. appreciated thanks! also, number defined perfect if sum of perfect divisors equal number. number defined abundant if sum of perfect divisors > number. number defined deficient if sum of perfect divisors < number. number not count perfect divisor. i not familiar big-o notation. also, number defined perfect if sum of perfect divisors equal number. number defined

WiFi connection freeze on Ubuntu 16.04 -

i have ubuntu 16.04 , wifi connection freeze seconds after restart, run below command: service network-manager restart and connection comes back, few minutes, again have run same command. , connection comes back. how can fix this? idea?

Autocomplete Search Engine in PHP, MYSQL and JAVASCRIPT -

Image
good day! have here sample program gives output of autocomplete search engine illustrated in picture below of description. of content of autocomplete given which "palawan","romblon","marinduque","mindoro","cagayan","batanes","nueva vizcaya","isabela","quirino" and think not dynamic. want pull out of data in column(provinces) table(tb_places) , put autocomplete engine. the purpose of autocomplete inform user data may search using search engine. everyone <?php $con = mysqli_connect('localhost,'root','','category'); ?> <!doctype html> <html lang="en"> <head> <style type="text/css"> tags { span.label{ font-weight: bold; color: #000;} </style> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel=&q

Android studio - how to create res folder for different flavor -

Image
i'd create res folder in flavor folder in android studio dont see option it. know structure looks this: src \ main | res but have flavor added , strucuture looks this: src \ main | res \ staging | (i want res appear here) is possible res appear under staging. way anytime using stagingdebug variant first drawables etc inside staging res folder ? tried right click , go new dont see option create res folder. i consider 2 things want achieve. first have consider directory structure. if have 2 flavors, example debug , release, , want different image each flavor need put files inside following directories: app/src/debug/res/drawable app/src/release/res/drawable first 1 debug flavor, second 1 release flavor. made sample project available @ github shows how use different image 2 flavors. the other thing consider use different view browse project items. if check on left of screen, have drop down allows change way browse project

java - SQL Exception: Operation not allowed after ResultSet closed -

i exception"operation not allowed after resultset closed", function close resultset every time. should add 'synchronized' function? or how solve exception? public static arraylist<region> gethotproductregionlist() { arraylist<region> list = new arraylist<region>(); resultset rs = null; conn.checkconn(); try { if (gethotproductregionstmt==null) gethotproductregionstmt = conn.preparestatement(gethotproductregionstr); rs = gethotproductregionstmt.executequery(); if (rs!=null) { while (rs.next()) { region r = new region(); setregion(r, rs); list.add(r); } rs.close(); } } catch (exception e) {

ios - LinkedIn login with custom token ( ERROR_INVALID_CUSTOM_TOKEN ) -

i trying login linkedin using native app , linkedin sdk. far can login using web if linkedin app not installed. can login linkedin , token in return. when try authenticate firebase error: optional(error domain=firautherrordomain code=17000 "the custom token format incorrect. please check documentation." userinfo= {nslocalizeddescription=the custom token format incorrect. please check documentation., error_name=error_invalid_custom_token}) this code: // app installed let permissions = [lisdk_basic_profile_permission,lisdk_emailaddress_permission] lisdksessionmanager.createsession(withauth: permissions, state: nil, showgotoappstoredialog: true, successblock: { (returnstate) -> void in lisdkapihelper.sharedinstance().getrequest("https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,public-profile-url,industry,positions,location)?format=json", success: { (response) -> void in

plpgsql - syntax error when running postgresql function/stored procedure -

trying perform set of complex postgresql db operations using function, simple function gets me error: error: syntax error @ or near "text" line 3: tmp text := info; ^ here sql create or replace function createme (info text) returns text $$ declare tmp text := info; begin select :tmp end $$ language sql; any idea why? thx! you procedure not in sql language, in plpgsql language. create or replace function createme (info text) returns text $$ declare tmp text := info; begin return tmp; end $$ language plpgsql; select :tmp nonsense in content. functions returns value command return - similar other environments.

java - Implement a CustomIdHandler for jsonapi-converter -

i trying implement jsonapi spec using jsonapi-converter library. part of it, trying code customidhandler generate custom id. there support string or long id. in case need compound key need implement resourceidhandler . customidhandler use case, in id combination of 2 properties. coursename , courseid . courseidhandler.java public class courseidhandler implements resourceidhandler { public courseidhandler() { } @override public string asstring(object identifier) { if (identifier != null) { return string.valueof(identifier); } return null; } @override public string fromstring(string source) { return source; } } course.java @type("course") public class course { @id(courseidhandler.class) private string id; private long coursename; private long courseid; public string getcoursename() { return coursename; } public void setcoursename(string coursenam

windows - Passing powershell variable to robocopy -

i have robocopy job copy files 1 folder location. "d:\inetpub\www.test.com.au\app_data\indexes" "d:\inetpub\www.test2.com.au\livewww\app_data\examine" /mir /is /mon:1 /mot:5 this working fine have started using octopus deployment , web root folder ,i.e d:\inetpub\www.test2.com.au\livewww\app_data\examine not same , keeps changing after every deploy like d:\octopus\dev\presentation.web\2017.9.320-ap\app_data\examine d:\octopus\dev\presentation.web\2017.9.321-ap\app_data\examine d:\octopus\dev\presentation.web\2017.9.322-ap\app_data\examine i thinking use powershell current root of website www.test2.com.au , pass location robocopy. i new powershell , have never worked in powershell question is possible use powershell , robocopy getting current root of website www.test2.com.au , pass robocopy execute command. how possible? appreciated thanks in advance yes, looking possible. web server administration module windows powershell includes intern

javascript - Given a set of Promises, how do I forcefully resolve with the response of the last Promise, while ensuring all Promises resolve successfully? -

promise 1 (resolves in 200ms) promise 2 (resolves in 400ms) promise 3 (resolves in 1000ms) promise 4 (resolves in 300ms) promise 5 (resolves in 500ms) these promises resolve in following order 0 - requests start 100 200 - promise 1 300 - promise 4 400 - promise 2 500 - promise 5 (most recent application state) 600 700 800 900 1000 - promise 3 (stagnant application state) given in app, response of promises dictates application state, when older promise resolves more newer one, application state stagnant. a potential implementation not start next request until previous request has finished, hang user progress considerably. edit: i might have left out bit of necessary context. there's no way me tell when promise added. promise.all can't have items added after has started, promise.all might not work me. for more normal use-case provided answers have worked nicely, unfortunately api bit chatty. so want promises complete go forward newest promise's valu

reactjs - How to implement a base component that preprocess all urls and let all other components extends it? -

when opens url domain, want keep track of query string variable(named var), idea make parent component @ componentwillmount, take query string, , save redux state variable, if state variable undefined. for example, if comes url: mydomain.com/anyurl/?var=abc now set state variable abc. , when viewer navigates page within domain, var in query string can dismissed, still keep track of activity, go mydomain.com/anyurl2 still know 1 var=abc. here approach: import react, { component } 'react' import { recordrefurl } '../actions/actions' import { connect } 'react-redux' class basecontainer extends component { componentwillmount() { if (this.props.location.query.var && !this.props.urlrefparam) { this.props.dispatch(recordrefurl(this.props.location.query.var )); } } } function select(state) { return { urlrefparam: state.urlrefparam, } } export default connect(select)(basecontainer) and in com

sql - Cascading parameter and multiple dates in Crystal report -

i trying create report in crystal (2011, v14.0), results displayed not consistent idea, feel below code should work no avail, clue appreciated! requires 1) user select cluster , based on (think country) 2) other parameter gets facility names filtered cluster (think state) now, cluster should mandatory , if user doesn't select facility should consider displaying facilities in user specified cluster. on top of there 4 date field in table, if of these dates falls between users selected date range should select them well. so, using formula if (not hasvalue({?facilitynamevw})) {cmd_pwcode_shop.description} = {?facilitynamevw - description} , ({workorder.actualstartdate} in {?from date} {?to date} or {workorder.actualfinishdate} in {?from date} {?to date} or {workorder.projstartdate}in {?from date} {?to date} or {workorder.projfinishdate}in {?from date} {?to date} ) else (hasvalue({?facilitynamevw}) or {cmd_wo_shop_facility.facilityname} = {?facilitynamevw}) , ({workorder.

javascript - MEAN app with angular 2 error: Cannot read property _id of undefined -

i building application first time store, update, view , delete client profiles. followed angular tour of heroes build basic app , pieced mongodb , express portions around net. i getting error in browser console when attempt delete client profile - error typeerror: cannot read property '_id' of undefined @ clientprofilecomp.webpackjsonp.../../../../../src/app/components/clientprofile.component.ts.clientprofilecomp.delete (clientprofile.component.ts:53)... (etc). i have confirmed using postman express routing working intended. able all/create clients @ /api/clients , get, put , delete /api/clients/:_id (where _id autogenerated id each entry). i believe problem in 1 of component files, error occurs when attempt delete or view specific client detail, causes type of error entirely (casterror). problem began when attempted remove mentions of clientprofile: clientprofile[]; (or hero in case of tutorial) no longer importing details client.ts (hero.ts) since u