Posts

Showing posts from April, 2015

excel - How does the CopyFromRecordset rs work -

hi want know how part of code pasting data? why not pasting data 1 row below other set targetrange = targetrange.cells(a, 1) set cn1 = new adodb.connection cn1.open "provider=microsoft.ace.oledb.12.0; data source=" & dbfullname & ";" set rs = new adodb.recordset rs .open sqlstr, cn1, , adcmdtext if = 1 intcolindex = 0 rs.fields.count - 1 ' field names targetrange.offset(0, intcolindex).value = "'" & rs.fields(intcolindex).name next intcolindex targetrange.offset(1, 0).copyfromrecordset rs ' recordset data elseif <> 1 targetrange.offset(1, 0).copyfromrecordset rs end if end rs.close set rs = nothing cn1.close set cn1 = nothing the context provided incomplete is there other code before posted? is part of function or entire function? where variables declared , initialized? what issue - not pasting anything,...

f# - Why do I need a type annotation here? -

in following code: type parseresult<'a> = { result : option<'a>; rest : string } type parser<'a> = string -> parseresult<'a> let thenbind p (f : option<'a> -> parser<'b>) : parser<'b> = fun input -> let r = p input match r.result | none -> { result = none; rest = input } | _ -> (f r.result) r.rest with type annotation f, type thenbind is: p:(string -> parseresult<'a>) -> f:(option<'a> -> parser<'b>) -> input:string -> parseresult<'b> but without annotation, it's: p:(string -> parseresult<'a>) -> f:(option<'a> -> string -> parseresult<'b>) -> input:string -> parseresult<'b> why? you don't need type annotation. 2 types identical. parser<'a> alias string -> parseresult<'a> , ...

jquery - I want to check the content of textarea must contains previous inputs' words using javascript -

is possible check content of textarea must contain previous inputs' words using javascript or jquery? , if not contains words value of textarea invalid or not submit. please reply me soon. thanks. i think understand you're trying done: want user utilize given input of 35 words retrieved input fields, give user option add more. addition optional. check out here to clear input: 1, 2, 3 | textarea: 1, 2, 3 | returns true input: 1, 2, 3 | textarea: 1, 2, 3, 4 | returns true input: 1, 2, 3 | textarea: 1, 3, 2 | returns true input: 1, 2, 3 | textarea: 3, 2, 1 | returns true input: 1, 2, 3 | textarea: 2, 2, 1 | returns false input: 1, 2, 3 | textarea: 1, 2 | returns false js $("#submit").prop("disabled", true); $(".input").on("keyup", function () { var input1 = document.getelementbyid("input1").value; var input2 = document.getelementbyid("input2").value; var input3 = document...

java - Play framework how can I put a name to my Json set -

i learning play framework(java) 2.40 , going through json examples , wondering how can put name json set? have.. public static result jsontry() { objectnode result = json.newobject(); result.put("1","one"); result.put("2","two"); return ok(result); } which returns ["1":"one","2":"two"] trying name set "numbers" . jsonobject , jsonarray deprecated in play framework 2.40 can not use suggestions great. got code above documentation https://www.playframework.com/documentation/2.0/javajsonrequests jsonnodefactory nodefactory = jsonnodefactory.instance; objectnode responsenode = nodefactory.objectnode(); objectnode result = json.newobject(); result.put("1","one"); result.put("2","two"); responsenode.put("numbers", result); return ok(responsenode); try out. or can use simple java hashmap. set data , retu...

Where is the asmx service client(web reference) to WCF client Service reference how to reference -

so going through , updating old web service client code , trying figure how update of features of asmx client setup stuff wcf standard... for instance these line of code... service.requestsoapcontext.security.timestamp.ttlinseconds = 180; service.requestsoapcontext.security.tokens.add(sectoken); where sectoken microsoft.web.services2 usernametoken... sectoken = new usernametoken(credential.username, credential.password, passwordoption.sendplaintext); and credential system.net.networkcredential. what equivalent in wcf? doing googling, looks should set operationcontextscop @ point looks can add timestamp , token... not sure happening when that? operationcontextscope? has been mentioned on microsoft's site, loathed admit not sure if applies circumstance... also how 1 set service.url? tried this... service.endpoint.listenuri = new uri(config.getattribute("serviceendpoint")); that seem work, again not certain... they overload the soap service clie...

css - First element in ng-repeat behaving differently (it should not) -

firstly, unable reproduce issue on plunker, attempt linked here: http://plnkr.co/edit/yfe07e i have ng-repeat repeats a-z , displayed buttons, user click filter results. the letters arranged in table display horizontally, filling available width. works b-z... not show animation effect. if watch via ng-click indeed register click, not animate click rest of letters. i don't know why i'm unable reproduce issue on plunker, hoping can point me in right direction. <ion-view view-title="title"> <ion-header-bar class="header-bar stable-bg"> <img src="content/img/logo.png" class="logo"> <span class="royal">title</span> <div class="time royal">{{gettime()}}</div> </ion-header-bar> <ion-content class="energized-bg"> <div class="letter-repeater stable-bg"> <span ng-repeat="letter in letters" class...

twilio - Forwarding live Calls to a new Twiml from the browser -

i following tutorial on https://www.twilio.com/docs/api/rest/change-call-state#post coding in php portion allows forward current inbound call new twiml url. how inbound call sid? currently, call sid retrieving forwards browser new twiml url , hangs inbound caller. think may have wrong call sid since want forward current inbound caller new twiml url. not browser. can please give me advice on retrieving inbound call sid use in php script? thanks twilio.device.incoming(function (conn) { callsid = conn.parameters.callsid; $("#log").text("incoming connection " + conn.parameters.from); // accept incoming connection , start two-way audio conn.accept(); }); this how getting call sid. if input call sid <?php // php helper library twilio.com/docs/php/install require_once('twilioapi/twilio-php-master/services/twilio.php'); // loads library // account sid , auth token twilio.com/user/account $sid = ''; $token...

php - How to validate multiple files in Laravel5 with Request -

Image
i using request validation in laravel5 , when use files validation doesn't work correctly. i need validate files recieve (only 6 images product) , , not appear inclusive message required files. example request file public function rules() { return [ 'nombre' => 'required | min:3 | max:20 | alpha_num', 'descripcion' => 'required | min:3 | max:255 | alpha_dash ', 'precio_salida' => 'required | numeric | min:1 ', 'id_categoria' => 'required |numeric | min:1|alpha_num', 'data_inici' => 'required' , 'id_envio' => 'required |integer | numeric', 'estado' => 'required|integer|between:0,1 | alpha_num', 'files' => 'required', 'id_pago' => 'required |integer| numeric' ]; } my control...

php - Regex to replace character with character itself and hyphen -

i need replace camelcase characters camel case character , - . what have got string those: albert-weisgerber-allee 35 bruninieku iela 50-10 those strings going through regex seperate number street: $data = preg_replace("/[^ \w]+/", '', $data); $pcre = '\a\s*(.*?)\s*\x2f?(\pn+\s*[a-za-z]?(?:\s*[-\x2f\pp]\s*\pn+\s*[a-za-z]?)*)\s*\z/ux'; preg_match($pcre, $data, $h); now, have 2 problems. i'm bad @ regex. above regex cuts every - streets name, , there lot of names in germany , europe. actually quite easy adjust regex not cut hyphens, want learn how regex works , decided try find regex replaces every camel case letter in string - & matched camel case letter except first uppercase letter appearance. i've managed find regex shows me places need paste hyphen so: .[a-z]{1}/ug https://regex101.com/r/qi2ia9/1 but how on earth replace string: albertweisgerberallee that becomes albert-weisgerber-allee to i...

ruby - Rake namespace not recognizing a local task -

i learning ruby , trying experiment parsing arguments , having trouble example made. rake namespace not recognizing local task. :example task works fine. :examplealt task not working. the error is: $ rake myapp:examplealt rake aborted! nameerror: undefined local variable or method `runtests' main:object c:/ctemp/rubytest/rakefile:19:in `block (2 levels) in <top (required)>' tasks: top => myapp:examplealt and here code: require 'rake' require 'rake/testtask' # uses '--' args format because 'optparse' lib use wants way # runs myapp tests args client, env, , application namespace :myapp |args| desc "runs tests." task :runtests, [:client, :env, :app] |t, args| puts "args: #{args}" end desc "runs example." task :example rake.application.invoke_task("myapp:runtests[--client=example, --env=staging, --app=myapp]") end desc "runs example alternate....

javascript - Simple JS Arrow Function: Missing Parenthesis After Argument List: Why? -

this simple javascript arrow function results in parser error. syntax seems consistent examples i've seen. syntax error , how correct it? var things = []; things.push("a"); var containsa = things.some(t => t === "a"); the error: uncaught syntaxerror: missing ) after argument list your code produces valid arrow function : t => t === "a" however, arrow functions experimental technology, part of ecmascript 6 proposal, still draft. therefore, not browsers have implemented them yet. among major ones, firefox has. if attempt use them on chrome, error.

javascript - Filter by checkbox show/hide target divs jquery -

i'm having trouble targetting divs need show/hide when jquery runs. i need hide <div class="grid-cell> otherwise flexbox won't display correctly once div's hidden. i'm having trouble getting hit correct divs , it's not working after changing code bit. https://jsfiddle.net/s1e93j92/6/ <input type="checkbox" class="checkbox" name="high" data-category-type="high">high <input type="checkbox" class="checkbox" name="low" data-category-type="low" > low <input type="checkbox" class="checkbox" name="low" data-category-name="bread" > bread <div class="wrap"> <div class="grid grid--flexcells grid--gutters grid--1of2"> <div class="grid-cell"> <div class="box"> <div id="categories" data-category-type=...

ios - UILabel not updating when called from delegate method -

i'm using contact picker grab string, pass string view controller, uilabel not updating data (or other string). in slingviewcontroller.m logs below, _taggedfriendsnames being passed successfully. perhaps issue because receiving view controller trying update label on ( slingshotview ) view? don't think that's case i've been updating labels in way in other methods. the answer related updating uilabels in general, i've had no luck after searching. things i've checked no success: updating main thread asynchronously @synthesize label in slingshotview calling setdisplay included potentially relevant code below. in advance tips! slingviewcontroller.m -(void)updatefriendspickedlabel:(id)sender { nslog(@"updatefriendspickedlabel: %@", _taggedfriendsnames); // see slingshotview.friendspickedlabel.text = @"any string"; // don't see } slingviewcontroller.h @class tbmultiselectcontroller; @class slingshotview; ...

parse.com - How to respond an error in a Parse Cloud Function and prevent retries? -

parse clients automatically retries network calls because of, know, network. i have parse cloud function may return error. in case don't want client retry call, because it'll fail again , again until client stop trying. is there way can prevent retry if function handled , error sent? if there's no way, how bad send success error flag? clients retry if error due network connectivity or server availability issues. if error other type of error, happen when cloud function returns error, or save rejected, client not retry. in general not make sense retry here because retrying result in successful response when error not connectivity/server related.

javascript - How can I add query parameters to a node.js/express.js res.redirect function? -

i trying use redirect users google authorization page in app. situation, can't use google api modules. i know can format res.redirect() function such: res.redirect('https://accounts.google.com/o/oauth2/auth?scope=https%3a%2f%2fwww.googleapis.com%2fauth%2fcalendar.readonly&response_type=code&redirect_uri=https%3a%2f%2flocalhost%3a3000%2fauth&client_id=690512789525-g8dbv0s1jo80u5hvevptqapeqokq7ees.apps.googleusercontent.com&hl=en&from_login=1&as=-6cc9a02870d13e22&authuser=0') but prefer cleaner, keep query parameters in object. like: res.redirect({uri: 'https://accounts.google.com/o/oauth2/auth, scope: 'https://............etc', response_type: 'code', etc }) each of query params attribute-value pair in object. any ideas on how that? a think need url.format(urlobj) : https://nodejs.org/docs/latest/api/url.html#url_url_format_urlobj

ruby on rails - I am trying to rewrite a button_to -

i'm trying rewrite following button code instead of redirecting me show page, creates object , current page stays displayed. <div class="colors"> <li class="colors" id="greys"> <%= button_to "some text", votes_path(color: 'grey', kid_id: current_kid, scoop_id: scoop.id, :method => :create), class: 'grey color-button' %> </li> </div> you should use remote flag send request via javascript. , possibly give feedback user. to send request via js in rails have add remote: true options hash: <div class="colors"> <li class="colors" id="greys"> <%= button_to "some text", votes_path(color: 'grey', kid_id: current_kid, scoop_id: scoop.id, :method => :create), class: 'grey color-button', remote: true %> </li> </div> in controller can special responses respondig js...

html - How to bottom align a DIV within a variable size TD -

Image
how can bottom align element (a div or span) within table cell height dynamically changed. <tr><td> <div>top text</div> <img src="#variableheight" style="float:right" /> <div style="vertical-align:bottom">bottom text</div> </td></tr> red 1 <td> background-color . need so#... <div> bottom aligned float:right img. you need "clear" float applied img : .bottom{ clear: both; } html: <div class="bottom">bottom text</div> fiddle: https://jsfiddle.net/l0j6sohs/

javascript - Trying to make a Cross domain post call in IE9 -

i trying make cross domain post call in ie9 below code: $.support.cors = true; var data = {"userid":uid,"email":email,"password":password}; if (isie () && isie () <= 9) { $.ajax({ type: 'post', crossdomain: true, url: posturl, cache:false, contenttype: 'application/json; charset=utf-8', datatype: 'jsonp', data:data, jsoncallback:'localjsonpcallback', jsonp:false, success: function (data) { console.log(data); }, error: function (status){ console.log(status); $("#error").html("incorrect e-mail entered. please re-enter e-mail "); } }); } function localjsonpcallback(json) { if (!json.error) { alert("success"); } else { alert(json.message); } } however, when @ call in fiddler getting 405 error , reque...

Filter rows in a table with the gap between the values ​​SQL SERVER -

i have big blocking problem. trying filter rows of table based on gap between dates. let me explain, has table sorted emetteur , date : emetteur | date ---------------------------- e1 | 13/06/2015 10:01 e1 | 13/06/2015 10:30 e1 | 13/06/2015 16:01 e1 | 13/06/2015 17:01 e2 | 14/06/2015 08:01 e2 | 15/06/2015 14:01 e3 | 15/06/2015 09:01 e3 | 15/06/2015 15:01 e3 | 15/06/2015 22:23 e4 | 12/06/2015 12:01 e4 | 12/06/2015 14:11 e4 | 12/06/2015 14:22 e5 | 15/06/2015 13:01 e5 | 15/06/2015 14:13 e6 | 11/06/2015 19:01 i trying select unique rows gap greater 5h, see in picture emetteur | date ---------------------------- e1 | 13/06/2015 10:30 e1 | 13/06/2015 17:01 e2 | 14/06/2015 08:01 e2 | 15/06/2015 14:01 e3 | 15/06/2015 09:01 e3 | 15/06/2015 15:01 e3 | 15/06/2015 22:23 e4 | 12/06/2015 14:22 e5 | 15/06/2015 14:13 e6 ...

ghc - Continuation versus call stack in Haskell -

how haskell (ghc) runtime know code should executed next after evaluation of thunk? on conceptual level, how different call stack in other programming languages (other storing closed variables on heap , having tail recursion)? ghc (or rather, ghc rts) has normal call stack, things. what's different contents of stack. doesn't match might expect. suppose function foo calls function bar calls function baz . might expecting call stack like foo bar baz at point. actually, when foo calls bar , "call" create thunk , return instantly. bar doesn't appear on stack @ point. when foo returns data caller, , caller decides it, @ point bar may appear on call stack, though foo seen. in short, order of stuff on call stack unrelated calls who. it's determined looks @ what.

arm - Qt application trying to load platform plugin "xcb" instead of "eglfs" -

built raspberry pi 2 linux distro including qt5.4 + qtwebkit + qml plugin using yocto on fido branch see tutorial testing following qml script root@raspberrypi2:~# more webkit3.qml import qtquick 2.0 import qtquick.controls 1.0 import qtwebkit 3.0 scrollview { width: 640 height: 480 webview { id: webview url: "http://qt-project.org" anchors.fill: parent onnavigationrequested: { // detect url scheme prefix, external link var schemare = /^\w+:/; if (schemare.test(request.url)) { request.action = webview.acceptrequest; } else { request.action = webview.ignorerequest; // delegate request.url here } } } } the error message this application failed start because not find or load qt platform plugin "xcb" looks it's still try start xcb plugin relates x11 whereas specified eglfs (??) r...

Rails 4 nested form not saving -

i have scoured other questions relating topic here, still having problem. have nested form inside nested form. answer choices inside questions inside survey. had no problem setting questions, , save fine. answer choices, though, not saving, , cannot figure out going wrong. survey.rb class survey < activerecord::base belongs_to :author has_many :questions, dependent: :destroy has_many :forms, dependent: :destroy has_many :answer_choices, through: :question validates :name, uniqueness: true accepts_nested_attributes_for :questions, reject_if: proc { |attributes| attributes['text'].blank?}, allow_destroy: true end question.rb class question < activerecord::base belongs_to :survey has_many :responses, dependent: :destroy has_many :answer_choices, dependent: :destroy accepts_nested_attributes_for :answer_choices, reject_if: proc { |attributes| attributes['content'].blank?}, allow_destroy: true end answer_choice.rb class an...

C# : can't execute code from R -

i want show ellipse in c#. codes fine when running in r message c# : "object static; operation not allowed (exception hresult: 0x8004000b (ole_e_static))" here codes : df.rconn.evaluate("library(cluster)") df.rconn.evaluate("library(rrcov)") public void setscatter(int xaxis, int yaxis, int zaxis, list<string> variable) { // plot r //to show outlier method : classic & robust mve this.comboboxxaxis.selectedindex = xaxis; this.comboboxyaxis.selectedindex = yaxis; dataform.rconn.evaluatenoreturn("x<-x[," + xaxis + "] "); dataform.rconn.evaluatenoreturn("y<-x[," + yaxis + "] "); dataform.rconn.evaluatenoreturn("shape <- cov(x)"); dataform.rconn.evaluatenoreturn("center<- colmeans(x)"); dataform.rconn.evaluatenoreturn("d2.95 <- qchisq(0.95, df = 2)"); //dataform.rconn.evalua...

Classic ASP Post to MS Access DB - Doesen't Work from Textarea Editor -

i use textarea modifyed tinymce when send form new.asp "new post" page, won't upload content server. that error... microsoft office access database engine error '80040e14' syntax error (missing operator) in query expression ''&#60;p&#62;-: cleaned :-&#60;&#47;p&#62; &#60;p&#62;&#160;&#60;&#47;p&#62; &#60;h2&#62;&#60;a name=&#39;&#34;_toc421990132&#39;&#34;&#62;&#60;&#47;a&#62;1)&#160;&#160;&#160;&#160; la sicurezza&#60;&#47;h2&#62; &#60;p&#62;&#160;&#60;&#47;p&#62; &#60;p'. /tesina/argomenti/new.asp, row 18 i tryed deal special characters in asp try out if issue, apparently it's not; i tryed upload text copy/pasting word, doesen't work, tryed notepad++, worked once plain text , no styling @ all. html form... <form id="newar" action="new.asp" method="post...

Django admin with inlines, 1 model with 2 foreigns keys to 2 different models -

i have 3 models total. main model has 2 foreign keys 2 different models. relationships setup many-to-one. when try customize admin, cannot allow me edit main character model , have 2 inlines (universe , series) show up. what simplest way? there seams ambiguity since 2 foreign fields throwing off. have scoured documentation must have missed something; have gotten more complex many-to-many working in admin, bit odd. here models: class characterseries(models.model): name = models.charfield(max_length=200) def __unicode__(self): return self.name class characteruniverse(models.model): name = models.charfield(max_length=200) def __unicode__(self): return self.name class character(models.model): name = models.charfield(max_length=200) rating = models.decimalfield(max_digits=3, decimal_places=1) universe = models.foreignkey(characteruniverse) series = models.foreignkey(characterseries) def __unicode__(self): ret...

ios - Need a tip with UIBezierPath. Triangle Shape like Instagram Sign Up View -

Image
i'm trying create bezier path instagram triangle in picture below, must doing wrong. bezier path not show! - (void)viewdidload { [super viewdidload]; // additional setup after loading view. } -(void)viewdidlayoutsubviews{ [super viewdidlayoutsubviews]; [self drawtriangle]; } - (ibaction)closebutton:(uibutton *)sender { [self dismissviewcontrolleranimated:yes completion:nil]; } - (void)drawtriangle{ uibezierpath* trianglepath = [uibezierpath bezierpath]; [trianglepath movetopoint:cgpointmake(self.signupbutton.center.x, self.signupbutton.frame.origin.y + 30)]; [trianglepath addlinetopoint:cgpointmake(self.signupbutton.center.x - 10, self.imageview.frame.size.height)]; [trianglepath addlinetopoint:cgpointmake(self.signupbutton.center.x + 10, self.imageview.frame.size.height)]; uicolor *fillcolor = [uicolor whitecolor]; [fillcolor setfill]; uicolor *strokecolor = [uicolor whitecolor]; [strokecolor setstroke]; [trianglepath fill]; [trianglepath stroke]; [trianglepath cl...

ms media foundation - How to create IMFSample for WindowsMediaFoundation H.264 encoder MFT -

i'm learning use h.264 encoder in windows media foundation. what have media samples in yuv420p format, that's buffers containing yyyyyyyyuuvv data. since h.264 encoder mft requires input in form of imfsample, i'm not sure how convert data in buffer imfsample. may this: imfmediabuffer *pbuffer = null; mfcreatememorybuffer(cbsize, &pbuffer); byte *pdata = null; pbuffer->lock(&pdata, null, null); memcpy(pdata, bufferihaveinyyyyuv format, buffer size); // correct? pbuffer->unlock(); imfsample *psample = null; mfcreatesample(&psample); psample->addbuffer(pbuffer); thanks this how (full example @ https://github.com/sipsorcery/mediafoundationsamples/blob/master/mfmp4toyuvwithmft/mfmp4toyuvwithmft.cpp ): imfmediabuffer *srcbuf = null; dword srcbuflength; byte *srcbytebuffer; dword srcbuffcurrlen = 0; dword srcbuffmaxlen = 0; check_hr(videosample->converttocontiguousbuffer(&srcbuf), "converttocontiguousbuffer failed.\n")...

ssh - Vagrant hangs up on Windows 7 using homestead -

this kind of weird. when ssh'ing vagrant, hangs after couple of alt+tabs or left 2 minutes , can't type single character after. quit current commandprompt or cmder , ssh'ed again. kinda work after 2 minutes after ssh , goes hang again. i tried running both vagrant , virtual box admin , still hangs up. windows 7 64bit, virtual box 4.3.26, vagrant 1.7.2 i setup homestead way.

regex - Java replaceAll() only replaces one instance -

i use string.replaceall() replace sequences of characters beginning '@', '$', or ':' , , ending ' '(space) . far have this: string = string.replaceall("[@:$]+.*?(?= )", "zzzz"); however, regex used replaces first instance meets above criteria. so, given string: "select title name nickname = :nickname , givenname = @givenname , familyname = $familyname" current (incorrect) output: "select title name nickname = zzzz , givenname = @givenname , familyname = $familyname" desired output: "select title name nickname = zzzz , givenname = zzzz , familyname = zzzz" how can edit regex produce desired output? as mentioned can use following statement: string = string.replaceall("[@:$]+[^ ]*", "zzzz"); [^...] matches characters except followed ^ . possible applications: one time processing of human-written files (need control outcome, there might strings contai...

node.js - Return q resolve when all operations complete -

i have function want resolve when foreach has completed.. im using q, , mongoose capitalised things refer to, , want create set of items first, run function after foreach complete. function createitems() { var deferred = q.defer(); var itemsarray = [{ 'name' : 'spade' }, { 'name' : 'bucket' } , { 'name' : 'sand'}]; itemsarray.foreach(function(itemobj) { var item = new item(itemobj); // forces use schema (dont worry) item.findoneandupdate({ url: item.short_name }, item, { upsert: true }, function(err) { if (!err) { console.log(item.name + ' created.'); deferred.resolve(); } else { deferred.reject(new error(err)); } }); }); return deferred.promise; } createitems() .then(function() { console.log('all items done.'); }); so expect see on console like; spade item created bucket item created sand item created items do...

c# - Is there a way to check if garbage collection was triggered while analyzing dump file through SOS.dll -

i analyzing .dmp file "outofmemory" exception. objects staying in memory long time, there command check if garbage collection triggered using sos.dll or sosex? in comment mention when @ dump, see particular object staying in generation 2 occupying 500+ mb, wanted check if garbage collection ran or not. if have object in gen 2, garbage collection ran @ least 2 times, otherwise in gen 0. now know it, it's obvious information not helpful. want know why remains in memory. to find out reference keeps large object in memory, use sos command !gcroot . when know that, review code find out such reference comes or should removed. if there no reference more, object may freed , it's alive because no gen 2 garbage collection has occurred since. see this great answer on idisposable, discusses point of releasing large object. in case, might ok call gc.collect() after releasing reference. should not tamper garbage collection, if have such large object ...

c# - how to print the last record of each admission number in sql server -

i having database have stored fees collected several students. i having column like:- admno name class section tuitionfee sjs001 arjun nursery 3000 sjs002 akash nursery 2000 sjs001 arjun nursery 1000 sjs005 baldev class-ii b 5000 there may same admission number might have paid several times tuition fees. want print last value of entered admission number how can this. if want print last admission, need add column admissiondate . can this: select top(1) admno,name,class,section,tuitionfee, admissiondate table_name admno = 'sjs001' order admissiondate desc this sql server specific syntax. there other ways achieve result, using max(admissiondate) in subquery. select * t1 t1.admno = 'sjs001' , admissiondate = (select max(admissiondate) t2 t1.admno = t2.admno)

c# - Validate object ID from GET to POST -

i have method allows user access comment have made on site. have post method lets them update comment. my normal solution send entire comment model through, let them update it, update on database when post back. involve sending commentid through in hiddenfor , can manipulated. how can verify commentid sent in get method same i'm getting in post , not able alter comment wish? how can verify commentid sent in method same i'm getting in post? basically have validate following things in post - user logged-in user. authenticated users post comments. commentid in post , should valid commentid , should present in database. userid associated logged-in user should same userid associated comment . comment should contain userid column, can check @ time of update. to make sure update happens comment has been sent in get - hold commentid in session , in post action compare commentid value in session .

javascript - Compiling SASS files using Grunt creates an unnecessary folder -

so have been trying create first compiled css files using grunt , sass, , having problem cant figure out. every time run sass task, unnecessary "sass" folder created inside of css folder: this how looks: module.exports = function(grunt) { // project configuration. grunt.initconfig({ watch:{ sass:{ files:['sass/*.scss'], task:['sass'] } }, sass: { dist: { files: [{ expand: true, cwd: '', src: ['sass/*.scss'], dest: 'css/', ext: '.css' }] } } }); grunt.loadnpmtasks('grunt-sass'); grunt.loadnpmtasks('grunt-contrib-watch'); grunt.registertask('default', ['sass']); }; and how folder looks after run task: /sass/somefile.scss /css/sass/somefile.css the sass folder should not there, result expect is: /sass/somefile.scss /css/somefile.css thanks in advance! ...

javascript - How to see if given object matches one of the objects returned from firebase -

i trying test if given object matches stored objects stored , returned firebase. if return true or store true in variable. here example of given object , firebase returned data given object: {name: "john", age: "32"} stored object: { '-jryqlgtnlfa1zektg5j': { name: "john", age: "32" }, '-jrkhwmkhhrshx66dswj': { name: "steve", age: "25" }, '-jrkhthqpkrpnh0b0lqj': { name: "kelly", age: "33" }, '-jrkiitisvmjzp1fkss8': { name: "mike", age: "28" }, '-jrkipqa8kyamj2r7a2h': { name: "liz", age: "22" } } var storedobject ={ '-jryqlgtnlfa1zektg5j': { name: "john", age: "32" }, '-jrkhwmkhhrshx66dswj': { name: "steve", age: "25" }, '-jrkhthqpkrpnh0b0lqj': { name: "kelly", age: "33" }, '-jrki...