Posts

Showing posts from July, 2014

(#17) User request limit reached - Facebook -

i not getting why happening, 1 of pages being used in our application keep getting following error " (#17) user request limit reached". we not making single api call using tokens page, on first attempt same error. reason behind this, have checked tokens page's token , other api usage.

MS Access Delete Query with Left Join -

i trying run delete query records in table 'csd' not available in table 'client codes dealing'. getting error 'could not delete specified tables' delete csd.* csd left join [client codes dealing] on csd.client = [client codes dealing].clientcode ((([client codes dealing].clientcode) null)); in comment mentioned [client codes dealing] union query. anytime union query involved, entire query made read-only (see why query read-only? ). the simplest thing turn union query make-table query, replace name of union query name of temporary local table created make-table query.

java - get a file in javascript in play framework 1.2.4 -

i'm having issue adding xml file javascript, i'm working play framework 1.2.4 my javascript has following fonction : downloadurl("example.xml", function (data) { var markers = data.documentelement.getelementsbytagname("marker"); (var = 0; < markers.length; i++) { var latlng = new google.maps.latlng(parsefloat(markers[i].getattribute("lat")), parsefloat(markers[i].getattribute("lng"))); var name = markers[i].getattribute("name"); var windowcontents = "<h3>" + name + "</h3>"; var marker = new google.maps.marker({ position: latlng, map: map }); bindinfowindow(marker, map, infowindow, windowcontents); } }); but exception says mapbillaction.example.xml action not found (mapbillaction controller) i have folder in view called m

MySQL - Variables in Query similar to PHP -

i have code on php: $query = "delete ponteved_admincs." . $_get['servidor'] . " auth = '" . $_get['auth'] . "';update ponteved_foroipb.members set member_group_id = 3 member_id = '" . $_get['foroid'] . "' limit 1"; mysqli_multi_query($con,$query); this code removes db specified user passed get, , changes user groups on ipb forum. there way variables in query if try on mysql event? i have on mysqlevent: delete ponteved_admincs.27015 date(vencimiento) <= date(now()) example i'd do, don't know: var @getuserid = select `foroid` `27015` `auth` = 'green'; delete ponteved_admincs.27015 date(vencimiento) <= date(now()) update ponteved_foroipb.members set member_group_id = 3 member_id = '@getuserid' thanks!

sms - How to make an HTTP request in PHP? -

i have send sms making http request via method. link contains information in form of variables, e.g. http://www.somelink.com/file.php?from=12345&to=67890&message=hello%20there after run script has if clicked link , activated sms sending process. i have found links request , curl , not, it’s confusing! the easiest way use curl. see http://codular.com/curl-with-php examples.

Windows Phone Emulator not able to sign in using email -

Image
i got problem windows phone emulator i not able sign email download app marketplace anybody have idea? the emulator not trusted platform using microsoft live id. need use actual phone set microsoft account. see also cannot set microsoft account in wp8 emulator

python - Tkinter Text widget - identify line by y-coord -

is there method identify row/column in tkinter.text widget in tkinter ? mean methods identify_row(event.y) , identify_column(event.x) . i want highlight line bellow cursor , need work disabled text widget. i thinking of getting height , count line number current y coord , height of line, thought, there might better way. so, there? thank advice. found it, works me: def __onlclicked(self, event): linestart = self.index("@{0},{1} linestart".format(event.x, event.y)) lineend = self.index("{} lineend".format(linestart)) self.tag_remove("current_line", 1.0, "end") self.tag_add("current_line", linestart, lineend) only 1 detail, unfortunately doesn't higlight lines same, because each line has different length. if knows how highlight full 'width' (the length of longes line guess) every line without adding spaces...that'd great!

oracle11g - PLSQL package installation -

anybody here knows how install plsql package in oracle 11g? trying use these 2 packages: 1.dbms_network_acl_admin 2.dbms_network_acl_utility i using oracle application express, far sql not able identify these .. thank you. installing plsql packages dbms_network_acl_admin you can check whether exist first, run user sys: select * dba_objects name = ... if don't exist on oracle rdbms (i don't know whether maybe express edition excludes them, seems illogical), database not installed well. easiest way re-install database. in case don't need replace software, create new database. the advanced way reinstall parts of data dictionary. if have never done before, can assume database end corrupt. can try instance executing ?/dbs/catqm.sql. replace ? path oracle_home lives , rdbms/admin. such $oracle_home/rdbms/admin on linux. remember close database other users. maintaining acl the comments led conclusion acl missing. approach use maintain them in pack

