Posts

Showing posts from August, 2014

sql - Any easy ways to automate creation of Yii DB migration code -

i have started using yii (1.1) in order keep syncronized db schemas between different environments. questions is: there easy ways automate writing of up() , down() methods sql code? at moment, if add new table or alter existing table need write manually these methods. the command yiic migrate create table_name creates empty class. alternatively create new migration file , use $this->exexute('sql code here') property. wondering if there way yii detect db changes , create migration code on it's own

python - Manually installing pyodbc on Windows with firewall -

i trying install pyodbc on work machine has firewall. donwnloaded pyodbc-3.0.7.zip, , tried install manually following command: pip install c:\users\appdata\local\continuum\anaconda\pkgs\pyodbc-3.0.7.zip but did not work. searching around, if want continue on in path, looks need compile c++ source. is way go if want install pyodbc manually? select appropriate exe cpu architecture here . once executable downloaded, active network connection isn't needed.

mongodb - How to recover from losing all your /data/db -

we using mongodb 3.0.2 , our system managed via mms discover 1 of our new dev environment lost content /data/db including journals, logs , config file. one thing the instance still , running in memory. does has solution on how recover situation? i tried db.fsynclock() supposed flush data disk no luck. afaict, files opened/memmapped mongodb, removing entry filesystem not prevent mongodb still use them (on unix-like systems, @ least). long not closed , mongodb not need open other files, things should still usable. enough start doing dumps. as experiment, populated newly installed mongodb 3.0.2 instance 2m documents. stopping it, restarting it, , removing data folder -- before having accessed collection. able mongodump collection without issue: > (i = 0; < 2000000; ++i) { db.test.insert({x:i}) } # stop mongodb # start mongodb again rm -rf data mongodump -d test -c test # success ! # stop mongodb mkdir -p data/db # start mongodb again mongoresto...

html - Javascript If-else statement -

new javascript trying basic 'if, else' statement , can't work... $(function () { if ($('.feature:contains("firmness rating 1")')) { $('#firm').css({'background-image': 'url(firmness1.png)'}).text('firmness rating 1'); } if ($('.feature:contains("firmness rating 2")')) { $('#firm').css({'background-image': 'url(firmness2.png)'}).text('firmness rating 2'); } if ($('.feature:contains("firmness rating 3")')) { $('#firm').css({'background-image': 'url(firmness3.png)'}).text('firmness rating 3'); } if ($('.feature:contains("firmness rating 4")')) { $('#firm').css({'background-image': 'url(firmness4.png)'}).text('firmness rating 4'); } if ($('.feature:contains("firmness rating 5")')) { $('#firm').c...

C++ dynamic downcasting to class template having template template parameter being a class template or an alias template -

i hope title makes sense. miss vocabulary express correctly. well, exemple more clear. problem me is: dynamic downcasting returns 0 @ run time in of following cases (written in comments). i'd know if it's correct behaviour (using c++11), why, , can make work. apparently, templated , a::a_templated treated different classes, despite being defined identical using alias "using". problem doesn't appear simple typedef alias. template <class t> class templated {}; class { public : typedef int a_type; template <class t> using a_templated = templated<t>; }; class test_base { public : test_base() {} virtual void foo()=0; }; template <class t> class test_type : public test_base { public : test_type() {} void foo() {} }; template < template <class t> class tt > class test_templated : public test_base { public : test_templated() {} void foo() {} }; int main() { test_base...

Android: how to change menu item at page scrolling with ViewPager? -

the last version of whatsapp i'm talking about. when scroll between tabs toolbar shows different menu options. can implement viewpager adapter , fragments not this. how done? don't know kind of trick behind. changes everytime switch pages in each fragment have override oncreateoptionsmenu , different menu/menu.xml files @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { menu.clear(); inflater.inflate(r.menu.menu, menu); super.oncreateoptionsmenu(menu, inflater); } don't forget call sethasoptionsmenu(true); , in oncreate of fragment

Eclipse Android Graphical Layout Not Showing Anything -

i don't know why getting error. tried changing java version , still didn't work. anyway resolving problem? http://i.stack.imgur.com/ky2tx.png you need install jdk 1.8 , set java compiler 1.8 can check link same issue. android - "parsing data android-21 failed"

ruby - How do I stop a defined method from mutating the argument passed to it? -

