Posts

Showing posts from February, 2013

sql server - php adodb MSSQL connection -

i have linux server i'm trying use php adodb connect mssql server. include('adodb5/adodb.inc.php'); $conn =& adonewconnection('odbc_mssql'); $dsn = "driver={sql server};server=msserver;database=northwind;"; $conn->connect($dsn,'sa','password')or die("unable connect server"); i've install mssql through yum etc , know server can connect i've tried following: $db = @mssql_connect("msserver","sa","password") or die("unable connect server"); mssql_select_db("northwind"); // simple query, select version of // mssql , print it. $version = mssql_query('select @@version'); $row = mssql_fetch_array($version); echo $row[0]; // clean mssql_free_result($version); any ideas why adodb wont connect, or examples on how can connect appreciated. i've solved looking @ forum: http://ourdatasolution.com/support/discussions.html?topic=4200.0 the cor...

apache - mod_spamhaus or any proxy checker -

we have advertisement server , have fraudulent advertisements users. have warning if ad different country, they´re using proxy servers.. so, had few ideas how solve problem. 1) when user came website, check ip, if anonymouse, write db (or can deny him instantly htaccess?) , ban him? 2) use mod_spamhaus, isn´t slow? what´s experiences? i think both options going little slow, @ least @ beginning, ips being unknown. i don't know mod_spamhaus deep enough tell how slow be. regarding option 1, it's easy implement using proxy checker , 1 example shows if ip address proxy, type , country. handy. anyway, proxy checker going delay each request unknown new ip addresses(you can save ip addresses in db , query db result there, faster know ips). @ least @ beginning options looks slow too, when have lot of proxy ips ban in database going fast.

javascript - BackboneJS and JQuery plugins architecture playing together in a MiniPhotoshop project -