Setting a variable equal to a variable in SQL Server -

i'm working on problem colleagues impossible. there xml in our database , want able take single attributes xml , set them equal variables work with. code far (that doesn't work). declare @mytext varchar(10) declare @myxml xml set @myxml = ' <ns0:testxml xmlns:ns0="http://test.com"> <testvalue>11</testvalue> </ns0:testxml>' set @mytext = ( ;with xmlnamespaces ('http://test.com' ns0) set @mytext = ( select a.bo.value('(/ns0:testxml2[1]/testxml3)[1]','int') [number] @myxml.nodes('ns0:testxml') a(bo) ) ) any appreciated, thank you. if logic off how sql works xml, please don't hesitate educate me. how's this, returns 11 provided xml want assume: declare @mytext varchar(10) declare @myxml xml set @myxml = ' <ns0:testxml xmlns:ns0="http://test.com"> <testval

angularjs - Using 'No' in Angular ng-show -

so have piece of code. element should shown if model optionfalse set, , if not not shown: <input ng-show="optionfalse" type="radio" name="example_boolean" />{% verbatim %}{{ optionfalse }}{% endverbatim %} the way set optionfalse value via ng-model: <input ng-model="optionfalse" type="text" name="answer_opt_true" value="" /> so if type text input radio should appear. works fine every keyword, when type 'no' input doesn't appear. why that? somehow no evaluated false? if so, how can find workaround? the same behaviour happening when type 'n'. othe letters works fine. angular binds ng-show boolean value. needs true element show. note: here list of values ngshow consider falsy value (case insensitive): "f" / "0" / "false" / "no" / "n" / "[]" taken angularjs docs

wcf - await async function C# -

i developing silverlight project using wcf.i need call function wcf after wcf function has finished.here code : int32 id = convert.toint32(((textblock)datagrid1.columns[0].getcellcontent(datagrid1.selecteditem)).text.tostring()); service1client obj = new service1client(); obj.deletepersonasync(id); //wait delete operation obj.getpersonlistcompleted += new eventhandler<getpersonlistcompletedeventargs>(listpeople); obj.getpersonlistasync(); how can that? call function "getpersonlistasync" int callback of obj.deletepersonasync(id) function. code soemthing follows: private void somefunction() { int32 id = convert.toint32(((textblock)datagrid1.columns[0].getcellcontent(datagrid1.selecteditem)).text.tostring()); service1client obj = new service1client(); obj.deletepersonasynccompleted += new eventhandler<deletepersoncompletedeventargs>(persondeleted); obj.deletepersonasync(id); } priv

sorting - CakePHP 2.4.4 Unable to sort/order by virtual field with paginate (Paginator) -

my virtual field property model, generated in beforefind(), called 'distance', works. however, can't sort it. have part of search form: echo $this->form->input('sort', array( 'options' => hash::get($predefined, 'sort'), // list of options )); which adds sort url, , works normal fields, not virtual field distance. should have implemented differently? far i'm aware, virtual fields should work fine pagination. edit: in case i've implemented pagination wrong... i've set defaults: public $paginate = array( 'limit' => 25, 'order' => array( 'properties.id' => 'asc' ) ); after building $conditions: $this->paginator->settings = $this->paginate; $data = $this->paginator->paginate('property', $conditions); $this->set('properties', $data); the above works fine changing order, directly editing /sort:fieldname/ in url, not virt

c# - How convert xml string UTF8 to UTF16? -