i'm picking fundamentals of ruby, , stumbled upon can't figure out. here's simple version of it, figure out concepts involved. suppose define method this: def no_mutate(array) new_array = array new_array.pop end now call method: a = [1, 2, 3] no_mutate(a) i expect printing give: [1, 2, 3] instead, gives: [1, 2] since i've defined new variable , pointed whatever array i'm passing in, , modifying new variable, why array i'm passing in being mutated? in example, why no_mutate mutate 'a'? how avoid mutating 'a'? as others have said have create copy, either using array.clone or array.dup . reason happens becuase ruby both pass value , pass reference. for example: a = 'hello' b = b << ' world' puts #=> "hello word" this happens because b new variable it's points same memory location a , when b changes in way doesn't create new object in way (such using << operato...

sql server - Syntax for SQL Trigger to Insert Data in another DB and also to update any field in another db adfter a field is edited -

here scenario - specific. have "bridged" db on sql called [fulcrum_xfer] use bridged because main db called [fulcrum uat] using bigint datatype fields , thereby displaying in access front end " #deleted data " in fields - behavior cannot changed in present design (the bigint has stay) have exact table name , fieldnames in [fulcrum_xfer] db - orderno field in orders table in [fulcrum_xfer] int , there no primary key what need have done tomorrow under threat of "you let down" following the table gets data inserted or updated called orders , in [fulcrum_xfer] database structure follows orderno int unchecked orderdate smalldatetime unchecked applicationtenantlinkid int unchecked orderstatus int unchecked the table receives triggered data orders in fulcrum_xfer called orders , in database fulcrum uat structure orderno bigint unchecked primar...

creating a text file and saving data in android -

i new programming android apps. in following code, want take input user through number of edittexts , save them file. use android studio , after giving inputs, checked file , empty. try display contents , still no output. wrong code? please me. public class user extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_user); nextclick(); } public void nextclick() { final context context = this; button next =(button) findviewbyid(r.id.usernext); next.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { try { edittext e1 = (edittext) findviewbyid(r.id.name); edittext e2 = (edittext) findviewbyid(r.id.designation); edittext e3 = (edittext) findviewbyid(r.id.orgname); edittext e4 = (edittext) findviewbyid(r.id.address); edittext...

apache - Some PHP errors don't appear in the browser -

i'm working in laravel 5 application. have been playing around configuration values , creating routes, controllers, models , views. used view php errors in browser, now, don't understand why. errors. in case, browser returns 500 http error (internal server error) . for example, if call url don't have correspondent route, error description in browser. if have route pointing controller not exist, receive 500 http error . why happen? it permissions problem, on storage folder, i.e. laravel cannot write log file. running chmod -r 755 storage root of project , problem resolve.

python - Stopping a class variable from re-initializing when called again? -

so here example code class hi(object) def __init__(self): self.answer = 'hi' def change(self): self.answer ='bye' print self.answer def printer(self): print self.answer class goodbye(object): def bye(self): hi().change() goodbye().bye() hi().printer() when run code output 'bye' 'hi' i want output 'bye' 'bye' is there way while still initializing self.answer hi or cause re-initialize 'hi' no matter afterwards? you using instance attributes not class attributes jonrsharpe pointed out. try this: class hi(object): answer = 'hi' def __init__(self): pass @classmethod def change(cls): cls.answer ='bye' print cls.answer def printer(self): print self.answer class goodbye(object): def bye(self): hi.change() goodbye().bye() hi().printer() here answer class att...

Why Unity3D Use Monodevelop(4.0.1) not the latest Xamarin(5.9) -

i use unity 4.6.3 , monovelop 4 installed default. seems monodevelop 4 has many bugs. i see lastest monovelop xamarin(5.9) http://www.monodevelop.com/download/ . why unity did't use xamarin default ide? if want use xamarin unity's default ide , have tips or document me. by way, know can change default ide edit=>preferences=>external tools=>external script editor. confuse why unity did't use latest monodevelop? you're totally right, i've been working old , buggy monodevelop version way long. but there didn't seem real alternative, @ least until last week colleague of mine found nice add-ins, make xamarin 5.9 working quite unity. note: works unity starting 4.6.5p2 . i'd recommend update unity latest version anyway, there lot of bugfixes (especially il2cpp, if you're doing ios). add-ins the xamarin add-ins can found here: http://files.unity3d.com/lukasz/unity-addins-5.9.0.zip requirements xamarin 5.9: http://www....

Creating a DSL: How to load a clojure file in the current context -

i trying create dsl packaging software using clojure. want define macros, functions, etc. , load file, , want of things define in same namespace file itself, if define macro abe , can use in file without using abe 's qualified name. i have far: (binding [*ns* (find-ns 'my-namespace)] (load-file "myfile")) but feeling i'm doing wrong. also, nice have locally bound variables accessible within clojure file. this: (let [a 1] (binding [*ns* (find-ns 'my-namespace)] (load-file "myfile"))) where a usable within myfile . the idea allow programmer specify how package in real clojure, language extended in ways transparent programmer. is there better way this? there better "idiomatic" way of creating dsl in clojure?

