Posts

xsd - Multiple XML file with same root name refer to 1 XML schema: setting a unique key to element -

Image
eg. have 2 separate files same root name can seen in employment.xml , education.xml. common word between both files word "code". ensure "code" , values not repeated in respective files. so moving onto schema, how make verification code only. since apprently 2 selectors not work in 1 . trying prevent writing , make schema reusable more similar lists "code". my idea create function thing. in sense, if identifies "employmentstatus", should result in 'xs:selector xpath = "employmentstatus"' , if identifies "education", should result in '"xs:selector xpath = "education"' etc. is possible in xml schema? suggestions great? xml files: employment.xml education.xml xml schema: rootwithattribut.xsd "xs:selector xpath = "*" " this works because * matches element node. works temporarily have 1 element currently. has helped element name. works. ...

ios - Using Twitter framwork to get tweet details -

i developing ipad application running in ios 5.1 in twitter integration has been done. able tweet using application using twitter.framework. want details of tweet made. used twrequest in framework post query as -(ibaction)querybuttontapped:(id)sender{ twrequest *request = [[twrequest alloc] initwithurl:[nsurl urlwithstring:@"http://search.twitter.com/search.json?q=indians&rpp=5&with_twitter_user_id=true&result_type=recent"] parameters:nil requestmethod:twrequestmethodget]; [request performrequestwithhandler:^(nsdata *responsedata, nshttpurlresponse *urlresponse, nserror *error) { if([urlresponse statuscode] >= 200){ nserror *error; nsdictionary *dict = [nsjsonserialization jsonobjectwithdata:responsedata options:0 error:&error]; uialertview *alertview1 = [[uialertview alloc] initwithtitle:@"twitter response" message:[nsstring...

jquery - Custom validation with ajax.....Here remote method is not working -

i using jquery.validate.js, in code below both remote , regex works separately when try integrate both not working. can me did wrong? <head> <script type="text/javascript"> $(document).ready(function(){ $("#clear").click(function(){ $("input[type=text], textarea").val(""); }); }); function submitform() { $.validator.addmethod("subtitleval", function(value, element) { return this.optional(element) || /^[a-za-z\s\_,\.:;()''""]+$/.test(value); }, "enter valid name."); var validator = $("#company").validate({ errorplacement : function(error, element) { offset = element.offset(); error.insertbefore(element) error.addclass('message'); error.css('position', 'absolute'); error.css('left', offset.left + element.outerwidth()); ...

groupwise maximum - how to get column of latest row mysql -

Image
the query below fine me except content in column message_content of first row in table al_messages . how can content of latest row? select a.conversation_id, a.creator_id, c.screen_name creator_screen_name, c.first_name creator_first_name, c.last_name creator_last_name, count(d.message_id) messages_count, message_content al_conversations inner join al_subjects b on a.subject_id = b.subject_id inner join al_members c on a.creator_id = c.member_id inner join al_messages d on a.conversation_id = d.conversation_id a.subject_id = 301 , b.creator_id = 17 group a.conversation_id the query result:

How To use Rendering plugin in grails -

Image
i using rendering plugin creating pdf.. plugin working fine.. but when click on download pdf.. rendering me page ![enter image description here][2] and gives me result in pdf format. . and gives me option save![enter image description here][3] but wanted.. when click on download pdf button(image 1) .. show me direct save window (image 3) rather rendering me page.. sorce code : def renderformpdf(long id){ def empinstance= emp.get(id) renderpdf(template:"view", model:[empinstance:empinstance, pdfrendering:true]) } try this def renderformpdf(long id){ def empinstance= emp.get(id) response.setcontenttype("application/pdf") response.setheader("content-disposition", "attachment; filename=filename.pdf") renderpdf(template:"view", model:[empinstance:empinstance, pdfrendering:true]) }

Perl variable garbage collection and refcount -

i have little confuse variable garbage collection in perl in following example : #!/bin/env perl use v5.14; package mytestmodule { sub foo { $fh = shift; for(1..100){ "put"; $fh->autoflush(1); print $fh "heloo\n"; sleep 1; } } } package main; use anyevent; use anyevent::fork::template; $cv = anyevent->condvar; $anyevent::fork::template->fork->run("mytestmodule::foo", sub { $fh_fh_fh = shift; $w_w_w; $w_w_w = anyevent->io(fh => $fh_fh_fh, poll => "r", cb => sub { $w_w_w unless 1; sysread $fh_fh_fh, $rslt, 10; "got:", $rslt; } ); }); $cv->wait; in above code, if remove $w_w_w , because of anyevent->io create object, reference become zero, reclaimed perl, make code not work ( cb not called ); ... $anyevent::fork::template->fork->run("mytestmodule::foo", sub { $fh_f...

r - Unauthorized error with ROAuth -

i using streamr package pull tweets twitter streaming api. working fine till recently. - getting error whenever handshake. > library(roauth) > requrl <- "https://api.twitter.com/oauth/request_token" > accessurl <- "https://api.twitter.com/oauth/access_token" > authurl <- "https://api.twitter.com/oauth/authorize" > consumerkey <- "<myconsumerkey>" > consumersecret <- "myconsumersecret>" > my_oauth <- oauthfactory$new(consumerkey=consumerkey,consumersecret=consumersecret,requesturl=requrl,accessurl=accessurl,authurl=authurl) > my_oauth$handshake(cainfo = system.file("curlssl", "cacert.pem", package = "rcurl")) error: unauthorized i have tried recreating new application on dev.twitter.com , still same error. have tried changing callback url , access levels - no use. have tried using master branch of roauth github. idea going wrong? using r 3.0.1 ...