Posts

Access Query to multiply -

year month exchange rate 2014 54 2015 60 year amount 2014 5000 2015 6000 i want multiply amount in every year exchange rate corresponding year. select currency.[year month], currency.[echange rate], loss.[year], loss.[amount] newamount=currency.[echange rate]*loss.[amount] [currency],[loss] thank help newamount calculated field. part comes after multiplication, , there no =. use related fields, primary key , foreign key, ??related_field?? parts. [year] , [month] should separate fields. select [currency].[year month], [currency].[exchange rate], [loss].[year], [loss].[amount], [currency].[exchange rate]*[loss].[amount] newamount [currency] left outer join [loss] on [currency].[??related_field??] = [loss].[??related_field??]

ios - Error in UnitTests Swift -

hi i'm doing unittests in ios swift project, after run says: class nurse implemented in both projectname , projectname.tests 1 of 2 used. 1 undefined. i found there's error after every test case: could not cast value '<project_name>.<class>' '<project_name_tests>.<class>' i've tried remove test build doesn't work, should do? thanks.

python - imported function calling function from original file -

this question has answer here: two python modules require each other's contents - can work? 2 answers i have python program a imports program b . program a has function foo , main classes , global variables etc. program b has function bar . program a 's main function ran user input during runtime bar, a calls bar: b.bar(stuff) . b.bar() tries call a.foo() . proper way of doing this? the proper way avoid doing as possible, e.g. have third script c containing foo avoid circular. one workaround otherwise write b so: def bar(): import foo foo() and not import a @ top level. way import happens when bar called a loaded , won't import error.

jquery - Javascript fails while trying to declare nested object -

i trying build jquery based simple mail template system. nested array supposed like: templates[1] = { "name":"product damage claim", "def":{ {'customer name?','delivery_name',1}, {'date information should provided customer?','',1}, {'order id','orders_id',0} }, "tpl":'mail content goes here' }; now if write above, javascript fails. seems, doing wrong in defining def object, idea what? as def contains list of values, should array of arrays templates[1] = { "name": "product damage claim", "def": [ ['customer name?', 'delivery_name', 1], ['date information should provided customer?', '', 1], ['order id', 'orders_id...

swift - Can't display user current location Mapbox iOS API -

Image
i want display user's current location after open app. use mapbox ios sdk. doesn't work @ all. don't know what's wrong. can see irrelevant map after open it. import uikit import mapbox import corelocation class viewcontroller: uiviewcontroller, mglmapviewdelegate, cllocationmanagerdelegate { @iboutlet weak var mapview: mglmapview! let locationmanager = cllocationmanager() override func viewdidload() { super.viewdidload() self.locationmanager.delegate = self self.locationmanager.desiredaccuracy = kcllocationaccuracybest self.locationmanager.requestwheninuseauthorization() self.locationmanager.startupdatinglocation() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } // mark: location delegate methods func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) { let location = locations.last let mapview = mglmapview(fr...

how to loop and read from a file, a particular integers or strings using index in python? -

i have in file one.txt: 99999 5286 88888 3478 i want read numbers 99999, 88888 not other numbers using loop , write file two.txt. str.split split string on whitespace, eg, "a b c d" become ["a", "b", "c", "d"] the docs on split: https://docs.python.org/2/library/stdtypes.html#str.split solution example: with open('one.txt', 'r') in_file, open('two.txt', 'w') out_file: in_string in in_file.readlines(): out_file.write(in_string.split()[0]) out_file.write('\n')

java - Server returned HTTP response code: 400 for URL: https://gcm-http.googleapis.com/gcm/send -

i searched lot, didn't find way solve problem below. enviando post para o gcm response code: 400 java.io.ioexception: server returned http response code: 400 url: https://gcm-http.googleapis.com/gcm/send @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:422) @ sun.net.www.protocol.http.httpurlconnection$10.run(httpurlconnection.java:1890) @ sun.net.www.protocol.http.httpurlconnection$10.run(httpurlconnection.java:1885) @ java.security.accesscontroller.doprivileged(native method) @ sun.net.www.protocol.http.httpurlconnection.getchainedexception(httpurlconnection.java:1884) @ sun.net.www.protocol.http.httpurlconnection.getinputstream0(httpur...