android - Difference between view.findViewById(R.id....) and just findViewById(R.id...) -

i'm trying implement custom array adapter , problem code crashes when use imageview imageview=(imageview)findviewbyid(r.id.imageview); rather imageview imageview=(imageview)rowview.findviewbyid(r.id.imageview); where rowview layout file listview have infalted. why occur , thought rowview.findviewbyid(r.id..) make faster find element id, without app crashes, can please explain this activity code public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //now list view listview listview=(listview)findviewbyid(r.id.listview); string[] values =new string[]{"ios","android","firefoxos","ubuntu"}; mysimpleadapter simpleadapter=new mysimpleadapter(this,values); listview.setadapter(simpleadapter); // } @override public boolean oncreateoptionsmenu(menu men...

screen scraping - How to save the body content of New York Times links using jsoup -

i have screen scraping different news websites washington post, ny times , yahoo message boards. used jsoup , works fine of websites washington post. however, when comes ny times, every approach i've used, failed. using such piece of code gives me "log in - new york times" content. string html = jsoup.connect(urlstring).maxbodysize(integer.max_value).timeout(600000).get().html(); doc = jsoup.parse(html); result = doc.title() + "\n"; result += doc.body().text(); i used cookies , pass them through requests, didn't work well. connection.response loginform = jsoup.connect("https://myaccount.nytimes.com/auth/login") .method(connection.method.get).execute(); doc = jsoup.connect("https://myaccount.nytimes.com/auth/login") .data("userid", myemail).data("password", password) .cookies(loginform.cookies()) .post(); map<string, string> logincookies = loginform.cookies(); docume...

excel vba - How to copy intersected data within a variable range? -

Image
my sheet has data's chiller 14 days. column time of data collection, 00:00:00 23:59:00. data collected every minute. therefore each row 1 minute. i'm using user form operating hours of chillers. okay here problem: set range operating hours prompt user column containing data need. which ever data in column specified user within operating hours range copied workbook. ** note user's chiller operating hours may differ different chillers. ** note code below not work. not select data whatsoever this coding tried sub try() dim strtime, endtime string dim rfoundstrt, rfoundend, orange range strttime = userform1.textbox9.text endtime = userform1.textbox10.text on error resume next sheet1 set rfoundstrt = .columns(1).find(what:=strtime, after:=.cells(1, 1), lookin:=xlvalues, lookat:=xlpart, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=false _ , searchformat:=false).entirerow.select end on error resume next sheet1 set rfoundend ...

Ionic live reload feature not reloading application -

i tried use live reload feature ionic serve , ionic emulate ios --livereload . server starts well, application displayed on simulator (or in browser) , works smoothly. when change file (a js or html in www directory) , save it, console write html changed: www/index.html example, application doesn't reload should be. i supposed websocket between server , app broken, when kill server (ctrl-c), web inspector immediatly fire following error : [error] websocket network error: operation couldn’t completed. connection refused (192.168.5.2, line 0, x4) so supposed there no issue websocket. moreover, displayed no error in network pane of web inspector. is there missed made livereload work ? my configuration : cordova cli: 5.0.0 ionic version: 1.0.0 ionic cli version: 1.4.5 ionic app lib version: 0.0.22 ios-deploy version: 1.7.0 ios-sim version: 3.1.1 os: mac os x yosemite node version: v0.10.30 xcode version: xcode 6.3.2 build version 6d2105 don't hesitate...

