Posts

Showing posts from April, 2014

android - Class must either be declared abstract or implement abstract method? -

this question has answer here: class must either declared abstract or implement abstract method error 3 answers it loos i'm doing right here must missing something. hoping explanation why i'm getting error in first line of code , should fix type of problem? i'm new android dev. public class page2 extends appcompatactivity implements onclicklistener { /** * attention: auto-generated implement app indexing api. * see https://g.co/appindexing/androidstudio more information. */ private googleapiclient client; imagebutton rock, scissors, paper; random randomnum = new random(); int cpumov; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activitypage2); //set xml page style display rock = (imagebutton) findviewbyid(r.id.imagebuttonrock); scissors = (imagebutton

javascript - Tinder like function, appcelerator -

i tried re create tinder function. i found code : var win = titanium.ui.createwindow({ backgroundcolor: "#ffffff", title: "win" }); // animations var animateleft = ti.ui.createanimation({ left: -520, transform: ti.ui.create2dmatrix({rotate: 60}), opacity: 0, duration: 300 }); var animateright = ti.ui.createanimation({ left: 520, transform: ti.ui.create2dmatrix({rotate: -60}), opacity: 0, duration: 300 }); var curx = 0; win.addeventlistener('touchstart', function (e) { curx = parseint(e.x, 10); }); win.addeventlistener('touchmove', function (e) { if (!e.source.id || e.source.id !== 'oferta') { return; } // subtracting current position starting horizontal position var coordinates = parseint(e.x, 10) - curx; // defining coordinates final left position var matrix = ti.ui.create2dmatrix({rotate: -(coordinates / 10)}); var animate = ti.ui.createanimation(

swing - How do you access your computer's menu bar in java? -

i making gui text editor in java. know java's swing interface provides menu bars in form of jmenubars, want doesn't take space in window. picture shows jmenubar i know enough, want looks this: picture shows computer's menu is there way programmatically? in advance.

algorithm - Can I assume that a bitwise AND operation is O(1)? If so why? -

