Posts

Showing posts from April, 2012

gcc - Error: "undefined reference to ‘__udivsmodsi4" when switching compilers in Contiki 2.6 -

i switching contiki 2.7 contiki 2.6 have found sky-shell-exec example not build msp430-gcc 4.5.3 in contiki 2.6. around while using contiki 2.6 trying install msp430-gcc 4.6.3. i have downloaded deb package 4.6.3 http://helpdesk.jogjaprov.go.id/ubuntu/pool/universe/g/gcc-msp430/ and have used following commands try , install it: sudo apt-get remove gcc* sudo apt-get remove gcc-msp430 sudo dpkg --force-all -i ~/downloads/gcc-msp430_4.6.3~mspgcc-20120406-3_i386.deb sudo apt-get -f install when msp430-gcc --version returns: msp430-gcc (gcc) 4.6.3 20120301 (mspgcc lts 20120406 unpatched) so seems has worked... however, when try make sky-shell-exec.sky target=sky in examples/sky-shell-exec/ 2 following error: usr/lib/gcc/msp430/4.6.3/../../../../msp430/lib/mmpy-16/libc.a(vuprintf.o): in function `vuprintf': /build/buildd/msp430-libc-20110612/src/./stdlib/vuprintf.c:387: undefined reference `__udivmodsi4' /build/buildd/msp430-libc-20110612/src/./stdlib/vuprintf...

c - passing a pipe as an argument to sort -m -

i wondering if possible send multiple pipes lets 3 arguments merged sort -m in c. for example execvp("sort", "sort", "-m", pipe1_read_end, pipe2_read_end, null) if targeting linux, can pass strings of form: /dev/fd/<number> ...representing pipes, <number> is, of course, fd table entry number file descriptor in question. in fact, bash if run sort -m <(something) <(something) for more os-agnostic solution, 1 typically uses named fifos (and bash <() construct if detects it's on operating system doesn't provide /dev/fd/ ).

Wrong setter called by jsf -

