Posts

Showing posts from July, 2010

php file_get_contents - AFTER javascript executes -

basically, trying scrape webpages php want after initial javascript on page executes - want access dom after initial ajax requests, etc... there way this? short answer: no. scraping site gives whatever server responds http request make (from "initial" state of dom tree derived, if content html). cannot take account "current" state of dom after has been modified javascript.

xpath - Querying XML content within an element -

i have odd xml document have query. weather.gov output. information i'd query within under: /enelope/body/ndfdgenresponse/dwmlout. converted form of xml. possible query individual elements under value, or have post process query within it? suspicion i'll have post process. <?xml version="1.0" encoding="iso-8859-1"?> <soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"> <soap-env:body> <ns1:ndfdgenresponse xmlns:ns1="http://graphical.weather.gov/xml/dwmlgen/wsdl/ndfdxml.wsdl"> <dwmlout xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;dwml version=&...

apache - Connecting to MSSQL server using RJDBC in Rapache -

i have problem connecting mssql server using rapache. use addon-package "rjdbc" connect server. in r-console can connect fine , access server when try connect trough rapache (on test website) fails , error. line when fails. drv <- jdbc("com.microsoft.sqldserver.jdbc.sqlserverdriver","/var/www/sqljdbc/sqljdbc4.jar") this error displayed in browser: error 324 (net::err_empty_response): server closed connection without sending data. in apache error log [tue jun 26 12:55:32 2012] [error] [client 10.21.2.79] rapache notice! thanks help,

datagrid - Find specific column and get values to an array in visual C# -

i trying refer specific column of datagrid , values array. don't errors problem zeroth position of array seem have value while other positions null.there 4 records in datagrid. doing wrong here's code: private void button1_click(object sender, eventargs e) { string[] arr = new string[10]; datatable getdata = new datatable(); foreach (datagridviewrow row in this.datagridview1.rows) { datagridviewcell cell = row.cells[1]; { if (cell != null && (cell.value != null)) { (int = 0; < datagridview1.rows.count; i++) { arr[i] = cell.value.tostring(); } } } } if (arr[0] != null) { textbox3.text = arr[0].tostring();//prints value } else if (arr[1] != null)//seems null { textbox2.text = arr[1]....

Is there a way to make this Ruby ternary operation evaluate properly? -

the following line of code <% invite.accepted ? { @going, @not_going = 'selected', '' } : { @going, @not_going = '', 'selected' } %> is attempt @ condensing several operations (evaluating expression , setting values of 2 variables accordingly) single line. it kicks error, claiming there's unexpected comma. is there way make work, or overloading poor ternary operator? (this personal experiment, way. don't mind using simple -- albeit cumbersome -- if/else statement) edit: following line of code works! i'll check off proper answer can! <% invite.accepted ? ( @going, @not_going = 'selected', '' ) : ( @going, @not_going = '', 'selected' ) %> how about: @going, @not_going = invite.accepted ? ['selected', ''] : ['', 'selected'] w, x = y, z same w, x = [y, z] , works fine , there no repetition.

grails - While Generating controller and view getting error : Can not set int field lms.Book.bookId to java.lang.Class -

while generating controller , view domain class as: class book { static constraints = { bookid blank:false booktitle blank:false } private int bookid private string booktitle private string author private double price private date edition private string publisher } giving error saying : can not set int field lms.book.bookid java.lang.class i think if u add 'private' field declaration, u have write getter , setter field: class book { static constraints = { bookid blank:false booktitle blank:false } private integer bookid ... integer getbookid() { this.bookid } void setbookid(integer bookid) { this.bookid = bookid } .... }

java - Jsoup get comment before element -

say have html: <!-- comment --> <div class="somediv"> ... other html </div> <!-- comment 2 --> <div class="somediv"> ... other html </div> i'm getting divs class == somediv , scraping them information. i'm doing this: document doc = jsoup.connect(url).get(); elements elements = doc.select(".somediv"); (element element : elements) { //scrape stuff } within loop, there way comment tag found before particular div.somediv element i'm on? if isn't possible, should go parsing html structure differently requirement? thanks advice. though question few month old here answer completeness. how using previoussibling preceding node . of course in real code want check, whether comment there. string html = "<!-- comment --><div class=\"somediv\">... other html</div><!-- comment 2 --><div class=\"somediv\">... other html</div>...

vb.net - Creating monopoly and Ludo in Visual Basic -

i want create monopoly board , ludo game in visual basic.net 2010. how should represent board? thinking of picture boxes, clumsy handle individually. can create arrays of picture boxes? also, since novice programmer, can tell features of visual basic useful game? instead of adding controls in forms designer, can add them programmatically in vb (and c#). gives freedom of storing them wherever want in two-dimensional array. sure add them form.controls property well. dim board new picturebox(m-1, n-1) {} myform.suspendlayout() ' diminishes flicker. integer = 0 m - 1 k integer = 0 n - 1 dim pic = new picturebox() 'todo: set properties of picturebox here board(i, k) = pic myform.controls.add(pic) next k next myform.resumelayout() also consider adding pictureboxes tablelayoutpanel instead of adding them directly form. and, of cause, idea create board class , handle board logic in class instead of performing logic in...

animation - How to make a flowing ribbon background for iOS like the one on PS3? -

i've started playing animated background views in ios, , think improves presentation of app. however, i'd create background don't know how make. effect i'm looking this: activeden.net/item/green-ribbon-animated-banner-background/49229 http://i156.photobucket.com/albums/t34/pspelver/wallpaper.jpg i'm not sure how design graphic kind of pattern, or if there better way core graphics. can please advise? thanks. try find (or create yourself) animated image of want. find or make video of effect want , frame-by-frame change .gif. set background. problem see effect want take lot of system resources.

pattern matching - Scala - extractor unapply confusion -

i'm attempting write extractor(s) use in matching against multiple parameter case class. simplified example: case class x(p1: string, p2: int) i'd each extractor objects define fixed value p1, , p2 defined on use. (a,b, etc cannot case class , subclass x, , use x( , ) case) example apply method: object { def apply(p2: int): x = x("a", p2) } object b { def apply(p2: int): x = x("b", p2) } ... for pattern matching, them match this: x("a", 2) match { case a(2) => true // <- should match: p1="a" , p2=2 case a(_) => true // <- should match: p1="a" , p2=_ case x("a", _) => true // <- should match: p1="a" , p2=_ case a(1) => false // <- should not match case b(2) => false // <- should not match: p1="b" , p2=2 } i know need define unapply method in a , b , etc., i'm thoroughly confused signature , logic should be: object { def unapply(...

jquery - javascript error, A script on this page may be busy, or it may have stopped responding -

i have used jquery components in web site, i'm getting error, "a script on page may busy, or may have stopped responding. can stop script now, or can continue see if script complete. " i have used, jquery tab component, carousel components 5 times, image slider component. due many jquery compnents? i have used, jquery-1.6.4.min.js fixed error, issue order of jquery scripts. once in correct order, works without issue, not due many components. @madhairsilence , @pst - comments

c# - Most Optimal TPL Dataflow Design? -

i ask input how best design optimal architecture using tpl dataflow. not have written code yet there no sample code can post. not looking code (unless volunteered) either assistance in design appreciated: the requirements follows: i have 3 core datablocks dependent on each other in specific ways. datablock1 producer produces objects of type foo1. datablock2 supposed subscribe foo1 objects (from datablock1) , potentially (not upon each , every foo1, subject specific function) produce foo2 objects stores in output queue other datablocks consume. datablock3 consumes foo1 objects (from datablock1) , potentially produces foo3 objects datablock2 consumes , transforms foo2 objects. in summary, here datablocks , each produce , consume: datablock1: produces(foo1), consumes(nothing) datablock2: produces(foo2), consumes(foo1, foo3) datablock3: produces(foo3), consumes(foo1) an additional requirement that same foo1 processed @ same time in datablock2 , datablock3. ok if foo1 obje...

javascript - How can I get the word that the caret is upon inside a contenteditable div? -

i trying extract single word content editable div @ position, when mouse clicked. example: lorem ipsum dolor sit amet, cons|ectetur adipiscing elit. cras vestibulum gravida tincidunt. proin justo dolor, iaculis vulputate eleifend et, facilisis eu erat.* using | represent caret, function should return " consectetur ". my attempt: window.onload = function () { document.getelementbyid("text-editor").onclick = function () { var caretpos = 0, containerel = null, sel, range; if (window.getselection) { sel = window.getselection(); if (sel.rangecount) { range = sel.getrangeat(0); if (range.commonancestorcontainer.parentnode == this) { caretpos = range.endoffset; } } } else if (document.selection && document.selection.createrange) { range = document.selection.create...

html - Add Dark Background Cover to Existing Website -

i building website , add dark semi-transparent background image cover background when user filling out form. wondering how current implementation not working. currently, when trying implement it, semi-transparent background not horizontally stretch entire width of page, , seems create unwanted chunk of vertical space @ bottom of page. existing solution involves creating div , using position:relataive; top:-1100px; left:0px; place div want. on website, semi-transparent background located on fourth , last page named 'find us'. clicking on tassel labeled 'feedback' reveal form. currently, difficult read form because of busy background, wanted use semi-transparent background cover 'blur' out on current page except form. demo of before attempted add semi-transparent background: http://www.sfu.ca/~jca41/stuph/it/website01/template.html demo of after attempt of adding semi-transparent background: http://www.sfu.ca/~jca41/stuph/it/website02/template.html ...

Access File in Mac using java.io.file -

i using java.io.file create new file in java.on mac-os using same code working fine on windows not working on mac. i using file file = new file(path); to create new file. in windows: used string path = "c:\test\1.html"; working fine. on mac: want create file @ "/users/pls/1.html" throwing error java.io.filenotfoundexception : /users/pls/1.html (no such file or directory) please help don't write separators manually,use system independent file.separator instead. string path = file.separator+"users"+file.separator+"pls"+file.separator+"1.html"; file file = new file(path);

actionscript 3 - Adding objects placed on the stage to an array (AS3) -

i'm working on project have bunch of objects (same type) placed on stage. want add of these objects array. here code, doesn't work though. know isn't best way go adding things stage, have way. package { import flash.events.event import flash.display.movieclip; public class pellet_manager extends movieclip { var pellets:array = new array(); var pellet:pellet; public function pellet_manager() { var pellet:pellet; (pellet in stage) { pellet = pellet; pellets.push(pellet); } } } } i have 5 instances of pellet on stage , want add them pellets array. should give each 1 instance name "pellet1" , loop through stage checking each 1 , adding array? any great. 1) access stage, have add manager it, , write callback function when it's added stage 2) foor loop has errors hope helps! package { import flash.events.event import flash.display.movieclip;...

c - 128-bit rotation using ARM Neon intrinsics -

Image
i'm trying optimize code using neon intrinsics. have 24-bit rotation on 128-bit array (8 each uint16_t ). here c code: uint16_t rotated[8]; uint16_t temp[8]; uint16_t j; for(j = 0; j < 8; j++) { //rotation <<< 24 on 128 bits (x << shift) | (x >> (16 - shift) rotated[j] = ((temp[(j+1) % 8] << 8) & 0xffff) | ((temp[(j+2) % 8] >> 8) & 0x00ff); } i've checked gcc documentation neon intrinsics , doesn't have instruction vector rotations. moreover, i've tried using vshlq_n_u16(temp, 8) bits shifted outside uint16_t word lost. how achieve using neon intrinsics ? way there better documentation gcc neon intrinsics ? after reading on arm community blogs , i've found : vext: extract vext extracts new vector of bytes pair of existing vectors. bytes in new vector top of first operand, , bottom of second operand. allows produce new vector containing elements straddle pair of existing vectors. ...

date - Using between mysql function ignoring year -

ok, have following users table: id | name | birthday 1 | nam1 | 1980-06-29 2 | nam2 | 1997-07-08 3 | nam3 | 1997-07-20 assuming today 2012-06-29 how can users celebrate birthdays in next 15 days? have tried this: select * users birthday between '%-06-29' , '%-07-14'; but looks not valid query. i think safest way compare age in 15 days age today: select * users timestampdiff(year, birthday, current_date + interval 15 day) > timestampdiff(year, birthday, current_date) see on sqlfiddle .

number formatting - Detect Java NumberFormat inaccuracy -

i want parse integer accurately, 1 has been potentially formatted according current locale. if didn't parse integer accurately, want know it. use: string string = "1111122222333334444455555"; locale locale = locale.getdefault(); numberformat numberformat = numberformat.getintegerinstance(locale); numberformat.setparseintegeronly(); number number = numberformat.parse(string); obviously "1111122222333334444455555" represents big number, bigger long can handle. numberformat gives me... double ?? i guess have expected receive biginteger rather double , since asked integer-specific number formatter. never mind that; bigger problem double value 1.1111222223333344e24 ! not equal 1111122222333334444455555 !! if numberformat gives me parsed value not equal stored in input string, how detect that? put way: "how can know if double value numberformat equivalent integral value represented in original string?" the javadocs parse() st...

TSQL pivot a single column table -

sorry late response off few days, , not specifying exact table structure. please ignore previous description above. have more information original question not longer valid obtain more information regarding need described below: i have following table (simplified version sake of discussion). first line headers: variableid documentid revision value 44 12 2 val1 45 12 2 val2 45 12 3 val3 44 13 1 val4 46 13 2 val5 47 14 1 val6 i’d convert (assuming n number of rows) following grouped (documentid, revision) table: documentid revision variable1 (44) variable2 (45) variable3(46) variable(47) variable (n) 12 2 val1 val2 null null 12 3 null val3 null null 13 1 val4 null null ...

ruby on rails - cancan/devise - redirect to requested path -

when user visits page not authorized view redirected login page. after log in redirected site root. there quick , easy way redirect them page asked for? you add hidden field referring_page sign_in -form add former referrer field , route there if existing, this: def after_sign_in_path_for(resource) params[:referring_page] || super end it's manual solution prefer using complex logic on controller side.

javascript - html/css breaking multicolumn text -

i looking solution situation: have large html text in 1 div container. using css3 multicolumns on that. , breaks container after contant height. n same heights "tables" multicolumn layouts. i'ts similar newspaper - large block text breaking after page height - next page continuing previous page text same multicolumn layout... how can ?

timer - Adding a time counter in Java? -

i writing application in java , add counter in user can start , stop. count in second , go minutes , hours (not days or months). make this? here how function: user clicks 'start' counter starts... user clicks 'pause' counter stops doesn't reset i new java there code @ or similar this? if not write me little code me started this? thanks, ljbaumer some recommendations: i use swing gui library i use swing timer nucleus of gui timer. a jlabel display change in time swing timer. the start jbutton's actionlistener start swing timer (calling start() on it) the pause jbutton's actionlistener call stop() . regarding: i new java there code @ or similar this? if not write me little code me started this? no, that's not how works here. responsible writing own code, we'll glad along if stuck or run errors or exceptions. learn more forcing brain create code, if seems difficult do. please check out following tutorials: ...

git fork - How to remove forked repository from assembla -

i playing around assembla , created fork of own repository selecting: source/git tab -> fork network -> fork -> fork new tab in space now, delete forked repository, without deleting orginal one, can't find suitable option. know how can delete it? you should have 2 tools in space now. can remove secondary tool through: admin tab -> tools -> delete second tool named source/git.2

html5/JavaScript or WPF/C# for diagramming application -

i'm going develop diagramming app support designing sql databases. i have experience wpf (about 2 years) , html5/js (about year) this should quick , easy-to-use app (working on linux , android wish) i'm looking advice, should use wpf or html5 ? thanks :) i'd go wpf. i don't think wpf easier html (it feels little overdesigned here , there), prototyping in c# easier richer language javascript. not mention benefits of typesafety.

java - Query two related tables (Joins) -

this first table in hive- contains information item purchasing. create external table if not exists table1 (this main table through comparisons need made) ( item_id bigint, created_time string, buyer_id bigint ) and data in above first table **item_id** **created_time** **buyer_id** 220003038067 2012-06-21 1015826235 300003861266 2012-06-21 1015826235 140002997245 2012-06-14 1015826235 200002448035 2012-06-08 1015826235 260003553381 2012-06-07 1015826235 this second table in hive- contains information items purchasing. create external table if not exists table2 ( user_id bigint, purchased_item array<struct<product_id: bigint,timestamps:string>> ) and data in above table- **user_id** **purchased_item** 1015826235 [{"product_id":220003038067,"timestamps":"1340321132000"}, {"product_id":300003861266,"timestamps":"1340271857000"},...

user interface - Android custom SeekBar with two values -

Image
i need create custom seekbar, can show 2 different values. idea is, dragging thumb change background color of whole seek bar (first value) , there white horizontal line, show second value. can me achieve this? one of thoughts use myseekbar.setprogressdrawable(dynamicalycreateddrawable); but hope there should better solution. if there not, can @ least point me, how dynamicaly draw image/drawable use this? you can use: myseekbar.setprogress(value1); // thumb myseekbar.setsecondaryprogress(value2); // white line where value1 , value2 between 0 , max.

php - Symfony Expiration Time Calculation -

insymfony (doctrine) trying create public function code below. i'm trying when user submits form, calculated expiration date item. here code have far don't know how calculate current time. have taken pieces of code different examples have found on internet fails every time. class car extends basecar { public function save(doctrine_connection $conn = null) { if ($this->isnew() && ! $this->getendtime()) { $now = need $this->setendtime(date('y-m-d h:i:s', $now + 86400 * sfconfig::get('item_duration'))); } return parent::save($conn); } } the item_duration set in app.yml file. can set site wide variable. you can current time this. $now = time();

objective c - Hide app icon in dock when minimized -

i new @ mac osx development. the app creating requires removing app icon dock throughout application. app allows minimizing , closing of app window. relaunching or reopening of closed or minimized app window done clicking app's icon status bar. i able set dock icon disabled during app launching; however, when app minimized (clicking minimize button), captures image of app's current window , adds dock. don't want occur. app should not add item dock. questions: does apple allow removal of app's re-launcher image dock when minimized? if apple allows this, how can hide or remove app dock? any big help! thanks! you cannot disable display of proxy tile when window minimized -- that's primary way users restore minimized window. if you'd rather window disappear entirely when it's not being used, disable minimization (in window's flags) , have user close window instead.

java - onBackPressed not Called Immediately - No Keyboard for id 0 - Android -

i overriding onbackpressed method in app : public void onbackpressed() { system.out.println("back pressed"); mp.stop(); finish(); } the problem button needs pressed @ least 3 times before method called. first couple of times : no keyboard id 0 using default keymap : /system/user/keychars/qwerty.kcm.bin can spot wrong ? call super.onbackpressed(); for more detail see link

asp.net - Recommended way to download remote SQL server database -

i'm corrently setting our company dtap environment our asp.net web application. current setup this: dev - on local machine local developer db test - on our local company server local company server db acceptance - production machine in separate iis application, running copy of production db production - production machine on production db i want add environment in order able reproduce bugs related data in production db. i'm deploying using teamcity , i'm looking easiest solution download production database (or backup of it) our company server , use if 'test on live data' environment. what recommended way this? right-click database on target server - "tasks" - "import data". specify production server/tables source.

google cloud messaging - Android GCM SENDER_ID, how to get it? -

i try migrate gcm , have issue sender_id need provide. use demo project google. in project need, if understand well, provide sender_id application in commonutilities.java file. the sender_id provided api key registered on https://code.google.com/apis/console/ , has form: aizasyaxxxxxxx_xxxxxxxxxxxnogzw (total 40 chars). using string sender_id on "broadcastreceiver mhandlemessagereceiver" error message: from gcm: error (invalid_sender). . where mistake? string provide not sender_id ? thank you. no, sender_id project id signed @ google api console, should numeric string. e.g. on browser uri, should see this: https://code.google.com/apis/console/#project:4815162342 the sender id 4815162342 updated answer: google has not updated docs completely. above answer old , based on documentation , seems still not updated. according updated google docs , seems project number on google api console used sender id

javascript - how to call event listener from the function which is in another scope? -

i want call google event listener looks this: google.maps.event.addlistener(trucks[data.results[i].id], 'click', function() { // magic :) } from function not defined in same scope: function this: function checkdata(){} how can that? can somehow send value can same click value? mean needs work on click event want call normal well. edit: let me more specific: we have like: function initialize() { google.maps.event.addlistener(trucks[data.results[i].id], 'click', function() {}; } and in different scope have function checkdata() { (var = 0; < window.data.results.length; i++) { if(window.data.results[i].driver_id==selectedindex) { // want sent founded object event handler in particular time } } } what need put inside checkdata call event handler in time? how pass value it? or need pass value it? revised answer: google.maps.event namespace contains trigger method. can use method simulate (for examp...

delphi - Virtual TAPI Device -

i'm building application relies heavily on tapi , allows users make/receive calls. wondering if had virtual tapi device or way of simulating incoming call, being on hold etc. if matters have using hbtapi components delphi (standard edition). unfortunately developing against simulator won't far due nature of tapi. know no complete end-to-end simulators. you can, little effort, setup own simple simulation environment using microsoft's h.323 telephony service provider , 2 or more computers on network. there several tapi sip providers( terasip , siptapi ) available let test against production sip servers. i've not seen tapi compliant hardware simulators. there's variation among vendors make tapi compliant hardware simulator give realistic behavior. your best bet test against actual hardware , provide list of ones support clients. can pretty results purchasing reliable voice modems support unimodem 5. can move tapi compliant pbx equipment there if t...

php - add css class to "main menu" (drupal, integration with columnal grid system) -

i have question you. i'm trying make website drupal 7, it's done except little problems, need first level of main menu had custom css classes in order integrate columnal , way print main menu: <?php print theme( 'links__system_main_menu', array( 'links' => $main_menu, 'attributes' => array( 'id' => 'main-menu', 'class' => array('menu') ) ) ); ?> and get: <ul id="main-menu" class="menu"> <li class="menu-nnn first active"> <a href="url" title="" class="active">home</a> </li> <li class="menu-nnn"> <a href="url">click me</a> </li> <li class="menu-nnn"> <a href="url">cli...

sharepoint - Creating a custom column: "Append-Only" File Upload -

i'm trying make custom column (for custom list), users can upload files without overwriting previous - way can keep past versions of files , upload newer ones , new ones append. there exist "append only" comment columns , file upload columns can see. i'm working sharepoint designer 2007 (2010 doesn't work site), , i'm referencing code found online somewhere (http://pastebin.com/raw.php?i=0qn89meu), trying research sharepoint documentation on msdn. can open site in designer, don't know go there (it's running on web server, not opening locally). i'm not clear on how start, thought there'd simple "right+click -> new column" feature can't find it. if point me in right direction start creating columns on site, great. thanks! an untested idea : create document library lookup column custom list. create event receiver (itemadded , itemupdated) take attached files , move them other list (with correct lookup value). ...

php - about limiting rss feed content -

i displaying blog rss feeds in website , 1 of blog soooo big 2-3 lines of description should display in website how can that? please me in advance am using magpierss-0.72 fetch rss code is require_once('rss_fetch.inc'); $url = 'http://rajs-creativeguys.blogspot.com/feeds/posts/default?alt=rss'; $rss = fetch_rss($url); foreach ($rss->items $i => $item ) { $title = strtoupper ($item['title']); $url = $item['link']; $desc = $item['description']; $date = $item['pubdate']; echo "<div class=\"blog\"><a target=\"_blank\" href=$url><h1>$title</h1>$desc<br/><br/><em>dated : $date <br/><br/></em></a></div> "; } and blog address http://rajs-creativeguys.blogspot.in/ $desc = substr(0,150,$item['description']); to first 150 characters. if want 150 words use $desc = ''; $max = 1...

linux - How tell wget to only download files within a specific path -

i trying download contents of website, since website in more 1 language, faced problem. structure of site follows: mysite.com fr.mysite.com ar.mysite.com ... i want download files in arabic domain (ar.mysite.com), using -r option downloads contents of other languages. how can wget recursively download files, files within specific domain? the --no-parent option want, if understand question. limits queries lie underneath "directory" specified original url.

hql distinct order -

hi need select distinct objects ordered newest subobject, how can this? tried select parent-objects subobjects: select distinct r.forumtheme forumresponse r order r.responseid desc i order items must appear in select list if select distinct specified. and when try this: select distinct r.forumtheme,r.responseid forumresponse r order r.responseid desc the result isnt distinct: forumtheme can appear multible times different responseid is there solution? for given forumtheme, have several responseids. how should sorted? [6, 3, 2] greater or lower [5, 4, 2] ? this why can't order by. you should execute following query: select r.forumtheme, max(r.responseid) forumresponse r group r.forumtheme order max(r.responseid)

jquery - Fancybox group images without duplicates -

how group multiple images without duplicates using fancybox? have tried using rel="group" although either displays list of recent images. i have following html: <ul> <li> <a rel="group1" class="fancy" title="custom title" href="http://farm3.static.flickr.com/2641/4163443812_df0b200930.jpg"> <img alt="" src="http://farm3.static.flickr.com/2641/4163443812_df0b200930_m.jpg"> </a> <h2><a rel="group1" class="fancy" title="custom title" href="http://farm3.static.flickr.com/2641/4163443812_df0b200930.jpg">test title image</a></h2> </li> <li> <a rel="group2" class="fancy" title="custom title" href="http://farm3.static.flickr.com/2641/4163443812_df0b200930.jpg"> ...

android - Months array throw ArrayIndexOutOfBoundException java -

in hijri calendar app, if click on next month button , reach till end of year (i.e. last month) or if click on prev month button till reach beginning of year (i.e. first month), app crashes , throws java.lang.arrayindexoutofboundsexception private imageview calendartojournalbutton; private button selecteddaymonthyearbutton; private final string[] hmonths = {"muharram", "safar", "rabi al-awwal", "rabi al-akhir", "jamadi al-awwal", "jamadi al-akhir", "rajab", "shabaan", "ramadhan", "shawwal", "zilqad", "zilhajj"}; private button currentmonth; private imageview prevmonth; private imageview nextmonth; private gridview calendarview; private gridcelladapter adapter; private calendar _calendar; private int month, year, hmonth, hyear; private final dateformat dateformatter = new dateformat(); private static final string da...

javascript - iOS Touch event passes through on DOM insertion -

in mobile safari on ipad , in ios uiwebview seeing following behavior. i have page replaces contents of dom element using javascript. first page has button when pressed remove elements container element , new set of html inserted container. the problem when button pressed , html switched out touch event passes through newly inserted html page. in case have text input on 2nd page in same position button on 1st page. so, when button pressed touch event passes through , puts focus on text input , soft keyboard comes up. do have details on why happens or how can prevent or workarounds problem? view link below on ipad , see talking about. doesn't seem happen on "click" event, both "touchstart" , "touchstop" makes happen. http://jsfiddle.net/tcollins/btmyd/embedded/result/ html <h3>touch start</h3> <div id="container2"> <button id="thebutton2">press me</button> </div> javascript ...

asp.net mvc 3 - Using webform master page in razor view -

i have tried implementing this , extension methods not working when rewrite them in vb. trying use corporate master page in mvc3 application. right have .master , .ascx page. confused on how show in razor view. my .ascx page: <%@ control language="vb" inherits="system.web.mvc.viewusercontrol" %> <asp:content id="content" contentplaceholderid="contentarea" runat="server"> <div> hello world </div> </asp:content> when run it, gives me error: content controls have top-level controls in content page or nested master page references master page. i use _viewstart.vbhtml to call on .ascx page. trying hack webforms objects work mvc3 going cause trouble down road. redo file mvc3 layout using razor. edit: added layout file tutorials: making layout pages understanding layout files layouts , sections

javascript - Hiding input doesnt work -

<input type="checkbox" name="avatarfileselected" value="image" id="avatarfileselected" onclick="$('#extra').hide('slow')"/> <span style="color:#538f05;">change image</span> <div id="extra"> <input type="file" name="avatarfile" id="avatarfile"></input> </div> the above code doesn't work. show me mistakes? you didn't include jquery... use vanilla javascript: onclick="document.getelementbyid('extra').style.display = 'none'"; instead of: onclick="$('#extra').hide('slow')" (or include jquery if want use it.) btw, <input> doesn't have closing tag: </input> replace: <input type="file" name="avatarfile" id="avatarfile"></input> with: <input type="file" name=...

R's read.csv() omitting rows -

in r, i'm trying read in basic csv file of 42,900 rows (confirmed unix's wc -l). relevant code is vecs <- read.csv("feature_vectors.txt", header=false, nrows=50000) where nrows slight overestimate because why not. however, >> dim(vecs) [1] 16853 5 indicating resultant data frame has on order of 17,000 rows. memory issue? each row consists of ~30 character hash code, ~30 character string, , 3 integers, total size of file 4mb. if it's relevant, should note lot of rows have missing fields. thanks help! this sort of problem easy resolve using count.fields , tells how many columns resulting data frame have if called read.csv . (n_fields <- count.fields("feature_vectors.txt")) if not values of n_fields same, have problem. if(any(diff(n_fields))) { warning("there's problem file") } in case @ values of n_fields different expect: problems occur in these rows. as justin mentioned, common problem u...

PHP - Multiple MySQL result, in separate variables -

i need mysql query search inexact match / match containing submitted value. the following example of in database: id img 1 1001_abc_01.jpg 2 1001_abc_02.jpg 3 1002_abc_01.jpg 4 1002_abc_02.jpg 5 1002_abc_03.jpg 6 1002_abc_04.jpg 7 1002_abc_05.jpg 8 1003_abc_01.jpg 9 1003_abc_02.jpg 10 1003_abc_03.jpg i need query search first part of filename ( 1002 ) , and assign each returned result in img field different variable. maximum amount of variables 5. for example, if search 1002 , should assign following variables: <?php $img1 = '1002_abc_01.jpg'; $img2 = '1002_abc_02.jpg'; $img3 = '1002_abc_03.jpg'; $img4 = '1002_abc_04.jpg'; $img5 = '1002_abc_05.jpg'; ?> so way can echo each filename result individually. again, maximum amount of variables here 5, if more 5 results returned, first 5 assigned varia...

c# - Are virtual members called via reflection (in normal circumstances)? -

i testing effects of calling virtual member in constructor, , discovered when calling member resulting exception wrapped within targetinvocationexception . according docs is: the exception thrown methods invoked through reflection however i'm unaware of invokations via reflection. mean virtual members called via reflection? if not why in case? the code: class classa { public classa() { splitthewords(); } public virtual void splitthewords() { //i've been overidden } } class classb : classa { private readonly string _output; public classb() { _output = "constructor has occured"; } public override void splitthewords() { string[] = _output.split(new[]{' '}); //targetinvocationexception! } } no, virtual methods called via virtual dispatch . reflection not being use...

node.js - Google feed api in a nodejs application? -

i have php application uses google feed api feeds want , display them. wondering how can call google feed api nodejs application ? use node's http.request() (or shortcut version http.get() ) functionality; that's conceptually same thing must doing in php. you might find installing , using mikeal's request module make things simpler.

c++ - How can I move a transform in the "forward direction"? -

i move transform forward, using directly object. rather move forward in particular axis (such z), there way can move in direction transform facing? example, default go down z axis perfectly, however, if rotate transform on y axis , want go "forward" not directly down z, little in direction rotated it. i believe need calculate forward vector, however, can seem find. can't find on if correct, or how it. how can move transform in "forward direction" while having 4x4 matrix (row major). this isn't game camera, rather game object. there for, have transform matrix, built rotation matrix, scale matrix , position. you can either extract third column (or row, depending on order of multiplication) matrix, , forward (or backwards, depending on direction "down" is). give destination vector the z-axis. equivalently, can multiply vector new vector4(0,0,1,0) (or new vector4(0,0,-1,0) ) matrix (or vector matrix). note fourth coordinate 0 instea...

iphone - I send some data to a webservice, it returns some JSON as NSData. How to convert to Dict?(iOS 4.3) -

i send credentials web-service. i can responce nsdata or nsstring. whats simpleist way convert (nsdata or nsstring)json nsdictionary can process it? building ios4.3 many thanks, -code download sbjsonparser framework using link, http://github.com/stig/json-framework/downloads , add required classes project (sbjsonparser.h). import sbjsonparser.h , use following code, sbjsonparser *parser = [[sbjsonparser alloc] init]; //dictionary name,id nsdictionary *jsonobject = [parser objectwithstring:jsonstring error:null]; //name array nsmutablearray *namearray = [[nsmutablearray alloc]init]; (nsmutabledictionary *dic in jsonobject){ [namearray addobject:[dic valueforkey:@"name"]]; }

Certificate is trusted by PC but not by Android -

since morning, certificate not trusted anymore on android , application cannot connect anymore: catch exception while starthandshake: javax.net.ssl.sslhandshakeexception: java.security.cert.certpathvalidatorexception: trust anchor certification path not found. return invalid session invalid cipher suite of ssl_null_with_null_null javax.net.ssl.sslpeerunverifiedexception: no peer certificate @ org.apache.harmony.xnet.provider.jsse.sslsessionimpl.getpeercertificates(sslsessionimpl.java:137) @ org.apache.http.conn.ssl.abstractverifier.verify(abstractverifier.java:93) @ org.apache.http.conn.ssl.sslsocketfactory.createsocket(sslsocketfactory.java:381) @ org.apache.http.impl.conn.defaultclientconnectionoperator.openconnection(defaultclientconnectionoperator.java:165) @ org.apache.http.impl.conn.abstractpoolentry.open(abstractpoolentry.java:164) @ org.apache.http.impl.conn.abstractpooledconnadapter.open(abstractpooledconnadapter.java:119) @ org.apache.http...

eclipse - Is it possible to save a set of breakpoints? -

i have set of breakpoints used debugging 1 issue. when want debug else, these breakpoints annoying, need disable/delete them. however, feel might want able recreate first set of breakpoints later. is possible save active breakpoints can switch between different sets of breakpoints 1 operation? if have 30 breakpoints, tedious recreate/reenable them manually. in eclipse (debug perspective -> breakpoints) select breakpoints, right click, export breakpoints!

objective c - Using Google Drive API for iOS app -

how can download revision history list of google drive document (that user doesn't own) through iphone app? all looking date , time of last revision. use queryforchangeslist return gtldrivechangelist . there a sample using api might you.

zend framework - PHP For loop to generate dynamic images -

i have page need generate thumbnail images each article. number of thumbnails vary each want check article in database , create array of thumbnails i'm struggling logic. this have far: for ($i=1; $i<20; $i++) { $thumbimages = array( 'src' => $newblogdoc['tvs']['thumbnail-image-' . [$i]] ); } is right direction? there more efficient way put array? your question isn't clear if want make associative array of arrays need do: for( $i=1; $i<20; $i++){ $thumbimages[] = array( 'src' => $newblogdoc['tvs']['thumbnail-image-'.[$i]] ); }

css - SVG for background -

i tried use svg background , works in local not when upload ftp. it has png fallback ie , others not support svg. in cases see png. (just example use red square svg , different think logo of skype.png fall back): http://jsfiddle.net/sng8w/ http://codepen.io/pen/9135/2 how put svg in in background? html: <div id="quadrat"></div>​ css: #quadrat { position: absolute; top: 20px; left: 20px; width: 400px; height: 400px; line-height:200px; background-image: url('http://mig-marketing.com/proves/retina/skype.png'); background-image: none,url('http://mig-marketing.com/proves/retina/rectangle.svg'), url('http://mig-marketing.com/proves/retina/skype.png'); background-size: 100% 100%; background-repeat:no-repeat; }​ you serving svg image 'text/xml' mediatype. while that's technically fine, it's quite possible browsers disallow in scenarios one, images allowed. try configuring server se...

Regex to remove [?] from line? -

what appropriate regex remove [?] line such: /hello[1]/world[2]/foo[3] /bar[3]/foo[2] etc. for symbol beetwin [] replace regex \[.+?\] empty string digits \[\d+?\]

http headers - Force the browser to cache a .php -

i need browser cache large, static .php file. open via ajax , want add current page. after research if found this $seconds_to_cache = 3600; $ts = gmdate("d, d m y h:i:s", time() + $seconds_to_cache) . " gmt"; header("expires: $ts"); header("pragma: cache"); header("cache-control: max-age=$seconds_to_cache"); this works ie, not chrome , firefox. here request accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-encoding gzip, deflate accept-language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3 cache-control max-age=0 connection keep-alive content-type application/x-www-form-urlencoded cookie phpsessid=5dkvr42f4it8pnnnqpesj6l413 host localhost referer http://localhost/mifa/suche.php user-agent mozilla/5.0 (windows nt 6.1; wow64; rv:13.0) gecko/20100101 firefox/13.0.1 charset utf-8 and here response header cache-control max-age=3600 connection keep-alive content-type text/html date thu,...

Is there a Java continuous testing plugin for Maven? -

i'm looking plugin run in console continuously scan maven project's test sources directory, , when detects change kicks off test cycle. analogous mvn scala:cc or scala build tool, java. can point me towards one? i have used sbt java project continuous test feature. i added sbt build file maven based project , use sbt when developing, use maven when building final package, starting embedded jetty etc , has worked out quite well.

Search for a certain style in word 2010 and make it into a bookmark using vba -

Image
how make style bookmark in word 2010? you won't able use of text in document bookmark name. illegal use characters in bookmark name in word/vba. may possible add such characters in bookmark names in xml format of document, if required, can ask separate question. this feels way code post on so. need explain framework have in place , tell hurdles are. can't again. "works me". if have questions though don't hesitate ask. run "runme" macro @ bottom. private function isparagraphstyledwithheading(para paragraph) boolean dim flag boolean: flag = false if instr(1, para.style, "heading", vbtextcompare) > 0 flag = true end if isparagraphstyledwithheading = flag end function private function gettextrangeofstyledparagraph(para paragraph) string dim textofrange string: textofrange = para.range.text gettextrangeofstyledparagraph = textofrange end function private function bookmarknamealreadyexist(boo...