i have string of xml(utf-8).i need store string in database(ms sql). encoding string must utf-16. this code not work, utf16xml empty xdocument xdoc = xdocument.parse(utf8xml); xdoc.declaration.encoding = "utf-16"; stringwriter writer = new stringwriter(); xmlwriter xml = xmlwriter.create(writer, new xmlwritersettings() { encoding = writer.encoding, indent = true }); xdoc.writeto(xml); string utf16xml = writer.tostring(); utf8xml - string contains serialize object(encoding utf8). how convert xml string utf8 utf16? this might you memorystream ms = new memorystream(); xmlwritersettings xws = new xmlwritersettings(); xws.omitxmldeclaration = true; xws.indent = true; xdocument xdoc = xdocument.parse(utf8xml); xdoc.declaration.encoding = "utf-16"; using (xmlwriter xw = xmlwriter.create(ms, xws)) { xdoc.writeto(xw); } encoding ut8 = encoding.utf8;

java - Generics in Constructor Parameters -

i know silly question since once knew stuff that. have hard time getting done. have constructor class wich should arraylist wich filled objects implement interface called collisionobserver. here constructor-head: public cursor(gl gl, libraryfinger finger, vector direction, float radius, int index, arraylist<t extends collisionobserver> observerlist) can tell me make big mistake? tried arraylist<collisionobserver> too, doesn't work too, since when call constructor objects implement collisionobserver error message says constructor undifined. ok, here complete cursor class: public class cursor implements collisionsubject{ private vector direction; private gl gl; private float radius; private libraryfinger finger; private glut glut; protected static float[] sphere_center = new float[3]; private arraylist<collisionobserver> observer = new arraylist<collisionobserver>(); public cursor(gl gl, libraryfinger finger, vector direction, float radi

boost - Cannot iterate a flat map -

i working boost flat_map , trying iterate through it, however, cannot figure out how create iterator. my_map = myseg.find<tlsshmmap>("temp_map").first; //fetch pointer map tlsshmemallocator alloc_inst (myseg.get_segment_manager()); (boost::container::flat_map<int, tlsstorage, std::less<int>() ,alloc_inst >::const_iterator row = my_map->begin(); row != my_map->end(); ++row) { //do stuff } the 'tlsstorage' struct use store data database. boost flat map declared follows somewhere else in code: boost::container::flat_map tls_temp_map = myseg.construct<tlsshmmap>("temp_map") (std::less<int>() ,alloc_inst); //object name the code have above not work. here errors, ideas? src/dbm/dbm_shm_server.cc: in member function 'int redcom::dbm::shmserver::startserver()': src/dbm/dbm_shm_server.cc:353:24: warning: unused variable 'tls_main_map' [-wunused-variable] tlsshmmap* t

java - Call Web Service from AJAX -

i've looked through number of posts/tutorials on calling ws via ajax, still not able this. not environment matters but... wrote java class in eclipse, i'm running on glassfish, , i'm able hit endpoint via soapui. java class: package com.tester.gf; import java.util.arraylist; import java.util.list; import javax.jws.webservice; @webservice public class glassfishtestapp { public list<string> getbrands() { list<string> brands = new arraylist<>(); brands.add("chevrolet"); brands.add("dodge"); brands.add("ford"); return brands; } } endpoint: localhost:8080/glassfishtestapp/glassfishtestappservice?wsdl when load following web page, see "error: " displayed in . <html> <head> <title>soap ws test</title> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script>

vb.net - Adding a value to a repeating element in my BizTalk Orchestration Message Assignment -

