Posts

Showing posts from May, 2012

css - Background fixed phonegap -

i have problem background on phonegap i'm using jquery mobile this css code witch generate background html, body { top: 0px; left: 0px; height: 100%; width: 100%; } .ui-page{ top: 0px; left: 0px; background: url('../img/bg.jpg') 0 0 no-repeat fixed !important; background-size: auto 100%; height: 100%; width: 100%; font-family: manksans; background-position:fixed; background-color:#102a3e; } when scroll in page background stay @ top , part background isn't fetch stay white , can't understand why thanks help remove !important style. overrides background-color . use .ui-page { background: #102a3e url('../img/bg.jpg') 0 0 no-repeat fixed; }

Unit Testing nested command objects in grails -

docs can test controllers command objects mocking params http://grails.org/doc/latest/guide/testing.html#unittestingcontrollers i wonder if works nested command objects? has gotten work? example: controller def create(formcommand form){ form.validate() ... } command class formcommand { innercommand cmd } class innercommand{ string x static constraints ={ x(nullable: false) } } test void testcreate(){ params["inner.x"]="any" controller.create() ... } my expectation command objects created , data binding works, expect inner command validated. expecting much? ok, seems that's possible want, needs code :-) data binding for nested command objects grails databinding needs not null instance of inner command. to that, can create custom org.codehaus.groovy.grails.web.binding.bindeventlistener : class innercommandbindeventlistener împlements bindeventlistener { public void dobind(object target, mutableproper

visual studio 2010 - Which encoding to use for reading Italian text in Python? -

