Posts

Showing posts from September, 2015

c# - Attribute value in root node of xml Linq to XML -

while parsing xml linq xml, came across strange behaviour (atleast me). below first xml parsed `<?xml version="1.0" encoding="utf-8"?> <testrun> <unittestresult testname = "arun" outcome = "i"> </unittestresult> <unittestresult testname = "arun1" outcome = "i"> </unittestresult> </testrun>` my code looks xdocument doc = xdocument.parse(filecontents); var result = doc.descendants("unittestresult"); the above works fine. if root node contain attributes same code not working. reason. xml sample below <?xml version="1.0" encoding="utf-8"?> <testrun id="7903b4ff-8706-4379-b9e8-567034b70abb" name="inaambika@inbelw013312a 2016-02-26 16:55:14" runuser="stc\inaambika" xmlns="http://microsoft.com/schemas/visualstudio/teamtest/2010"> <unittestresult testname = "arun" outcome = "...

android - Retrieve value from radioButtons in alertDialog -

i want retrive value radio buttons. doing below code. when click ok button of alert dialog app force closed. why is so. not retriving value properly final sharedpreferences settings = getsharedpreferences(prefs_name, mode_private); if (settings.getboolean("isfirstrun", true)) { layoutinflater li = layoutinflater.from(this); view promptsview = li.inflate(r.layout.prompts, null); alertdialog.builder alertdialogbuilder = new alertdialog.builder(this); alertdialogbuilder.setview(promptsview); final edittext userinput = (edittext) promptsview .findviewbyid(r.id.edittextdialoguserinput); final radiogroup radiogroup = (radiogroup) findviewbyid(r.id.radiogroup1); // set dialog message alertdialogbuilder.setcancelable(false).setpositivebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog,int which...

ios swift - uiimage array to video disorted and flipped -

Image
i modified of code in time lapse builder class in link https://github.com/justinlevi/imagestovideo take in array of images instead of url. everything seems working fine far taking images , creating video; however, i'm having issues way images being displayed in video. this how images , under how on iphone: i feel issue in fillpixelbufferfromimage method: func fillpixelbufferfromimage(image: uiimage, pixelbuffer: cvpixelbuffer, contentmode:uiviewcontentmode){ cvpixelbufferlockbaseaddress(pixelbuffer, 0) let data = cvpixelbuffergetbaseaddress(pixelbuffer) let rgbcolorspace = cgcolorspacecreatedevicergb() let context = cgbitmapcontextcreate(data, int(self.outputsize.width), int(self.outputsize.height), 8, cvpixelbuffergetbytesperrow(pixelbuffer), rgbcolorspace, cgimagealphainfo.premultipliedfirst.rawvalue) cgcontextclearrect(context, cgrectmake(0, 0, cgfloat(self.outputsize.width), cgfloat(self.outputsize.height))) let horizontalratio = c...

html - How to set background image using picture tag and src set -

how set image background div.so div should take height of image.this functionality need implemented using picture tag , srcset attribute in html.and if text overlays on image image should remain in same height div height should grow text. below code tried div height not increasing <style> .image { position: relative; width: 100%; /* ie 6 */ } .info{ position: absolute; top: 200px; left: 0; width: 100%; color: yellow; } </style> <script src="picturefill.min.js"></script> <div class="image"> <picture> <source srcset="new-york-city-wallpapers-desk.jpeg" media="(min-width: 1240px)"> <source srcset="new-york-city-wallpapers-tab.jpeg" media="(min-width: 940px)"> <source srcset="new-york-city-wallpapers-mob.jpeg" media="(min-width: 724px)"> <img srcset="" src="new-yor...

multithreading - What is thread local storage? Why we need it? -

i reading threads in os concepts , come across "thread local storage (tls)". understood tls similar static or global data, more unique individual thread. bit confusing on unique here? why can't pass data through runner (i.e., thread's actual codes) functions params function? let's supposed working in ada. in ada program define task (thread) includes [static] variable can accessed task. create multiple instances of task. need copy of [static] variable each task. that's implementation use thread local storage. in other words, static area of memory gets copied each thread in program. as alternative tls, thread allocate such storage @ top of stack.

xml - Xpath with xmlns -

although there tons of question on xpath , xmlns, not able achieve desired result. my xml :- <project xmlns = "https://afdsl/skdflsk/d"><name>amcr_positions</name><property name="included" type="hidden">true</property><locales><locale>en</locale><locale>de</locale></locales> <defaultlocale>en</defaultlocale> <namespace><name locale="en">amcr_positions</name> <name locale="de">amcr_positions</name> <lastchanged>2015-04-06t17:37:40</lastchanged> <lastchangedby>i575079</lastchangedby> <property name="included" type="hidden">true</property> <namespace> <name locale="en">database layer</name> <querysubject status="valid"> <name local...