i’m having trouble adding value repeating element in biztalk orchestration message assignment component. here have done. created vb.net class xsd.exe tool schema. create vb.net helper class inherits schema class , added class variable orchestration. trying create new message within assignment component. when setting values non-repeating element working , message created. i’m not sure how set value repeating element. when try code below error “inner exception: object reference not set instance of object.”. error on line “credentialslookuprequestheader.ids[0] = categoryvaluetype;”. categoryvaluetype complex type , can have more one. -helper class <serializable> <xmlroot("credentialslookupadaptertype")> _ public class credentialslookupadaptertype inherits credentialslookuprequestv1_3type public function toxmldocument() xmldocument dim serializer new xmlserializer(gettype(credentialslookupadaptertype), new type() {gettype(credentialslookup

java - Convert a LibGdx image into an acceptable Android Image format -

i need convert java libgdx image of type com.badlogic.gdx.scenes.scene2d.ui.image image of type " android.graphics.bitmap ". need because want share image using android action_send intent. there way convert libgdx image android bitmap or java bufferedimage?

vb.net - Converting VB project to C# project how to convert "My Project" Folder -

i attempting convert vb project c# project hand. there ton do, , might imagine, not intuitive. old vb project had project folder. in visual studio 2012 represented wrench in solution explorer. in there resoruces.designer.cs file, resources.resx, settings.designer.cs, settings.settings file, etc. assuming of these native vb apps. i thinking of excluding thing , adding pieces in 1 one. thinking settings file needed. in couple of places have reference my.settings , trying figure out how convert app.config file, or kind of file. any advice?

javascript - D3 brushing on grouped bar chart -

i trying brushing work similar example, grouped bar chart: http://bl.ocks.org/mbostock/1667367 i don't have understanding of how brushing works (i haven't been able find tutorials), i'm bit @ loss going wrong. try include relevant bits of code below. chart tracking time fix broken builds day , grouped portfolio. far brush created , user can move , drag it, bars in main chart re-drawn oddly , x axis not updated @ all. can give appreciated. thank you. // x0 time scale on x axis var main_x0 = d3.scale.ordinal().rangeroundbands([0, main_width-275], 0.2); var mini_x0 = d3.scale.ordinal().rangeroundbands([0, main_width-275], 0.2); // x1 portfolio scale on x axis var main_x1 = d3.scale.ordinal(); var mini_x1 = d3.scale.ordinal(); // define x axis var main_xaxis = d3.svg.axis() .scale(main_x0) .tickformat(dateformat) .orient("bottom"); var mini_xaxis = d3.svg.axis() .scale(mini_x0) .tickformat(dateformat) .orient("bottom")

ios - SpriteKit detect if node is removed from parent -

is there method gets called every time node deleted? or added? along terms of touchesbegan method gets called every time touch on screen happens. or touchesmoved method gets called when node gets touched , moved. so there such method gets called when node gets removefromparent ? i using update method detect if node still present like: sknode *n = [self childnodewithname: @"n"]; if (!n) { // no n if (life != 0) { [self addchild:_n); life--; } } now when ever node missing remove 1 life, , add node again. the problem update method running fast 2 lives removed every time node removed. believe because adding node kinda slower update method. takes 2 loops on update method before detects node present again. there no such method. can create one. create subclass of (for example) skspritenode , override "remove" methods (or using). within method send message whichever object needs receive removal event, or send n

r - Create xts index with both date & time -

i want run 1 minute data trading app through r program i've written. far of xts objects have been daily bars yahoo, etc. how create time part of xts index? note date & time in first 2 columns. possible there missing dates, it's pretty guaranteed there missing minutes. there should not duplicates. (i'll check myself) thanks library(timedate) testdata = structure(list(x = 1:6, date = structure(c(1l, 1l, 1l, 1l, 1l, 1l), .label = "07/01/1998", class = "factor"), time = structure(1:6, .label = c("06:31", "06:34", "06:35", "06:36", "06:38", "06:39"), class = "factor"), open = c(114.06, 114.11, 114.06, 114.09, 114.09, 114.06), high = c(114.06, 114.13, 114.13, 114.09, 114.09, 114.13), low = c(114, 114.06, 114.06, 114.03, 114.06, 114.06), close = c

javascript - Is there a way to tell if an ES6 promise is fulfilled/rejected/resolved? -

this question has answer here: how can synchronously determine javascript promise's state? 10 answers i'm used dojo promises, can following: promise.isfulfilled(); promise.isresolved(); promise.isrejected(); is there way determine if es6 promise fulfilled, resolved, or rejected? if not, there way fill in functionality using object.defineproperty(promise.prototype, ...) ? they not part of specification nor there standard way of accessing them use internal state of promise construct polyfill. however, can convert standard promise 1 has these values creating wrapper, function makequerablepromise(promise) { // don't create wrapper promises can queried. if (promise.isresolved) return promise; var isresolved = false; var isrejected = false; // observe promise, saving fulfillment in closure scope. var result = promise.the

git log - Is it possible to dynamically generate git log format? -

i'd show author name , author date, optionally show committer name , committer date if different author name , date. this use after rebase. author info remains same, committer info changes. if , if different, i'd show committer info in addition author info. author , committer info same: %c(yellow)%h%creset %s %c(cyan)(%an - %ar)%creset different: %c(yellow)%h%creset %s %c(cyan)(%an - %ar, %cn - %cr)%creset is possible? there no conditionals in format arguments, , no format string expands conditionally that, so: no. on other hand, extract information commit manually (in script), compare, , choose format apply 1 commit, so: yes, if you're willing outside of git log command. for showing single commit, latter seems reasonable. looking @ whole log, suspect painful. :-) (could still done, use git rev-list generate list of revs, git log each, 1 @ time, piping whole result through same pager git log use, etc. but... painful.)

graph - D3 force layout: Finding relative center based on current visible view -

i have d3.js graph forced layout design. have allowed users zoom in , out of graph bounds set can't zoom in past 1 , can't zoom out past 0.1. right now, when plot values on graph, automatically send them center of graph (based on height , width of svg container). works fine until zoom out zoom in else , plot new node. new node end @ original center , not new relative center. how scale when zooming right now: function onzoom() { graph.attr("transform", "translate(" + zoom.translate() + ")" + " scale(" + zoom.scale() + ")"); } i unable find calls current visible coordinates of graph, those, how use them calculate relative center of graph if svg graph size remains static? for simple geometric zoom, it's straightforward figure out visible area visible area dimensions plus translation , scale settings. remember translation setting position of (0,0) origin relative to top left corner of display, if transla

printing - C# ShellExecute on windows 2012r2 incorrect work -

i have irritating problem , can't solve 30+ hours. please me because there friday evening , i'd go home. what's problem? my service tries invoke action file via shellexecutea function action doesn't invoked. when invoke action right click menu - action done correctly. details create action txt , tif extensions: txt: action name : a4, comand line: "c:\program files\windows\nt\accessories\wordpad.exe" /pt "%1" "printer" “%3” tif: action name : a4, comand line: "c:\windows\system32\rundll32.exe" "c:\windows\system32\shimgvw.dll",imageview_printto /pt "%1" "printer" "%3" "%4" where printer - name of printer. so, can see these commands configured printing file. in service wrote on c# use next code: string size = "a4";//name of action file int returncode = shell32.shellexecuteany(0, ref size, ref sourcefilepath, 0, 0, 6); where shell32.shellexecuteany

c# - An example for supporting foreach without implementing IEnumerable -

i looking @ this blog explains foreach can supported without implementing ienumerable . not go details of implementation. i looking example of how support foreach without implementing ienumerable . edit: @sam 's comment, got looking for. (see answer below) here class doesn't implement ienumerable , or interfaces @ all: public class foo { public ienumerator<int> getenumerator() { yield return 1; yield return 2; } } you can foreach so: foreach (int n in new foo()) console.writeline(n); and print: 1 2

ios - Xcode Environment Variables and Command Line Arguments -

background i developing ios app connects server. have team of developers run own server unique addresses debugging. our rule source control checkin "production url". in android have solution works well. solution won't work in ios. what i've tried set "command line argument" or "environment variable" in build scheme. problem put "*.xcproject" file get's checked in , causes merge conflicts. if set @ user level fine because .gitignore xcuserdata. i tried referencing "myconfig.h" file not checked in. if not exist project won't build. what want do if developer wants point @ different server set environment variable on mac. "export my_server="http://domain.com/api/". in project file add , environment or command line argument "my_server=$(my_server)". unfortunately can't figure out how xcode resolve variable on osx machine. seems environment variables resolved on device only. co

Django 1.6.1, Python 3.3.2, uwsgi 2.0 -- uwsgi crashes and won't run -

i compiled python 3.3.2 source because i'm not sure how else install python 3.3.2. prior compiling installed: zlib1g-dev libbz2-dev libpq-dev python3-dev python-dev then setup virtualenv usual , tried installing uwsgi through pip crashed linking error stack trace didn't contain information on missing (this separate concern if interested here's trace https://gist.github.com/antelopesalad/8735358 ). someone recommend install uwsgi source , compiled happens when try run it: https://gist.github.com/antelopesalad/8737279 i compiled uwsgi downloading 2.0 doing: downloaded https://pypi.python.org/packages/source/u/uwsgi/uwsgi-2.0.tar.gz unzipped , ran python3.3 uwsgiconfig.py --build my os lubuntu 13.x. ideas?

Image shifts to the right in wordpress post -

setting contact information. inserted text first , then, started inserting images right before it. first 2 display way need them. 3rd 1 (with envelope) shifts right. can't understand what's happening it. had ever come across that? live link here it's @ bottom of page http://soloveich.com/pr6/ the solution remove margin: 0 1em 1em 0; from img.alignleft in css, 3 images line up.

c++ - How to store pointers (or references) to objects in a std::set -

are there proper means in c++11 stl store object pointers in std::set , , have them sorted object's operator < method? there is, of course, possibility of writing own compare type , passing set second template argument, i'd imagine stl provide more convenient way. a bit of googling revealed std::reference_wrapper , in opinion should allow code this: #include <functional> #include <set> struct t { int val; bool operator <(t& other) { return (this->val < other.val); } }; int main() { std::set<std::reference_wrapper<t>> s; t a{5}; s.insert(a); } but in fact, causes compiler error: clang++ -std=c++11 -wall -wextra -pedantic test.cpp -o test in file included test.cpp:1: in file included /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/functional:49: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2/bits/stl_function.h:235:20: e

actionscript 3 - Sticky header on elements in VBox -

i have vbox container elements in it. vbox has limited height , enables scrolling if elements exceed height. each of child elements have "header" element. in case of scrolling, header element visible if container "clipped" scrolling, iphone contacts application (see this question behavior described , headers correspond a , b , etc.). have bottom element should behave similarly, sticking bottom of visible area of canvas. i have been trying accomplish listening on mouse events detect scrolling , manually correct position of header , bottom elements this: private function updatetopbottomposition():void { var host:displayobjectcontainer = owner; var global0:point = host.localtoglobal(new point(0, 0)); var global1:point = host.localtoglobal(new point(host.width, host.height)); //transform parent global coordinates local frame var local0:point = this.globaltolocal(global0); var local1:point = this.globaltolocal(global1); var maxt

eclipse - Android Logcat: showing my app's log messages after I re-plug in my phone after 10 or more minutes later? -

my android app writing messages can view eclipse logcat when phone plugged in usb. now, when i'm out the field, unplugged, app still producing log.i() messages. however, when plug phone computer 10 or more minutes later, cannot see messages. there way view them in eclipse logcat? or perhaps can use adb shell on phone , cat messages file? sometimes need go "devices" view in debug window , click on device, logs retrieved

eclipse - Android Manifest change force closes app -

i added class working app. want new class first page load, called dashboard.class. added manifest , app force closes when try load it. went , removed entry in manifest , app worked again. please tell me doing wrong <activity android:name="com.magicbuddy.gamble.dashboard" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name="com.magicbuddy.gamble.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="com.magicbuddy.gamble.mainactivity" /> <category android:name="android.intent.category.default" /> </intent-filter> &l

html - Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available" -

i have html form in jsp file in webcontent/jsps folder. have servlet class servlet.java in default package in src folder. in web.xml mapped /servlet . i have tried several urls in action attribute of html form: <form action="/servlet"> <form action="/servlet.java"> <form action="/src/servlet.java"> <form action="../servlet.java"> but none of work. keep returning http 404 error below in tomcat 6/7/8: http status 404 — /servlet description : requested resource (/servlet) not available. or below in tomcat 8.5/9: http status 404 — not found message : /servlet description : origin server did not find current representation target resource or not willing disclose 1 exists why not working? put servlet class in package first of all, put servlet class in java package . should always put publicly reuseable java classes in package, otherwise invisible classes in packa

How can I read multiple cookies with Perl's CGI.pm? -

i using cgi.pm write out cookies. during course of user using site, other cookies added "test.com" cookie set, (as shown in broswer history) but want log user out, , "clean" pc. since don't know scripts user has used, can't foresee cookies on pc. in short, there way read cookies "test.com" script can print them out again 1s duration, (effectively 'deleting' them) ** know can read cookie in $xyz=cookie('$name') ... how can create array holding $name variable can loop through it? script run on "test.com", cross site policy not issue +++++ brian d foy added partial answer below. how envisage code might strung together. use cgi::cookie; %cookies = cgi::cookie->fetch; (keys %cookies) { $del_cookie.="cookie(-name=>'$cookies[$_]',-path=>'/',-expires=>'+1s');"; } print header(-cookie=>[$del_cookie]); i wondered how script recognise domain. appears script intelligent

c - wrt54g routing table / ip table -

i undergraduate student developing firmware upgrade wrt54gl router concerns routing table. aim of implementation enhance routing of ipv4 , ipv6. the question modules need alter routing table's source/ configuration requirements? i have setup development environment on ubuntu netbeans openwrt toolchain. i new , advice or reading material on rally helpful have failed find useful material online. the link used router source follows, http://support.linksys.com/en-apac/gplcodecenter and source code file name downloaded follows, wrt54gl-us_v4.30.16.004.tar your appreciated implementation vital degree. thank again :) that appears using linux version 2.4.20. kernel subdirectory net/ipv4 has core ipv4 code. files route.c , fib_*.c files contain main route handling code. see http://www.cs.unh.edu/cnrg/people/gherrin/linux-net.html#tth_chap8 . reference little old, kernel.

python - How to find the index of an array within an array -

i have created array in way shown below; represents 3 pairs of co-ordinates. issue don't seem able find index of particular pair of co-ordinates within array. import numpy np r = np.random.uniform(size=(3,2)) r out[5]: array([[ 0.57150157, 0.46611662], [ 0.37897719, 0.77653461], [ 0.73994281, 0.7816987 ]]) r.index([ 0.57150157, 0.46611662]) the following returned: attributeerror: 'numpy.ndarray' object has no attribute 'index' the reason i'm trying can extend list, index of co-ordinate pair, within for-loop. e.g. v = [] in r: v.append(r.index(a)) i'm not sure why index function isn't working, , can't seem find way around it. i'm new programming excuse me if seems nonsense. you can achieve desired result converting inner arrays (the coordinates) tuples. r = map(lambda x: (x), r); and can find index of tuple using r.index((number1, number2)); hope helps! [edit] explain what's going on in code

c - Max size of pointer array to 2D array? -

i'm using following allow me choose 2d array use, dynamically. const prog_uint16_t (*p)[8]; p = arrayname; this works fine 2d array of size [3][8], require [10][1025]. when try this: const prog_uint16_t (*p)[1025]; p = arrayname; i "cannot convert" error. any ideas? thanks! edit: here's declaration of 2d array works. 1 doesn't declared same way, different number of entries ([10][1025]). const prog_uint16_t tri[3][8]={{10,20,30,40,50,60,70,80},{11,21,31,41,51,61,71,81},{12,22,32,42,52,62,72,82}}; thanks! you cant change size , type of constant pointer of course can change data pointed or else cant resize type ofp pointer look code maybe you const int x; // x cannot modified const int* px = &x; // px address of const int // , can't used change int *px = 4; // illegal - can't use px change int int* pint; // address of normal int pint = px; // ille

A Perl /CGI script to accept different upload files -

related -- https://stackoverflow.com/questions/21487257/a-perl-cgi-script-for-uploading-files -- question, have one: can this: http://www.seaglass.com/file-upload-pl.html script modified accept different input files , save them different output files, , not overwrite single output file? i'm new perl/cgi, wouldn't see obvious answer. in $basename have name of file. not have write uploaded file /tmp/outfile ; can construct path dynamically, depending on $basename . create directory want place files. assume still c:\tmp . instead of open(outfile, ">/tmp/outfile") write open(outfile, ">/tmp/$basename") and should work. taint removed $upfile inside getbasename() , before $basename created. not safe, still. before giving open() , should remove unwanted characters file name, e.g. $basename =~ s/[^a-za-z0-9_.-]//g; $basename =~ s/^[^a-za-z0-9]*//; if $basename empty now, have chose name other way. if file of same name exists,

tooltip - Rgraph show key when cliking line -

i want display tooltip when click line graph, along usual tooltip value. there way link canvas key area?! are referring interactive key? http://www.rgraph.net/docs/interactive-keys.html it's not tooltip though - highlights entry on key. edit: there's example of poly object has been positioned sit on line(s) , when clicked highlights appropriate key entry. wasn't simple accomplish (lots of playing coordinates) - neither trying remember wifes birthday when drunk: http://www.rgraph.net/tests/spline-key-clickable.html

SAS - Write filenames to a dataset, or to an external file? -

is there way, in sas, grab filenames (.txt files) directory (e.g. c:\temp) , write them dataset? or possibly write them separate .txt. file? i'm trying find examples online haven't been able locate anything. the simplest way named pipe , can read from. eg: filename mydir pipe 'dir c:\temp\*.txt /b'; data mydata; infile mydir lrecl=150 truncover; input @1 line $150.; run;

How to detect when networking initialized in /etc/init.d script on redhat 6 -

i have init.d script start process on boot , requires networking initialized. can use utility nm-online comes networkmanager package problem @ deployment nw not installed have have other reliable option can tell me network set , can connect other server on network. can keep trying till networking or connection set cause other problem related error reporting. here similar question asked other folk. how detect when networking initialized in /etc/init.d script? wait_for_network() { [ -z "${linkdelay}" ] && linkdelay=10 $info "waiting network..." if [ -f /usr/sbin/nm-online ]; nm-online -q --timeout=$linkdelay || nm-online -q -x --timeout=30 else check_for_network_up $linkdelay || check_for_network_up 30 fi [ "$?" = "0" ] && success "network startup" || failure "network startup" echo } i trying other approach can check route table. if network not up, route

ruby - Reliable persisted sidekiq task -

i working on ruby application creates todos , meetings. there reminders sent out respect each meeting or todo imagine. we using sidekiq , nice use sidekiq create scheduled jobs in x number of days/hours etc. my concern lose jobs if redis restarts. am write in assuming if redis restarts, lose jobs , if so, there can done it? if not sidekiq, else use? there several ways of doing that, go through link http://redis.io/topics/persistence . snapshotting technique snapshots of dataset on disk.

android - how to use websokets in phonegap application for notify user? -

i need write phonegap(ios , android) app in background listen websockets connection , notify user. plugin that, exist? or other way ? i'm pretty sure network stack (and therefore websocket connectivity) interrupted when application goes background. think have time register apns / gcm handler when os tells suspend application. you might want ask question on kaazing website (there few folks there know stuff) confirm this.

CSS background-position 100% (right) not working as expected -

i have simple div width less 100%, background image having background-position 100% 0. instead of bg image sticking right side of div, getting cut off, , seems think actual right position edge of body, not div background is. .bg { width:80%; height:500px; background-repeat: no-repeat; background-attachment: fixed; background-position: 100% 0; background-size: 50%; background-image: url(http://www.blackitty.net/photographs/photos/slideshow/slide/133/tofino_2013-11-24.jpg); } i made fiddle it: http://jsfiddle.net/bobmeador/j2mwx/ upper element shows problem. below full image can see getting cut off. any idea why seems using parent positioning rather div belongs to? i have same result when .bg div set width 100% , inside div set 80% width. seems ignoring container widths , using overall body width 100% reference. i tihnk problem background-attachment: fixed; , if remove image aligns right. http://jsfiddle.net/j2mwx/2/

menuitem - Deeply nested menu items do not fire on click - Android -

it may worth noting r.java file disappeared morning because used incorrect menu icon name in menu xml file. have since corrected name , regenerated r.java file. what have found out debugging: any menu item takes 4 clicks not fire onoptionsitemselected listener in android. can make these 4-click menuitems fire onoptionsitemselected listener? thanks. <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_sticker" android:showasaction="always" android:icon="@drawable/ic_action_add" android:title="add sticker"> <menu> <item android:id="@+id/menu_male" android:showasaction="always" android:title="male"> <menu> <item android:id=&quo