Posts

Showing posts from August, 2011

rust - How can I build just the core libraries (libstd, libcore, ...) from source, without building the whole compiler toolchain? -

my current work flow requires me rebuild rust compiler every day "standard crates" libstd target platform ( arm-unknown-linux-gnueabihf ). this not ideal. use nightly compiler, able target arm platform, not include standard libraries arm, host machines platform. how can build libraries source, without building whole compiler toolchain 3 compiler stages, llvm, jemalloc, etc...? can't i'm 100% sure, might work. run: rustc -v --version make note of commit-hash, navigate rust src folder , run: git checkout *your commit-hash* finally compile with: rustc -o --target=arm-unknown-linux-gnueabihf rust/src/libstd/lib.rs this should compile library current working directory. see http://spin.atomicobject.com/2015/02/20/rust-language-c-embedded/ original, , more detailed explanation.

c# - Programatically enable RichTextBox and show caret -

for application working on, have usercontrol added form programatically several times. part of usercontrol richtextbox set transparent , has click functionality disabled acts more label , blends user control. when user control deliberately clicked user, richtextbox's background changed white, isreadonly set false, , clicking enabled. the problem trying correct user still has click on richtextbox second time enable caret prior typing. googling , code attempts programatically set caret haven't worked. suggestions why below code isn't working? there else need do? contentbox.ishittestvisible = true; contentbox.background = new solidcolorbrush(color.fromrgb(240, 240, 240)); contentbox.isreadonly = false; //manage caret position textpointer newpointer = contentbox.caretposition; newpointer = newpointer.documentend; contentbox.caretposition = newpointer; i think missing setting logical , keyboard focus control afterwards. try dispatcher.begininvoke( ...

php - Laravel 5 - how to authenticate without email confirmation? -

