Posts

Showing posts from January, 2014

javascript - Validating email using js -

i trying create form allows people submit email using @msu.edu email. have alert coming when it's not msu.edu email, when use email test@msu.edu not submitting form. function checkmail() { var email = document.validation.email.value.tolowercase(); var filter = /^([\w-]+(?:\.[\w-]+)*)@msu.edu/i; var result = filter.test(email); alert('valid email found: ' + result); return result; } you need escape . there. correct code: function checkmail() { var email = document.validation.email.value.tolowercase(); var filter = /^([\w-]+(?:\.[\w-]+)*)@msu\.edu/i; // ^-- escape dot var result = filter.test(email); alert('valid email found: ' + result); return result; } demo

Partial fold of a list in Haskell -

how apply fold functions finite number of times, instead of folding entire list? example, incomplete fold sum first 3 numbers, leaving rest untouched: foldln 3 (+) [1..5] -- [6,4,5] it seems simple fold on part of list, cons rest of list: foldln :: int -> (a -> -> a) -> [a] -> [a] foldln n f xs = (foldl1 f $ take n xs) : drop n xs result in repl: *main> foldln 3 (+) [1..5] [6,4,5] if worry taking , dropping same list double job, can rewrite splitat : foldln n f xs = (foldl1 f $ fst t) : snd t t = splitat n xs note type of function, can't base fold on foldl , because can't have list [[1,2,3],4,5,6] in haskell.

ruby on rails - Test User Authentication with RSpec -

i work simple rails 4.1.0 app , not use devise. i'm testing application controller: class applicationcontroller < actioncontroller::base protected def current_user @current_user ||= user.find(session[:user_id]) if session[:user_id] end def signed_in? !!current_user end helper_method :current_user, :signed_in? def current_user=(user) @current_user = user session[:user_id] = user.try :id end # want test method def authenticate_user! render nothing: true, status: :unauthorized unless current_user end end i have problem authenticate_user! method. full spec see here . method spec: describe 'authenticate_user!' context 'when user logged in' before { subject.send(:current_user=, create(:user)) } 'do nothing' expect(subject.send(:authenticate_user!)).to eq nil end end context 'when user not logged in' controller before_action :authenticate_u...

Trying to do a simulation in R -