i'm rather new backbonejs. exciting stuff worked plain jsons until now. :) used design jquery widgets , plugins encapsulate logic / presentation. backbone seems more flexible mv* approach. i redesigning "mini-photoshop" project work. javascript/html page can add elements labels, images, buttons, change properties, drag&drop them around , change z-index, etc. i took approach of having backbone collection of elements represents drawing. thought of using jquery plugin able create workspace in everypage i'd like. so like: $('.wrapper').miniphotoshop({ elements:elements, // bb collection painter:painter // object knows how draw }); the painter seperated plugin change way collection drawn. so objects here are: miniphotoshop - jquery plugin gets bb collection painter - object consisting of methods know how draw elements. propertybox - jquery widget when element clicked on shows properties. my question jquery-backbone salad make s...

c++ - Overflow issues when implementing math formulas -

i heard that, when computing mean value, start+(end-start)/2 differs (start+end)/2 because latter can cause overflow. not quite understand why second 1 can cause overflow while first 1 not. generic rule implement math formula can avoid overflow. suppose using computer maximum integer value 10 , want compute average of 5 , 7. the first method (begin + (end-begin)/2) gives 5 + (7-5)/2 == 5 + 2/2 == 6 the second method (begin + end)/2 gives overflow, since intermediate 12 value on maximum value of 10 accept , "wraps over" else (if using unsigned numbers usual wrap 0 if numbers signed negative number!). 12/2 => overflow occurs => 2/2 == 1 of course, in real computers integers overflow @ large value 2^32 instead of 10, idea same. unfortunately, there no "general" way rid of overflow know of, , depends on particular algorithm using. , event then, things more complicated. can different behaviour depending on number type using under hood , th...

Rails 3 & Devise: Error when logout -

problem solved klaustopher answer fixed problem. the problem can't logout when have <%= current_user.email %> or <%= current_user.username$> in layouts/application.html.erb when delete line out of application.html.erb, able logout without errors. i've searched on google not find problem. my application.html.erb: <!doctype html> <html id="html"> <head> <title><%= content_for?(:title) ? yield(:title) : "contractbeheersysteem" %></title> <%= stylesheet_link_tag "application", "simple_form", "gegevens", "drop-down-menu", "table", :media => "all" %> <%= javascript_include_tag "autocomplete-rails.js" %> <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js", "appli...

c# - LINQ get collection in anonymous type -

i have following linq statement: var query =(from item in _itemrepository.findall() item.id == "20649458" singelitem in item.listofchildren singelitem.property == "singelitem" manyitems in item.listofchildren manyitems.property == "many" select new { item.id, singelitem, manyitems }); var result = query.tolist(); tasks collection of objects , clause tasks.property == "something" matches several items in collection, when use anonymous type in select, 1 item (the first) of matching results instead of collection of tasks. how can matching tasks in collection? edit: happends flat objects, (just db result set join statement). when don't use anonymous type you're dealing entity clas...

iphone - How to limit pinch out to the default view size -

Image
i working on pdf based application trying implement uipinchgesturerecognizer.i want limit pinch off functionality when user reaches default view size 640,960. in current implementation user able pinch in/out infinite. - (void)pinchzoom:(uipinchgesturerecognizer *)gesturerecognizer { if ([gesturerecognizer state] == uigesturerecognizerstatebegan || [gesturerecognizer state] == uigesturerecognizerstatechanged) { if (!zoomactive) { zoomactive = yes; uipangesturerecognizer *pangesture = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(panmove:)]; [pangesture setmaximumnumberoftouches:2]; [pangesture setdelegate:self]; [self addgesturerecognizer:pangesture]; [pangesture release]; } [gesturerecognizer view].transform = cgaffinetransformscale([[gesturerecognizer view] transform], [gesturerecognizer scale], [gesturerecognizer scale]); [delegate leavesvi...

php - creating a web app which allows a member registers other members -

am in tight end, contracted create php web application allows 1 register , user can register 5 more others, other users registered can register 5 members each. i expected create database save users particular member registered in array, whereby list them out in table form, the confusing part how factor out database structure can save 5 users, when queried list them out (am confused save them in array or separate table). i'd prefer saving in array any other user gets registered of 5 registered, linked main referee , of them counted , whole process stops user registers 5 members , 5 members register 5 users each his/her account make 25 total each account it illustrated as 1. parent - 5 children - then 5 children bears 5 children each, parent acknowledge both children , grandchildren, once children , grandchildren gets 25 in number, reproductive cycle ends parent, children can carry on make theirs 25 also i have made database needed guidelines build have 3 days c...

javascript - isPrototypeOf in indesign -

hi relativly new indesign scripting , figure out if object subtype of class. example: want iterate on page items , take not graphic: layer = app.activedocument.layers[layerindex]; (i = 0; < layer.allpageitems.length; i++) { alert(layer.allpageitems[i].reflect.name) if(layer.allpageitems[i].isprototypeof (graphic) ) { alert("graphic"); } else { .... } } howver if nver matches. there examples of how use isprototypeof ? have test if object of type or subclass of it? edit : clarify, trying test if have instance of inherited graphic. but far can see seems impossible. you want instanceof operator. if (layer.allpageitems[i] instanceof graphic) { alert("graphic"); } else { .... } you use isprototypeof have reverse order , prototype itself, not constructor. this: if (graphic.prototype.isprototypeof(layer.allpageitems[i])) { alert("graphic"); } else { .... }

php - Using data from multiple tables -

so here's issue: have 3 tables, overlapping information (specifically, username) in each. except username row isn't named same thing in every table. because username specific user, makes sense other information user based on username. here's have. (the first function returns query, second function returns information in array (or supposed to, anyway). function get_user_by_id($id) { global $connection; $query = "select * ownerorganization, owner, queue_acl"; $query .=" owner.ownerid=ownerorganization.ownerid"; $query .=" , owner.ownerid=queue_acl.user_id"; $query .= " , owner.ownerid ='{$id}'"; $result_set = mysql_query($query); confirm_query($result_set); if ($user = mysql_fetch_array($result_set)) { return $user; } else { return null; } } function get_user_id() { if (isset($_get['ownerid'])) { return get_user_by_id($_get['ownerid']); ...

php - How to make sure an object exists before performing operations -

i have index.php loads bites of page other php files. @ top of index.php have require_once statements including php class handles db connection , instantiate object of class: <?php require_once 'libs/databasehandler.php'; $dbh = new databasehandler('localhost', 'root', '*******', 'pride2012'); require_once 'pages/01_includes.php'; require_once 'pages/02_menu.php'; require_once 'pages/03_slider.php'; require_once 'pages/04_news.php'; ?> the page-bit using db managing class 04_news.php , enough constructing object before 04_news.php loads make myself sure object exists before database related operations start? defining object prior operations enough. alternatively, can use built-in __autoload( ) method dynamically load classes needed. take @ php.net: autoloading classes more information.

scheduled tasks - Which schedulers for rails 3.1 or above can stay on all the time on ubuntu 12.04? -

we looking scheduler can stay on time our rails 3.1 app on ubuntu 12.04 server. using rufus scheduler killed passenger accident , can not stay on time. there quite few of schedulers available out there. looking simple , easy use 1 our rails app. primary purpose of scheduler fire off periodically check session timestamp , reset if necessary. recommendation? thanks. have looked @ clockwork? https://rubygems.org/gems/clockwork

c# - Request and Response Cookies doesn't work in a Console app -

i have windows console works fine when make httpwebrequest user, if try other user, it's not works. think problem in cookies, because obtain less values when use user not works when use user works. here's code: mainconsole: namespace consoleapplication1 { class program { static void main(string[] args) { var mymanager = new requestmanager(); mymanager.sendpostrequest("http://www.example.com","", true); var myresponse = mymanager.sendpostrequest("http://www.example.com/login.phtml", "login=username&pass=password&action=login&%3e%3e+login_x=33", true); var content = mymanager.getresponsecontent(myresponse); console.write(content); console.readline(); } } } requestmanager class: namespace consoleapplication1 { public class requestmanager { public string lastresponse { protected set; get...

Parsing levels of XML in jquery -

here xml. going have many degrees, each degree have many schools, , each school have many specializations. page gave 3 dropdowns. not asking code preform onclicks nested dropdown updates. (unless has cool recurrence pattern work. this problem having when ask degree degrees node , add text() dropdown text degree, school, spec... want dropdown "degree 1", "degree 1 school 1 spec...", sure idea, have tried adding "degrees.filter, , children" nothing. i need handle on how parse xml nested nodes once level @ time. thanks time. <degrees> <degree> degree 1 <schools> <school>school 1 <specializations> <specialization>specialization 1</specialization> <specialization>specialization 2</specialization> </specializations> </school> <school>school 2 <specializations> <specialization>specialization 3</specialization...

apex code - Salesforce webservice call -

i trying following; from salesforce.com call http or post , post json object using httprequest system class. getting following exception (it https): java.security.cert.certificateexception: no name matching issue mywebsite.com found i have configured website in remote host already. have idea wrong here? are missing call req.setclientcertificatename? i have apex code salesforce calls out web service on site. protected client-side ssl. website, host, authorizes client cert salesforce.com (vs traditional web ssl browser client authorizes server cert). can create self-signed certificate in salesforce admin under certificate , key management , reference call req.setclientcertificatename. here code production org: httprequest req = new httprequest(); req.setmethod('post'); req.setheader('host', 'www.mywebsite.com'); req.setendpoint('https://www.mywebsite.com/post.asp'); try { req.setclientcertificatename('cert_for_mywebsite')...

c++ - How to get the winapi id of a thread that has been created using the standard library? -

c++11’s standard library contains <thread> allows threads created. however, windows api requires id functions ( postthreadmessage , namely). how can it? remark: std::thread::get_id() doesn’t seem work: postthreadmessage(m_thread->get_id(), wm_quit, 0, 0); e:\documents\khook\khooker\hook_runner.cpp(129): error c2664: 'postthreadmessagew' : cannot convert parameter 1 'std::thread::id' 'dword' use member function native_handle() . provides native thread handle. can call getthreadid() on it.

Mule 3: Creating a RESTful web service endpoint -

i'm trying create endpoint (i think that's right word?) in mule 3 responds requests. mule application runs within javaee web app within web container. in web.xml, have mulerestreceiverservlet servlet defined handles requests urls begin "/rest/": <web-app> <listener> <listener-class>org.mule.config.builders.mulexmlbuildercontextlistener</listener-class> </listener> <servlet> <servlet-name>mulerestservlet</servlet-name> <servlet-class>org.mule.transport.servlet.mulerestreceiverservlet</servlet-class> <load-on-startup /> </servlet> <servlet-mapping> <servlet-name>mulerestservlet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app> my <flow> looks this: <flow name="myflow"> <servlet:inbound-endpoint path="category/service" /> <comp...

build settings - How to set ARMV6 assembler codegen to ARM mode in Xcode 4? -

in xcode 4.3.2, build recommendation: upgrade armv6 assembler codegen thumb arm mode. i can either accept or reject recommendation , change gets made me. problem recommendation seems pop after i've built , run few times. integrate setting defaults, can't find setting in build settings let me preemptively. the setting want "gcc_thumb_support". determined examining (through version control) change made project settings after let xcode make change me, , setting saw. i've seen in project/target settings in 2 ways: gcc_thumb_support , compile thumb but pretty convinced same setting.

.net assembly - C# load raw bytes -

i've developped small decrypt , execute application , i'm stuck @ execution part. succesfully execute .net assemblies using method below: assembly asm = assembly.load(decryptedbytes); if (asm.entrypoint == null) throw new applicationexception("no entry point found!"); methodinfo epoint = asm.entrypoint; object ins = asm.createinstance(epoint.name); epoint.invoke(ins, null); but when try allocating executable region using post application crashes the useful information this: fault module name: stackhash_0a9e here code: const uint page_execute_readwrite = 0x40; const uint mem_commit = 0x1000; [dllimport("kernel32.dll", setlasterror = true)] static extern intptr virtualalloc(intptr lpaddress, uint dwsize, uint flallocationtype, uint flprotect); private delegate int intreturner(); intptr buf = virtualalloc(intptr.zero, (uint)decryptedbytes.length, mem_commit, page_execute_readwrite); marshal.copy(decryptedbytes, 0, b...

manifest - JBoss java.io.IOException during deployment -

i building jboss application server module, on jbossas 7.1.1. while trying modify classpath in manifest file, ran error: 12:30:53,097 info [org.jboss.as.server.deployment] (msc service thread 1-4) jbas015876: starting deployment of "mydeployableproject.war" 12:30:53,141 error [org.jboss.msc.service.fail] (msc service thread 1-1) msc00001: failed start service jboss.deployment.unit."mydeployableproject.war".structure: org.jboss.msc.service.startexception in service jboss.deployment.unit."mydeployableproject.war".structure: failed process phase structure of deployment "mydeployableproject.war" @ org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:119) [jboss-as-server-7.1.1.final.jar:7.1.1.final] @ org.jboss.msc.service.servicecontrollerimpl$starttask.startservice(servicecontrollerimpl.java:1811) [jboss-msc-1.0.2.ga.jar:1.0.2.ga] @ org.jboss.msc.service.servicecontrollerimpl$starttask.r...

Spotify Play Button (undefined or sorry the play list is empty) -

hola puesto un play button que estaba funcionando ok hasta hace unos días en que sin modificar el código ha empezado poner en la web undefined en una lista y sorry play list empty en la otra lista. ¿que ha podido pasar? ¿han cambiado algo? en el generador de codigo tambien al pegar la uri da error al genera el código. el caso es que ha estado funcionando ok intento ahora en inglés (now in english) hi, i've put in web play button 2 playlist. yesterday ok, today give me 1 error, playlist 1 (undefined) , playlist 2 (sorry play list empty) dont understand beacause function ok today dont work. the playlist uri 1: spotify:user:intergus:playlist:1je2hr6sajhhorx9ecdf8o playlist uri 2: spotify:user:intergus:playlist:5kyek1elishdxuswdh9w74 those playlist work ok in spotify. please me thanks spotify's playlist service feeling bit sad — causing sorts of problems play button. if nothing in code has changed, unfortunately there's nothing can wait out.

javascript - jQuery AJAX with Multiple Array data Parameters -

i've posted single array, can't figure out how send more 1 array in ajax post. here code 1 array: var = new array(); // fill array var a_post = {}; a_post['array1[]'] = a; $.ajax({ url: "submitorder.php", data: a_post, type: 'post', success: function(data) { alert(data); } }); and in submitorder.php have: $array1= $_post['array1']; foreach ($array1 $a => $b) echo "$array1[$a] <br />"; this works fine. however, when try add second array b_post data: field, doesn't work. tried data: {a_post, b_post}, , few variations of that, can't work properly. while i'm @ it, how load submitorder.php after posting rather show alert of data? update using nicolas' suggestion, got work changing data field to: data: {'array1':json.stringify(a), 'array2':json.stringify(b)}, however, need add rest of form data has been input user. can data $(this).serialize() if...

PHP File include error -

i have following code in php page. times when delete cache2.html file, expect php recreate , next person cache2.html instead of executing php code. following warning times on page , no content. because of multiple users accessing php concurrently? if so, how fix it? thank you. warning: include(dir1/cache2.html) [function.include]: failed open stream: no such file or directory in /home/content/54/site/index.php on line 8 <?php if (substr_count($_server['http_accept_encoding'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); $cachefile = "dir1/cache2.html"; if (file_exists($cachefile)) { include($cachefile); // output contents of cache file } else { /* html (built using php/mysql) */ $cachefile = "dir1/cache2.html"; $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); ob_flush(); // send output browser } ?> calls file_exists() cached, it's you're getting ...

Jetty - Basic Auth sending 403 instead of 401 while configuring Gerrit -

i have war file (specifically, gerrit.war ), expects container (specifically, jetty) handle basic http authentication , pass information down webapp . don't have access code or web.xml file. i'm following these instructions use exiting jetty configs wrap gerrit in realm, when access base url (/login/) 403 (forbidden) error. i'd expect 401 prompt browser ask credentials (no?) i can post files haven't changed example above. let me know if help, however.. there many ways in can occur. in case occured because constraint did not have role set. code generated 403: private void secureservlet(servletcontexthandler handler) { constraintsecurityhandler security = new constraintsecurityhandler(); security.setrealmname(this.realm); security.setauthenticator(new basicauthenticator()); security.setloginservice(new webloginservice(this.engine)); constraint constraint = new constraint(); constraint.setname(constraint.__basic_auth); //...

"read" in Node.js REPL -

is there function in node.js reads characters stream until reads complete javascript expression , returns expression? "read" part of read-eval-print loop? i want read json objects stream , process them come in. don't need interactive parts of repl in use case. {"r": 0.0, "e": -0.2, "t": 0.98} // callback happens here content of object {"r": 0.2, "e": 0.0, "t": 1.0} // callback happens here content of object // etc a complete javascript expression not valid json serialization, e.g. { foo: 'bar' } valid js expression, invalid json (json requires double-quoted object keys , string literals). if know json objects end on newline boundary, can accumulate lines in variable, trying json.parse() until succeed (an unsuccessful json.parse() throw syntaxerror ), not allow detect errors in input (you'll accumulate lines forever). if provide more details , how expect receive, there might o...

sql server - Bulk load data conversion error while importing DATETIME data -

i found few posts on topic on stackoverflow, none seem solve problem. i trying set bulk imports sql server 2008 express, , failing import datetime values. issue seems basic must missing simple, , i'm hoping else can catch problem. the problem i importing table: create table [dbo].[bulktest]( [reportdate] [datetime] not null ) this format file (bulktest.fmt): 10.0 1 1 sqldatetime 0 0 "\r\n" 1 reportdate "" this data being imported (bulktest.tab): reportdate 2010-12-31 2011-01-31 this import statement: bulk insert dbo.bulktest 'q:\...\bulktest.tab' ( check_constraints, tablock, formatfile='q:\...\bulktest.fmt', firstrow=1, datafiletype='char' ); these errors: bulk load data conversion error (type mismatch or invalid character specified codepage) row 1, column 1 (reportdate). msg 4864, level 16, state 1, line 1 bulk load data c...

cocoa - NSTableView makeViewWithIdentifier across nibs -

i have similar question cocoa - view-based nstableview, using 1 cell in multiple tables , amplified apple's own docs makeviewwithidentifier:owner: "typically identifier associated external nib in interface builder , table view automatically instantiate nib provided owner." this seems imply should able store nstablecellview in separate nib nib containing nstableview . however, in experimenting, have ever been able obtain cells contained within tableview i'm calling on. i.e., if cut , paste cell new .xib file, tableview can no longer find it. doing wrong, or impossible , somehow misreading apple's docs? i ran problem , think cannot use makeviewwithidentifier:owner: when you're using dedicated nib populate view-based tables. the problem has file owners (ie. view controllers). makeviewwithidentifier:owner: seems intended used "self" owner simple custom views. generally if have separate nib custom view outlets, you're goin...

python - downloading a file from a page -

i make script (in language, preferably python or perl) download specific type of file being streamed web page. not know files location have find out finding files being streamed page, , selecting 1 want based on file type. a similar example want download video off youtube, there no pattern or way find url except finding files being streamed computer. the part cannot figure out how find files being streamed page. rest can myself. file name not mentioned anywhere in source of html page. example of problem... this works fine: import urllib urllib.urlretrieve ("http://example.com/anything.mp3", "a.mp3") however not: import urllib urllib.urlretrieve ("http://example.com/page-where-the-mp3-file-is-being-streamed.html", "a.mp3") if can me figure out how download files page or find files being streamed appreciate it. all need know language/library/method can accomplish this. thanks

how to read mail from Google mail and mark as save and save mail in local folder with C# .NET -

i trying build winform app to read mails google app save mail , attachment local folder mark mail read save email body , attachments sql-server database the latter ok i'm having trouble first 3. i've everywhere , people telling me how send mail on winform app not how read, mark , save content , attachment. codeproject next best resource online after (imho.) here well-reviewed sample projects long way: http://www.codeproject.com/articles/14304/pop3-email-client-net-2-0 http://www.codeproject.com/articles/6062/a-pop3-client-in-c-net http://www.codeproject.com/articles/188349/read-gmail-inbox-message-in-asp-net http://www.codeproject.com/articles/34495/building-your-own-mail-client-using-c http://www.codeproject.com/articles/15611/pop3-email-client-with-full-mime-support-net-2-0

Google Apps Script UrlFetchApp with JSON Payload -

i'm trying post web service expecting json payload using google apps script. i'm using following code: var options = { "method" : "post", "contenttype" : "application/json", "headers" : { "authorization" : "basic <base64 of user:password>" }, "payload" : { "enddate": "2012-06-03" } }; var response = urlfetchapp.fetch("http://www.example.com/service/expecting/json", options); on server side i'm getting following error: warn [facade.settingsservlet] 04 jun 2012 15:30:26 - unable parse request body: enddate=2012-06-03 net.liftweb.json.jsonparser$parseexception: unknown token e i'm assuming server expecting { "enddate": "2012-06-03" } instead of enddate=2012-06-03 but don't know how make urlfetchapp it. i not understand server side error 'payload' parameter must string specified her...

iphone - Get Correct Output : NSXML Parser -

my xml file : <?xml version="1.0" encoding="utf-8"?> <plist version="1.0"> <count count="3" /> <spac> <opt>aa</opt> <opt>bb</opt> </spac> </plist> i have used following line of code nsxml parssr : - (void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qualifiedname attributes:(nsdictionary *)attributedict { if([elementname isequaltostring:@"spaces"]) { //initialize array. appdelegate.api = [[nsmutablearray alloc] init]; } } - (void)parser:(nsxmlparser *)parser foundcharacters:(nsstring *)string { [appdelegate.api addobject:string]; nslog(@"the count :%d", [appdelegate.api count]); } - (void)parser:(nsxmlparser *)parser didendelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qname...

audio - Detect Song with Java -

is there library detecting playing song java? not winamp or wmp, generally, technique listen audio output example? thank you. edit: no, want listen audio output , decide whether there's song playing right now, or not. not identifying. there's song or not (playing right now). you can take fourier transform of audio input , compare known frequency distributions of various songs in database. if close enough, can same. this has flaws, it's idea can work off of.

google app engine - GAE/J + Restlet + Backend + Cron Job + 405 Error: -

hoping or direction following issue facing. i getting 405 (method not allowed) error when using gae backends cron job on live system. cron job started on backend defined, throwing 405 error after delegating call target restlet. url route follows per logs. http://backendname.appid.appspot.com/cronurl my current configuration follows: gae/j: 1.6.1 restlet: 2.1 rc5 i've have done following: defined attachment of cron url route java class in restlet application i have backends.xml defined set backend public see if resolves issue, didn't i have cron.xml defined set url cron job set target backend instance name please let me know if more information. thanks! have marked restlet @get annotation? a cron job invoke specified url using http get. other verbs (e.g., put, post, delete) not supported cron jobs.

shell - Replacing domains of e-mail addresses with just one domain -

i edit file containing set of email ids such domain names become generic. example, peter@yahoo.com, julie@hotmail.com, philip@gmail.com peter@generic.com, julie@generic.com, philip@generic.com i used following sed command, sed '/@/,/.com/ s//generic/' filename.txt here sed replaces '@' 'generic , .com 'generic' , not content in between @ , .com use sed 's/@[^,]*/@generic.com/' this replace after "@" until first comma generic.com, thereby fixing domain, , leaving ending comma in tact. since seem have confusion, ranges ( /regex/,/otherregex/ ) select number of lines, not positions within line.

windows phone 7 - Folder navigation -

i recent intrested @ skydrive api , have problem folder navigation. resolve 2lvl depth deeper have problem. thinking folderid , stroe in string[][], there has more gently. suggest something? what need tree object structure need store. should try this public class folder { public folder(folder parent, string folderid) { this.folderid = folderid; this.parent = parent; } public folder parent { get; private set; } public string folderid { get; private set; } } you can use , create them in loop structure starting parent.

Merging content of 2 directories on separate git branches and integrating branches later -

i have project hosted @ github. developing new set of features on shared topic branch named metamodel pushed github. @ same time have ongoing bug-fix work happening on master. plan integrate metamodel master @ point metamodel branch go away. both of these branches contain 2 directories contents want merge 1 single directory. @ point 2 directories divergent between 2 branches. furthermore, continue diverge more until branch integration. what happen when go integrate branches if have merged 2 directories on each branch independently? we, project, have elected integrate branches means of rebasing in case has bearing here. git doesn't care directories, or file names. cares content. , rather intelligent merging (it'll figure out when things moved or renamed). so, basically, in answer question of "what happen when integrate these branches together", answer - "i don't know." haven't seen content. can tell git rather efficiently compa...

Why doesn't my file get uploaded to my java servlet? -

well i'm trying upload file servlet web interface. i've been using apache commons fileupload following tutorial , integrating servlet. somehow can't manage file uploaded. here's form in web page: <form class="well" action="gentreeuploader" method="post" enctype="multipart/form-data"> <label>choose file:</label> <center><input type="file" class="input-xlarge" name="wordfile"></center><br> <center><span class="help-block">note: after clicking "upload file!" of data contained in file uploaded database</span></center><br> <center><input class="btn btn-primary" type="submit" value="upload file!"></center> <input type="text" name="tester" value="xoxoxo" /> <input type="...

Can I start new row of CSS table cells without a row wrapper element? -

given markup this: <div class="a">a</div> <div class="b">b</div> <div class="a">a</div> <div class="b">b</div> <div class="a">a</div> <div class="b">b</div> is possible style document this: |-------|---------| | | | | | b | | | | |-------|---------| | | | | | b | | | | |-------|---------| | | | | | b | | | | |-------|---------| (and if content in or b longer, neighbor grow match height)… without additional markup? i understand giving .a , .b display value of table-cell make 1 big row. what’s solution? not without flexbox , hasn’t landed in several major browsers yet, seems consensus.

.net - C#: copy range of cells from excel sheet and paste in HTML email body -

i have excel sheet. data pretty straight forward in few columns , rows. there formatting done on cells (example.. colors, bold font, etc). using c# send email. wish copy contents of excel sheet , paste in body of email formatting maintained. is possible? talking bs? that's not easy one. mean have check style of every character in every cell! wouldn't easier send excel sheet? if provide more information why doing might able suggest alternatives won't time consuming! edit: the easiest use workbook.sendmail() method. the code: excel.workbook myworkbook = xlapp.workbooks["book1.xls"];` string recipients = "elvispresley@gmail.com"; string subject = "no need open attachment, lazy ****"; bool returnreceipt = false; myworkbook.sendmail(recipients, subject, returnreceipt); note recipients parameter typed system.object argument passed in can string[] if have multiple recipients.

node.js - node+now.js+connect gives me an error -

i installed node_module connect use static method. code: var http = require('http'); var connect = require('connect'); var nowjs = require("now"); var app = connect(); app.use(connect.static('/var/www/www.domain.com/htdocs')); app.use(function(req, res){ res.end(); }); http.createserver(app).listen(8001); var = nowjs.initialize(http); but error: [typeerror: object #<object> has no method 'listeners'] typeerror: object #<object> has no method 'listeners' @ object.wrapserver (/home/chris/nowjs/node_modules/now/lib/fileserver.js:23:29) @ [object object].initialize (/home/chris/nowjs/node_modules/now/lib/now.js:181:14) @ object.<anonymous> (/home/chris/nowjs/multiroomchat_server.js:15:22) @ module._compile (module.js:446:26) @ object..js (module.js:464:10) @ module.load (module.js:353:31) @ function._load (module.js:311:12) @ array.0 (module.js:484:10) @ eventemitter._...

ruby on rails - How to add overlay to Google map via ajax call -

working gmaps4rails , rails 3.2 , trying add overlay on top of google maps when user clicks checkbox "show radius" , circle show on map radius around user's location. i know how create js callbacks tied google map created via gmaps4rails, how retrieve map dom within rails controller itself? presumably, i'd call "showcircle" function within .js.erb template or similar.

javascript - Firefox setTimeout + jQuery fade loop inconsistent, stops early, won't cycle -

http://jsfiddle.net/x6pcd/11/ i'm trying make slideshow fades between several absolute-positioned div's. on chrome, ie9, opera code below works fine. on firefox, timeout goes once or twice, stops. if remove js section marked below, loops properly. <style> .slide {position:absolute; top:0; left:0; width:300px; height:200px} </style> <div id="slides" class="slides"> <div class="slide slide1" style="background:#c66"> <div class="swap_links"> <a href="javascript:" class="active">1</a> <a href="javascript:">2</a> <a href="javascript:">3</a> </div> </div> <div class="slide slide2" style="background:#6c6"> <div class="swap_links"> <a href="javascript:">1</a> <a href="javascript:" class="active">2...

python - Different json encoders for different "depths" -

i write json encoder knows when expand object, or leave in abbreviated form. the object have, has many properties, of collections of other objects (which in turn have own properties may collections, ad infinitum). json.dumps method return large strings if recursed through objects. is possible set "depth" objects found after depth not expanded further? first, should figure out whether you're getting hard disk savings here. don't think in percent difference, dollar cost of diskspace people running program. second, figured out hacky way of doing this: copy folder /lib/json/ folder outside of python install. name folder like, say, jsondepth go encoder.py , make 3 changes (line numbers python 2.7): line 411, change def _iterencode(o, _current_indent_level): if isinstance(o, basestring): yield _encoder(o) to def _iterencode(o, _current_indent_level): if(_current_indent_level > skip_indent_level): yield 'null...

ruby on rails - launching background process in capistrano task -

capistrano task namespace :service desc "start daemontools (svscan/supervise/svscanboot)" task :start, :roles => :app sudo "svscanboot&" end end now doesn't work: svscanboot process doesn't run. helped me find sleep : https://github.com/defunkt/resque/issues/284 other sources pointed me nohup , redirection , , pty => true , tried these. run "nohup svscanboot >/tmp/svscanboot.log 2>&1 &" # no run "(svscanboot&) && sleep 1" # no run "(nohup svscanboot&) && sleep 1" # yes! now, explain me why need sleep statement , difference nohup make? record above run equally if run user shell, problem in context of capistrano. thanks my simple solution make svscanboot.sh file @ remote server whatever code want run. in case svscanboot >/tmp/svscanboot.log 2>&1 in cap rake task add run "sh +x somefile.sh ...

javascript - Facebook graph api call to get app access token returns "unknown error" -

i building web app integrating facebook. have on facebook app id , app secret already. i'd use javascript retrieve app's access token make further app-to-user app requests. i'm following instructions here however, not make fb.api call working. tried fb.api('https://graph.facebook.com/oauth/access_token','get', {client_id:'xxxxx', client_secret:'xxxxx',grant_type:'client_credentials'}, function(response) { alert(json.stringify(response)); }); and fb.api("/oauth/access_token?client_id=xxxxxx" + "&client_secret=xxxxxxxx&grant_type=client_credentials", function(response) { alert(json.stringify(response)); ...

windows - Is there any way to detect whether client pipe's handle is closed when using NamedPipe? -

i wondering if there way detect status of client pipe's handle server side on windows platform. even though client closed pipe(disconnected) closehandle() function, there seems no way detect server side. using waitforsingleobject() handle object returns wait_object_0 , regardless of status of client handle. so, solution detect whether client pipe's handle closed or not server side less cost? if reading data pipe ( pipe_access_inbound or pipe_access_duplex ) error_broken_pipe when client closes end of pipe. if aren't ready process data pipe start reading ahead of time (using asynchronous i/o) in order detect when pipe broken. note if there more 1 handle client end of pipe, considered closed when last handle closed. might issue, example, if client inadvertently causes subprocess inherit copy of handle. i don't know of way detect client has closed outbound-only pipe without writing data it. best option may use pipe_access_duplex if incoming sid...

jaxb - Using SAX with JAXBContext -

i trying deserialize xml data newly created java content trees: i using sax, have java class under src\main\java\summaries.java , trying print document extracted: string xmlpath = "c:\\workspace-sts-2.8.0.release\\restclient\\src\\main\\resources\\dailysummary.xml"; string xmlpath2 = "/dailysummary.xml"; string xmlpath3 = "/src/main/resources/dailysummary.xml"; inputstream inputstream = null; inputsource inputsource = null; unmarshaller unmarshaller = null; jaxbcontext jc = null; try { // read file // or try xmlpath1 or try xmlpath3 inputstream = resttestclient.class.getclassloader().getresourceasstream(xmlpath2); inputsource = new inputsource(inputstream); saxparserfactory sax = saxparserfactory.newinstance(); sax.setnamespaceaware(true); xmlreader reader = sax.newsaxparser().getxmlreader(); saxsource saxsource= new saxsource(reader, inputsource); // use jaxb class[] classes = new class[1]; classes[0]= summaries.class; jc = jaxbcontext.newin...

java - Fix an unresponsive GUI due to JTextArea? -

i designing program has jeditorpane users can enter , compile java code. can run program in new process, , output displayed in jtextarea . accomplish extending jtextarea , adding member: private outputstream writer = new outputstream() { public void write(int b) { console.this.append(string.valueof((char) b)); } }; i have simple getstream() method returns outputstream wrapped in printwriter , , call system.setout() , system.seterr() printwriter . now here comes issue: if user compiles program lot of output sent console @ once (e.g., infinite loop of system.out.println() calls), entire gui hangs. have attempted fix using swingworker handle append() calls nothing seems work. is there way keep gui responsive if massive amounts of text being written jtextarea ? i'm assuming part of issue amount of time time taken update gui after append() call. there maybe way delay writing jtextarea small amount user can click button terminate process? ...

windows phone 7 - Clicking at start and end of SoundEffect playback in WP7 XNA -

i'm looping sound file: http://engy.us/misc/thrusterloop.wav . plays in windows on number of players, when load in soundeffect in xna has these annoying clicks @ start , end of playback. if loop while doesn't of these annoying clicks in middle. if play standalone sound, still click @ start. it's doing clicking both in emulator , on physical device. why doing this? there wrong sound file? it's 16-bit stereo 44.1 khz pcm wav file, assumed pretty standard. (edit2) captured sound produced through playback through xna , compared original waveform. take look: http://engy.us/pics/waveform_original.png http://engy.us/pics/waveform_emulatorxna.png something pretty screwed playback! 2 large amplitude changes must have been clicks heard. seems scramble first bit somewhat. putting silence @ start helped people because scrambled silence doesn't produce clicks. use program audacity take @ waveform of sound. can reduce or eliminate 'clicking' lin...

c# - Getting TextBox value from another page -

possible duplicate: asp.net pass value next page i requesting quantity user using text box , after doing calculations it, want display result on label on page. here code confirm.aspx.cs public partial class confirm : system.web.ui.page { protected void page_load(object sender, eventargs e) { if (request.cookies["user"] != null) { label2.text = server.htmlencode(request.cookies["user"]["username"]); label3.text = server.htmlencode(request.cookies["user"]["email"]); label1.text = server.htmlencode(request.cookies["user"]["items"]); } } protected void button1_click(object sender, eventargs e) { session.add("textbox1value", textbox1.text); response.redirect("total.aspx"); } } and here code page, total.aspx.cs public partial class total : system.web.ui.page { int totalprice...

asp.net - Forms authenticated on one web server, would like to be authenticated on another too -

we're using forms authentication (iis 7 , asp.net 3.5) on our domain, www.ourbusiness.com , having no problems. wish add additional asp.net servers on different domain -- newapp.ourbusiness.com -- , things such has been authenticated on www.ourbusiness.com authenticated on newapp.ourbusiness.com. i've seen scattered reports on how go this, provide additional guidance? understanding example, want servers use same machine key authentication cookie on 1 box others, we're doing on www.ourbusiness.com domain. i'm not sure else required or if there articles explaining steps involved. , help. you handle creating formsauthenticationticket , httpcookie yourself. way can set domain cookie handle subdomains. said servers need have same machine key well. formsauthenticationticket ticket = new formsauthenticationticket(1, username, datetime.now, datetime.now.addminutes(30), ispersistent, userdata, formsauthent...