scala, transform a callback pattern to a functional style internal iterator -

suppose api given , cannot change it: object providerapi { trait receiver[t] { def receive(entry: t) def close() } def run(r: receiver[int]) { new thread() { override def run() { (0 9).foreach { => r.receive(i) thread.sleep(100) } r.close() } }.start() } } in example, providerapi.run takes receiver , calls receive(i) 10 times , closes. typically, providerapi.run call receive(i) based on collection infinite. this api intended used in imperative style, external iterator. if our application needs filter, map , print input, need implement receiver mixes these operations: object main extends app { class myreceiver extends providerapi.receiver[int] { def receive(entry: int) { if (entry % 2 == 0) { println("entry#" + entry) } } def close() {} } providerapi.run(new myreceiver()) } now, question how use providerapi in functional style, internal ...

node.js - Socket.io using default namespace with some custom namepsace, not working -

i trying use default namespace '\' connecting general android application sockets socket.io , want make custom namespace website '/web' when client io.connect('/web') connects default namespace. basically want authorization of all, not /web namespace. here code io.sockets.on('connection', function (socket, next) { //some handshaking data varify connection } io.of('/web').on('connection', function(socket, next) { //here want skip verification } got request on default instead of /web. socket.io connection event trigger / default namespace on socket connections. later events client trigger on namespace connected to.

Make camera in webgl with vertex shader? -

i have idea, i'm not sure it, because i'm no guru in webgl. in webgl, there no camera. if 1 want simulate it, has operations lot of objects... precise, must change position hundreds of thousands of vertices. didn't study three.js or babylon js deep, have no clue, how work cameras. since vertex shader can transform vertex positions , because can pass camera matrix vertex shader, make sence let make calculations, gpu hard work instead of cpu? do mean : create view matrix in vertex shader using data position , orientation instead of create application , send resulting matrix in shader ? actually last case solutions three.js , lot of others : object representing camera can manipulated javascript. @ draw, view matrix built position , orientation parameters, , sent active shader program. creating view matrix done in steps : create identity matrix (no transformation) ; combine matrix each transformations apply camera : translations , rotations ; invert...

c# - How to make a StackPanel fit its Children's width -

i'm writing down here because i'm having lots of issues thing, , hope able me out :p i want create dynamic stackpanel fits children's width. i'll make example. let's stackpanel empty. width 10 (f.e.) , fixed height 30. want add image, , wrote down: bitmapimage myimage = new bitmapimage(new uri("[path]")); image realimage = new image(); realimage.source = myimage; realimage.width = 50; realimage.height = myimage.height; mystackpanel.children.add(realimage); the stackpanel not enlarge 50px though; it's stuck 10px, cutting image. same happens when try add other ui elements, textblocks , on. i tried like mystackpanel.width += realimage.width; but of course didn't work. i've tried set stackpanel's width "auto", didn't either. stackpanel declaration in xaml: <window x:name="mainwindow1" x:class="proj.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"...

Printing from a buffer using the read(2) function in C -

i'm trying read in bits using read function , i'm not sure how i'm supposed printf results using buffer. currently code fragment follows char *infile = argv[1]; char *ptr = buff; int fd = open(infile, o_rdonly); /* read */ assert(fd > -1); char n; while((n = read(fd, ptr, size)) > 0){ /*loops reads file until returns empty */ printf(ptr); } the data read ptr may contain \0 bytes, format specifiers , not \0 terminated. reasons not use printf(ptr) . instead: // char n; ssize_t n; while((n = read(fd, ptr, size)) > 0) { ssize_t i; (i = 0; < n; i++) { printf(" %02hhx", ptr[i]); // on older compilers use --> printf(" %02x", (unsigned) ptr[i]); } }

javascript - Turn script content of a function into string -