php - Codeigniter Upload Files/image only works when offline -

i made code upload files on web, when still using xampp, going well, after upload hosting, file uploading not working.. here's code : model (for updating database record) function edit_logo_web() { $timestamp = date('ymdhi'); $img = $_files['userfile']['name']; $logo = $timestamp."_".$img; $data = array ( 'logo' => $logo ); $id = 1; $this->db->where('site.id', $id); if($this->upload->do_upload()){ $this->db->update('site', $data);} else{ } } controller (for uploading img/file web directory) function logo_web() { $timestamp = date('ymdhi'); $img = $_files['userfile']['name']; $config['file_name'] = $timestamp."_".$img; $config['upload_path'] ='asset/img/'; $config['allowed_types'] = 'gif|jpg|png|bmp|jpeg|png...

excel - Eliminating duplicates such that the only records that remain were unique -

i couple of examples solve following condition: i have record set duplicates similar in single column: a b b c c c d f f is there excel function or vba code display records not duplicated? (true count of 1) in above example, such function or code return records "a" , "d". i have pivot table solution, looking individual not want use pivot table. maybe, if a in a2, a1 not contain a , list sorted, in b2 , copied down suit: =(a2<>a1)*(a2<>a3) then filter select 1 in columnb.

International character in my SQL Server database does not display on my Classic ASP page -

Image
i have international character shows in sql server database. when attempt display field on webpage using classic asp, shows diamond question mark inside. searching, seems utf-8 encoding. have added meta tag include utf-8 , did not work. below screenshot of how data looks inside sql server database using management studio, query. how can display on webpage? <meta charset='utf-8'> turns out whole code took trick. had @ top of page: <% session.codepage = 65001 response.charset ="utf-8" session.lcid = 1033 'en-us %>

python - If value contains string, then set another column value -

i have dataframe in pandas column called 'campaign' has values this: "uk-sample-car rental-car-broad-matchpost" i need able pull out string contains word 'car rental' , set product column 'car'. hyphen not separating out word car, finding string way isn't possible. how can achieve in pandas/python? pandas sweet string functions can use for example, this: df['vehicle'] = df.campaign.str.extract('(car).rental').str.upper() this sets column vehicle contained inside parenthesis of regular expression given extract function . also str.upper makes uppercase extra bonus: if want assign vehicle not in original string, have take few more steps, still use string functions time str.contains . is_motorcycle = df.campaign.str.contains('motorcycle') df['vehicle'] = pd.series(["mc"] * len(df)) * is_motorcycle the second line here creates series of "mc" strings, masks on entri...

perl - Context and the Comma Operator -

