Posts

Showing posts from May, 2015

multithreading - How to stop one thread with another python -

i creating game gives twenty seconds enter input. have learned way multi threading , learned how create multiple threads goal being 1 thread ask input , other time. problem ran 1 thread can't terminate , can't find way make main thread either. there way don't know about? i'm pretty new threads , python if there obvious way, don't know it. program far: import _thread import time def askforinput(): input(">") def time(time): time.sleep(time) #terminate first thread _thread.start_new_thread(print_time,()) _thread.start_new_thread(time,(20)) while 1: pass it fine either timing thread or input thread main program too. if there way without threading, i'm open, that's best way think of.

angularjs - add a custom function on angular $resource -

this question has answer here: angular - extending $resource subobject custom methods 4 answers i have angular resource goes this app.factory('user', function ($resource) { return $resource( '/api/user/:listctrl:id/:docctrl/', { id: '@id', listctrl: '@listctrl', docctrl: '@docctrl' }, { update: { method: 'put' }, current: { method: 'get', params: { listctrl: 'current' } }, nearby: { method: 'get', params: { docctrl: 'nearby' }, isarray: true } } ); }); now want have full name in vie

php - Viewing the returned string of openssl_random_psuedo_bytes() -

why doesn't echo openssl_random_pseudo_bytes(12) print out if concatinate string show output? according the manual return type of openssl_random_pseudo_bytes string why there problem? tried type casting (string) , didn't work. the openssl_random_pseudo_bytes(...) function returns binary number in form of string (i.e. ascii value(s)) of specified length. for example, 1 possible output of: $number_of_bytes = 1; $bin = openssl_random_pseudo_bytes($number_of_bytes, $cstrong); $hex=bin2hex($bin); $dec=hexdec($hex); could be: var_dump($bin); // string(1) "ã" var_dump($hex); // string(2) "e3" var_dump($dec); // int(227) var_dump($cstrong); // bool(true) notes: $dec integer random value can equal (at most) 2 ^ (8 * $number_of_bytes) - 1. where 1 byte comprises 8 bits php has integer overflow limitation of @ 2^31-1 or 2^63-1 bits (the limits of signed integers use 4 bytes or 8 bytes depending on whether have 32 or 64 bit platform re

google app engine - Builds at commandline but fails to build as gae app -