i'm pretty new r, hope can me! i'm trying simulation bachelor's thesis, want simulate how stock evolves. i've done simulation in excel, problem can't make large of simulation, program crashes! therefore i'm trying in r. the stock evolves follows (everything except $\epsilon$ consists of constants known): $$w_{t+\delta t} = w_t exp^{r \delta t}(1+\pi(exp((\sigma \lambda -0.5\sigma^2) \delta t+\sigma \epsilon_{t+\delta t} \sqrt{\delta t}-1))$$ the thing here stochastic $\epsilon$, represented brownian motion n(0,1). what i've done in excel: made 100 samples size of 40. these samples standard normal distributed: n(0,1). then these outcomes used calculate how stock affected these (the normal distribution represent shocks economy). my problem in r: i've used sample function: x <- sample(norm(0,1), 1000, t) have 1000 samples, distributed. don't know how put these results formula have evolution of stock. can help? using r (di...

use enter alternate to key press in C#.Net -

i'm designing login windows desktop app, how can use "enter" key alternate login button_click let user enter application after verifying credentials ? to make click event fire on pressing enter key, need make button default button. if using winforms set login button form.acceptbutton property. http://msdn.microsoft.com/en-us/library/system.windows.forms.form.acceptbutton%28v=vs.100%29.aspx if using wpf set buttons button's isdefault property true.

iphone - How to change the DisplayName of an iOS Application? -

Image
i know there many answers related question, such like. programmatically rename xcode project renaming xcode 4 project , actual folder etc. but @ following code: nsstring *plistpath = @"...../testingapi-info.plist"; nsmutabledictionary *dictionary = [[nsmutabledictionary alloc]initwithcontentsoffile:plistpath]; [dictionary setobject:@"mytestingapp" forkey:@"cfbundledisplayname"]; [dictionary writetofile:plistpath atomically:yes]; i changing name of apps icon above code, changed name "mysuperapp => mytestingapp" so, valid change using above code ? have fear of app rejection ?? want set changes through above code like, bundle identifier, bundle name..etc ? is valid or not ?? using above code apple reject application or not ?? as rckoenes said correctly, won't work on device. bundle contents readonly, including info.plist. can not overwrite it. to clarify: open info.plist file in xcode , rename whatever wan...

ruby - Rails ActiveModel::Dirty in a form -

when using rails form update boolean value (in case shipped ), how can check see if has been set (specifically) false true, in order set shipped_at variable? at moment, update action looks this: def update @order = @current_shop.orders.find(params[:id]) if @order.update_attributes(params[:order]) redirect_to edit_admin_shop_order_path(@current_shop, @order), notice: 'order updated.' else render action: "edit" end end this condition needs checked, shipped_at should assigned (if condition holds) , obviously, object should saved. should use activemodel::dirty ? how should controller action @ end of day? i think responsibility of model order itself. class order < activerecord::base before_update :set_shipped_at def set_shipped_at if self.shipped_was == false && self.shipped == true self.shipped_at = time.now end end end now don't need change in controller , if save order piece ...

sql server - using stuff for fullname when task is same for two person even though fullname is not separating with comma -

select distinct stuff((select distinct ', ' + u1.fullname tm_user u1 u.tm_userid=u1.tm_userid xml path ('') ), 1, 2, '') fullname, task_name project join task on project.project_id=task.project_id join timesheet on timesheet.task_id=task.task_id join team on project.project_id = team.project_id join tm_user u on u.tm_userid=timesheet.user_id u.is_active=1 , u.report_to=13 , worked_dte between '2014-03-18' , '2014-03-21' output getting fullname task_name chandu devathi new task 2222 chandu devathi tesst eprom copy chandu devathi testing plz ignore. harish kumar ramakrishnappa tesst eprom copy excepted output fullname task_name chandu devathi ...

c# - Popup.Stays Open false not working -

this follow of below question, how close popup window when dialog box open in wpf? i'm having popup , it's staysopen set false. now, if explorer window open pressing windows+ e , popup closed. if not closed when file dialog open key combination.

java - How to convert a csv to Hashmap if there are multiple values for a key ? (without using csv reader ) -

here link states reading of data csv hashmap. convert csv values hashmap key value pairs in java however, trying read file of csv, in there multiple values given key. eg: key - value fruit - apple fruit -strawberry fruit -grapefruit vegetable -potatoe vegetable -celery where , fruit , vegetable keys. i using arraylist<> store values. code writing able store keys , stores last corresponding value . so, when print hashmap , : fruit - [grapefruit] vegetable- [celery] how can iterate through loop, , store values? following code, have written : public class csvvaluereader { public static void main(string[] args) throws ioexception { map<string, arraylist<string>> mp=null; try { string csvfile = "test.csv"; //create bufferedreader read csv file bufferedreader br = new bufferedreader(new filereader(csvfile)); string line = ""; stringtoken...

How to add custom css animation to an element in Sencha Touch? -

i have panel in sencha touch. inside of panel have button. when click on button, want increase width of panel custom css animations. have tried far. sencha touch code: xtype:'panel' id:'mypanel', style:'width:300px;-webkit-transition:width 2s;transition:width 2s;' items: [ { xtype:'button', text:'expand', id:'expand' } ] controller.js //on button click ext.getcmp('mypanel').addcls("expand"); custom.css .expand { width:600px; } inside style of panel, have given animation. doesnot work. appreciated. you need remove inline style. , use 2 css classes. mypanel.js ext.define('myapp.view.mypanel', { extend: 'ext.panel', config: { centered: true, cls: 'colapse', // initialy added cls class id: 'mypanel', items: [ { xtype: 'button', item...

string - writing in text file in java -

i have text file contained large number of words, , want divide words writing ** every 4 words. did until adding first ** ( first 4 words) , have difficulties in putting other stars. here code until (i using java) import java.io.*; public class insert { public static void main(string args[]){ try { insert in = new insert(); int tc=4; in.insertstringinfile (new file("d:/users//im080828/desktop/souad/project/reduction/weight/outdata/d.txt"), tc, "**"); } catch (exception e) { e.printstacktrace(); } } public void insertstringinfile(file infile, int lineno, string linetobeinserted) throws exception { // temp file file outfile = new file("$$$$$$$$.tmp"); // input fileinputstream fis = new fileinputstream(infile); bufferedreader in = new bufferedreader (new inputstreamreader(fis)); // output fileoutputstream fos = new fileoutputstream(outfile); printwriter out = new ...

c# - Get selected item from a bound listbox -

i have listbox of users , want selected item it.i used selecteditem returns 0 . listbox xaml code: <listbox name="_imagelist" margin="10,10,10,0" issynchronizedwithcurrentitem="true" scrollviewer.horizontalscrollbarvisibility="visible" verticalalignment="top" height="250" borderthickness="0" selectionchanged="list_clicked"> <!--<listbox.itemcontainerstyle> <style targettype="{x:type listboxitem}" basedon="{staticresource {x:type listboxitem}}"> <eventsetter event="mouseleftbuttondown" handler="listboxitem_mouseleftbuttondown"/> </style> </listbox.itemcontainerstyle>--> <listbox.itemtemplate> <datatemplate datatype="enfant"> <border cornerradius="30"> <grid> ...

jquery - how to get an html object[data value ] from an array of same html element object -

how data object html object has more 1 element in array. <div id='show_box'> <h6 id="#0" data-choosed="1000">1000</h6> <h6 id="#1" data-choosed="1000">2000</h6> <h6 id="#2" data-choosed="1000">3000</h6> </div> in javascript var h6_len=$("#show_box > h6").length; switch (h6_len) { case 0: choosed=$('#show_box > #' + h6_len).data('choosed'); $('#total_box').text(choosed);// return drop-down clicked //this part of code working fine.. when case == 0 break; case 1: var h6_1=$('#show_box > h6')[0]; var h6_2=$('#show_box > h6')[1]; /* having issues... getting data value 1 of array h6 element... console.log( typeof h6_1); ...

javascript - nlapiSenEmail API is Not sending email in Scheduled Script -

am new netsuite development. have created suitescript of scheduled script type. in use following code nlapisendemail(473882, 'yoursfred@yahoo.in','test','test', null, null, null); the above code sending email @ time of debuggin using netsuite script debugger. when create scheduled record , deployed same code , scheduled testing not sending code , not shows errors. can in this also testing in sandbox account? sandbox accounts have limitations in sending out emails.

node.js - How can I get a path as a key in express? -

my current route lookup app.get('/s/:key', ... , there reason able other keys passed in same way. possible i'll require getting paths way well--so want capture app.get('/s/:key/more/stuff/here/', ... , able read key independently of /more/stuff/here portion. don't have issue capturing other parameters array of arguments , concatenating them, don't know how that--i 404s if try capture other /s/:key nothing following. is there way this? string routes in expressjs regular expression being said, can use asterisk * wildcard: app.get('/s/:key/*', function(req, res, next) { var key = req.params.key; var someotherparams = req.params[0]; }); which be: http://example.com/s/1/some/other/stuff - req.params.key = 1 , req.params[0] = some/other/stuff then there can parse wildcard. split / . or if want strict should not have other characters alphanumeric, slashes , dashes, use regex directly on route. because on express...

objective c - try to create CCSpriteFrame but get nil values -

i'm trying animate ccsprite in cocos2d v3 following question , i'm getting following error message in log: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** -[__nsarraym insertobject:atindex:]: object cannot nil' this code: nsmutablearray *animationframes = [nsmutablearray array]; int framecount = 0; for(int = 1; <= 9; ++i) { ccspriteframe *spriteframe = [[ccspriteframecache sharedspriteframecache] spriteframebyname: [nsstring stringwithformat:@"hero-%d.png", i]]; [animationframes addobject:spriteframe]; //error occur line framecount++; if (framecount == 8) break; } the problem spriteframes nil, don't why. tested values nslog, , tried add hero-1.png ccsprite object , works fine. tried add fixed hero-1.png in frames verify if problem variable. didn't work also.

php - curl not working on windows -

this error getting on running script: [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.015 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [certinfo] => array ( ) [redirect_url] => the script shown in below: $ch=curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); $output=curl_exec($ch); $abc=curl_getinfo($ch); curl_close($ch); //echo $output; print_r($abc); please me out............. the info curl_errno() means ...

jquery - bootstrap 3 navbar padding and items background -

Image
i'm using bootstrap 3 build website. please tell me how remove padding / margin menu items? looks this: and have different link colors when hovering items. code this: <!-- start main navigation --> <nav class="navbar navbar-custom" role="navigation"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> </div> <!-- collect nav links, forms, , other c...

Created my one-file-blog (php/mysql) - Feedback and Injections? -

this first attempt write simple (one-file) blog-engine, build php , mysql. want make , have simple , don't want include hundreds of files, classes , on, because want publish text , that's is. don't need plugins, changing templates, apis or that. script working , running fine, i'm novice , have started php/mysql. :) so want feedback, i've done wrong, maybe complicated or if there possibility of injections or similiar? , feedback welcome (and sorry poor english!). i've include comments, that's easier follow thoughts: <?php ///////////////////////////////////////////////////// base // whats name of blog , how many recent articles should shown on front $blogname = 'the basic blogname'; $anzahl = '3'; // alright, let's connect database include_once 'include/connect.php'; // use generate german date (e.g.: march --> märz) setlocale (lc_all, 'de_de@euro.utf8', 'de_de.utf8', 'de.utf8', 'ge.u...

php - oauth 401 unauthorized error for heroku app fitbit -

i've got heroku app , running auth0 way of logging in via oauth... have code more or less same fitbit api php tutorial - "completeauthorization.php". looks bit like: $oauth = new oauth($conskey, $conssec, oauth_sig_method_hmacsha1,oauth_auth_type_authorization); $oauth->enabledebug(); } catch( oauthexception $e ) { print_r($e); } echo 'done new oauth'; $oauth->settoken($_session['access_token'], $_session['access_token_secret']); echo 'done set token'; // fitbit api call (get activities specified date) //http://api.fitbit.com/1/user/28c9gg/activities/date/2013-12-01.xml $apicall2 = 'http://api.fitbit.com/1/user/'.$_session['userid'].'/activities/date/2014-02-25.xml'; echo $apicall2; // performing api call $oauth->fetch($apicall2); //$oauth->fetch($apicall); var_dump($oauth->getlastresponse()); i user id, , session secret , token etc. auth0 response in...

Elasticsearch: mapping text field for search optimization -

i have implement text search application indexes news articles , allows user search keywords, phrases or dates inside these texts. after consideration regarding options(solr vs. elasticsearch mainly), ended doing testing elasticsearch. now part stuck on regards mapping , search query construction options best suited special cases have encountered. current mapping has 1 field contains text , needs analyzed in order searchable. the specific part of mapping field: "txt": { "type" : "string", "term_vector" : "with_positions_offsets", "analyzer" : "shingle_analyzer" } where shingle_analyzer is: "analysis" : { "filter" : { "filter_snow": { "type":"snowball", "language":"romanian" }, "shingle":{ ...

Failure installing SQL Server 2008 R2 Express X64 -

i having serious problem installing (from web platform installer , downloaded installer). have laptop win7 x64 enterprise on it. i have read forums , tried solutions have found, permissions, .net framework copying setup files etc. these did move install on in end fails database. have tried following ms advice on trying read log files see fails why looked @ of solutions fixes didn't work. makes worse solutions retrying install (removal of things registry) has made things worse on laptop other stings stop working every time remove sql keys. i hoping here on logs see if give me better indication of whats wrong. problem can't see way of attaching zip file here

php - Ajax errors on services since 2.4: custom event + request scope -

since upgraded symfony 2.1 2.4, i'm faced quite unexpected error. speculate on reasons why happens: [2014-03-24 10:32:19] emergency.emergency: uncaught exception 'symfony\component\dependencyinjection\exception\inactivescopeexception' message 'you cannot create service ("form.type.daterange") of inactive scope ("request").' in d:\users\abousquet\workspace\eportal\app\cache\dev\appdevdebugprojectcontainer.php:1231 stack trace: #0 d:\users\abousquet\workspace\eportal\app\bootstrap.php.cache(2033): appdevdebugprojectcontainer->getform_type_daterangeservice() #1 d:\users\abousquet\workspace\eportal\app\cache\dev\classes.php(1842): symfony\component\dependencyinjection\container->get('form.type.dater...') #2 d:\users\abousquet\workspace\eportal\app\cache\dev\classes.php(1807): symfony\component\eventdispatcher\containerawareeventdispatcher->lazyload('resources.autol...') #3 d:\users\abousquet\workspace\eportal\vendor\sym...

c# - Storing user data after authentication with MVC4 -

i creating simple login using asp.net mvc4 / razor. need custom logic, here's have far: public class user { [required] [display(name = "user name")] public string username { get; set; } [required] [datatype(datatype.password)] [display(name = "password")] public string password { get; set; } public int userid { get; set; } public datetime lastlogin { get; set; } public bool isvalid(string username, string password) { if(mycustomlogic.isvaliduser(username, password)){ // set other variables return true; } else { return false; } } } in controller: public actionresult login(models.user user) { if (modelstate.isvalid) { if (user.isvalid(user.username, user.password)) { formsauthentication.setauthcookie(user.username, true); // line in question } } return view(user); }...

android - CustomVideoRecording : Video getting blurred with green lines in Samsung Galaxy3 if I am using Custom Zoom while recording -

i getting video blurred green lines in samsung galaxy s3, if use custom "zoom-in" otherwise fine. means if not applying zoom fine, how handle this? this code preparing camera, zoom , recording. private void preparecamera() { log.d(log_tag, "inside prepare camera ---"); try { // create instance of camera mcamera = getcamerainstance(); mparameters = mcamera.getparameters(); // green mess in video file without mparameters.set("cam_mode", 1); if (mparameters.iszoomsupported()) { try{ mparameters.setzoom(zoomlevel); //seekbar manage zoom seekbar.setmax(mparameters.getmaxzoom()); }catch(exception e){ log.e(log_tag, "exception while setting camera parameters"+e.tostring()); } } if (build.version.sdk_int >= build.version_codes.gingerbread){ ...

64bit - LotusScript call to NSFItemInfoNext on Domino 64 bit server crashes server -

i'm trying make call lotusscript agent 'nsfiteminfonext' on domino 9.0.1 64-bit server. call 'nsfiteminfo' succeeds. code has been tested on 32-bit , works correctly. field rich text field broken several items. type blockid64 pool long block integer end type declare function w64_nsfiteminfo lib lib_w32 alias "nsfiteminfo" (byval notehandle long, byval itemname string, byval namelength integer, itemblockid blockid64, valuedatatype integer, valueblockid blockid64, valuelength long) integer declare function w64_nsfiteminfonext lib lib_w32 alias "nsfiteminfonext" (byval notehandle long, byval previtemblockidpool long, byval previtemblockidblock integer, byval itemname string, byval namelength integer, itemblockid blockid64, valuedatatype integer, valueblockid blockid64, valuelength long) integer dim dbhandle long dim notehandle long dim rtitemname string dim itemblockid blockid64 dim ite...

PHP Shorthand Ternary not behaving as expected -

introduced in php 5.3, shorthand ternary operator should work this: $result = 'foo' ?: 'bar'; should return foo . however, on live server (php 5.4.26), result bar . a full ternary operator syntax works fine. $test = 'foo'; $result = $test ? $test : 'bar'; returns foo correctly. both syntaxes fine on dev server (php 5.3.10). is there way disabled somehow? suggestions? changing instances full systax undesirable - there's significant number in external library (amazon aws sdk). correction: $result = 'foo' ?: 'bar'; does have correct result on both servers, but $test = 'foo'; $result = $test ?: 'bar'; incorrectly returns bar on live server. wierder...

sql - Include date boundaries to segment select results -

i want return in same row results of particular measure on different time range. instance "last 30 days", "last 7 days", "last 3 days". on doing i've used union function, , created multiple sub-queries every time range. downside of doing i'm collecting same numbers 3 times, consequent increase in running time. a colleague suggested me use case function segment time range. i've thought implement follows: select tp.name, case when pub.date between dateadd(day, -31, getdate()) , dateadd(day, -1, getdate()) sum(impressions) else 0 end 'last 30 days impressions', case when pub.date between dateadd(day, -31, getdate()) , dateadd(day, -1, getdate()) sum(revenue * rler.rate) else 0 end 'last 30 days revenues', case when pub.date between dateadd(day, -8, getdate()) , dateadd(day, -1, getdate()) sum(impressions) else 0 end 'last 7 days impressions', case when pub.date between ...

JavaScript access objects with wildcard for key -

i have javascript object this: e {_layers: object, _inithookscalled: true, _leaflet_id: 25, _map: e, constructor: function…} _inithookscalled: true _layers: object 38: e _container: g _ini _mradius: 107 i want access radius . number 38 changes case case. kind of wildcard. myobject._layers[??]._mradius you can this: myobject._layers[object.keys(myobject._layers)[0]]._mradius

php - @ only supresses a message, not a control flow -

i've found following example on php manual site: some might think trigger_error throw() or err.raise construction, , @ works catch(){} 1 - in fact it's not. function badgirl(){ trigger_error("shame on me",e_user_error); return true; } $sheis = @badgirl(); echo "you never see line - @ supress message, not control flow"; 1) can please explain me why last line not displayed? because e_user_error breaks script execution? 2) if registered custom error handler set_error_handler , didn't exit or die in last line displayed? that error breaks execution, @ - silently, because e_user_error fatal error. try running example without error suppression operator - print: php fatal error: shame on me in /tmp/test.php on line 3 fatal error: shame on me in /tmp/test.php on line 3 more on error constants here sure, custom error handler can decide continue execution.

arrays - Slow performance with cumulative count in PHP -

i have performance issues in chartcontroller. have 2 arrays: 1 array dates , 1 array entities contain date. want cumulative count date values of entities. i have bit of code it's slow (i have wait 3 - 4 seconds 68k rows in data array). my code: // loop through sql results , count on date foreach ($result $row) { foreach ($dates $date => $value) { // $row['appointmentdate'] datetime object if ($date >= $row['appointmentdate']->format('ymd')) { $dates[$date]++; } } } is there smarter / better / faster way achieve this? // edit jack gived me push needed , solved performance issue. the code above took 38000 ms complete, code beneath 5700ms. usort($result, function($a, $b) { return $a['appointmentdate'] > $b['appointmentdate']; }); // loop through sql results , count on date ($i = 0; $i++; $i <= count($result)) { ...

android - ADT/Eclipse bug? -

i encountered problem annoying. made class file wherein contents same demo file on net. copy-pasted it, renamed it, , changed package file. now, problem whenever, suppose these: intent intent = new intent(mainactivity.this, screenslide.class); startactivity(intent); screenslide.class 1 i'm referring to. gives me noclassdeffounderror. don't know how fix it. tried cleaning project still problem appears. strange thing tried project, libraries imported, deployed in pc , guess what? there's no error! it's frustrating. please me :( listview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> arg0, view arg1, int arg2, long arg3) { // todo auto-generated method stub string artist = (string) arg0.getitematposition(arg2); artist = artist.replace(' ', '+'); intent intent = new intent(mainactivit...

How can we pass e.channel Uri to a web service from windows phone -

void pushchannel_channeluriupdated(object sender, notificationchannelurieventargs e) { dispatcher.begininvoke(() => { // display new uri testing purposes. normally, uri passed web service @ point. system.diagnostics.debug.writeline(e.channeluri.tostring()); //messagebox.show(string.format("channel uri {0}", // e.channeluri.tostring())); servicereference1.service1client objserviceclient = new servicereference1.service1client(); objserviceclient.insertnotificationurlcompleted += new eventhandler<insertnotificationurlcompletedeventargs>( }); } in above code, servicereference1 web service, want send e.channel uri web service. how can pass uri web service?

ios - Pop navigation controller on another navigation controller -

Image
to navigation controller on modal segue figured i'd try create hierarchy can see in screenshot. what right way in outlet exit modal (login info view controller)? i tried different stuff: - (ibaction)goback:(id)sender { //none of these works.. (only tried 1 @ time..) [self.navigationcontroller removefromparentviewcontroller]; [self.navigationcontroller popviewcontrolleranimated:yes]; [self.navigationcontroller.navigationcontroller popviewcontrolleranimated:yes]; } at point want dismiss modal viewcontroller, use line within class: [self dismissviewcontrolleranimated:yes completion:^{ }]; so, in case, becomes: - (ibaction)goback:(id)sender { [self dismissviewcontrolleranimated:yes completion:^{ }]; }

Rails use Boolean similar to counter_cache? -

a miniatures model has many collections. users can have , vote best collection version of miniature. votes in model called imagevotes update counter_cache attribute in collections model. what want flag collections ranked first miniature gold, rank 2nd, 3rd , 4th silver. realise can on miniature model selecting @miniature.collection.first, able store store vote-count in counter_cache display total number of golds or silvers 1 user. is there way each model have boolean fields called gold , silver updated new votes cast in same way counter_cache updated? any pointers , further reading appreciated. update: it occurs me done sort of second index column. vote_position column if will, updated number "1" record highest counter_cache number , ascended there. use @miniature.collection.where(:vote_position => "1") or similar. perhaps more ideal? as seems me need implement method in miniature model: def set_gold_and_silver top_collections = self.co...

vb.net - Faster HTTPWEBREQUEST/WEBRESPONSE - Too Slow -

is there way speed up? going through list of 2000 , going 1 one. please note, have tried "service manager max connections/default connections etc. none of these have been valuable solutions. ' ' created sharpdevelop. ' user: merickson2 ' date: 3/22/2014 ' time: 5:59 pm ' ' change template use tools | options | coding | edit standard headers. ' imports system.net imports system.io imports system.text imports system.text.regularexpressions public partial class mainform dim fetch1 integer dim newlist1 integer dim splitlist() string dim tempcookies new cookiecontainer dim encoding new utf8encoding public sub new() ' me.initializecomponent call required windows forms designer support. me.initializecomponent() ' ' todo : add constructor code after initializecomponents ' end sub sub mainformload(sender object, e eventargs) 'do stuff end su...

vb.net - Cannot perform 'Like' operation on System.Decimal and System.String -

i want use filter on datagridview according below method: dt = executeselect(querycondition, idwindow).tables(0) _textfilters = "" dim first boolean = true each f field in fields if f.value.length > 0 if not first _textfilters += " , " end if _textfilters &= f.field & " '%" & f.value & "%'" first = false end if next dt.defaultview.rowfilter = _textfilters i got error in line dt.defaultview.rowfilter = _textfilters cannot perform 'like' operation on system.decimal , system.string because have decimal fields in database table. but if use: dim view dataview = new dataview(grille.datasource) _textfilters = "" dim first boolean = true each f field in fields if f.value.length > 0 ...

regex - How to check for string inequality using LLVM's FileCheck in the presence of CHECK-DAGs? -

i'm using llvm's filecheck verify results of llvm pass i've written. i know can check 2 strings equal doing like: check: first string = [[id:[0-9]+]] check: second string = [[id]] but there way check not equal? e.g., like: check: first string = [[id:[0-9]+]] check: second string = [[!id]] of course check-not obvious answer, i'm using check-dag doesn't play check-not : check-dag: can appear anywhere check-dag: first string = [[id:[0-9]+]] check-dag: second string = [[!id]] i'm dealing numbers here, i'll satisfied solution addresses that. if else fails, solution addresses [0-9] (no repetition) do.

C# logged user and run as user -

i have 2 users: domain1\user1 , domain2\user2. i'm logged domain1\user1. want run app (with option 'run different user') domain2\user2. how can gets user name of person logged on windows, because environment.username return user2, want domain1\user1. check out windowsimpersonationcontext on msdn, believe has you're looking for. http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx you can implement own helper class if like, declare using([establish context here]) , perform activities within code block executed user context. quite handy! note: if decide utilize using , sure in dispose() method of helper release impersonation context cleans nicely when program leaves using block.

html - Storing value inside text file with php -

i'm doing tutorial have form 5 different values inside of it. whenever hit value/number inside form, number saved textfile. let's hit value 3 , 4. result be: textfile.txt: 3 4 so question is, how send these values textfile? same structure of php coding if sent database? my form looks like: <form> <div id="rating-area" class="shadow"> <img src="star-icon.png" id="thumb1" value="1"/> <img src="star-icon.png" id="thumb2" value="2"/> <img src="star-icon.png" id="thumb3" value="3"/> <img src="star-icon.png" id="thumb4" value="4"/> <img src="star-icon.png" id="thumb5" value="5"/> </div> </form> i've been searching day answer without success. form.php <?php //save text file if( isset($_get[...

c# - Linq GroupJoin exception -

i have similar query in code trying perform group join: var query = client in _clientsrepository.query() join order in _ordersrepository.query() on client.id equals order.client.id orders select new model(client, orders); it's identical 101 linq samples, however, whenever run following exception: {"unable cast object of type 'remotion.linq.clauses.groupjoinclause' type 'remotion.linq.clauses.fromclausebase'."} not sure why happening , can't find answers on web. here's stacktrace: @ nhibernate.linq.groupjoin.groupjoinaggregatedetectionvisitor.visitquerysourcereferenceexpression(querysourcereferenceexpression expression) @ nhibernate.linq.visitors.nhexpressiontreevisitor.visitexpression(expression expression) @ remotion.linq.parsing.expressiontreevisitor.visitandconvert[t](t expression, string methodname) @ remotion.linq.parsing.expressiontreevisitor.visitlist[t](readonlycollection...

ruby on rails - Error: undefined method `each' for nil:NilClass -

i'm getting error: undefined method `each' nil:nilclass when trying render choose_album_to_add.html.erb : <table class="table_"> <thead> <tr> <th>album</th> </tr> </thead> <tbody> <% @albums.each |album| %> <tr> <td><%= album.name %></td> </tr> <% end %> </tbody> </table> <br> my users_controller.rb def choose_album_to_add @albums = album.all end what wrong? edit as asked, i'm sure view file choose_album_to_add.html.erb in /app/views/users . , i've route this: match '/addalbum/:id', to: 'users#choose_album_to_add', via: 'get' of course, i'm typing /addalbum/45 on browser, , routes properly. view loaded sure, problem instance vars declared on controller can't accessed on view . =[ i've scaffolded 4 resources , they're working fine follo...