one of colleagues used comma after statement instead of semi-colon, resulted similar below code: my $special_field = 'd'; %field_map = ( 1 => 'a', 2 => 'b', 3 => 'c', ); sub _translate_to_engine { ($href) = @_; %mapped_hash = map { $field_map{$_} => $href->{$_} } keys %$href; $mapped_hash{$special_field} = fakeobject->new( params => $mapped_hash{$special_field} ), # << comma here return \%mapped_hash; } at first surprised passed perl -c , remembered comma operator , thought understood going on, results of 2 print statements below made me doubt again. my $scalar_return = _translate_to_engine( { 1 => 'uno', 2 => 'dos', 3 => 'tres' } ); print dumper $scalar_return; # {'c' => 'tres','a' => 'uno','b' => 'dos','d' => bless( {}, 'fakeobject' )} this call made in scala...

knockout.js - Loading data from observableArray one-by-one clicking button -

i came across nice sample code knockout.js , learning. curious understand code flow. when try read code stuck understand specific area. here jsfiddle link can see full code http://jsfiddle.net/rustam/ssbzs/ //this 2 area clear this.currentquestion = ko.computed(function(){ return self.questions()[self.questionindex()]; }); this.nextquestion = function(){ var questionindex = self.questionindex(); if(self.questions().length - 1 > questionindex){ self.questionindex(questionindex + 1); } }; this.prevquestion = function(){ var questionindex = self.questionindex(); if(questionindex > 0){ self.questionindex(questionindex - 1); } }; when clicking next or previous button 2 function getting called prevquestion & nextquestion 2 routine questionindex value getting changed , accordingly question , answer set changing. my problem there no link between questions , questionindex know when questionindex getting change how question set changing ? ...

objective c - fetch data from a RESTful API into Core Data -

hello can t fetch localdatabase json restapi i want data website : http://barcelonaapi.marcpous.com/bus/stations.json i'm using restkit 0.20 here code in appdelegate : - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsurl *baseurl = [nsurl urlwithstring:@" http://barcelonaapi.marcpous.com/bus/stations.json "]; rkobjectmanager *objectmanager = [rkobjectmanager managerwithbaseurl:baseurl]; // initialize managed object model bundle nsmanagedobjectmodel *managedobjectmodel = [nsmanagedobjectmodel mergedmodelfrombundles:nil]; // initialize managed object store rkmanagedobjectstore *managedobjectstore = [[rkmanagedobjectstore alloc] initwithmanagedobjectmodel:managedobjectmodel]; objectmanager.managedobjectstore = managedobjectstore; // complete core data stack initialization [managedobjectstore createpersistentstorecoordinator]; nsstring *storepath = [rkapplicationdatadirectory() stringbyappen...

android fragments - Custom font change for textview in custom listview -

i have custom list 1 image view , 1 text view. want change textview font custom font in assests folder. i using fragments getassests method not working in fragment. help just use typeface typeface = typeface.createfromasset(.getassets(), "fonts/swinsbrg.ttf");

html - How to eliminate whitespace between two divs in different class=row's (Bootstrap)? -

looks except on vertical tablet browsers. whitespace between red , blue divs appears, forced height of black div. it's critical in solution stacking order of divs on tablet/mobile screens goes blue > black > red. <html> <div class="container"> <div class="row"> <div class="col-sm-7"><div class="blue"><img src="jpg"> lots of whitespace appears below between 768 aprx 900 px browser width (tablet dimenions)</div></div> <div class="col-sm-5"><div class="black">line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>line of text<br>l...

Find diameter from volume of sphere C++ -

this question has answer here: why division result in 0 instead of decimal? 6 answers i have got task create program calculates diameter of sphere of volume 1234.67 cu meters. i have written following code : - #include <iostream> #include <math.h> using namespace std; int main(){ float vol, dm, h; vol = 1234.67; cout << "calculating diameter of sphere volume 1234.67 cu meters" << endl; h = vol*(3/4)*(7/22); dm = 2 * cbrt(h); cout << "the diameter of sphere volume 1234.67 cu meters " << dm << endl; return 0; } what's wrong program , gives 0 output calculating diameter of sphere volume 1234.67 cu meters diameter of sphere volume 1234.67 cu meters 0 h...

c# - How to track WPF commands? -

in wpf application, want have user tracking system keep statistics on way users using application. in other words, i'm looking way track commands being executed , how have been triggered user (by clicking on toolbar button, using keyboard shortcuts, etc). far, haven't found nice way while using wpf command pattern... do have ideas/suggestions on how achieve/design without overriding every control used in application? for discussion purposes, created basic wpf application containing toolbar single save button, textbox , listbox. added keybinding trigger save command when pressing ctrl+s. the first challenge determine device (mouse or keyboard) used trigger command. the second challenge determine control used trigger command (the command source). i'm not interested know control had keyboard focus when command triggered, know control used trigger command (usually it's button, hyperlink, menuitem contextmenu, etc.) mainwindow.xaml <window x:class="t...

android - Measure time per game session -

is possible measure time user has spend in game (not overall, per 1 session), using parse's methods, without additional code me? or if not possible, using google analytics? you use user timings, https://developers.google.com/analytics/devguides/collection/android/v4/usertimings . mean saving current timestamp in oncreate , , logging in ondestroy , or related place.

.net - AES-functions always reply with empty results -

today i've got question current visual basic project i'm going for. intention serve 1 or more encrypted configuration-files program in same directory executable placed in. because (en/de)cryption processed twice (username , password), want (en/de)crypt directly string string. hope reduce hassles temporary files , might useful later on. with of great site , tutorial came far, @ least compiler doesn't complain anymore. :) far, good... my code following: private function producekeyandiv(byval password string) object() dim bytearray(password.length) byte, key(31) byte, iv(15) byte bytearray = system.text.encoding.ascii.getbytes(password) dim sha_function new system.security.cryptography.sha512managed dim hashresult byte() = sha_function.computehash(bytearray) array.copy(hashresult, key, 32) array.copy(hashresult, 32, iv, 0, 16) dim obj(2) object obj(0) = key obj(1) = iv return obj end function private function generatestreamf...