my problem is: the first setter not second setter call, not undestand? lets go my managed bean: public class managedbean { public pessoa getpersonbyparam(string a){ return hash.get(a); } } my page: <h:inputtext value="#{mbean.getpersonbyparam(param).name}"> </h:inputtext> my model: public class person { private long id; private string name; // getter / setter } my stack: servlet.service() servlet faces servlet threw exception: javax.el.propertynotfoundexception:/time.xhtml @37,82 value="# {mbean.getpersonbyparam(param).name}": /time.xhtml @35,74 value="# {mbean.getpersonbyparam(param).name}": class 'br.com.diario.test.managedbean' not have property 'getpersonbyparam'. any idea? from el expression can access array, hashmap , treemap. better if declare hashmap property, way can access in xhtml page. example java code public class managedbean { hashmap<s...

java - Deployment Failed Exception in JBOSS -

i deploying project 'sample' in jboss using eclipse, gives error deployment failed. whole stack trace follows. using jboss 6 version eclipse indigo. jsf project. 10:34:45,871 error [org.jboss.kernel.plugins.dependency.abstractkernelcontroller] error installing start: name=jboss.web.deployment:war=/sample state=create mode=manual requiredstate=installed: org.jboss.deployers.spi.deploymentexception: url file:/e:/jboss-6.1.0.final/server/default/tmp/vfs/automount65c745c10686c9d/sample.war-c9ce82b91e56502f/ deployment failed @ org.jboss.web.tomcat.service.deployers.tomcatdeployment.performdeployinternal(tomcatdeployment.java:325) [:6.1.0.final] @ org.jboss.web.tomcat.service.deployers.tomcatdeployment.performdeploy(tomcatdeployment.java:146) [:6.1.0.final] @ org.jboss.web.deployers.abstractwardeployment.start(abstractwardeployment.java:476) [:6.1.0.final] @ org.jboss.web.deployers.webmodule.startmodule(webmodule.java:118) [:6.1.0.final] ...

Comprehensive exam in moodle -

i need build comprehensive exam build of 3 main title , 10 question in each title. is possible simulate comprehensive exam moodle? do mean this: http://en.wikipedia.org/wiki/comprehensive_examination ? the article notes 'there no standard definition such exams entail', suggest answer 'yes', depend on trying achieve. quiz module within moodle quite capable of creating 3 page quiz, 10 questions on each page (or can more 3 pages, static text defining break between sections). if, however, wanting have separate grades each of sections, have split across 3 quizzes (possibly using conditional availability prevent access second & third quizzes until first has been answered).

upload image error with php class and curl -

hi have code uploader.php: class uploader { var $filepath; var $uploadurl; var $formfilevariablename; var $postparams = array (); function uploader($filepath, $uploadurl, $formfilevariablename, $otherparams = false) { $this->filepath = $filepath; $this->uploadurl = $uploadurl; if(is_array($otherparams) && $otherparams != false) { foreach($otherparams $fieldname => $fieldvalue) { $this->postparams[$fieldname] = $fieldvalue; } } $this->postparams[$formfilevariablename] = "@" . $filepath; } function uploadfile() { $ch = curl_init(); curl_setopt($ch, curlopt_url, $this->uploadurl); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $this->postparams); ...

objective c: detect touch began/down when touch started from outside of view/image/button -

i have resembles key pad (one master view, 9 subviews). touch began/down may start in of 9 subviews. detect touch down/began, know when user drags finger other subviews (which views finger dragged into), , when user lifts finger up/touch up/stop. (stack overflow not letting question posted. i'll try pasting code answer section, see if works). // in ib set long press gesture min duration 0.1 -(ibaction)handlelongpressonvoices:(uilongpressgesturerecognizer *)gesturerecognizer { cgpoint location = [gesturerecognizer locationinview:gesturerecognizer.view]; if (gesturerecognizer.state == uigesturerecognizerstatebegan){ [self whichvoiceselected:location]; } else if(gesturerecognizer.state == uigesturerecognizerstatechanged){ [self whichvoiceselected:location]; } else if(gesturerecognizer.state == uigesturerecognizerstateended){ [self.avplayer stop]; } } -(void)whichvoiceselected:(cgpoint)location { int updatedselectedvo...

python - How to make values accessible across all test methods? -

generalized scenario follows: import unittest class test(unittest.testcase): string1 = none def test1(self): self.string1 = "valueassignedfrommethod1" print "test1 :" print self.string1 def test2(self): print "\ntest 2 :" print self.string1 if __name__ == "__main__": unittest.main() output of above code follows: test1 : valueassignedfrommethod1 test 2 : none how can use same "string1" variable across methods & if value gets changed in 1 method should available in other methods too? in project have following scenario:[using python + selenium webdriver + page object pattern + unittest library] class test(unittest.testcase): def redirecttofalconhostui(self): #start google chrome browser self.browser = webdriver.chrome(executable_path='e:\\chromedriver.exe') #navigate website url site_home = home(self.browser...

c# - StreamWriter not releasing lock on a file even when including within Using clause -

i using c#.net code copy file containing xml data location on linux server. after copy file call third party (java app) web-service tries consume file copied. third party service first tries rename file , in process getting issue -java file.renameto method returns false. suggests file still being used/open other process. the stream write code given below using (streamwriter file = new streamwriter(filename) { file.writeline(xml); file.close(); } // code calls web service follows the file copied may huge in size (20-30 mb in cases). there way can confirm file has been copied location , no process holding on file before call third party service. sure there not other process holding on other 1 copying file. try perform file.close(); file.dispose(); that works me.

Using PHP Podio library, cannot get ratings data via PodioItem::get($id) -

i using latest php podio library (4.0.1) , using podioitem:get() item app. have found can retrieve 'likes' (i.e. heart) ratings, cannot retrieve voting ratings (e.g. 5 star or custom vote created). seems problem newly created apps or adding rating fields older apps. can rating data apps have had rating field awhile, perhaps since before 4.0 library change not sure. besides normal access attempts in code, tried printing out ratings structure using print_r , var_dump , getting no data other entries 'likes'. any thoughts why can' retrieve data part of item get() call? podio-php don't have access votes in current release, i've added library. pull latest dev version github (4.0.2 not enough). commit here: https://github.com/podio/podio-php/commit/fd4f3d66307a26d0ecef961467e8aac47df759c7 then can request votes using fields option so: $item = podioitem::get($you_item_id, array('fields' => 'votes')); var_dump($item->votes...

sharepoint 2013 - IIS SMTP DeliveryMethod script Error -

i trying setup outgoing email sharepoint on premises. need configure smtp settings script given on iis official web , received error \windows\system32\inetsrv\appcmd set config /commit:webroot /section:smtp /from:webmaster@mydomain.com /deliverymethod:network /network.port:80 /network.defaultcredentials:false /network.host:smtp.host.com /network.username:web@mydomain.com /network.password:password but error after executing above script error message: unknown attribute "deliverymethod" ..resaon: enum must 1 of network, specified pickup directories. i unable track error , unable find relevant solution issue network in case not command, parameter , case sensitive. set variable "network" instead of "network" , retry command.

java - How to set a custom port for RMI regisrty? -

in rmi program want set rmi registry on port 8080, when it, exception. here server code public class server { public static void main(string[] args) { try { locateregistry.createregistry(8080); mathserverimpl mathserver = new mathserverimpl(); naming.rebind("mathserver", mathserver); system.out.println("math server has started , running"); } catch (remoteexception | malformedurlexception e) { system.out.println(e.getmessage()); e.printstacktrace(); } } } the code works port 1099, it's default port far know, case gives me java.net.connectexception, , here log. java.rmi.connectexception: connection refused host: 10.100.25.173; nested exception is: java.net.connectexception: connection refused @ sun.rmi.transport.tcp.tcpendpoint.newsocket(tcpendpoint.java:619) @ sun.rmi.transport.tcp.tcpchannel.createconnection(tcpchannel.java:216) @ ...

json - Jackson and App Engine causing NoClassDefFoundError -

there few questions this, jackson 1.x. i'm using jackson 2.4.3 app engine sdk 1.9.15 , i'm getting following error: java.lang.noclassdeffounderror: org/codehaus/jackson/map/objectmapper i've tried using jackson-all-1.9.11.jar still same issue. if import repackaged jackson com.google.appengine.repackaged works fine, following warning makes sound bad thing do. warning: ..... not part of app engine's supported api. discouraged using class - app may stop working in production @ moment. usually error indicates required jar missing /web-inf/lib folder, or there several conflicting jars (with same classpath) in folder. you may not error in ide if added jar project's classpath. if use eclipse, start selecting project , looking problems tab. may see warning there specified resource not available on server. right click on warning , choose "copy..." option. otherwise, manually add jar /web-inf/lib folder.

c++ - Get the local ip address with unix sockets -

i programming simple udp client server chat little more familiar network programming. make easier user see servers ip address (so user can type client connect). that's why server display own local ip address. this code: (edited code handle multiple ip's) // hostname of server char hostname[128]; if (gethostname(hostname, sizeof(hostname)) == -1) { std::cout << "could not hostname of server. error: " << std::strerror(errno) << std::endl; return 1; } struct addrinfo hints, *serverinfo, *p; std::memset(&hints, 0, sizeof(hints)); hints.ai_family = af_unspec; // use af_inet (ipv4) or af_inet6 (ipv6) force version hints.ai_socktype = sock_dgram; // try information our hostname int rv; if ((rv = getaddrinfo(hostname, null, &hints, &serverinfo)) != 0) { std::cout << "failed information host \"" << hostname << "\". error: " << gai_strerror(rv) << std::endl; retu...

php - 301 Redirections after copying Magento installation -

after copying magento installation domain.com dev.domain.com see if update safely 1.8 1.9 system automatically redirects domain.com , after editing configuration through mysql database. both insecure , secure path urls have been changes match dev.domain.com server, yet site redirects domain.com . the backend of dev.domain.com works in strange way now. once access it, doesn't redirect. log in, , redirects me domain.com backend login page. yet, if add ' dev. ' in front of url (leaving session key is), brings me backend albeit through seems 10 redirections. when there, tabs 'greyed out'. cannot hover them bring menu panels. everything seems correct not sure else can affect this. have erased cache & session directories, yet no avail. nb: have checked if .htaccess files misconfigured. 1 edited 1 in root directory change 'www' 'dev'. neither 'www' nor 'dev' makes difference problem. did change chanfiguration in ...

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

i registred handler simple qtextobjectinterface , draws 10x10 red rectangle. when used qtextedit in normal qwidget app, worked. when used qquicktextedit (textedit qml component) in qt quick app, doesn't worked (nothing drawed, rectangle in textedit reserved, because when change cursor position, notice there something, empty space, nothing drawed. qtextobjectinterface intrinsicsize method called (that explains why see there empty space 10x10), drawobject method isn't. i did research , found problem here: qquicktextedit.cpp qt 5.3.0 sources (line 1821) qsgnode *qquicktextedit::updatepaintnode(qsgnode *oldnode, updatepaintnodedata *updatepaintnodedata) { . . . if (textframe->firstposition() > textframe->lastposition() && textframe->frameformat().position() != qtextframeformat::inflow) { updatenodetransform(node, d->document->documentlayout()->frameboundingrect(textframe).topleft()); c...

c++ - Member is inaccessible from Template class object in parameter -

i have class has function takes in template list object parameter. using list object i'm supposed to: //receives list of nvpair objects , sets data value in data member //of object in list according corresponding name in name - value pair here class , function: class cartoon : public object { string type; string name; string likes; public: void set(const list<nvpair<string, string>, 10>&& list) { //set list.objarray[0] } }; here list template class: template<typename t, int max> class list { t objarray[max]; int index; public: list() : index(0) {} size_t size() const { return index; } const t& operator[](int i) const { //try {} shit return <= max && >= 0 ? : -1; } void operator+=(const t& t) { objarray[index++] += t; } void operator+=(t&& t) { objarray[index++] += move(*t); } }...

python - Entries in Nested Dictionaries -

given nested dictionary: mydict = { 'through': { 1: 18, 2: 27, 3: 2, 4: 15, 5: 63 }, 'one': { 1: 27, 2: 15, 3: 24, 4: 9, 5: 32 }, 'clock': { 1: 2, 2: 5, 3: 9, 4: 6, 5: 15 } } the outer key word, inner keys files that word contains , values number of times said word appears in file. how use file numbers work out total number of text files present? i.e. is there way of extracting number of key / value pairs in inner dictionary? i.e. numoffiles = 5 because there 5 files here, had hundreds , read dictionary automatically, had work out? len fun...

Set Session in PHP email doesn't seem to work -

lol, seems question has not ever been asked before in google. so, trying send email via php form. scenario of registered member invite thier friend our page typing many email address text area. when submit form, form send email email address enters in text area. this email news letter. in email there products show addressed email. what want $_session in email is: when people has email adress click 1 of products in news letter , come page, page whom got link page. [edit] i dont want achieve string this: index.php?email=$email&username=$username since can set 1 link not global link , this can manipulated new coming people. what mean global link is, mentioned above, there many products going represent in newsletter, such ../product-a.php, ../product-b.php, ../product-c.php, ../product-d.php, , on. , make create many different sessions in pages because user have clicked 1 of product explore website first before deciding buy product or register website. so, here cod...

css - How can I insert a small rectangle inside the rectangle? -

Image
. here link http://jsfiddle.net/ashadee/xhalqvav/ . html code <a href="#" class="rectangle">eat lunch</a><br> css a{ font-size: 1.2em; white-space: normal; } a.rectangle { width: 70%; height: 5%; border: 1px solid black; padding: 5%; margin-top: 0%; background-color: #fafafa; opacity: 0.4; display: block; text-decoration: none; text-align: center; font-family: comic sans ms; box-shadow: 10px 10px 5px #888888; } how make design 1 in image? should use canvas property. demo - http://jsfiddle.net/victor_007/xhalqvav/2/ use pseudo element :after , :before styling right box , rounded a { font-size: 1.2em; white-space: normal; } a.rectangle { width: 70%; height: 5%; border: 2px solid black; padding: 5%; margin-top: 0%; background-color: #fafafa; opacity: 0.4; display: block; text-decoration: none; text-align: center...

cordova - meteor android crosswalk webview login not visible -

meteor crosswalk reveal sign in/up button when apk developed via crosswalk load external website. when app built via meteor , crosswalk cordovalib used replace existing directory sign in/up not visible. it sounds there nothing special crosswalk, rather compiled app in way, cannot connect server.

telerik - Kendo MultiSelect does not populate bound values -

i have multiselect belongs kendo listview editortemplates. when want submit selected multiselect values, got list of items selected, populated 0 value. cant correct value of selected items. here listview: @(html.kendo().listview<escms.modules.c2c.domain.c2cfieldrangelist>() .name("listview") .tagname("div") .clienttemplateid("template") .datasource(datasource => datasource .model(model => model.id(x => x.fieldrangeid)) .pagesize(6) .create(create => create.action("addrange", "field")) .update(update => update.action("updaterange", "field")) .read(read => read.action("readrange", "field", new { id = model.fieldid })) )) and here editortemplates: <table> <tr> <td> @html.labelfor(x => x.rangevalue) </td> <td> : </td> <td> @html.textbox...

javascript - Darts game - checking problems in AngularJS -

there content of angularjs (javascript ) file: // define new angular module var myapp = angular.module('myapp',[]); myapp.controller('myappcontroller',function($scope){ $scope.player = ''; $scope.players = []; $scope.totalpoints = []; $scope.flag = 1; $scope.mynumberregex = /[0-9]/; $scope.last = {}; $scope.score = {}; $scope.winner = 0; $scope.nextplayer = ''; $scope.nextround = false; var actualplayer = 0; var pointsvalue,round = 0; var internalroundcounter = 1; var shootsstring = ''; $scope.$watch('roundcount',function(value){ console.log('new value',value); }); $scope.add = function(){ $scope.players.push({name: $scope.player, totalpoints: 0, fields:[]}); $scope.player = ''; }; $scope.checkform = function() { var valid = true; if ($scope.players....

apache - Redirect Loop while rewriting URL for a video file -

i have video file url modified .htaccess rewriterule ^videos/([0-9]+)/.*$ cms/support/get.file.php?file_id=$1 [qsa,l] now when load file http://web01.agmsdallas.com/videos/966/ i end redirect loop , page fails load. have checked .htaccess rule others , appears good. rule works on different server. can 1 wrong. there apache directive disabled causing error. it appears issue been welcome.conf file of apache has <locationmatch "^/+$"> options -indexes errordocument 403 /error/noindex.html </locationmatch> once commented out, redirection works fine.

php - populate select dropdown menu with category names from mysql database -

this question has answer here: mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row() expects parameter 1 resource 33 answers hi im trying populate select dropdown menu names in database mysql, im getting blank dropdown nothing in , not expanding. in advacnce database: icadbs504a create table if not exists `category` ( `cat_id` int(11) not null, `cat_name` varchar(40) not null, `cat_path` varchar(20) not null ) engine=innodb default charset=utf8 auto_increment=6 ; insert `category` (`cat_id`, `cat_name`, `cat_path`) values (1, 'computers', 'uploads/1/'), (2, 'phones', 'uploads/2/'), (3, 'toys', 'uploads/3/'), (4, 'pet accessories', 'uploads/4/'), (5, 'camping', 'uploads/5/'); form: <select name="category"> <?php // make connection: $dbc = mysqli_connect (...

Jmeter - Not capturing the redirected URL -

Image
i recorded test in jmeter 2.11 ubuntu 12.04, redirect different ip after logging in, url specified in http request default log in page, change based on user after logging in. want capture redirected url after logging webpage.the url specified in http request defaults initial log in , after ip address redirected another.please let me know if there method of capturing redirected ip. in advance!! please refer screen shot below http sampler settings hope help

javascript - Bootstrap with JS, result of a function in popover -

this code temperature of london weather api. works correctly (images local hence won't show): <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="css/body.css" /> <meta name="msapplication-tap-highlight" content="no" /> </head> <body> <script src="http://code.jquery.com/jquery-2.0.0.js"></script> <script language="javascript" type="text/javascript"> <!-- function foo(callback) { $.ajax({ ...

selenium webdriver - ChromeDriver screenshot not showing whole document if window size were set? -

using chrome selenium driver, not getting screenshots showing whole document if browser dimension set me instead of keeping dimensions got automatically. i create chrome driver this: iwebdriver browser = new chromedriver(); browser.manage().window.size = new size(1024, 768); i take screenshot this: var screenshot = browser.takescreenshot(); screenshot.saveasfile("c:\\screenshot.png", imageformat.png); the screenshot size 1014x686, expected, because should cover document, depicts bottom part of webpage instead of whole webpage. why? if not setting window size, screenshot seems correct. unfortunately, limitation of current chrome driver. it's been logged an issue in issue tracker . driver bug, in turn, dependent on fix a bug in chromium itself . until parent bug in chromium fixed, there's nothing chromedriver or selenium project can work around problem proper amount of reliability , fidelity.

java - Uploading Multipart-form-data to php -

i upload data (username, description,..) , photo android-app server (php-script). by searching found solution: how take photo , send http post request android? by click on send button, upload-process starts , php-script works $_post -vars empty? can me? request-code: [...] case r.id.btnsend: string strname = tname.gettext().tostring(); string stremail = temail.gettext().tostring(); string strdatum = tdatum.gettext().tostring(); string strbeschreibung = tbeschreibung.gettext().tostring(); nvpairs = new arraylist<namevaluepair>(2); nvpairs.add(new basicnamevaluepair("sender", "andoidapp")); nvpairs.add(new basicnamevaluepair("name", strname)); nvpairs.add(new basicnamevaluepair("email", stremail)); nvpairs.add(new basicnamevaluepair("datum", strdatum)); nvpairs.add(new basicnamevaluepair("beschreibung", strbeschreibung)); nvpairs.add(new basicnamevaluepair(...

Why can't I install lxml for python? -

i have downloaded tarball lxml , using ipython setup.py install try install it. unfortunately giving me screenfuls of error messages: src/lxml/lxml.etree.c:200651: error: ‘xml_xpath_invalid_operand’ undeclared (first use in function) src/lxml/lxml.etree.c:200661: error: ‘xml_xpath_invalid_type’ undeclared (first use in function) src/lxml/lxml.etree.c:200671: error: ‘xml_xpath_invalid_arity’ undeclared (first use in function) src/lxml/lxml.etree.c:200681: error: ‘xml_xpath_invalid_ctxt_size’ undeclared (first use in function) src/lxml/lxml.etree.c:200691: error: ‘xml_xpath_invalid_ctxt_position’ undeclared (first use in function) src/lxml/lxml.etree.c:200921: error: ‘libxslt_version’ undeclared (first use in function) src/lxml/lxml.etree.c:200933: error: ‘xsltlibxsltversion’ undeclared (first use in function) src/lxml/lxml.etree.c:200945: error: ‘__pyx_v_4lxml_5etree_xslt_doc_default_loader’ undeclared (first use in function) src/lxml/lxml.etree.c:200945: error: ‘xsltdocdefaultloa...

IntelliJ IDEA empty constructor/method code style -

how tweak inllij idea 14 code style java, make keep closing brace of empty constructor/method right after opening one. e. g. : class { private a() {} public void b() {} } go settings/code style/java/wrapping , braces , select these options: keep when reformatting simple blocks in 1 line simple methods in 1 line simple classes in 1 line that keep code untouched while reformatting code: if(true) {} public void foo() {} public class bar {} i tested on intellij 13.1.5, work same way on 14 too.

ios - Custom Footer view for UICollectionview in swift -

i re-writting objective-c app of min in swift , decided collection view works better tableview in case. have collectionview set how want , need add footer collection view. in objective-c easy me, did create uiview, add objects it, , add tableview this. self.videotable.tablefooterview = footerview; now i've been trying in collection view similar solution, i've had no luck far. is there simple .collectionviewfooterview or can add uiview to? edit found similar ideas here if helps create answer edit i've been thinking on ways achieve right idea add footer view end of collection view using following code: var collectionheight = self.collectionview.collectionviewlayout.collectionviewcontentsize().height footerview.frame = cgrectmake(0, collectionheight, screensize.width, 76) the issue i'm having workaround need add more space contentview of colletionview , having no luck that my solution i solved using work-around (not prettiest works), add uiview...