i'm creating simple authentication system in laravel 5. have authentication code written in laravel 4 i'm using foundation. my problem is, sqlstate[42s22]: column not found: 1054 unknown column 'confirmed' in 'where clause' (sql: select * users email = myemail@gmail.com , confirmed = 1 limit 1) it looks laravel looking see if email verified. not need implement sign-up , verification process application. question is, how tell laravel not worry email confirmation? my authentication code looks this: public function postauthenticate() { // fetch posted credentials $email = \request::input('email'); $password = \request::input('password'); $remember = \request::has('_remember'); $credentials = [ 'email' => $email, 'password' => $password, 'confirmed' => 1 ]; // attempt log in user if (\auth::attempt($credentials, $remember)...

networking - Routing table interpretation -

given following table, network using 8-bit host addresses, asked compute associated range of destination host addresses every interface. asked number of addresses in every range. table: prefix match interface 00 0 010 1 011 2 10 2 11 3 i determined given prefixes of 8-bit binary ip's , concluded that: 00000000 00111111 (0-63 in decimal) uses interface 0 addresses in range = 2 power of (8 - number of bits in prefix, 2) = 64 01000000 01011111 (64-95 in decimal) uses interface 1 addresses in range = 2^(8-3) = 32 01100000 10111111 (96-191 in decimal) uses interface 2 addresses in range = 2^5 = 32 11000000 , higer (192+ in decimal) uses interface 3 addresses in range = 2^5 = 32 is reasoning correct? the number of addresses in each range 2 (8 - prefixlen) . if prefix has 2 bits, number of addresses 2 6 = 64.

javascript - How to convert nested setTimeouts to promises -

using rsvp.js or other promises/a+ implementation how can turn code like... console.log('step 1'); settimeout(function() { console.log('step 2'); settimeout(function() { console.log('step 3'); }, 100); }, 300); into promises implementation? create delay function returns promise , resolves after specified time elapses in settimeout , this function delay(time) { return new rsvp.promise(function (resolve) { settimeout(resolve, time); }); } and can invoke this console.log("step 1"); delay(3000) .then(function () { console.log("step 2"); return delay(1000); }) .then(function () { console.log("step 3"); });

javascript - Perform multiple clicks as long as user is hovering over an element in jQuery -

i have following jquery. once hover on next or previous arrows, clicks on them, making slider move. need modify code, keeps clicking long hovering, right now, once. $( "#slider .next, #slider .prev" ).hover( function() { $(this).click(); }, function() {} ); the slider uses jquery plugin called tiny carousel thanks this trigger click on elements every second: var clr; $(".next, .prev").hover(function (e) { clr = setinterval(function () { $(e.target).click(); }, 1000) }, function () { clearinterval(clr); }); jsfiddle example

Python Installing Cython & Numba but no vcvarsall.bat despite Visual C++ 2010 -

i use python 3.4 i try install cython , numba keep getting "unable find vcvarsall.bat". i googled solution , found need microsoft visual c++ 2010 installed (for python 3.4). so installed it. and tried installing cython , numba ---> fail. and must type "set vs90comntools=%vs100comntools%" in command prompt, did, c:\users\dorky>set vs90comntools=%vs100comntools%. and tried installing cython , numba again ---> fail. not enough that, went environment variables set vs90 vs100 thing manually. and tried installing cython , numba again ---> fail. so how can solve special "unable find vcvarsall.bat" problem? what heck special vcvarsall.bat user must install microsoft's programs in order use it? why not extract out vcvarsall.bat file independent file , copy&paste file or directory needs , not bother rest of software package? why not python team extract out vcvarsall.bat , incorporate python packages whenever user insta...

winforms - Passing Value from One Form to Another (C#) -

i have search form in program. when user double-clicks cell (of dgv) on search form, want program close form , jump item on main form. i'm doing identifying each item unique id. i'm trying pass value of rows id other form. problem that, says i'm passing value 0 each time. when insert message boxes on search form, says integer 'id' has been assigned variable on main form: public int celldoubleclickvalue { get; set; } here code: search form: private int id; private void searchdgv_celldoubleclick(object sender, datagridviewcelleventargs e) { this.rowindex1 = e.rowindex; this.id = convert.toint32(this.searchdgv.rows[this.rowindex1].cells["id"].value); invmain inv = new invmain(); inv.celldoubleclickvalue = this.id; this.dialogresult = dialogresult.ok; this.close(); //messagebox.show(inv.celldoubleclickvalue.tostring()); //above, shows got assigned successfully. } ...

html - Bootstrap Carousel auto-scrolls whole page when changing slides -

Image
i'm trying add bootstrap carousel our existing website www.121studios.ca. carousel works fine except page scrolls carousel lines top of browser. think has navbar , way auto-scrolls section select. https://jsfiddle.net/zocpu8oo/5/ this code navbar, i'm not sure why scrolls though carousel section isn't included. (quick note: carousel between section , membership section if makes different) (before click next) (after click next) <header id="header" class="light"> <!-- logo: delete "class="logo"" remove logo or upload own logo "assets/images". --> <a id="logo" href="#intro"></a> <!-- navigation: each item below must correspond "section" id's defined below. --> <ul id="navigation"> <li class="current"><a href="#intro">home</a></li> <li><a href="#a...

c# - how to assign int value to SELECT database string? -

i used dataadapter use select common choose rows of table oledbdataadapter objdataadapter = new oledbdataadapter("select * table daynum = @daynum", objconnection); //here daynum must equal 10; daynum = 10 i want assign integer value @daynum for example int intday = 10; objcommand.parameters.addwithvalue(intday.tostring(),"@daynum"); but don't work how can fix problem? remove .tostring() . try this: objcommand.parameters.addwithvalue("@daynum",intday);

css - dynamically position element with Less -

i have div (div1) shows on hover of div (div2) right , bottom of (sort of tool tip). when div2 happens close bottom of screen, div1 goes off screen (completely or partially). there way position div1 top of div2 depending on div2 located , purely less, no javascript. maybe other ways, without javascript. thank you. with pure css not possible @ current moment. still can without javascript. ugly , not reliable. consider next line more sport interest actual advice. can achieve so: determine on server side how space there between div2 , end of html content. make sure data client device can (like width , height) somehow user agent , consider them in calculation. calculate sizes of div1. bit easier, think. generate appropriate css

java - RabbitMQ messages shoing error : TypeError: queue.backing_queue_status is undefined ReferenceError: queue is not defined -

i working on java application communicates rabbitmq server. yesterday of message queues started behaving strangely. see nothing showing in following fields weird queues: policy , state and in fields "ready","unacked","toatal" see "?". while clicking on queues see following error message : typeerror: queue.backing_queue_status undefined referenceerror: queue not defined the biggest problem application dependent upon rabbutmq server. have separate thread running fetches details queues , job. moment tries fetch properties corrupted queues looks thread dies. not see exception . whole workflow stops. please me out. my application specifications : language : java framework : spring 3.x rabbitmq version : 3.3.1 framework used access rabbitmq : spring-rabbit-1.2.1

parsing - Can the antlr4 parser see matching opening and closing text pattern? -

i'm matching user-defined html-template tags (simplified): {% label %} ... {% endlabel %} the "label" alphanumeric value user can define himself, e.g.: {% mytag %}<div>...</div>{% endmytag %} is there way tell parser label start tag text has match endlabel end tag text? in other words, want invalid: {% mytag %}<div>...</div>{% endnotmatchingtag %} my lexer looks this: label : alpha (alpha|digit|underscore)* ; fragment underscore: '_' ; fragment alpha: [a-za-z] ; fragment digit: [0-9] ; end : 'end' endlabel : end label tagstart : '{%' tagend : '%}' ws : [ \t\r\n]+ -> skip ; and parser rule looks similar this: customtag: tagstart label tagend block tagstart endlabel tagend; (and block matches text or other tags recursively) right i'm checking match in listener, hopin...

node.js - heroku node js cleardb mysql fail : ER_ACCESS_DENIED_ERROR: Access denied for user -

today i'm pushing app on heroku, create database cleardb, configure using software (navicat premium) create tables. i start program, works on local side, , when try access database error : er_access_denied_error: access denied user 'xxxxxxxx'@'ip-xx-xx-xx-xxx.us-westxxxxxxxxxx' (using password: yes) i have read that's maybe port defined on navicat. this configuration : connection: { port : '3306', host : 'us-westxxxxxxxxxx', user : 'xxxxxxxx', password : 'xxxxxxxx', database : 'xxxxxxxx', charset :'utf8' } my configuration don't know error. thanks helping ! check endpoint data cleardb endpoint url looks dramatically different expect. the host piece after @. cleardb_database_url => mysql://[username]:[password]@[host]/[database name]?reconnect=true one thing notice specify port (i don't , works) , specify port ...

custom exception mapping in spring security xml -

i giving below snippet in spring security.xml <!-- exception mapping configuration --> <bean id="securityexceptiontranslationhandler" class="com.abc.xyz.exceptionmappingfailurehandler" > <property name="exceptionmappings"> <props> <prop key="org.springframework.security.authentication.credentialsexpiredexception">/408</prop> </props> </property> </bean> i getting error while starting tomcat saying : invalid property exceptionmappings of com.abc.xyz.exceptionmappingfailurehandler class :bean property exceptionmappings not writtable or has invalid setter method . what should content of com.abc.xyz.exceptionmappingfailurehandler class ? appreciated ! your class should work: package com.abc.xyz; public class exceptionmappingfailurehandler { public void setexceptionmappings(map mappings) { ...

c# - More effective way to change runtime terrain Unity? -

in unity game players able chop down trees using example axe. tree gets removed terrain , replaced falling tree prefab. works fine in small scale. looking more effective way though, because: the entire terrain needs reloaded if tree cut down. if terrain large , complex means entire game freezes few seconds whenever tree cut down. it works poorly in multiplayer. in order terrain stay in sync, players terrain needs reloaded each time tree cut down. means everyone's game freezes every few minutes. i have thought "chunking" terrain entire terrain built , don't know of way break parts after has been made. any ideas appreciated! i'm intermediate level programmer don't need write code me here, need idea or suggestion best way this?

java - Operation Time Out Error in cqlsh console of cassandra -

i have 3 nodes cassandra cluster , have created 1 table has more 2,000,000 rows. when execute ( select count(*) userdetails ) query in cqlsh, got error: operationtimedout: errors={}, last_host=192.168.1.2 when run count function less row or limit 50,000 works fine. count(*) pages through data. select count(*) userdetails without limit expected timeout many rows. details here: http://planetcassandra.org/blog/counting-key-in-cassandra/ you may want consider maintaining count yourself, using spark, or if want ball park number can grab jmx. to grab jmx can little tricky depending on data model. number of partitions grab org.apache.cassandra.metrics:type=columnfamily,keyspace={{keyspace}},scope={{table​}},name=estimatedcolumncounthistogram mbean , sum 90 values (this nodetool cfstats outputs). give number exist in sstables make more accurate can flush or try estimate number in memtables memtablecolumnscount mbean

events - jfxtras - CalendarPicker getDisplayedCalendar in EventFilter wrong -

i have calendarpicker eventfilter. in eventfilter want displayedcalendar calendarpicker.getdisplayedcalendar(), wrong date. last date before calendarpicker update displayedcalendar. it seems eventfilter executed before standard events of calendarpicker. and cannot use eventhandler because event consumed calendarpicker. for example: - see march 2015 in calendarpicker. - change month april 2015 - in calendarpiker.addeventfilter() calendarpicker.getdisplayedcalendar() "2015-03-01" - calendarpicker shows april 2015 how can execute standard events before eventfilter? here code: calendarpicker.addeventfilter(mouseevent.mouse_clicked, new eventhandler<mouseevent>() { @override public void handle(mouseevent event) { if (event.getbutton().equals(mousebutton.primary)) { calendar cal = calendarpicker.getcalendar(); if (cal != null) { selecteddate = cal.gettime(); log.debug(string.format("(selecteddate): %s" , selecteddate)); ...

asp.net - 400 Bad Request for OData -

i created .net 4.5 web project using visual studio 2012 test out using odata following this tutorial . however, whenever send following request fiddler: put http://localhost:14116/odata/products(5) http/1.1 host: localhost:14116 accept: application/json content-type: application/json content-length: 67 { "name" : "apple //e", "price" : "1298", "category" : "computer" } i following response: http/1.1 400 bad request cache-control: no-cache pragma: no-cache expires: -1 server: microsoft-iis/8.0 x-aspnet-version: 4.0.30319 x-sourcefiles: =?utf-8?b?yzpcdxnlcnnczgxhdmvsbgvczg9jdw1lbnrzxhzpc3vhbcbzdhvkaw8gmjaxmlxqcm9qzwn0c1xp rgf0yvrlc3qzxe9eyxrhvgvzddncb2rhdgfcuhjvzhvjdhmonsk=?= x-powered-by: asp.net date: wed, 01 apr 2015 14:37:41 gmt content-length: 0 what missing? (stack overflow removing 2 empty lines in http response.) this request works fine: get http://localhost:14116/odata/products?$filter=price+lt+500...

Insert files into HTML input programmatically via javascript -

is there way put file server file type input tag via javascript? way change value of text type input, want insert file file type input. i tried things like: var _file = new file(); document.getelementbyid('fileinputid').files[0] = _file; but seems filelist property of input protected , cannot change file objects inside it. i want bring file server , load file input. is there way achieve issue? thank y'all!

unix - Testing slob.c using malloc() -

i have altered slob.c gathers stats on last 100 small list allocations. made necessary edits make sure slob being used. i running test program calls malloc() 10,000 or 100,000 times on size of 20 bytes. but slob test results after test program runs states average claimed size 140 bytes (when expecting @ least somewhere near 20 bytes). what doing wrong, there way accurately test slob? i pretty sure stat collecting accurate, have had few professors check out me. current test program: int main() { char * ; int ; for( = 0; < 1000000; i++) { = (char*) malloc(20*sizeof(char)) ; if(a == null) printf("null\n") ; } //here print system call resulting stats memory claimed , free memory my original answer correct: char * ; int ; for( = 0; < 10000; i++) { = (char*) malloc(20*sizeof(char)) ; if(a == null) printf("null\n") ; } this simple code can used test how altered slob file allocates memory (co...

android - Remove SearchView search voice button line -

Image
thanks other related posts regarding searchview customisation able customise searchview point: now i'm trying add voice search , able change voice button background resource: int searchvoiceiconid = searchplate.getcontext().getresources().getidentifier("android:id/search_voice_btn", null, null); imageview searchvoiceicon = (imageview) searchview.findviewbyid(searchvoiceiconid); searchvoiceicon.setimageresource(r.drawable.ic_action_mic); searchvoiceicon.setbackgroundcolor(color.transparent); however, can't seem rid of line under voice search button. any suggestions???? thanks code: ((linearlayout)search.findviewbyid(r.id.search_voice_btn).getparent()).setbackgroundcolor(color.transparent);

Using an Enum as a flag in a class, Python -

i use enum represent internal state of class: #!/usr/bin/python3 enum import enum class testclass: class color(enum): red = 1 blue = 2 green = 3 def __init__(self): self.value = 0 def setvalue(self, color): self.value = color this thought possible implementation. 2 annoying things see are: to set value have : q = testclass() q.setvalue(q.color.red) and find q.color.red someway umpleasant, i'd rather have like: color.red or red . maybe way have use string comparison, trying avoid using enum. i method q.color.mro seems internal method of enum class. for? alternative #1: can have enum class string lookup you: def setvalue(self, color): self.value = self.color[color] usage: q = testclass() q.setvalue('red') reference: https://docs.python.org/3/library/enum.html#programmatic-access-to-enumeration-members-and-their-attributes alternative #2: if there no conflicts, ...

Get User Token and Secret with Google API in Android -

first of i'm noob android developer. came ios background , see android development driving me little crazy, apologies if i'm ask dumb question. i succesfully implemented "sign in google+" login in app , need information logged user. here can see data retrieved him. @override public void onconnected(bundle bundle) { log.d(tag, "connected google"); string accountname = plus.accountapi.getaccountname(mgoogleapiclient); log.d(tag, "user email: " + accountname); if (plus.peopleapi.getcurrentperson(mgoogleapiclient) != null){ person user = plus.peopleapi.getcurrentperson(mgoogleapiclient); log.d(tag, "user name: "+ user.getname().getgivenname()); log.d(tag, "user image: " + user.getimage().geturl()); log.d(tag, "user id: " + user.getid()); } } but need 2 more things: user's access token , user's access secret . i did similar on ios app i'm lost t...

TFS Eclipse Plugin detects wrong files edited -

eclipse tfs plugin says lot of files includes images (.png, vs..) have been edited although have made no change them when open "detect local changes" tab. understand files in bin/ folder supposed have been edited don't understand other files mentioned above seen edited tfs eclipse plugin. there idea of reason or solution it? when you're using server workspace, tfs treats file not have readonly bit set changed. that's how server workspaces work. if want tfs reflect contents of file need "undo unchanged", tfs automatically when check in (tfs never creates 2 revisions when both have exact same contents). or switch local workspace, in case tfs store copy of file in hidden folder, knows workspace version looked when tfs served you. tfs 2010 not support local workspaces. note tfs 2010 general support ends july 2015 , it's recommended upgrade tfs 2013u4 or tfs 2015 releases.

design patterns - JAVA: Choosing algorithm based on multiple dimensions -

i have instance of class address, have change according environment: 1) region: base class sub-classes regiona , regionb 2) site: base class sub-classes sitea, siteb , sitec 3) language: base class sub-classes languagea , languageb each subclass defines constraints address modification. problem each tuple (region, site, language) has define own modifier. so, have method adjust(address a, region r, site s, language l): void adjust(address a, region r, site s, language l){ if(r instanceof russia && s instanceof mailru && language instanceof russian){ a.set_street("abc") } else if(r instanceof russia && s instanceof mailru && language instanceof english){ a.set_street("fgh") } } what best design patter use in case? use polymorphism loose if s , instanceof s! use abstract factory pattern easier creation of street info. region , language (sub)products (resp. factories, w...

python - Django messages not working -

i trying use django's messages framework. i've done told in https://docs.djangoproject.com/en/dev/ref/contrib/messages/#enabling-messages i add messages messages.success(self.request, 'updated.') no messages shown. {% if messages %} evaluates false. if print {{ messages }} <django.contrib.messages.storage.fallback.fallbackstorage object @ 0x7fb701c47b70> . what can wrong? my middlewares middleware_classes = ( 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.auth.middleware.sessionauthenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ) my template context processors template_context_processors = [ ...

autorun - Can node webkit build in a single windows .exe file -

i have project need run in pen drive, content updated daily, , need automated way generate single file (.exe) downloaded users. i use tool https://github.com/mllrsohn/node-webkit-builder , when build windows, build generate multiple files ( dlls, dat ,exe ). this break automation because content need downloaded (single file). any help? as far know, can't. try making 7zip sfx archive , running own program instead of installer. this needs create temporal files when run (which deleted when program quits) , don't think can remove initial prompt. if you're okay that, might need. edit: can the necessary sfx modules here .

php - Multiple Laravel 5 and AngularJS Apps -

i'm working on project has multiple loosely coupled modules (20+) , have decided go laravel 5 , angularjs. i'm using yeoman angularify generator angularjs. can't decide on application structure, ideally want each sub-module different app easy developers work on separate apps independently. mylab/ app/ http/ controllers/ somecontroller.php # api's used across apps ... public/ bower_components/ angular/ bootstrap/ scripts/ angular.modules.js #custom modules used across apps .. resources/ views/ .. #landing page view sub-app1/ app/ http/ controllers/ subapp1controller #sub-app1 specific api's .. public/ bower_components/ repo1/ #specific sub-app1 ... resources/ angularapp1 #spa sub-ap...

java - why do we have to fix the duration for each measurement iteration? -

what timing iterations means ? @measurement(iterations = 50, time = 2) should time of measurement fixed, if iteration of measurement takes longer 2 seconds, iteration stopped ? if true impact have on measurements. the straightforward answer question is: "we have provide iteration time (or rely on default iteration time), because otherwise iteration never stop". depending on benchmark mode, meaning iteration time may different. example, javadoc says : /** * <p>throughput: operations per unit of time.</p> * * <p>runs continuously calling {@link benchmark} methods, * counting total throughput on worker threads. * mode time-based, , run until iteration * time expires.</p> */ throughput("thrpt", "throughput, ops/time"), there no way stop uncooperative execution in java, short of killing vm. (interrupting thread needs cooperation: there should check interruption). therefore, if @benchmark call takes longer re...

cron - Inside Docker container, cronjobs are not getting executed -

i have made docker image, dockerfile, , want cronjob executed periodically when container based on image running. dockerfile (the relevant parts): from l3iggs/archlinux:latest copy source /srv/visitor workdir /srv/visitor run pacman -syyu --needed --noconfirm \ && pacman -s --needed --noconfirm make gcc cronie python2 nodejs phantomjs \ && printf "*/2 * * * * node /srv/visitor/visitor.js \n" >> cronjobs \ && crontab cronjobs \ && rm cronjobs \ && npm install -g node-gyp \ && python=/usr/sbin/python2 && export python \ && npm install expose 80 cmd ["/bin/sh", "-c"] after creation of image run container , verify indeed cronjob has been added: crontab -l */2 * * * * node /srv/visitor/visitor.js now, problem cronjob never executed. have, of course, tested "node /srv/visitor/visitor.js" executes when...

java - Is it possible to have space between cells in iTextPdf? -

Image
does itextpdf allow set spacing between cells in table? i have table 2 columns , trying draw border-bottom on cell. want space between each border same cell padding. i using below code: pdfptable table = new pdfptable(2); table.settotalwidth(95f); table.setwidths(new float[]{0.5f,0.5f}); table.sethorizontalalignment(element.align_center); font fontnormal10 = new font(fontfamily.times_roman, 10, font.normal); pdfpcell cell = new pdfpcell(new phrase("performance", fontnormal10)); cell.setverticalalignment(element.align_middle); cell.sethorizontalalignment(element.align_left); cell.setborder(rectangle.bottom); cell.setpaddingleft(10f); cell.setpaddingright(10f); table.addcell(cell); table.addcell(cell); table.addcell(cell); table.addcell(cell); document.add(table); how do this? you want effect: that explained in my book , more in presspreviews example. you need remove borders first: ...

php - Automatically update SQL database when checkbox clicked -

i'm using php list out table sql database, , each of rows have checkboxes in them user keep track of whether or not part of row complete or not. i'd when checkbox checked or unchecked, sql database automatically update. possible, or need "save data" button @ end of each row? edit: clarify, i'm using php . if set onclick action of checkbox php/updatecheckbox.php?id=... , how know value of checkbox? also, wouldn't force page refresh? try this $fet['id'] id fetched db intimate modify. <a href=#><input type="checkbox" onclick="myfunction('.$fet['id'].');"> </a> <script> function myfunction(del) { var rmvfile=del; if (confirm("are sure want delete file?") == true) { if(del!='') { $.ajax({ type:'post', url:'query4.php', data:{rmvfile: rmvfile}, success:function(msg){ } }); } } } ...

facebook - How can I access the posts of my own fb page using graph api version 2.0 -

it want access posts of fb page owned me using graph api version 2.0 . know how it, have code issue facing need submit app review manage_accounts permission granted after app facebook can without getting app reviewed need tomorrow? i following error in graph api explorer query: query: me?fields=id,name,accounts{access_token} error the field 'accounts' accessible on user object after user grants 'manage_pages' permission. please let me know if there way around this? thank you it manage_pages , not manage_accounts . can use manage_pages role in app (admin, developer, tester). if want make app available users, have go through review process manage_pages . either way, have authorize user manage_pages , that´s error message tells you.

assembly - Calling C function from masm 64 -

i have problem assembly code (64 bit masm in visual 2013 on win8 64). when i'm calling c function (printf), throwing exception ntdll.dll. i'm doing wrong? how can read , write data console in 64 bit masm? can find tutorial masm 64 bit? extrn printf : proc .data format byte "arg1: %d", 10, 0 .code printdata proc mov rbx, 100 push rbx lea rax, format; format address push rax call printf; throw unhandled exception ntdll.dll - access violation reading location 0xffffffffffffffff. add rsp, 16 ;2* 64bit value ret printdata endp end p.s i'm calling printdata c++ code. the 64-bit calling convention ( https://msdn.microsoft.com/en-us/library/ms235286.aspx ) requires pass arguments starting in rcx, followed rdx, r8 , r9 if needed. in case need rcx store address of format, , rdx integer value want print.

mysql - Native query executeUpdate seems to commit data in Spring transaction -

my usecase following: when creating application user (entitymanager.persist) have create db user , grant him privileges (that's why need hibernate nativequery). i have spring @transactional method calls dao both calls: @transactional public integer createcompany(company company) throws exception { companydao.createreportuser(reportuser user); ... } my dao method looks this: getem().persist(companyreportsuser); getem().createnativequery("create user user1@localhost identified :password").setparameter("password", password).executeupdate(); getem().createnativequery("grant select on appdb.v_company user1@localhost").executeupdate(); //several grants now, first line executeupdate() executed can see persisted companyreportsuser in database along db user (user1@localhost). all nativequeries executed , commited 1 one. since commited, cannot rolled back. there no auto-commit parameter set anywhere in configuration assume 'false...

Apache Marathon app and container relation -

i understand relation between marathon app , container. so, marathon app definition can contain single container definition (1:1)? far understand marathon rest api, link attached, answer yes. https://mesosphere.github.io/marathon/docs/rest-api.html#post-/v2/apps but supposed use app groups in order define such complex applications built more single container? have checked kubernetes, , idea of "pod" in case seems convenient build such applications, composed multiple containers, containers in same pod have single network stack, , application scaling happens on pod level. can say, kubernetes pod corresponds marathon app group? or should not try find similarities, rather should better understand marathon philosophy? thank you! regards, laszlo an app in marathon specifies how spawn tasks of application. while can specify how many tasks want spawn, every single on of these tasks corresponds 1 command or container. to you, need understand more use case. ...

Changing locale of user in home page of Grails application -

i've been trying change user locale after logging in (i use spring security). i have tried changing locale in success event handler of spring security (oninteractiveauthenticationsuccessevent) , creating own localeresolver , registering on resources.groovy. it seems work fine pages except home page. this mylocaleresolver class mylocaleresolver implements localeresolver { def springsecurityservice private locale defaultlocale = null; @override locale resolvelocale(httpservletrequest httpservletrequest) { user user = user.findbyemail(springsecurityservice.authentication.principal.username) if (user && !defaultlocale) { if (user.lang) { this.defaultlocale = new locale(user.lang) } else { this.defaultlocale = locale.english } } println "defaultlocale = $defaultlocale" return this.defaultlocale } @override void setlocal...

node.js how to repreduce PHP MD5 encryption -

i'm converting existing php based website node.js app, , need reproduce encryption method php js. private static $_passwordsalt = 'd2g6iop(u(&§)%u§vuipu(hn%v/§Â§urerjh0ürfqw4zoöqe54gß0äq"lou$3wer'; public static function getcryptedpassword($password = 'password') { return sha1(md5(self::$_passwordsalt.$password)); } so far i've tried not return same results: userschema.methods.hashpassword = function(password) { var salt = 'd2g6iop(u(&§)%u§vuipu(hn%v/§Â§urerjh0ürfqw4zoöqe54gß0äq"lou$3wer' var md5hash = md5(password + salt); var hash = sha1(md5hash); return hash; }; please try these: var crypto = require('crypto'); var salt = 'd2g6iop(u(&§)%u§vuipu(hn%v/§Â§urerjh0ürfqw4zoöqe54gß0äq"lou$3wer' var password = 'pass'; var hashmd5 = crypto.createhash('md5').update(salt + password).digest("hex"); var hassha1 = c...

canvas - Absolute position click potion of zoomed image in android -

i want calculate un-scaled absolute position of image drawn on canvas based on position clicked user on scaled canvas. i used following zoom implementation translate/scale bitmap within boundaries? so far, public boolean inme(int x, int y, region clickregion) { if(mscalefactor == 0) mscalefactor = 1; float curx = ((x*1.0f)/ mscalefactor) - (mposx * mscalefactor); float cury = ((y*1.0f) / mscalefactor) - (mposy * mscalefactor); x = (int)curx; y = (int)cury; //clickregion grapics.region computed on non-zoomed coordinates if (clickregion.contains(x, y)) return true; else return false; } this works fine, when there no zooming, when zoomed there significant issues. edit this algo used zooming , panning. public class panzoomview extends view { public static final string tag = panzoomview.class.getname(); private static fin...

c# - Doxygen Documentation for WPF -

i in process of creating documentation c# code. i've done lot of ordinary source code , set doxygen create html out of it. arrived @ ui done in wpf, both xaml , source code. question is, best way document these files? comments possible in xaml not useful cannot nested. don't know if doxygen can possibly handle xaml documentation. should documented in xaml.cs files? i found more or less solution. @ first, have add file extension file_patterns , *.xaml in case. doxygen uses extension determine parser use. guess default c. next add documentation this: <!--> /** \file * \brief brief file description. * * more elaborated file description. */ --> the < !-- , --> comment section xaml files. when doxygen parses file removes documentation without adding it. that's why there > fool doxygen parser comment finished. know ugly worst can happen descriptions lost in documentation still available in files. long there no better way of doing stick this....

git - View a repository on every commit -

i want view repository first commit , kinda on press of button or may command ,transit next commit (the whole repo).i run code @ of commits . there tool or group of command so. i couldnt phrase question enough please comment. i run programs @ specific commit. this m doing understand design procedure of developer.(eg .how whole project put ?). i share readme of project based on idea . a code reader leverages power of github's commit feature animate process of code writing.it works tutor making each commit level reach , @ 100 % complete clone of given repo. in tutor mode can see next step , understand write code. new programmers learn how develop large applications , think in such pragmatic way. program , m more thinking of desktop application try make web app. that git filter-branch able do: --tree-filter <command> this filter rewriting tree , contents --index-filter <command> this filter rewriting index. similar tree filter not che...

udp - How to stream video in iOS app from GoPro HERO4? -

how stream video in ios app gopro hero4? able steam using gopro hero3. have tried several ways failed stream. to start streaming need execute url: http://10.5.5.9/gp/gpcontrol/execute?p1=gpstream&c1=start to stop: http://10.5.5.9/gp/gpcontrol/execute?p1=gpstream&c1=stop next can download streaming data using port udp 8554. unfortunately solution working old software version. last 1 02.00.00 not working.

visual studio - Overwriting local changes in Git -

i using git in visual studio , getting error when trying pull: an error occurred. detailed message: 1 uncommitted change overwritten merge however when try , commit won't let me because have pull first, it's vicious cycle. there doesn't seem on how fix error within visual studio. how can latest version on server , overwrite local changes? how can latest version on server , overwrite local changes? in team explorer window, in list of pending changes (that’s create commits), can right click on files , click “undo…” undo whatever local changes did files. should able pull. however, shouldn’t need pull commit. git commits local repository, state of other remote repository never considered commits. there "out going commits", when "sync" gives me error. the “sync” button in “unsyched commits” view push , pull. indeed requires not have uncommitted changes (that overwritten) in working directory. go “changes” view , make com...

database - SilverStripe CMS unpublish without user interaction -

a site of mine has strange behavior. time time of pages unpublished without user interaction. in page history there no entry activity. pages children of secured page. the unpublished pages not same. varies in page , in period. the apache access files give no information access outside. for testing changed content of these pages. after waiting few days 1 of these pages unpublished again. content of page did not change. can exclude possibility of nightly recovery of database provider. how can possible? system: silverstripe 3.1.12 (cms/framework) we can use onbeforeunpublish notify of when page unpublished debug problem. through sitetree extension. we declare sitetree extension in our config.yml file (or alternative yml file): sitetree: extensions: - sitetreeextension in extension class add onbeforeunpublish function email when ever page unpublished: class sitetreeextension extends dataextension { public function onbeforeunpublish() { ...

authentication - Yii2 Login from DB (Setting unknown property: app\models\User::password_hash) -

i want user authentication in yii based on user table in database. user model: <?php namespace app\models; use yii; use yii\base\notsupportedexception; use yii\db\activerecord; use yii\helpers\security; use yii\web\identityinterface; /** * model class table "user". * * @property integer $id * @property string $username * @property string $password * @property string $title */ class user extends \yii\db\activerecord implements identityinterface { public static function tablename() { return 'user'; } /** * @inheritdoc */ public function rules() { return [ [['username', 'password'], 'required'], [['username', 'password'], 'string', 'max' => 100] ]; } /** * @inheritdoc */ public function attributelabels() { return [ 'id' => 'userid...