agile - Development Methodologies -

i having confusion on development methodology. for example, take following: waterfall model iterative & incremental unified process extreme programming dynamic system development method which of these development methods etc. understanding waterfall , iterative & incremental models used different methods (uf, xp, dsdm) correct? there 2 important concepts grasp. first 1 definition of project. pmi definition: "a project can defined temporary endeavor undertaken create unique product or service" so, there project management , planning styles (or models). comes sequential model, iterative model, etc. these models describe set of practices , techniques lead project beginning end. and there a kind of project software development project. means project end of delivery of software. to kind of projects there specialisations of former models. example there waterfall model following sequential model , extreme programming (xp) following iterative...

Allow landscape for Youtube embedded video Objective C -

i have app supports portrait have embedded youtube videos should have possibility play in landscape, can't find solution this.. code webview yt video loaded: ytview = [[uiwebview alloc] initwithframe:cgrectmake(0,0,self.view.frame.size.width,170)]; ytview.delegate = self; [ytview setallowsinlinemediaplayback:yes]; [ytview setmediaplaybackrequiresuseraction:no]; [_scrollingview addsubview:ytview]; nsstring* embedhtml = [nsstring stringwithformat:@"\ <html>\ <body style='margin:0px;padding:0px;'>\ <script type='text/javascript' src='http://www.youtube.com/iframe_api'></script>\ <script type='text/javascript'>\ function onyoutubeiframeapiready()\ {\ ytplayer=...

java - websphere path of installedApps directory -

java how path of websphere installedapps directory? i use string websphereappspath = new file(".").getcanonicalpath() result: c:\ibm\websphere\appserver2\profiles\appsrv01 i need result: c:\ibm\websphere\appserver2\profiles\appsrv01\installedapps\bastionnode01cell per application binary settings topic in knowledge center, want ${app_install_root}/${cell} . see creating, editing, , deleting websphere variables topic sample code on expanding variable. (that said, suspect directly accessing directory wrong approach. should consider asking new question along lines of "what best way x? can accomplish looking @ installedapps directory, seems there should better way.")

ios - Multilines UITextView inside a dynamic sizing UITableViewCell gets wrong -

Image
i'm doing ios 8 app, have 3 uitableviewcell in uitableview, , need them dynamic change height. implemented using autolayout , add 2 lines of code in viewdidload method below: self.tableview.estimatedrowheight = 66.0; self.tableview.rowheight = uitableviewautomaticdimension; it works! but issues appeared, there uitextview in second uitableviewcell . can not display long texts entirely, when rotate device/simulator landscape mode, texts display correctly , entirely. here is: sorry posting screenshot include chinese, can check last line of texts , notice number blue font. last line appears in landscape portrait. however, turn portrait landscape, entire texts displayed landscape: finally, there issue, uitableviewcell list wrong , overlapping layout follows: the cell red line circled shouldn't here! can tell me i'm doing wrong here? maybe it's hard answer looking these screenshots, posted code file here i guess these issues related autolayou...

php - MySQL query Where x = Anything -

i'm creating list of radio buttons filter down data base @ moment query im using is select * table activities = '{$activities}' , climate = '{$climate}' , continent = '{$continent} my problem end query "continent" has list of continents pick "any" radio button. causing error can't think of value need attach raido button in order select everything. thanks, you can use clause, , set %. pull continent stored on table. select * table activities = '{$activities}' , climate = '{$climate}' , continent '{$continent} https://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html

c# - Given a HttpResponseMessage, how do I read the content of the request? -

given system.net.http.httpresponsemessage , can quite lot of information request made through response.requestmessage , example response.requestmessage.requesturi // url of request response.requestmessage.method // http method however, can't figure out way useful from response.requestmessage.content // stringcontent instance i've looked through property tree of stringcontent , can't figure out how contents regular string in way works in watch window. any suggestions? analyzing system.net.http.dll v2.2.29.0 ilspy shows system.net.http.httpclienthandler.createresponsemessage (that initializes httpresponse object) doesn't corresponding httprequest 's .content . means if wasn't null in first place, content object itself should still available. system.objectdisposedexception thrown "when operation performed on disposed object." "disposed object" mean? system.net.http.stringcontent turns out implement system...