no issues building @ commandline: darians-macbook-pro:gdriveweb darianhickman$ go build helloworld/hello.go darians-macbook-pro:gdriveweb darianhickman$ error @ locahost:8080/ the go application not built. (executed command: /users/darianhickman/go_appengine/goroot/bin/go-app-builder -app_base /users/darianhickman/gowork/src/bitbucket.org/darian_hickman/gdriveweb/helloworld -arch 6 -dynamic -goroot /users/darianhickman/go_appengine/goroot -nobuild_files ^^$ -unsafe -gopath /users/darianhickman/gowork -binary_name _go_app -extra_imports appengine_internal/init -work_dir /var/folders/fk/wknp5jzn53gbgbml0yn695_m0000gn/t/tmpshfp6tappengine-go-bin -gcflags -i,/users/darianhickman/go_appengine/goroot/pkg/darwin_amd64_appengine -ldflags -l,/users/darianhickman/go_appengine/goroot/pkg/darwin_amd64_appengine hello.go) /users/darianhickman/gowork/src/golang.org/x/net/context/ctxhttp/ctxhttp.go:35: req.cancel undefined (type *http.request has no field or method canc

Android Studio not playing well with Lombok -

i upgraded latest android studio (2.1.1) , it’s acting strange concerning lombok. have arrangement such class dog implements interface idog. @data class dog implements idog{ private final list<string> toys; } interface idog{ public list<string> gettoys(); } before upgrade 2.1.1 never had complaint, here what’s happening in ide looks normal: no red squiggly underline asking dog implement gettoys. when run code, gradle complains dog should implement gettoys. so check if lombok not there, comment out @data . squiggly underline comes. so it’s if android studio understands lombok handling getter creation gradle not see it. has found solution this?

ios - Updating UILabel in Child View 1 after Global Variable Update in Child View 2 -

i have made simple app test , cannot figure out. have ipad storyboard have put 2 container views shown below. have label in 1 view , button in another. button increment label, 1 number @ time. my problem not passing value or incrementing, getting view load new value. each container has own viewcontroller some code below, although sparse ive written bunch , deleted didn't work. please correct format. keep general format, updating global variable within button , updating label. labelviewcontroller.h #import <uikit/uikit.h> @interface labelviewcontroller : uiviewcontroller @property (weak, nonatomic) iboutlet uilabel *checklabel; -(void)loadlabel; @end labelviewcontroller.m #import "labelviewcontroller.h" #import "parentviewcontroller.h" @interface labelviewcontroller () @end @implementation labelviewcontroller @synthesize checklabel; -(void)loadlabel{ checklabel.text = [nsstring stringwithformat:@"%d",value]; [self.view

java - How to pass a certain amount of data when clicking a link in html? -

how can pass specific set of data when click link? example <a href="1.jsp">1</a> <a href="2.jsp">2</a> i want pass 1 clicking 1 , pass 2 clicking 2. how can ? you can encode arbitrary parameters following syntax: <a href="1.jsp?param1=value1&param2=value2&...&paramn=valuen">1</a> if using servlets, can access user request's parameter by: string value1 = request.getparameter("param1"); all parameters strings.

javascript - How to put <ul> around image in css -

Image
so, title says, want put <ul> around image. ul got 4 <li> , , want put 2 <li> on left side of image, , 2 <li> on right side: <one>-----<two>-----(imagelogo.png)-----<three>-----<four> here how looks @ moment: as can see 4 <li> @ top left corner of site. put on blue line same <div> - #line . tried padding, looks bad, , hard control once page minimized or resized in way. here html file: <body> <div id="line"> <div class="line-menu"> <ul class="menu-buttons"> <li>one</li> <li>two</li> <li>tree</li> <li>four</li> </ul> </div> </div> <div id="top"> <div id="logo"> <img src="images/chelsea-logo.png">

django - Run manage.py migrate but no accout related tables created in graphite.db -

i'm installing graphite 0.9.15 on ubuntu server 16.04 lts. during configuration step cd /opt/graphite/webapp/graphite sudo cp local_settings.py.example local_settings.py then using command in official installation instruction: sudo pythonpath=/opt/graphite/webapp/ python manage.py migrate --settings=local_settings gave information operations perform: apply migrations: (none) running migrations: no migrations apply. then went check graphite.db sqlite3 graphite.db select name sqlite_master type='table'; only 2 tables created, django_migrations , sqlite_sequence, no account relevant tables. , inside apache error log, /opt/graphite/storage/log/webapp/error.log, operationalerror: no such talbe: auth_user. it's because of missing account tables. some info: ubuntu 16.04 lts python2.7.11 django 1.9.6 django-tagging 0.4.3 whisper, carbon, graphite 0.9.15 please know reason , how solve this? lot! actually issue wh

php - How to display hex code color in box? -

Image
i hex color value database per user , shows in box (picture beneath). want show color in small box instead of hex value. code <dd class="fl br-1 lh36" style="width:73px"> <p class="ff-m f14" style="color: #ff4600"><b>color</b></p> <p class="ff-m f13"><?= $user_info['my_color']?></p> </dd> screenshot you should able use in-line style color header... <dd class="fl br-1 lh36" style="width:73px"> <p class="ff-m f14" style="color: #ff4600"><b>color</b></p> <p class="ff-m f13" style="background-color:<?= $user_info['my_color']?>"></p> </dd>

Triggering spell check in InDesign using COM -

how can begin spell check process selected text / text using com interface? there's executemenucommand javascript, seems there's no alternative com interface. i hate when happens! walk away, , take stab different angle! ((indesign.menuaction)app.menuactions["check spelling..."]).invoke(); where app com application. cast unnecessary, allows see properties of menu action.

Ubuntu anaconda paths messed up after drive switch -

quick background: have 2 harddrives, , switched other 1 /media/waffleboy/storage /storage. drive anaconda installed on. realise paths screwed right now, command giving me following error: zsh: /storage/programfiles/anaconda3/bin/spyder: bad interpreter: /media/waffleboy/storage/programfiles/anaconda3/bin/python: no such file or directory i not find paths located online (no ~/.profile folder , not in ~/.config either). how should fix working again? it seems after more intensive googling, there no hope problem anaconda not meant moved after installation. warning people move hard drive paths diff mount points. bad interpreter: no such file or directory error when launching ipython anaconda reinstalling scratch now.

inserting headline in matlab exporting file -

i have matrix (input) , want export text file (output), therefore, using following code in matlab: save('out.txt', 'input', '-ascii'); my question how can insert example 3 lines (as follow) header? don't want open output.txt file in program, because size of output.txt large , non of available softwar can open it. therefore, want directly in matlab. these data set are... created 2013 i think cannot using save function. quick, can see 2 options might useful. first . create file header , use save -append options: input = rand(5); header = ['these data set created 2013']; fileid = fopen('out.txt','w'); fprintf(fileid,'%s\n', header); fclose(fileid); save('out.txt', 'input', '-ascii', '-append'); second . instead of using save, manually use fprintf write everything: input = rand(5); header = ['these data set created 2013']; fileid = fopen('out.txt',&

facebook app to pull posts in website not working -

i trying pull posts facebook website. created facebook app same( https://www.facebook.com/kcm.edu.np/ ). code: $(document).ready(function() { var accesstoken ='975498622499311|eks53jkww4f74jeshrdhujnwowg'; $.ajax({ url: 'https://graph.facebook.com/v2.5/kcm.edu.np/posts?fields=full_picture,id,is_published,link,story,message,name,updated_time,description,from,source,caption,created_time,permalink_url,type,target&access_token=' + accesstoken + '&limit=6', type: 'get', success:function(result){ $("#hidden-next-feed").val(result.paging.next); $.each( result.data, function( index, value ) { var link; var imgsrc = ''; var name = ''; var message = ''; if(typeof(value.link) != "undefined" && value.link !== null) { link = value.link;

php - How to ceiling or floor a variable? -

i have tried use algorithms made other languages ceiling variables , flooring them, looked in php manual answers couldn't manage find answers finding floor / ceiling. i have tried setting precision 0 in php.ini , didn't change anything. i have tried 3 / 2 , want give me 1 (floor) answer or 2 (ceil) to ceiling or floor variable simple using php builtin math functions: $ceiling = ceil(1.5); // ceiling of 3/2 2 $floor = floor(1.5); // floor of 3/2 1 ceil takes float , returns float rounded nearest integer. floor takes float , returns float rounded down nearest integer. see: http://php.net/manual/en/function.ceil.php http://php.net/manual/en/function.floor.php

wso2cep - When stream event Join in WSO2 CEP each output event produsing two times -

i using wso2 cep embedded inside wso2 das following execution plan @import('relatedstream:1.0.0') define stream rs (id string, product string, uc1 string, state string, brand string, model string, type string, tweet string, rtid string); @import('inputstream:1.0.0') define stream ins (id string, product string, uc1 string, state string, brand string, model string, type string, tweet string); @export('matchingstream:1.0.0') define stream ms (rid string, rproduct string, ruc1 string, rstate string, rbrand string, rmodel string, rtype string, hid string, hproduct string, huc1 string, hstate string, hbrand string, hmodel string, htype string); ins#window.time(2 sec) r join rs#window.length(1) h on r.product == h.product , r.brand==h.brand , r.type==h.type , r.model==h.model , r.state!=h.state , r.id==h.rtid select r.id rid, r.product rproduct , r.uc1 ruc1 , r.state rstate, r.brand rbrand , r.model rmodel , r.type rtype ,h.id hid , h.product hproduct

mysql - How will I join these tables? -

Image
i've got problem joining these tables; have code. my query : select partial a.{editransactiondetailid, ponumber}, partial b.{edi997detailid, nooftrans}, partial c.{editransactionid, senderid, receiverid, gsnumber, isanumber, filename}, partial d.{edidoctypeid, doctype} matrixedibundle:editransactiondetail join a.edi997details b join b.editransaction c join c.edidoctype d c.filename :filename , a.ponumber :ponumber , d.doctype = :doctype , a.flag = 1 , c.flag = 1 and got error : join b.editransaction': error: class matrix\matrixedibundle\entity\editransactiondetail has no association named edi997details how can join it? you have not made relationship among tables, that's why got error here, select table1.column1, table2.column2... table1 join table2 on table1.common_field = table2.common_field; // (this part missing in code) for further study http://www.t

How to test $q promises in angularJs with mocha, chai, sinon -

we have moved mocha, chai , sinon our test libraries , coming jasmine little confused how test promises. i have form submit function calls service , on return navigates user correct state: submit(event, theform){ event.preventdefault(); if(theform.$valid){ this.authenticationservice.authenticateuser({ email: this.email, password: this.password }).then( (result) => { this.$state.go('dashboard.home') }); } } have gotten part of way there following test: it('should submit login credentials if valid', function(){ var dfd = q.defer(), promise = dfd.promise; controller.email = 'ryan.pays@leotech.com.sg'; controller.password = 'password123'; sinon.stub(service, 'authenticateuser').returns(promise); sinon.spy(state, 'go'); sinon.spy(controller, 'submit'); controller.submit(event, theform); dfd.resolve();

php - Searching String In All Tables And Displaying It With Pagination Technique -

my database has 5 tables: computer|mobile|tablet|musicsystem|camera all tables in same structure like: productid|productbrand|price|userid here, want search product's brand name in field of productbrand in tables, userid=$userid , limit 10 display pagination technique. how can create such query in mysqli , display in php? thanks in advance. try this... select * computer c,mobile m,tablet t,musicsystem ms,camera cam userid = $userid , (c.productbrand = searchingproductbrand or m.productbrand = searchingproductbrand or t.productbrand = searchingproductbrand or ms.productbrand = searchingproductbrand or cam.productbrand = searchingproductbrand ) limit 10

reactjs - How can I verify that webpack has built my blob with NODE_ENV=production? -

is there way check whether, on arbitrary site, have built javascript blob node_env=production? for example, work out jquery version site using type console $.fn.jquery . is there can type console see if javascript blob built node_env=production?

Java - How to format a mix of strings and integers using printf() to get equal length in the output? -

i having issues formatting correctly: starting mechanical cuchoo clock time [ 0:00:00], total drift = 0.00 seconds after 1 day mechanical cuchoo clock time [23:59:00], total drift = 60.00 seconds the correct formatting is: starting mechanical cuckoo clock time [ 0:00:00], total drift = 0.00 seconds after 1 day mechanical cuckoo clock time [23:59:00], total drift = 60.00 seconds i tried , works there better way? system.out.printf("%60s", this.getclocktype() + " cuchoo clock time [" + time.formattedreportedtime() + "], " + "total drift = "); system.out.printf("%s", fmt.format(time.gettotaldrift()) + "\n"); here small snippet in addition answer caio. string format = "%12s mechanical cuckoo clock time [%8s], total drift = %5.2f seconds%n"; system.out.printf(format, "starting", "0:00:00", 0.0); system.out.printf(format, "after

osx - Raspberry Pi: Remote desktop with tightvnc and mac -

i trying setup tightvnc on raspberry pi 2 (rp2), can remote in mac. have done before , went smooth butter. second setup has been real challenge , not sure why. used these steps: https://www.raspberrypi.org/documentation/remote-access/vnc/ . thing did wrong on - setup automatic start before ever connecting vnc server or setting password, makes me think might root of problem. when try connect rp2 via finder's connect server feature, message saying cannot connect , need check settings on host. can ssh rp2, , can see indeed tightvnc not running, but! .x0-lock , x0 in /tmp/ folder exist. if delete both of these , restart tightvnc , connect rp2 mac can see grey pixelated screen & mouse cursor. ??? i tried removing tightvnc, tried disabling autostart, persists beyond me (i have used linux before school , work, not complete noob, not expert either). tried redoing steps correct install, no luck. any ideas? thing can take at? might wipe whole raspberry instal. thanks!

c++ - Does unordered_map iterator/reference invalidation allow for cuckoo, hopscotch, and robin hood hashing? -

i'm trying figure out if it's possible build conformant, efficient implementation of modern c++'s std::unordered_map using techniques cuckoo hashing, hopscotch hashing, , robin hood hashing allow compact tables, high load factors, , maintain high performance. what's special these techniques involve potentially moving elements around make room others, rather chaining, or probing until open slot found (as in linear or quadratic probing) or. from insert http://www.cplusplus.com/reference/unordered_map/unordered_map/insert/ iterator validity on cases, iterators in container remain valid after insertion. exception being when growth of container forces rehash. in case, iterators in container invalidated. a rehash forced if new container size after insertion operation increase above capacity threshold (calculated container's bucket_count multiplied max_load_factor). references elements in unordered_map container remain valid in cases, after rehash.

How to properly apply a lambda function into a pandas data frame column -

i have pandas data frame, sample , 1 of columns called pr applying lambda function follows: sample['pr'] = sample['pr'].apply(lambda x: nan if x < 90) i following syntax error message: sample['pr'] = sample['pr'].apply(lambda x: nan if x < 90) ^ syntaxerror: invalid syntax what doing wrong? you need mask : sample['pr'] = sample['pr'].mask(sample['pr'] < 90, np.nan) another solution loc , boolean indexing : sample.loc[sample['pr'] < 90, 'pr'] = np.nan sample: import pandas pd import numpy np sample = pd.dataframe({'pr':[10,100,40] }) print (sample) pr 0 10 1 100 2 40 sample['pr'] = sample['pr'].mask(sample['pr'] < 90, np.nan) print (sample) pr 0 nan 1 100.0 2 nan sample.loc[sample['pr'] < 90, 'pr'] = np.nan print (sample) pr 0

php - cant update password in mysql db and how to insert confirm password in register page -

i having 2 problem in programming. 1)cant update password in mysql db. change_password.php <?php session_start(); require_once 'class.user.php'; $user_home = new user(); ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>(type title page here)</title> </head> <body> <?php ///////collect form data ///// if(isset($_post['btn-signup'])) { $password=$_post['password']; $password2=$_post['password2']; $old_password=$_post['old_password']; ///////////////////////// $stmt = $user_home->runquery("select * registered_users userid=:uid"); $stmt->execute(array(":uid"=>$_session['usersession'])); $row = $stmt->fetch(pdo::fetch_assoc); if($row['password']<>md5($old_password)){ echo"your old password not matching per our record.<br>"; echo"no same pass"; } if

selenium - Managing web driver code separately -

can me question. i working on test automation framework , want keep webdriver code separately , initiate test cases. please me in this. - thanks go pom model encapsulation . in example below have created test setup class can used in test classes. so testsetup class- using nunit.framework; using openqa.selenium; using openqa.selenium.chrome; using openqa.selenium.firefox; using openqa.selenium.ie; namespace dummy { [setupfixture] public class testsetup { public static iwebdriver driver; [onetimesetup] public void testsetup() { if (driver == null) { //local tests driver = new firefoxdriver(); } } public static bool iselementpresent(by by) { try { driver.findelement(by);

Remove a node like <nom:Hrs/> from xml with vb .net -

i have xml this: <cfdi:comprobante> <cfdi:emisor> </cfdi:emisor> <cfdi:conceptos> <cfdi:concepto/> </cfdi:conceptos> <cfdi:complemento> <nomina:nomina dato="21"> <nomina:percepciones> <nomina:percepcion/> </nomina:percepciones> <nomina:incapacidades/> <nomina:horasextras/> </nomina:nomina> </cfdi:complemento> </cfdi:comprobante> and need remove nodes: <nomina:incapacidades/> <nomina:horasextras/> and attribute dato="21". i tried next code: dim doc xdocument = xdocument.load(_xml2) doc.root.element("nomina:incapacidades").remove() doc.root.element("nomina:horasextras").remove() doc.root.element("nomina:nomina").attribute("dato").remove() doc.save(_xml2) but not working. would nice if me.

Delphi TypeInfo for generic records -

i'm trying use generic records rtti, ran problem type info. know why following won't compile using delphi 2010? program generictypeinfo; {$apptype console} uses typinfo, sysutils; type tmyrec<t> = record public value: t; end; tmyint = tmyrec<integer>; tmystring = tmyrec<string>; begin try writeln(gettypename(typeinfo(tmyrec<integer>))); <--- works fine writeln(gettypename(typeinfo(tmyrec<string>))); <--- writeln(gettypename(typeinfo(tmyint))); <--- won't compile writeln(gettypename(typeinfo(tmystring))); <--- nor this!! except on e: exception writeln(e.classname, ': ', e.message); end; readln; end. the lines indicated above generate following compiler errors: [dcc error] generictypeinfo.dpr(24): e2134 type 'tmyint' has no type info [dcc error] generictypeinfo.dpr(24): e2134 type 'tmystring' has no type i

How to use a dynamic library in a Visual C++ Android Application -

Image
i trying create simple visual c++ native activity application (android) uses dynamic shared library (.so). seems common thing, still can't find samples this. microsoft provides twolibs sample , similar, there library called java code. need in c++. i tried make native activity , adding reference shared library project. compiles fine, when run it, program crashes. doesn't matter whether call functions library. when use static library doesn't crash. i have tried add compiled .so library list of dependencies wiwth same success: could explain me how supposed done?

rad - Delphi Indy Attachments not working -

i have app needs ftp uploads network drive. using indy this. then, when file located on network drive , uploaded ftp server, want email same file colleague. i using code below this. email gets sent fine, reason, attachments never make it. doing wrong in code? i add file (during ftp process) public (form) member variable called emailfiles (tstringlist), pass procedure. here take list of file names , try add tidmessage component. when email sent, no attachments.... procedure tfrmmain.sendemail(frommail, tomail, subject, body: string; attachments: tstringlist); var i: integer; att : tidattachmentfile; begin memo1.lines.add(''); memo1.lines.add('starting email service...'); smtp.host := 'mail.*****.com'; smtp.username := '***un***'; smtp.password := '***pw***'; try msg1.from.address := frommail; msg1.recipients.emailaddresses := tomail; msg1.subject := subject; msg1.body.add(body); //add

ios - Ambiguous error when attempting to filter values using enum -

i have filter trying use compare 1 value another. here enum using: enum someenum: string { case first = "hey" case second = "there" case third = "peace" static let values = [first, second, third] func pickone() -> string { switch self { case .first: return "value 1" case .second: return "value 2" case .third: return "value 3" } } here attempting filter , find matching values: array.append(someenum.values.filter({$0.rawvalue == anotherarray["id"] as! string})) i end getting ambiguous error: cannot convert value of type '[someenum]' expected argument type 'string' any ideas? the problem is, someenum.values return type [someenum] , not string . and append function expects parameter string , instead [someenum] . this is, need change: change append appendcontentsof , since filter

javascript - 'Object.assign' mutates state in deeper levels -

i have sample jsbin code @ http://jsbin.com/givolafala/edit?html,js,console,output var oldobject = { name: 'john', address: { city: 'new york'}}; var newobject = object.assign({}, oldobject); console.log(oldobject); console.log(newobject); newobject.name = 'mathew'; newobject.address.city = 'los angeles'; console.log(oldobject); console.log(newobject); in example, i'm changing name @ top level john mathew . object.assign returns new state new name mathew . oldobject keeps previous value john . if change value in level other root, not work. in example change city los angeles , , notice newobject , oldobject have same city los angeles . oldobject state mutated. is bug? this not bug, called reference. there's difference between how primitive values , objects (references objectes actually) behaves. var oldobject = { name: 'john', address: { city: 'new york'}}; oldobject consis

AngularJS with global $http error handling -

i want globally intercept $http error scenarios, preventing controllers handling errors themselves. think http interceptor need, i'm not sure how controllers handling error. i have controller this: function homecontroller($location, $http) { activate(); function activate() { $http.get('non-existent-location') .then(function activateok(response) { alert('everything ok'); }) .catch(function activateerror(error) { alert('an error happened'); }); } } and http interceptor this: function httpinterceptor($q, $location) { var service = { responseerror: responseerror }; return service; function responseerror(rejection) { if (rejection.status === 404) { $location.path('/error'); } return $q.reject(rejection); } } this works, in as browser redirects '/error' path. promise ca

cordova - Can anybody give me an example how to call a CORS enabled web service from web worker in Phonegap (iOS)? -

i want call cors enabled restful web service cordova ios app within web worker.cordova use load web app using file:// protocol , web service https:// both origins different.i want know whether possible or not?if can give me example. from web worker cannot directly call cors enabled api.but if deploying hybrid app ios can achieve this.there class called nsurlprotocol, using life cycle method can achieved.thanks.

image - Rails paperclip crop save ratio -

Image
how save ratio while crop image? i use paperclip , image style blog_article_main 940x400x works ok. but while crop image ratio changed. my cropper module paperclip class cropper < thumbnail def transformation_command if crop_command crop_command + super.join(' ').sub(/ -crop \s+/, '').split(' ') else super end end def crop_command target = @attachment.instance if @attachment if target.cropping? ["-crop", "#{target.crop_w}x#{target.crop_h}+#{target.crop_x}+#{target.crop_y}"] end end end end my js javascript: $(function () { $('#cropbox').jcrop({ onchange: update_crop, onselect: update_crop, bgcolor: 'black', bgopacity: .2, setselect: [100, 100, 400, 400], //aspectratio: 16 / 9, maxsize:[940,400] }); }); function update_crop(coords) { var rx = 100/coords.w; var ry

centos - Libtool - Mismatch version -

i try install usbip on centos 5.11 (kernel 2.6.18-409.el5) have error when type "make" : make[1]: entering directory "/root/downloads/usbip-0.1.7/src" making in lib make[2]: entering directory "/root/downloads/usbip-0.1.7/src/lib" if /bin/sh ../libtool --tag=cc --mode=compile gcc -dhave_config_h -i. -i. -i.. -wall -w -wstrict-prototypes -std=gnu99 -dusbids_file='"/usr/local/share/usbip/usb.ids"' -g -o2 -mt libusbip_la-names.lo -md -mp -mf ".deps/libusbip_la-names.tpo" -c -o libusbip_la-names.lo "test -f "names.c" || echo './'"names.c; \ mv -f ".deps/libusbip_la-names.tpo" ".deps/libusbip_la-names.plo"; else rm -f ".deps/libusbip_la-names.tpo"; exit 1; fi libtool: version mismatch error. libtool 1.9b, libtool: definition of lt_init comes older release. libtool: should recreate aclocal.m4 macros libtool 1.9b libtool: , run autoconf again.

ios - UIRefreshControl not spinning when beginRefreshing is called from delegate -

i have main view controller fonction func beginquerydata() { if !refreshcontrol.refreshing { refreshcontrol.beginrefreshing() if let colview = collectionview { colview.setcontentoffset(cgpoint(x: 0, y: colview.contentoffset.y - refreshcontrol.frame.height), animated: true) } querydata() } } this works fine when called in viewdidappear of viewdidload. now, have setting view controller push on top of view controller. each time change setting in setting view controller, call beginquerydata() of viewcontroller set delegate of setting view controller. ( delegate.settingschanged() ) the problem: the main viewcontroller refreshed, spinning icon shown it's not animating... tried endrefreshing , beginrefreshing in viewdidload() doesn't work, spinning icon disappears.

sql server - SQL Query to Crystal Report -

need results query: select cast(a.invoicedate date) invoicedate, count(*) recordcount salesorder join imssalesextracthistory b on a.slsordnbr = b.slsordnbr , a.ordlnnbr = b.ordlnnbr , a.ordlnseqnbr = b.ordlnseqnbr b.safinsertdate > getdate()-2 group cast(a.invoicedate date) order cast(a.invoicedate date) to replicated crystal report. i have started formula in formula workshop window within crystal reports 2013 keeps giving me error: ( select distinct cast("salesorder"."invoicedate" date) invoicedate "salesorder" join "imssalesextracthistory" on "salesorder"."slsordnbr" = "imssalesextracthistory"."slsordnbr" , "salesorder"."ordlnnbr" = "imssalesextracthistory"."ordlnnbr" , "salesorder"."ordlnseqnbr" = "imssalesextracthistory"."ordlnseqnbr" "imssalesextracthi