this question has answer here: how functions's body string? 2 answers for example, if have this: function hello() {console.log("hello")} i want able make function in java script return string value: "console.log("hello");" is there way plain javascript? you can of code including function declaration calling tostring() method on function. can parse string remove unwanted information. something this: function hello() { console.log("hello"); } var f = hello.tostring();//get string of whole function f = f.substring(f.indexof('{') + 1);//remove declaration , opening bracket f = f.substring(0, f.length - 1);//remove closing bracket f = f.trim();//remove starting/eding whitespace console.log(f); here working example

SSAS Many-to-Many relation without bridge table -

is possible many-to-many relation without bridge table in ssas ? have 1 fact table subjectid , fact table fk_subjectid , many others keys (related others dimensions). in view datasource 2 fact table connected each other, can't chose many-to-many relationship in dimension tab ? i'm missing maybe ? thanks lot. you @ least have define intermediate dimension. can defined based on first of fact tables, , can have subjectid attribute. , invisible users. analysis services requires intermediate dimension many-to-many relationships.

Python Barcode Generation -

i'm using elaphe package python generate ean-13 barcode images. package installed source using tar file found @ https://pypi.python.org/pypi/elaphe . when run code: barcode_image_path = "/tmp/" def create_barcode_image(product_barcode): path = barcode_image_path + product_barcode + '.png' img = barcode('ean13', product_barcode, options=dict(includetext=true, height=0.4), margin=1) img.save(path, 'png') return path from python interpreter seems work perfectly. correct barcode generated path specify. when run apache using web.py web framework receive error: traceback (most recent call last): ... img_path = create_barcode_image(barcode) file "/var/www/py/documents/barcode_images.py", line 27, in create_barcode_image img.save(path, 'png') file "/usr/local/lib/python2.7/dist-packages/pil/image.py", line 1406, in save self.load() file "/usr/loca...

coldfusion - Unable to access shared folder on windows via apache on mac -

i trying setup local site on mac. the configuration - application server: coldfusion 9 webserver: apache 2 i have got local site , running. in site, wish access images hosted on dev server (windows 2003). images folder shared , can mount mac. i have added virtual director in httpd.conf - alias /images/covers/uk "//xxx.xx.x.xx/imagesfolder/covers/uk/" <directory "//xxx.xx.x.xx/imagesfolder/covers/"> options indexes followsymlinks allowoverride order allow,deny allow require granted </directory> alias /images/covers "//xxx.xx.x.xx/imagesfolder/covers/" <directory "//1xxx.xx.x.xx/imagesfolder/covers/"> options indexes followsymlinks allowoverride order allow,deny allow require granted </directory> here xxx.xx.x.xx ip of windows server. imagesfolder name of shared folder on server. however, not able access folder , getting 403 error. any idea how fix please. you sh...

php : test for lines of array the condition range of date is between range of date -

i have logic problem on how filter entries within range of date. an array $price contains prices flight depending of period of travel, ordered date: print_r($price) [21] => array [date_beg] => 2014-07-05 [total1] => 648 [22] => array [date_beg] => 2014-08-05 [total1] => 750 [23] => array [date_beg] => 2014-08-12 [total1] => 520 it 648 euros 2014-08-05, becomes 750 2014-08-05 ... i have special offers @ periods. the same information present each element of array: print_r($price) [21] => array [date_beg] => 2014-07-05 [total1] => 648 [special_beg] => 2014-07-07 [special_end] => 2014-08-06 [special_price] => 600 [22] => array [date_beg] => 2014-08-05 [total1] => 750 [special_beg] => 2013-10-27 ...

cuda - On plans reuse in cuFFT -

this may seem simple question cufft usage not clear me. my question is: which 1 of following implementations correct ? 1) // called in loop cufftplan3d (plan1, x, y, z) ; cufftexec (plan1, data1) ; cufftexec (plan1, data2) ; cufftexec (plan1, data3) ; destroyplan(plan1) 2) init() //called 1 time in application { cufftplan3d (plan1, x, y, z) ; } exec () //called many times data changing size remains same { cufftexec (plan1, data1) ; cufftexec (plan1, data2) ; cufftexec (plan1, data3) ; } deinit() //called 1 time in application { destroyplan(plan1) } 3) cufftplan3d (plan1, x, y, z) ; cufftexec (plan1, data1) ; destroyplan(plan1) cufftplan3d (plan2, x, y, z) ; cufftexec (plan2, data2) ; destroyplan(plan2) .... ... assume data sizes of data1 , data2 , data3 same. please ignore correctness of syntax. need conceptual answer. the third implementation doesn't correct me... i think 3 can made work. method 2 fa...

php - CodeIgniter Routing 404 Error -

i new codeigniter , having trouble figuring out routing. getting 404 page not found error when go "/simplepie1". routing issue, or have messed controller or view? thanks. my controller: class feeder extends ci_controller { public function index() { $this->load->library('rss'); $feed = $this->rss; $feed->set_feed_url('http://www.theverge.com/rss/frontpage'); $success = $feed->init(); $feed->handle_content_type(); $this->load->view('feed_view', array('feed' => $feed)); } } my view: <?php include_once('header.php'); ?> <?php include_once('navbar.php'); ?> <?php foreach($feed $item) : ?> <br /> <a href="<?php echo $item['permalink']; ?>"><?php echo $item['title']; ?></a> <?php endforeach; ?> <?php include_once('footer.php'); ?>...