ios - Can I distribute app with Developer Provisioning Profile? -

can distribute app selected device developer provisioning profile whaereas created distribution profile well. yes can distribute app selected device developer profile. in general advisable distribute app through ad-hoc distribution profile. if supporting minimum os version 8.0 can take advantage of 1000 beta users through test flight.

php - Running code parallel with ReactPhp -

problem: need clone/download several git repositories, unfortunately doing sequentially takes ages. got idea use reactphp event loop , parallelly. despite of many attempts not able running parallelly. maybe misunderstood concept, expectation reactphp somehow fork execution of code. could take @ code , share guidelines how working? use symfony\component\stopwatch\stopwatch; include 'vendor/autoload.php'; $toclone = [ ['url' => 'http://github.com/symfony/symfony.git', 'dest' => 'c:\tmp\cloner1'], ['url' => 'http://github.com/laravel/laravel.git', 'dest' => 'c:\tmp\cloner2'], ['url' => 'http://github.com/rails/rails.git', 'dest' => 'c:\tmp\cloner3'], ]; $end = count($toclone); $i = 0; $deferred = new react\promise\deferred(); $fclone = function (\react\eventloop\timer\timer $timer) use (&$i, $deferred, &$toclone, $end) { $project = ...

javascript - why form is submitted while the return from validateform() is false? -

i have code have javascript validation in jquery mobile.but problem form submitted validate form return false.what may reason please reply? below code. <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="http://code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.css" rel="stylesheet" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script> // validate contact table function validatecontact() { var emergencycontactelt = document.getelementbyid("emergency_contact"); var emergencycontacteltrows = emergencycontactelt.rows...

java - tomcat v8.0 doesn't start at ubuntu -

this question has answer here: several ports (8005, 8080, 8009) required tomcat server @ localhost in use 26 answers i'm new here, sorry if asked bad question it's tomcat, have ubuntu 14.04 ans eclipse installed tomcat v8.0 , when start it, doesn't worked , show me error message : "several ports (8005, 8080, 8009) required tomcat v8.0 server @ localhost in use. server may running in process, or system process may using port. start server need stop other process or change port number(s)." i need solution , thank much either stop service(s) running on ports (you can find out "lsof -i" suggested flafoux or have @ http://www.cyberciti.biz/faq/what-process-has-open-linux-port/ alternatives) or change port of tomcat. need modify ports in file "{tomcat-directory}/conf/server.xml" (see documentation here , here if nee...

java - Adding same widget to two panel causing issue -

i have created 2 verticalpanel(mainvp,subvp) , 1 textbox(box).textbox(box) added mainvp subvp adding mainvp rootpanel here if lauch application nothing visible though have added textbox(box) verticalpanel(mainvp) added main rootpanel. verticalpanel mainvp=new verticalpanel(); verticalpanel subvp=new verticalpanel(); textbox box=new textbox(); mainvp.add(box); //textbox added verticalpanel subvp.add(box); rootpanel.get().add(mainvp);//mainvp contains textbox can explain me how above code working internally? your panel subvp isn't added anything, , when box added subvp , removed mainvp . widgets can 1 place @ time. -- (adding more detail comment posted) this part of basic assumption of how widget works - isn't "stamp" can put on page in several places, instead represents 1 or more dom elements, , wraps them easier use , reuse. each widget exposes event handlers can listen to, , ways change widget looks like. imagine if had 2 buttons o...

c# - Grab object values during runtime for creating Mock objects required for writing Unit Test -

Image
consider below class needs tested, class tobetested { employee _e; public tobetested(employee e) { _e = e; } void process() { // _e } } [testclass] class tobetestedtest { [testmethod] public void testprocessmethod() { employee e = // initialise test value.. tobetested tbt = new tobetested(e); tbt.process(); //assert verify test results... } the problem employee can complex type properties in can objects of more classes. becomes difficult initialise employee mock values , generate testable object. while debugging can set breakpoint , see employee object in tobetested contains. there way can grab values object available during runtime , use in test method? you can use object exporter . extension visual studio generate c# initialization code object in debugging windows. can use generated code in unit test initialization.