Posts

Showing posts from September, 2011

ios - How do I keep using Swift 2.3, instead of 3.0, Xcode updated and can't build anymore -

i developing app 20+ framework dependencies , not of them on 3.0 yet. want keep using swift 2.3. however, after updating xcode 8.0, can no longer build app. fails following error: “use legacy swift language version” (swift_version) required configured correctly targets use swift. use [edit > convert > current swift syntax…] menu choose swift version or use build settings editor configure build setting directly. i don't want convert whole project 3.0 yet. so question how keep same after xcode 8.0 update? in case want use swift 2.3 should go build settings -> use legacy swift language version -> yes achieve it. after building app, there minor syntax issues. after fixing (not hard) go usual

perl - Sqlite unable to find DB file with Mojolicious and Par Packer -

i'm writing program perl uses mojolicious , sqlite. using par packer distribute .exe file deployment on other windows machines. i use strawberry perl on windows development. i use following windows batch file par packer generate .exe file: pp -o hallo.exe ^ -x ^ -l libeay32__.dll ^ -l zlib1__.dll ^ -l ssleay32__.dll ^ -a lib ^ -a public ^ -a templates ^ -a "c:\strawberry\perl\site\lib\mojo\entities.txt;mojo\entities.txt" ^ -a "c:\strawberry\perl\vendor\lib\mojolicious\resources\public;mojolicious\public" ^ -a "c:\strawberry\perl\vendor\lib\mojolicious\resources\templates;mojolicious\templates" ^ -a "d:\perl\main.db" ^ hallo.cgi this above works bring in sqlite got following error when trying run hello.exe : dbd::sqlite::db prepare failed: no such table: libraries hallo.cgi works fine when run normally. perl hallo.cgi example. when compiled .exe file sqlite error occurs. what happ

ios - How to dismiss the UIActivityViewController on clicking the Cancel button? -

let activityvc = uiactivityviewcontroller(activityitems: objectstoshare, applicationactivities: nil) let excludeactivities = [uiactivitytypeairdrop, uiactivitytypeprint, uiactivitytypeassigntocontact, uiactivitytypesavetocameraroll, uiactivitytypeaddtoreadinglist, uiactivitytypeposttoflickr, uiactivitytypeposttovimeo,uiactivitytypemail,uiactivitytypeopeninibooks,uiactivitytypecopytopasteboard] activityvc.excludedactivitytypes=excludeactivities let nav = uinavigationcontroller(rootviewcontroller: activityvc) nav.modalpresentationstyle = uimodalpresentationstyle.popover let popover = nav.popoverpresentationcontroller uipopoverpresentationcontroller! activityvc.preferredcontentsize = cgsizemake(0,150) popover.sourceview = self.view popover.sourcerect = cgrectmake(345,580,0,0) self.presentviewcontroller(nav, animated: true, completion: nil) i'm trying dismiss activity controller when cancel button clicked not working. on clicking anywhere

mysql - echo PHP array with while loop -

i'm using while loop echo php array : $connect = mysqli_connect("localhost", "user", "password", "db"); $sql = "select * table order rand() limit 0,4"; $result = mysqli_query($connect, $sql); if(mysqli_num_rows($result) > 0) { echo'<section> <div class="container"> <div class="row"> <h2 class="bold">title</h2> <hr> '; while($row = mysqli_fetch_array($result)) { echo' <div class="col-sm-3 col-md-3 col-md-push-3"> <div class="portfolio-wrapper"> <div class="portfolio-single"> <div class="portfolio-thumb"> <a href="'.$row['link']." target="

java - Why doesn't my get-method return the assigned value to my key? -