python - While Trying to def: TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int' -

i using code in python 2.7 produce new number by: def alg(n): n=((n**2)-1)/4 return n and error message: typeerror: unsupported operand type(s) ** or pow(): 'nonetype' , 'int' any great! thanks! somehow, you're passing none when call function, what's happening: alg(none) ... n none inside function, causing error. in other words: problem not in function, it's in point you're calling it. also word of warning - you're performing division between integers, better play safe , make sure @ least 1 of division's operands decimal, or else loose precision: def alg(n): # there's no need reassign n return ((n**2)-1)/4.0 # notice .0 part @ end

PHP Regex: group must end with character but do not capture this character -

example regex: /^([\w]+:)?other:(.*)$/ example string: test:other:words... the first group match "test:", want capture "test". @ first thought: /^([\w]+)?:?other:(.*)$/ but realised can't have single : in beginning. how can capture group if exists must end : : must not captured group? example input , output: randomstring:constantstring:somethingelse should give 'randomstring' first group. and constantstring:somethingelse should give first group empty here go: ^(?:(\w+):)?constantstring:(.*)$ (?:) non capturing group demo

sql - Merge rows into one row based on condition -

i have table structure similar below create table #temp(name varchar(10),col1 int,col2 int,col3 int,col4 int,col5 int) in case table can have same name repeated other values different so. sample values can insert #temp values('abc',1,0,0,1,1) insert #temp values('abc',1,0,1,1,0) insert #temp values('abc',1,0,1,1,0) insert #temp values('def',0,0,0,1,0) insert #temp values('def',1,0,1,1,1) insert #temp values('def',1,1,0,1,1) what trying here select 1 row each name, select column priority has value 1. so expected result in case name col1 col2 col3 col4 col5 abc 1 0 1 1 1 def 1 1 1 1 1 i have achieved doing below, works absolutely fine. there proper(easy) way of doing this. select name, (select top 1 col1 #temp t t.name=m.name order col1 desc) col1, (select top 1 col2 #temp t t.name=m.name ...

Centering HTML table wider than body -

when html table wider page body, it's left aligned, no matter if specified centered alignment. i've table containing css3 gradient buttons, size isn't easy predict (buttons size depends on font used browser). on browsers table grows wider page body, causing table become uncentered related page banner. i've read questions this: center table, if wider parent container stating way of centering tables in scenario javascript. but i'd wish find solution without javascript. page design simple (just site logo centered on header, , array of big buttons below). do have suggestion easy , elegant solution this, buttons table centered in page? http://jsfiddle.net/jq3qb/ i'm not sure is, want? can positioning , play left percentage adjust table. #test{ border: 1px black solid; width: 800px; position:relative; left: -25%; text-align:center; }

Make the initial dropdown menu option in Concrete5 not go to a page -

