Posts

Showing posts from September, 2011

php - Username behind URL -

hello stack overflow i'm kind of stuck user_profile/username_here. problem can fill in every username want , still show made username if put behind '/' got filtered out how let show username of user logged in behind url? i'm using url rewriting. htaccess: rewriteengine on rewritebase / rewriterule ^profile/([a-za-z0-9-\._]+)(\/)? /profile.php?username=$1 [l,qsa] here code i'm using user_profile.php: <?php require_once('db.php'); session_start(); if(!isset($_session['id'])) { header("location: access_denied.php"); } else { $username = $_session['username']; $firstname = $_session['firstname']; $lastname = $_session['lastname']; $result3 = mysql_query("select * tab username='$username' , firstname='$firstname' , lastname='$lastname'"); if($row3 = mysql_fetch_array($result3)) { $username = $row3...

apache - File upload is not working in server but working locally -

i have seen phpinfo file,it has no tmp value set set /tmp upload_tmp_dir = "/tmp" but still not working. server in amazon ec2. i have tried putting upload_tmp_dir "/var/www" (with no trailing slash ) ,but didn't work. need set permissions tmp directory ? print_r($_files); is giving enter code here array ( [upload_file] => array ( [name] => ps.jpg [type] => image/jpeg [tmp_name] => /tmp/phpbcpdfp [error] => 0 [size] => 193728 ) ) and is_uploaded_file($_files['upload_file']['tmp_name']) is giving result 1 it permission issue on destination folder. do sudo chmod -r 777 /destination/folder , try again. should work. if still can't upload file, maybe permission problem on parent directory. after that, find user (and group) owner of uploaded file. then set permission back, , change owner of directory : sudo chown -r owner_user.group /destination/folder .

angularjs - How does $parse work? -

i have simple code this: <div ng-app="app"> <input type="text" ng-model="money" mask="2"> <p>{{money}}</p> </div> angular.module("app", []) .directive("mask", function($parse) { return { restrict: "a", require: "ngmodel", link: function(scope, element, attrs) { console.log($parse(attrs.mask)); // function(s, l, a, i){return 2;} console.log($parse(attrs.mask)(scope)); // 2 } } }); why first output function(s, l, a, i){return 2;} with (s, l, a, i) ? in case need jsfiddle: https://jsfiddle.net/ealonwang/x1hcbpjw/11/ according angular documentation $parse service $parse() without calling scope iief, returns function evaluated expession, aka: return 2 ; however function returned takes multiple arguments: function(context, locals) function represents compiled expression: context – {object}...

mysql - Java Application on network enviroment -

i'm developing application using java & mysql database, application desktop application working in network environment. application has static content loaded database when starting application. if super user made change variables, need enforce network users restart application can load new variables. what idea or code need use. you implement this. observer pattern or maybe can have "configtable" in database, property, value, expiration time. so, when admin updates value, other applications in network can pool new value. take jgroups regarding pooling approach, (we don't have enough information give best solution) try this. a notification_table id, event (event know, maybe load new images, etc) workflow 1) clients pool table every x seconds, filtering id > lastnotificationid (that needs saved in local file) 2) client applies new events. 3) client updates local file new notificationid.

IndexOutOfBoundsException showing while running my android program -

i doing android map oriented project. wrote code display direction between 2 places, works in lower android versions such 2.0, 2.2, etc. not working on android 4.0 , higher. when run code in android 4.0 shows indexoutofboundsexception . my class import java.io.inputstream; import java.util.arraylist; import javax.xml.parsers.documentbuilder; import javax.xml.parsers.documentbuilderfactory; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.protocol.basichttpcontext; import org.apache.http.protocol.httpcontext; import org.w3c.dom.document; import org.w3c.dom.node; import org.w3c.dom.nodelist; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.point; import android.os.bundle; import android.widget.button; import com.google.android.maps.geopoint; import com.google....

php - Exception handling the right way -

