Posts

Showing posts from June, 2010

xcode - iOS simulator crashes every time I build my app EXC_BREAKPOINT(code=EXC_i386_BPT,subcode=0x0) -

i developing app , i'm done! i've run issue when build application, ios simulator crashes , xcode gives me this: libswiftcore.dylib`swift_dynamiccastobjcclassunconditional: 0x1032c0620: pushq %rbp 0x1032c0621: movq %rsp, %rbp 0x1032c0624: pushq %rbx 0x1032c0625: pushq %rax 0x1032c0626: movq %rsi, %rcx 0x1032c0629: movq %rdi, %rbx 0x1032c062c: xorl %eax, %eax 0x1032c062e: testq %rbx, %rbx 0x1032c0631: je 0x1032c064c ; swift_dynamiccastobjcclassunconditional + 44 0x1032c0633: movq 0x82756(%rip), %rsi ; "iskindofclass:" 0x1032c063a: movq %rbx, %rdi 0x1032c063d: movq %rcx, %rdx 0x1032c0640: callq 0x1032c31ca ; symbol stub for: objc_msgsend 0x1032c0645: testb %al, %al 0x1032c0647: movq %rbx, %rax 0x1032c064a: je 0x1032c0653 ; swift_dynamiccastobjcclassunconditional + 51 0x1032c064c: addq $0x8, %rsp 0x1032c0650: popq %rbx 0x1032c0651: popq %rbp 0x1032c0652: re...

unison - Git: validating data and/or recovering from sloppy file synchronization? -

i use git, , synchronize files, including git's metadata, among several machines using file synchronization utility (unison). mistakenly changed different files on 2 different machines, without synchronizing in between. i'm pretty sure have correctly reconciled files themselves, i'm not sure have correct git metadata reconciled set of files. is there should check consistency? should git commit newly reconciled set of files? as long have unison synchronizing all of git's metadata (by suppose mean stuff in project's .git directory), should fine git commit. update git's metadata using current version of conflicting file (the version want) , can sync these changes unison.

python - Tox: run tests only on certain platforms -

i have test sections in tox.ini should run on windows. how can configure tox run test section on specific platform? tox 1.8+ has introduced new platform setting. here's quote the docs . a testenv can define new platform setting. if value not contained in string obtained calling platform.platform() environment skipped.

css3 - Adding a :NOT selector to a CSS request -

this question has answer here: css negation pseudo-class :not() parent/ancestor elements 2 answers i have class: li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; } but don't want apply if contained elements class="k-list" <abc class="k-list"> not applied here </abc> how add :not above css? the best way override whatever added element if contained element class .k-list : li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; } .k-list li:before { display: none; } if, reason, want make sure @ least 1 of higher elements in dom not have class k-list (including html , body): *:not(.k-list) li:before { margin: 0 5px 0 -15px; color: #005984; content: "■"; } if knew wanted start such search, however, more specific , useful: body *...

c# - RadioButtonList alignment issue -

i have below code based on value backend have display radiobuttonlist listitem value , controls in aspx page. when rbl1.selectedvalue = "0" alignmnet of controls fine. when rbl1.selectedvalue = "1" radiobuttonlist coming center below, , want rbl align left side only. can body me in this. c#: public string hiddenclassname { get; private set; } if (!string.isnullorempty(value) && value.tolower() == "y") { rbl1.selectedvalue = "0"; //yes lblname.visible = true; txtname.visible = true; hiddenclassname = "display:block"; } else { rbl1.selectedvalue = "1"; //no lblname.visible = false; txtname.visible = false; hiddenclassname = "display:none"; } aspx: <h2> information</h2> <table width="100%"> <tr> <td> <asp:label id="lbl1...

ARMv7 assembly store values in an array -

i'm trying add user inputted number every element in array. had working until realized original array not being updated. simple, thought, store value array , move on life. sadly, doesn't seem quite simple. as title suggests, i'm using armv7 , writing assembly. i've been using this guide understand basics , have code at. when run example code given here works fine: str r2, [r3] puts whatever in r2 r3 points at. following attempt same thing gives me signal 11 occurred: sigsegv (invalid memory segment access) , execution stopped at: 0x0000580c str r3,[r5,#0] : @ loop , add value values in array regardless of array length @ setup loop @ r4 comes above , scanf value, i've checked registers , value correct mov r0, #0 ldr r1, =array_b ldr r2, addrarr loop: @ start loop add inputed number every value in array add r3, r2, r0 ldr r3, [r3] add r3, r3, r4 @ add input each index in array add ...

ios - How to set a tag to UICollectionView - SWIFT - Multiple CollectionViews on same screen -

i have multiple uicollectionview on same screen. know objective-c can set tag of each collectionview code below. can't figure out how same on swift [self.collectionviewone settag:1]; [self.collectionviewtwo settag:2]; [self.collectionviewthree settag:3]; //then inside "cellforitematindexpath" if tag equal then... if(collectionview.tag==1) { //... } self.collectionviewone.tag = 1 if(collectionview.tag == 1) { //... } is mean? it's same thing. that said, why not compare actual objects instead of using tags? if(collectionview == self.collectionviewone) { //... }

c# - What WP 8.1 XAML control could look and behave like the system Task switcher? -

i'm writing windows phone 8.1 store app , need create control looks , behaves similar wp 8.1 system task switcher (that appears when holding hardware button). it should show images , support sliding left or right when swiping. know control should use or need create new control scratch? so, sollution easy. control looking was... scrollviewer. has 2 properties in winrt xaml make scrollviewer scrolling behave wanted: horizontalsnappointsalignment , horizontalsnappointstype . if want try behavior, this msdn code sample expose you. one point mention. if wish set such behavior to, example, listview should firstly internal scrollviewer in code , set horizontalsnappointsalignment , horizontalsnappointstype properties. can use getfirstdescendantoftype<t>() extension method winrt xaml toolkit. var sv = mylistview.getfirstdescendantoftype<scrollviewer>(); sv.horizontalsnappointsalignment = snappointsalignment.center; sv.horizontalsnappointstype = snappoin...

c - How to calculate the length of output that sprintf will generate? -

goal : serialize data json. issue : cant know beforehand how many chars long integer is. i thought way using sprintf() size_t length = sprintf(no_buff, "{data:%d}",12312); char *buff = malloc(length); snprintf(buff, length, "{data:%d}",12312); //buff passed on ... of course can use stack variable char a[256] instead of no_buff . question: there in c utility disposable writes unix /dev/null ? smth this: #define forget_about_this ... size_t length = sprintf(forget_about_this, "{data:%d}",12312); p.s. know can length of integer through log ways seems nicer. since c simple language, there no such thing "disposable buffers" -- memory management on programmers shoulders (there gnu c compiler extensions these not standard). cant know beforehand how many chars long integer is. there easier solution problem. snprintf knows! on c99-compatible platforms call snprintf null first argument: ssize_t bufsz = snprintf(nul...

javascript - How can I create a scope function the return json in Angular? -

i have function this: $scope.getdays = function() { $http.post("core/ajax/loaddays.php").success(function(data){ return data[0].days; }); }; and in loaddays.php have json: [{"days":"1"}] if console log return correct: 1. but, problema when call on html code. recive looping erros : $rootscope:infdig how can this? sorry english read on concept of ajax (asynchronous javascript), because that's you're doing here. you should this: $scope.getdays = function() { $http.post("core/ajax/loaddays.php").success(function(data){ $scope.days= data[0].days; }); }; and use {{days}} in html. days filled data shortly after call getdays() , depending on how fast server request handled.

java - How to create jigsaw puzzle pieces using openGL and bezier curve? -

Image
i trying create jigsaw puzzle demo, , know of alternative ways of creating puzzle pieces without using mask. have jigsaw pieces taking full image, breaking image 4 pieces (lets puzzle 2x2) , storing , applying mask each piece. looks below // create standard puzzle pieces arrypieceendpos = new int[mcols][mrows]; arrypieceimg = new bitmap[mcols * mrows]; arryispiecelocked = new boolean[mcols * mrows]; int pos = 0; (int c = 0; c < mcols; c++) { (int r = 0; r < mrows; r++) { arrypieceimg[pos] = bitmap.createbitmap(mbitmap, c * mpiecewidth, r * mpieceheight, mpiecewidth, mpieceheight); arryispiecelocked[pos] = false; arrypieceendpos[c][r] = pos; pos++; } } i use helper method apply mask each piece private bitmap maskmethod(bitmap bmporiginal, bitmap bmpmask) { // adjust mask bitmap if size not size of puzzle piece if (bmpmask.getheight() != mpiecehei...

java - Creating a button dynamically with a user inputted title from different activity -

i'm trying learn little android programming on side, still beginner, appreciated, i'm sure isn't hard experience. what want able load activity, "add button" button. when add button clicked page links 3 user inputted strings (say str1, str2, str3). want able click button on second activity , have screen link original activity, new button added displaying "str1 str2 str3" , "add button" button underneath new one. i have managed first part , have created of fields , button on 2nd activity, don't know how go creating button on first activity dynamically , string desired. thank in advance!! in layout add button <button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="..."/> and in java try this: button mbutton = (button)findviewbyid(r.id.button); mbutton.settextsize(str1+str2+str3); and button click event: ...

git svn - Which layout to use for git-svn in a project with standard layout currently and non standard layout in past -

should use standard layout param ( -s ) git svn when our subversion repository adheres standard layout although not case of history? i'm trying import subversion repository git while history. more details first few years main project folders in root instead of trunk folder / - project folders in root '- e.g. apps '- components /branches /tags /trunk - empty after many years migration branch introduced , used few additional years / - project folders in root '- e.g. apps '- components /branches '- migration - long living branch used main project work time '- e.g. apps '- components '- few other branches (<3) /tags '- many tags releases for past 1 year current state conforms standard layout / - no files, no folders in root (except trunk, branches, tags) /branches '- oldmigration - migration branch renamed (moved) '- e.g. apps '- components '- few other branches (<5) ...

html5 - Div content vs Section content, your own Opinion -

this question has answer here: what difference between <section> , <div>? 12 answers well have html5, i'm wondering, if follow standards of html5 only, should use: <section></section> or <div></div> well teachers have problem answer on question, i'm asking guys, think? hear suggestions it. using yourself? found topic before wrote topic. didn't answer on question. div or section? thank you. have great day! div used wrapper identified class or id while section grouping of content within it. edit** div should used styling on section because div generic tag has no "meaning"

c++ - Programmatic way to see if a PC is connected to a specified network -

os: windows, language: c++ i'm implementing use case: when user starts software, software needs know if his/her pc connected specified network (e.g. college campus intranet). if yes, of software's features enabled. i'm new area , cannot tell reliable programmatic way. function getcomputernameex ( https://msdn.microsoft.com/en-us/library/windows/desktop/ms724301%28v=vs.85%29.aspx ) seems promising. if function works use case, data obtained function can rely on? thanks in advance! one of more reliable indicators presence of mac addresses: these visible inside lan, not on global internet. on nat'ted ipv4 networks mac address globally unique. on windows can try sendarp

Creat an image from Google Compute Engine instance -

i trying replicate new instance current instance in google compute engine (following google instruction: https://cloud.google.com/compute/docs/images#create_an_image_from_a_root_persistent_disk ). in step 3 (terminate instance), following instruction ($ gcloud compute instances delete example-instance --keep-disks boot). however, still asks me whether want delete instance: the following instances deleted. attached disks configured auto-deleted deleted unless attached other instances. deleting disk irreversible , data on disk lost. want continue (y/n)? n am still able recover instance or continue create image of current instance google's instruction? if body has try replicate google compute engine, please let me know. thank you! i tested command on account , deleted instance using " --keep-disks boot ". option keeps boot disk despite warning message says "attached disks configured auto-deleted deleted....." you can use developers console,...

vtd xml - VTD-XML Modifying huge files -

as know vtd-xml able process large /gb/ xml files. can use classes: - vtdgenhuge - vtdnavhuge - autopilothuge but unfortunately there no xmlmodifierhuge in api. question how can modify /some elements in xml tree inserted / large xml structure using vtd? thanks, ferenc i think maximum file size supported in java 2gb standard version of vtd-xml. however, might possible 64bit version of jvm. other option available in c version of vtd-xml...

ms access - loop updates table but also gets system exceeds resources error -

i running loop below in macro. finishes updating table "system resources exceed"... wondering wrong... or better way of doing it... dim rst dao.recordset set rst = currentdb.openrecordset("temp_group") rst.movefirst until rst.eof if isnull(rst!avgoft1_discount) rst.edit rst!avgoft1_discount = 0 rst.update end if if isnull(rst!avgoft2_discount) rst.edit rst!avgoft2_discount = 0 rst.update end if if isnull(rst!avgoft3_discount) rst.edit rst!avgoft3_discount = 0 rst.update end if if isnull(rst!avgoft4_discount) rst.edit rst!avgoft4_discount = 0 rst.update end if rst.movenext loop set rst = nothing it should work no errors, though simplified edit once per record: dim rst dao.recordset set rst = currentdb.openrecordset("temp_group") rst.movefirst until rst.eof if isnull(rst!avgoft1_discount.value + rst!avgoft2_discount.value + rst!avgoft3_discount.value +...

XML in Python and lxml -

i using pinnacle (betting) api returns xml file. @ moment, save .xml file below: req = urllib2.request(url, headers=headers) responsedata = urllib2.urlopen(req).read() ofn = 'pinnacle_feed_basketball.xml' open(ofn, 'w') ofile: ofile.write(responsedata) parse_xml() and open in parse_xml function tree = etree.parse("pinnacle_feed_basketball.xml") fdtime = tree.xpath('//rsp/fd/fdtime/text()') i presuming saving xml file , reading in file not necessary cannot work without doing this. i tried passing in responsedata parsexml() function parse_xml(responsedata) and in function tree = etree.parse(responsedata) fdtime = tree.xpath('//rsp/fd/fdtime/text()') but doesn't work. if want parse in-memory object (in case, string), use etree.fromstring(<obj>) -- etree.parse expects file-like object or filename -- docs for example: import urllib2, lxml.etree etree url = 'http://www.xmlfiles.com/examples/n...

reCaptcha works locally but not on PythonAnywhere -

locally on http://127.0.0.1:8000/ recaptcha works expected. when deployed pythonanywhere ("production") on form supposed work, "verify" (the label) nothing else. i have used keys google in db.py as: gluon.tools import recaptcha auth.settings.captcha = recaptcha(request, '6lehlgmtaaaaapmanzsnaayabmbr8amc6bzjajsu', '6lehlgmtaaaaakcaa8nuqsmdpjpaah_cir40o7g') i have added script google in layout.html , script google @ end of form recaptcha supposed be. i know locally recaptcha not checking public/private keys, , may explain why works locally, still - doing incorrectly ? ok...so issue on pythonanywhere side. once took care of whitelist - recaptcha works expected website hosted @ pythonanywhere. and....this feature part of free option (it used available paid sites). giles , conrad !

php - OOP maximum function nesting level -

i have weird situation oop my class simple class thing{ private $children = array(), $parent; public function addchild(self $thing){ $this->children[] = $thing; $thing->setparent($this); } public function setparent(self $thing){ $this->parent = $thing; $thing->addchild($this); } } $a = new thing(); $b = new thing(); $b->setparent($a); if try use these functions maximum function nesting level of 100 error , know why, how supposed change code? way makes sense, if remove of function calls not work should. as mentioned in comments, code creates infinite loop between setparent() , addchild() , wherein call setparent() implicitly calls setchild() , in turn calls setparent() again. if want code work such call setparent() or call addchild() enforces relationship in properties in both objects, can solve infinite loop experiencing adding if () condition inside addchild() , calling setparent() if object's p...

javascript - How does jQuery makes the jQuery object both a function and an object property? -

i've been wondering long time how jquery can both function , object property. you can use function, jquery(...) , can use property jquery.ajax(...) how can achieve such thing in javascript? functions objects in javascript. can have main function var $ = function() { alert('wat'); } and extend it $.fadeto = function() { alert('fadeto'); }

file - Check how many "," in each line in Perl -

this question has answer here: counting number of occurrences of string inside (perl) 4 answers i have check how many times "," in each line in file. have idea how can in perl? on moment code looks it: open($list, "<", $student_list) while ($linelist = <$list>) { printf("$linelist"); } close($list) but have no idea how check how many times "," in each $linelist :/ use transliteration operator in counting mode: my $commas = $linelist =~ y/,//;

Using variable values within different scenarios in a feature, capybara -

i have feature 4 scenarios. use value of 1 variable set in scenario 1 across different steps , in scenario 2. i use $ not set. assuming $ value remains same across feature when(/^the user goes manageusers, picks 1 of secondary users$/) click_link "admin" click_link "manage users" emailofuser=env["email"].to_s atpos = emailofuser.index('@') emailofuser = emailofuser[0,atpos] page.body.to_s.scan(/<td>(.*?)@abc.com<\/td>/).flatten().each |w| if "#{w}" != emailofuser $secondaryuseremail = "#{w}" + "@abc.com" break end end end when(/^the secondary user logs in password "([^"]*)"$/) |arg| if geturl != uri.parse(current_url) visit geturl end find(:xpath,"//input[@id='user_email']").set($secondaryuseremail ) fill_in "user_password", :with => arg click_button "sign in" end in above step, steps in 1 scenari...

csv - Python: Concatenate two dictReader strings for header row -

i'm trying create header row in results file first file's header row plus second file's header row. example: legacy file header row: (column a, column b ...) mapping file header row: (column c, column d ...) , results file should contain: (column a, column b, column c, column d) separated out text each each column. i'm having trouble coming proper way concatenate two. can see below "+" not valid. header row first row in file. suggestions appreciated. import csv open('legacyfile.csv', 'r') in_leg, open('mappingfile.csv', 'r') in_map, open('results.csv', 'wb') out_res: c1 = csv.dictreader(in_leg, delimiter=',', quoting=csv.quote_none, fieldnames=[]) c2 = csv.dictreader(in_map, delimiter=',', quoting=csv.quote_none, fieldnames=[]) #set headers , write header row output file headerlist1 = list(c1) headerlist2 = list(c2) c1.fieldnames = (headerlist1[0]) c2.fieldnam...

c# - Number of threads that can run in parallel on a single processor -

hello have started working threads in c# , have question not able clear answer. can multiple threads run in parallel on single core processor, or 1 thread can run @ time? i'm running following program on single core processor , see following output time: main called hello main done which makes me wonder if ran on multi core processor see output as: main called main done hello static void main(string[] args) { console.writeline("main called"); thread thread = new thread(sayhello); thread.start(); console.writeline("main done"); console.readline(); } public static void sayhello() { console.writeline("hello"); } a single-core processor can run 1 thread @ time, operating system uses mechanism switch between multiple running threads give appearance of concurrency. although threads aren't running in parallel, can never know when 1 thread stop , other start. the many pitfalls of multi-threading still p...

command line - How to Import modules without an Xcode project in Swift -

i using command line create swift files , using "swift" command in order run 1 of them. 1 file able access functions file. if c use #include macro , specify file is. swift's import statement doesn't seem allow that. there should way , know how it. for example: if have file function in , make file uses function. how allow use it? // file1.swift import foundation func sayhello() -> string { return "hello" } // file2.swift import file1 // <-- trying import file1 doesn't work println(sayhello()) once files have been made write "swift file2.swift" in terminal. tells me.. error: no such module 'file1.swift' clearly swift compiler looking module. how make file1 module? i've seen solutions take place in xcode. i'm looking in command line. // file1.swift func sayhello() -> string { return "hello" } // main.swift println(sayhello()) and terminal: $ swiftc file1.swift ma...

angularjs - Is there a way to define service on controller only -

i have global set angular app module: var app = angular.module('app', [], function ($interpolateprovider) { //$interpolateprovider.startsymbol('<%'); //$interpolateprovider.endsymbol('%>'); }); i include in pages angular stuff. i have controller loaded on page requires service called 'angularfileupload' : app.controller('fileuploadcontroller', ['$scope', 'fileuploader', function ($scope, fileuploader) { if place service inside module array, works fine. there way of attaching controller instead... means not have load script files every page using module regardless of if controllers require angularfileupload service or not. edit: regarding last comment if declare: var app = angular.module('app'); how add service module?

Database for Embedded Linux, and Architecture -

below architecture of applications. sensor↔parser app↔database↔application1↔ethernet↔server application2 , application3 same level of application1. database = sqlite3 problem many transaction occured on database system. parser app , applications queries whole range of database checking differences every second. so change architecture or database. is there database has better performance sqlite3? or part have change? i switch out sqlite3 in favor of mysql or postgresql, database systems meant handle multiple clients sqlite3 won't able because stored in single file. each (write) access therefore has block entire database instead of single row of table in question.

boolean logic - Combinational circuit: binary output one higher than input -

the question goes follows: design combinational circuit 3 inputs x, y, z, , 3 outputs a, b, c . when binary input 0, 1, 2, or 3, binary output 1 greater input. when binary input 4, 5, 6, or 7, binary output 2 less input. i'll honest in have not slightest clue on how start this. i'm guessing i'll using full adder of sort, being can add more 2 bits. first year of electrical engineering @ college, and, sadly, professor not great of teacher... any extremely appreciated, thanks! you not need create adder. to start, draw table of inputs , output: | *inputs * || * outputs * | | x | y | z || | b | c | |=========================| | 0 | 0 | 0 || 0 | 0 | 1 | | 0 | 0 | 1 || 0 | 1 | 0 | | 0 | 1 | 0 || 0 | 1 | 1 | | 0 | 1 | 1 || 1 | 0 | 0 | | 1 | 0 | 0 || 0 | 1 | 0 | | 1 | 0 | 1 || 0 | 1 | 1 | | 1 | 1 | 0 || 1 | 0 | 0 | | 1 | 1 | 1 || 1 | 0 | 1 | from here, should able create complicated formula each value of a, b, or c. each of these complicated for...

javascript - Angular Data Binding problems -

so want user coming portfolio enter first name on index.html page. welcome user on welcome page. how pass information index.html welcome.html. i'm novice @ angular, grateful! index.html: <header ng-controller="username myapp"> <form > <label><h1>enter first name: </h1></label> <input type="text" ng-model="user.name" name="clients" autofocus /> <button><a href="welcome.html">clickme</a></button> </form> <h1>{{user.name}}</h1> </header> welcome.html: <div class="container"> <div class="propic"></div> <div class="blurb">sfdvsdfvsdv <span ng-controller="firstctrl">{{data.message}}</span> fsdv sdfvsdfv sdf fs vsdfv sdfvf f vsdfv sdfv sfdv dsv fdv</div> </div> app.js: (function(){ var ...

objective c - UITableView reordered cells not retaining its state after scrolling -

i'm working on uitableview dynamic number of rows & sections. have stored data's (rows , section values) in nsmutabledictionary this. { fruits = [apple, orange, pineapple], cars = [ferrari, porsche, audi] } here fruits & cars section titles while values corresponding rows. fine. i'm following raywanderlich's tutorial here reorder uitableview cells within section long pressing row. works perfect. problem is, after reordering cells, when scroll bottom or top of table, reordered cells goes initial position. but, want them stay in reordered position after scrolling or reloading. ideas appreciated.

loops - R ddply rollingmean help: Need to capture rolling mean by Unique ID -

i'm struggling desired output using ddply. believe on right track think failing output data loop, inside loop... sample data: player, career_game, date, era, pitches gio gonzalez, 176, aug 1, 3.0, 86 gio gonzalez, 177, aug 5, 4.01, 89 gio gonzalez, 178, aug 10, 4, 11 gio gonzalez, 179, aug 16, 4.06, 102 gio gonzalez, 180, aug 21, 3.83, 97 ............... jordan zimmermann, 114, apr 4, 1.8, 81 jordan zimmermann, 115, apr 9, 8.1, 57 jordan zimmermann, 116, apr 14, 5.27, 93 jordan zimmermann, 117, apr 19, 3.92, 100 .............. ill call data frame, bb. so trying accomplish want average of previous, lets 5 games each player @ each instance... example far have code below.... pitchers_5 = data.frame(ddply(bb, ~player, tail, n=5, numcolwise(mean))) this calculates previous 5 games player (career_games 176 through 180). however, average each observation. career_game 177, code calculate mean games 172 through 176, sp...

javascript - Should I include the Google Map script tag on every page of my website? -

it seems if not include script tag google map on each page of website, error: "uncaught referenceerror: google not defined" . if include script tag on page there no map error "uncaught typeerror: cannot read property 'offsetwidth' of null" . maybe need sort of check system in javascript see if id exists? wasn't sure correct way of incorporating google map api? this javascript looks like: // google map function initialize() { var mapcanvas = document.getelementbyid('map-canvas'); var mapoptions = { center: new google.maps.latlng(44.5403, -78.5463), zoom: 8, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(mapcanvas, mapoptions) } google.maps.event.adddomlistener(window, 'load', initialize); include on every page intend use map. don't include elsewhere. fix javascript not things not need done. if don't intend render map, don't write code ...

add in - I have a copy of Microsoft Dynamics POS 2009. How do I extend it or make add-ins? -

i have copy of microsoft dynamics pos 2009. how extend or make add-ins? i've been trying search net answer question, i'm not turning anything. is there project type can install visual studio or that? i surprised @ how hard find sdk product. it's available microsoft dynamics registered partners. john saunders' third comment includes 1 of places found links sdk. page @ following link includes link sdk update pos 2009 sp1: http://www.microsoftdynamicsforums.com/forums/forum_posts.asp?tid=4067&title=pos-2009-sdk-where-is-it there isn't link sdk available through microsoft.com search field, have link data model, may helpful: https://support.microsoft.com/en-us/kb/975368 i assume down-voted question because "justin should have googled it," fact is... google didn't help. search john saunders posted in first comment not lead sdk within first ten pages of results. (this stackoverflow question showed on third page of results!) ten pag...

c++ - Access violation for a specific function -

i have many functions in customerlist.cpp file, 1 of doesn't work shown below (and break point marked comment). note: store class correct, , m_phead customerlist private variable (but shouldn't matter). bool customerlist::removestore(int id) { store *back, *temp; if(m_phead = null) { cout << "\nerror! store " << id << " not found in list!\n"; system("pause"); return false; // nothing delete } // search item delete = null; temp = m_phead; while((temp != null) && (temp->getstoreid() != id)) { = temp; temp = temp->m_pnext; } if(back == null) // delete first item in list { m_phead = temp->m_pnext; // function breaks here delete temp; cout << "\nsuccess! store " << id << " added list!\n"; system("pause"); return ...

perl - Why does perl2exe complain about "Unresolved symbol: Perl_Gthr_key_ptr"? -

in perl, error mean? unresolved symbol: perl_gthr_key_ptr i getting error while converting perl file binary using perl2exe on hp-ux pa-risc machine. /usr/lib/dld.sl: unresolved symbol: perl_gthr_key_ptr (code) /tmp/p2xtmp-9979/cwd.sl iot trap (core dumped) off top of head looks non-threaded perl trying load modules compiled threaded perl. edit: clarify, can compile perl support threads (threaded perl) or without support threads (non-threaded perl). if module built used threads , loaded perl without support threads produces above error. to check thread support in perl, search "thread" string in output of perl -v : perl -v | grep thread

Rails 4.2 - dependent: :restrict_with_error - access errors -

:restrict_with_error causes error added owner if there associated object rails association basics i have added following code: class owner < activerecord::base has_many :things, dependent: :restrict_with_error end my understanding when try delete owner has dependent things error should raised. in show action in owners_controller try access errors can not find them: def show @owner = owner.find(params[:id]) @owner.errors end update - delete code def destroy @owner = owner.find(params[:id]) @owner.destroy flash[:notice] = "owner deleted successfully" respond_with(@owner) end given code... def destroy @owner = owner.find(params[:id]) @owner.destroy flash[:notice] = "owner deleted successfully" respond_with(@owner) end def show @owner = owner.find(params[:id]) @owner.errors end at point trying access errors, there not any. errors temporary. not persist object, , not cross requests. exist on model in s...

d3.js - How to visualize the graph using d3Network in R -

i'm trying use package called d3network in r visualize network , used example in r : # load data data(mislinks) data(misnodes) # create graph d3forcenetwork(links = mislinks, nodes = misnodes, source = "source", target = "target", value = "value", nodeid = "name", group = "group", opacity = 0.4) it gives me bunch of scripts rather plot. saw example on internet , seems others have never come cross kind of issue. doing wrong or missing? , know how specify colour of source nodes , target nodes. thanks in advance it seems using d3network package old , not supported anymore. try using networkd3 package. the function name is: forcenetwork try this: library(networkd3) data(mislinks) data(misnodes) forcenetwork(links = mislinks, nodes = misnodes, source = "source", target = "target", value = "value", nodeid = "name", grou...

string - Multilevel parsing using shell command -

i have file in following format ///// name 1 start_occurrence: occurrence 1 occurrence 2 /// name 2 start_occurance: occurrence 1 occurrence 2 /// name 3 start_occurrence: occurrence 1 occurrence 2 occurrence 3 all need make count of number of occurrences each name , save them in csv file. can using combination of shell commands? yes can programmatically, looking bunch of shell commands in pipe lined fashion. " names " can anything. names not come pattern. catch line after /// name. occurrence not have number it, anyline starts occurrence or have occurrence subject of interest. awk 'c=="thisisname"{b=$0;c="";}$1=="///"{c="thisisname"}$0~/\<occurrence\>/{a[b]+=1;}end{for (i in a){print i" "a[i]}}' your_file_here explain: if match name start condition ($1=="///"), mark c thisisname. if name line (c=="thisisname"), mark name line b, , mark c name part ended(c="...

c# - String.Format Currency for K, M and B -

if currency amount large, i'm trying abbreviate it. for example: if (amt > 1000000) { decimal d = (decimal)math.round(amt / 1000, 0); return string.format("{0:c0}", d) + " k"; } if number given on 1 million, take off last 3 digits , replace k. works fine when currency symbol (like $ on left hand side) however, currency symbols put on right hand side. so instead of nice looking $100 k usd, i'd 100 € k french euros. how can change format put k after numbers, , before currency symbol. seems might step far. ideas? you can use currencypositivepattern determine if currency symbol comes before or after number. can modify currencysymbol suit needs. decimal amt = 10000000; thread.currentthread.currentculture = new cultureinfo("fr-fr"); //set france current culture numberformatinfo nfi = cultureinfo.currentculture.numberformat; string currencysymbol = nfi.currenc...

Adding column value dynamically in select statement SQL Query -

i have 2 sql tables below table1 servername downloaded failed rebootrequried server1 3 2 yes server2 4 1 no table2 servername administartor server1 john server3 alex i want join these 2 tables can extract administrator name out of table 2. if servername of table 1 not matching servername of table2 , want retain columns servername,downloaded,failed, rebootrequired, administrator(which null) . if servername matches columns should retained including administrator name table2? how can select statement in sql? pretty new ,and not sure how use conditional statement in sql you need use left join . join tables1 , table2 on servername . for more insight go through tutorials joins select servername,downloaded,failed, rebootrequired, administrator table1 t1 left join table2 t2 on t1.servername=t2.servername

android - Resume MediaPlayer after pressing Home Button -

i have mediaplayer streams music in background, when press home button music stops, want, when resume application, music not there anymore. , when current track ends, doesn't loop. my code following: mediaplayer backgroundmusic; int length = 0; //play background music backgroundmusic = mediaplayer.create(mainactivity.this, r.raw.background_music); backgroundmusic.start(); backgroundmusic.setlooping(true); @override protected void onpause() { super.onpause(); if(backgroundmusic.isplaying()){ backgroundmusic.pause(); length = backgroundmusic.getcurrentposition(); }else{ return; } } public void onprepared(mediaplayer backgroundmusic){ backgroundmusic.start(); backgroundmusic.seekto(length); } how can resume music stopped, when press home button, , make music loop. thanks in advance. try implement code service class if want player play in background or if want store position save data in static ...

How to check older WordPress versions? -

i want know how check if wordpress installation lower version. let's want check if wordpress installation below 3.4 . how do ? what important here version can 4.1.1 isn't float either. how check if version lower current version 4.1.1 ? <?php echo bloginfo('version'); ?> bloginfo('version') returns wordpress version. http://codex.wordpress.org/function_reference/get_bloginfo so based on comments in specific case be $wp_version = bloginfo('version'); $wp_version = substr('$wp_version', 0, 2); <-- gets x.x digits compare $wp_version_num = floatval($wp_version); if($wp_version_num <= 3.4) { echo "less equal"; } else{ echo "greater"; } what did here take string cut 1 decimal convert float wanted.

Styling ActionBar for Android -

i using xamarin.forms create ui cross platform app. have created actionbar in android. want style actionbar accordingly. currently, actionbar title displays on extreme left (as per default behaviour). have changed background color , text color. wish align title in center , make bold. here current resource file styling. <resources> <style name="mytheme" parent="android:theme.holo.light"> <!-- customize theme here. --> <item name="android:actionbarstyle">@style/myactionbar</item> </style> <style name="myactionbar" parent="@android:style/widget.holo.light.actionbar"> <item name="android:background">@color/actionbarbackground</item> <item name="android:titletextstyle">@style/titletextstyle</item> </style> <!-- action bar title text --> <style name="titletextstyle" parent="@android:style/...

ios - Is it possible using Foursquare API search places containing string? -

Image
i want search result google search. here if search 'tokyo' gives me 4 results containing place 'tokyo'. same functionality want using foursquare api. able find near places current position or given position. you need use https://api.foursquare.com/v2/venues/search endpoint , use query parameter return matches based on keyword. since you're on ios can use uitableview show results search suggestions or other libraries fit requirement. since autocomplete/autosuggest search, suggest try call endpoint on change event of text field delay. example using afnetworking library ios: afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; nsmutabledictionary *params = [[nsmutabledictionary alloc] init]; [params setobject:foursquare_clientid forkey:@"client_id"]; [params setobject:foursquare_clientsecret forkey:@"client_secret"]; [params setobject:searchtextfield.text forkey:@"query"]; [params setobj...

javascript - How hide/visible element in accordion -

Image
i want when accordion element visible span , img element display , when invisible not displayed. in fact user click on 1 of element display img , span add , when user slide toggle span , img hide. $("#accordion > li > div").click(function(){ if(false == $(this).next().is(':visible')) { $('#accordion ul').slideup(300); } $(this).next().slidetoggle(300); }); $('#accordion ul:eq(0)').show(); #accordion { list-style: none; padding: 0 0 0 0; width: 170px; } #accordion div { display: block; background-color: #ff9927; font-weight: bold; margin: 1px; cursor: pointer; padding: 5 5 5 7px; } #accordion ul { list-style: none; padding: 0 0 0 0; } #accordion ul{ display: none; } #accordion ul li { font-weight: normal; cursor: auto; padding: 0 0 0 7px; } #accordion { text-decoration: none; } <script src="https://ajax....

json - How can I show the need to specify a value in the x axis highchart? -

there same json data. i have tried show value in highchart extract values json data. scope.jsondata = [ { "name": "a", "categories": "03.01", "timestamp":"133409520000", "locate": "1", "value": 90 }, { "name": "a", "categories": "03.02", "timestamp":"133409530000", "locate": "1", "value": 110 },{ "name": "a", "categories": "03.03", "timestamp":"133409630000"...

ios - How to populate collection view with dynamic content -

Image
i apologise if question bit vague. the problem having this: have collection view 9 cells. each cell holds filtered version of uiimage , name of filter. reason index 7(case 7 in code) doesn't used , looks index 8 (case 8)is shown twice. here relevant methods: -(uiimage *)filteredimagefromimage:(uiimage *)image withfilterindex:(nsuinteger)filterindex{ ciimage *beginimage = [ciimage imagewithcgimage:image.cgimage]; // 1 cicontext *context = [cicontext contextwithoptions:nil]; cifilter *filter; switch (filterindex) { case 0: filter = [cifilter filterwithname:@"ciphotoeffectnoir" keysandvalues: kciinputimagekey, beginimage, nil]; break; case 1: filter = [cifilter filterwithname:@"ciphotoeffectmono" keysandvalues: kciinputimagekey, beginimage, nil]; break; case 2: filter = [cifilter filterwithname:@"ciphotoeffecttonal" keysandvalues: kc...

ruby - Array Alphabetical Sorting Without .sort -

i'm trying sort multiple strings alphabetical array without using .sort method. i've tried while loops, if statements, it's not working. i keep getting nil error on line 13 when comparing user_input array. don't know how fix , don't understand why it's happening. alpha_sorter = [' '] user_input = ' ' sort_counter = 0 puts 'type in many words want.' puts 'one word per line.' puts 'when done, leave line blank , press enter.' while (user_input != '') user_input = gets.chomp.downcase if (user_input <= alpha_sorter[sort_counter]) alpha_sorter.insert(sort_counter, user_input) sort_counter = 0 else sort_counter += 1 end end puts alpha_sorter my program using sort: alpha_sorter = [] user_input = ' ' puts 'type in many words want.' puts 'one word per line.' puts 'when done, leave line blank , press enter.' while (user_input != '') user_input ...

c# - Unsanitized XML from WebService, How to sanitize -

i have "xml" response webservice isn't sanitized. meaning contains illegal characters , special characters , html tags , hexadecimal . what's best way sanitize response? here xml example service. <root> <response> <type>e</type> <code>cmne_00034</code> <source>cmnq3030</source> <message>some valid message here.</message> <detail>error details here line 114: endif line 115: edit line 116: else > line 117: call lp_accept() line 118: return ($status) line 119: endif line 120: done<end of module> // invalid here @ cmnq3030.exec line 117: call lp_accept() @ gpcsy_run line 5: activate instancename."exec"( ) @ csyv1000.logon line 159: call gpcsy_run() </detail> </response> </root> i have tried lots of things, creating xmlreader has settings, this. public xdocument createxmldocument(string content...

html - How to divide bootstrap row into 5 equal parts? -

i want divide bootstrap row 5 equal parts . includes 12-col-md , how can divide equal 5 parts? can me solve problem? a great way resolve here ! by default bootstrap not provide grid system allows create 5 columns layout, can see it’s quite simple. @ first need create default column definition in way bootstrap it. called classes col-..-15. .col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 { position: relative; min-height: 1px; padding-right: 10px; padding-left: 10px; } next need define width of new classes in case of different media queries. .col-xs-15 { width: 20%; float: left; } @media (min-width: 768px) { .col-sm-15 { width: 20%; float: left; } } @media (min-width: 992px) { .col-md-15 { width: 20%; float: left; } } @media (min-width: 1200px) { .col-lg-15 { width: 20%; float: left; } } now ready combine classes original bootstrap classes. example, if create div element be...

jquery - iOS prevent scrolling with overlay -

i have wordpress site basic homepage structure this: <html> <head></head> <body> <div id="overlay"></div> <div id="scrolling-body"> //lots of stuff here </div> </body> </html> my css looks this: div.overlay { background:#000000; display:block; width:100%; height:100%; position:fixed; top:0px; bottom:0px; opacity:0; -webkit-transition: opacity 15s; -moz-transition: opacity 1s; -ms-transition: opacity 1s; -o-transition: opacity 1s; transition: opacity 1s; overflow-y:auto; -webkit-overflow-scrolling:touch; } div.overlay.active { z-index: 10000; opacity:0.4; } and toggle active class simple jquery. my issue when overlay active , can still scroll #scrolling-body on ios mobile devices. prevent scrolling on other devices ( scroll calculated when active toggled): $(window).scroll(...

javascript - Click Event Unbinded after Server Side Call -

i'm facing issue on click event of button. kindly have @ following javascript code. $(function () { uploadbtndisableevents(); function uploadbtndisableevents() { var buttonupload = $('#' + '<%= imgbtndocupload.clientid %>'); var txtfile = $('#' + '<%= filupload.clientid %>'); var txtname = $('#' + '<%= txtdocname.clientid %>'); buttonupload.on('click', function () { validatecontrols(txtfile, txtname)) { settimeout(function () { buttonupload.prop('disabled', true); buttonupload.removeattr('href'); }, 10); } }); var validatecontrols = function (file, docname) { ...