i building website using concrete5 includes drop down navigation using auto nav. right navigation looks this: --home --schools --school 1 --school 2 --school 3 right when click on schools takes page (which blank because haven't added anything) my question is, how make schools didn't go anywhere when clicked , had choose drop down options? quick workaround make "dummy" parent page in concrete5 nav: use external link main schools page instead of actual concrete5 page. create new external link in site map under home titled, "schools". link, enter # (pound sign, no http://) , or javascript(0); move pages inside existing "schools" page under new "schools" (do dragging-and-dropping each school onto new external link delete old "schools" parent page. another more in-depth option includes creating custom page attribute called "nav_link_dummy", using custom autonav template check (...

url rewriting - Creating a public profile and custom URL in PHP -

i'm looking create user admin area , public profile page custom url in php. have found great tutorial on users creating own private admin area. however, i'm struggling find further guidance on following: creating public custom url (such as website.com/username) based on user requested on signup. using custom url display public profile page selected information user entered private admin area. i know bread , butter stuff i'm leaning php guidance , best practices @ stage welcome. thanks, jack. you try following: use mod_rewrite (assuming have apache server) forward domain.com/abcde requests don't match existing file or directory (see -f condition) domain.com/user.php?name=abcde in user.php , data based on user-chosen name database , display it, display error message if no user found.

c++ - QtGridLayout behaving like a QVBoxLayout? -

Image
i'm having issues working qgridlayout. here's code , explanation comes after: for(int =0; i<filecount; i++) { int row = 0; int col = 0; qstring docname = filteredfiles.at(i).at(0); qlabel* doctitle = new qlabel; doctitle->settext(docname); qlabel* docicon = new qlabel; if(filteredfiles.at(i).at(2)== "word") { qpixmap icon("c:blah/blah/blah/wordicon.jpg"); docicon->setpixmap(icon); } else if(filteredfiles.at(i).at(2)== "excel") { qpixmap icon("c:/blah/blah/blah/excelicon.png"); docicon->setpixmap(icon); } else { qpixmap icon("c:/blah/blah/blah/ppicon.png"); docicon->setpixmap(icon); } gridcontainer->addwidget(docicon); gridcontainer->addwidget(doctitle); topgrid->addlayout(gridcontainer,row,col,1,1); col++; } maincontainer->addlayout(topgrid); the above code supposed make 2...

Unable to Run Spring Form based application(By using MVC architecture) -

i'm new spring.i have made application named "bookworkshop" using spring-3.1 following mvc architecture.but i'm hitting url:http://localhost:8087/bookworkshop i'm getting error follows: org.springframework.beans.typemismatchexception: failed convert property value of type 'java.lang.string' required type 'java.lang.class' property 'commandclass' . i'm attaching code herewith:: spring servlet class:bookdispatcher-servlet.xml <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springfram...

c# - Pausing a storyboard on TabItem mouse over -

i have tab control invisible tabs. when mouse on area of form, calls c# handler runs: ((storyboard)findresource("animate")).begin(hiddentab); the animate storyboard: <storyboard x:key="animate"> <objectanimationusingkeyframes begintime="0:0:0" storyboard.targetproperty="visibility"> <discreteobjectkeyframe keytime="0"> <discreteobjectkeyframe.value> <visibility>visible</visibility> </discreteobjectkeyframe.value> </discreteobjectkeyframe> </objectanimationusingkeyframes> <doubleanimation begintime="0:0:0.0" storyboard.targetproperty="opacity" from="0" to="1" duration="0:0:0.2"/> <doubleanimation begintime="0:0:2.5" storyboard.targetproperty="opacity" from="1" to="0...

java - Filling dropdown list with related tables name in JSP -

i have following structure of database created in hibernate4: department (has fields: department_id , department_name) connected through department_institute (has department_id , institute_id) institute (has institute_id , institute_name) later connected through institute_teacher (by id's again) teacher (teacher_id, name, surname, title). it has 1 many relationship 1 department can have many institutes , 1 institute can have many teachers. i put object , through jstl put 1 dropdown menu (dropdown list doesn't need have few levels, can on same level). problem is, don't know: how query data , put them 1 list, use jstl in jsp put them in dropdown menu. could tell me how that? love understand that. here skeleton of method querying "everything": [edit] here made method querying database, if have if it's solution or not, grateful public list<string> enlisteverything(){ session session = sessionfactory.opensession(); transaction...

Add a button to a webpart that enables a text box (C#), getting an error: Cannot implicitly convert type 'bool' to 'string' -

i have added button webpart - want functionality enable disabled text box next it. on deploy, getting error: cannot implicitly convert type 'bool' 'string' when convert string try overcome issue ( jdhfbtn.onclientclick = convert.tostring(jdhftxt.enabled = true); ), makes text box editable. looking resolve issue. please forgive ignorance - new c# , web parts, , not advanced in programming. thank you. here code in question: sb.append("</td>"); sb.append(" </tr>"); sb.append(" <tr class=\"row2\">"); sb.append(" <td class=\"rowtextleft\" width=\"25%\">spr/jdhf allotment:</td>"); sb.append(" <td class = \"rowtext\" td width=\"75%\">"); lc3 = new literalcontrol(sb.tostring()); controls.add(lc3); ...

ios - Custom tab bar icon colors -

im using xcode 5 develop list oriented app. have custom tint tab bar, custom images tab icons, custom tint tab bar's icon images when selected, cannot find how customize icon images' tint when not selected. right default gray can barely see in contrast green tab bar. want make tab bar icons' images , names white. does know how set tab bar icons' image tint in xcode 5? you can try tint selected icon : // custom tab bar [[uitabbar appearance] setselectedimagetintcolor:[uicolor whitecolor]]; and tint non active icon : [self.tabbaritem setfinishedselectedimage:[uiimage imagenamed:@"item_seleted.png"] withfinishedunselectedimage:[uiimage imagenamed:@"item_unselected.png"]];

javascript - HighCharts: Use shared tooltip only when series overlap -

in below highcharts example, series a , b have identical data. line b visible in chart plot area, plotted directly on a . it impossible end user know a behind b . we can set tooltip.shared = true in configuration object show data values given x-axis point when hovered on series. however, in real-life example have 50 series plotted on chart , not appropriate. is possible keep behaviour of tooltip.shared = false , when user hovers on series overlaps @ point 1 or more series, show (and only) of overlapping series values in tooltip? or there other user-friendly way indicate there 2+ identical y-values @ given x-value? http://jsfiddle.net/adamtsiopani/xbyzz/ $(function () { $('#container').highcharts({ xaxis: { categories: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'] }, too...

javascript - Dynamically get value of input fields with jQuery and process them with PHP -

i working on page show different input fields, depending on selection user did. example 1: <input type="text" name="color" value="" id="5"> <input type="text" name="location" value="" id="6"> <input type="text" name="age" value="" id="7"> example 2: <input type="text" name="color" value="" id="5"> <input type="text" name="destination" value="" id="8"> <input type="text" name="hours" value="" id="9"> <input type="text" name="date" value="" id="10"> question 1: how can input fields jquery when input fields dynamic? question 2: on serverside, want process input fields value , id. how can make dynamic? i know can done when fix, e.g.: var color = $(...

extjs4 - Reset Form Record Not Clearing Values - ExtJS 4.2 -

i have grid panel containing records which, on-click, loaded form panel editing. on "close" of our form panel, we're calling myform.getform.reset(), seems reset record values in form fields persist. // load record me.down('form').loadrecord(record); // close me.down('form').getform().reset() or me.down('form').reset() please advise how clear values in form upon resetting our record. do have trackresetonload set true form? if so, want set false.

arrays - Accepting form fields with square brackets in the name in Rails -

in rails app, i've run case i'd have checkbox name ends in square brackets, e.g.: name="foo[bar][baz[]]" other special characters seem handled correctly, looks rails stripping out square brackets , treating them declaring array rather being part of name. needs done allow arbitrary characters (brackets in particular) in name , have them processed correctly rails? that's because square brackets not allowed in specification: id , name tokens must begin letter ([a-za-z]) , may followed number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), , periods ("."). from html 4 basic html data types about rails part, , combining these 2 answers ( 1 , 2 ): rails make use of square brackets make associations in params hash, shouldn't mess names.

Compilation of 2.6.35 Linux + Android patches. Physical address of the kernel image? -

as title says i'm compiling linux kernel android patches. i'm being asked few configuration questions first time compiling. asked following question: physical address of decompressed kernel_image (zreladdr) [] (new) i don't know are asking. think odd asking specific address in memory. 1 familiar this? some updated info: source of question arch/arm/kconfig i found google's recommended config here: http://source.android.com/devices/tech/kernel.html i'm trying make connection between 2 now. guess need read on how .config files work i figured out how through issue. turns out previous question asking if wanted decompressed kernel image address auto-calculated had said 'no' to(this default). still can't imagine situation want manually specify address of kernel image though & i'm wondering if skipping question right thing default have answer it.

mysql - what is the difference between 'alter table rename' and 'rename table'? -

i using mysql. here's example, want rename table b, what's difference between following statement: alter table rename b; and one: rename table b; can give detail compare between them? vary based on different engine? as documented under alter table syntax : for alter table tbl_name rename new_tbl_name without other options, mysql renames files correspond table tbl_name without making copy. (you can use rename table statement rename tables. see section 13.1.32, “ rename table syntax” .) privileges granted renamed table not migrated new name. must changed manually. as documented under rename table syntax : you cannot use rename rename temporary table. however, can use alter table instead: mysql> alter table orig_name rename new_name ; there no other differences.

loops - Bash Exit Status codes for Ping -

i working on small script checks if host or down. until [ "$status" -eq "0" ] ping -c 1 192.168.0.3 echo host down status=`echo $?` done it supposed change status 0 if pings host , exit until loop. doesnt. if echo out value of $? value zero. can me figure out please? :) thanks in advance you have echo host down after ping command. $? takes exit status of echo command not ping command. ping -c 1 192.168.0.3 status=$? if [ $status -ne 0 ]; echo "the host down" fi

ios - How to get out of a UIStoryboard initialized in code -

Image
i have main container controller initializes child view controllers. i'm trying learn use uistoryboards tho , i'm stumped how out of storyboard. here's flow: once end of storyboard's scenes, how should out of storyboard , container controller? should keep pointer storyboard? it? should keep pointer initial view controller (which 1 explicitly add child)? it's .view won't on screen @ end don't know either. try looping through childviewcontrollers for (uiviewcontroller *vc in self.childviewcontrollers) { // }

android - Understanding the fragment and activity lifecycle and backwards navigation -

i'm trying understand odd behavior. have activitya calls method in oncreate() add fragmenta r.id.fragment_container. inside fragmenta have button attaches fragmentb using activitya's fragment manager (getactivity().getsupportfragmentmanager()) , replacing r.id.fragment_container , add backstack. have button starts new activityb. when navigate activityb get: activitya onresume(), fragmenta onresume(). when navigate fragmentb get: fragmentb oncreateview(), fragmentb onactivitycreated() 2 onresume(). so questions is...why view state saved when new activity launched , not when fragment replaced , reattached. looks better restore state rather recreate views , fetch data again. seems opposite behavior expect i'm missing fragment state saving/restoration step or something. seems activity pausing fragmenta (and activitya) when activityb launched , restoring on pressed when fragmentb attached fragmenta gets destroyed. i'm sure there's way prevent can't seem figure ...

php - Display grouped sql results -

i have sql query groups results. print_r shows results there. display these results in table groups i.e. table 1 list of seats table, table 2 etc. i have tried kinds of things done no avail... here code. can display records - display them groups arghhh $seatings = $wpdb->get_results("select bb_cl_seating.table, bb_cl_seating.seat, bb_cl_seating.seat_id, bb_events_attendee.fname, bb_events_attendee.lname, bb_events_attendee.email bb_cl_seating left join bb_events_attendee on bb_cl_seating.id = bb_events_attendee.id bb_cl_seating.event_id = '1' "); foreach ($seatings $seating) { } // ends foreach $seatings = $wpdb->get_results("select ...

jquery - JPlayer not playing video in IE -

i have jplayer audio , video files on tytonsound.com for reason, ie doesn't want play video files. video files available in .mp4, .ogv , .webm does know why these files aren't being played? for example page can use http://tytonsound.com/commercials.php the bottom list item video. i had add format, m4v. didn't create m4v file, used mp4 one, , told script mp4 , m4v. see below. { title : "wawahte", m4v : "/video/wawahte.mp4", mp4 : "/video/wawahte.mp4", webmv :/video/wawahte.webm", ogv : "/video/wawahte.ogv", poster : "images/poster.png" }

shell - Makefile - unterminated call to function `foreach': missing `)'. Stop -

this problem driving me nuts! here simple makefile: sources = b c $(foreach var,$(sources),echo $(var);) all: @echo done with make 3.8, makefile:3: *** unterminated call function 'foreach': missing ')'. stop. with make 3.81, makefile:3: *** missing separator. stop. but, if put foreach line within 'all' target, runs fine. help!! that foreach yield bunch of echo commands. can't have @ top level of makefile. use $(info) instead: $(foreach var,$(sources),$(info $(var))) example: $ make b c done

javascript - .innerHTML <br> breaking -

why breaking? i've not used .innerhtml correctly before , don't know why wrong. function asdf() { document.getelementbyid("qwerty").innerhtml="a<br> b<br> c<br> d<br>"; } you have escape new-lines in javascript string-literals: function asdf() { document.getelementbyid("qwerty").innerhtml="a<br>\ b<br>\ c<br>\ d<br>"; } though could, potentially more-easily, insert newlines in string itself: function asdf() { document.getelementbyid("qwerty").innerhtml = "a<br>\nb<br>\nc<br>\nd<br>"; }

c# - Clearing datagridview starting from the chosen row -

i want clear datagridview starting row user chose. trying few ways implement it, generate errors, have this: foreach(datagridviewrow row in this.datagridview1.rows) { if(row.index >= odelementu - 1) datagridview1.rows.removeat(row.index); } user need choose row should clear datagridview , click button odelementu //this variable represents starting row i don't know why loop misses rows. grateful advices it's because modify datagridviewrowcollection in foreach loop , make index gotten becomes inexact . try instead: while(datagridview1.rows.count>=odelementu) { datagridview1.rows.removeat(odelementu-1); }

Jquery - Change color of link -

i have following: <div id="libdiv" class = "libraryheader "> <a href="#" class="libraryheader" id="videolink" /> videos </a> | <a href="#" class="libraryheader" id="articlelink" /> articles </a> | <a href="#" id="newslink" class="libraryheader" /> news </a> </div> when click on link, like color of link turn gold while other links grey. .libraryheader { font-family: sans-serif; font-size: 24px; color: #4f5a5e; /* grey color */ text-decoration: none; } .libraryheaderselected { font-family: sans-serif; font-size: 24px; color: gold; text-decoration: none; } what happening when select links, turn gold when selected link, prevously selected remains gold , not turn grey. selected link gold. others...

air - Android Intent filter to receive URL shared from Chrome -

updated... i trying app show when click 'share' in chrome have not been successful. here have , app shows in list of apps crashes when select app. since adobe air app, feel has activity name. have tried app name, package name "air.appname" keeps crashing. <activity android:name="startactivity"> <intent-filter> <action android:name="android.intent.action.send" /> <category android:name="android.intent.category.default" /> <data android:mimetype="text/plain" /> </intent-filter> </activity>

c# - Where/when to populate lookup values? -

i've tried googling 2 days can't seem find answer. i'd category class provide description based on id entered , return error if id not valid. best approach? public class category { private int _id; private string _desc; public category(int id) { id = id; } public int id { { return _id; } set { _id = value; //_desc = value data access layer or throw error if id invalid } } public string description { { return _desc; } } } public class person { public int id {get; set;} public category category {get; set;} } public class myapp { static void main() { person p = new person(); category c = new category(2); p.category = c; } } since there potentially several instances of class category, waste memory-wise include va...

ruby on rails - displaying data from table columns in the view -

i able display information table user submitted data. can't seem setup how display users information table. index.html.erb: #this gives undefined local variable or method 'bio'. bio.content works on user page if signed in , shows data user only. <%= bio.content.all %> bio_controller.rb: def show @bio= user.all end user_controller.rb: def show @bio = current_user.bio.build can show me missing can show bio information database, instead of being allowed show data of signed in user profile. you need @bio.content.all in view. , want structure html: if @bio @bio.content.all.each |b| <!-- html show `b` record --> end end

brightness control slider is really slow in responding in ios -

i need help. i creating simple image processing app, load image camera roll or take picture. have brightness control (slider) adjust brightness of image. problem slider works in real time on simulator, on ipad there small delay in response. have tried everything, don't seem have luck. please help. have seen other apps slider works smoothly without delay. doing wrong? thanks i'm going take guess on things left out of initial question. 1) clarify, problem is: movement of slider not smooth. 2) also, result of, or in combination with, ui roughness, there delay in change image. i'm not sure implementation looks like, but, sounds you're doing work and/or on main thread. so, heres functioning implementation might do: - (void)sliderchanged:(uislider *)sender { [self adjustimagebrightnesswithvalue:sender.value; } - (void)adjustimagebrightnesswithvalue:(cgfloat)value { [self cancelcurrentwork]; // maintain reference operation , cancel [self...

delphi - SetWindowsHookEx inside Thread instability -

ok guys, i'll try explain problem in complete form. i'm using 1 dll injected in process (injected using virtualallocex/writeprocessmemory/createremotethread don't matter) , dll when run in entrypoint have 1 thing: procedure entrypoint(reason: integer); begin if reason = dll_process_attach begin mymainthread.create; end ok, work being done inside mymainthread (tthread)... in mymainthread set 2 timers, , hook keyboard events using setwindowshookex (wh_keyboard_ll). working fine when separately, is: or setwindowshookex or 2 timers... when both things unknown reason hook works few characters typed in keyboard (less 10) , timers stops, mymainthread doesn't terminate. tests on windows 7 / 2008 perfectly, when running in windows 2003 problems started. mymainthread execute this: procedure mymainthread.execute; begin while not terminated begin mythread:= self; startkeyboardhook; startup; settimer(0, 0, 600000, @mymainthrea...

How to tell if my program is being piped to another (Perl) -

"ls" behaves differently when output being piped: > ls ??? bar foo > ls ??? | cat bar foo how know, , how in perl? in perl, -t file test operator indicates whether filehandle (including stdin ) connected terminal. there -p test operator indicate whether filehandle attached pipe. $ perl -e 'printf "term:%d, pipe:%d\n", -t stdin, -p stdin' term:1, pipe:0 $ perl -e 'printf "term:%d, pipe:%d\n", -t stdin, -p stdin' < /tmp/foo term:0, pipe:0 $ echo foo | perl -e 'printf "term:%d, pipe:%d\n", -t stdin, -p stdin' term:0, pipe:1 file test operator documentation @ perldoc -f -x .

How to work with node.js and mongoDB -

i read : how manage mongodb connections in node.js web application? http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html how can set mongodb on node.js server using node-mongodb-native in ec2 environment? and confused. how should work mongodb node.js? i’m rookie, , question may stupid. var db = new db.mongoclient(new db.server('localhost', 27017)); db.open(function(err, database) { //all code here? database.close(); }); or every time when needing db need call: mongoclient.connect("mongodb://localhost:27017/mydb", function(err, database) { //all code here database.close(); }); what difference betwen open , connect? read in manual open: initialize , second connect. mean? assume both same, in other way, when should use 1 instead other? i wanna ask it's normal mongoclient needing 4 socket? running 2 mywebserver @ same time, here’s picture: http://i43.tinypic.com/29mlr14.png edit: wanna m...