i have rather simple question, read articles error , exception handling in php, have still questions left unawnsered. 1) in way make custom exception classes (that extend php's default exception)? , in cases should make custom exceptions? 2) read exceptions have caught catch/try block, see thrown exceptions in codes without try/catch blocks. using set_exception_handler() function? , how should use function properly? 3) allow custom behaviors when exception thrown (for example, record exceptions in database), should use set_exception_handler() or else? thank taking time read questions , have nice day! if need exceptions more built-in exceptions extending them way go. there not more that. they not have to caught. should caught @ point (see 3.) if writing library or module of kind can throw exceptions , leave the user of code catch it. you can wrap entire application in try-catch block , catch exceptions there, , need them (e.g. save them log file, or d...

java - ArrayIndexOutOfBoundsException when running range query in Accumulo -

i using geomesa 1.1 connect accumulo 1.6.2 java. have no problems querying database specific attributes (specific column values). when try run range query (tried both time , geometric ranges) error. when check accumulo logs see error: exception while doing multi-scan java.lang.arrayindexoutofboundsexception: -1 but none of code uses arrays. exception thrown underlying library. this how constructing cql filter: filter cqlfilter = cql.tofilter("bbox(where, 160.0, 1.0, 170.0, 3.0)"); what might causing java.lang.arrayindexoutofboundsexception: -1 ? edit updated question , answer make clear isn't duplicate , provide more general future visitors. as quick note, looks might using geomesa accumulo quickstart. geometry field there named 'where'. if update filter filter cqlfilter = cql.tofilter("bbox(where, 160.0, 1.0, 170.0, 3.0)"); it may work you.

Do Jobs really work in background in powershell? -

i trying implement background commands initiate after user clicks button, , far have ended ui locking while job on-going. using time consuming loop check if ui locks up. can let job work in background ui freed up. not sure want complicate code adding runspaces. doing incorrectly? $inputxml = @" <window x:class="wpfapplication2.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:wpfapplication2" mc:ignorable="d" title="create user" height="448.05" width="656.017" resizemode="noresize"> <grid margin="0,0,-6.8,-0.8" background="#ffd7d7d7"> ...

linux - How do I set the dependency path in configure? -

i want cross-compile gtk+ armhf raspberry pi 2 on x86_64 virtual machine, therefore have compile dependencies of gtk+ armhf well. now gdk-pixbuf needs libtiff, compiled libtiff $home/arm . how can tell ./configure -script use $home/arm directory dependencies placed? thanks!

python sorting two lists - zip, sort, zip - unorderable types: int() < NoneType() -

i have 2 lists: a_list = ['a', 'k', 'a'] c_list = [[none, none], [13, none], ['f', none]] i sort a_list , c_list arranged according order of a_list. after sorting have: a_list = ['a', 'a', 'k'] c_list = [[none, none], ['f', none], [13, none]] i trying zip , sort , zip approach, gives me error message @ following stage: a_c_zip = sorted(zip(a_list,c_list)) typeerror: unorderable types: int() < nonetype() i think happening because of ambiguity of 2 a values, wonder if there work-around? after sorting a_list works without problem i don't want write own sorting routine since slow. you'll need specify key on sort. provided don't care order in 2 "a" entries sorted, can tell sorted @ first element of each pair generated zip (where each pair contains 1 element a_list followed 1 element c_list ). >>> a_list = ['a', 'k', 'a'] >>> c_...

python - Programming error with order by and distinct on Django with PostgreSQL -

there lot of similar posts none hit @ trying to. distinct has use same fields order_by, fine. so have following query: q = mymodel.objects.order_by('field1', 'field2', '-tstamp').distinct('field1', 'field2') ultimately trying find latest entry in table combinations of field1 , field2 . order_by think should, , that's great. when distinct following error. programmingerror: select distinct on expressions must match initial order expressions ultimately seems sql problem (not django one). looking @ django docs distinct, shows can , can't work. that q = mymodel.objects.order_by('field1', 'field2', '-tstamp').distinct('field1') will work (...and does). don't understand when add on field2 in same order done in order_by still same result. appreciated edit: notice if do q = mymodel.objects.order_by('field1', 'field2', '-tstamp').distinct('field1...

How can I save Selenium/Selenese tests as .json files? -

how can store selenium test in .json file? i store selenium tests logic-less .json file. selenium ide allows tests saved .html file ( http://docs.seleniumhq.org/docs/02_selenium_ide.jsp#selenium-commands-selenese ), logic-less, prefer have data stored in json file. json makes easier work test-runners nightwatch.js. i not want tests stored in .js, java, python, c#, ruby formats. it looks sauce labs has developed json format selenium builder: https://github.com/seleniumbuilder/se-builder/wiki/json-format

List to String. java android -

so trying call method contains list of peak value of array. reading array text file stringbuilder string . should call method perform function array, , toast results or printf. note array has string numbers equal space 1-d. string adata = string.valueof(stringbuilder); // find peaks string dataarray[] = adata.split(" "); list aa = dataarray; list = findpeaks(aa); // can't convert list. dataalert alert = new dataalert(); alert.show(getfragmentmanager(), "dataalert"); peaks_value.settext(string.valueof(a)); } }); }//end oncreate(). public static list<integer> findpeaks(list<float> points) { arraylist<integer> peaks = new arraylist<integer>(); float x1_n_ref = 0; int alpha = 0; (int = 0; < points.size(); i++) { if (x1_n_ref - points.get(i) < 0) { x1_n_ref = points.get(i); alpha = 1; } else if (alpha == 1 && x1_n_ref - points.get(i) > 0) { ...

bash - create book from filesystem -

a file system represents book directory representing each chapter , each chapter section, each page/.png file in directory p page of section q of chapter n. page 1 listed 0/0/0 page 456 might third chapter, , second section's page 4 making 2/1/3 directory containing of other pages/.png files. how bash script recursively search through each directory , organize corresponding pages right page file system read book/pdf? page 1 (0/0/0 in file system) in new directory shiny label displaying 1 or 001 while page/file 456 (2/1/3) displayed wonderful 456? i've found couple similar problems use following, find . type -d | while read -r d '' file; mv .'{$d} done which finds directories within . gets stuck renaming files. hunted down following script. source #!/bin/bash cd list=find `"path/to . " -type d` directory in $list; echo "directory=$directory" cd $directory imglist="ls | grep '\.png'" file in $im...

php - How do I put data with button into a table through foreign key? -

i'm working on web application school , goal create several classes , put students in it, , thinking, first think insert class , next thing select classes , put button next it, lead selecting or inserting students specific class. , have problem, because don't know, how connect buttons classes, guess has id , attach button, have no idea, how should that. two tables, students , classes. students has constraint class id. $sql = "select id, class_name, year class"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { echo "id: " . $row["id"]. " - class name: " . $row["class_name"]. " - year: " . $row["year"]." <button><a href=index.php?content=students>enter class</a></button>"."<br>"; } } you can add more variables href of button. classid=$row["id"]. combine vari...

html - Responsive Design: CSS Not loading on Iphone 5 Safari -

i'm searching reason , hint why website ( link ) not shown correctly responsive design (based on twitter bootstrap) on iphone5 safari browser while working correctly on desktop using ie, chrome or safari. on htc & samsung galaxy website working correctly. by googling find 2 solutions a) cleaning cache of browser , b) using <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1"> both doesn't fix problem. simulating iphone 5 device in google developer tool shows website correctly while in reality page not show css design. here the: false responsive design screenshot any idea need i'm running out of possible ideas. download bootstrap web server , include path in page, don't have rely on source go down. should fix problem, if not, try cordova. possible your phone being blocked bootstrap site because going on mobile network or that. source: personal experienc...

node.js - nodejs server code inside view -

i building website nodejs & express. come .net world, building sites mvc / razor. is there way insert server side code view using nodejs/express ? in head i'm thinking of similar can in asp.net mvc view, : <div class='user-info'> <%= db.fetchuserbyid(1).name %> </div> well, have lot of options. check list : https://github.com/joyent/node/wiki/modules#wiki-templating the 1 have heard of jade : http://jade-lang.com/ think.

opengl - Get or generate System Information in "C++" -

if @ windows pc's system information window , select components->display in left pane. second top value in right pane pnp device id. case xp @ rate. i need way of accessing or generating pnp device id value. i use glgetstring ( renderer ) , glgetstring ( vendor ) identify primary gpu. have been told these values can subject change when driver updated, not ideal use list of our known problem devices. further searching has shown me these glgetstring values generated pnp device id combination of bios information , driver .inf file data. does know way in c++ access pnp device id. opengl doesn't deal kind of low level device access. it's device model purely abstract , strings reported of informational value. if want know specific information device, must use os dependent bus enumeration functions.

information retrieval - Solving haar wavelet transform -

Image
i trying understand haar wavelet transform. confirm if answer correct or tell me doing wrong. problem tried solve: if unclear, please ask. if compute fast wavelet transform (fwt) of r using haar wavelet filters, expect r1 . if question, r1 answer.

Clearing directory /tmp/sqoop-hadoop/compile/ -

i want delete many old directories in sqoop compile directory (eg: /tmp/sqoop-hadoop/compile/cebe706d23ebb1fd99c1f063ad51ebd7 ) clean space. does sqoop stores temporary files in compile directory /tmp/sqoop-hadoop/compile/ ? will deleting of directories older particular day cause issues? does sqoop stores temporary files in compile directory /tmp/sqoop-hadoop/compile/? it creates jar file out of generated java code each of sqoop command (unless reusing jar files). if not using parameters such --jar-file, can safely delete directories. will deleting of directories older particular day cause issues? it should not unless reusing jar files using parameters such --jar-file

excel - macro to delete all the rows containing specific values -

this question has answer here: how delete rows in excel based on criteria using vba? 4 answers i have been working on code delete rows if there specific value in cells column a. works fine , delete rows need, loop keeps going , not understand should stop @ cell "a400". me? thank you! sub apaga1() dim pulo string sheets("sistema").activate cells.find("lf00").activate activecell.offset(1, 0).select lastcell = range("a400") 'apagar lfs until x = coelhoviado if left(activecell, 3) = "lf " or left(activecell, 3) = "lfs" or left(activecell, 4) = "lf00" or left(activecell, 3) = "lft" activecell.entirerow.delete shift:=xlup activecell.offset(-1, 0).select x = x + 1 end if activecell.offset(1, 0).select loop end sub try code: sub test() dim...

Wordpress Ajax deeplink gives 404 -

hi folks, my first post here, got throught reading before. i working on wordpress projekt. , seems missing overview on problem. use ajax recieve additional product data. http:url/product/additional_ajax_data... this works fine, except direct call of ajax urls. direct call of ajax url gives 404 not found. please dont give instructions like: add 200 ok header... cause project consist of thousand pages , work arounds no go... aditional infos: urls have no ajax hash tag... , content dynamicly loaded depending on last url fragment i found solution: to prevent wordpress of 404 when calling ajax url directly, add rewrite endpoints system. you can follow post jon cave on wordpress: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ works on custom post_types , custom taxonomys, keep eye on type wich want register custom endpoint rewrite (that may depends on options post type, page type etc...). if sure url correct , file there, check if ...

Python: Writing lists to .csv file -

i’m teaching myself programming, using python initial weapon of choice. i have learnt few basics , decided set myself challenge of asking user list of names, adding names list , writing names .csv file. below code. works. my question differently, i.e. how code improved readability , efficiency. approach situation differently, structure differently, call different functions? interested in, , appreciate great deal, feedback more experienced programmers. in particular, find parts clunky; such having specify user required format data entry. if request data (name age location) without commas however, each record, when written .csv , end 1 record per cell (excel) – not desired result. #requesting user input. guestnames = input("please enter names of guests, 1 @ time.\n"\ "once have finished entering information, please type word \"done\".\n"\ "please enter names in following format (name, age, location). ").capitalize() gues...

c++11 - C++/ name conflict: how to exclude a previously defined function -

i want write log2() function new datatype defined myself array. this #include <iostream> #include <cmath> array log2(array& a) { array c=a; (int i=0; i<a.size(); i++) c[i]=log2(a[i]); return c; } despite other functions sin, cos, etc, 1 (log2) not declared under std namespace. using following std::log2(a[i]) the compiler not resolve inside log2 suppoed built-in c function. persist use same name (log2) simplicity of code. this error message error: invalid initialization of reference of type 'array&' expression of type 'double' solved: worked when switched -std::c++ 11. std::log2 introduced in c++11. make sure have c++11 compliant compiler (e.g. gcc4.8 or later, compile -std=c++11 ), , use std::log2 inside function. if don't use std::log2 , compiler cannot find standard function (as not using namespace std; ) , tries use yours, of course not defined double s, , error. my personal opinion s...

android - Nonin Onyx II 9560 data -

i creating android app ready in pulse oximeter data using bluetooth interface. able connect , see data coming in not match of formats (13 or 2, 7,8) defined in oem spec. here data dump of getting. have idea ? thanks! hex dump of data read [54] e2 00 00 32 80 00 00 00 00 01 00 2a 50 79 00 26 "...2.......*py.&" 80 00 00 00 80 00 80 00 00 00 00 00 00 00 00 80 "................" 00 00 00 08 00 1c 05 01 00 00 94 97 01 91 00 01 "................" 01 00 00 00 00 00 "......" learnt nonin developer initial message received device. android device has respond , receive set of transactions before final measurement data received. i using hdp profile. when use hdp, have follow ieee 11073 spec. if want serial data have use spp (serial port profile).

android - Unable to access preloaded SQLite database file -

Image
i using pre loaded sqlite database android app. working fine when test on emulator. when try on real device, returns error saying: android.database.sqlite.sqliteexception: no such table: supplier i have checked database file , has table 'supplier'. i believe have placed .db file in correct location (initially misspelled , got errors db not found. fixed , error gone since). using following code , dependency. have attached screen shot database located now. please advice. dependencies { compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' } . string tablename = "supplier"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //getting database stored in assets folder try { dbhelper dbhelper = new dbhelper(this); dbhelper.getreadabledatabase(); } catch (sqliteassethelper.sqliteassetexception e) { ...

Function chaining in Erlang -

it nice create orm active record or hibernate, should process chained queries this: user = user:new():for_login(«stackoverflow_admin»):for_password(«1984»):load(). how can this? or that, in 1 line - or @ least similar in spirit , meaning. maybe there preprocessing tools can in this? although found @zxq9 answer informative, mentioning history of imitating java-like oop style in erlang helpful. method chaining needs state , there efforts include "stateful modules" erlang: parametrized module : proposal lets developer implement modules accept parameters , hold them module state use in functions. long ago had been added erlang experimental feature, technical board decided remove syntactic support feature in r16 because of both conceptual , practical incompatibilities caused. tuple module : backwards compatibility parametrized module, introduced in details in chapter 8 of programming erlang (second edition) , there no official documentation , still cont...

parse.com - Parse Cloud code written in ES6? -

can parse cloud code written in es6? currently, i'm creating 1 of cloud files this: var job = parse.object.extend("job"); parse.cloud.define("createjob", function(request, response) { var job = new job(); job.set("name", request.params.name); job.save(); response.success(); }); this shortened version of is. ideally create class this: class job extends parse.object { var name; var descriptiontext; constructor(name, descriptiontext) { this.name = name; this.descriptiontext = descriptiontext; } } parse.cloud.define("createjob", function(request, response) { var job = new job(request.params.name, request.params.descriptiontext); job.save(); }); however, doesn't work. missing or not possible? i'm ios developer looking create better javascript cloud code. you trying write parse cloud code correct? believe docs lane rettig referenced talking parse javascript sdk support es6 features such cla...

c# - modulo function -

this question has answer here: how modulus operation works float data type? 2 answers newbie in c#, trying work out simple calculation. float old x=300 float distance=300 float pitch=0.8 int sign=1 new x= old x - (sign * (distance % pitch) * 0.5 f) the value generated program new x 299.6 (which don't understand). the value (distance % pitch) 0.7999955 . if calculate manually 300 modulo 0.8 0 . guessing modulo function behaves differently float values don't know how. or calculated 300 percentage of 0.8? explanation on appreciated. never expect binary floating-point calculations (using float or double ) on decimal floating point values (e.g. 0.8 ) give exact results. the problem of decimal numbers cannot represented in binary floating-point format. can think of trying represent 1/3 in decimal notation. it's not possible. ...

entity framework - Oracle Developer Tools for VS2013 throwing object reference error -

Image
i have following installed: vs 2013 oracle 11g database oracle developer tools vs 2013 12.1.2400 odp.net 12.1.2400 ef 6 after add or select new connection when adding new ado.net entity data model, "object reference not set instance of object" error , not able add new model. this working when had devart oracle client installed (although wasn't using it). after uninstalled devart components started error. i have since uninstalled , re-installed oracle developer tools , odp.net still same error. i able connect oracle database via server explorer within vs. any ideas? it's driving me mad. i decided give on vs 2013 , installed vs 2015 planning on doing anyway. in vs 2015 got same "object reference error" when trying add new project. found thread: error message "no exports found match constraint contract name" had solution that. i installed oracle developer tools vs 2015 (the msi version) , it's working. still not wor...

What package for loading and saving images in R -

i know has been asked before existing answers seem out of date, can't install either bio7 or rimage using install.packages , searching cran repository bio7 gives 404 link (am missing something?). so of now, right packages loading / saving images in r 1 can process pixels within r? i don't need provide processing routines. long can reliably turn jpeg grid of pixel values , vice versa (and preferably same png) can write processing code. i think raster need. library(png) img <- readpng(system.file("img", "rlogo.png", package="png")) ## convert raster, interpolate =f select sample of pixels of img img.r <- as.raster(img,interpolate=f) now have vector of color: str(img.r) 'raster' chr [1:76, 1:100] "#00000000" "#0

javascript - how to create arrow down/up in css -

Image
how can create arrow point down /up in css? i tried build div: .triangle_down { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 15px solid #2f2f2f; font-size: 0; line-height: 0; float: left; } this result: . but tried build this: any suggestions? my proposal is: .triangle_down { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 15px solid #2f2f2f; font-size: 0; line-height: 0; float: left; } .triangle_down1 { position: relative; top: -5px; content: ""; display: inline-block; width: 15px; height: 15px; border-right: 0.2em solid black; border-top: 0.2em solid black; transform: rotate(135deg); margin-right: 0.5em; margin-left: 1.0em; } .triangle_up1 { position: relative; top: -5px; content: ""; display: inline-block;...

internet explorer 9 - CSS columns not working when viewing HTML file on network share -

i have simple columns approach based on list described here: how make html grid resizes fit page width? it works on local machine when viewing file on network share, in 1 big column. css in html file, no external scripts @ all. i'm using ie9 in both cases why different behaviour? after looking @ example link , corresponding jsfiddle, accepted answer uses linked stylesheet resource: bootstrap-combined.min.css. accessible here: http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css i'm guessing, somewhere in network, when file accessed, user/iis/whatever agent doesn't have rights access bootstrap file or wasn't included ftp publish. every <ul> i've ever worked has <li> 's set clear:both default. setting <ul class="inline"> , it's made child elements inline elements float left default, defined (apparently) in twitter bootstrap. it's voo-doo css me. you try setting <li...

drools - MySQL jBPM 6.2 deployment error -

after solving couple of issues switch h2 mysql jbpm 6.2; followed instructions modify 3.6.3. using own database . stuck @ error thrown while deployment . has solved this, could'nt find fix. env: wildfly 8.1 jbpm 6.2 final mysql 5.7.9 here's stack trace .failed file. "{\"jbas014671: failed services\" => {\"jboss.deployment.unit.\\\"jbpm-console.war\\\".weldstartservice\" => \"org.jboss.msc.service.startexception in service jboss.deployment.unit.\\\"jbpm-console.war\\\".weldstartservice: failed start service caused by: org.jboss.weld.exceptions.deploymentexception: exception list 1 exceptions: exception 0 : org.jboss.weld.exceptions.weldexception: weld-000049: unable invoke public void org.jbpm.executor.impl.executorservicelifecyclecontroller.init() on org.jbpm.executor.impl.executorservicelifecyclecontroller@2742ef77 @ org.jboss.weld.injection.producer.defaultlifecyclecallbackinvoker.invokemethods(defau...

curl - Using R to accept cookies to download a PDF file -

i'm getting stuck on cookies when trying download pdf. for example, if have doi pdf document on archaeology data service, resolve this landing page embedded link in pdf redirects this other link. library(httr) handle resolving doi , can extract pdf url landing page using library(xml) i'm stuck @ getting pdf itself. if this: download.file("http://archaeologydataservice.ac.uk/archiveds/archivedownload?t=arch-1352-1/dissemination/pdf/dyfed/gl44004.pdf", destfile = "tmp.pdf") then receive html file same http://archaeologydataservice.ac.uk/myads/ trying answer @ how use r download zipped file ssl page requires cookies leads me this: library(httr) terms <- "http://archaeologydataservice.ac.uk/myads/copyrights" download <- "http://archaeologydataservice.ac.uk/archiveds/archivedownload" values <- list(agree = "yes", t = "arch-1352-1/dissemination/pdf/dyfed/gl44004.pdf") # accept terms on for...

php - Inserting code into MySQL database -

so have input users enter code, paypal code more specific. , error when submitting code database. "not acceptable! appropriate representation of requested resource not found on server. error generated mod_security." so tried updating code via phpmyadmin this: update store set paypal = "codehere" and didn't work, when entered '' instead of "" works. so question is, how can adjust insert code work. here below current code: // here store input value $paypal = $_get['paypal']; if (!empty($paypal)) { $sql2 = "update store set paypal = :paypal"; $stmt1 = $connection->prepare($sql2); $stmt1->bindparam(':paypal', $paypal, pdo::param_str); $stmt1->execute(); } thanks in advance! , let me know if didn't provide enough information. you can try disabling mod_security in .htaccess file <ifmodule mod_security.c> secfilterengi...

c# - What is the algorithm behind the PDF cloud annotation? -

Image
i've noticed several pdf annotation applications (adobe acrobat, bluebeam, etc) have algorithm creating cloud pattern around polygon: when drag vertices of polygon, cloud pattern recalculated: notice how arcs recalculated wrap around polygon. not being stretched or warped. whatever algorithm used define seems industry standard. several pdf editors allow create this, , in each 1 cloud arcs same when dragging vertices. i trying create wpf sample application replicates this, can't seem find documentation anywhere generating cloud pattern. i'm quite fluent graphic design , 2d programming, , i'm capable of creating tool drag vertices around, need figuring out how draw these arcs. looks series of arcsegments in pathgeometry . so question be, what's algorithm create these arcs around polygon? or where can find documentation these industry-standard pdf patterns, drawings, and/or annotations? (cloud, arrows, borders, etc) the clouds in sketche...

android - getting string from preferences -

so have edittextpreference in preferences , want type in , save it, want text in activity . key of edittextpreference b1. tried code : sharedpreferences getprefs = preferencemanager.getdefaultsharedpreferences(getbasecontext()); string samples = getprefs.getstring("b1", ""); b1.settext(samples); <edittextpreference android:dialogtitle="button 1" android:key="b1" android:summary="set text on button 1" android:title="set text on button 1" /> i java.lang.nullpointerexception between string samples = getprefs.getstring("b1", "lol"); b1.settext(samples); try this home.java public class home extends activity { public sharedpreferences prefs; string mvalues; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { setcontentview(r.layou...

Wordpress - Own plugin - get all images of the media gallery -

i've written plugin wordpress tinymce editor , want use images have been uploaded media gallery in plugin. how can access uploaded pictures in own plugin? can't find in wordpress docs. thanks. i not clear on question. looking method access add media button? in attempts answer question -> method allows attachments in media section.. displays can manipulate way want to. reference: http://codex.wordpress.org/template_tags/get_posts $args = array( 'post_type' => 'attachment', 'numberposts' => -1); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments $attachment ) { echo apply_filters( 'the_title' , $attachment->post_title ); the_attachment_link( $attachment->id , false ); } }

c# - Form2.ShowDialog doesn't pause Form1 -

i have weird problem. whenever call second form first 1 doesn't pause private void bhelp_click(object sender, eventargs e) { helpmenu = new help(this); helpmenu.showdialog(); } i have progress bar , timers keep ticking while help still being shown. if not way pause form anyway how can ? im pausing timers in order make pausing

Conditional statement fails Rails 4 -

i developing rails app has pins assigned category when created. app has 16 categories in total. pins displayed on main index page ( except category 16 ) , user can click pin take them show page of @pin. show page has @pin , random pin selected pins in db ( except category 16 ). mentioned actions above defined in pins controller , function without error. the problem when category 16 selected , user proceeds pins show page random pin should pin category 16 only, being selected pins in db! i have set variables , conditional statements in index, , show actions achieve above, please check comments in pins controller show-action. problem code persists @ comment ====something wrong!==== please relatively new rails i'm not sure doing wrong, have spent hours trying sorts nothing has worked. pins_controller index action def index if params[:category].blank? @restricted = category.find(16) # category id 16 set var @restricted used exclude cat 16 index page in line below. @pi...

javascript - Object and array merge by map function -

i have small issue, want merge object , array map function. code is: var headers = [{ "name": "date", "dtype": "date", "dtitle": "inserta date" }, { "name": "patient", "dtype": "text", "dtitle": "insert patient name" } ]; var rows = [ [1, 2], [3, 4], [5, 6] ]; var c = 0; var item = []; var items = []; rows.map(function(v) { v.map(function(a) { h = headers[c]; h.value = a; item.push(h); c++; }); items.push(item); c = 0; }); console.log(items); finally duplicate last record rows array. don't know made mistake. try use _ each , loop same result. i want receive result ex: result = [ [ { "name":"date", "dtype":"date", "dtitle":"inserta date", "valu...

Amazon S3 and Cloud Front -

how integrate amazon cloud front , s3 in photo sharing application? i upload s3, , return cloudfront url has not been successful because appears there latency between s3 , cloudfront such returned url not valid. does know how can work around this? facebook uses akamai , if upload image available. would appreciate ideas on this. you must trying fetch object immediately through cloudfront. i'm unsure why might be, hitting limits of s3's eventual consistency model . when upload object, message takes tiny amount of time propagate across s3 service. under 1 second , hard detect. (in previous life job, found reasonably guarantee files arrived within 10 seconds, , 99.9% within 1 second) here's official word aws; it's worth reading whole page : a process writes new object amazon s3 , lists keys within bucket. until change propagated, object might not appear in list. there's longer discussion on stackoverflow question ; assuming using stand...

How to use Makefile in docker-machine -

like window or osx, docker-machine used start linux env, make not installed. have makefile pull/build/start docker, not run. how solve this? the boot2docker vm based on tiny core linux , install package use tce-load : docker-machine ssh <profile> tce-load -wi make to search packages can use interactive tce tool.

c# - how to write the value to each matrix index -

for example, have set formula find xnew[k+1], ynew[k+1] , anew[k+1] . how pass value 3 1 matrix if want index 1,1 xnew[k+1] , index 1,2 ynew[k+1] , index 1,3 anew[k+1] . here's got far. for (k = 0; k < 5; k++) { xnew[k+1] = cx + (t * mpcv[k]) * math.cos(ca); ynew[k+1] = cy + (t * mpcv[k]) * math.sin(ca); anew[k+1] = ca + (t * mpcw[k]); double[,] qk = new double[3, 1]; int i, j; (i = 0; < 3; i++) { (j = 0; j < 1; j++) { qk[i, j] = 1; } } } thank help. suposing xnew[k+1] , ynew[k+1] , anew[k+1] doubles: for ( k = 0; k < 5; k++ ) { xnew[k + 1] = cx + (t * mpcv[k]) * math.cos(ca); ynew[k + 1] = cy + (t * mpcv[k]) * math.sin(ca); anew[k + 1] = ca + (t * mpcw[k]); double[,] qk = { { xnew[k + 1] , ynew[k + 1] , anew[k + 1] } }; } this make 1x3 matrix (arrays start in 0) with: qk[0,0] = xnew[k+1] qk[0,1] = ynew[k+1] qk[0,2] = anew[k+1] but if want ...