Posts

Showing posts from February, 2014

Bash - convert string to date -

i need convert date in bash string has hour included, such as: 2012-02-09-18, , store result inside variable, can compare such strings dates. if use conversion date -d "2012-02-09-18" it crash "invalid date error". how can this? you can tweak input make parseable date using sed : str='2012-02-09-18' date -d "$(sed 's/-\([^-]*\)$/ \1/' <<< "$str")" thu feb 9 18:00:00 est 2012

mysql - PHP move existing files on the server to database -

i have huge number of files existing on server , want move them mysql instead. best way in terms of performance mentioned number of files pretty big . , if there 3rd party script existing that. you should never store files in mysql. keep files in folder, , put paths files in database. the reason why shouldn't it, because filesystem optimized 1 thing.. storing files, you'll have way more performance storing files on disk compared database. sure database have lot of data in memory, since mysql tries put in memory if can. but filesystem same. accessed files end in memory save io on disk itself, can read more file system cache , virtfs.

android - Authorization headers with Retrofit + Robospice + Jackson -

i creating app consumes rest api. api has ability login/logout in order access private data. creating consumer(client android app) retrofit + robospice + jackson. okey, authorization part came play. need provide token , other credentials in request authorization header . can done using requestinterceptor . here complete tutorial how use basic authentication. basic authentication retrofit . clear how implement this. in case have resources can accessed without credentials. here part of api declared retrofit annotations public interface maliburestapi { //doesn't need credentials @get("/store/categories") category.list categorylist(); //doesn't need credentials @get("/store/categories/{id}/products") product.list productlist(@path("id")int categoryid); // needs credentials @post("/store/users/{id}/logout") // needs credentials user logout(@path("id") int id,@body crede

ios - Creating an app for an already made website -

i started internship local county , first task got them create app existing job searching/posting site(like monster.com or jobfind, etc). never made app before school didn't offer ios development course kind of stressing out on , have pretty been left figure out myself. i doing on ui design app , turning out nicely. issue having registration forms , postings. example, when registering account have registration form filled labels , text fields so: name: _____________ phone: _____________ address: ____________ and on. question is, how user inputs in text fields when registering/logging app connect same database running website connected to. have access php folder/files website , database on mysql workbench. have viewed numerous tutorials , read few of them use different examples mine , ended confusing me more. figured post question here in case has done before or maybe has read/seen great tutorial have not came across yet. help/tips extremely appreciated learn how so. us

angularjs - How do I stop the following "External changes" message in Brackets -

Image
i using brackets angular. when alt-tab , come brackets presents me seemingly helpful message. i turn off. don't think live preview feature because still seem message when close browser session auto reload files. regards after digging around appears indeed issue in brackets. suspect happening in case have unsaved changes in js file when focus away brackets. when return brackets filesyncmanager in brackets picks might have changed js file cant work out happened in brackets or outside, safely displays message, albeit misleadingly. issue highlighted in github issue issue#10341 i have not yet tried install autosave extension through extensions manager in brackets see if resolves issue.

c# - How to divide a string value by another string value, each containing a numeric value -

how make label display numericupdown1 / numericupdown2 properly? here have label6.text = convert.tostring(numericupdown1.value/numericupdown2.value); i have tried label6.text = numericupdown1.value/numericupdown2.value and got error saying cannot implicitly convery blah blah bytes an after start project crashes ( have project opens tries display numud1 / numud2 ... in simple terms: decimal d = (numericupdown1.value/numericupdown2.value); stringval = system.convert.tostring(d); label6.text = stringval; or create subclass of numericupdown , override parsevalue method (as seen here ): public class mynumericupdown : numericupdown { protected override double parsevalue(string text) { // change text whatever want string newtext = fixtext(text); // call base implementation. base.parsevalue(newtext); } private static string fixtext(string inputtext) { // stuff here. } }

ubuntu - Linux "make" command Error 127 -

i'm new linux , trying install mktorrent (latest version) , readme file states run 'make' command while in directory. however, after trying 3 different terminals/emulators receive same error shown quoted below. i've tried install "automake" repositories suggested through other answers found on here/google no luck. here directory contents: http://i.imgur.com/umdlo7o.png cc -o2 -wall prefix.c -o prefix make: cc: command not found make: *** [prefix] error 127 sudo apt-get install build-essential should install requirements compiling c/c++ based applications

java - Need resolution for the below hung thread issue in Websphere Application Server -

i getting below hung thread message when first transaction triggered. hung keeps on increasing , jvm not respond transactions further. have no other option other restarting. [xx/xx/xx x:xx:xx:xxx xxx] 00000063 w uow=null source=com.ibm.ws.runtime.component.threadmonitorimpl org=ibm prod=websphere component=application server thread=[deferrable alarm : 3] wsvr0605w: thread "messagelistenerthreadpool : 4" (00000098) has been active 744872 milliseconds , may hung. there is/are 1 thread(s) in total in server may hung. @ java.util.hashmap.get(hashmap.java:303) @ com.pantero.util.collections.mapofmaps.get(mapofmaps.java:100) @ com.pantero.metamodel.caching.optimisticcachemanager.get(optimisticcachemanager.java:22) @ com.pantero.metamodel.builtin.builtinschema.getfromcache(builtinschema.java:285) @ com.pantero.metamodel.modelobject.getfromcache(modelobject.java:1340) @ com.pantero.metamodel.types.classtype.getproperty(classtype.java:475)

curl - Ruby CGI is unable to continue the downloading process when sending data to Opera -

i wrote small ruby cgi script - let's call downloader.rb - friends download files file hosting service. script looks follows: #!/usr/bin/ruby require "cgi" cgi=cgi.new(:accept_charset => "utf-8") file_id=cgi["id"] #get file id request variable url="http://www.yetanotherfilehost.com/file/#{file_id}" range=env["http_range"]==nil ? "" : "-r #{env["http_range"].split("=")[1]}" #get range http request header in fact passed in request header, can accessed through environment variable called http_range header=%x{curl #{range} -s -b ./cookie.txt "#{url}" -l -i}.force_encoding("utf-8").encode("utf-8").split("\r\n").last(7).join("\r\n") #i call curl option -i dump response headers , -l # follow redirection occurs in case, , keeping # last 7 lines of headers, send them later users, # emulating download process. response headers looks follow

message queue - How many tcp connection created on a queuing protocol such as ZeroMQ -

excuse me basic question, didn't find answer in google searches. i want develop server should respond hundreds of clients. each client may send tens hundreds of messages per second. i want know if use queuing protocols such amqp (rabbitmq implementation) or zeromq, how many tcp connections server should supports? is total number of clients or total number of messages per second? nota bene: zeromq not "queuing"-protocol. 1 shall rather think powerful framework of low-level building blocks [primitives] enable designers setup fast , rather abstract behaviour-oriented designs advanced use-cases messaging per se robust, non-blocking, asynchronous, distributed systems concurrency signalling , content-related transport + controls. indeed powerful set of tools, believe me. amqp broker-based approach zeromq broker-less solution message count per se not typically create problem. their associated processing typically does. limit no.1: operating s

Android: Time Loop in milliseconds -

this game similar 1 of try survive long possible, hell-shooter games. so wish record amount of time user can survive after pressing "start". similarly, continue update frames @ time. thinking using handler or timer or animation updating frames (the activity) , mathematically manipulating simpledateformat. however, i'm not sure how 1 go it. as start, have of fruitninja survival mode, though smaller times recorded too. thanks! you can use timer or thread handler timer = new timer(); timer.schedule(new timertask() { @override public void run() { own code ///////schedule timer, after first 100ms timertask run every 1000ms } }, 1000, 1000); can use handler handler handler = new handler(); handler.postdelayed( new runnable() { public void run() { afficher(); } }, 1000l);

swift - Assigning a value to an object of type AnyObject -

i have variable var post :anyobject? which object got parse api call. want post["caption"] = captiontextview.text but following error message cannot subscript value of type 'anyobject?' index of type 'string' i figured out how value post variable. example, works fine extract value key "caption" captiontextview.text = post!["caption"] as! string! but don't know how change value. want change value of post variable , save can updated parse database. what's correct way this? are sure don't want use pfobject class instead of anyobject? var post :pfobject? post?["caption"] = captiontextview.text https://www.parse.com/apps/quickstart#parse_data/mobile/ios/swift/existing

ember.js - Where is ember? Or node for that matter? -

i trying start ember tutorial. i'd swear i've used node , npm before, not super recently. installed sudo npm install -g ember-cli (doing user got me errors indicating needed sudo) , didn't see errors. ember -v returns nothing. no error, new command prompt. same node --version . synaptic says i'm running node version 1.4.21+ds-2(vivid). what missing here? why can't ember run or return errors? note, i'm seeing same behavior question: installing ember-cli on ubuntu. ember new app fails silently but added weirdness asking version fails. so @kingpin2k got it: https://stackoverflow.com/a/18130296/233467 at point long ago tried install apt-get install node installed node, aka amateur packet radio node. not wanted. put "node" right there in path. so purged node, , symlinked /usr/bin/node /usr/bin/nodejs , installed ember again. time seems there.

Keyboard shortcut for moving tabs in SublimeText3 -

every time open new tab in sublimetext have take hands off keyboard , use mouse move newly opened tab desired position among existing tabs... surely there must keyboard shortcut moving sublimetext tabs left and/or right? please yes... it seems if there no shortcuts this. you can see actions , shortcuts in command palette (ctrl+p on windows). no such action move tab left . the news, however, there plugin this: https://github.com/sublimetext/movetab you can install using package control .

How to include GitHut library in my project (Android Studio) -

i trying add library project because want change in class there. why adding dependencies in gradile setting not enough. i know in library says "if want use library, have download materialdesign project, import workspace , add project library in android project settings.". mean, should copy files , put them in libs folder ? quoting the documentation : if want use library, have download materialdesign project, import workspace , add project library in android project settings. step #1: download project, whether via zip file github gives or using git clone repository step #2: move materialdesign/ directory project directory, peer of existing app/ module step #3: modify settings.gradle in project directory include :materialdesign in list of modules build step #4: in app module's build.gradle file, add compile project(':materialdesign') dependencies

c++ - Calling template function with conditionals -

given function type template : template<typename typea, typename typeb, typename typec> void foo (typea a, typeb b, typec c) { ...; } then hope call function approach shown follows: int main (void) { int ta = 32; int tb = 64; int tc = 32; float *array_a; double *array_b; float *array_c; foo<(ta == 32 ? float : double), (tb == 32 ? float : double), (tc == 32 ? float : double)>(array_a, array_b, array_c); return 0; } of course, code results in compile error... however, wonder whether there convenient way check ta's, tb's, , tc's value , call function foo accordingly... first of all, choosing type use instantiate template based on value of variable , conditional operator syntactically wrong. language doesn't allow type chosen method. second, can let compiler deduce type. can use: foo(array_a, array_b, array_c); the compiler deduce typea float* , typeb double* , , typec float* . using

ruby - How to fix Facebook Graph API returning 'reorder_pids is required' -

so have problem in updating post using app sending link via post gives me problem https://graph.facebook.com/ {post-id} => post data are: {message:"a new updated message"} it returns json code requiring me specify 'reorder_pids' paramter. {"error":{"message":"(#100) parameter reorder_pids required","type":"oauthexception","code":100}} i'am trying out @ facebook graph api explorer , not working. when try specify vale reoder_pids stil throws error said 'reorder_pids' must array. what workaround problem? did wrong on post parameter request? i got working doing this: post /v2.5/{user_or_page_id}_{post_id} ?access_token={token} &message={new_message} notice how user_id (or page_id) prefixed post_id , version updated. seems multiple problems accessing edges on api can solved using {user_or_page_id}_{post_id} . no fb telling anybody. source: how should retrieve indiv

ios - Changing tableview height in swift -

Image
i want change tableview when keyboard appears screen in swift. because if don't update height, bottom messages hides under keyboard. here screenshots: before: after: you can see in screenshots, tableview still under keyboard. used following code , didn't work. func keyboardwillshow(notification: nsnotification) { var info = notification.userinfo! var keyboardframe: cgrect = (info[uikeyboardframeenduserinfokey] as! nsvalue).cgrectvalue() self.tableview.frame.size.height=self.tableview.frame.size.height-keyboardframe.size.height self.view.layoutifneeded() uiview.animatewithduration(0.2) { self.bottomcons.constant = keyboardframe.size.height //this line textbox , button. unrelated tableview. self.view.layoutifneeded() } } why tableview height not changing? how can fix it?

c# - MethodCallExpression is not setting up the orderby correctly -

i'm new expression business. modeling after example: https://msdn.microsoft.com/en-us/library/vstudio/bb882637(v=vs.110).aspx i trying list of offices satisfies specific name. code works point need setup order by. keep getting error: parameterexpression of type 'db.office' cannot used delegate parameter of type 'system.string' here code iqueryable<office> offices = getalloffices(); parameterexpression pe = expression.parameter(typeof(office), "office"); expression left = expression.property(pe, typeof(office).getproperty("officename")); expression right = expression.constant(filterrequest.filters.value); expression e1 = expression.equal(left, right); expression predicatebody = e1; methodcallexpression wherecallexpression = expression.call( typeof(queryable), "where", new type[] { offices.elementtype }, offices.expr

c++ - Expected unqualified-id before '{' token -

i'm trying write program generate labor times based on labor rate, , i'm running expected unqualified-id before '{' token error. include <iostream> using namespace std; double s516 = 5.5; // 516-70 alloy welds @ 5.5 inches per minute double a304 = 4.3; // a304 steel welds @ 4.3 inches per minute double x; // value placeholder total linear inches welded int main() { cout << "please enter total number of inches welded:\n "; cin >> x; } { if s516, multiplies[(s516 * x *1.1 / 60]; else if a304, multiplies[(a304 * x * 1.1 / 60]; } am on right track of this? try this: #include <iostream> using namespace std; double s516 = 5.5; // 516-70 alloy welds @ 5.5 inches per minute double a304 = 4.3; // a304 steel welds @ 4.3 inches per minute enum material { material_s516 = 1, material_a304 = 2 }; int main() { double x; // value placeholder total linear inches welded cout <&

ios - Facebook Pop fragment from Obj-C into Swift -

working on departed coworkers project. need implement objective-c code facebook pop animation swift. paste in entirety since few lines long. i've looked @ few tutorials being new @ pop , swift has made tricky. how write in swift? - (void)scaledownview:(uiview *)view { popspringanimation *scaleanimation = [popspringanimation animationwithpropertynamed:kpoplayerscalexy]; scaleanimation.tovalue = [nsvalue valuewithcgsize:cgsizemake(0.1, 0.1)]; scaleanimation.springbounciness = 6.f; [view.layer pop_addanimation:scaleanimation forkey:@"scaleanimation"]; } i'm assuming you've added bridging header project in question. imported #import <pop/pop.h> in bridging header. you'll have import pop @ top of swift file you'd use below method. func scaledownview(view: uiview) { let scaleanimation = popspringanimation(propertynamed:kpoplayerscalexy) scaleanimation.tovalue = nsvalue(cgsize: cgsize(width: 0.1, height: 0.1)

javascript - Angular 2 service injection using TypeScript 1.5 -

i'm trying basic, functional structure set angular 2. have basic api elements framework advances, can advance structure. currently, i'm @ wit's end how perform simple act of passing services. here example source, taken right comments of recent definitelytyped file: class greeter { greet(name: string) { return 'hello ' + name + '!'; } } @component({ selector: 'greet', appinjector: [greeter] }) @view({ template: `{{greeter.greet('world')}}!` }) class helloworld { greeter: greeter; constructor(greeter: greeter) { this.greeter = greeter; } } bootstrap(helloworld); as can see, i'm using typescript 1.5 in example. i have tried inject greeting service in component annotation using hostinjector , injectibles , appinjector . i've tried adding second argument of bootstrap call, in bootstrap(helloworld, [greeter]) . in cases error message when trying run in browser: error durin

multithreading - C# need 2 threads for long execution -

i have program loads data sharepoint site. loads txt files, xml files, etc. of these "load" actions can take lot of time because of user's connectivity sharepoint. therefore whole windows form ui gets unresponsive until data loaded. so know how can create thread "retrieval" of information while whole windows forms ui still works , operative. you have few options. i'm not going provide exact code of them, but, provide research topics. you can use backgroundworker , task.run() or manage own threading doing thread.start() . need fire off event when downloading finished? if so, can this: var task = new task(() => dosomething()); task.continuewith(() => signaldone(), taskscheduler.fromcurrentsynchronizationcontext()); task.run(); the continuewith , taskscheduler.fromcurrentsynchronizationcontext ensure signaling done on ui thread minimize race conditions. you're on own if you're doing databinding being populated.

vb.net - Ivalueconverter not working in phone 8.1 Xaml -

i using case converter in xaml textbox : <textbox text="{binding obj.username,mode=twoway,converter={binding uppercaseconverter}}" grid.row="1" grid.column="0" verticalalignment="center" horizontalalignment="center" minwidth="200" x:name="usernametxtbox"/> and converter initiated as: public sub new() ' call required designer. initializecomponent() ' add initialization after initializecomponent() call. uppercaseconverter = new mccommoncodes.converters.caseconverter(mccommoncodes.converters.charactercase.lower) me.datacontext = me end sub property uppercaseconverter mccommoncodes.converters.caseconverter the code converter is: public class caseconverter implements ivalueconverter property selectedcase charactercase public sub new(byval convertcase charactercase) selectedcase = convertcase

c# - LINQ: Select Post with multiple Tags -

i'm trying find posts contains selected tags. my current code returning posts containing selected tags , posts containing of selected tags. here function. appreciate help. sample database structure tables [post] - id - title - body [posttag] - id - postid - tagname so [post] [posttag] got one-to-many relationship postid foreign key. public static ienumerable<post> getpostcontainsalltags(ienumerable<string> _selectedtags, int numposts) { using (mapleprimesdatacontext dc = new mapleprimesdatacontext(_connectionstring)) { var tagposts = (from p in dc.posts join t in dc.posttags on p.id equals t.postid p.status == 1 && _selectedtags.contains(t.name) orderby p.dateadded descending select p).take(numposts).tolist(); return tagposts; } } i change datab

c# - Convert double (0.1) to BigRational and back -

i must missing something, when try create bigrational double value 0.1 gives me long nonsense value. converting gives 0.0 : double d = 0.1; // 0.1 bigrational br = new bigrational(d); // 3602879701896397/71213961919824440... double d2 = (double)br; // 0.0 what missing? know 0.1 not representable in system.double surely bigrational can approximate enough round-trip it? as @elgonzo explains: this known issue year ago: bcl.codeplex.com/workitem/13051 . a commenter on referenced work item uploaded fix reads in 0.1 correctly.

html - Collapse and Expand Tree structure in Javascript -

i need on collapse , expand using javascript. here running code (.html) <h2>test</h2> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-16"> <title></title> <script type="text/javascript"> function toggledisplay(element) { element.style.display = element.style.display === 'none' ? '' : 'none'; }; function toggledisplayall(elements) { for(var i=0; i<elements.length; i++) { toggledisplay(elements[i]); } } </script> </head> <body> <ul> <a onclick="toggledisplayall(this.parentnode.getelementsbytagname('ul')); return false;" href="#">name:</a> <ul style="display:none;"> <a onc

javascript - Z-index issues, z-index isn't working as it should -

my issue when ever links hover, hidden sub menu pushes below div it. i've tried playing around z-index still no luck. can please me this. my jsfiddle html: <div class="row" id="top-eybrow"> <div class="eyebrow-section right text-left"> <ul> <li> <a href="#">sign in</a> </li> <li> <a href="#">register</a> </li> <li> <a href="#">my acount &nbsp;<i class="fa fa-sort-desc dropdown-i fa-fw"></i></a> <ul> <li> <a href="#">add listtings</a> </li> <li> <a href=&qu

javascript - When using scroll Top, if footer disappears, add class to it -

when user scrolls top , footer hides, detect , add class make visible setting position fixed in css class. when footer hide, page blinks, css class added , removed in few milliseconds. how fix page doesn't blink? thank you. if($(window).scrolltop() + $(window).height() < ($(document).height() - $(selector).outerheight())) { $(selector).addclass("stickybottom");; } else { $(selector).removeclass("stickybottom"); }

html - Bootstrap 3 Alignment -

i've made thumbnail . please image provided. ![enter image description here][1] i want buttons n h u should overlap image. how do that? plus there should small black translucent strip on image 20px bottom. <div class="thumbnail"> <div class="caption"> <p class="product_title">{{deal.title}}</p> <p class="product_price">&#8377 {{deal.buyout_price}}</p> </div> <div class="pull-left" style="padding-top:20px;"> <img src="{% static "images/p.png" %}" alt="new product"><br> <img src="{% static "images/p.png" %}" alt="new product"><br> <img src="{% static "images/p.png" %}" alt="new product"> </div> <img src="media/auction/screenshot_from_2015-05-18_235741.png" alt=".

javascript - AuglarFire Authenticating With Routers throw unknown provider error -

so following firebase doc here authentication routers . instead, use ionic / ui-router , has abstract view , actual view controller. here structure: .state('auth', { url: "/auth", abstract: true, templateurl: "app/auth/auth.html", resolve: { "currentauth": ["auth", function(auth){ // $waitforauth returns promise resolve waits complete return auth.$waitforauth(); }] } }) .state('auth.signin', { url: '/signin', views: { 'auth-signin': { templateurl: 'app/auth/auth-signin.html', controller: 'signinctrl' } } }) .state('home', { cache: false, abstract: true, url: "/home", templateurl: "app/home/home.html", controller: 'hometabctrl', resolve: { "currentauth": ["auth", function(auth){ // $requireauth returns promise resolve waits complete // if promise reje

android - set 9 patch from assets folder -

how can set imageview border 9 patch file in assets folder? have tried didn't work. drawable d = drawable.createfromstream(getassets().open("borders/border1.9.png"), null); imageview.setbackground(d); any idea? 9-patch pngs compiled on build time. non compiled .9.png usual png , loaded is. the build.xml describes task compile .9.pngs aapt (android asset packaging tool). you can't compile on runtime, put can precompile them aapt: aapt.exe c -s <input-folder-with-images> -c <outpout-folder> where: 'output-folder' has exist

Grails 2.3.9 - Error: ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType -

whenever enter grails command: test-app error: error executing script testapp: java.lang.classnotfoundexception: grails.plugin.spock.test.grailsspectesttype (use --stacktrace see full trace) in buildconfig.groovy have: grails.project.dependency.resolution = { ... plugins { ... test ":spock:0.7" } } i've tried replacing compile ":spock:0.7" . i've tried cleaning application , refreshing dependencies no luck. any ideas , how fix it? thanks for grails 2.2+ try code in buildconfig: grails.project.dependency.resolution = { repositories { grailscentral() mavencentral() } dependencies { test "org.spockframework:spock-grails-support:0.7-groovy-2.0" } plugins { test(":spock:0.7") { exclude "spock-grails-support" } } } for more info check out: https://grails.org/plugin/spock

javascript - Suggestions for dynamic dates/events on a HTML site -

i volunteer animal rescue group , our web site strictly html site jquery. i'm looking suggestions on how make bit more dynamic don't have figure out when next adopt-a-pet event be. on 2nd , 4th saturday of each month. information, expect implore little javascript/jquery magic , produce html code, dynamically. <article class="event-holder"> <h4><a class="more-heading" href="aap.html">adopt pet</a></h4> <p>meet our cats available adoption on june 26th... <a class="read-more" href="aap.html">more</a></p> </article> given code sample above, date of june 26th dynamic variable. thing i'm not sure start. if can this, i'd appreciate it. this seems work me: var nextsaturday = new date(); var months = ['january','february','march','april','may','june','july','august','se

javascript - Fade image containers -

i have menu of 7 elements. whenever element clicked, content appears fading in. if element clicked, current content fade out , new content fade in. applied concept 3 of 7 elements in menu, i'm facing couple of problems, such content not fading, , problem in delay of fade in , out of content, leading collisions between contents, anyway apply working solution on elements of menu? html: <div id="menu" class="menu"> <ul class="headlines"> <li id="item1"onclick="checklist(this)"><button >a</button></li> <li id="item2"><button >b</button></li> <li id="item3"><button >c </button></li> <li id="item4"><button>d </button></li> <li id="item5"><button>e </button></li> <

sql server 2008 - How to use OR in join while using Entity Framework -

Image
can 1 convert following sql statement entity framework c# or vb.net me? sql statement: select t1.*, t2.* tblwistransacs t1 inner join tblwcbtransacs t2 on t1.ticketno = t2.ticketno or t1.ticketno = t2.customernumber var result = (from t1 in dbcontext.tblwistransacs join t2 in dbcontext.tblwcbtransacs on 1 equals 1 (t1.ticketno == t2.ticketno || t1.ticketno == t2.customernumber) select new { t1, t2 }).tolist();

web scraping - How to access response Body after simulating a POST request in Node.js? -

This summary is not available. Please click here to view the post.

ios - Override navigation controller back button -

i have uiviewcontroller called detailviewcontroller push homeviewcontroller. in detailviewcontroller there container display subview a, b , c. if tap button in navigation bar, navigation pops homeviewcontroller, expected. i'd override button if container displaying subview b, container updates show subview (and likewise, subview c goes subview b). , if we're displaying subview pop homeviewcontroller expected. essentially, need able tap button force navigation not pop previous view. possible? i know hide button , replace custom bar button item don't want that. want keep exact styling of native button.

ios - UITableView internal bug: unable to generate a new section map with old section count: and new section count: with userInfo (null) -

i haven't seen error before, , did search why may happening couldn't find info on it: coredata: error: serious application error. exception caught delegate of nsfetchedresultscontroller during call -controllerdidchangecontent:. uitableview internal bug: unable generate new section map old section count: 1 , new section count: 0 userinfo (null) does know might happening here? not sure "internal bug" part - error indicate problem code or bug in uitableview? did use nsfetchedresultscontroller in multiple uitableview. if so, that's cause. use 1 nsfetchedresultscontroller 1 uitableview. not switch queries when switching views.

Php caching variable -

i learning cache , found sample online. http://www.webgeekly.com/tutorials/php/learn-how-to-cache-content-with-php-in-under-5-minutes/ private $scachename = ''; private $icachetime; protected function write($icachetime, $sdata) { on specific part below, sdata referring to? content supposed cached? if not, variable supposed save content being cached?

c# - Using a variable from a different class and method into another class and method -

this main class person public class person { public void setage(int n) { n = 20; } static void main(string[] args) { } } and want access n variabe in inherited class student class student : person { public void gotoclasses() { console.writeline("i going class"); } public void showage() { console.writeline("my age {0}",n); } } i tried using person.n or setage(20) or setage(n) , won't work ! public class person { public int age {get; set;} } above represents basic object. use case: person person = new person(); person.age = 25; other object additions: public class person { public date birthdate {get; set;} public int age { { return (datetime.now.year - birthdate.year); } } //read }

c# - DbContext and Connection pools -

in application i've inherited there's in base controller, every other controller in application inherits from. public basecontroller() { db = new mydbcontext(); db.database.log = s => debug.write(s); } public mydbcontext() : base("name=mydbcontext") { // hack force visual studio deploy entityframework.sqlserver package var instance = sqlproviderservices.instance; } due way application has been designed, @ least 2 contexts created per request. (it's mvc application , there call homecontroller on every page plus whatever other controllers called particular page.) my question when dbcontext create connection sql server? when context created, or when query executed? if it's former, using 2 twice number of connections sql server needed, , if it's latter it's not of issue. i don't think can refactor in immediate future, not without justification. potential pitfalls of design sh

c# - web.config - read custom section, change attribute and save it -

i'm trying access specific custom section of web.config file change section attribute value , save it this config file: <custom.viewpoint> <!-- ********** repository ********** --> <application type="custom.tablet.readerapplication, custom.tablet"> <content-set> <publications include="periodical" default="ajcli"> </content-set> </application> <!-- ********** security ********** --> <web.authentication enabled="false"> <session persist="true" expiration="30.00:00:00" /> </web.authentication> <custom.viewpoint> what i'm trying access web.authentication attribute enable true false , vice versa. want testing purposes, instead of going each folder , changing attribute false want able program when i'm done testing want turn on when done testing. i found code access section isn't workin

java - Create a videoplayer with the LibVLC for android -

i trying creat video player android app last libvlc. the problem don't know how lib works , can't find sample me (as here https://bitbucket.org/edwardcw/libvlc-android-sample ) so try on own create video player : public class videoplayeractivity extends appcompatactivity implements ivideoplayer, gesturedetector.ondoubletaplistener, idelaycontroller { private static libvlc libvlc() { return vlcinstance.get(); } private static mediaplayer mediaplayer() { return vlcinstance.getmainmediaplayer(); } @override @targetapi(build.version_codes.jelly_bean_mr1) protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); toast.maketext(getapplicationcontext(), "ca start videoplayeractivity !!", toast.length_short).show(); if (!vlcinstance.testcompatiblecpu(this)) { // exit(result_canceled); return; } extras = getintent().getextras(); muri = extras.getparcelable(play_extra_item_location);