Posts

Showing posts from March, 2011

Sending serial data to Arduino using RXTX Java library -

i have code reads line of serial data arduino. have arduino set send out whatever data reads in, or if there no data read send out "no data". receiving "no data" java console fine, , arduino code works expected when using terminal. cannot java send data arduino, have tried various methods no luck :( ideally serial event method used send data great. (the receive 1 working). any appreciated, code shown below: public class serialcomm implements serialporteventlistener { serialport serialport; /** port we're going use. */ private static final string port_names[] = { "/dev/tty.usbserial-a9007ux1", // mac os x "/dev/ttyacm0", // raspberry pi "/dev/ttyusb0", // linux "com3", // windows }; /** * bufferedreader fed inputstreamreader * converting bytes characters * making displayed results codepage independent */ private bufferedreader input; /** output stream port */ privat

ckeditor - Ck-editor i had added ck-editor with div contenteditable="true" when i scroll the page it is floting up and down.how to fix it on the top of div -

how fix ck-editor on top of content editable="true" div , fix width of ck editor.ck-editor floating , down side of div. thanks in advance. just search in ckeditor.js [ case "bottom":f("absolute","top" ] , replace third parameter of function [ b.y-n-o ] done.

sql - Match Against... SEMI-Literall -

i want match-against query in words of string must necessary in field, needs accept mistakes or words uncomplete. my actual script this: $search= '+'.str_replace(" ","% +",$_post["searchtext"]); with convert "this text" "+this +is +my +text" words necessary in search, , make $query = $dbh->prepare("select name,surname match (name,surname) against (:search in boolean mode) coincidences users match (name,surname) against (:search2 in boolean mode) order coincidences"); $query->execute(array('search' => $search,'search2' => $search)); the problem if in db there "stephen hawking" , search "stephen hawk" wont appear... how can fix this? thank much its done... $search= '+'.str_replace(" ","* +",$_post["searchtext"]).'*'; :d

java - Convert String into a two dimensional array -

i try convert string s=[[4, 2, 2, 4], [3, 4, 5, 6], [6, 7, 8, 9], [3, 2, 1, 4]] 2 dimensional array this {4, 2, 2, 4}, {3, 4, 5, 6}, {6, 7, 8,9}, {3, 2, 1, 4} by use code int e=s.replaceall("\\[", "").replaceall(" ","").replaceall("],","]").length(); string[] rows1 = s.replaceall("\\[", "").replaceall(" ","").replaceall("],","]").substring(0, e-2).split("]"); string[][] matrix1 = new string[4][4]; int r1 = 0; (string row1 : rows1) { matrix[r1++] = row1.split(","); } system.out.println(arrays.deeptostring(matrix1)); but have problem exception in thread "main" java.lang.arrayindexoutofboundsexception: 3 @ test.main(test.java:94) can me find solution? i think code you. read comments carefully. string s="[[4, 2, 2,

mysql - Is this a t sql stored proceedure -

i want execute within excel (sql query window) execute select statement. should make stored proceedure , execute tat within excel? begin try drop table globalshop.dbo.v_order_hist_dtl_quote end try begin catch end catch begin try drop table globalshop.dbo.v_order_lines_quote end try begin catch end catch select * globalshop.dbo.v_order_hist_dtl_quote globalshop.dbo.v_order_hist_dtl isnull(user_3,'') <> '' select * globalshop.dbo.v_order_lines_quote globalshop.dbo.v_order_lines isnull(user_3,'') <> '' /* quotes orders 1.0 */ select qt.quotenum, qt.custid, qt.qcustnum, qt.qcustname, qt.qdate, count(ol.order_no) #_open_orders, count(oh.order_no) #_closed_orders "track quotes".dbo.trackquoteshist qt left outer join globalshop.dbo.v_order_hist_dtl_quote oh on qt.quotenum = oh.user_3 left outer join globalshop.dbo.v_order_lines_quote ol on qt.quotenum = ol.user_3 qt.qdate between '03/01/

active directory - How to synch LDAP users and groups when LDAP does not support Unique Identifier? -

i import reference ldap users , groups database. therefore, need synch these users , groups periodically. it clear me how synch these object when ldap supports unique identifier (uid). example active directory support objectguid attribute. in case when user (or group) moved other place in ldap tree , therefore dn changed still can find using uid , update user. what when ldap not support uid , dn changed? if looking using old dn can not find user (or group) , need remove user. but how can distinguish between use cases when user moved other place in ldap tree (its dn changed) , user deleted ldap? when moved should find , update new dn. when deleted need remove it. i not know how it. can use username (login name) user synchronization? what should use ldap group? in case want support multiple ldap servers sensible option making id configurable, i.e. ask users unique attribute during deployment. work in 100% of cases if customers use ldap authentication, sinc

mod rewrite - Apache ModRewrite Issues .htaccess -

i attempting create mod rewrite change following: https://example.com/app/landing https://example.com?keyword=landing , https://example.com/app/adwords https://example.com?keyword=adwords however, have not been able so. using codeiginter requires few rules in place prevent index.php? in url, therfore unsure whether or not creating problem. here current code: rewriteengine on rewritebase /app/ try 1: rewriterule landing https://example.com/?keyword=landing [r] try 2: rewriterule ^landing?/ https://example.com/?keyword=landing [r] try 3: rewriterule ^landing?/ https://example.com/?keyword=landing [r] #removes access system folder users. #additionally allow create system.php controller, #previously not have been possible. #'system' can replaced if have renamed system folder. rewritecond %{request_uri} ^system.* rewriterule ^(.*)$ /index.php?/$1 [l] #when application folder isn't in system folder #this snippet prevents user access application folder #submitt

statistics - Data Mining and Unbalanced Classes -

i have unbalanced classes of records , data following: x y z class 1 4 3 5 7 6 8 7 excellent 4 8 pass 3 7 34 6 1 5 4 3 excellent b 4 4 excellent b i want predict class: what best data mining techniques? i used decision tree unfortunately faced problem of unbalanced record , wasn't able classify data i'd recommend looking smote (synthetic minority oversampling technique). technique randomly selects, replacement, set of minority instances within training dataset. these selected instances added duplicates training dataset resulting in more balanced classes , thereby preventing classifier learning predict majority class. depending on software or module using, , whether or not need use decision trees specifically, there may other options. instance, svms (again depending on software or module used) accompanied ability specify class-s

android - How Can I display a event when the user keep touch in a Listview? -

i have seen in app when user keep touch in listview show action delete or anything. for when user keep touch can use listener onitemlongclick have this: listview.setonitemlongclicklistener(new onitemlongclicklistener() { public boolean onitemlongclick(adapterview<?> arg0, view arg1, int pos, long id) { // show action. } });

iis - Force SSL with exceptions in web.config -

i have following in web.config force ssl, need exclude specific paths being forced. <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webserver> <rewrite> <rules> <rule name="redirect https http" stopprocessing="true"> <match url="(.*)" /> <conditions> <add input="{https}" pattern="^off$" /> </conditions> <action type="redirect" url="https://{http_host}/{r:1}" redirecttype="seeother" /> </rule> </rules> </rewrite> </system.webserver> </configuration> i've tried changing match url have specific path inverted appears not caught. examples: site.com/app/default.aspx - force ssl site.com/

jquery - Cannot set custom request header on ajax calls from my local developing server -

Image
im trying set local dev js client call remote server serves rest api. server functional , tested. when try execute javascript locally cannot set custom headers. im aware of cross domain policy, , fix im executing chrome using --disable-web-security allow cross domain calls. calls going, when check request header there no trace of custom headers. im setting 2 headers in dev server using jquery im setting them in production: var ajaxoptions = { ajax: { headers: { 'x-app-key': appkey, 'x-auth-token': token }, //and other stuff my api respond , error telling me header missing, , checking console cant see where: what missing? yep, struggling now, , appears there no way set custom header cross domain ajax request unless have cors set on server. custom headers trigger preflight request, see here http://techblog.constantcontact.com/software-development/using-cors-for-cross-domain-ajax-requests/

Horizontal scroll in multi layer drop down meny (css) -

i have multi drop down menu several layers in css, , vertical scroll longer parts. problem when hover part in submenu leads submenu, new submenu confined within "box" created first submenu (and overflow) , have scroll horizontally see new submenu, instead of appearing next old submenu. how create new "box" outside first 1 instead of inside it, never have scroll horizontally when have several submenus , subsubmenus? this simplified version of code (the part controls appearance of submenus): #navbar li ul { display: none; max-height:800px; overflow-y:auto; min-width: 160px; max-width:auto; } and code controls display of more submenus when hovering element: #navbar li:hover ul, #navbar li.hover ul { display: block; position: absolute; margin: 0; padding: 0; z-index: 20000; -o-transition: 1.7s ease-out 1s; -webkit-transition: 1.7s ease-out 1s; -moz-transition: 1.7s ease-out 1s; }

R Neural Networks - Weights -

i have error message when use weights in nnet() though package documentation says weights. however, if use wts works. suppose weight defaults 1 if don't enter value. regardless of wts value enter nnet() return weights = 83 , how 83 weights assigned ?. please @ output below: i suppose don't understand how these weights assigned any appreciated. thank you. attach(iris) library(caret) set.seed(3456) trainindex <- createdatapartition(iris$species, p = .8, list = f, times = 1) iristrain <- iris[ trainindex,] iristest <- iris[-trainindex,] irispred <- nnet(species ~ ., data=iristrain ,weights = 1, size=10) predicted <- predict(irispred,iristest,type="class") error when using weights (package documentations says use weights) irispred <- nnet(species ~ ., data=iristrain ,weights = 1, size=10) error in model.frame.default(formula = species ~ ., data = iristrain, : variable

Doxygen duplicate documentation from @file and @defgroup -

i'm using doxygen document project. in 1 file, have bunch of public functions want put in group. follows: /** @file myfile.c @brief file. has stuff. */ /** @defgroup my_group group myfile.c stuff @{ */ //code & stuff documentation /** @} */ the issue latex output contains of documentation here twice; once in "module documentation" section , again in "file documentation" section. amounts maybe 25 pages of purely duplicate stuff in end pdf file (generated latex). an ideal fix have file documentation myfile.c "see @ref my_group" or that. there way accomplish in doxygen? acceptable solution found: create doxygen layout xml file , configure doxygen use ( instructions ) open xml file; find <group> tag; comment out <detaileddescription> , <memberdef> sections this resulted in list of members being produced in "module documentation," hyperlinks full member documentation within &q

java - Can't open an activity in android -

i have problems android programming. trying open activity on phone, fails. says unfortunately program has stopped. not know how solve this, try connect method below. appreciated. please ask if did not specify enough. public void addglossary(view v){ intent intent = new intent (this, addglossary.class); button buttonzero = (button) findviewbyid(r.id.buttonzero); startactivity(intent); } here code activity: public abstract class addglossary extends activity implements onclicklistener, oninitlistener { private int my_data_check_code = 0; private texttospeech mytts; private mediaplayer mmediaplayer; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_add_glossary); button speakbutton = (button)findviewbyid(r.id.speak); speakbutton.setonclicklistener(this); intent checkttsintent = new intent(); checkttsintent.se

jquery - JavaScript animation is never executed -

pretty simple sliding animation, when click tallarrowsright div, nothing happens. looking on obvious? $(document).ready(function(){ var = 3; var current = 1; $(".tallarrowsright").click(function(){ if(current<all){ $(".slideme").animate({left:"-=1000"},500) current = current+1 } }) i believe it's not animation problem, css issue. try add position:relative .slideme working code here just click "basic plunk!" :)

python - Trouble installing pygame using pip install -

i tried: c:/python34/scripts/pip install http://bitbucket.org/pygame/pygame and got error: cannot unpack file c:\users\marius\appdata\local\temp\pip-b60d5tho-unpack\pygame (downloaded c:\users\marius\appdata\local\temp\pip-rqmpq4tz-build, conte nt-type: text/html; charset=utf-8); cannot detect archive format cannot determine archive format of c:\users\marius\appdata\local\temp\pip-rqmp q4tz-build please if have solutions please feel free share them! tried pip install --allow-unverified , gave me error well. this method works me. pip install pygame==1.9.1release --allow-external pygame --allow-unverified pygame -- these steps lead me command (i put them people finds easily): $ pip install pygame collecting pygame not find downloads satisfy requirement pygame externally hosted files ignored access them may unreliable (use --allow-external pygame allow). no distributions @ found pygame then, suggestes allow external: $ pip install pygame --allow-e

apache spark - How to calculate difference of time between two records using Scala? -

i want calculate time difference between events of session using scala. -- given source csv file shown below: header "session","events","timestamp","records" data "session_1","event_1","2015-01-01 10:10:00",100 "session_1","event_2","2015-01-01 11:00:00",500 "session_1","event_3","2015-01-01 11:30:00",300 "session_1","event_4","2015-01-01 11:45:00",300 "session_2","event_1","2015-01-01 10:10:00",100 "session_2","event_2","2015-01-01 11:00:00",500 required output header "session","events","time_spent_in_minutes","total_records" data "session_1","event_1","50",100 "session_1","event_2","30",600 "session_1","event_3","15",900 &quo

oracle - ORA-12514 TNS:listener does not currently know of service requested in connect descriptor error -

i have windows server on virtual machine build 2 years ago. installed oracle database , sql server on it. worked fine. last 2 days try use oracle database , got error: ora-12514 tns:listener not know of service requested in connect descriptor i checked listener.ora , tnsnames.ora , couldn't found error. listener.ora sid_list_listener = (sid_list = (sid_desc = (sid_name = plsextproc) (oracle_home = c:\oraclexe\app\oracle\product\11.2.0\server) (program = extproc) ) (sid_desc = (sid_name = clrextproc) (oracle_home = c:\oraclexe\app\oracle\product\11.2.0\server) (program = extproc) ) ) listener = (description_list = (description = (address = (protocol = ipc)(key = extproc1)) (address = (protocol = tcp)(host = this_is_my_host_name_or_ip)(port = 1521)) ) ) default_service_listener = (xe) and tnsnames.ora main_database = (description = (addre

c++ - Passing a const reference of std::pair to a function -

i wrote following. however, i'm confused managed compile. did, have questions... void tree_walk(const std::pair<tree, node> &tree_root) { tree t = tree_root.first; node current = tree_root.second; // code walks tree, updating current go along. } i'm wondering if calling tree.first copies tree? semantics of passing std::pair reference? tree_rooting.first not copy anything, but tree t = tree_root.first; does. if not want copy tree, can do const tree &t = tree_root.first; to answer second question: correctly passed pair function const reference. if want modify input, leave out const in functions signature pass non- const reference.

python - How to change the linewidth of hatch in matplotlib? -

is there way increase width of hatch in matplotlib? for example, following code specifying linewidth changes width of edge. want change linewidth of line used hatch. import matplotlib.pyplot plt import numpy np x = np.random.randn(100) fig = plt.figure() ax = fig.add_subplot(111) ax.hist(x, fill=false, hatch='/', linewidth=2) plt.show() as of matplotlib version 2.0, can directly change linewidth parameter , follows: import matplotlib mpl mpl.rcparams['hatch.linewidth'] = 0.1 # previous pdf hatch linewidth mpl.rcparams['hatch.linewidth'] = 1.0 # previous svg hatch linewidth this seems better workaround folks have above. can check matplotlib version by: import matplotlib mpl print(mpl.__version__) # should 2.x.y

c++ - What my customized compare does not work? -

i wrote compare operator below: struct greaterthan { bool operator() (string a, string b) { if (a.length() == 1 && a[0] == b[0]) //line1 { return true; } if (b.length() == 1 && b[0] == a[0]) //line2 { return true; } return a.compare(b) == 1 ? true : false; } }; vector<string> v{"2", "20", "5", "7"}; sort(v.begin(), v.end(), greaterthan()); the purpose of line1 , line2 make "2" ahead of "20" when sorting. causes runtime error. error "invalid operator<" on visual studio. the return value of std::string::compare doesn't have 1 when a "greater than" b . has greater 0 . instead of return a.compare(b) == 1 ? true : false; i think need: return (a.compare(b) < 0);

java - How to have Jackson use a method to serialize a class to JSON? -

let's have following classes: public class myclass { private test t; public myclass() { t = new test(50); } } public class test { private int test; public test(int test) { this.test = test; } public string tocustomstring() { return test + "." + test; } } when jackson serializes instance of myclass , following: {"t":{"test":50}} is there annotation can put in test class force jackson invoke tocustomstring() method whenever serializing test object? i'd see 1 of following outputs when jackson serializes instance of myclass : {"t":"50.50"} {"t":{"test":"50.50"}} if want produce {"t":"50.50"} you can use @jsonvalue indicates that results of annotated "getter" method (which means signature must of getters; non-void return type, no args) used single value serialize instance.

jquery - Why am I inserting NULL values into a MySQL table with PHP? -

i have been assigned create web page school project posts data table called 'studyabroad' in mysql database . right of values inserting null (the default values) , can't identify why references html select/option tags not working. assignment has been first exposure php , have limited knowledge of language. the code uses jquery populate cascading dropdowns country , continent @ time. i intending code insert studyid , term ( semester student studied abroad), studentid (which session variable), name of country student studied in, , continent country located on. studyabroad table structure: name type null default studyid int(11) no none auto-increment term varchar(15) yes null studentid varchar(37) yes null countryname varchar(75) yes null continent varchar(15) yes null php, jquery, , html code: <?php if(isset($_post['submit'])) { upload()

How to build search by means ElasticSearch in PHP? -

i search tutorial or examples how build search means elasticsearch in php. there not lot examples in network. have read basic information elasticsearch , had started try. use php library. now problem in adding information in elasticsearch after search. how create index , add data it? example need create search of school-friends name hobby , country. somebody can share own experience? this should work, try read on official documentation. docs

c# - How do I edit a FormCollection value, and then use TryUpdateModel with the edited collection? -

mvc5 storing passwords in plaintext. don't want use default hashing algorithm, i'm required use e.encrypt() instead. i'm creating registration function, , need know how can edit values formcollection before using tryupdatemodel . here's code: [httppost] public actionresult register([bind(include = "user,pass,email")] formcollection form) { var user = new users(); string hash = e.encrypt(form["pass"]); // gets set. if (tryupdatemodel(user, form)) { context.entry(user).state = entitystate.added; context.savechanges(); return redirecttoaction("login", "account"); } return view(); } i've searched high , low, , i've found irrelevant needs. i've tried this: form["password"] = e.encrypt(form["password"]) ...and compiles, when debugging, value never gets set. e.encrypt() work function, it&

xcode - Swift 1.2 StringLiteralConvertable error -

i updated xcode 6.3 swift 1.2, , received on 300 errors, of involved adding exclamation point. 1 type of issue not go away, however, error "'_' not convertible 'stringliteralconvertable'". appears multiple times, in these situations: pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":user.objectid, "key":"won", "value":won anyobject],block:nil) pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":friend.objectid, "key":"parties", "value":played], block:nil) pfcloud.callfunctioninbackground("modifyuser", withparameters: ["objectid":creator.objectid, "key":"left", "value" :left], block: { (error) in self.remainingpotatos = pfuser.currentuser()["left"] as! int }) the error appears on strings keys of dictionary, howeve

Changing display name of an Android app by modifying its apk file - (Android 5.0) -

i trying change display name of android file (the name shown on screen once app installed). have apk file*. when unzip apk file, it's partially binarized. know change display name, have change androidmanifest.xml file, file partially in binary. if unzip application, change (or nothing!), zip up, sign , zipalign it, application not work anymore. doesn't install, crashes while trying, claiming parse error - there problem while parsing package. if unzip application using apktool , change (or nothing) , rezip using apktool b apkfolder -o changedapk.apk , sign , zipalign it, app install, changes seem present, app crashes moment opens up. stacktrace seems indicate following problem: f/monodroid(12679): no assemblies found in '(null)' or '/storage/emulated/0/android/data/geocortex.app/files/.__override__'. assuming part of fast deployment. exiting... if rezip application using apktool b apkfolder (thus place changes in original apk file), sign , zipalig

php - Call Permalink in Wordpress Counter -

i'm using code found in internet count facebook shares, i'm not able call permalink i'm using. the function: <?php $facebook_like_share_count = function ( $url ) { $api = file_get_contents( 'http://graph.facebook.com/?id=' . $url ); $count = json_decode( $api ); return $count->shares; }; ?> the call: <?php echo $facebook_like_share_count( 'http://www.someurl.com' ); ?> my permalink: <?php the_job_permalink(); ?> i tried many ways , none worked.

xml parsing - How to create a xml file with specific structure using Php and Mysql? -

this question has answer here: using simplexml create xml object scratch 3 answers $sql = "select * users order rand() limit 100"; $xml = new simplexmlelement('<xml/>'); $result = $conn->query($sql); if ($result->num_rows > 0) { while ($row = $result->fetch_array()) { $users = $xml->addchild('users'); $users->addchild('id',$row['sno']); $users->addchild('lat',$row['lat']); $users->addchild('long',$row['lng']); $users->addchild('address',$row['address']); } $conn->close(); //create xml file $fp = fopen("users100r.xml","wb"); //write xml nodes fwrite($fp,$xml->asxml()); fclose($fp); echo $xml->savexml(); ?> i want create xml file using above co

javascript - Why is the body of my ajax multipart/form-data POST request empty? -

i have following form in html: <form id="formid" action="upload" method="post" enctype="multipart/form-data"> <input type="file" name="file"> </form> i submit post request via ajax follows: function upload_ajax(){ var xhr = new xmlhttprequest(); var form = $("#formid"); var formdata = new formdata(form); xhr.open("post", form.attr('action') , true); xhr.send(formdata); } but when select file , run upload_ajax(), file not sent server. on examining post request can see body empty (except boundary:------webkitformboundaryzrrtlc7acnj5mkte--). everything works fine if replace upload_ajax() upload_normal() below: function upload_normal(){ $('#formid').submit(); } can understand doing wrong in ajax call? i think error $("#formid") jquery object , not form. to access form write: var form = $("#formid")[0];

java - Loading Panel Contents Dynamically -

i have developed template gui wanna reuse , purpose added panel empty in template , wanna load things dynamically. assuming below code: public class tempgui extends jframe{ public tempgui(jpanel dynamicpanel){ initcomponents(); this.dynamicpanel = dynamicpanel; } ... } this not seem working panel not changed. think should normal, there way components of dynamic panel , set them inside form ? all this.dynamicpanel = dynamicpanel; make instance field, this.dynamicpanel point ever parameter dynamicpanel is. if parameter not on screen in anyway, no see anything. in fact, not affect ever this.dynamicpanel pointing to. instead, consider adding parameter container... public class tempgui extends jframe{ public tempgui(jpanel dynamicpanel){ initcomponents(); this.dynamicpanel.add(dynamicpanel); } ... } but you'd need change things around bit, have dynamicpanelcontent (which replace this.dynamicpan

c - Address family of socket is mentioned in structure and socket creation why? -

my doubt on code of lines in socket program. family of address specified in serv_addr.sin_family = af_inet; sockaddr_in structure, why should mention same in socket(af_inet, sock_stream, 0); socket creation. family address in 2 sentence mean? struct sockaddr_in serv_addr; listenfd = socket(af_inet, sock_stream, 0);//here serv_addr.sin_family = af_inet;//and here serv_addr.sin_addr.s_addr = htonl(inaddr_any); socket() creates new socket. needs know address family knows kind of addresses allowed work with, whether ipv4, ipv6, ipx, netlink, etc. address family dictates layout , format address values. instance, af_inet allows ipv4 addresses, whereas af_inet6 allows ipv6 addresses (and ipv4 addresses if socket set dual-stack mode on platforms support feature). every sockaddr_... structure has family field. sockaddr_... structures can passed around various functions, need know type of address receiving input, , can specify type of address returning output. th

java - CXF RS: How do I tell the application to use my custom ExceptionMapper? -

i found this documentation documents how use exceptionmapper . doesn't provide information on how tell webapp should use it. how configure that? you can in spring configuration file this: <jaxrs:server id="foo" address="/v2"> <jaxrs:providers> <bean class="com.myexceptionmapper"/> </jaxrs:providers> </jaxrs:server>

Copying files from one directory to another in java throws NoSuchFileException -

i have hashset of strings, names of files want copy working direcorory "path" directory. find following piece of code should working, however, java.nio.file.nosuchfileexception: /commits/1/hello.txt exception. hashset<string> stagedqueue = hashset<string>(); stagedqueue.put("hello.txt"); stagedqueue.put("bye.txt"); string path = "/commits/" + commitid; (string file : stagedqueue) { files.copy((new file(file).topath()), (new file(path + "/" + file).topath())); what can fix this? can't figure out why getting these exceptions. please note moving these empty directory. don't go through file ; use java.nio.file. your problem here try , copy initial file directory not exist yet: string path = "/commits/" + commitid; first of all, destination directory, call dstdir , instance. create base directory , copy files it:

angularjs - " =? " in Angular Directive Isolate Scope -

scope: { someproperty: "=?" somepropertytwo: =?wheeeeee } what "=?" do? can't find answer anywhere. understand using scope: {} (or scope: true) gives directive new scope, former being isolate scope , latter being one-way binded parent ctrl (ctrl of page/view on directive used). understand that: someprop: @x //will one-way bind someprop parent ctrl's x someprop: =x //two-way someprop: &x() //some space magic binding methods however, don't understand how/why " =? " used. relevant articles (that cover first three): http://www.undefinednull.com/2014/02/11/mastering-the-scope-of-a-directive-in-angularjs/ http://weblogs.asp.net/dwahlin/creating-custom-angularjs-directives-part-2-isolate-scope edit: same these? ? - attempt locate required controller or pass null link fn if not found. ^ - locate required controller searching element , parents. throw error if not found. https://docs.angularjs.org/api/ng/service/ $compile#-re

ember.js - Custom Ember CLI addon not installing properly -

i've taken stab @ building ember cli addon share world. purpose of addon firebase authenticator ember simple auth. i've gotten code working, after packaging addon according ember cli documentation few tutorials, i'm running issues. first, when install addon directly repo or npm, following output: jamesdixon$ ember install ember-cli-simple-auth-firebase version: 0.2.3 installed packages tooling via npm. installing installing browser packages via bower... cached git://github.com/simplabs/ember-simple-auth- component.git#0.7.3 cached git://github.com/firebase/firebase-bower.git#2.2.3 installed browser packages via bower. installing "ember generate" command requires entity name specified. more details, use "ember help". after install, when looking @ application directory, see addon has been installed under npm_modules , proper bower packages have been installed under bower_components directory. unfortunately, none of code under app directo

mysql - Trying to pass an authenticated user to DB controller in nodejs with bookshelf -

i creating web app first allows user login using credentials stored in mysql database. then, when go /crm trying pass field value, specifies database user has access, through instantiate bookshelf/knex database connection. crmdb.js var knex= require('knex')({ client: 'mysql', connection:{ host: 'localhost', // host user: 'the user', // database user password: 'the password, // database password database: req.user.db, // database name per user.db field charset: 'utf8_general_ci' } }); var bookshelf = require('bookshelf')(knex); module.exports.crmdb = bookshelf; can this? put in route? var crm = function (req, res, next) { if(req.isauthenticated()){ } else { res.redirect('/signin'); } } in route.js var crm = function (req, res, next) { if(req.isauthenticated()){ var user = req.user; module.exports = {

automated tests - Get link from text input field and then open it with DalekJS -

i have issue link need traverse using dalekjs not clickable, rather copy/pastable. how can retrieve value input field in browser , use in test.open() call? <table> <tbody> <tr> <td>link 1</td> <td><input type="text" value="http://example.com/link-1" class="start-link"></td> </tr> <tr> <td>link 2</td> <td><input type="text" value="http://example.com/link-2" class="start-link"></td> <tr> </table> in example above dalekjs dynamically run test.open('http://example.com/link-1'); during progression of test. module.exports = { 'a test case': function (test) { test.open('http://example.com/example-from-above.html') .open('http://example.com/link-1') //this link i'm trying retrieve dyn

Release IOS app for only specified client group -

my team developing ios app used specified users customer of our hardware product(sensors being used in manufacturing). can release app through normal apple app approval procedure , adopted app store? or apple disallow kind of app targeting specified customer group put in public app store? if can not put public store, method release app customers? you allowed put on app store long doesn't use private apple api. if prefer not on app store, can enroll apple's ios enterprise developer program allows ad-hoc distribution (at costly price $$$). recommended if app specific target group , outside of group, app's useless, better release internal app instead of on public app store.

linux - Shell scripting practicing environment. -

i want learn linux , shell scripting out installing linux on machine. used linuzoo.com site provides environment practicing machine not open terminal. i'm not entirely sure question - asking (1) how practice or (2) why linuzoo.com giving problems? regardless, i'd recommend using virtual machine, instead of kind of simulator or phony shell. there's no substitute real linux environment. virtualbox extremely powerful, free, , open-source virtualization environment, i'd start there.

Cakephp 2.0, controller doesn't see model -

i'm busy upgrading site client of mine. it's first time working cakephp , i'm running issues. i created table named banners inside database, , made following files: model/banner.php controllers/bannerscontroller.php view/banners/admin_index.ctp it seems controller can't find model. whenever try load page admin_index.ctp following message: error: internal error has occurred. if replace contents of public admin_index() , make echo text, work. i tried adding form admin_index.ctp doing this echo $this->form->create('banner'); this gives me error: internal error has occurred. i have set model, controller, view , database way others posts, pages, etc set , can't seem work. have idea on how fix this? kind regards, nick <?php class banner extends appmodel { } ?> <?php class bannerscontroller extends appcontroller { public $helpers = array('html', 'form'); public function admin_index(){ $banners = $

ios - Swift Xcode "EXC_BAD_INSTRUCTION" -

when try run game fatal error: unexpectedly found nil while unwrapping optional value with thread error exc_bad_instruction (code=exc_i386_invop, subcode=0x0)" this happens on line of code highscorelbl.text = nsstring(format: "highscore : %i", highscore) in gamescene import spritekit class gamescene: skscene, skphysicscontactdelegate { var movingground: csmovingground! var hero: cshero! var cloudgenerator: cscloudgenerator! var wallgenerator: cswallgenerator! var wall: cswall! var scorelabel = uilabel() var score = int() var isstarted = false var herocategory: uint32 = 1<<1 var wallcategory: uint32 = 1<<2 var groundcategory: uint32 = 1<<2 var inviscategory: uint32 = 1<<3 let walls = cswall() var highscorelbl: uilabel! var highscore = 0 override func didmovetoview(view: skview) { backgroundcolor = uicolor(red: 159.0/255.0, green: 201.0/255, blue: 244.0/255.0, alpha: 1.0) /* let backgroundtexture = sktexture(im

markdown - prevent pandoc from converting $ into mediawiki <math> -

i converting markdown file mediawiki table using pandoc: content of file mtcars.md : | |c1 |c2 | |:--|:----|:--| |7 |p$a |a | |8 |ab |b | |9 |p$a |c | then (i using ubuntu 64 bits , pandoc version 1.13.2) pandoc -t mediawiki -o mtcars.txt mtcars.md but 2 $ signs interpreted <math>...</math> : {| ! !c1 !c2 |- |7 |p<math>a |a | |8 |ab |b | |9 |p</math>a |c |} how can dollar signs instead? the pandoc documentation says: anything between 2 $ characters treated tex math. opening $ must have non-space character right, while closing $ must have non-space character left, , must not followed digit. thus, $20,000 , $30,000 won’t parse math. if reason need enclose text in literal $ characters, backslash-escape them , won’t treated math delimiters. so, 1 way put backslash in front of $: | |c1 |c2 | |:--|:----|:--| |7 |p\$a |a | |8 |ab |b | |9 |p\$a |c | output: | |c1 |c2 | |:--|:----|:--| |7 |p$a |

intellij idea - UNEXPECTED TOP-LEVEL EXCEPTION in Android Studio with apache libraries -

i working on project upload file server because of using apache libraries. getting following error when try build project error:execution failed task ':app:dexdebug'. com.android.ide.common.internal.loggederrorexception: failed run command: c:\documents , settings\rohitkum\appdata\local\android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output c:\documents , settings\rohitkum\androidstudioprojects\nfcdemo\app\build\intermediates\dex\debug --input-list=c:\documents , settings\rohitkum\androidstudioprojects\nfcdemo\app\build\intermediates\tmp\dex\debug\inputlist.txt error code: 2 output: unexpected top-level exception: com.android.dex.dexexception: multiple dex files define lorg/apache/http/consts; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535)