Posts

Showing posts from January, 2011

sparql - where to get data about all european cities, villages from? -

i looking data european cities, villages , towns. interested in name, postal codes, telephone area codes, latitude, longitude, population , country belongs to. 1. can extract comprehensive amount of data from? 2. how query data linkedgeodata to begin with, tried extract data linkedgeodata ( http://linkedgeodata.org/sparql ). however, can't reasonable results. when following query executed, population occassionally appears, other fields left blank. select * { ?place <http://linkedgeodata.org/ontology/place> . optional { ?place <http://linkedgeodata.org/property/opengeodb:name> ?name . } optional { ?place <http://linkedgeodata.org/ontology/opengeodb:lat> ?lat . } optional { ?place <http://linkedgeodata.org/ontology/opengeodb:lon> ?lon . } optional { ?place <http://linkedgeodata.org/property/opengeodb:postal_codes> ?postal . } optional { ?place <http://linkedgeodata.org/ontology/opengeodb:telephone_area_code> ?tel

iphone - iOS is it possible to convert CLLocation into some sort of XYZ metric coordinate system? -

i'm building augmented reality game, , working cllocation rather cumbersome. is there way locally approximate cllocation xyz coordinate, expressed in meters origin starting @ arbitrary point (for example initial position when game started)? lets i'm working 1 mile radius , not care curvature of earth. is possible approximate or somehow simplify location based calculations local position tracking? alternatively, there coordinate system can used cllocation incorporates roll, pitch, yaw of cmattitude compass orientation? clarification: far understand, problem latitude , longitude units vary in size, depending on position on globe. should've specified x,y,z should in standard units, meters or feet. thank you! the haversine formula may useful. i found article on @ http://www.jaimerios.com/?p=39 code examples.

Performance penalty of using functor to provide a function or an operator as a C++ template parameter? -

i have family of complex functions performing similar tasks except 1 operator right in middle of function. simplified version of code that: #include <assert.h> static void memopxor(char * buffer1, char * buffer2, char * res, unsigned n){ (unsigned x = 0 ; x < n ; x++){ res[x] = buffer1[x] ^ buffer2[x]; } }; static void memopplus(char * buffer1, char * buffer2, char * res, unsigned n){ (unsigned x = 0 ; x < n ; x++){ res[x] = buffer1[x] + buffer2[x]; } }; static void memopmul(char * buffer1, char * buffer2, char * res, unsigned n){ (unsigned x = 0 ; x < n ; x++){ res[x] = buffer1[x] * buffer2[x]; } }; int main(int argc, char ** argv){ char b1[5] = {0, 1, 2, 3, 4}; char b2[5] = {0, 1, 2, 3, 4}; char res1[5] = {}; memopxor(b1, b2, res1, 5); assert(res1[0] == 0); assert(res1[1] == 0); assert(res1[2] == 0); assert(res1[3] == 0); assert(res1[4] == 1); char res2[5] = {}; me

c# - Hosting WCF service and static html files -

we developing application has static html pages + jquery on client side. client gets data rest-ful wcf service hosted in iis. i'm bit confused on how structure in vs/host it.one of pre requisite i'm not allowed put client side html static content asp.net app sake of it. my aim following: - have mechanism client dev , service dev can integrate there work easily, i.e on running single project should seeing there progress of there work. - separate client , service projects allowed, client cannot hosted in asp.net app. - within client code, should able retrieve data relatively service uri's. i.e should not tied down specific port or localhost, if /getmydata wcf serivce, rather http://localhost:51345/getmydata , should return data service. for service side, i'm using route table instead of svc file. right now, thinking bundle service , client static content single host project , query data relatively.my question - there better approach this? should taking care o

printing - Print Sample for MonoMac -

does know of monomac sample shows how implement print (to printer)? haven't been able find one. i don't know of one, conceptual docs apple relevant, , sample snippets should straightforward port c#: https://developer.apple.com/library/mac/#documentation/cocoa/conceptual/printing/printing.html

cpu - Some general information about assembly -

i accidentally ended here: http://altdevblogaday.com/2011/11/09/a-low-level-curriculum-for-c-and-c/ , , turned out 1 of informative collection of stuff have read far. knew assembly kind of low level language can executed directly processor, but, read each processor has it's own assembly. questions: is true? will able run basic assembly on both netbook , pc? is difference between, say, avrs (who use risc architecture) , x86 processors use cisc, instruction set use? how run assembly code , in kind of files store it? yes, extend. although 2 processors same family might have different assembly languages, in reality 1 language may extension of other. processors different manufacturers (e.g. intel , amd) share great deal of instruction set. moreover, in spite of vast number of assembly languages out there, share relatively small number of fundamental concepts. once learn program in 1 assembly language, learning second 1 order of magnitude easier undertaking. of co

symfony - Symfony2 load conditional configuration -

i started symfony2, i'm still noob. i need load config file (yml) based on either request uri, or specific route. e.g /{dynamicroute} should load dynamicroute.yml and /{anotherdynamicroute} should load anotherdynamicroute.yml (hope makes sense) update : basically want to this: we have 1 backend system our clients can log in. there can set facebook applications. i'm using fosfacebookbundle users can connect facebook. fosfacebookbundle requires facebook settings set in config.yml, because have multiple facebook applications running of 1 system, can't put facebook settings in config.yml. so thinking load client specific configuration based on route. example create route this: // src\acme\mybundle\controller\democontroller.php /** * @route("/client/{client_id}") */ public function indexaction($client_id) { // load client specific data so when user loads specific client's page, want load yml configuration facebook details speci

jQuery how to add another css in code? -

hi have code right on website... <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> var scrollspeed = 50; // speed in milliseconds var step = 1; // how many pixels move per step var current = 0; // current pixel row var imagewidth = 4000; // background image width var headerwidth = screen.width; // how wide header is. //the pixel row start new loop var restartposition = -(imagewidth - headerwidth); function scrollbg(){ //go next pixel row. current -= step; //if @ end of image, go top. if (current == restartposition){ current = 0; } //set css of header. $('#body').css("backgroun

c# - Modifying a paragraph added using InsertParagraphAfter() -

var p1 = document.paragraphs.add(ref o); p1.range.insertparagraphafter(); now want grab paragraph created using insertparagraphafter() , modify it. how can access it? insertparagraphafter supposed extend current selection include new paragraph. if start creating empty selection @ end of existing paragraph, current selection should set new paragraph after calling insertparagraphafter . note have not tested following code (i have not tried compiling it), may way off. var p1 = document.paragraphs.add(ref o); // set selection end of paragraph. document.range(p1.range.end, p1.range.end).select(); p1.range.insertparagraphafter(); // insertparagraphafter should expand active selection include // newly inserted paragraph. var newparagraph = document.application.selection;

javascript - How to phrase 'has not' in jquery? -

for page in our app there number of customers generated in list when page loaded. 1 scrolls down on page more customers generated towards bottom of list, , forth till 1 scrolls way down , there no more customers generate. i trying check, within .on() function, if new generated customers @ bottom has clock icon, , if not add clock icon new customers. check: var isclock = $(timepickers).parent().has('.clockicon').length ? '' : addclock; if (typeof isclock === 'function') { isclock(); } the problem customers there start on page, of course have clock icon, because of customers have clock icon not adding of ones don't have 1 now. .has() makes more since, idea of .is() because of says on jquery website: check current matched set of elements against selector, element, or jquery object , return true if @ least 1 of these elements matches given arguments. and thats needed check if of customers don't have clock icon add it. c

CSS - context used styling? -

i thought possible, tells me it's not. i want context styling in css file like: div#foo { h2 { color: #f42 } p.bar { font-size: 12px } } so h2 , p.bar in div id foo styled. or possible less , other similar libs? thanks & kind regards, jurik this not possible pure css, that's why should use scss or less (i suggest use sass/scss), css supersets less/sass-scss allows write dynamic css ease, take @ this comparision check out compass main reason why suggest sass/scss

php - Error 330 net::ERR_CONTENT_DECODING_FAILED with Minify on first load -

minify php5 minifier js , css files : http://code.google.com/p/minify/ when modify css file reload page via google chrome, on first load, have error : error 330 (net::err_content_decoding_failed): unknown error it's on first load of page after css modification. if reload after, there no error. i believed problem zlib on : http 330 error on php deprecation errors zlib activated on server. the error not happening when minify in debug mode (so when merge file , doesn't modify nor compress content) this seems bug in 2.1.5. had same problem described, in 2.1.5 downgraded 2.1.3 , works. here download link 2.1.3: http://code.google.com/p/minify/downloads/detail?name=minify_2.1.3.zip

android - How do libgdx detect keyboard presence -

when writing in textfield, need textfield move upwards in order let textfield visible when keyboard pops up. does libgdx have kind of method returns true if keyboard visible , false when down? the following code detect when press textfield, prevent showing keyboard , open native dialog moves , down keyboard. take input native dialog , put in textfield: textfield.setonscreenkeyboard(new textfield.onscreenkeyboard() { @override public void show(boolean visible) { //gdx.input.setonscreenkeyboardvisible(true); gdx.input.gettextinput(new input.textinputlistener() { @override public void input(string text) { textfield.settext(text); } @override public void canceled() { system.out.println("cancelled."); } }, "title", "default text..."); } });

c# - sequential execution inside a parallel for each loop -

my requirement thing this. have few independent jobs , few sequential jobs abide contract. in client app, inside parallel loop need make sure independent tasks executed in order if sequential should 1 after another. below code. thanks, using system; using system.collections.generic; using system.linq; using system.text; using system.reflection; using system.threading.tasks; namespace sample { class program { static void main(string[] args) { program p = new program(); list<icontract> list = p.run(); parallel.foreach(list, t=> t.execute()); } list<icontract> run() { list<icontract> list = new list<icontract>(); type[] typesinthisassembly = assembly.getexecutingassembly().gettypes(); array.foreach( typesinthisassembly, type => { // if type of interface not ichartview, continue loop if (type.getinterface(typeof(icontract).tostring

javascript dot notation to bracket notation in array of objects -

i have array of objects , i'm looking use google closure. need convert dot notation bracket notation. at moment, i'm accessing properties in loop this: thearray[i].myprop1; thearray[i].myprop2; when write thearray[i].['myprop1']; it doesn't convert. how do conversion bracket notation in arrays of objects. drop dot. it should thearray[i]['myprop1'];

How can I use my same JavaScript code on a newly loaded page (from a redirect) -

i trying emulate user experience on multiple websites, want single script redirect new website, start scrolling bottom, , go original site. here code, loads page fine not scroll. <html> <head> <title>benchmark</title> <script type="text/javascript"> function loadurl(newlocation) { window.location = newlocation; window.onload=pagescroll; } function pagescroll() { window.scrollby(0,50); // horizontal , vertical scroll increments scrolldelay = settimeout('pagescroll()',100); // scrolls every 100 milliseconds } </script> </head> <body> <a href="javascript:void" onclick="loadurl('anysite.com'); return false;">link-1</a> </body> </html> i have not gotten redirect page, doesn't matter yet. thanks! there number of problems prevent working: when set window location new url (regardless of being external or not), javascript on curren

Flash Builder variables -

ok, i'm @ wits' end. i'm noob , that, , it's been awhile since i've done programming sincerity. said, i'm trying , running problems left , right. my biggest problem has assigning variables. side project, i'm trying create simple calculator using flashbuilder. know it's not done, , has multiple problems. appreciated! here's code far. what. am. i. missing??? <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600"> <fx:script> <![cdata[ import mx.events.flexevent; import spark.components.formitem import spark.components.textarea; import spark.components.textinput; public var n_1:number public var n_2:number public va

c# - Pressing F5 in Visual Studio 2010 Builds but does not Launch Application -

i have click once application (wpf) in c#. when hit f5 debug/launch application worked smoothly. eventually, f5 build solution , not launch application (therefore not step through code). short while switched debug release mode , reason allowed application launch after using f5 , step through code again. no longer works either. long story short, cannot application run in manner allows me step through code. can start without debugging (ctrl + f5). doesn't me other tell me if application works or not. you have lost start project in solution, or start project messed up, , no correct "item" defined startup. right click on 1 of projects, , select : define startup project. retry should trick. if not, check in projects properties see if form or defined startup object project. edit : dont define class library project startup project, choose ui :).

Linq to Entities Many to Many Query WPF DataGrid -

i have many many relationship in sql server 2008: student table (studentid pk, studentname) course table (courseid pk, coursename) studentcourse (pure junction table) (studentid, courseid both in composite pk). in visual studio 2010: entity model setup properly. have datagrid bound to: <collectionviewsource x:key="courseviewsource" d:designsource="{d:designinstance my:course, createlist=true}" />" this allows me set datagrid columnsproperty both tables: coursename , students.studentname. i need show students in courses in, on same datagrid. my query is: ` var context = new context(); var list = y in context.courses z in y.students select y; datagrid1.itemssource = list;` this query returns first student in table student in courses , gets repeated, can't show other students taking same courses , other courses. question: how can change query using linq entities. have tried many things

ios5 - Design upgrade to iPad 3 filenames -

i have app needs upgraded png files support retina. how done in regards filenames when have folder 40 files buttons etc. sorry "stupid" question have start somewhere.. for images within app, double size of image , put @2x suffix on image. example, if have 100px x 44px button image named mybutton.png. you'd create 200px x 88px image named mybutton@2x.png. place button in same folder other image , os take care of rest you. secondly, if you're worried nomenclature launch images , image icons i'd recommend reading on freshly updated programming guide , human interface guidelines. lastly, created nice little inforgraphic combines requirements easier read format. feel free check out. lists what's required, names of new image files , sizes apple requires images. hope helps! programming guide - images human interface guidelines - images ios image guide - inforgraphic

c# - How to detect the Retina Display in MonoTouch -

just question want detect retina display in monotouch app. thanks. there answers objectivec here's c# version: bool retina = (uiscreen.mainscreen.scale > 1.0); that work newer iphone , ipod touch , suspect (will know in less 2 weeks) new ipad. jason's approach work , can attractive if need know several hardware related features (e.g. retina + camera).

html - php variable not working in a heredoc -

i wrote heredoc 3 weeks ago working great, , until today used 5 php variables. here heredoc: echo <<<itemdetails_heredoc <img src="$sitepath/images/logo-landing2.png" /> <form action="$thisfilename" method="post" name="arti-form" id="arti-formid"> <label style="display: inline-block; width: 140px">owner name:</label><input type="text" style="width: 300px" id="ownerid" name="ownername" readonly="readonly" value="$theloggedinuser" /><br /> <label style="display: inline-block; width: 140px">the item:</label><input type="text" style="width: 300px" readonly="readonly" id="itemnameid" name="itemname" value="$itemname" /><br /> <label style="display: inline-block; widt

android - Layout with two TextViews -

i'm trying design layout 2 textviews: | | | (multilined textview) (60dp textview) | | (of unknown size ) | if first textview has little text, should this: | | | (hello!) (12:34:56) | | | if first textview has many text, should this: | | | (ey! very very long) (12:34:56) | | (message. ) | somebody knows how achieve this? thank much. edit: got working. solution in own answer. try this: <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content" > <textview android:id="@+id/text_1" android:layout_width="wrap_content"

Django template tag to determine "a" or "an" -

is there existing django template tag determine a/an before article? if not, how go writing such tag? someone kind enough leave snippet here: http://djangosnippets.org/snippets/1519/

MS paint like simple text editor to draw text on image in ASP.NET -

good evening , we working on requirement end user given option select area on image & write text in selected area in asp.net . this functionality same text functionality in ms-paint i know can achieved using flash , don't want use flash . don't know if possible silverlight . if it's, give try prefer asp.net highly appreciated .

Does Hazelcast follow JSR-107 -

read jsr-107 , jcache recently. know whether hazelcast or ehcache follow jsr? jsr107 (jcache) made progress , notified spec committee hazelcast implement jcache spec. having jcache part of java ee 8 significant achievement hazelcast committed jcache. -talip (hazelcast founder)

c - Does message queue support Multi-thread? -

i have 3 questions thread , process communication. can linux function msgget(), msgsnd(), , msgrcv() invoked multiple threads in 1 process? these functions in different threads attempt access(r/w) 1 process' message queue. race conditions supposed taken care system? if not, there method support threads , send message main thread(process)? can semop() function used synchronize threads in 1 process? there shared memory have following entities access. process several threads in 1 process. have use semaphore of inter-process level , semaphore of threads level at same time ? simple way handle this? a lot of question. :) thanks. can linux function msgget(), msgsnd(), , msgrcv() invoked multiple threads in 1 process? you not need worry race conditions, system take care of that, there no race condition these calls. can semop() function used synchronize threads in 1 process? yes, read more in documentation do have use semaphore of inter-pro

sql server - rename function on live db to match local db -

i'm having trouble table function created in sqlserver 2008. i created in local db , appears as: [dbo].myfunction when view in management studio. but when create function on live db (im using shared hosting btw) appears as: [myusername].myfunction when view in management studio. this causing me problems using sqlmetal generate classes based on db. i'd rather names consistent both db's how can rename it? tried modifying tthat didnt work run following statement (with user has sufficient permissions) exec sp_rename '[myusername].myfunction', '[dbo].myfunction' when user not member of db_owner role, object create without specifying schema created in "user schema" to prevent in future, create function as: create function dbo.myfunction() returns ...

iphone - My activity Indicator show after my algorithm -

i have function onclickbutton (pseudocode): show activityindicatorview (or progressbar or change label text no matter) execute algorithm hide activityindicatorview actvitiyindicatorview never show. if delete hide @ end of function, emerge after algorithm. in spite of show before execute algorithm. why , how can fix ? most execute algorithm long cpu time consuming process called on main thread... you showing activity indicator before algorithm...the ui takes time update layout (adding activity indicator..) ..but before does..your a;gorith takes place on main thread..and block ui update.. when task completes.. tell hide activity..and activity hides....that why can't see being added , removed view.. to solve this..do algorithm task in separate thread(no main thread) ..this way ui updated , task complete in background.. alternative way perform long task after delay..so ui update itself

c# - Override XML Serialization Method -

i'm having trouble trying customize way datetime variables serialized in objects. want output 2011-09-26t13:00:00z when override getobjectdata() function believe way this, no xml data output them @ all. [datacontract(namespace = "")] [xmlrootattribute(namespace = "http://www.w3.org/2005/atom", elementname = "feed")] public class gcal { [xmlnamespacedeclarations] public xmlserializernamespaces _xsns = new xmlserializernamespaces(); [xmlelement(elementname = "entry")] public collection<mmu.calendar.gcalevent> items = new collection<mmu.calendar.gcalevent>(); /*some other elements*/ } public class gcalevent { [xmlelement(namespace = "http://schemas.google.com/g/2005")] public gdevent when = new gdevent(); /*some other elements*/ } public class gdevent : iserializable { [xmlattribute(attribut

java - What is the maximum number of files per jar? -

i'd know if there maximum number of files allowed per jar, after can have classpath issues classes not taken account? the jar format rebranded zip format, inherits limitations of format. the original zip format has limit of 65535 entries, in total in java 6 , earlier, can have @ many classes or other files, combined. many tools include directories entires, , reduces entires available classes , other files. in java 7, zip64 supported, higher limit. i suspect failure mode, however, won't randomly missing files, failure @ jar generation time.

Magento Java Soap invalid XML response -

i writing on soap client magento using apache cxf. far works fine creating products changing categories, updating products etc. works here on local machine or magento installation in local network. so set magento shop on server in net. calls api worked except one, creation of products media. this response server. <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:body> <soap-env:fault> <faultcode>sender</faultcode> <faultstring>invalid xml</faultstring> </soap-env:fault> </soap-env:body> </soap-env:envelope> maybe can me this. thanks in advance... fritz i had same issue. fixed me making call https have .htaccess rewrite forces traffic on ssl. if doing rewriting urls https, in code, change url $proxy = new soapclient('http://example.com/api/v2_soap/?wsdl'); to $proxy = new soapclient('ht

perl - Read a string of alphanumeric characters after a ; -

i'm teaching myself perl i'm pretty new language. i've been reading on , on regular expression can't figure out right context. want following: let have file name "testfile" files contains 3 lines, test first line test: first line test; third line how can read , print out third 1 , after ; without space. "this third line" this i'm thinking $string =~ m/this third/ this edited incorrectly. in first , second sentence there should space before test.in third 1 shouldn't. want skip white space. grabbing stdin, might this: while ( <> ) { print $1 if /^test; (.*\n)/; }

javascript - 'length' is null or not an object -

button click, executes method, takes long (> 1 min time), populates grid within update panel. asyncpostbacktimeout="600" set, should plenty of time. do locally , short , long duration works fine. when deployed iis 7 short duration, don't experience trouble @ all. however, longer ones give me following error: edit: error on browser javascript console message: 'length' null or not object line: 2 char: 18021 code: 0 edit: deployed on test server therefore below link not work straight off bat. uri: http://epic/scriptresource.axd?d=3tx7t6ewzexoeemuaa1e9w3jsjacoprdefijbekiyjsg8amewhqtpedv31v-r-fkisdfa9pg2hupavqozf_hy7_e2fwgzwu07o7n-3j58ttvujekcpgxwmmo-sjpxo4c0&t=ffffffffbd2983fc i don't know length coming from, other javascript have this: <script type="text/javascript" language="javascript"> function cancelclick() { alert('changes have not been saved'); } function startprocedure() {

python - Redundant code in Django models.py. How do I improve it? -

i trying create task list each task having datetime attribute. tasks needs in order t_created being first , t_paid being last. order shown in step_datetime . description each tasks in steps . i have 2 methods all_steps , next_step shows task list information. 2 methods need display name of user_created , variable won't defined until methods called. that's why doing string replace method. i feel repeating code lot, , want follow dry principle of django. there way improve code? here full code: class order( models.model ) : def __unicode__( self ) : return unicode( self.id ) def comments_count( self ) : return ordercomment.objects.filter( order = self.id ).count() def all_steps( self ) : user = self.user_created.first_name steps = [] step_datetime = [ self.t_created, self.t_action, self.t_followup_one, self.t_vendor_appt_one, self.t_vendor_appt_two,

Call NavigationService from Silverlight UserControl that contains Navigation Frame -

i have usercontrol contains frame urimapper. rootvisual, loaded when application loaded. (simplified) xaml: <usercontrol> <navigation:frame x:name="contentframe" source="/page1"> <navigation:frame.urimapper> <urimapper:urimapper> <urimapper:urimapping uri="" mappeduri="/views/home.xaml"/> <urimapper:urimapping uri="/{pagename}" mappeduri="/views/{pagename}.xaml"/> </urimapper:urimapper> </navigation:frame.urimapper> </navigation:frame> <hyperlinkbutton x:name="page1link" navigateuri="/page1" targetname="contentframe" content="page1"/> <hyperlinkbutton x:name="page2link" navigateuri="/page2" targetname="contentframe" content="page2"/> </usercontrol> this works great, want add back-button. wh

Flex using XML dot notation string -

in following example first trace gives me xml data @ node, second trace not. as3. how use variable same inline dot notation? var x:string = "animxml.home.version"; trace(animxml.home.version); // works trace([x]); // not thanks not sure trying achieve output same thing: var x:string = animxml.home.version string; trace(animxml.home.version); // works trace(x); // works update (full script): <?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600"> <fx:declarations> <fx:model id="animxml"> <root> <home> <version>version 1</version> </home>

java - Drawing window in JFrame -

Image
i have separate graphics window (along separate cartesian coordinate plane) inside larger window using java.awt/javax.swing, i've drawn picture show mean. i have no idea how this, throwing kind of literature @ me can read understand better great, solution problem along awesome. ps. haven't tried anything, have no idea try. i recommend downloading netbeans start with, easiest ide ui design know of. start creating main frame of application. add buttons need , position them in picture on main frame. add jpanel frame , call drawingcanvaspanel . panel drawing area. don't forget override panel's paincomponent method in draw custom drawings , shapes using panel's graphics .

SQL Server Table -

i have sql server table. need create same table in database. how see create table query created table can run that. create table .. in ssms can right click table , select script table create new query window.

ruby - Rails: label_tag in helper method not outputting code -

i'm trying write helper method simplify building forms using bootstrap twitter. when try , put label_tag helper method nothing output. every other helper_tag method in function works not label_tag. ideas i'm doing wrong? name symbol , text labels text helper code def bootstrap_form_text_field(name, text) content_tag :div, class: "control-group" label_tag name, text, class: "control-label" content_tag :div, class: "controls" text_field_tag name end end end view code <%= bootstrap_form_text_field :called_number, "called number" %> output <div class="control-group"><div class="controls"><input id="called_number" name="called_number" type="text" /></div></div> i'm using ruby-1.9.3-p0 , rails 3.2.2 if helps. edit: seems last tag helper being called being displayed. copied label_tag

regex - ^a-zA-Z0-9 excluding spaces? -

i trying find in paragraph not abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789 , not space / /gi /[^a-za-z0-9]|[^ ]/gi the above doesn't work! you try with: /[^a-za-z0-9\s]/gi

jasper reports - How to configure mail server settings in JasperReports Server 4.0.0 -

i'm using jasperreports server 4.0.0 , want how configure mail server settings mail reports report scheduling. how can that? know this? yahoo settings are: yahoo! mail smtp server address: smtp.mail.yahoo.com yahoo! mail smtp user name: full email address (including "@yahoo.com") yahoo! mail smtp password: yahoo! mail password yahoo! mail smtp port: 25 so be: # file pass-through stuff in # file referenced maven js.quartz.properties file. quartz.delegateclass=org.quartz.impl.jdbcjobstore.postgresqldelegate quartz.tableprefix=qrtz_ quartz.extrasettings= report.scheduler.mail.sender.host=smtp.mail.yahoo.com report.scheduler.mail.sender.username= full yahoo! mail email address (including "@yahoo.com") report.scheduler.mail.sender.password= yahoo! mail password report.scheduler.mail.sender.from=your full yahoo email report.scheduler.mail.sender.protocol=smtp report.scheduler.mail.sender.port=25

Deep Cloning an object on the client side (GWT + Javascript) ? -

i know of deep cloning library in java, use in server side code. however, right need "deep clone" object on client side code. believe there's javascript framework thing yui3, not sure how use gwt code. you use jsni use yui3 code gwt code, have include whole yui3 source in gwt app might litle bit inefficient if need deep cloning functionality. if have the source code deep cloning library java backend might use on gwt client if there no external dependencies. can check out these resources more info: how can deep copy arbitrary object in gwt? gwt overlay deep copy

python - Program output that is neither STDOUT or STDERR? -

i'm getting strange behavior when trying capture output of django's manager.py > ./manage.py runserver 0.0.0.0:2869 validating models... 0 errors found django version 1.3.1, using settings 'polling.settings' development server running @ http://0.0.0.0:2869/ quit server control-c. error: port in use. > ./manage.py runserver 0.0.0.0:2869 >stdout 2>stderr > cat stderr error: port in use. > cat stdout > why getting empty string when try capture output on second run? any program detect if stdout and/or stderr connected terminal or not: man isatty(3) . python has such functionality: sys.stdout.isatty(). probably python script or logging subsystem prints lines missing in second run when running on terminal i.e. in interactive mode. it's common , proper practice. example, there no sense print "quit server control-c" if output redirected log file. below simple illustration: #!/usr/bin/python import sys print "

html - CSS3 -transition- -

i have navigation bar using css highlight on hover , when li has class active. has transition fade background in. have far: css: #nav {height:32px; border-top: 1px solid #fff; border-right: 1px solid #ffffff; background: #141941 url('../img/toptierbg.gif') repeat-x; } #nav ul {padding: 0px; list-style: none; height:32px; width:100%; } #nav li { position:relative; float: left; margin:0; border-left:1px solid #fff; line-height:30px; background: #141941 url('../img/toptierbg.gif') repeat-x; padding-top:0px;} #nav a, #nav a:link, #nav a:visited, #nav a:hover, #nav a:active {width:156px; display:block; text-align:center; font-size:12px; text-decoration:none; color:#fff; margin: 0px 0px 0px 0px; -webkit-transition: background 0.5s linear; -moz-transition: background 0.5s linear; -o-transition: background 0.5s linear; transition: background 0.5s linear; } #nav .active {text-align:center; text-decoration:none; padding:0; color:#fff; height:32px; background: #1d2248 url

node.js - How to add campaign tracking data to any url automatically? -

i bunch of different url sources , redirect same url, campaign data added url (to track referred clicks). for example have these urls: www.example.com/category/product/name.html www.example.com/id_product=5 i want add @ end following: utm_source=source&utm_medium=medium&utm_campaign=campaign and urls become www.example.com/category/product/name.html?utm_source=source&utm_medium=medium&utm_campaign=campaign www.example.com/id_product=5&utm_source=source&utm_medium=medium&utm_campaign=campaign how correctly check , cover cases if url string has parameters, , add mine? want in node.js thank you elaborating on @snkashis, similar arguably more elegant solution, again using node's url module, is: var addqueryparams = function (cleanurl) { var obj = url.parse(cleanurl, true, false); obj.query['utm_source'] = 'source'; obj.query['utm_medium'] = 'medium'; obj.query['ut

c# - SQL: select data which doesn't have relations in another table -

i'm writing c# application , using access .mdb. have table email messages , table message relations (each email msg can assigned several teams of workers). i want to messages first table not assigned team - ie, either have no entries in second table or have empty entry. works ok empty entries doesn't return rows don't have assignment entry @ all. i'm using following query: select top 10 mails.* mails inner join mailassignments on mails.msgid = mailassignments.msgid (mails.msgid <= ?) , (mails.msgid not in (select msgid mailassignments)) or (mailassignments.forteam null) or (mailassignments.forteam = '') update: i need use kind of join because on conditions query should return rows having relation in other table (eg. when wants display messages team , unassigned messages). update: ok, guess can make simplier deleting assignment second table don't need check empty assignments, ones don't exist @ all. still need sh

jquery - Unable to retrieve input value from within table -

i have table populated in way (i'm using grider jquery plugin) <table border="0" id="table_reserved_price_list"> <tbody> <tr class="noedit"> <th class="testclass" col="cod_products">codice prodotto</th> <th class="testclass" col="products">prodotto</th> <th class="testclass" col="cat_products">categoria</th> <th class="testclass" col="brand">brand</th> <th class="testclass" col="discount">sconto percentuale</th> </tr> <tr> <td> <input type="text" onchange="ajax_showoptions(this,'get_code_prod',event)" onkeyup="ajax_sho

arm - Android phones on armv5 processor? -

is there way of knowing android phones run armv5 processor? thanks system.getproperty("os.arch") returns string, example: "armv5tejl" , "armv6l". don't know "l" stands - arm never uses it. if wanted actual list of products sold companies based on armv5 core, question. have no idea find such list.

java - IntelliJ gui creator: JPanel gives runtime null pointer exception upon adding any component -

i having problem intellij's java gui creation. of code behind panel unfortunately hidden within gui creator , not editable me. i created blank jpanel "questionpanel" itellij gridlayoutmanager. when try add panel, null pointer exception though panel not null. tried adding jtextfield layout (out of curiosity) , did not either. jtextfield shows up, still cannot add within code. when change layout manager else (gridbaglayout, formlayout, borderlayout, etc.), no longer errors, nothing shows up. displayview.java private jpanel questionpane; public void initialize() { questionpane.addmouselistener(new mouselistener() { @override public void mousereleased(mouseevent e) { questionpane.add(new jlabel("test")); system.out.println("click event received."); } //other overrides hidden } does have idea of going on behind scenes or way me components onto panel? thanks. sample stack trace (th

c# - Cannot resolve TargetProperty when using StoryBoard in WinRT -

i trying set storyboard in code behind, exception thrown every time saying "cannot resolve targetproperty (uielement.rendertransform).(compositetransform.scalex) on specified object." here code: image img = new image() { source = image.source, name="image"+i.tostring()}; var pointedstoryboard = new storyboard(); var doubleannimationx = new doubleanimation(); doubleannimationx.duration = timespan.frommilliseconds(500); doubleannimationx.to = 2; pointedstoryboard.children.add(doubleannimationx); storyboard.settarget(doubleannimationx, img); storyboard.settargetproperty(doubleannimationx, "(uielement.rendertransform).(compositetransform.scalex)"); i tried storyboard.settargetname(doubleannimationx, "image" + i.tostring()); instead of storyboard.settarget(doubleannimationx, img); but did work , don't know , thankful if me ! in advance . you need add composite transform image first. img.rendertransform = new composi

javascript - GWT issue with IE9 -

i had project using gwt , gwt-presenter compatible browsers: ie9, firefox, chrome, opera , safari. , since migration gwt platform, project not works ie9 except in compatibility mode(display page if using earlier version of internet explorer) , it's still compatible others browsers. problem exactly?? dont know browser loads file it displays blank page , no errors reported! ! there has been faced problem ie9? appreciated. gwt has special section of documentation ie9 , can find here - https://developers.google.com/web-toolkit/doc/latest/devguideie9 note - gwt has quite while supported ie9 browser permutation can added in module.gwt.xml file.

objective c - reloadData Crashing iOS App -

i'm doing twitter request api data with: twrequest *postrequest = [[twrequest alloc] initwithurl:[nsurl urlwithstring:@"http://search.twitter.com/search.json?q=a2zwedding&include_entities=true"] parameters:nil requestmethod:twrequestmethodget]; then i'm getting processing request with: [postrequest performrequestwithhandler:^(nsdata *responsedata, nshttpurlresponse *urlresponse, nserror *error) { // nsstring *output; nsarray *results; if ([urlresponse statuscode] == 200) { nserror *jsonparsingerror = nil; nsdictionary *publictimeline = [nsjsonserialization jsonobjectwithdata:responsedata options:0 error:&jsonparsingerror]; results = [publictimeline objectforkey:@"results"]; } [self performselectoronmainthread:@selector(populatetable:) withobject:results waituntildone:yes]; }]; i'm trying display "results" in uitableview. delegate , datasource same view controller processi

Java: SimpleDateFormat timestamp not updating -

evening, i'm trying create timestamp when entity added priorityqueue using following simpledate format: [yyyy/mm/dd - hh:mm:ss a] (samples of results below) nano-second precision not 100% necessary 1: 2012/03/09 - 09:58:36 pm do know how can maintain 'elapsed time' timestamp shows when customers have been added priorityqueue? in stackoverflow threads i've come across, use system.nanotime(); although can't find resources online implement simpledateformat. have consulted colleagues. also, apologize not using syntax highlighting (if s.o supports it) code excerpt [unused methods omitted]: <!-- language: java --> package grocerystoresimulation; /***************************************************************************** * @import */ import java.util.priorityqueue; import java.util.random; import java.util.arraylist; import java.util.date; import java.text.dateformat; import java.text.simpledateformat; /************************