my processor can arithmetic operations on 8-bit or 16-bit unsigned integers. 1) means word size processor 16 bits, correct? operations on words o(1). the reason has actual circuit-level implementation of how processor works, correct? if add 2 words, , result number more 16-bits, state following? 1) processor can add numbers report 16 least significant digits. 2) report more 16 bits, processor must have software permits these operations large numbers (numbers don't fit in word). finally, let's have word w 16-bit digit , want 8 least significant digits. can w & 0xff. time complexity of operation? o(1) because of circuit level implementation of processor well? short answer: yes, single bitwise , considered o(1) . a little more detail: even if looked @ number of operations on each bit still o(1) . actual number of bit operations may vary variable type, e.g. 8 bits vs. 16 bits vs. 32 bits vs. 64 bits (even 128 bits or more). key no matter under

html - Javascript: is it possible to read the raw code of external scripts? -

given typical script tag: <script src="foo.com/myscript.js"></script> would possible directly read contents of myscript.js string or something? example: <script id="myscript" src="foo.com/myscript.js"></script> <script> var inners = document.getelementbyid("myscript").//raw contents of myscript.js </script> no. can read contents of inline script tag, because have content: <script id="myscript"> var inners = document.getelementbyid("myscript").textcontent; </script> but external js, script contents not put dom; need re-fetch using ajax (it cached unless anti-caching measures taken, not take time re-fetch).

reactjs - Use React-Redux To Develop a Login Page -

i try use react-redux develope login page , encounter problems. i want send textfields account , password server ajax, when click login button, login button can not value of textfields. i not want use "form tag" , try best solve problem myself, still suspect solution, want find advise problem. my solution following textfields trigger action set login info next state. login button send these info server only. the following part of codes. textfield: class baseinputcomponent extends react.component { constructor(props) { super(props); this._handlechange = this._handlechange.bind(this); } _handlechange(e) { this.props.onchange({infotype: this.props.datatype, data: e.target.value}) } render() { var style = { marginbottom: 30 }; return ( <div style={style}> <textfield hinttext={ this.props.hinttext } floati

html - Setting width and height of the video -

i facing problem regarding width , height of video. right now, occupying full screen want full sized in width , setting height want. example, refer http://airbnb.com . if me out. <div align="center"> <video autoplay loop id="video" class="con"> <source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4> </video> <div class="overlay"> <form> <label for="input">form input label</label> <input id="input" name="input" value="" /> <button type="submit">submit</button> </form> </div> </div> this css using. .con { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translatex(-50%) translatey(-50%); transition: 1s opacity; } .overlay { position:absolute; top:0; left:0; z-index:1; } it see

java - Passing Entities as method parameters vs sending new object created from part of entity -

i list of @entity es query (so called main entities). have fill of transient fields in these entities values different queries / entities. each of these transient fields needs different combination of fields main entities , based on should run query , fill transient fields. these done in 3 4 different methods. my question is, better approach in terms of performance , practice? pass main entities list (could in 100s) each of these methods , them filled in method or create object based on fields needed each method , result , fill entities? when pass entities methods, not creating copies, passing original list? no performance related issues? except primitive types, every object passed methods parameter passed reference. therefore won't create copies of entities if pass list<entityclass> object methods. if there isn't other reason not so, go option 1 , pass list of entities methods.

Python find the frequency of combinations in 2 lists -

i have 2 lists, list1 = ['a', 'b', 'c', 'a'] list2 = ['a', 'b', 'c', 'd','a'] how can find frequency each combinations of 'a''a' , 'b''b' , 'c''c' ? use aptly named counter , collections , this: >>> collections import counter >>> counter(zip(['a','b','c','a'],['a','b','c','a'])).most_common() [(('a', 'a'), 2), (('b', 'b'), 1), (('c', 'c'), 1)] zip creates pairs of objects should compared: >>> zip(['a','b','c','a'],['a','b','c','a']) [('a', 'a'), ('b', 'b'), ('c', 'c'), ('a', 'a')]

Julia get wrong value when I try to unsafe_load a pointer from C -

the c code: typedef struct __kstring_t { size_t l, m; char *s; } kstring_t; kstring_t * get_ptr_of_kstr(int num){ char * ch = (char *)malloc(num); kstring_t kstr = {0, num, ch}; kstring_t *p = &kstr; printf("in c, kstr.l: %zu\n", p->l); printf("in c, kstr.m: %zu\n", p->m); printf("in c, kstr.s: %p\n", p->s); printf("in c, pointer kstr: %p\n", p); return p; }; the julia code type kstr l::csize_t m::csize_t s::ptr{cchar} end problem when use ccall call get_ptr_of_kstr , pointer of kstring_t in julia , use unsafe_load value, value seems wrong. messages below: in c, kstr.l: 0 in c, kstr.m: 100000 in c, kstr.s: 0x37b59b0 in c, pointer kstr: 0x7fffe7d80b90 kstr = ptr{ht.kstr} @0x00007fffe7d80b90 unsafe_load(kstr).s = ptr{int8} @0x00007fffe7d80b90 the value of unsafe_load(kstr).s same kstr . why? how fix it? regarding c part (i don't know bindings between julia , c

boost - unordered_map with string in managed_shared_memory fails -

Image
this code: int main (int argc, char *argv[]) { typedef int keytype; typedef string mappedtype; typedef std::pair<keytype, mappedtype> valuetype; typedef boost::interprocess::allocator<valuetype, boost::interprocess::managed_shared_memory::segment_manager> shmalloc; typedef boost::unordered_map<keytype, mappedtype, boost::hash<keytype>, std::equal_to<keytype>, shmalloc> shmhashmap; boost::interprocess::managed_shared_memory segment(boost::interprocess::open_or_create, "containersharedmemory", 65536); if(argc == 2 && string(argv[1]) == "clear") { boost::interprocess::shared_memory_object::remove("containersharedmemory"); return 0; } shmhashmap *hash_map = segment.find_or_construct<shmhashmap>(boost::interprocess::unique_instance)(segment.get_segment_manager()); if(hash_map == null) { cout << "find_or_construct error"

javascript - Socket.io socket.emit not passing data to server -

i trying hands on socket.io. have following code. this index.html. <!doctype html> <html> <body> <ul id="messages"></ul> <form action="" onsubmit="return sayhello()"> <input id="m" autocomplete="off" /><button>send</button> </form> <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script> <script> var socket = io.connect('http://127.0.0.1:3001/'); function sayhello(){ var msg = document.getelementbyid('m'); console.log(msg); <- getting printed. socket.emit('message', msg.value); msg.value=''; return (false); } // $('form').submit(function(){ // socket.emit('chat message', $('#m').val()); // $('#m').val(''); // return false; // }); // socket.on(&#

How to call a method from another inherited class in c# -

this question has answer here: what nullreferenceexception, , how fix it? 33 answers i have class , method below public class wakeup : world { public void methoda(string) { log.writeline("wakeup world"); } } and below 1 class , method in trying call "methoda" public class hello : world { public void methodb() { wakeup p = new wakeup; p.methoda(string); } } this isn't working. unable call "methoda" inside "methodb" note : both classed inherited other class called "world" can suggest me how can achieve ? create instance of first class inside second 1 correctly, pass string value instead string type in second class method call public class wakeup : world { public void methoda(string text) {

c# - Convert.ToByte Could not find any recognizable digits -

this question has answer here: how convert string byte[] in c# 4 answers i need somehow convert "xxx" byte got exception an unhandled exception of type 'system.formatexception' occurred in mscorlib.dll additional information: not find recognizable digits. is possible "xxx" value convert byte? byte tr = (byte)(convert.tobyte("xxx", 16) << 4); it not possible convert "xxx" byte. not representation of byte.

visual c++ - Cannot locate VS 2015 Enterprise executable -

installed vs 2015 enterprise in location c:\program files(x86)\microsoft visual studio 14.0 from previous posts other versions supposed in common\ide folder somewhere. in control panel shows installed. can't locate it. as said in comments, path is: c:\program files (x86)\microsoft visual studio 14.0\common7\ide\devenv.exe

jquery - php -laravel How to Save custom data from user input -

i want save registration number data in laravel project registration number format: <dept code>-<current year>-xxx. example, cse-2012-001, here dept code come ui side when user select particular department. how do it..any idea or possible solution? here controller: public function savestudent(request $request) { $this->validate($request,[ 'email' => 'required|unique:students', 'contact_no' => 'required|regex:/(01)[0-9]{9}/', ]); $student = new student(); $student->name = $request->input(['name']); $student->email = $request->input(['email']); $student->contact_no = $request->input(['contact_no']); $student->address = $request->input(['address']); $student->date = $request->input(['date

javascript - Removing all classes starting with string -

i have following html: <div class="cols someclass"></div> <!--like cols1, cols2, etc..--> <div class="columns someclass"></div> <!--like columns1, columns2, etc...--> <div class="col-1 someclass"></div> <!--like col-2, col-3,etc...--> <div class="column-1 someclass"></div> <!--like column-2, column-3, etc...--> how remove classes starting "col" ? i believe there no jquery magic this, here's solution: $('[class*=col]').each(function() { this.classname = $.grep(this.classname.split(' '), function(el) { return !/^col/.test(el); }).join(' '); }); fiddle basically, selects elements have col in classes , iterate on them, iterating on classes , removing begin col . or without regex: $('[class*=col]').each(function() { this.classname = $.grep(this.classname.split(' '), function(cl) {

Is it possible to run Firebird 2.5 query in parallel mode? -

colleagues, have query looks like for select first 100 contracts.doc table_1 :contr begin insert tmp_port ( dt, ....) select :in$dt dt, ... p_procedure (0, :contr , :in$dt); end the problem proprietary procedure p_procedure works slow. can't optimize p_procedure . in oracle, remember, can increase speed of execution using parallel . is there similar (like hint 'parallel') in firebird 2.5? there other approaches increase execution speed? thank advice.

java - when springmvc's requestmapping with chinese ,happen an error? -

in springmvc when use request mapping like: /home/tag/{tag} the 'tag' accept string; when transmit chinese word 'tag', such as: **/home/tag/中文** it works, when use same url, change chinese one, such as: /home/tag/æ—…è¡Œ i getting 404 error without output in eclipse. i'm new learn springmvc ,i'll appreciate if can me improve.

dynamic - delete word templates in CRM 2016 -

Image
i created word templates entity how can update/delete/edit existing templates created entity? i tried navigate settings->business->templates not showing ones created within templates instead of selecting word or excel , want delete selecionar edit or update image

java - Why I can't success when I set spring.profiles.active in web.xml -

i have server data sources, use profile in spring3.1, web.xml: <context-param> <param-name>contextconfiglocation</param-name> <param-value>classpath:applicationcontext.xml,classpath:applicationcontext-dao.xml,classpath:sqlmapconfig.xml</param-value> </context-param> <context-param> <param-name>spring.profiles.active</param-name> <param-value>test</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> and applicationcontext.xml: <beans profile="develop"> <context:property-placeholder location="classpath:develop.properties"/> </beans> <beans profile="test"> <context:property-placeholder location="classpath:test.properties"/> </beans> but doesn't work

Elasticsearch 2.x Not working with Spring boot 1.2.5 -

hi friends have installed elastic search 1.4.5 , using spring boot 1.2.5 . setup working fine. dependencies included elasticsearch in pom file is: <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-elasticsearch</artifactid> </dependency> now know elasticsearch upgraded , latest version of 2.x series. have installed elasticsearch 2.3.1 started spring boot application gives me warnings [2016-04-25 11:48:27,263][warn ][transport.netty ] [katie power] exception caught on transport layer [[id: 0x70aad8aa, /127.0.0.1:41327 => /127.0.0.1:9300]], closing connection java.lang.illegalstateexception: message not read (request) requestid [6], action [cluster/nodes/info], readerindex [39] vs expected [57]; resetting @ org.elasticsearch.transport.netty.messagechannelhandler.messagereceived(messagechannelhandler.java:121) @ org.jboss.netty.channel.simplechannelupstreamhandl

sql - MySQL - join two queries the second being filtered by the result from the first -

i have situation rearch return single product sku return example: select pr.sku, pr.pksku, pr.colordescription, pr.commonbrandname, pr.basemodel tbl_products pr pr.pksku = 160386 order pr.commonbrandname, pr.sku, pr.standardcolor but sku may have other alternative colours available linked via basemodel , need display these know can writing new query so: select pr.sku, pr.pksku, pr.colordescription, pr.commonbrandname, pr.basemodel tbl_products pr pr.basemodel = "result previous query" order pr.commonbrandname, pr.sku, pr.standardcolor but combine 1 query, possible ? secondly if need results ordered sku's returned 1st query listed first so: searched sku alternative color searched sku alternative color alternative color searched sku alternative color etc. it this select pr.sku, pr.pksku, pr.colordescription, pr.commonbrandname, pr.basemodel tbl_products pr inner join tbl_products pr1 on pr.basemodel = pr1.basemodel pr2.pksku = 16

Swift: Reduce function -

i have array let digits = ["3", "1", "4", "1"] i want convert them int value 3141 i have tried let digits = ["3", "1", "4", "1"] let mydigit = int(digits.reduce("") { $0 + $1 }) print(mydigit) //3141 but don't want wrap int() of digits.reduce("") { $0 + $1 } , want use reduce achieve this. (that can use int() inside reduce function) how this? , there ways else achieve this? any helps appreciated. thanks. another approach reduce. there no way around converting strings have ints @ point. let digits = ["3", "1", "4", "1"] let number = digits.reduce(0) { 10 * $0 + int($1, radix: 10)! } print(number)

html - How does "/f179" relate to twitter's little bird icon? -

if inspect on little bird icon on twitter.com see css has content: "/f179" . twitter's icon? special font lots of special characters including twitter's icon? please use below code: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css"> add above link in head section of page , following code use twitter icon on page.. <i class="fa fa-twitter" aria-hidden="true"></i>

javascript - How to do radio buttons in Angular -

this code. when submit switchcolors, server returns undefined it. how wrong? also how should initiate $scope.swichcolors in controller? have $scope.switchcolors = ''; <label class="radio-inline"> <input type="radio" ng-model="$parent.switchcolors" value = "yes" >yes</input> </label> <label class="radio-inline"> <input type= "radio" ng-model = "$parent.switchcolors" value = "no" >no</input> </label> try using ng-value instead of value <label class="radio-inline"> <input type="radio" ng-model="$parent.switchcolors" ng-value = "yes" >yes</input> </label> <label class="radio-inline"> <input type= "radio" ng-model = "$parent.switchcolors" ng-value = "no" >no</input> </label>

How to read a array value form json in java -

i have following json data:- { "store": { "book": [ { "category": "reference", "author": "nigel rees", "title": "sayings of century", "price": 8.95 }, { "category": "fiction", "author": "evelyn waugh", "title": "sword of honour", "price": 12.99 }, { "category": "fiction", "author": "herman melville", "title": "moby dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction",

wordpress - Responsive design works on desktop but not iphone -

i using free theme wordpress. have customized design meet needs, there problems design when open website using iphone or ipad. have tried know. can me identify source of problem? [link of website.][1] try media query iphone 6/6 plus , apple watch css media queries @media screen , (min-device-width: 375px) , (max-device-width: 667px) , (orientation: landscape) , (-webkit-min-device-pixel-ratio: 2) { } iphone 6 portrait @media screen , (min-device-width: 375px) , (max-device-width: 667px) , (orientation: portrait) , (-webkit-min-device-pixel-ratio: 2) { } iphone 6 plus landscape @media screen , (min-device-width: 414px) , (max-device-width: 736px) , (orientation: landscape) , (-webkit-min-device-pixel-ratio: 3) { } iphone 6 plus portrait @media screen , (min-device-width: 414px) , (max-device-width: 736px) , (orientation: portrait) and (-webkit-min-device-pixel-ratio: 3) { } iphone 6 , 6 plus @media screen , (max-device-width: 640px), scr

cordova - ionic android platform error -

when added android platform ionic project error.can please tell whats wrong here.my node js version 4.4.3 module.js:327 throw err; ^ error: cannot find module 'config-chain' @ function.module._resolvefilename (module.js:325:15) @ function.module._load (module.js:276:25) @ module.require (module.js:353:17) @ require (internal/module.js:12:17) @ object.<anonymous> (c:\users\uvindu\appdata\roaming\npm\node_modules\cordova\node_modules\npm\lib\config\core.js:2:10) @ module._compile (module.js:409:26) @ object.module._extensions..js (module.js:416:10) @ module.load (module.js:343:32) @ function.module._load (module.js:300:12) @ module.require (module.js:353:17) @ require (internal/module.js:12:17) following these steps fixed problem me http://ionicframework.com/getting-started/

c++ - No output displayed when a pointer is defined; -

#include <iostream> using namespace std; int main() { int val = 8; int *point = &val; cout << val << *point << endl; } i wrote straightforward program print out value of variable first using variable name using pointer variable. unknown reason though, no output printed console. however, if run same code line line in debugger, expected output (88). since problem specific me, i'll add i'm using eclipse kepler mingw compiler on 64 bit system. on how can solve problem , pointers function highly appreicated. i found answer here and since code , debugger correct - post recommends do: [1] uninstall - removed traces of eclipse (64-bit). - removed traces of mingw (and/or cygwin). - removed traces of java (sdk , jre). [2] restart pc [3] install - installed latest java jdk (includes jre) 32-bit. - installed eclipse ide (java edition) 32-bit. - installed mingw (with msys). - installed necessary cdt tools within eclipse. ho

javascript - Chrome is showing the angular expression instead of value. Firefox displays the correct value -

showing angularjs expression in dom instead of value in chrome browser showing correct value in firefox. in chrome shows like: <div id="{profile.id}" data-id="{{profile.id}}">some text</div> in firefox displays correctly: <div id="1234" data-id="1234">some text</div> how solve chrome?

java - Font doesn't load correctly when running from jar -

Image
i have problem java. load new font using code: graphicsenvironment ge = graphicsenvironment.getlocalgraphicsenvironment(); ge.registerfont(font.createfont(font.plain, getclass().getresourceasstream("/some/packages/fonts/font.ttf"))); when debug in netbeans, works correctly, here's screenshot: http://i.imgur.com/ohj4xrw.png but, once compile game font doesn't load (or @ least doesn't display correctly), this: http://i.imgur.com/ou1k9ow.png and there's 1 more thing - when run jar terminal (java -jar app.jar) - font works! have no idea why , how fix it. can me? if app runs correctly when running command, try this: process proc = runtime.getruntime().exec("java -jar app.jar"); // make sure provide path inputstream in = proc.getinputstream(); inputstream err = proc.geterrorstream(); outputstream out = proc.getoutputstream(); // in/out/err streams of proc

java - How to get size of file in rest api jersey -

i have made rest api in working fine want read size of file , have used below code read size of file @post @path("/test") @consumes(mediatype.multipart_form_data) public response upload( formdatamultipart form ){ system.out.println(" size of file="+ filepart.getcontentdisposition().getsize()); } but got size of file -1 . can 1 suggest me how can read actual size of file . but using system.out.println(" data name ="+ filepart.getcontentdisposition().getfilename()); i got correct name of file . hope wanted. have verified in system. prints size of file in bytes. @post @path("/upload") @consumes(mediatype.multipart_form_data) public response uploadfile(@formdataparam("file") inputstream uploadedinputstream, @formdataparam("file") formdatacontentdisposition filedetail) { string uploadedfilelocation = "/home/desktop/" + filedetail.getfilename(); // save writetofile(uploadedinp

javascript - How to add multiple files to a zip with zip.js? -

i using javascript zip.js library. i've seach around cannot find example more 1 file added zip. here code, generates "corrupted" zip. var len = results.rows.length, i; var k=1; zip.createwriter(new zip.blobwriter(), function(writer) { (i = 0; < len; i++){ // image url sqlite request url = results.rows.item(i).url; var img = new image(); img.onload = function() { var = document.createelement('a'); a.href = this.src; var filename= a.pathname.split('/').pop(); // filename.php timest = new date().gettime(); // use textreader read string add writer.add(timest+".jpg", new zip.data64urireader(getbase64image(img)), function() { // onsuccess callback k++; if(k==len){ settimeout(function(){ writer.close(function(blob) {

linux - What does **uevent** stands for? -

as per title, know elaboration. after googling, found 'uevent' stands "userspace event". is correct? thanks. thats correct stands user space event , off topic stackoverflow... :)

javascript - $resource delete method doesn't work right -

i learning angluarjs's $resource. set button on html deleting record json file,and hope delete 1 record testform.json file. unfortunately, failed , can't solve problem. the codes here: my angularjs code deleting function in controller codes shown follows $scope.deleterecord = function () { var id = 1; var arecord = new singleresource(); arecord.$get({userid:id},function () { $log.info(arecord); arecord.$delete(); }); the html part of deleting function shown here: <div class="form-group"> <div class="col-sm-6 col-sm-push-2"> <button type="button" class="btn btn-primary" ng-click="deleterecord()">delete information</button> </div> </div> "$scope.deleterecord" function when clicking delete information button, record id=1 in json file should removed. error says:&

java - Understanding algorithm - Multinomial Naive Bayes -

Image
i have been introduced naive bayes classification method (multinomial nb), reference how described michael sipser in book "the theory of computation". i looking @ algorithm described both training , applying multinomial nb, presented follows: however, i'm coming loss when interpreting aspects of algorithm. instance, in trainmultinomialnb(c, d) on line 6: what concatenate_text_of_all_docs_in_class(d, c) do? so far, understand follows. suppose have 3 - 3 - documents in class "movies" , "songs": movies doc1 = "big fish" doc2 = "big lebowski" doc3 = "mystic river" songs doc1 = "purple rain" doc2 = "crying in rain" doc3 = "anaconda" after applying concatenate_text_of_all_docs_in_class(d, c) , left with, strings: string concatenatedmovies = "big fish big lebowski mystic river" string concatenatedsongs = "purple rain crying in rain

ios - Show User's current location on map -

i trying display user's current location on map reason, not takes default coordinates. i have mkmapview class called inside uiviewcontroller. mapview.h #import <uikit/uikit.h> #import <mapkit/mapkit.h> #import <corelocation/corelocation.h> @interface mapview : mkmapview <mkmapviewdelegate, cllocationmanagerdelegate>{ cllocationmanager *locationmanager; } @end mapview.m #import "mapview.h" @interface mapview () @end @implementation mapview - (id)initwithframe:(cgrect)frame{ self = [super initwithframe:frame]; if (self) { locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; self.delegate = self; [self addannotation:[self userlocation]]; [locationmanager startupdatinglocation]; } return self; } - (void)locationmanager:(cllocationmanager *)manager didfailwitherror:(nserror *)error { nslog(@"didfailwitherror: %@", error);

algorithm - Reading lossy file format (PRC), resulting in precision problems -

i got making viewer various 3d file formats, , formats had before didn't pose problem, until came prc file (which 1 of supported 3d formats can embedded in pdfs). can extract data pdf , display models encoded in non-lossy ways, when tried decode call "highly compressed tesselations" run problem think precision problem, don't quite know how fix or solutions. essentially lossy format, , take original (floating point based) vertex coordinates , -using tolerance value- divide coordinates , round result nearest integer. when traversing mesh encode triangles, first triangle has absolute values stored, remaining triangles based on previous neighbouring triangle , building local coordinate system middle of shared edge being origin, vector along shared edge being x-axis, , triangle normal being z-axis. y-axis result of cross product of those, , using 3 local axis stores coordinate third point of new triangle. i have system working, , simple models not many triangles wo

arrays - Evaluation Error while using the Hiera hash in puppet -

i have following values in hiera yaml file: test::config_php::php_modules : -'soap' -'mcrypt' -'pdo' -'mbstring' -'php-process' -'pecl-memcache' -'devel' -'php-gd' -'pear' -'mysql' -'xml' and following test class: class test::config_php ( $php_version, $php_modules = hiera_hash('php_modules', {}), $module_name, ){ class { 'php': version => $php_version, } $php_modules.each |string $php_module| { php::module { $php_module: } } } while running puppet manifests following error: error: evaluation error: error while evaluating function call, create_resources(): second argument must hash @ /tmp/vagrant-puppet/modules-f38a037289f9864906c44863800dbacf/ssh/manifests/init.pp:46:3 on node testdays-1a.vagrant.loc.vag quite confused on doing wrong. puppet version 3.6.2 , have parser = future i appreciate here. looks yaml off. you don't

javascript - prevent overlay from closing on click -

i have page send message. when message sent overlay appears on page. overlay prevent user clicking anywhere on page force user click button when wants stop message displayed on client device. the overlay made of small box (300 x 200 px) placed in center of screen. inside there message , button: <div id="box"> <h1>allarme <br>in corso</h1> <form name="fermare"><button name="al_fermare" class="btn btn-danger">disattiva</button></form> </div> if user clicks outside box div nothing happens (desired behaviour). if user clicks button overlay closed , javascript triggered (desired behaviour). if user clicks inside box not on button overlay closed js not triggered. (not desired behaviour). i have 2 ways of solving this: trigger js on click event on box div; prevent happening on click in box outside button; how can point 2? best solution. the triggered js following: d

How to test equality of MongoDB filters (BSON) in Java/Groovy? -

i'm generating mongodb-queries unsing filters-api . bson r1 = filters.and(filters.eq("a","b"), filters.eq("c","d")) bson r2 = filters.and(filters.eq("a","b"), filters.eq("c","d")) but how can check result equality? example: r1.equals(r2) and r1.dump().equals(r2.dump()) don't work. one thing is: convert bson bsondocument compare json strings here found on https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/mongodb-user/peel8wiwxwa/zhpyglqedqaj bsondocument b1 = r1.tobsondocument(bsondocument.class, mongoclient.default_codec_registry); bsondocument b2 = r2.tobsondocument(bsondocument.class, mongoclient.default_codec_registry);

coreos - What is the difference between docker images and docker search commands? -

on coreos (899.15.0) machine, when execute docker search , images following results : docker search private-registry:5000/ name description stars official automated docker images on private registry machine: repository tag image id created virtual size nginx latest e32087da8ee6dfa45221c48670fa9475f3d8a53a0e9ccabef4f741c62c77d49b 2 weeks ago 182.6 mb registry 0.9.1 facc02b3acf6f811e8eace6d07b34cd5ab687e926ac5b5231da93264b259f1a4 12 weeks ago 422.8 mb <none> <none> db81ebdc7ebd3d7aec05d4faa6f4c9c2e35954896e968bce2f90a9736485aa06 3 months ago 422.8 mb ...and few more images the

objective c - Let video play using a slider -

i want have slider , video(let's 1 of 10 seconds) , when slider @ 0 imageview should set first image of video. when slider @ 0.3 imageview should show image that's displayed @ (3/10)*the length of video (in case 3 seconds). when slider @ 1 imageview should show image that's displayed @ end of video. use slider play video fast or slow. can tell me code image of video @ specific second? i don't want play second imaged should displayed @ second. thanks in advance! you error because, in parsing [[nsuserdefaults standarduserdefaults] integerforkey @"myscorelevel1"] , compiler gets "integerforkey" , sees string literal after that. never legal syntax. [[nsuserdefaults standarduserdefaults] integerforkey] legal syntax, compiler complains of missing ] . of course, real problem missing : after "integerforkey", compiler not smart enough realize that. (and of course using = instead of == problem, not 1 compiler has recogniz

reporting services - OLEDB provider for linked server reported change of schema version between compile time and run time for table error -

i trying run report giving message: an error has occurred during report processing. (rsprocessingaborted) query execution failed dataset 'paramyear'. (rserrorexecutingcommand) more information error navigate report server on local server machine, or enable remote errors i checked in visual studio , error: oledb provider linked server sql10 reported change of schema version between compile time("182424452472301") , run time ("182454520418731") table dbo.stud query: select distinct funding_type destinations_1415_1516_union (year in (@year)) , (ageband in (@ageband)) , (completion_status in (2, 3)) kindly let me know how resolve this i ran dbcc freeproccache command in ssms , re-ran report. works fine now....

google apps script - Invalid Argument on basic API call using UrlFetchApp.fetch(url) -

i'm new google apps scripts , i've been trying make simple call url. make call browser: https://accounting.sageone.co.za/api/1.1.1/supplier/get?apikey= {4cfeefe1-ce04-425f-82c3-dcb179c817d5}&companyid=164740 , respons i'm looking for. try make call google apps scripts using following code: function myfunction() { var url = 'https://accounting.sageone.co.za/api/1.1.1/supplier/get?apikey={4cfeefe1-ce04-425f-82c3-dcb179c817d5}&companyid=164740 var response = urlfetchapp.fetch(url); logger.log(response); }' i respons stating ' message details invalid argument: https://accounting.sageone.co.za/api/1.1.1/supplier/get?apikey= {4cfeefe1-ce04-425f-82c3-dcb179c817d5}&companyid=164740 (line 4, file "code")' i've tried whole bunch of permutations no luck... when using urlfetchapp, need enter url parameters part of request parameters rather in url itself. get request these go directy part of parameters, post request paramet