Posts

Showing posts from August, 2012

linux - Is it necessary to write a "portable" if (c == '\n') to process cross-platform files? -

this thinking comes discussion practical problem replacing multiple new lines in file one . wrong happened while using cygwin terminal running on windows 8.1 machine. since end-of-line terminator different, \n , \r , or \r\n , necessary write "portable" if(c=='\n') make work on linux, windows , os x? or, the best practise convert file commands/tools? #include <stdio.h> int main () { file * pfile; int c; int n = 0; pfile=fopen ("myfile.txt","r"); if (pfile==null) perror ("error opening file"); else { { c = fgetc (pfile); if (c == '\n') n++; // work fine under different platform? } while (c != eof); fclose (pfile); printf ("the file contains %d lines.\n",n); } return 0; } update1: crt convert line endings '\n'? if input file opened in binary mode (the character 'b...

ios - swift animate all added views alpha -

i want animate views (based on tag) alpha change, getting "cannot assign alpha view" error. way this? all views have alpha of 0 upon being added subview of mycustomview func transitioneffects() { uiview.animatewithduration(0.5, animations: { view in self.mycustomview.subviews { if(view.tag != 999) { view.alpha = 1 } } }) } this because swift needs know kind of objects inside subviews nsarray before sending methods. nsarray automatically converted in swift array of anytype objects, doesn't know kind of objects extracted array. casting array array of uiview s objects should work fine. func transitioneffects() { uiview.animatewithduration(0.5, animations: { view in self.mycustomview.subviews [uiview] { if(view.tag != 999) { view.alpha = 1 } } }) }

asp.net mvc - How to achieve edit functionality in @Html.DropDownListFor? -

is possible have edit option in @html.dropdownlistfor in mvc3 can trigger autocomplete event(if exists) . have requirement type , filter contents of @html.dropdownlistfor i'm looking http://www.oanda.com/currency/converter/ functionality

c++ - Is it really efficient to use Karatsuba algorithm in 64-bit x 64-bit multiplication? -

i work on avx2 , need calculate 64-bit x64-bit -> 128-bit widening multiplication , got 64-bit high part in fastest manner. since avx2 has not such instruction, reasonable me use karatsuba algorithm efficiency , gaining speed? no. on modern architectures crossover @ karatsuba beats schoolbook multiplication somewhere between 8 , 24 machine words (e.g. between 512 , 1536 bits on x86_64). fixed sizes, threshold @ smaller end of range, , new adcx/adox instructions bring in further scalar code, 64x64 still small benefit karatsuba.

automated tests - Want to know info on skills required to be good a QA tester and on Selenium -

i embedded c/c++ developer 4 years. thinking shift career testing field. helpful if give me complete set of skills 3+ years of experienced selenium/qa tester would/should know. p.s: know needs lot of hands-on experience expertise in field prepared myself professional before entering testing field. please suggest! selenium uses different types of bindings, can choose language best suites you. java seems popular if hands on java, learning selenium not take long api need master. oh having javascript/css/xpath knowledge regardless of whichever binding use. use .net content java , quite easy convert java .net anyways. see link resources: https://github.com/atinfo/awesome-test-automation . helpful

python - Is there a way to use os.walk function to go through a user's files from a website built on django? -

i want this, user have browse desired folder. rootdir = "/browsed/folder" # iterate root directory recursively using os.walk root, subfolders, files in os.walk(rootdir): file in files: fname = os.path.join(root, file)

objective c - How to check if (id) object is null in ios? -