i'm using python tools visual studio , reading files written in italian. tried iso-8859-1, iso-8859-2, utf-8, utf-8-sig. notepad++ opens file utf-8 without bom. content = fp.read() words = content.decode("utf-8-sig").lower().split() w in words: p='' cur.execute('select word multiwordnet.italian_lemma l, multiwordnet.italian_synset s l.id = s.id , l.lemma="%s"' % w) the string results in crash c'è . (getting read "c\'\xe3\xa8" ) using chardet not help traceback (most recent call last): file "c:\users\tathagata\documents\visual studio 2012\projects\pythonapplicati on4\pythonapplication4\pythonapplication4.py", line 344, in <module> createsynsetdict() file "c:\users\tathagata\documents\visual studio 2012\projects\pythonapplicati on4\pythonapplication4\pythonapplication4.py", line 294, in createsynsetdict cur.execute('select word multiwordnet.italian_lemma l, multiwordnet.it alian

database - Oracle SQL error ORA-00907: missing right parenthesis -

how all? basically i've written bit of sql code create table keep getting error stated in title, idea why? here's code: create table staff( staffid int not null primary key, firstname varchar2(20), lastname varchar2(20), addressline_1 varchar2(30), city varchar2(15), postcode varchar2(7), telephone varchar2(15), salary decimal (19,4), branchid int foreign key references branches(branchid) ); also here code 'branches' table create table branches (branchid int not null primary key, addressline_1 varchar2(30), city varchar2(15), postcode varchar2(7), telephone varchar2(15), manager varchar2(20)); any appreciated! thank you! a few suggestions: first make sure branches table has been created. second, alter create table code following: create table staff( staffid int not null primary key, firstname varchar(20), lastname varchar(20), addressline_1 varchar2(

Call by reference, value, and name -

i'm trying understand conceptual difference between call reference, value, , name. so have following pseudocode: foo(a, b, c) { b =b++; = a++; c = + b*10 } x=1; y=2; z=3; foo(x, y+2, z); what's x, y, , z after foo call if a, b, , c call reference? if a, b, , c call-by-value/result? if a, b, , c call-by-name? another scenario: x=1; y=2; z=3; foo(x, y+2, x); i'm trying head start on studying upcoming final , seemed review problem go over. pass-by-name foreign me. when pass parameter value, copies value within function parameter , whatever done variable within function doesn't reflect original variable e.g. foo(a, b, c) { b =b++; = a++; c = + b*10 } x=1; y=2; z=3; foo(x, y+2, z); //printing print unchanged values because variables sent value //changes made variables in foo doesn't affect original. print x; //prints 1 print y; //prints 2 print z; //prints 3 but when send parameters reference, copies address of variable me

joomla - Redirecting after click Submit on Submission Form -

i using joomla 1.5.23 , user clicks 'submit' on submission form (rsform pro) taken straight landing page, versus thank page button ('continue'). how eliminate step? thank you! just change redirect in controller of component (which can find out looking @ "option" , "task" inputs of form you're submitting). please update latest 1.5. version (i think it's .26 @ least) , start planning move 2.5.

authentication - WebApi - CurrentUserId isn't accessible until after Registration? -

i have following: public httpresponsemessage register(registermodel model) { if (modelstate.isvalid) { // attempt register user try { websecurity.createuserandaccount(model.username, model.password); websecurity.login(model.username, model.password); initiatedatabasefornewuser(model.username); formsauthentication.setauthcookie(model.username, createpersistentcookie: false); return request.createresponse(httpstatuscode.created, websecurity.currentuserid); in code, currentuserid (at end) resolves -1 because websecurity doesn't see new user until after method closes. i'd return profile or @ least id of newly registered user register() method - how can accomplished? you should able id of user this: websecurity.getuserid(model.username)

How to apply filter to images loaded by Android ImageLoader? -

i'm using android-universal-image-loader library load images , caching etc. i'm trying apply box blur filter it, using jh labs library. tried apply filter in onloadingcomplete event doesn't seem bitmap there in mutable. has had experience of applying filter bitmaps loaded android imageloader? i've gotten work. right approach apply filter in onloadingcomplete event. however, since bitmap there inmutable, key pass in imageview , call setimagebitmap method again set filtered bitmap imageview: public void displayimageblurred(string imageuri, final imageview imageview) { this.displayimage(imageuri, imageview, true, 0, new simpleimageloadinglistener() { @override public void onloadingcomplete(bitmap loadedimage) { int width = loadedimage.getwidth(); int height = loadedimage.getheight(); boxblurfilter filter = new boxblurfilter(); filter.setradius(8.5f); int[] src = androidutils.

php - regex match some special chars -

this question has answer here: regex match open tags except xhtml self-contained tags 35 answers i have strings this: hello my_string is-very-cool & stuff how can explode(?) string special chars allowing spaces, - , _ ? any ideas? preg_split('/[^\w -]/', $string) this split on isn't a-z, 0-9, _, - or space.

xslt - convert XML formats -

i have xml format below in string: <?xml version="1.0" encoding="utf-8" ?> - <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> - <soap:body> - <getuserlinksresponse xmlns="http://microsoft.com/webservices/sharepointportalserver/userprofileservice"> - <getuserlinksresult> - <quicklinkdata> <name>system 1</name> <group>general</group> <privacy>private</privacy> <url>https://url1.com</url> <id>6500</id> </quicklinkdata> - <quicklinkdata> <name>system 2</name> <group>general</group> <privacy>private</privacy> <url>https://url2.com</url> <id>6499</id> </quicklinkdata> - <quicklinkdata> <nam

java - Write to socket directly and get TCP ZeroWindow -

Image
just can see, send request specific socket every 10 seconds directly( remain alive , detected ), can send twice. using wireshark, found third package send has tcp zerowindow , cannot send server. following packages. usually, window size should remain @ normal level instead of decreasing time. what's wrong source code? appreciated! three packages got: source code: simple public class pediy { public static void main(string[] args) throws ioexception { url url = new url("http://bbs.pediy.com"); socket socket = null; printwriter os = null; bufferedreader = null; while(true) { socket = new socket(url.gethost(), 80); os = new printwriter(socket.getoutputstream()); string request = "get / http/1.1\nhost: bbs.pediy.com\nproxy-connection: keep-alive\naccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nuser-agent: mozilla/5.0 (windows nt 6.1) applewebkit/537

sql server - using joins how to compare 2 columns -

i have 2 tables table1 : id name 1 os 2 harddisk 3 ram 4 windows 5 linux 6 solaris 7 mac 8 unix 9 dcci table2 : id table1_id table1_component 1 1 4 2 1 5 3 1 6 4 1 7 5 1 8 6 1 9 i want join above 2 tables , need output put table1_id table1_component os windows os linux os solaris os mac os unix os dcci please me, instead of numbers in table 2 need names table1 you need join on table1 twice result: select t1.name table1_id, c.name table1_component table1 t1 inner join table2 t2 on t1.id = t2.table1_id inner join table1 c on t2.table1_component = c.id see sql fiddle demo

C++ What does size parameter in qsort do -

in qsort: void qsort (void* base, size_t num, size_t size, int (*compar)(const void*,const void*)); documentation explains: size size in bytes of each element in array. size_t unsigned integral type. but qsort invoked qsort(...,...,sizeof(int),...) , or qsort(...,...,sizeof(char *),...) if understanding correctly, since size of string can not determined, not matter anymore, instead use sizeof(char*) type declaration. any explanations? qsort requires contiguous block of memory can treated array. becaue of that, each item in array must same size, , provide size qsort when call it. if want store actual strings in array, they'll need same size, size of largest one. and, when comparison function compares them, qsort move around massive amounts of memory complete sort, since swap strings themselves. far more usual have strings stored outside of array area , use array store pointers strings. pointers swapped they're going smaller on average strings

html - CSS displaying elements vertically down instead of hortizontal straight -

i have elements wrapped inside div . elements displayed in horizontal direction inside div. problem , can't figure out how display elements vertically down direction. done research , 1 solution use vertical-align doesn't seem work. here example of i"m trying accomplish http://s9.postimg.org/6i34jzazz/save.jpg my css .container {height:500px; width: 700px; background-color:#00b358} my html <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" href="css/navigation.css"> </head> <div class="container "> <img border="0" src="download.jpg" alt="pulpit rock" width="304" height="228"> <img border="0" src="1.jpg" alt="pulpit rock" width="304" height="228"> <img border="0" src="2.jpg" alt="pulpit rock" width="304"

how to implement a card UI like chrome on Android? -

i want implement card ui chrome on android. how should ? very vague question, , may want try simple google search next time. check out though, may you're looking for: http://www.androidviews.net/2012/12/cardsui/

javascript - remove content using ajax -

i new ajax. i have index.html <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $.ajax({url:"n.php",success:function(result){ $("#div1").append(result); }}); }); }); </script> <div id="div1" style="margin-left: 25;"></div> <button>add author</button> demo.php name:<input type="text" name="txtname"> age:<input type="text" name="txtage"> above code adds name , age textboxes on index.html page when 'add author' button clicks without refreshing page. now want put button 'remove author',and want perform exact opposite action(i.e) remove name , age textboxes added previously. i don't know how this.is possible through $("#div1").(result); thanx in advance.

Linux can bus driver -

i going through can base network driver mcp-2515 https://github.com/raspberrypi/linux/blob/rpi-3.6.y/drivers/net/can/mcp251x.c please suggest can find description of function, :-- alloc_candev open_candev alloc_can_skb can_dropped_invalid_skb alloc_can_err_skb etc ..... is there read-me file or tutorial ? please suggest. for kernel functions have found lxr useful. not asking for, perhaps little more specific in question.

javascript - how to know a machine is reachable from browser/js -

this might weird, ask such question besides knowing browsers/js limitations. still want know if has hints. i have web application running, on page accept ip address user, ip address of user's device, ideally network resource. ip suppose reachable users' desk. having accepted ip address, still want check browser, using js, whether reachable. any idea. note: regexing check whether seems intranet resource or not.

node.js - forever and forever-monitor -

the github pages light on documentation. know loves forever, i'm confused difference between forever , forever-monitor is, , package should using under circumstances. do offer same functionality? as stated in readme of forever , readme of forever-monitor forever module command line interface , package forever-monitor core monitoring functionality without cli can use programatically . which package should using under circumstances? you should use forever module when want use cli(starting manually example). you should use forever-monitor when writing program should control application starting. example app start other apps in via interface or if want spawn should restarted on failure in app. do offer same functionality? i haven't looked throughout code package.json file's dependencies in forever module includes forever-monitor sounds realistic because forever module application controls other applications(and therefor uses forever-monitor

TortoiseGit how to clone a folder structure -

i not want clone whole repository. have repository 300 mb, , want folder called /sourcecode, instead of downloading whole root folder. is there way this? the feature not yet available tortoisegit: see issue 1599 (january 2013). so should simple checkout, except need edit first .git/info/sparse-checkout , describe in " is possible sparse checkout without checking out whole repository first? ". be aware still buggy msysgit1.8.1 though. see " why git sparse checkout leave behind directories? ".

forms - PHP Added to query string on submit -

i have text field , submit button, when click on submit button want add on query string. example http://www.fakewebsite.com/?name=mike but name appears blank here code <?php if($_post){ echo $_post['name']; }else{ ?> <form action="http://www.fakewebsite.com/test.php?name=<?php $_server['name']; ?>" method="post"> <label for="name">name</label><input type="text" name="name" id="name" /> <input type="submit" name="submit" id="submit" /> </form> <?php } ?> post request differ get requests in terms of how send data server. with data elements appended url (like tried). with post data elements within body of http request. this problem 1: trying pass argument parameter. can work, not guarranteed to. the other thing is, have input field same name name . if first thing work,

c# - How to turn a Selectlist into Html.SelectListFor() -

i need following turned @html helper drop down list. <select size="30" class="scrollableinside" id="customerselect"> @foreach (var customer in model.customers) { <option value=@customer.customercontacts.first().customercontactid>@customer.customername &#09;&emsp;&#09; @customer.customercontacts.first().phone</option> } </select> since i'm doing little unnorthodox .first() , 2 pieces of data being put list i'm not sure how make @html.selectlistfor this. @html.dropdownlistfor(model => model.customerid, new selectlist(model.customers, "customerid", "what put here")) you should try this public class indexviewmodel { // stores selected value drop down box. [required] public int countryid { get; set; } // contains list of countries. public selectlist countries { get; set; } } public class homecontroller : controller { [httpget]

visual studio 2012 - Scoping issue with redefined variable in c++ -

given following code: for (list<vertex*>::iterator v = vertexlist->begin(); v != vertexlist->end(); v++) { if (!(*(*v) == *u)) { (*v)->setcolor(white); (*v)->setpred(null); (*v)->setdist(infinity); } } queue<vertex*> q; q.push(u); vertex* v = q.front(); // wont assign item in queue v vertex* t = q.front(); // assign item in queue t as can see variable v has been defined in loop , (at least far know) should last in scope. (while active). but, when i'm trying assign q front new variable named v, wont put item in queue inside. instead, see ?????? inside it. (using visual studio 2012). compilation passes. in other hand, when try assign q front variable not named v let me , t hold correct value (the first item in queue). what missing here..? i think debugger bug, if there descriptive property or member of vertex, can write in console control , see vertex* v correctly assigned.

jquery - Ajax where to debug -

i have basic webpage makes ajax call aspx file. it works great on development machine. when test on production machine nohting nor kind of error. i have different ip addresses's , port number's between 2 machines. have checked these differences handled. the page displays ok , reponds click event ok. the production machine worked once when setup localhost call once changed that, stopped. have rechecked ip , port , correct. i have copied file couple of times in case of corruption. the thing can think port number 20201, shouldn't use. the dev machine win7 target xp, both running xampp. it supposed custom page home automation, ajax call speak software called homeseer. where or can change see whats wrong. i puzzled works great in test , nothing positive or negative in production world. many help. <!doctype html> <html> <head> <script type="text/javascript" src="jquery/jquery-1.7.1.js"></script> <

ios - samba library failed to download the shared files of Mac osx -

i have tried download shared files of mac osx using smb ipad fails error( unable open file). can download windows , linux shared files. i have resolved updating version of samba static library in ios.

java - how to change setIndeterminate jProgressbar in other frame -

i have 2 frame, framea , frameb, in framea add 1 button name buttona show frameb , progressbar (setindeterminate(false)), in frameb add 1 button name buttonb , want when click buttonb, progressbar in framea.setindeterminate(true) in framea frameb b; public framea() { initcomponents(); progressbar.setindeterminate(false); b = new frameb(); } public jprogressbar getprogressbar() { return progressbar; } private void buttonaactionperformed(java.awt.event.actionevent evt) { b.setvisible(true); } in frameb use code in event buttonb clicked private void buttonbactionperformed(java.awt.event.actionevent evt) { framea a= new framea(); a.getprogressbar().setindeterminate(true); } but doesnt worked this... private void buttonbactionperformed(java.awt.event.actionevent evt) { framea a= new framea(); a.getprogressbar().setindeterminate(true); } isn't going work, you've created instance of

exception - Cakephp App class code printing on the page and spl_autoload_register error -

i have moved cakephp installation development server production server (config file , htaccess updated). the production server using older version of php , have requested host upgrade it. after upgraded php version, site printing php code on webpage ( class : /lib/cake/core/app ) .. displaying fatal error on bottom of page, below fatal error: uncaught exception 'logicexception' message 'passed array not specify existing static method (class 'app' not found)' in /xxxxxxx/lib/cake/bootstrap.php:154 stack trace: #0 /xxxxxxx/lib/cake/bootstrap.php(154): spl_autoload_register(array) #1 /xxxxxxx/app/webroot/index.php(92): include('/xxxxxxx/pu...') #2 {main} thrown in /xxxxxxx/lib/cake/bootstrap.php on line 154 please help.. have checked php version has changed, did check (with phpinfo())?

What does CSS measurement unit 'em' actually stand for? -

as title says, want know css unit 'em' stands for. in 'cm' stands c enti m eter. i not asking 'em' or how used! i couldn't find answer on w3c . wikipedia article saying "something": the name of em related m. unit derived width of capital "m" in given typeface. my interpretation of first sentence 'em' pronunciation/phonetic letter 'm'. reading second sentence, seems 'e' in 'em' stands regarding width of letter 'm'. i'm still lost, 'em' stands for! that historical definition; in modern usage refers size of font, word "em" no longer having practical or relevant meaning. matter of fact, same wikipedia article expands on evolution in usage , meaning in a later section : one em traditionally defined width of capital "m" in current typeface , point size, "m" commonly cast full-width of square "blocks", or "em-quads&

android - Overflow icon is not coming the Actionbar of ActionBarSherlock -

i new android. trying use actionbarsherlock in application. tried following code in oncreateoptionsmenu : menu.add("save").setshowasaction(menuitem.show_as_action_always); menu.add("edit").setshowasaction(menuitem.show_as_action_always); menu.add("clear").setshowasaction(menuitem.show_as_action_always); menu.add("refresh").setshowasaction(menuitem.show_as_action_always); menu.add("save all").setshowasaction(menuitem.show_as_action_always); but not getting overflow icon in actionbar. understood silly mistake. couldn't find is. please me fix it! since asking menuitem.show_as_action_always think none of menu items go in overflow. also, if device has hardware menu button , icons not go in overflow, instead can access them using menu button.

c - Finding prime numbers is giving me errors -

i wanted print divisors of given range of numbers. works alright. when try modify put **** @ end of prime number's divisors acts bizarre. #include <stdio.h> int main() { int a,start,rounds,b,c,k=0; printf("please enter number start :"); scanf("%d",&start); printf("please enter how many numbers want print number :"); fflush(stdin); scanf("%d",&rounds); for(a=start;a<=start+rounds;a++) { printf("\n\nthe divisors of number :%d \n",a); for(b=1;b<=a;b++) { c=a%b; if(!c) { k++; printf("%d\n",b); } } //printf("%d",k); if((k==2)||(k==1)) printf("***\n"); } getchar(); return 0; } ps:- trick used find prime number counting how many printf statement has been executed before loop

python - if (foo or bar or baz) is None: -

i've been refactoring rather crufty code , came across following rather odd construct: #!/usr/bin/env python2.7 # ... if (opts.foo or opts.bar or opts.baz) none: # (actual option names changed protect guilty) sys.stderr.write("some error messages these required arguments") ... , wondering if ever make conceivable sense. i changed like: #!/usr/bin/env python2.7 if none in (opts.foo, opts.bar, opts.baz): # ... i did fire interpreter , try first construct ... seems work if values false and last of these false values none. (in other words cpython's implementation seems return first true or last false value chain of or expressions). i still suspect proper code should use either any() or all() built-ins added 2.5 (the code in question requires 2.7). i'm not yet sure preferred/intended semantics i'm starting on project. so there case original code make sense? the short-circuiting behavior causes foo or bar or baz return

map - Get markers inside OpenLayers bounding box -

i have drawn map on page using openlayers 3.0. and in document.ready() have drawn map , have plotted few markers on using longitude , latitude combinations. and have added draw line,polygon , select feature on map. my idea plot few markers on map while page load, , draw ploygon or bounding box , on clicking selections should able markers plotted inside selection, possible this without looping, please give me suggestion accomplish this. my html , javascript code follows var map, layer; var drawcontrols; openlayers.feature.vector.style['default']['strokewidth'] = '2'; $('document').ready(function () { console.log('in'); openlayers.proxyhost = "/proxy/?url="; map = new openlayers.map('map'); layer = new openlayers.layer.wms("openlayers wms", "http://vmap0.tiles.osgeo.org/wms/vmap0", { layers: 'basic' }); map.addlayer(laye

maven-jaxb plugin - Two classes have the same XML type name -

following problem, have 2 wsdl files have generate stubs. both wsdl files contains same xml type names (second wsdl further stage of first wsdl). i generate stubs following configuration: <plugins> .. <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <version>0.7.1</version> <executions> <execution> <id>ws-source-gen-phase1</id> <goals> <goal>generate</goal> </goals> <configuration> <removeoldoutput>true</removeoldoutput> <extension>true</extension> <schemadirectory>src/main/resources/meta-inf/schema/xyz/</schemadirectory>

javascript - How to Keep second last li active in JQuery -

i have simple tab control in mvc application view <div class="span12" id="test" style="width: 810px;"> <ul class="nav nav-tabs"> <li class="active" id="li1"><a href="/#tab1" data-toggle="tab">new stream1</a></li> <li><a id="addspan" href="/#c" data-toggle="tab">+</a></li> </ul> <div class="tabbable"> <div class="tab-content" id="tabcontent"> <div class="tab-pane active" id="tab1"> tab content </div> </div> </div> </div> <script type="text/javascript"> $(function () { var count = 2; $('#addspan').click(function () { $(&#

c# - Upload File from Local to Remote URL Server -

i need upload files remote directory having difficulty in doing so. any idea or links please? i have tried web client , posted file upload approach. what need e.g. www.google.com\file\upload.txt c:\www.google.com\file\upload.txt try 1 solution code string filepaths = path.combine(appdomain.currentdomain.basedirectory, "\\www.google.com\\file\\upload.txt"); using (streamwriter writer = new streamwriter(filepaths, true)) { writer.write("word "); writer.writeline("word 2"); writer.writeline("line"); } try 2 solution code string mydocpath = environment.getfolderpath(environment.specialfolder.mydocuments); string filepath = mydocpath + @"\upload.txt"; webclient client = new webclient(); uri addy = new uri("www.google.com\\file\\upload.txt"); byte[] arrreturn = client.uploadfile(addy, filepath); console.writeline(arrreturn.tostring()); regards

php - Yii Boilerplate where to unzip files -

i'be been trying find answer no luck. should zip unzipped www directory? weird url sites localhost/myapp/frontend/ . better have links localhost/myapp/ - putting files (including yii framework files) seems kind of not secure. you may specify localhost directory editing file 000-default in etc/apache2/sites-enabled . edit these lines: [4]documentroot /var/www [9]<directory /var/www/> for example, if myapp in www/myapp , you'd navigate page: localhost/myapp

python - Django file uploading -

i need have ability upload files on server before uploading verify file whether file , image or script called image.jpeg. i'm using library called python-magic import magic attachment = request.files['file'].read() m = magic.open(magic.magic_mime_type) m.load() ft = m.buffer(attachment) m.close() its working fine me. should read whole file? attachment = request.files['file'].read() i think bad idea question how header of file weight? can read couple bytes , verify files mime-type. you first guess mimetype using mimetype module suggested here . if ok guess, upload file webserver. in case access file afterwards, can entire check source provided, have read file anyway.

css - Using "display: table-cell" is there a way of getting the "colspan" functionality? -

this question has answer here: colspan/rowspan elements display set table-cell 12 answers using display: table-cell there way of getting colspan functionality, available when using real table cells? in particular need "cells" span multiple columns. real tables not possibility using form per row layout, won't validate real table. no cannot add colspan or rowspan display:table-cell. 1 of limitations in table-cell feature! you can check limitations in reference link http://www.onenaught.com/posts/201/use-css-displaytable-for-layout if want bring colspan feature table-cell, have use table-row-group , table-caption feature follows display: table-caption and table-row-group; check fiddle link : http://jsfiddle.net/zqqy4/

c# - Converting a JavaScriptConverter to json.net JsonConverter -

i need rewrite following class json.net jsonconverter in order code working xamarin mono android private class resourceconverter : javascriptconverter { public resourceconverter() { } public override ienumerable<type> supportedtypes { { return new readonlycollection<type>(new list<type>(new type[] { typeof(systemcertificate) })); } } public override object deserialize(idictionary<string, object> dictionary, type type, javascriptserializer serializer) { if (dictionary.containskey("certificate")) { systemcertificate customerresource = new systemcertificate(); customerresource.systemid = dictionary["systemid"].tostring(); string base64text = dictionary["certificate"].tostring(); customerresource.certificate = convert.frombase64chararray(base64text.tochararray(), 0, base64tex

silverlight - subscribe to clipboard event from within browser -

using win32 api possible subscribe clipboard events ( clipboard event c# ). is possible within active x control or silverlight within web page? my scenario know when new has arrived in clipboard in web page within internet explorer (min version 8). in silverlight 5 can enable trusted applications in browser: http://msdn.microsoft.com/en-us/library/gg192793(v=vs.95).aspx in trusted applications can use p/invoke call winapi.

regex - How to check if there are doubles in the same line? -

i have text file many lines this: img_0106.jpg y:\2004_05_23_bern basel\ 2004_05_23 img_0107.jpg y:\2004_05_23_dortmund\ 2004_05_23 img_0108.jpg y:\2004_05_25_paris\ 2004_05_24 img_0110.jpg y:\2004_05_25_paris\ 2004_05_25 i want check if there double dates in same line , not. line 1,2,4 have date match. line 3 doesn't have date match (2004_05_25 != 2004_05_24) i know how find double lines don't know how find doubles in same line in case. can please me? this :g command regex give lines duplicated dates, can operations on lines: :g/\v(\d{4}_\d{2}_\d{2}).*\1 if want find them, (or highlight them hlsearch), /sameregex

css3 - Media query for the Blackberry 9900 bold? -

i need media query applied on blackberry 9900 bold. i have tried @media screen , (max-height: 480px) , (max-width: 640px) wasn't successful. can me? the code helped fix problem is: <meta name="viewport" content="target-densitydpi=device-dpi"> <meta name="viewport" content="width=device-width, initial-scale = 1.0, maximum-scale = 1.0" />

How to close my Android app when i click the back button from my mobile? -

i have created android app. i need close or exit application when click button mobile. how can achieve that? you have handle button functionality @override public void onbackpressed() { // todo auto-generated method stub super.onbackpressed(); finish(); }

c# - JsonSerializer calling container Equals override method -

first of had around , understand override/virtual etc. haven't found cases specific situation - i'm sure isn't unique. want make sure implementation go right implementation. have following code setup demonstrate issue: using system; using system.collections.generic; using system.io; using system.text; using newtonsoft.json; using newtonsoft.json.converters; namespace sandpit { public class program { static void main() { var fixture = new fixture { name = "fixture name", participants = new list<participant> {new participant {name = "participant name"}} }; var writer = new stringwriter(new stringbuilder()); var serializer = new jsonserializer(); serializer.converters.add(new stringenumconverter()); serializer.serialize(writer, fixture); console.write(writer.tostring());

linux - bash, search for usb storage devices. output location -

i looking way list usb connected devices or removable storage media. i using list gtk boot media writer, user can write iso usb. this creates perfect list of partitions: ls /dev | grep "[sh]d[a-z][1-9]" how can similar looking list removable media? on system (ubuntu 12.04), can list of usb devices , partitions ls /dev/disk/by-path/*usb* giving /dev/disk/by-path/pci-0000:00:02.1-usb-0:1.1:1.0-scsi-0:0:0:0 /dev/disk/by-path/pci-0000:00:02.1-usb-0:1.1:1.0-scsi-0:0:0:0-part1 or partitions alone ls /dev/disk/by-path/*usb*part* these symbolic links, pointing real device files, /dev/sdd , /dev/sdd1 example. i have tested usb stick , external usb hard disk only. cannot say, whether or how works esata or firewire disks.

c# - get only integer value from string -

i need last number string. string contains pattern of string+integer+string+integer i.e. "gs190pa47". need 47 string. thank you a simple regular expression chained end of string number of integer digits string test = "gs190pa47"; regex r = new regex(@"\d+$"); var m = r.match(test); if(m.success == false) console.writeline("ending digits not found"); else console.writeline(m.tostring());

c++ - A bug in code about write a class that is same array of pointer? -

hello have below code in pointarray.h #ifndef pointarray_h_included #define pointarray_h_included template <typename t> class pointarray { private: int nsize; t *array[]; public: pointarray(); pointarray(const t *points[],const int size); pointarray(const pointarray &pv); ~pointarray(); int * get(const int position);//is same array[position] const int * get(const int position) const;//is same array[position] const int getsize() const;//get size of array }; #endif // pointarray_h_included in pointarray.cpp #include "pointarray.h" #include<iostream> #include <assert.h> using namespace std; template<class t> pointarray<t>::pointarray(const t *points[],const int size) { nsize=size; (int i=0;i<size;i++) { array[i]=new t; *array[i]=*points[i]; } } template<class t> pointarray<t>::pointarray() { nsize=0; } template<class t> pointarray<

forms - Symfony "Could not load type" service yaml -

i tried create service in symfony 2.2 1 of form : service.yml: tyg_user.settings.form: class: symfony\component\form\form factory_method: createnamed factory_service: form.factory arguments: - tyg_user_settings - tyg_user_settings_name tyg_user.settings.form.type: class: tyg\userbundle\form\settings\settingsformtype tags: - { name: form.type, alias: tyg_user_settings } tyg_user.settings.form.handler: class: tyg\userbundle\form\settings\settingsformhandler scope: request arguments: - @tyg_user.settings.form - @request - @fos_user.user_manager settingsform.php <?php namespace tyg\userbundle\form\settings; use symfony\component\form\formbuilderinterface formbuilder;; use symfony\component\form\abstracttype; class settingsform extends abstracttype { public function buildform(formbuilder $builder, array $options) { $builder ->add('birthday', 'birthday'

How to remove android ads (admob) from the source code -

i trying adapt opensource android app own project, , need remove android ads. i've tried remove them don't know how , errors here , there. there easy way it? thanks. try it.... http://stackoverflow.com/questions/4549401/correctly-disable-admob-ads http://stackoverflow.com/questions/13323097/in-app-purchase-remove-ads please check above links you. remove below code application adview adview = (adview) this.findviewbyid(r.id.adview); adview.loadad(new adrequest()); <xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/adview" android:layout_width="fill_parent" android:layout_height="fill_parent" ads:adsize="banner" ads:adunitid="a1513ffd4f3e17c" />

How to do pattern matching in scheme -

has idea how make match in scheme 2 (?x lives-in ?city) (john lives-in new-york) ?i've tried using match-define didn't succeed i guess meant pattern matching. general solution problem, think implementing unification algorithm , there's complete working solution described in sicp . alternatively, consider embedding minikanren in code, it's simple logic programming system works scheme. now, simpler match can use racket's pattern matching abilities. example in question: (define expression '(john lives-in new-york)) (match expression [(list ?x 'lives-in ?city) (list ?x ?city)] [_ #f]) => '(john new-york) the above match given expression against (?x lives-in ?city) pattern, returning list matched values ?x , ?city , or #f if no match found.

c# - How can I apply a style to all buttons? -

how , create style gives button controls have resource blue (yellow border, blue background)? can added texbox well? is there centralized place, since want style able affect buttons in different pages in app? in these cases may use styles : you going apply same properties (or members) on several controls of type you going make save , desired state of type , use later. you can add style in control's resources or resourcedictionaries this: <style targettype="button"> <setter property="borderbrush" value="yellow"/> <setter property="background" value="blue"/> </style> if define x:key , should explicitly button follows style (e.g. <button style="{staticresource mybuttonstylekey}"> ) otherwise style automatically apply on buttons. edit: add resourcedictionary (named mystyles.xaml ) project (in folder named myresource ). here code: <resourcedictionary x

c# - Nhibernate Found: integer, Expected INT -

i exception: nhibernate.hibernateexception: wrong column type in main_command column id. found: integer, expected int the mapping is: <id name="id" type="int"> <generator class="identity" /> </id> and class property is: public virtual int id { get; set; } checking nhibernate source sqlite dialect , finding answer similar question. looks signed integer types don't map integer required sqlite auto increment column. registercolumntype(dbtype.int16, "smallint"); registercolumntype(dbtype.int32, "int"); registercolumntype(dbtype.int64, "bigint"); but news unsigned ints map integer . registercolumntype(dbtype.uint16, "integer"); registercolumntype(dbtype.uint32, "integer"); registercolumntype(dbtype.uint64, "integer"); therefore, please try following mapping: <id name="id" type="uint32"> <generator class="id

javascript - phonegap application on blackberry OS 5 -

i deployed phonegap application on android , worked fine, when deployed on blackberry bold 9900 emulator there worked fine deployed on blackberry curve 8520, application failed entirely. i read somewhere bb os 5 not support ajax call couldn't figure out way stop ajax calling on os 5 device.

github - Managing a Yii app with Git -

if have public git repository yii app. i'm wondering how keep db config settings private? can't ignore whole file. create second ignored config , merge results: $config=require_once(dirname(__file__).'/protected/config/main.php'); $configignored=require_once(dirname(__file__).'/protected/config/ignored.php'); require_once($yii); $config = cmap::mergearray($config, $configignored); yii::createwebapplication($config)->run();

How to add and delete particular view based on position Dynamically in android? -

Image
i implemeting sample application in android creating dynamic views. please observe below image............ by seeing above picture want create dynamic view consists of close imageview, button, spinner , edittext clicking plus button. after entering fields click on plus button create new view above widgets similarly. i want delete particular row clicking delete imageview. , again add clicking plus, repeat process untill how many rows want. click on submit button rows of views values , show details on next screen.... and tell me other way is, there possibility of create seperate xml file view , use on our code... like see below picture... please me.... in advance..... if store views in iterable data structure list, iterate on them when "delete"-button klicked , search ones delete checking coordinates calling getx() , gety(). however, lfor said before, better way create own data structure each row. recommend create "row"-class containing

xamarin.android - Binding multiple targets to same source -

i making page contains viewpager pages consist of textview displaying title , listview displaying charts custom view have made. i have working fine in wp7, following code: <controls:pivot title="stakeholder"> <controls:pivotitem header="last hour"> <scrollviewer> <itemscontrol itemssource="{binding locations}"> <itemscontrol.itemtemplate> <datatemplate> <stackpanel> <textblock text="{binding name}" horizontalalignment="center" /> <chart:minicharthour minmaxrange="{binding charthourrange}" data="{binding charthoursamples}" margin="0,0,0,15" /> </stackpanel> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol