Posts

Showing posts from July, 2015

kohana registration returns error -

kohana registration returns error - i have working registration script problem not know how check if username exist because if email or username exist returns me fatal error: orm_validation_exception [ 0 ]: failed validate array ~ modpath/orm/classes/kohana/orm.php [ 1174 ] and here script: $validate = validation::factory($values) ->rule('name', 'not_empty') ->rule('password', 'matches', array(':validation', 'password', 'repeat-password')) ->rule('password', 'not_empty') ->rule('email', 'email')->rule('email', 'not_empty') if(!$validate->check()){ $errors = $validate->errors('registration', true); foreach($errors $value){ echo $value . "<br />"; } return; } $model = orm::factory('user'); $model->values(array( 'username' => $values['nam...

wpf - ComboBox Whith a TreeView -

wpf - ComboBox Whith a TreeView - i need create usercontrol combobox. in items in need treeview , button. if navigate tree item should go text box in bottom. if click button tree should collapsed. first thought isn't good. <stackpanel orientation="vertical"> <stackpanel orientation="horizontal"> <textbox text="{binding adresse, mode=twoway}" maxlength="50" minwidth="170" grid.row="5" margin="5,2,5,2"/> <button width="25" margin="2" click="down"> <image source="/c1_net;component/images/arrow.jpg" horizontalalignment="left" /> </button> </stackpanel> <stackpanel x:name="tree" orientation="vertical" visibility="collapsed"> <sdk:treeview height=...

Cyber-Ark Privileged Identity Management API -

Cyber-Ark Privileged Identity Management API - do know if there sort of api available cyber-ark privileged identity management integrate enterprise applications? i think reply might 50% yes, 50% no. cyber-ark offers web services , api vault objects, should able retrieve passwords vault trusted application. there paragraph of sales info on cyber-ark's website: cyber-ark's comprehensive sdk provides interface vault objects can utilize develop custom solutions work vault. cyber-ark provides variety of sdk such command line interface, activex api, .net api , web services api but beyond working vault objects, i'm not exclusively sure. i'm looking more info on vault web services, , think need register partner information. i'll post follow-up if larn anymore. api identity cyber-ark

linux - Pattern decoding II -

linux - Pattern decoding II - possible duplicate: pattern decoding i have new question concerning previous post pattern decoding: i have same info file, there double empty (blank) lines, have taken business relationship in decoding. so, double empty lines mean there street/grout (for definitions see previous post: pattern decoding) in there 0 (0) house, have count these kind of patterns too. (yes, may think, absolutely wrong statement, because there no street without @ to the lowest degree 1 house, analogy, please, take is.) here new info file, double lines: 0 0 # <--- grouping 1 -- 1 house (0) , 1 room (0) 0 0 # <--- grouping 2 -- 2 houses (0;1) , 3,2 rooms (0,1,2;0,1) 0 1 0 2 1 0 # <--- house 2 in grouping 2, first room (0) 1 1 # <--- house 2 in grouping 2, sec room (1) 0 0 # <--- grouping 3 0 1 # <--- house 1 in grouping 3, sec room (1) 0 2 0 0 # <--- grouping 4 1 0 # <--- house 2 in grou...

javascript - Visual Studio Intellisense for Backbone.js -

javascript - Visual Studio Intellisense for Backbone.js - is there -vsdoc.js file backbone.js? if not, there feasible work-around method intellisense backbone.js javascript library? i don't think there vsdoc. couldn't find in nuget , searching didn't bring up. an alternative might reference non-minified version same way reference vsdoc file. may function list , maybe parameter names. if have js tool (many of them in extensions manager), or have resharper 6.0, may able go definition of function or , read comments in there (the non-minified version has comments, not in vsdoc format). update: some mutual reference code, enable intellisense not reference file, assuming utilize nuget package. http://nuget.org/packages/backbone.js reference in razor file (.cshtml) @if (false) { <script src="/scripts/backbone.js" type="text/javascript"></script> } reference in webforms view engine (.aspx, .ascx, .master): <% if(...

browsing and playing audio and video files in android -

browsing and playing audio and video files in android - i developing project in need play sound , video files. when sound player clicked should display sound files sdcard , play files. when video player clicked need display video files , play video files. i using media player playing files. mediaplayer mp = new mediaplayer(); string filepath = environment.getexternalstoragedirectory()+"/f.mp3"; mp.setdatasource(filepath); mp.start(); but problem is,how browse audio/video files , set info source dynamically when user selects particular file. you should utilize mediastore has separate contentprovider sound , video http://developer.android.com/reference/android/provider/mediastore.html audio : http://developer.android.com/reference/android/provider/mediastore.audio.html video : http://developer.android.com/reference/android/provider/mediastore.video.html android audio video

php - Why is this foreach failing? -

php - Why is this foreach failing? - the script using 'gets' html page , parses showing .jpg images within, need create modifications , when fails... this works: include('simple_html_dom.php'); function geturladdress() { $url = $_server['https'] == 'on' ? 'https' : 'http'; homecoming $url .'://'.$_server['http_host'].$_server['request_uri']; } $html = file_get_html($url); foreach($html->find('img[src$=jpg]') $e) echo '<img src='.$e->src .'><br>'; however, there problems... want show images on size, plus site not display total url in img tag , need seek around too... have done following: include('simple_html_dom.php'); function geturladdress() { $url = $_server['https'] == 'on' ? 'https' : 'http'; homecoming $url .'://'.$_server['http_host'].$_server['request_uri']; }...

asp.net mvc 3 - Custom model binder for inner model -

asp.net mvc 3 - Custom model binder for inner model - i got model this: public class mainmodel { public string id {get;set;} public string title {get;set;} public timepicker timepickerfield {get;set;} } timepicker inner model looks this: public class timepicker { public timespan {get;set;} public ampmenum ampm {get;set;} } i'm trying create custom model binding inner model: timepicker the question is: how values in custom model binder submitted in form timepicker model fields? if seek this: var value = bindingcontext.valueprovider.getvalue(bindingcontext.modelname); i null in value . i'm not sure how implement model binder correctly. public class timepickermodelbinder : defaultmodelbinder { public override object bindmodel(controllercontext controllercontext, modelbindingcontext bindingcontext) { if (bindingcontext == null) { throw new argumentnullexception("bindingcontext"); ...

How to show custom message when somebody clicks on refresh button of Coldfusion cfGrid (When session is out)? -

How to show custom message when somebody clicks on refresh button of Coldfusion cfGrid (When session is out)? - i using coldfusion (9.0.1) cfgrid populate data. code given below <cfform id="viewnewcustomerreport" name="viewnewcustomerreport"> <div class="buttonclass"> <cfinput type="button" id="generatereport" name="generatereport" value="generate report" /> <cfinput type="hidden" name="filters" id="filters" bind="javascript:generatereport({generatereport@click})"/> </div> <br/> <div id="gridcontainer"> <cfgrid name="newcustomerreport" autowidth="yes" colheaderbold="true" selectonload="false" width="710" bind="url:index.cfm?fuseaction=reportscommon.getnewcustomerreport&page={cfgridpage}&pages...

Good server-javascript host/framework? -

Good server-javascript host/framework? - i'm trying find javascript based web host, server-side javascript implementation. have played nodejs, , seems good, don't want have write entire server scratch. need host/framework next features (or @ to the lowest degree of them): 1: ability run script continuously on server while maintaining continuous dialog other scripts client pages (through xmlhttprequest). 2: php/asp functionality. 3: don't want have write entire server scratch. want worry writing application. also, have been looking aptana's jaxer, seems holy grail perspective, when go web site "www.jaxer.org", returns irrelevant page. please explain me? thanks, chris i've used https://no.de/ joyent host node.js applications. for communicating between client , server i'd utilize http://socket.io/ . it's communication framework take appropriate communication method maintain connection (continuous dialog) client. for serving...

Add .htaccess to cache manifest? -

Add .htaccess to cache manifest? - do need add together .htaccess file cache manifest? i know files required site need added work offline, .htaccess part of site in same sense? no. file part of server config, , should set inaccessible user. .htaccess cache-manifest

iis 7 - How can I set an app pool restart schedule in IIS7 via WMI / Powershell? -

iis 7 - How can I set an app pool restart schedule in IIS7 via WMI / Powershell? - i creating function manage app pools in iis7 our desired specifications, , having problem converting 1 line our equivalent iis6 script; set restart schedule. in iis6 line was: $newpool.periodicrestartschedule = @( '6:15' ); the naive translation iis7 is: $newpool.recycling.periodicrestart.schedule = @('00000000061500.000000:000') however doesn't work because throws exception: exception setting "schedule": "unable cast object of type 'system.string' type 'system.management.managementbaseobject'. how create scheduleelement[] array assign value? edit: problem 1 down...: $time = ([wmiclass]'root\webadministration:scheduleelement').createinstance() $time.value = '00000000061500.000000:000' $newpool.recycling.periodicrestart.schedule = $time; problem 2: value doesn't seem save when phone call $newpool.put...

node.js - Using routes in Express-js -

node.js - Using routes in Express-js - so i'm starting utilize node.js. saw video ryan dahl on nodejs.org , heard recommended express-js websites. i downloaded latest version of express, , began code. have fledged static view on /, seek sending parameters, errors this: cannot /wiki i tried next guide on expressjs.com way 1 uses routes has changed in latest version, makes guide unusable. guide: app.get('/users/:id?', function(req, res, next){ var id = req.params.id; if (id) { // } else { next(); } }); generated express: app.get('/', routes.index); my problem arises when seek , add together route. app.get('/wiki', routes.wiki_show); i've tried bunch of approaches, maintain getting cannot /wiki (404) error. routes/index.js looks this: exports.index = function(req, res) { res.render('index', { title: 'test', articles: articles, current_article: current_article, s...

iphone - Custom Audio Player -

iphone - Custom Audio Player - i'm looking sound player used many iphone applications such as: incubus, adele, foo fighters. this sound player has animated equalizer , slide left right when touched. using it, can browse different app screens , still have command on sound turn on or off. is part of framework available downloading or buying? all these app created same company, library company created , uses internally. iphone objective-c audio player

repository - How do I look inside my svn snapshots (backups) -

repository - How do I look inside my svn snapshots (backups) - i'm looking project may or may not checked 1 of many subversion repositories. machine actual repository died few years ago, have backups. bz compressed tar archives, snapshots taken weekly of filesystem (when unzip 1 , ls next directories: conf dump help openvxi repositories working ) i've done dump on late revision, , installed subversion on local machine, , installed repository still don't know what's in it. how browse what's within these things, without bother , work of checking out re-create of first? i hoping svnadmin help command allow me peer within these things there not seem alternative available. (i should note curious of our active projects have been moved on assembla. 1 i'm looking has not been worked on few years) you won't able find much treating repository directory. such tool want svnlook . svnlook tree <path-to-uncompressed-repository> | g...

Troubleshoot varnish and dual server configuration -

Troubleshoot varnish and dual server configuration - i have varnish set , working 2 server instances. i've made changes default.vcl file , updated changes follows on both servers: $now = fdfdf; sudo varnishadm -t xx.xx.xx.xx: -s /etc/varnish/secret vcl.load reload$now /etc/varnish/default.vcl && sudo varnishadm -t xx.xx.xx.xx: -s /etc/varnish/secret vcl.use reload$now" one server reflects new alter , works fine, other still seems using old configuration. does have thought why might or how troubleshoot? thanks, if execute each command manually, work? best guesses are: you're prompted sudo password on 1 system, not on other (thus hangs)? you're pointing secret-file wrong permissions? somehow first varnishadm didn't homecoming "true" , vcl.use didn't trigger in sec part so, best thing do: execute each command manually , check responses get. varnish varnish-vcl

download - Issue with downloading PDF from S3 on Chrome -

download - Issue with downloading PDF from S3 on Chrome - i'm facing issue on downloading pdf files amazon s3 using chrome. when click link, controller redirect request file's url on s3. it works firefox, nil happens chrome. yet, if perform right click -> save location as download file ... and copy-paste of s3 url chrome lead blank screen ... here info returned curl: date: wed, 01 feb 2012 15:34:09 gmt last-modified: wed, 01 feb 2012 04:45:24 gmt accept-ranges: bytes content-type: application/x-pdf content-length: 50024 server: amazons3 my guesses related issue content type ... tried didn't work. the canonical internet media type pdf document application/pdf defined in the application/pdf media type (rfc 3778) - please note application/x-pdf , while commonly encountered , listed media type in portable document format well, notably absent official application media types listed internet assigned numbers authorization (iana). i'm not a...

jquery - facebook like button dynamic thumbnail with ajax gallery -

jquery - facebook like button dynamic thumbnail with ajax gallery - i want set facebook button website. located on image archive page. image archive loaded dynamicly via jquery $.post() function. archive consists of grid of images , single image view. when click on image in grid bigger version loaded single image view. want provide facebook button share website , thumbnail selected image should appear. the meta tag property og:image looks follows <meta id="active-image" property="og:image" content="http://mysite.com/default_image.jpg" /> when clicks on image in grid content attribute of meta tag changed url of current image in single view. $('#active-image').attr('content','http://mysite.com/detail_image.jpg'); as href of button use <a target="_blank" href="http://www.facebook.com/sharer.php?u=http://mysite.com">facebook</a> the problem thumbnail provided popup faceboo...

objective c button disabling queues user touch ups -

objective c button disabling queues user touch ups - i'm writing ap which, when press on button, button should disabled random amount of time between 0-10seconds , after that, button becomes active again. however, while button disabled, if user clicks, click seems queued waitingg button enabled , click processed. how disable , not enqueue user clicks? -(void)buttonpressed{ nslog(@"button pressed!"); button.userinteractionenabled=false; sleep(rand()%10); proglabel.text=@"button enabled!"; button.userinteractionenabled = true; } i'm assuming using button derives uicontrol ( uibutton ?). can take advantage of existing enabled property. setting property no ignore touch events. see this link info regarding uicontrol . also, issue see in illustration sleep() function. i'm not familiar function, could blocking main thread. cautious. instead, should utilize nstimer. after each interval, might this: button.enab...

jquery - Fire hover event from JS event function -

jquery - Fire hover event from JS event function - i using radtreenode telerik. create utilize of nicer scrollbars appear on hover event. part seems working expected. however, if expand item in tree node (so scroll bar needed) scroll bars don't appear until mouse out , in again. presume happening because hover event not firing mouse above element. treeview command has client side event fires when node expanded. possible fire hover event when function fired? i tried next seems cannot find #scrollbars element. can see element in chrome dev tools. function clientnodeexpanded(sender, eventargs) { $('#scrollbars').mouseenter(); } methods case sensitive in js: $('#scrollbars').mouseenter(); or: $('#scrollbars').trigger("mouseenter"); jquery events scroll hover

java 6 - Set custom cursor when dragging external file into Swing app -

java 6 - Set custom cursor when dragging external file into Swing app - i have swing application import external file dragging external file windows explorer onto application. have basic functionality working. however, alter default drag/drop cursor icon application appropriate cursor. have not been able alter cursor visible user while mouse key pressed , held on application. have seen examples of working if drag , drop operation within same swing application. have attempted accomplish using draggesturelistener , dragsource no avail. seems methods not called unless drag source within swing. possible alter drag cursor when dragging external file swing application? please see simplified example: public class dndtemplate extends jframe { private static final long serialversionuid = 1l; private jcomponent thepane = null; private cursor dropcursor = null; public dndtemplate() { super( "drop file here" ); thepane = (jcomponent) getcontentpane(); thepane....

windows phone 7 - Superscript and Subscript in WP7 -

windows phone 7 - Superscript and Subscript in WP7 - i'm trying show "h2o" 2 in subscript in pivotitem header. e.g. <controls:pivotitem header="h20"> </controls:pivotitem> i'd assign same value code behind textblock.text. e.g. textblock1.text = "h2o"; // 2 appear subscript. is possible version of silverlight used wp7? after searching around found solution. from subscript , superscript in textblock troels pedersen , lordcheeto respectively. in xaml subscript 2 can expressed via unicode. e.g. <controls:pivotitem header="h&#x2082;0"> </controls:pivotitem> and code behind. e.g. textblock1.text = "h\x2082o"; // 2 appears subscript. there limitations on approach characters in basic multilingual plane (0000-ffff) supported , font beingness used needs back upwards characters. windows-phone-7 xaml subscript superscript

jquery - Cannot write more than two fields, using SPServices UpdateListItems -

jquery - Cannot write more than two fields, using SPServices UpdateListItems - i'm creating list items in sharepoint (moss) list programmatically. i've been successful several different techniques, long limit number of fields two. need provide 76 field values, actually. trying spservices updatelistitems method. latest versions of jquery (1.7.1) , spservices (0.7.0). my first approach utilize valuepairs option. have 2 arrays can utilize feed this. worked fine 2 values. tried statically filling variables , using those. same result. switched caml batch method. same result. the finish function status "success." nil gets written list. var batch = "<batch onerror='continue'><method id='1' cmd='new'>"; batch += "<field name='" + vartitle + "'>" + vartitle_val + "</field>"; batch += "<field name='" + varformid + "'>" + varformid_val...

wpf - How can I rewrite my code to bind a collection element in code? -

wpf - How can I rewrite my code to bind a collection element in code? - how can write binding xaml in code bind collection element? <gridviewcolumn width="70" displaymemberbinding="{binding pageconfidences[0], stringformat=p1}"> ... </gridviewcolumn> depending on pageconfidences is, may have write value converter. see http://social.msdn.microsoft.com/forums/en-us/wpf/thread/ed707380-f14f-40e1-8a79-bfb9a445a7fa/ wpf xaml binding

python - Regular Expression HTML Tag Exclusion -

python - Regular Expression HTML Tag Exclusion - yes, yes, i've weighed using xml parser instead of regular expressions, seems simplistic plenty case it's suitable: from beautifulsoup import beautifulsoup urllib import urlopen tempsite = 'http://www.sumkindawebsiterighthur.com' thetempsite = urlopen(tempsite).read() currenttempsite = beautifulsoup(thetempsite) email = currenttempsite.findall('tr', valign="top") print email[0] currently results with: <tr valign="top"> <td><p>phone number:</p></td> <td>&nbsp;</td> <td><p>706-878-8888</p></td> </tr> i'm trying remove markup (tr, td, p,   nice too) , result: phone number: 706-878-8888 my problem over-exclusion , multiple lines beingness regex'd, looking reply outputs on single line. if results simple, next regex set 'phone number:' in capture grouping 1 , number in ca...

jquery - Limit number of lines (rows + Enter key press) in Text area plus show Line Count -

jquery - Limit number of lines (rows + Enter key press) in Text area plus show Line Count - i looking find way using jquery / html / or css following. my text area fixed size, 1 font size/type, , want able following. limit number of lines 18 lines display number of lines user has used far (kind of twitter approach characters displaying lines used) line definition: line project either when user presses come in on keyboard , goes new line, or when new row / line created in textarea naturally typing continuously int textarea. have fixed size textarea , user cannot go outside these limits set. i not provide code snippets problem approach of how i'm seeing solution. basing algorithm on font.js javascript library, retrieve length in pixels of text , of caracters in text. if you're using unique font in textbox know when line completed each time number of pixels in line equals or inferior actual number of pixels used in new line. in pseudo-code : var textboxlinei...

Multiple image upload using php -

Multiple image upload using php - i have simple php script allows users upload photos. i'd know how convert script enable user upload multiple photos @ same time. this part of php script: if (isset($_files['images'], $_post['album_id'])) { $image = addslashes(file_get_contents($_files["images"]["tmp_name"])); $image_name = addslashes($_files['images']['name']); $image_size = getimagesize($_files["images"]["size"]); $image_temp = addslashes($_files['images']['tmp_name']); $allowed_ext = array('jpg', 'jpeg', 'png', 'gif'); $ex = explode('.', $image_name); $image_ext = strtolower(end($ex)); $album_id = $_post['album_id']; what changes need create part allow multiple uploads? know there should foreach loop in there somwhere don't know set it. mike here rough solution, not write entire code h...

.net - Entity Framework Code First mapping composite key in join table where foreign keys are not exposed in model -

.net - Entity Framework Code First mapping composite key in join table where foreign keys are not exposed in model - i have bring together table additional field relevant join: virtualdatastreamid int not null datastreamid int not null formulaelement int not null all columns primary key. the poco mapped is: public class virtualdatastreammap { public virtual datastream datastream { get; set; } public virtual virtualdatastream virtualdatastream { get; set; } public virtual string formulaelement { get; set; } } i not have foreign key properties in model as, me, concept of foreign key implementation detail , should encapsulated relationships specified class. i'd prefer not add together these if possible. how map fluent api? hoping below (which unfortunately doesn't work): modelbuilder.entity<virtualdatastreammap>() .haskey(vdm => new { datastreamid = ...

ios - Texture Atlas - Matrices or Coordinates? -

ios - Texture Atlas - Matrices or Coordinates? - when using texture atlases (i'm using opengl es 1.1 , 2.0 on ios), has improve performance: using matrices right piece of atlas each object, or using texture coordinates? i'd 'using texture coordinates' should faster in average case : in case, can have chance have less draw calls. in best case, can submit objects in single draw call. for texture matrices, in average, have alter between each object, have submit 1 object per draw call. of course, usual in graphics, mileage may vary depending on specific context, , may find specific optimization opportunities in case. if performance gain of import application, should seek both , profile performance. ios performance opengl-es textures texture-mapping

vb.net - Can you ignore specific redundant qualifiers in Resharper? -

vb.net - Can you ignore specific redundant qualifiers in Resharper? - we have used me.property , me.control in our vb projects, , have got resharper. know of way ignore specific type if redundant qualifier? i still want complain if utilize other redundant qualifiers. as far know, known cases of qualifier redundancy covered single inspection, means can't tell resharper ignore occurrences of me still highlight, say, explicit namespace references. here's relevant feature request you're free vote , watch. vb.net resharper

iphone - InAppPurchase implementation -

iphone - InAppPurchase implementation - how can test in-app purchase before release? i have application not in app store haven't provide details submission of application in itunesconnect , want implement in-app purchase same application possible? yes possible. need login itunes connect business relationship , submit details of ur app , create in-app purchases there only. can test before uploading app store. please r&d on own on google , come here code if u have problem. iphone in-app-purchase in-app-billing

Video Conferencing in ASP.NET, flash, silverlight -

Video Conferencing in ASP.NET, flash, silverlight - i need implement video conferencing in asp.net application. we have cases contains 3 users. per case need set video conferencing possibility. are there services or libraries utilize functionality? edit: tokbox service use, need solution maintain on own servers now. there existing services allow me this? see here: http://www.red5chat.com/. by far easiest solution @ point embed flash asp.net pages. can utilize red5 media server backend if want free , pretty solution. (you can pay back-end media server solutions wowza or flash media server.) you can in theory silverlight (see http://silverlightvideochat.codeplex.com/), it's not sophisticated flash solutions, i.e., video codec isn't good, there's no aec, noise reduction, etc. as html5, google has open-sourced webrtc, , it's working way through standards process. it's supported ~0% of browsers out there. (it released chrome dev channel in mi...

android - Using an arbitrary stream as a source for MediaPlayer -

android - Using an arbitrary stream as a source for MediaPlayer - i utilize arbitrary inputstream info source mediaplayer object. the reason inputstream using in fact authorized https connection media resource on remote server. passing url in case not work authentication required. can authentication separately , inputstream resource - problem do 1 time have it? i thought alternative of using named pipe , passing filedescriptor setdataresource method of mediaplayer. there way create named pipes in android (without using ndk)? any other suggestion welcome. i think have found solution. appreciate if others interested seek on own , study results device models , sdk version. i have seen similar posts direct thought post anyway since newer , seems work on newer versions of sdk - far works on nexus 1 running android 2.3.6. the solution relies on bufferring input stream local file (i have file on external storage possible place on intenal storage well) , providing ...

string - Calling PHP explode and access first element? -

string - Calling PHP explode and access first element? - possible duplicate: php syntax dereferencing function result i have string, looks 1234#5678. calling this: $last = explode("#", "1234#5678")[1] its not working, there syntax error...but where? expect 5678 in $last . not working in php? array dereferencing not possible in current php versions (unfortunately). can utilize list [docs] straight assign array elements variables: list($first, $last) = explode("#", "1234#5678"); update since php 5.4 (released 01-mar-2012) supports array dereferencing. php string explode

javascript - How to select elements within boundary? -

javascript - How to select elements within boundary? - i'm trying figure out way select elements overlapped (and contained, covered up) within absolutely positioned div. i need select elements within pixel boundary. how can done using jquery? here's basic idea: var left = 100, top = 200, right = 300, bottom = 500; $('#main-div').children().filter(){ var $this = $(this), offset = $this.offset(), rightedge = $this.width() + offset.left, bottomedge = $this.height() + offset.top; if (offset.top > top && offset.left > left && right > rightedge && bottom > bottomedge) { homecoming true; } homecoming false; }); change coordinates @ top whatever need. javascript jquery

c++ - Create a 2D world -

c++ - Create a 2D world - ive got project school create tanks game ( worms or else ) with little research found best way create 2d world hold bitmap of 1 , 0 switch between background , foreground. load 2 images 1 background worms game sea or , image map placed on it. because of bitmap if shoot replace 1 in 0 there whole in map.. with qt draw canvas display bitmap. i don't find how programme this, maybe help me out, start? what you're describing 1's , 0's called transparency , bitmaps can made encode info in them, known alpha channel. the key break downwards problem smaller parts , tackle each little part - question broad. so, break downwards this: create window draw bitmap on window (no transparency - it's background) draw sec bitmap transparency modify transparency of sec bitmap @ run time c++ 2d

html - Storing a WebView for offline browsing Android -

html - Storing a WebView for offline browsing Android - what best way forcefulness android store webview media (say sd card) 1 time page loaded? a few more details: -each page rich images, scripts , styling. -each page .5-1 megabyte -they saved 1 time onfinishedloading override called. -ideally, best save sd card (thoughts?) utilize local repo open up not sure if should utilize sql database webviews, or take each view , write out file - , if latter, easiest don't have write total webcrawler each file linked? in order utilize caching on android, need provide html5 manifest file along html. <!doctype html> <html lang="en" manifest="manifest.file"> <head> ... the caching mechanism cache whatever entries list in manifest file sqlite database. maintain in mind database per app, not per webview. (i had lot of problems this). this article explains steps need take accomplish this. http://web.archive.org/web/2014...

OS X Cocoa concurrency: how to return control to the UI after a task is launched -

OS X Cocoa concurrency: how to return control to the UI after a task is launched - i have calculation task take time complete. minutes. maybe several minutes. want launch task button on ui, homecoming ui user can interact other areas while task running. i modeled code after illustration apple's concurrency programming guide: // code here initialize c++ objects a, b, c, , d ivars. - (nsoperation*)taskwithdata:(id)data { nsinvocationoperation* theop = [[[nsinvocationoperation alloc] initwithtarget:self selector:@selector(mytaskmethod:) object:nil] autorelease]; homecoming theop; } // method actual work of task. - (void)mytaskmethod:(id)data { // perform task. task(a, b, c, d); } then phone call mytaskmethod:data within button's ibaction: -(void)actionbuttonpushed:(id)sender { nsautoreleasepool* mypool = [nsau...

javascript - How to resolve circular dependencies with nested views in Backbone.js -

javascript - How to resolve circular dependencies with nested views in Backbone.js - i'm building app using brunch , backbone.js include nested menus. have created menuitemmodel , menuitemscollection, both extending corresponding backbone-base-objects. in add-on have menuitemview (for individual items) menuitemsview (for collections of items). stripped down, this: class menuitemview extends backbone.view tagname: 'li' initialize: (options) -> if @model.get('children')? childcollection = new menuitemlist childview = new menuitemsview el: $('<ul>').appendto @el collection: childcollection class exports.menuitemsview extends backbone.view initialize: (options) => @collection.bind 'add', @add add: => view = new menuitemview { model: @collection.last() } as can see, there's circular dependency between 2 views, , not exclusively unexpected...

java - Someone Please Explain to me this part of Code -

java - Someone Please Explain to me this part of Code - public string extension(file f) { string filename = f.getname(); int lastindex = filename.lastindexof(dotsymbol); if(lastindex > 0 && lastindex <filename.length() -1) { homecoming filename.substring(lastindex+1); }else { homecoming ""; i don't understand why need decrement 1 if statement , add together 1 substring. you finding lastly position of string has dot. if find dot homecoming substring after dot (this gets file extension). subtract one, because if dot lastly character of string have no file extension. add together one, because don't want homecoming dot, want homecoming what's after dot (the file extension). java filefilter

forms - JavaScript validator with 2 submit buttons -

forms - JavaScript validator with 2 submit buttons - i'm using javascript validator http://www.javascript-coder.com/html-form/javascript-form-validation.phtml. problem i'm facing have 1 button saves registration (here need check name , last name ) , sec button checks entire form. however, if press button, checks entire form. <form id="ministerial" name="register" action="" method="post"> <label>title: </label> <input type="text" name="title" value="" /> <label>first name: </label> <input type="text" name="first_name" value="" /> <label>last name: </label> <input type="text" name="last_name" value="" /> <label>organization: </label> <input type="text" name="organization" value="" /> ... <input type="submit...

How can I add new codecs for matlab? -

How can I add new codecs for matlab? - is there way load new codecs matlab? supports basic codecs , filters. need utilize uncompperessed videos in matlab on linux, can utilize gstreamer plugins. on windows, can utilize directshow codecs, including ffdshow. alternatively, can utilize ffmpeg transcode video or write frames of video series of images. matlab codec

delphi - blogger via idHTTP : error 400 bad request -

delphi - blogger via idHTTP : error 400 bad request - i'm trying post blogger using idhttp component, however, i'm getting "http/1.0 400 bad request" error. procedure tform1.button1click(sender: tobject); var request,response,req : tstringlist; auth,blogid : string; begin blogid := '00000000000000000000000'; request := tstringlist.create; response := tstringlist.create; req := tstringlist.create; idhttp1.request.connection := 'keep-alive'; idhttp1.request.contenttype := 'application/x-www-form-urlencoded'; idssliohandlersocket1.ssloptions.method := sslvsslv23; request.clear(); request.values['accounttype'] := 'google'; request.values['email'] := 'xxx@gmail.com'; request.values['passwd'] := 'yyy'; request.values['service'] := 'blogger'; response.text :=idhttp1.post('https://www.google.com/accounts/clientlogin',request); auth := resp...

select - JQuery Selector that has -

select - JQuery Selector that has - i'm trying wrap head around this. e.g. let's wanted select #cp-rollup, first one. (sorry question title. not sure how word it) $('.stats-tabs-position[href*="#cp-rollup"]').click(function() { alert("cp-rollup"); }); <ul class="stats-tabs-position"> <li class="settings-tabs"><a href="#cp-rollup">rollup</a></li> <li class="settings-tabs"><a href="#cp-vehicle">vehicle</a></li> <li class="settings-tabs"><a href="#cp-personnel">personnel</a></li> <li class="settings-tabs"><a href="#cp-logisticsrole">logistics role</a></li> <li class="settings-tabs"><a href="#cp-logi...

jvmti - JDI: How to pause a Java application (JVM) like in the debugger -

jvmti - JDI: How to pause a Java application (JVM) like in the debugger - i looking potentially jdi api pause jvm @ arbitrary point during execution. looking @ breakpointrequest createbreakpointrequest method needs specific location. there other api not need location or someway current location passed create breakpoint. i looking way attach , pause application, utilize jvmti agent receive callback breakpoint event perform farther processing. thanks breakpoints create sense location in source. arbitrary pausing application best done suspending threads running in jvm. take @ suspendthreadlist() or suspendthread in jvmti. mechanism 'pause' looking for. java jvmti jdi

javascript - Preventing a async load function from being called repetitively in a click event -

javascript - Preventing a async load function from being called repetitively in a click event - i have callback function loads page of info @ time. function gets called/triggered when , next links clicked. run issues animation , load completing in time when end user fast, subsequent clicks of next link , repetitively calls load function. realize async call, there way queue or pause loads/animations 1 load not running before other 1 finished? function nextpagenav_click() { var curpage = parseint($('#curpage').attr('value').tostring()) + 1; $('#curpage').attr('value', curpage); loadpage(curpage, 'next'); } function loadpage(curpage, state) { $.ajax({ type: "post", url: "defaulttmp3.aspx/getlatestprofiles", cache: true, async: false, data: "{'pageindex': " + curpage + "}", contenttype: "appl...

osx - Connecting to a remote SQL Server Express 2008 instance on Windows 7 from Java using JDBC (on Mac OS X) -

osx - Connecting to a remote SQL Server Express 2008 instance on Windows 7 from Java using JDBC (on Mac OS X) - i'm running issues trying connect remote sql server 2008 express instance java. here specifics: db server: windows 7 running sql server 2008 express client: mac os x (10.6.8) running java (1.6.0) using jdbc4 drivers here's code: import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; public abstract class sqldatabase { protected connection c; protected void establishconnection() { seek { string url = "jdbc:sqlserver://myservername\\sqlexpress;databasename=mydatabase;user=sa;password=pwd"; c = drivermanager.getconnection(url); } grab (sqlexception e) { system.err.println("sqlexception: " + e.getmessage()); } } } when hits "drivermanager.getconnection" line, th...

ruby on rails - Setting up git commit hook for Redmine -

ruby on rails - Setting up git commit hook for Redmine - i trying migrate setup here @ office svn git , setting redmine host our projects , issue management (currently utilize version of gforge + svn). should preface saying i'm embedded c software developer day , have 0 experience rails or web apps, trying new things volunteered set project management tools take future. i have redmine setup , using gitolite git repo manager. additionally, using ericpaulbishop/redmine_git_hosting plugin facilitate automatic public ssh key pushing gitolite , automatic repo creation when register new project. seems work except repo view within project not maintain track of changesets. (the "history" empty, although when view files, show latest version correctly) i copied post-receive hook plugin's contrib directory .gitolite/ mutual hooks, 1 time again know little ruby , how these gitolite hooks work don't know how debug this. notice there log messages , things in ...

Change file name and its extension before output it Java -

Change file name and its extension before output it Java - lets i've got file in d: has filepath as: d:\work\2012\018\08\2b558ad8-4ea4-4cb9-b645-6c9a9919ba01 at moment name of file not meaningful. doesn't have format. have ability create file object above filepath in java , alter name , format before writing bytes. new path following: d:\work\2012\018\08\mywork.pdf after changes have been made, should still able gain access original file per normal. i know type of file , name there won't problem getting details. just rename file: file file = new file(oldfilepath); boolean success = file.renameto(new file(newfilepath)); you give filename , utilize same parent current file: file file = new file(oldfilepath); file.renameto(new file(file.getparentfile(), newfilename)); java file filepath

notifications - Best way to implement a GMail like notifier in Android -

notifications - Best way to implement a GMail like notifier in Android - i'm looking create notifier type app android. sits in background , performs lookup via net every often, , notifies of of import incoming data. whats best way this? how can create run @ selected intervals, battery friendly? the gmail notifications in android seem check email connect internet. there way code same? thanks! right off bat, should mention technique describe in question called polling. thing polling isn't battery/resource friendly , want remain away much possible (in mobile realm). now given description of problem, want push solution. that's how android's gmail client works. android's native force solution called c2dm , it's freely available versions 2.1+. now how work? the general thought this: using gmail example, server (i.e. backend) receives new email user x . server send targeted message app installed on x 's device @ point app contact serv...

mobile - Android Validation message not displaying -

mobile - Android Validation message not displaying - i newbie android development. can please help me? my problem validation message not displayed after values passing correct. it needs display "your business relationship under renewal process. please give 1 business day renew account." after returns false. i debugged code value returning correct. executes alertbox() , proceeds not displaying it. next code have added. private onclicklistener submitlistener = new onclicklistener() { public void onclick(final view view) { edittext etusername = (edittext)findviewbyid(r.id.txtusername); edittext etpassword = (edittext)findviewbyid(r.id.txtpassword); final string susername = etusername.gettext().tostring(); final string spassword = etpassword.gettext().tostring(); if((susername.length() > 0) & (spassword.length()>0)) { context mcontext = loginactivity.this; final dialog dialog = new dialog(mcontext); ...

php - getting highest values in a data set -

php - getting highest values in a data set - i taking gps info , drawing map, show maximum speed @ various points. need maintain track of speed value each info point , if decreases mark previous point max value. is nicely in mysql, or loop though in php , values. quite simple via php, includes pulling out loads of info not required. one info set 20k rows give or take few thousand. from graph below expect 4 info points back. table construction simple id, long, lat, speed (not matters much) edit: id uuid, not integer :/ assuming have ids > 0: select id, speed ( select if(speed<@speed,@id,0) id, if(speed<@speed,@id:=0,@id:=id) ignoreme, @speed:=speed speed (select @speed:=0) initspeed, (select @id:=0) initid, yourtable ... ) baseview id>0 this compare lastly speed current speed, give lastly rising id , speed every falling interval, 0 , speed other cases in inner query. select rows, have positive id p...

html - PHP: Don't load images until div is expanded? -

html - PHP: Don't load images until div is expanded? - on site, have updates section, groups updates (galleries) own div. each div loaded hidden. take section, , expands show new galleries. that works fine. however, loads images on page load, causes hr glass linger longer like. there way create image load after div made visible? edit: went with: $(function() { $('.collapse img').attr('src', function(index, src) { homecoming this.getattribute('data-src'); }); }); collapse div name has images in it. how can changed alter images in current div? collapsed divs have same name. however, when expanded, want load images in 1 div. right loads images in collapsed div 1 time expand 1 of them. your divs should not contain images @ startup. can load images via javascript if user expands div. example: function expanddiv(idofdivelement) { divobj = document.getelementbyid(idofdivelement); var imageobj =...

SQL Server: How do I check if an element attribute of an xml node contains a specific string? -

SQL Server: How do I check if an element attribute of an xml node contains a specific string? - i've xml document this. <students> <student> <node type="http://www.something.com/xyz/10/abc/rollnumber" value="original=10000;modified=100003445" /> <node type="http://www.something.com/xyz/10/abc/serialnumber" value="original=10000;modified=172777" /> <node type="http://www.something.com/xyz/10/abc/stream" value="original=cs;modified=ec" /> </student> </students> to value of stream, can write: select @myxml.value('(/students/student/node[@type="http://www.something.com/xyz/10/abc/stream"]/@value)[1]', 'varchar(100)') changedvalue my problem url part may change, hence want match based on criteria @type = "%stream" or @type.contains("stream") is possible? the...

sql - MySQL equivalent of Oracle's SEQUENCE.NEXTVAL -

sql - MySQL equivalent of Oracle's SEQUENCE.NEXTVAL - i need able generate run query homecoming next value of id on next table: create table animals ( id mediumint not null auto_increment, name char(30) not null, primary key (id) ) in oracle can phone call nextval on sequence , gives next sequence (note: without having insert on table). after googling around found can find current value of auto_increment using next query: select auto_increment information_schema.tables table_name='animals'; the problem value increment every time value queried. in oracle, when phone call nextval, value of sequence incremented if don't insert row table. is there way can modify above query value returned different lastly time query called? i.e. auto_increment incremented every time checked , when used on query utilize new value. i using spring jdbctemplate if can done in 1 query better. this illustration innodb demonstrates way impleme...