Image
i have made function consume webservices , want check if (id) object null or not. doing here: -(void)callservice:(nsstring*)request param:(nsstring*) parameters completion:(void (^)(nsarray *list, nserror *error))completionhandler { [self.manager post:request parameters:parameters success:^(nsurlsessiondatatask *task, id responseobject) { nslog(@"response object: %@", responseobject); if (![responseobject iskindofclass:[nsnull class]]) { [self methodusingjsonfromsuccessblock:responseobject]; if (completionhandler) { //nslog(@"%@", list); completionhandler(list,nil); } } else { nslog(@"nothing found"); } }failure:^(nsurlsessiondatatask *task, nserror *error) { //nslog(@"error: %@", [error description]); if (completionhandler) { completionhandler(nil,error); } }]; } but ...

angularjs - External json parser before the hearing is visible -

i want external json before view visible , active, $ http.get not work until view visible. i'm dealing $ ionicview.beforeenter $scope.$on('$ionicview.beforeenter', function () { var value = window.localstorage.getitem("url_id"); var values = value.split("//"); $scope.url_id = values[1]; $http.get(categoriadatos.local + $scope.url_id).then(function (resp) { $scope.local = resp.data; }, function (err) { console.error('err', err); }) }); once view active , visible method works , gets data.

linux - How to index text files to improve grep time -

i have large number of text files need grep through on regular basis. there ~230,000 files amounting around 15gb of data. i've read following threads: how use grep efficiently? how use grep large (millions) number of files search string , result in few minutes the machine i'll grepping on intel core i3 (i.e. dual-core), can't parallelize great extent. machine running ubuntu , i'd prefer via command line. instead of running bog-standard grep each time, there way can either index or tag contents of text files improve searching? have tried ag replacement grep? should in ubuntu repositories. had similar problem yours, , ag faster grep regex searches. there differences in syntax , features, matter if had special grep-specific needs.

html - Is position:absolute always counted from the top of the page? -

if make element inside , give properties position:absolute;top:10px; count 10px top of page , not inside . is normal or should use instead position:relative; or something? thanks answers! absolute not related border of page. if take example: <div class="box1" style="position:relative;"> <div class="box2" style="position:absolute;top:5;"></div> </div> the position of box2 dependent on position of box1.

android - How to deal with etc1 alpha channel -

i'm trying support etc1 android game have no idea how deal alpha channel. can tell me start , how etc1 working alpha? update: using: gl_fragcolor = vec4(tex1.rgb,tex2.a); doesn't work, there still black rectangle around texture you need alphamask shader. basically instead of having 1 texture full color information including transparency, have 1 texture rgb (etc1) , 1 texture alpha (can etc1). then in fragment shader, assign rgb first texture , alpha 2nd. gl_fragcolor = vec4(tex1.rgb,tex2.a); !note code above exeplifying approach, syntax might wrong.

python - Using docker environment -e variable in supervisor -

i've been trying pass in environment variable docker container via -e option. variable meant used in supervisor script within container. unfortunately, variable not resolved (i.e. stay instance $instancename ). tried ${var} , "${var}" , didn't either. there can or not possible? the docker run command: sudo docker run -d -e "instancename=instance-1" -e "foo=2" -v /var/app/tmp:/var/app/tmp -t myrepos/app:tag and supervisor file: [program:app] command=python test.py --param1=$foo stderr_logfile=/var/app/log/$instancename.log directory=/var/app autostart=true the variable being passed container, supervisor doesn't let use environment variables inside configuration files. you should review supervisor documentation , , parts string expressions. example, command option: note value of command may include python string expressions, e.g. /path/to/programname --port=80%(process_num)02d might expand /path/to/programname --p...

objective c - iOS: Global property variable not being set even when value is passed to it -

i have set of code parses xml file find user id number. id number sent view controller soap wsdl request. problem value never set. my 2 classes loginpageviewcontroller , emimenutableviewcontroller. i trying pass integer value loginpageviewcontroller emimenutableviewcontroller. here header file emimenutableviewcontroller: #import <uikit/uikit.h> @interface emimenutableviewcontroller : uitableviewcontroller @property (nonatomic) int usernumber; @end here header file loginpageviewcontroller: #import <uikit/uikit.h> @interface loginpageviewcontroller : uiviewcontroller <nsxmlparserdelegate> { nsxmlparser *xmlparser; nsstring *classelement; nsmutablearray *titarry; nsmutablearray *linkarray; bool itemselected; nsmutablestring *mutttitle; nsmutablestring *mutstrlink; int usernumber; nsstring *parsedstring; } // username , password text fields @property (weak, nonatomic) iboutlet uitextfield *usernametextfield; @propert...

Internal structure differance between excel created with Interop and OpenXMLSDK -

i know if there internal structure differance between excel created microsoft office interop excel (interop) , microsoft openxmlsdk ( openxmlsdk )? i working third party application rejects excels created openxmlsdk , accepts excels created interop. to compare can download open xml sdk productivity tool , use compare feature. allow take 2 excel files , compare internal xml see if there differences. another option if can't tool installed rename file in question .zip file , examine contents way. there amount of files in zip, should able compare files using compare tool on web windiff.

nesting varstatus into var as index for method in jstl foreach -

is there way use varstatus index (integer param) var's method in jstl foreach loop in jsp pages? i want this: <c:foreach items="${pizza1.getfeltetlist()}" var="aktpizza" varstatus="index" > <tr> <td>${index.index+1}</td> <td>${aktpizza.nev}</td> <td>${aktpizza.ar}</td> <td><a href="/pizzaordermvc/add/${aktpizza.getafeltet(${index.index+1})}">add</a></td> </tr> </c:foreach> so getafeltet(int i) method requires int parameter , want pass actual index of varstatus. other fields above populated correctly. should correct syntax achieve this? you can't , don't need nest ${...} in each other. have one. <a href="/pizzaordermvc/add/${aktpizza.getafeltet(index.index+1)}">add</a>

c++ - Search UITableView without Search Bar -

how can search uitableview without using search bar function (i.e. want code search through , return answer?) @ indexrow result sits within tableview . i think answer uisearchcontroller ... thanks worked out: [nsindexpath indexpathforrow:[objectsaray indexofobject:objetc] insection:0] this return indexpath of row of object from array used build tableview if have 1 section (0)...

php - Could not handle ?university dbpedia-owl:count in ARC2 -

i'm using simple sparql query list of universities selected country. , of sparql code select ?name ?type { ?university <http://schema.org/collegeoruniversity> { ?university dbpedia-owl:country dbpedia:france } union { ?university dbpprop:country dbpedia:france } optional { ?university dbpprop:name ?name . filter (langmatches(lang(?name), 'fr')) } optional { ?university dbpedia-owl:type ?type } to show result in php side, i'm using arc2 library use php query sparql endpoints , generate html pages. steps doc ok. here full php code sparql query server side: <html> <body> <?php include_once('semsol/arc2.php'); /* arc2 static class inclusion */ $dbpconfig = array( "remote_store_endpoint" => "http://dbpedia.org/sparql", ); $store = arc2::getremotestore($dbpconfig); if ($errs = $s...

asp.net mvc - IIS 8 block request by JSON payload fields -

i have mvc.net 4 web server accepts http post request json formatted string request data. add rule in iis level before request hits server, block request regex on json string. possible? i think creating , adding custom http module can solve problem. http module called on every request in response beginrequest , endrequest events.

c++ - BSTR memory leak in atldbsch.h - what to do? -

i running deleaker application find , fix memory leaks in application. now, finds lot of bstr leaks roots in open()-function of microsoft crestrictions class (atldbsch.h file). if 1 looks there 1 can notice takes 7 lpctstr parameters, used this: pvariant = m_pvarrestrictions + 1; . . pvariant->bstrval = ::sysallocstring(t2cole_ex_def(lpszparam1)); this done 7 such parameters (where number 1 increased every time). the destructor doing delete[] m_pvarrestrictions; but bstrs allocated via ::sysallocstring() never freed though via calls ::sysfreestr() am missing or there leak, , in case how should handled in case? according https://github.com/dpalma/sge/blob/master/3rdparty/atl/atldbsch.h , m_pvarrestrictions defined atl::ccomvariant * , atl::ccomvariant destructor should cleaning bstr variants (the code correctly setting vt vt_bstr ). is, ccomvariant destructor calls ccomvariant::clear calls variantclear . thus, there should not memory leak here -- co...

Selenium Webdriver -- No such Element -

i trying login sears.com using selenium webdriver.clicked on sign in link-->login form opens. but unable locate text box element inside login form. login form inside iframe ( frame name =easyxdm_default5914_provider ).this iframe inside div (id=modaliframe) driver.switchto().frame(driver.findelement(by.xpath(".//iframe[@id='easyxdm_default5914_provider']"))); driver.switchto().activeelement(); driver.findelement(by.id("email")).sendkeys("xxx@gmail.com"); getting below exception in console: org.openqa.selenium.nosuchelementexception: unable locate element: {"method":"id","selector":"email"} try below code. driver.get("http://www.sears.com/"); driver.findelement(by.xpath("//*[@id='header-shop-your-way-partner']")).click(); driver.findelement(by.xpath("//*[@id='open-sign-in-form']/span[2]")).click(); driver.switchto().frame("reg...

iphone - ios swift How to add images to navigationbar that are not in the center/titleview? -

in swift, how add icon navigation bar on side instead of middle? want slack search icon having appear next right menu icon, see picture here: https://static-s.aa-cdn.net/img/ios/618783545/1b2dca063c580767bf28c885e22c61bc i not want icon in center of navigation bar title view property, people do. how have icon appear next right menu? thanks. i have not tried swift yet works on objective-c. can add multiple items right passing array of uibarbuttonitems [self.navigationitem setrightbarbuttonitems:]

sql - Displaying data from multiple tables in Oracle 11g -

question i want display combination of data different tables. in case combinations of food , drink, have not been ordered far. my database tables customer_order orderno(pk) dateord datereq address o00001 03-apr-11 07-apr-11 union st o00002 05-apr-11 01-may-11 st. andrew st. o00003 12-apr-11 27-apr-11 garthdee o00004 12-apr-11 17-apr-11 union st. dish dishid(pk) dishname vegetarian price d0001 pasta bake yes 6.00 d0002 fish pie no 9.00 d0003 steak , chips no 14.00 d0004 stuffed peppers yes 11.50 d0005 ham , rice no 7.25 d0006 lamb curry no 8.50 drink drinkid(pk) drinkname drinktype price dr0001 water soft 1.00 dr0002 coffee hot 1.70 dr0003 wine alcoholic 3.00 dr0004 beer alcoholic 2.30 dr0005 tea hot ...

php - How to get a Thumbnail from a Video on Azure Media Services? -

i start new azure , azure php sdk because i'm php developer. azure php sdk, can store video , video url. want know how create video thumbnails azure. don't know how do. to create thumbnail should create job usual setting thumbnail xml via setconfiguration . this untested code should work. // sets thumbnail configuration $thumbnailconfig = <<<eot <?xml version="1.0" encoding="utf-8"?> <thumbnail size="50%,*" type="jpeg" filename="{originalfilename}_{size}_{thumbnailtime}_{thumbnailindex}_{date}_{time}.{defaultextension}"> <time value="10%"/> </thumbnail> eot; $xmltask = '<taskbody><inputasset>jobinputasset(0)</inputasset>' . '<outputasset>joboutputasset(0)</outputasset></taskbody>'; $mediaprocessor = $restproxy->getlatestmediaprocessor('azure media encoder'); $task = new task($xmltask, $mediap...

django - Error decodin signature JWT authentication Android -

i'm using django rest_framework , activated jsonwebtokenauthentication . seems work fine when post login user token. if validate token in jwt.io signature validated. when send or post endpoint in server , in header put "authorization: jwt " following. 06-26 12:20:58.832 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ authorization: jwt {token:<token>} 06-26 12:20:58.842 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ ---> end http (no body) 06-26 12:20:59.322 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ : http/1.0 403 forbidden 06-26 12:20:59.332 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ allow: get, post, head, options 06-26 12:20:59.332 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ content-type: application/json 06-26 12:20:59.332 5293-7833/com.infortec.angel.montalbanwebser d/retrofit﹕ date: fri, 26 jun 2015 10:19:34 gmt 06-26 12:20:59.332 5293-7833/com.infortec.angel.montalb...

php - Laravel and Bootstrap - Form with no action still sending data -

i'm working on laravel site built else , 1 of pages has form on doesn't have action or obvious location data gets sent to, yet still sends data back-end. the form below found on portal.blade.php - can't find in there resembling form:: if delete classes 'inspiring' & 'submit' submit button form stops working. live page: http://amazingyou.bravissimo.com/about <!-- modal --> <div class="inspiring modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"> <span aria-hidden="true">&times;</span> ...

c# - Is there a "right" way to abstract out my code? -

i have been developing in c# around 12 months (from scratch, no previous dev experience apart little bit of php script hacking) , think have developed skills level can write app , perform function perfectly. however, still little confused best coding practises, understand code bad: class example1 { public static alert generatealert() { alert alertobject = new alert(); alertobject.alertdatetime = datetime.now; alertobject.alerthasrecords = false; return alertobject; } } if example alertdatetime requires more simple line datetime.now; end bulking out massive function. not good! however, cant see problem following 2 examples (i favour example 2) class example2 { public static alert alertobject = new alert(); public static alert generatealert() { populatealertdate(); checkforalertrecords(); return alertobject; } private static void checkforalertrecords() { alertobject.a...

app store - At what point will I have any revenue money using iAd banners? -

i have app has been on app store around 2 weeks , has 170 downloads far. using iad banners , have friends have clicked on banner , says have made $0 far, @ point change ? possible apple has error or have made error? well, first of depends if have set iad correctly , linked account , enrolled in iad contract. if did link , have agreed contract apple iad, may not revenue them. iad works on cpm basis, cost per mille means advertiser pays per 1000 impressions or clicks. have have way more "few clicks friends" start earning actual revenue. also, friends pressing banners against iad rules , terms , banned, highly advise against it. lastly, should check if following apple: 1) linked code custom identifier apple 2) signed iad worldwide contract apple 3) set correctly if made have wait , earn more start earning. hope helps, julian

Why do I not get a formated date with this javascript-script? -

i new javascript, maybe missed obvious. i have following script (see some other answer ): <script> var d = new date(); document.getelementbyid("demo").innerhtml = d.tolocaleformat("dd.mm.yyyy"); </script> which want use create formatted date in jacasvript. if date today (26 june 2015) expect script produce following string: 26.06.2015 however, following: dd.mm.yyyy is other answer wrong? how can formatted date without library ? i tried use parse or format instead without success. try code: <script> var d = new date(); document.getelementbyid("demo").innerhtml = d.tolocaleformat("%d.%m.%y"); </script>

java - Insertion Sort algorithm not working as expected -

my insertion sort code is: class insertionsort { public static void main(string s[]) { int []a={12,5,8,87,55,4}; int []r=sort(a); for(int i=0;i<a.length;i++) { system.out.println(r[i]); } } static int[] sort(int a[]) { int key,i,j; for(j=1;j<a.length;j++) { key=a[j]; i=j-1; while(i>=0 && a[j]<a[i]) { a[j]=a[i]; i--; } a[i+1]=key; } return a; } } but result not correct. however, if replace a[j] key in while loop condition , a[j] a[i+1] in while loop body, code generates correct result. there difference between a[j] , key , a[j] , a[i+1] ? correct code: static void sort(int a[]) { for(int j = 1; j < a.length; j++) { int key = a[j]; int = j; while(i > 0 &...

javascript - different data in different json file. How to load them -

i have 2 different json files ( marker.json , marker.json0 ) contain different coordinates(latitude , longitude) , need load them renaming .json0 .json (and former .json .json0 ) different data contained in former .json0 .json parsed in javascript file handles ajax request causes markers , infowindow displayed on map. this javascript file handles asyncronous loading of json array. there 2 functions search , remove. both of them fired whenever user click "cerca" or "cancella" button purpose different. searchaddress parses json array inside loop markers , infowindow visible while removeaddress deletes them map, need click "cerca" button again recreate markers , infowindow time belong new json file on webserver renamed .json extension used in js file. last edit builds function handle ajax request , @ end of code load both of json files still markers go on same coords. have deleted global variables , have tried use arguments d...

python - Organize Data that is Callable to Hovertool -

i'm confused how make hover tool call 2 main variables of stacked bar plot. my pivot_table below. company names first column, , months along top row. number number of calls in month each customer. pivot_table.head(2) out[4]: month 1 2 3 4 5 6 7 8 9 10 11 companyname company1 17 30 29 39 15 27 23 12 36 21 18 company2 4 11 13 22 34 27 16 18 29 31 17 month 12 companyname company1 15 company2 14 here code # months jan = pivot_table[1].astype(float).values feb = pivot_table[2].astype(float).values mar = pivot_table[3].astype(float).values apr = pivot_table[4].astype(float).values may = pivot_table[5].astype(float).values jun = pivot_table[6].astype(float).values jul = pivot_table[7].astype(float).values aug = pivot_table[8].astype(float).values sep = pivo...

python - How should a Twisted AMP Deferred be cancelled? -

i have twisted client/server application client asks multiple servers additional work done using amp. first server respond client wins -- other outstanding client requests should cancelled. deferred objects support cancel() , cancellor function may passed deferred 's constructor. however, amp's sendremote() api doesn't support passing cancellor function. additionally, i'd want cancellor function not stop local request processing upon completion remove request remote server. amp's boxdispatcher have stopreceivingboxes method, causes deferreds error out (not quite want). is there way cancel amp requests? no. there no way, presently, cancel amp request. you can't cancel amp requests because there no way defined in amp @ wire-protocol level send message remote server telling stop processing. interesting feature-addition amp, if added, not add allowing users pass in own cancellers; rather, amp have create cancellation function sent "c...

php - Initialize WordPress environment in a script to be run by a cron job -

i have run custom php script want run cron job. within script, need wordpress functions insert users wordpress table. script on root directory of wordpress installation. script starting with: require( dirname( __file__ ) . '/wp-load.php' ); if run script directly in browser functions , else works no errors. when cron hits apparently not work. nothing supposed happen happens. just if helps, command line is: php -q /home/enkaizene/public_html/soporte/cron-test.php is issue script? or command? how should script start? thank you you run cron using wget web address. wget -o /dev/null http://www.example.com/cron-test.php you limited php timeout need make sure script doesn't run longer set timeout - or increase timeout.

Rails Performance Profile Reports 0 MB -

i'm experiencing unexpected behavior when try performance testing. it's reporting 0 mb memory though millions of objects created in run. while profiler running, activity monitor reporting memory usage in 100s of mb. here details local environment: os: mac os 10.9.5 hardware: macbook air ruby: 2.2.2 (rvm) rails: 4.1.11 using rails-perftest & ruby-prof gems any idea why i'm seeing 0 memory usage? $ rails_env=development perftest profiler 'queue.last.refill' -m process_time,memory,objects,gc_runs,gc_time run options: --seed 30468 # running: profilertest#test_queue_last_refill (10.00 sec warmup) process_time: 62.34 sec memory: 0 bytes objects: 3,903,787 gc_runs: 3 gc_time: 0 ms . finished in 239.965591s, 0.0042 runs/s, 0.0000 assertions/s. you need gc patched mri. need require ruby-prof. check documentation here: http://guides.rubyonrails.org/v3.2.13/performance_testing.html#i...

Deploy images TeamCity Octopus without Git -

hi have site in git using team city , octopus deployment. the issue have have thousands of images on dev environment need go staging. dont want check git. best way of automating step without adding git. using teamcity , octopus website deployment @ moment.

java - Cannot get elements from Vector from other class (Thread) -

i have class (my server start class), here create every new client new thread him. after thread createt, add him vector (list) keep track of active users , connections, can send messages specific user. cant access vector-list thread (its class below). can explain me, how can this? have private list , public setter , getter methods size 1 vector. testet it, if connect more 1 client there multiple threads different socket creates. can add entrys vector if manuel in server start class. package securemessageserver; public class securemessageserver { private vector<securemessageserverclientthread> userlist = new vector(); private sslserversocket sslserversocket; int port = 9999; private boolean isrunning=true; sslsocket sslsocket; private synchronized void loadcertificat(){ try { url url = this.getclass().getresource("/securemessageserver/keystore.jks"); file file = new file(url.touri()); system.setproperty("javax.net.ssl.keystore...

ios - How to implement a slide in/out menu on only a part of the viewcontroller in Swift? -

Image
i want implement slide menu indicated in picture bellow. after user presses button, want create animation slides label , image (1) right slides 2 images (2) in. i have far managed slide label , image (1) right using: self.mylabel.center.x -= self.view.bounds.width self.myimage.center.x -= self.view.bounds.width but can't find solution bring view #2 in ... i not looking specific code (although nice :) rather point me right direction. so, first put label , image inside own uiview make manipulating them easier (though don't know rest of ui maybe that's not idea). i think problem might not how slide them (as say, you've worked out how slide things about); self.mylabel2.center.x += self.view.bounds.width self.myimage2.center.x += self.view.bounds.width will it. is problem how position them off screen in first place? if want them end in same place initial label , image can use starting position guide. in viewdidload self.mylabel2.center.x...

sql - Why oracle DB does not update the fileds -

Image
i not know wrong query not give error , not update row. enddatetime field datatype timestamp. update test_bank set status = 'received', enddatetime = '16-jun-15 11.21.06.000000000' enddatetime = null ; i believe in oracle syntax checking null following enddatetime null instead of enddatetime = null

javascript - Sending data from an HTTPS page to a localhost server -

i wondering best way send data https webpage loaded in browser server running on localhost be. have solution works both http , https pages, https pages browser output mixed content warning (as should). can bypassed changing browser settings, i'd rather not have users that. javascript loaded in browser through bookmark (not sure if best way it, browser independent): function sendlocalpost(player, song) { var url = "http://localhost:13337/"; $.ajax({ type: "post", crossdomain: true, contenttype: "application/json; charset=utf-8", url: url, datatype: "json", data: { 'player': player, 'song': song }, success: function (data) { } }); } and here important snippets c# server code: public webapphandler() { // other non-important stuff listener = new httplistener(); listener.prefixes.add("http://localhost:133...

ruby - Rails override flash -

in application, need show several flashes, of same type. in cases, my_controller#some_action flash[:alert] = [] ... flash[:alert] << error1 if something_bad_happened ... flash[:alert] << error2 if something_else_bad_happened and in view iterate on each flash type , check if flash normal flash or array of flashes. flash.each |type, val| if flash[:type].is_a?(array) flash[:type].each |fl| render_flash(fl) end else render_flash(flash[:type]) end end this cool , works well, in code end mix of actions use standard flash , "array" flash, , find stupid. is there way override flash setters that flash[:alert] = error_x ...would push error_x array of flash ? edit: the above code used handling "array of flashes" quick way found achieve goal, if you're telling me unclean , have better solution, i'm taking (or @ least i'll keep in mind when have similar stuff in future). put code explain bit context edit 2: ...

python - Query by empty JsonField in django -

i need query model jsonfield , want records have empty value ([]): i used mymodel.objects.filter(myjsonfield=[]) it's not working, returns 0 result though there's records having myjsonfield=[] try mymodel.objects.filter(myjsonfield='[]') .

selenium - webdriver C# - dropdown selectByVisibleText -

Image
trying select word inside dropdown menu. in webdriver ide appear click dropdown (which id "p" , click word "barcelona" inside dropdown.: i can open dropdown menu using: driver.findelement(by.id("p")).click(); now i'm trying select word inside dropdown menu, using "selectelement" , "select visibletext" not work in c# webdriver me. selectelement selector = new selectelement.selectbyvisibletext("barcelona"); any helps please? using c# webdriver , not java. i think problem in selectelement initialization. can try following code: selectelement selectelement = new selectelement(driver.findelement(by.id("p"))); selectelement.selectbytext("germany"); if new in c# webdriver api, can find following article useful: http://automatetheplanet.com/getting-started-webdriver-c-10-minutes/

scala - Implicit resolution from trait -

i have use case similar situation following: trait { implicit val x = "hello" } class b { // somehow bring x scope here??? def run(x: int)(implicit y: string) = y + x } println((new b).run(3)) i understand need bring x defined in trait in implicit scope of b. i've tried following: # attempt 1 # class b extends { .... } /// doesn't work # attempt 2 # class b extends { val x1 = implicitly[string] /// doesn't work either def run(x: int)(implicit y: string) = y + x } please explain missing here (or, point me relevant theory topic can study, new scala). the value of 'implicit y' resolved in println-line not available. making variable implicitly available within body of class, resolution of implicit string not needed there. implicit isn't magic; if can't reach implicit variable explicitly can't compiler. what problem trying solve?

How to select only filtered table data in angularjs? -

this code: <div> <input type="search" class="form-control" placeholder="search student" ng- model="stdsearch" /> </div> <table class="table" > <thead> <tr> <th><input type="checkbox" ng-model="master"></th> <th>admission no</th> <th>student name</th> <th></th> </tr> </thead> <tbody> <tr ng-repeat="student in classstudents | filter:stdsearch"> <td><input id="checkslave" type="checkbox" ng-checked="master" ng-model="student.isselected" aria-label="slave input"></td> <td>{{student.admission_no}}</td> <td>{{student.first_name}}&nbsp;{{student.middlename}}&nbsp;{{student.last_na...

c - While writing into a file , Where intermediate data stored in between fopen() and fclose()? -

below small program takes information user , write file teacher.txt . using 1 array q2[30] taking input , writing file using fprintf() . when want enter more teacher again loop execute @ time fclose() not appear data not write/save(don't know) file previous value of q2 erased/overwrite new input. in case data stored/write fprintf() .because when manually open teacher.txt before fclose() there no new data. #include <conio.h> #include <iostream.h> int main() { system("cls"); int yoe; char cond[]="yes";char q2[30]; file *p; p = fopen("teacher.txt","a+"); //opening file in reading + appending mode printf("\ndo want add more teacher ? (yes/no)\n"); gets(q2); fflush(stdin); if(!strcmp(q2,cond)) { { printf("\nenter teacher's name\n"); gets(q2); fprintf(p,"\n!%s!",q2); printf("enter teacher's qualifications\n"); ff...

html - Body overflow screen width on mobile only -

i trying create fluid layout adapts different screen sizes... works on desktop no issues, on tablet or cellphone body overflows , creates horizontal scroll bar. click here can see problem i have checked elements , padings , margins, , doesn't seam issue. used css desktop scroll remove footer.css line no 55 .infolinksbottom{ margin-left:5%; // remove line margin-left:0; //add line padding-left:5%; // add line box-sizing: border-box; // add line }

database - Difference between ISQL and DBISQL -

i reading sybase documentation , don't understand difference between dbisql , isql . interchangeable, have same functionality, when use 1 other? isql doesnt let create user-defined database options. if need add own database options, use dbisql interactive sql utility instead. i dont know if there more differences, if exist, in specific functions better work dbisql isql.

ios - Load imageView from Xcassets using Switch statement -

i have images @1 @2 , @3 in xcassets , trying load image onto scrollview page using code below switches image due age on. page determined position , switch statement called in viewwillload function. images not loading sounds working know image loading problem. can help? override func viewdiddisappear(animated: bool) { self.imageview.removefromsuperview() self.imageview.image = nil } override func viewwillappear(animated: bool) { showimageview() let tapgestureimage = uitapgesturerecognizer(target: self, action: selector("handletapgestureimage:")) imageview.addgesturerecognizer(tapgestureimage) imageview.userinteractionenabled = true } // mark: bwwalkthroughpage implementation func walkthroughdidscroll(position: cgfloat, offset: cgfloat) { // getting page number scroll position. first page loads nil want zero. screenpage = int(((position / view.bounds.size.width) + 1) - 1) } func showimageview() { // change imageview in...

Dataflow job fails, but the step still shows successful -

Image
our pipeline failed, graph in developers console still shows been successful. however, results not written bigquery, , job log shows failed. shouldn't graph show failed too? another example: another example: this bug handling of bigquery outputs fixed in release of dataflow service. thank patience.

ios - Generating a signed URL for AWS S3 -

i'm trying create signed url aws s3, want url file in bucket, don't want use upload/download. i've tried afnetworking, following steps on amazons documentation , using aws ios sdk. so far have this: awsstaticcredentialsprovider *credentialsprovider = [awsstaticcredentialsprovider credentialswithaccesskey:@"access key" secretkey:@"secret key"]; awsserviceconfiguration *configuration = [awsserviceconfiguration configurationwithregion:awsregionuswest2 credentialsprovider:credentialsprovider]; [awsservicemanager defaultservicemanager].defaultserviceconfiguration = configuration; awss3presignedurlbuilder * urlbuilder = [[awss3presignedurlbuilder alloc] initwithconfiguration:configuration]; awss3getpresignedurlrequest *presignedurlrequest = [awss3getpresignedurlrequest new]; presignedurlrequest.bucket = @"bucket-name"; presignedurlrequest.key = @"/filename"; presignedurlrequest.httpmethod = awshttpmethodget; pr...

Does Cocos2d-x support ETC2 textures? -

i'm building game , i'm supporting following texture formats: atc dxt png pvr i'd add support etc2 (etc1 won't work because of our graphics require alpha channel). cocos2d-x support etc2 textures? no. but 2 things. cocos2d-x doesn't have etc2 defines in cctexture2d.h. need add etc2 defines yourself. https://github.com/cocos2d/cocos2d-x/blob/v4-develop/cocos/renderer/cctexture2d.h#l95-l96 https://github.com/cocos2d/cocos2d-x/blob/v4-develop/cocos/renderer/cctexture2d.cpp#l60-l110 //! 2-bit pvrtc-compressed texture: pvrtc2 (has alpha channel) pvrtc2a, //! etc-compressed texture: etc etc, //! s3tc-compressed texture: s3tc_dxt1 s3tc_dxt1, and cocos2d-x uses opengl es 2.0 context, @ least, on android. https://github.com/cocos2d/cocos2d-x/blob/v4-develop/cocos/platform/android/java/src/org/cocos2dx/lib/cocos2dxglsurfaceview.java#l76 this.seteglcontextclientversion(2); so using etc2 glcompressedteximage2d needs these extensions. o...

javascript - JQuery row clone and event attributes separation -

i have script clones tables rows , increment ids, names, , event attributes. the problem i'm having clone , increment onchange event attribute inside 1rs textfield ( id="code" ) , clone/increment onkeyup event attribute inside second textfield ( id="qte" ) currently both onchange , onkeyup event duplicated in both textfields. here jquery : jquery.fn.addclone = function() { return this.each(function() { // row cloningg var row = $(this).parents('tr'); var parent = {}; // use tbody or table parent if ( $(row).parents('tbody').length>0) { parent = $(row).parents('tbody'); } else { parent = $(row).parents('table'); } // inject clone var copy = $(row).clone(); $(copy).addclass('sadey'); $(copy).addclass('isclone'); $(parent).append( copy ); // remove last td , replace ...