i've been assigned following task in datastructures , algorithms course, , have no idea why not work. the task implement linked hashtable. have created 2 classes, 1 acts key <-> value pair, representing element (entry class), , hashtable class has methods (currently put , get), can't seem of them work. hashfunction method provided our teachers, can't answer questions regarding that. whenever execute program, no errors, list returns empty. here can guide towards right direction of doing wrong? assume error lies within put method, can't seem figure out issue might be. best regards, victor package laboration2; /** * class works container key , value. * 'entry' become element in our hashtable * * @author victor marante * @version 1.0 * @since 2016-09-22 */ public class entry { private object key; private object value; private entry next; public entry(object key, object value) { this.key = key; this.val

umbraco7 - Umbraco Can't add media : -

actual error: value "png" of type "system.string" not converted type "system.int32" whcih expected property type "umbracoextension" been working on new site week , find cannot upload media @ all. umbraco version 7.5.3 i did have bunch of orphaned nodes have manually removed, think problem. if change connection string , point different db media upload works fine. stumped. ideas umbraco media upload error i think did same me: accidentally changed data type "label's" (aka noedit) value type integer. set string originally. internal data type, many internal property umbracoextension image property group use data type. try go backoffice/developer/data types, select "label" data type , check if value type not set integer. if yes, change string.

javascript - Highlighting multiple nodes in networkD3 -

Image
i have been building force directed network networkd3 using forcenetwork method. the graph looks : able highlight single node (and it's neighbors) , fade out others , looks like: the code based on jsfiddle , except have linked node value search box, had received in question now expanded search have list of node names. , need nodes in list highlighted , rest fade. how alter properties of selected list of node objects?

ios - UITableView height inside UIScrollView in Swift -

Image
i'm trying add uitableview inside uiscrollview when set height of uitableview using tableview.contentsize.height not setting height (it add height whats actual height is) can please help? i able make content size of table set table height , modify content size of scrollview following way. i designed table inside scrollview , call modify height of table , content size of scrollview viewdidappear my code : override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. self.extradesignafterstoryboard(); } override func viewdidappear(animated: bool) { self.modifycontentheight(); } func extradesignafterstoryboard() { scrolvw = uiscrollview(); scrolvw.frame = cgrectmake(0, 64, self.view.frame.size.width, 200); scrolvw.backgroundcolor = uicolor.greencolor(); self.view.addsubview(scrolvw); tblviewscr = uitableview(frame: cgrectmake(0, 80, scrolvw.frame.size.width, 120), style: uita

firebase - Swift - How to get latitude and longitude value outside function LocationManager() -

i working firebase db, , want save lat,long value of device on firebase. had 2 value locationmanager() this function locationmanager() func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) { let lastlocation: cllocation = locations[locations.count - 1] let lat = string(format: "%.6f", lastlocation.coordinate.latitude) let long = string(format: "%.6f", lastlocation.coordinate.longitude) } next, try save lat,long on firebase: ref = firdatabase.database().reference() ref.setvalue(lat) error: "use of unresolved identifier". how latitude , longitude value outside function locationmanager(). you can declare cllocationmanagerdelegate right of class definition. class yourclass { private var currentcoordinate: cllocationcoordinate2d? } and in location delegate method assign current value func locationmanager(manager: cllocationmanager!, didupdatelocations lo

hive - Can i concurrently set MAPJOIN hint and STREAMTABLE hint? -

can use this? select /*+ mapjoin(t2)*//*+ streamtable(t1)*/ t1.c1. t2.c1 t1 left outer join t2 on t1.c1 = t2.c1; and confuse "streamtable" on different join keys. for example: t3 biggest table,and t2 secondary big table,t1 smallest table. select /*+ streamtable(t2)*/ t1.c3, t2.c2, t3.c3 t2 left outer join t1 on t2.c1=t1.c1 left outer join t3 on t2.c2=t3.c2; so if when t2 join t1 it's ok.but when t2 join t3,if t2 if still treated big table? how can handle situation? you can achieve following: select /*+ mapjoin(t2), streamtable(t1)*/ t1.c1. t2.c1 t1 left outer join t2 on t1.c1 = t2.c1; there non-trivial number of cbo-related defects might still run into, involving windowing functions , columnar formats in experience. therefore useful know how apply hints.

angularjs - angular/ionic iframe issue on ios -

i have issue ionic app on iphone. ionic writes index.html: <iframe src="gap://ready" style="display:none;">...</iframe> the console output of app loops error 40 times per second: refused load gap://ready because appears in neither child-src directive nor default-src directive of content security policy. i guess everytime dirtycheck of angular working, error thrown. iframe comming , how can rid of iframe , error? solution, add gap: following meta tag in index.html : <meta http-equiv="content-security-policy" content="default-src * data: cdvfile: gap:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>

php - How to add multiple values onto the same array -

i want show information on page regarding multiple queries, each of them representing project status. that, made while loop, adds information array. the problem that, show 1 of statuses available, first one. here code: $exec = mysql_query($queryontime) or trigger_error(mysql_error()); $exec1 = mysql_query($querydelayed) or trigger_error(mysql_error()); $exec2 = mysql_query($querypending) or trigger_error(mysql_error()); $array_dados = array(); // chart data while($info = mysql_fetch_array($exec)||$info1 = mysql_fetch_array($exec1)||$info2 = mysql_fetch_array($exec2)){ $array_dados[] = $info; $array_dados[] = $info1; $array_dados[] = $info2; } return $array_dados; so can see, have 3 queries, , try adding of them array, yet 1 of $info shows up. why that? edit: i removed or , separated fetch arrays, yet still shows "pending" one. here's how looks right now: $exec = mysql_query($querypending) or trigger_err

concurrency - What is the right way to make a barrier in distributed tensorflow? -

during distributed training want sync after each epoch, calculations on chief worker , proceed or stop training depending on these calculations. need barrier so. i don't see similar in documentation, implemented solution based on queues (similar how gradients stored , applied in distributed training): def build_barrier(tasks, task_index, barrier_name): queues = [] i, task in enumerate(tasks): tf.device('%s/cpu:0' % task): tf.name_scope(barrier_name): queues.append( tf.fifoqueue( len(tasks), (tf.float32), shapes=(()), name=str(i), shared_name=str(i))) tf.control_dependencies([queue.enqueue(1.) queue in queues]): return queues[task_index].dequeue_many(len(tasks)) the idea create queue per worker. 'signal' push token in each queue , 'join' dequeue many token

ios - Swift 3: Can not convert value of type 'int' to expected argument type 'DispatchQueue.GlobalQueuePriority' -

swift 3.0: receiving error can not convert value of type 'int' expected argument type 'dispatchqueue.globalqueuepriority' on creating dispatch async queue dispatchqueue.global(priority: 0).async(execute: { () -> void in }) warning, deprecated in ios 8, see below latest dispatchqueue.global expects dispatchqueue.globalqueuepriority enum, is: high default low background so in case, write: dispatchqueue.global(priority: .background).async(execute: { () -> void in }) if want lowest priority. a quick check reveals, dispatchqueue.global(priority:_) deprecated in ios 8. latest solution: dispatchqueue.global(qos: .background).async { } which gives more options choose from: background utility default userinitiated userinteractive unspecified

php - Laravel Auth Custom Fields -

trying add custom field auth, check if user 'activated' before allowing login i've tried modifying authenticatesusers.php although understand file shouldnt edited directly. here tried , did not work. public function postlogin(request $request) { $this->validate($request, [ $this->loginusername() => 'required', 'password' => 'required', 'activated' => '1' ]); you can add custom field manaually authenticating users. public function postlogin(request $request) { $this->validate($request, [ $this->loginusername() => 'required', 'password' => 'required' ]); if (auth::attempt(['email' => $request->email, 'password' => $request->password,'activated'=>1]) ) { return redirect()->intended('/'); } }

unix timestamp - UNIX_TIMESTAMP mysql query error -

i'm trying make query using unix_timestamp , basicly query: "select * payment unix_timestamp(pay_till) >=".$today that's pretty simple query, pay_till has value 2016-09-21 23:59:59, & today 1474498800. so shouldn't return me payment done after 2016-09-21 23:59:59, how still return me payments till 2 days after.

node.js - piping with requestjs in node 0.10 vs higher version -

so need understanding happens when piping requests , if there difference between node 0.10.x , 4.5.x i have this: function(req, res, next){ if(req.method === 'put'){ var putoptions = { uri: config.url + req.url, headers: { token: req.session.token }, jason: req.body }; var r = request.put(putoptions, callback); return req.pipe(r).pipe(res); } } now works fine in node 0.10.x, in 4.5.x "write after end" error, unless remove req.pipe -part , r.pipe(res) , works fine in 4.5.x. now in understanding difference between these two, happens, , why behaves differently in different node versions. thanks help! ---update--- ok when tried req.pipe(r, {end: false}).pipe(res) worked in 4.5.x, i'm no longer getting "write after end"-error ... i'm still bit confused why there difference.. docs regarding pipes doesn't seem have changed since 0.10

javascript - How to issue a dragstart event with jQuery? -

i have event this: $(document).on('dragstart', '#' + gridid + ' tr.rgrow, #' + gridid + ' tr.rgaltrow ', function (ev) { console.log(ev); }); i issue dragstart event, this: $(".rgrow > td, .rgaltrow > td").filter(function() { return $(this).text().trim() === "utt000000899103"; }).parent().dragstart(); parent() finds right tr , dragstart undefined. so, how should proceed instead? edit: based on comment a. wolff have tried .parent().trigger('dragstart') error. try this: $(document).on('dragstart', '#' + gridid + ' tr.rgrow, #' + gridid + ' tr.rgaltrow ', function (ev) { console.log(ev); var e = ev.originalevent; e.datatransfer.effectallowed = 'move'; }); and $(".rgrow > td, .rgaltrow > td").filter(function() { return $(this).text().trim() === "utt000000899103"; }).p

javascript - How to configure directive that comes from a third-party library -

is there way configure directive comes third-party library? i'm using library called angular-tablesort , want disable scope: true option sets in directive : tablesortmodule.directive('tswrapper', ['$parse', '$compile', function( $parse, $compile ) { return { scope: true, controller: ['$scope', 'tablesortconfig', function($scope, tablesortconfig ) { /* ... */ } } }]); is there way w/o modifying source code of library?

javaScript upload multiple files - when it has finished -

i have javascript function upload files , want know when files uploaded, when upload of multiple files has finished. there possibility this? function uploadfiles(files, userid, projectid, successcallback, progresscallback) { if (files && files.length) { (var = 0; < files.length; i++) { var file = files[i]; if (!file.$error) { upload.upload({ url: 'api/fileuploads/fileupload/' + userid + '/' + projectid, data: { file: file } }).then(function (resp) { if (successcallback) { successcallback(resp); } }, null, function (evt) { var progresspercentage = parseint(100.0 * evt.loaded / evt.total); var log = 'progress: ' + progresspercentage + '% ' + evt.config.data.fi

python built-in integer object -

i read article python retains number objects better performance. example: x = 3 y = 3 print(id(x)) print(id(y)) gives out same values, means x , y referencing same object. article suggested retained number objects approximately in range 1~100. so tested following code getting exact range: for in range(-1000,1000): x = int(str(i)) y = int(str(i)) if str(id(x)) == str(id(y)): print(i) and result quite weird: prints out -5~256. i'm wondering how these 2 magic numbers came , why they're being used. also, these 2 values change in different environment? thanks! 256 power of 2 , small enough people using numbers range. -5 less sure about, perhaps special values? related: what's integer cache inside python? also word of wisdom thread: this implementation detail, don't ever rely on happening or not happening

mysql - PHP Convert String to Duration -

using php , mysqli . i selecting string mysql database , saving variable called $querytime , i'd modify how string displayed on screen. when print_r($querytime); see; 01:25:24 when var_dump($querytime) see; string(8) "01:25:24" is there way can display string in time duration format - like; 1 hour, 25 minutes, 24 seconds presumably because database field stored varchar , not time-stamp things more complicated? unfortunately don't have access modify database. any appreciated. you simple work on string, if format same: $querytime = '01:25:24'; $parts = explode(':', $querytime); $parts[0] .= ' hours'; $parts[1] .= ' minutes'; $parts[2] .= ' seconds'; //01 hours, 25 minutes, 24 seconds echo implode(', ', $parts);

javascript - (Ionic/Cordova) PermissionDeniedError for getUserMedia -

so i'm working on app uses webrtc , i'm @ point want bang head against table. i'm having issue getusermedia, returns permissiondeniederror when run on phone (android 6.0.1). the app has these permissions set in androidmanifest.xml : <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.camera" /> <uses-permission android:name="android.permission.record_audio" /> <uses-permission android:name="android.permission.modify_audio_settings" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.access_wifi_state" /> the app request storage, camera , voice permissions on runtime , have installed cordova-diagnostic-plugin, verifies app has these permissions

omnet++ - veins/sumo "hello world" example explanation -

i have run veins/sumo "hello world" example successfully, digging code can basics before writing own scenario, problem can't find code responsible creating nodes (cars) , managing mobility (initial position...)? in advance. the veins default example use sumo flow insert cars in scenario, can see here , cars follow route0. start on edge "-39539626" , goes edge "-5445204#2" , going on. sumo can work trips , route (manually created or randomtrips.py) , stop point, read more here

asp.net - RadScriptManager and RadRotator -

i'm new code (telerik asp ajax) there guy not here anymore, can't ask him help.. there page simple questionary.. has been working on previous web server (based on iis windows 7). after built new pc installed win_7 , same iis, telerik version might freshier. .. there main page placeholder (ph) radscriptmanager. then, code, radrotator created , added control ph. .. during debugging everithing ok, can see how code creates elements, creates radrotator success, , created rotator passed ph container. '' @ end of way there no rotator visible @ page. .. , can't see it's references it's script on page well. it should that: <script src="http://some path/2016.3.914/rotator/radrotator.js" type="text/javascript"></script> but there no such state on final page. the iis set integrated mode, not classic. app under net4. why be? if question not clear, please, ask me clarification. well, sorry, forgot report answer..

swift - Trying to create a slideshow of images -

i trying make slideshow of images folder don't know how load images folder in order , display them onscreen. using nstimer switch pictures works if know filename each image. this program runs on mac. have tried nsfilemanager according other answers have found on stack overflow, couldn't them work. using nsimage load image onto view. you not need yourself. apple created (and more) ikimage kit. (read docs that.) here short part of image kit programming guide : a slideshow popular way consumers view digital images. ikslideshow class , ikslideshowdatasource protocol provide easy way application support slideshows of images . . .

opencv - Make an image contour black and white using open CV and Python -

i'm trying paint part of image black , white using opencv2 , python3. code i'm trying: (x, y, w, h) = cv2.boundingrect(c) cv2.rectangle(frame, (x,y), (x+w,y+h),0,0) sub_face = frame[y:y+h, x:x+w] # apply gaussian blur on new recangle image # sub_face = cv2.gaussianblur(sub_face,(9, 9), 30, bordertype = 0) sub_face = cv2.cvtcolor(sub_face, cv2.color_bgr2gray) # merge blurry rectangle our final image result_frame[y:y+sub_face.shape[0], x:x+sub_face.shape[1]] = sub_face when apply gaussianblur method, works properly, when try cvtcolor method fails message (on last line): not broadcast input array shape (268,182) shape (268,182,3). doing wrong? the c variable in first line contour (from motion detection). i'm new python , opencv. thanks! you trying assign single channel results cv2.cvtcolor call 3 channels @ once result_frame rgb / 3 channel image. wanting assign single channel 3 channels. 1 way cleanly exploit numpy broadcasting creating singleton

android - how to check the text in first two buttons equals to the text in third button -

here code .this doesn't work button1.gettext() + button2.gettext() == button3.gettext() use equals compare strings, try this, string button1text = button1.gettext().tostring(); string button2text = button2.gettext().tostring(); string button3text = button3.gettext().tostring(); if((button1text + button2text).equals(button3text)){ // strings equal } else { // strings not equal }

mongodb - Query mongo document to return all rows in a field -

for example, if have name field in mongo document person . in sql, query select name person; return names. equivalent in mongo? i thinking db.person.find(<<what fill here>>, {name: 1}); i trying retrieve names while using mongo console. an empty json object {} matches documents. db.person.find({}, {name: 1});

sql server - T-SQL INSERT into UNLESS -

i have following table: account | period | amount -------------------- | -------- | ------ umbrella corporation | 201601 | 100 umbrella corporation | 201602 | 50 umbrella corporation | 201608 | 100 acme inc | 201504 | 85 acme inc | 201504 | 90 acme inc | 201512 | 40 [period] plain text, represents date yyymm , may include yyymmdd too, purpose, ignore day. goal insert new row each unique combination of [account] , 12 possible time-periods each year (yyyymm). example -> if unique combination exists in table, nothing -> if unique combination not exist, insert new row account, period , amount (the amount being 0 newly inserted rows).   desired outcome account | period | amount -------------------- | -------- | ------ umbrella corporation | 201601 | 100 umbrella corporation | 201602 | 100 umbrella corporation | 201603 | 0 umbrella corporation | 201604 |

Python development on private network--no pip -

the company work has taken measures make our assets more secure. such, use computer on private network has no access internet. developing python software in environment difficult @ times. cannot pip install anything. downloading, copying, , installing packages locally option have found , hit-and-miss dependencies constant , recursive issue. looking better solution. hope find this: a tool allow setting environment on machine internet access , copying environment isolated machine. a tool allow specifying package , pack , of dependencies download. some other clever solution. has solved this? you can install devpi in server, there can host pypi packages or upload own. it's compatible pip, won't break workflow, need point pip.conf use local devpi

c++ - c++03 Initializing a array of objects with multiple parameters -

this might simple question trying initialize array of objects using parameterized constructor. example: class a{ public: int b,c,d; (int i, int j); }; void a::a(int i, int j){ d = rand() b = 2*i; c = 3*j; } void main(){ a[50]; /*initialize 50 objects using constructor*/ } i have tried vector initialization mentioned in this link however, since there 2 parameters, not work. also, mentioned in link , not possible , tedious manually enter 50 initialization values. is there easier way. also, i,j values same objects (available through main()) d should random value , differs each object. you can use std::generate example: a generator(){ return a(1,2); } std::generate( a, + (sizeof(a) / sizeof(a[0])), generator );

javascript - SVG mobile orientation change -

i'm working on svg , far well, except 1 issue. normally, in absence of width/height attributes on root element, svg scale fill viewport. however on mobile, notice changing orientation breaks functionality. when rotating portrait landscape, original screen width becomes width of viewport , svg goes way off bottom. rotating gives opposite problem, resulting in small svg. this not happen on desktop, when resizing browser window - svg correctly adjusts scale fills available space. how can force svg scale recalculate correctly when screen orientation changes? the issue has been resolved forcing redraw. can done performing operation causes svg change somehow, if "change" no-op. in case... window.addeventlistener('resize',function() { svg.setattribute("x",0); }); ... worked fine.

TestNG in Eclipse, Reference to undefined variable env.DOMAIN_PATH -

Image
i got error when try run unit test in eclipse testng, error message is: reference undefined variable env.domain_path but problem not exist when run in intellj or maven. any 1 experience problem? i use eclipse mars.2 release (4.5.2), , updated testng plugin version 6.9.12.201607091356 thanks. when trying run testng, got same error. changed preferences in eclipse testng -> maven systempropertyvariables , environmentvariables unchecked, , able run test cases successfully. before after

c# - How to change the text of a button on clicking it in UNITY? -

Image
i want change text of button on clicking in unity. new c#. kindly me out! the script added button element using unityengine; using system.collections; using unityengine.ui; public class buttontextchange : monobehaviour { text buy; // use initialization void start () { buy = transform.findchild("text").getcomponent<text>(); } // update called once per frame void update () { } public void clicked() { debug.log("button buy clicked!"); buy.text = "i button!"; } } i have tried lot of answers not working out me! have button inside canvas. appreciated ! your problem comes setup of text , buttons. the buttontextchange component on buttontext object. can see on picture object has no child. run: void start () { buy = transform.findchild("text").getcomponent<text>(); } which getting error. text object under button object pass in onclick call. public class buttontextchange : mono

c# - Is it possible to access the PPSONE data with the DI SDK from SAP B1? -

i try write sowftware production can confirm material items. when want production order key, can't find po. if same thing business partner, works. use pps 1 addon sap b1, there problem? not possible access data addon or have change? sapbobscom.businesspartners vbp = connection.company.getbusinessobject(sapbobscom.boobjecttypes.obusinesspartners); sapbobscom.productionorders vpo = connection.company.getbusinessobject(sapbobscom.boobjecttypes.oproductionorders); if(vbp.getbykey("l22437")) { writelogline("name: " + vbp.cardname); // works, name! } else { writelogline("no matching customer record found!"); } if (vpo.getbykey(anykey)) // tried lot of keys, no 1 worked { writelogline(vpo.getasxml()); } else { writelogline("no matching production order record found!"); } there weird thing, in sap gui po displayed work orders, coresponding table in db @ppsone_prdorders. works neither if change sapbobscom.productionorders sapbobscom.wor

i was doing php forms , and the else statement is only being ouputed -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 22 answers here code - dont problem is... my form: <form action="process1.php" method="post" > first name : <input type="text" name="first name" value="" /> password : <input type="password" name="pasword" value= "" /> <br/> <input type="submit" name="submit" value="submit" /> </form> process1.php <?php $users = array("abhishek","alan" ); # doing limit users if (firstname == $users ){ $firstname = $_post['firstname']; $password = $_post[ 'password']; echo "$firstname" . "and"

ios - Different types of closure syntax in swift - which one is correct? -

i'm pretty curious 1 of these syntax statements (more) correct. playground happily compiles both cases. method 1 // copied , appears clear me uiview.animate( withduration: 3.0, animations: { }, completion: { (bool) in // completion code } ) method 2 uiview.animate( withduration: 3.0, animations: { // code }) {(bool) in // code when finished? // argument label completion missing? } why rounded brackets in 2nd method closed before last argument stated? or implementation of uiview.animation ? the difference between both methods following: method 1: regular closure method 2: trailing closure . last closure parameter in signature of function can written in shorter syntax . if second parameter completion , , animations parameter last, trailing closure apply animations etc. has stand last (or only) closure parameter. if miss completion label, free type this: uiview.animate(withduration

sql server 2008 - Half of Classic ASP page works great, 2nd half gives SQL connection error -

please help! i moving classic asp & asp.net website 1 server another, , 1 of reports works fine on old server partially working on new server. can please tell me: if there might preventing successful connection sql server. if there else involved in than: connection string asp page dll my server environment: windows server 2008 r2 sql express 2008 iis7 connection details: the classic asp pages of website connect using sql connection string located in registry. other classic asp pages on website working fine....and first half of report working fine. i have tested connection string individually, , connects properly. report structure details: the first half of report (that working correctly) loads data directly table in database display each item in list format. uses employees table populate employee name each item in list. the second half of report (that not working) loads data same table first half. however, groups them manager (manager details

ruby on rails - Should I use integer or string to declare this attribute? -

i'm building app ruby on rails mesure demographic variables. right now, have doubt how declare type of data 2 attributes of model (stats) belongs users model. attributes "genere" , "civil status". know elements string data if pretend make statistics info, would more convenient declare data integer? , say, nominative data in statistic number enough represent status or genere, ie. 1 -> femenin / 2 -> masculin. i'll appreciate advice. time. enums integer bitmasks way attributes there definite amount of choices , add/removing options developer level concern. class person < applicationrecord enum gender: [:undisclosed, :male, :female, :other] end this store gender in integer column values 0-3. column faster scan , index string column. it saves hassle of whitelisting acceptable string values , writing scopes based on value. you can person.female scope.

variables - PHP if $var null then return $var2 -

i havent been able find answer this: my code works this: echo ' <p> '.$test2.'</p> '; i want make $test2 change if null have tried following code , bunch of other , breaks page $test2 = if(empty($price)){ return $pstatus}; any apprteciated update have modified code, returns price if price empty returning nothing when should return $pstatus so $price 625000 variable empty should return sold $pstatus variable $price = number_format($p->meta_box->real_homes_property_price); $fimage = $p->better_featured_image->media_details->sizes->medium->source_url; $ptitle = $p->title->rendered; $pdesc = $p->excerpt->rendered; $plink = $p->link; $pstatus = $p->pure_taxonomies->{"property-status"}[0]->name; $test2 = $pstatus ? $price : $test2; you can inline: $test2 = $price ? $pstatus : $test2; if need assign "$price" "$test2" , if there no price assign "$pstatus

javascript - Do logic on data after post -

i'm building exam app. tutor makes exam , student answer exam. want show result exam after student has posted answer. use express , mongodb. when show result exam + answer of student. mean multiple choice, show answer if student took bad 1 , need show when good. i thinking make middleware 1 correction , post result document. do have other strategies how can handle this? you don't need middleware that. need redirect user result page student id. since know student id , answers, can render result page according answers have submitted.

javascript - Marionette.js - Uncaught ReferenceError: text is not defined -

i wonder if can find what's wrong in case. "uncaught referenceerror: text not defined" in line 6 app.js: ((__t=( text ))==null?'':_.escape(__t))+ driver.js: var marionette = require('backbone.marionette'); var todoview = require('./views/layout'); var initialdata = { items: [ {assignee: 'scott', text: 'write book marionette'}, {assignee: 'andrew', text: 'do coding'} ] }; var app = new marionette.application({ onstart: function(options) { var todo = new todoview({ collection: new backbone.collection(options.initialdata.items), model: new todomodel() }); todo.render(); todo.triggermethod('show'); } }); app.start({initialdata: initialdata}); views/layout.js var backbone = require('backbone'); var marionette = require('backbone.marionette'); var todomodel = require('../models/todo'); var formview = require('./form'); va

css - Why does bootstrap have two fonts in Sass? -

i change default font bootstrap sass , found this: //== typography // //## font, line-height, , color body text, headings, , more. $font-family-sans-serif: "helvetica neue", helvetica, arial, sans-serif !default; $font-family-serif: georgia, "times new roman", times, serif !default; what's difference between sans-serif , serif in context? because if inspect page, fonts helvetica neue. how serif/georgia utilised if i'm seeing helvetica neue being used? those options change base style font if want serif or sans-serif. this: create 3 base styles: $font-family-sans-serif: "helvetica neue", helvetica, arial, sans-serif !default; $font-family-serif: georgia, "times new roman", times, serif !default; $font-family-monospace: menlo, monaco, consolas, "courier new", monospace !default; then set sans-serif on base var: $font-family-base: $font-family-sans-serif !default;

rest - Docker maven plugin -

docker plugin found (spotify/docker-maven-plugin) use native docker application, far understand docker rest api client "redirects" commands docker daemon process. it's true in case if use docker on windows machine , docker daemon works on linux in virtual box. so, docker-maven-plugin exist doesn't require native docker application , "talking" docker daemon without intermediaries? it doesn't require native docker application, knowing docker daemon is. docker-maven-plugin per documentation : by default plugin try connect docker on localhost:2375. set docker_host environment variable connect elsewhere. docker_host=tcp://<host>:2375 this how client knows docker daemon is. docker-maven-plugin respects (and other) docker environment variables know docker resides, whether native, in vm running on hypervisor virtualbox locally, or on remote server. docker machine if you're using docker machine, these environment var

CodenameOne InfiniteContainer Scrolling -

in simulator works well, in smartphone when scrolling down in infinitecontainer can see black flickering (probably related getting data server) can somehow prevent behaviour? thanks jb make sure code doesn't block fetch method long. needs fast. if need networking construct components make sure use addtoqueueandwait , process components correctly on event dispatch thread.

javascript - jhtmlarea not working inside updatepanel -

i have jhtmlarea textarea on form textarea id="txtdigital" name="txtdigital" class="form-control" style="background-color:white; resize: vertical !important; " rows="20" placeholder="details" runat="server"></textarea> which being set in javascript with: $(document).ready(function () { $(function () { $("#<%=this.txtdigital.clientid%>").htmlarea({ toolbar: [ ["bold", "italic", "underline", "strikethrough"], ["increasefontsize", "decreasefontsize", "forecolor"], ["orderedlist", "unorderedlist", "superscript", "subscript"], ["indent", "outdent", "justifyleft", "justifycenter", "justifyright"] ] });

php - How to resequence the AUTO_INCREMENT id in MySQL after deleting few records? -

i have table 3000 entries. randomly choosing 25 of shifted table. once done, want ids (which assigned auto_increment , primary key) in original table in sequence, perform next iteration. how should it? we cannot change auto_increment value value other current max value.auto_increment counter keeps on incrementing value used column defined. the other way change value above current max value manually alter value of auto_increment counter max(value) +1. so guess here have order records in ascending existing id after deleting 25 records , manually set id value of each record according incrementing variable , in end set auto_increment count value value of variable in end +1. sample : alter table t set auto_increment=some_value; though advised leave auto_increment alone , avoid if it's done sake of making ids great , there no other probable reason.

xcode - iOS button design -

Image
what best way design custom buttons , using them within xcode. want them not random buttons. should button apple themselves. you can use uibutton , can set easily: background color, background image font type, font color round corner dimensions dynamics right constraints what kind of button want make? see this link basic tutorial meantime.

php - Authorize users based on roles in CakePHP 3 -

i authorize users based on few roles. visitors should able reach method show. wrote in appcontroller: public function beforefilter(event $event) { $this->auth->allow(['show']); } it works. in initialize() method of appcontroller i've got also: $this->loadcomponent('auth', [ 'authorize' => 'controller' ]); i allow logged users role "user" reach "index", , "add" methods, wrote in appcontroller: public function isauthorized($user) { if (isset($user['role']) && $user['role'] === 'admin') { return true; } if (isset($user['role']) && $user['role'] === 'user') { $this->auth->allow(['index', 'logout', 'add']); } return false; } admin can reach methods expected. user logged role "user" can't reach "index" or "add" method. how can fix this? instead of using

Jboss/Wildfly Logging to Separate Files -

we have deployed 2 ears both same package file structure. possible wildfly log info 2 separate log files whereby each ear has own logging information? if so, how configure in config file? yes possible log information on separate files in wildlfy. need define multiple logging profiles on wildfly configuration file. create new logger profile either using jboss cli or directly updating standalone.xml file. open standalone.xml file , update following section, <subsystem xmlns="urn:jboss:domain:logging:3.0"> and update section like, <logging-profiles> <logging-profile name="accounts-app-profile"> <console-handler name="console"> <level name="info"/> <formatter> <named-formatter name="color-pattern"/> </formatter> </console-handler> <periodic-rotating-file-handler name="file&

css - Increase element's order through a SASS variable -

i'm looking best method in sass iterate class's order go 1 every 4 item. came following gets result wanted, comes lot of perhaps unnecessary markup. @for $i 1 through 3 { &:nth-child(#{$i}) { order: 3; background: green; } } @for $i 4 through 6 { &:nth-child(#{$i}) { order: 1; background: blue; } } @for $i 7 through 9 { &:nth-child(#{$i}) { order: 2; background: red; } } full example of code working on codepen is there better way missing? this you're asking single loop , math. there's more efficient way, come with: .box { @for $i 0 through 9 { $c : $i + 1; &:nth-child(#{$c}) { order: (($i - $i % 3) / 3) + 1; } } } outputs: .box:nth-child(1) { order: 1; } .box:nth-child(2) { order: 1; } .box:nth-child(3) { order: 1; } .box:nth-child(4) { order: 2; } .box:nth-child(5) { order: 2; } .box:nth-child(6) { order: 2; } .box:nth-child(7)

html - Make notification bar slide up from the bottom -

i have small horizontal notification bar slides bottom of page. it comes fine, when open page flashes, disappears , slides up. how modify doesn't appear/disappear before transition takes place? #notificationbarbottom { position: fixed; z-index: 101; bottom: 0; left: 0; right: 0; background: #5cb85c; color: #ffffff; text-align: center; line-height: 2.5; overflow: hidden; -webkit-box-shadow: 0 0 5px black; -moz-box-shadow: 0 0 5px black; box-shadow: 0 0 5px black; } @-webkit-keyframes slidedown { 0%, 100% { -webkit-transform: translatey(0px); } 10%, 90% { -webkit-transform: translatey(510px); } } @-moz-keyframes slidedown { 0%, 100% { -moz-transform: translatey(0px); } 10%, 90% { -moz-transform: translatey(510px); } } .cssanimations.csstransforms #notificationbarbottom { -webkit-transform: translatey(510px); -webkit-animation: slidedown 2.5s 1.0s 1 ease forwards; -moz

javascript - Assigning classes or ids to button created dynamically using jquery -

i creating several buttons dynamically. trying assign each on different class or id when clicked on have different output. how add value @ end of each class or id name give each button unique class or id name? here code socket.on('usernames', function(data){ var $contentwrap = $("#contentwrap").empty(); for(i=0; <data.length; i++){ $input = $('<input type="button" style="width:200px" class= "button"/></br>'); $input.val(data[i]); $input.appendto($("#contentwrap")); } }); can created on click event button created. far created on click even, works first button. here code $(document.body).on('click','.button', function(e) { console.log($('.button').val()); }); use $(this).val() instead of $('.button').val() . this refer clicked button. $(document.body).on('click','.button', function(e) { con