Posts

Showing posts from February, 2015

javascript - tweenMax 'staggerFrom' and 'From' broken with requestAnimationFrame? -

for reason when use or staggerfrom requestanimationframe, animation jumps , acts if it's doing "to" tween. when use code outside of requestanimationframe, works fine. why this? need use within requestanimationframe because trigger tween when scroll @ position , need requestanimationframe determine position (i advised that's correct way instead of attaching scroll). here's tween: tweenmax.staggerfrom(".box", 1, { x:100, autoalpha: .5}, .5); i made quick codepen demonstrating issue.

javascript - If removeClass doesn't affect source code, what's the point? -

i have bunch of forms pattern: <form action="/go/special" method="post" target="_blank"> <input name="a" type="hidden" value="something"/> <input type="submit" class="general effect" value="click me"></form> for each form has special inside action, want remove effect class using jquery code: <script src="/js/colorbox.js"></script> <script> jquery(function($) { // find forms have "special" in action, find input, , add class $('form[action*="special"] input[type="submit"]').removeclass('effect'); }); </script> edit: effect class code: (jquery, document, window), $(document).ready(function() { $(".effect").click(function(t) { t.preventdefault(); var e = $(this).closest("form"); return $.colorbox({ href: e.attr(&

ruby on rails - Access to top domain cookies from subdomain application -

my vbulletin forum sets cookies on domain-name.com , , i'd read these cookies within rails app on beta.domain-name.com . how can this? if set cookie's domain to: .domain-name.com (dot @ beginning), can access it's cookies subdomains, if domain domain-name.com (withouth dot @ beginning) can access it's cookies domain.

About Javascript output in Google App Script -

i got problem output of code weird. wanna sum number. var reserve_num =0 var sheets = spreadsheet.getsheets(); for(var in sheets){ var reserve_sheet = sheets[i]; var num = reserve_sheet.getrange("d1").getvalue(); reserve_num += num; } //insert sheet("c6") 確認済 sheet.getrange("c6").setvalue(reserve_num); in code need calculation of variable 'num' got string. i'd know how fix it if line: var num = reserve_sheet.getrange("d1").getvalue(); is returning number string, can convert number string number number number() : var num = reserve_sheet.getrange("d1").getvalue(); var num = number(num); logger.log('typeof num: ' + typeof num);

python - How to convert neatly 1 size numpy array to a scalar? Numpy "asscalar" gives error when input is not a 1 size array. -

i have silly interest in how avoid following error in smart way (possibly using right numpy functions). in many ocasions need use numpy function find single item. however, item present more once, use indeces function in way in output simple variable (if appears once, either string or float) or array (if mutiple instances). of course, use len() in boolean check , perform conversion. however, know if there 1 step approach. had tought use asscalar however, function returns , error if input not 1 value array (i had hope return input value unchanged :/). here reproduction of error on second part of code import numpy np inventory = np.array(['eggs', 'milk', 'ham', 'eggs']) drinks = 'milk' food = 'eggs' index_item_searched = np.where(inventory == drinks) items_instore = np.asscalar(inventory[index_item_searched]) print 'the shop has', items_instore index_item_store = np.where(inventory == food) items_instore =

c# - How to create empty-conditional operator for collections similar to null-conditional operator? -

c# 6.0 introduced null-conditional operator, big win. now have operator behaves it, empty collections. region smallestfittingfreeregion = freeregions .where(region => region.rect.w >= width && region.rect.h >= height) .minby(region => (region.rect.w - width) * (region.rect.h - height)); now blows if where returns empty ienumerable , because minby (from morelinq ) throws exception if collection empty. before c# 6.0 solved adding extension method minbyordefault . i re-write this: .where(...)?.minby(...) . doesn't work because .where returns empty collection instead of null . now solved introducing .nullifempty() extension method ienumerable . arriving @ .where(...).nullifempty()?.minby() . ultimately seems awkward because returning empty collection has been preferable returning null . is there other more-elegant way this? imho, "most elegent" solution re-write minby make in minb

ruby on rails - Empty? fails on ActiveRecord with a default_scope( :order) -

occasionally want check whether person model has organizations. straightforward enough; use @person.organizations.empty? . however, coupled default_scope ( default_scope { order(:name) } ), error: activerecord::statementinvalid (pg::invalidcolumnreference: error: select distinct, order expressions must appear in select list line 1: ... "relationships"."person_id" = $1 order "organizat... ^ : select distinct 1 one "organizations" inner join "contracts" on "organizations"."id" = "contracts"."organization_id" inner join "relationships" on "contracts"."id" = "relationships"."contract_id" "relationships"."person_id" = $1 order "organizations"."name" asc limit 1): i'm using postgres db , (abbreviated) model setup looks follows:

Retrieve gdb option values -

is there way in gdb retrieve (not print) value of options logging file, logging redirect, etc.? why provide set command no command? why provide set command no command? rtfm . command called show , info .

while loop - im creating a c++ program where the user has 2 attempts in trying a password username combo. If they cant get it they program stops -

this error getting. moving on python c++ , huge adjustment. description of program: write program creates 3 or more valid username/password combinations, prompts user enter username , password. if combination valid, print confirmatory message. if combination invalid on first try, print warning message , let user try 1 more time (prompt them again username , password). if second try correct, print confirmatory message. if second try incorrect, print chiding message. in either case, halt program after second attempt. show output 3 cases: correct username/password on first attempt; correct on second attempt; incorrect on both attempts. $ g++ username_password.cpp -o username_password username_password.cpp: in function ‘int main()’: username_password.cpp:34:2: error: ‘else’ without previous ‘if’ else if (username != "veasy62" && username != "tveasy62" && username != "terriyon62" && password != "a65908" &&

javascript - CKEditor 4 in read only mode - removing buttons removes formatting -

i use ckeditor allow users create rich document want redisplay inside ckeditor instance other users. i want display content make control read don't want toolbars showing. if use removebuttons or of other methods remove these disabled toolbars lose formatting associated buttons. eg. if remove underline button lose underline formatting in content. is there way hide these buttons without losing formatting in content? that standard ck behaviour stated in acf documentation . when don't set allowed content ck binds toolbars in editor, removing buttons make acf strip html created such buttons. the solution is, in read-only editors, set ckeditor.config.allowedcontent allow tags you'll displaying.

java - unit testing Spring Web app with JConnect -

i having issue attempt unit test dao in webapp. have spring configuration set create datasource bean using sybase jconnect jdbc driver. problem can bean created when run app webapp. in trying run unit tests, receive: java.lang.classnotfoundexception: com.sybase.jdbc3.jdbc.sybdriver to further explain, here directory structure: src main -java - ...java files etc - resources -applicationcontext.xml -other config files - webapp -web-inf -jconn3.jar <---- putting here works, test doesn't have web-inf folder! -test -java -resources so how allow jconn3.jar recognized @ runtime unit tests? have tried putting in main/resources directoru, causes failure regardless of whether i'm running webapp or not. can see jconn3.jar gets copied target/classes directory on build, why jar not found @ runtime? seems way work keep in web-inf directory, how unit test dao depends on it. i using spring mvc , mav

go - what's the difference between decodeRuneInternal and decodeRuneInStringInternal -

in golang's std package, "func decoderuneinternal" , "func decoderuneinstringinternal" same except args, is: func decoderuneinternal(p []byte) (r rune, size int, short bool) func decoderuneinstringinternal(s string) (r rune, size int, short bool) why not define decoderuneinstringinternal as: func decoderuneinstringinternal(s string) (r rune, size int, short bool) { return decoderuneinternal([]byte(s)) (r rune, size int, short bool) } in utf8.go, decoderuneinstringinternal's implementations same decoderuneinternal. why? the 2 functions avoid memory allocation in conversion []byte(s) in case string function wraps []byte function or memory allocation in conversion string(p) in case []byte function wraps string function.

how to display huge data in new excel sheet using python -

from openpyxl import load_workbook wb=load_workbook('project_python.xlsx') sheet2=wb.get_sheet_by_name('sheet2') sheet3=wb.get_sheet_by_name('sheet3') sheet1=wb.get_sheet_by_name('sheet1') sheet3=wb.get_active_sheet() in range(3,6369): d1=(sheet1.cell(row=i,column=1).value) j in range(3,6369): d2=(sheet2.cell(row=i,column=1).value) if d1==d2: print(i,sheet1.cell(row=i,column=1).value,"same") else: print(i,sheet2.cell(row=i,column=1).value,"modified") i comparing 2 excel sheets i.e sheet1 , sheet2 , want display last 2 outputs in sheet3 on same workbook. how can that? to write in cell: sheet3.cell(column=1, row=1, value="something") put want .

Game loop in Swift (OSX) -

all i'm wanting update method time delta previous frame, every example i'm finding either swift on ios, or objective-c osx, or uses nstimer not recommended because doesn't sync display refresh. does spritekit on osx provide simple way update method once per frame in pure swift code? way without spritekit better.

c++ - `Class::Class() : a(0), b(1)` meaning -

this question has answer here: what weird colon-member (“ : ”) syntax in constructor? 12 answers what following mean? don't know search searching : gives me nothing... server::server(int port) : listen_sock(0), current_autogen_nickname(1) where listen_sock used later in: listen_sock = socket(af_inet, sock_stream, 0); and current_autogen_nickname not used. it means defining constructor class server declared 1 int parameter. class has fields listen_sock being set 0 , current_autogen_nickname being set 1 you defining constructor , using initializer list.

android - How to restrict user to select current or previous time for Today and select any time for past dates in time picker dialog -

as have written in title wanna restrict user select current or past time today , can pick time past dates . please tell me how in android. have added restriction date picker using setmaxdate(); method unable same in time picker please tell me how should this. try setmaxdate(system.currenttimemillis());

javascript - I was stored cookies in temp file on client machine for cross domain cookie issue. Is this right way to override on cross domain cookie issue? -

actually, suffered cross domain cookie issue in safari web browser in mac & iphone devices. so, create 1 temp file on client machine , save cookies in temp file 1 domain. , when try read cookies domain file in file made changes if cookies not set fetch cookies data temp file , again set cookies domain. it's work successfully. right way overcome on issue?.

events - EventListener not working on custom component in Java -

i'm trying draw shape responsive mouse events, thought of extending awt.component can registered event listeners ain't working, although compiles no errors. import java.awt.component; import java.awt.event.*; class ball extends component{ public ball(){ this.addmouselistener(new mouseadapter(){ public void mousepressed(mouseevent e){ // event triggered } }); } } here's example i'm testing on applet using appletviewer (for learning purpose): import java.applet.applet; import java.awt.graphics; import java.awt.component; import java.awt.event.*; public class test extends applet{ ball ball; public void init(){ ball = new ball(); } public void paint(graphics g){ ball.paint(g); } } class ball extends component{ int x, y; public ball(){ x = y = 50; this.addmouselistener(new mouseadapter(){ public void mousepressed(mouseevent

android - Text align vertical doesn't work in tags -

Image
i have problem vertical alignment. codes below; <?xml version="1.0" encoding="utf-8"?> <co.hairmod.android.post.create.tokenlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="20dp" android:layout_width="wrap_content" android:orientation="horizontal" android:gravity="center_vertical"> <relativelayout android:layout_width="wrap_content" android:layout_height="20dp"> <textview android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="20dp" android:background="@drawable/catalog_tag_textview_cornered" android:textcolor="@android:color/white" android:textsize="14dp" android:paddingleft="23dp" android:paddingright="10dp" android:text="deneme&

javascript - Why jQuery hide() not work but fadeOut() works? -

jsfiddle why hide() not working? when try change hide() fadeout() it's working. why? $(document).ready(function() { $(".toggle").hover(function() { $(".submenu").hide(); $(this).find(".submenu").first().show(); $(".hlavnakategoria").removeclass("active"); $(this).addclass("active"); }); $(".submenu").mouseleave(function() { $(".submenu").hide(); // whi not work?? try change fadeout() }); }); @import url(https://fonts.googleapis.com/css?family=open+sans:400,800,600,700&subset=latin,latin-ext); html, body { margin: 0; padding: 0; font-family: 'open sans', sans-serif; font-size: 11pt; } html { width: 100%; height: 100%; background: rgb(255, 255, 255); background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(229, 229, 229, 1) 100%); background: -webkit-linear-gradient(top, rgba(255, 255, 255,

java - Cannot parse XML message with JAXB org.springframework.oxm.UnmarshallingFailureException -

Image
i using following code parse soap response receiving unmarshallingfailureexception, changed @xmlseealso @xmlrootelement problem still persists. wsdl here . caused by: javax.xml.bind.unmarshalexception: unexpected element (uri:"elsyarres.api", local:"searchflightsresponse"). expected elements <{elsyarres.api}inbound>,<{elsyarres.api}leg>,<{elsyarres.api}legs>, <{elsyarres.api}outbound>,<{elsyarres.api}request>,<{elsyarres.api}response>, <{elsyarres.api}searchflights>,<{elsyarres.api}soapmessage> code @xmlrootelement(name = "soapmessage") @xmlaccessortype(xmlaccesstype.field) public class wegolosoapmessageresponse { @xmlelement(name = "username") private string username; @xmlelement(name = "password") private string password; @xmlelement(name = "languagecode") private string languagecode;

haskell - cabal misconfiguration for tests -

my .cabal file contains following hspec configuration: -- name of package. name: mymodule version: 0.1.0.0 cabal-version: >=1.10 ... test-suite my-tests ghc-options: -wall -werror cpp-options: -dtest default-extensions: overloadedstrings type: exitcode-stdio-1.0 main-is: hspectests.hs hs-source-dirs: tests build-depends: mymodule, base >= 4.8 && < 4.9, containers >= 0.5 && <0.6, split >= 0.2 && < 0.3, hspec default-language: haskell2010 my directory structure follows: myproject | - src | - main.hs | - other.hs | - tests | -hspectests.hs | - dist | - myproj.cabal when run cabal build , source build succesfully executable ./dist/build/myproj/myproj . cabal build fails with: cabal: can't find source hspectests in dist/build/my-tests/my-tests-tmp, tests insp

intellij idea - Scala - Cannot resolve symbol - Looping through map -

i doing programming in scala looping through map. below code works fine. val names = map("fname" -> "robert", "lname" -> "goren") for((k,v) <- names ) println(s"key: $k, value : $v") when looping through map, if give (k,v) instead of (k,v), program not compiling. gives cannot resolve symbol error. below loop - for((k,v) <- names ) println(s"key: $k, value : $v") i executing program in intellij idea 15 scala worksheet. can please explain reason error. it doesn't compile same reason code doesn't compile: val (a,b) = (1,2) // error: not found: value // error: not found: value b but does compile: val (a,b) = (1,2) // a: int = 1 // b: int = 2 constant names should in upper camel case. is, if member final, immutable , belongs package object or object, may considered constant method, value , variable names should in lower camel case source: http:/

email - SMTP server not working, running on Node.js with Mailin package -

Image
i followed mailin docs haven't been able make work. my domain is: aryan.ml i'm using amazon route 53 dns configurations. here's screenshot of that: on app.js file i'm running sample code given official mailin docs well. code under "embedded inside node application" heading @ http://mailin.io/doc var mailin = require('mailin'); mailin.start({ port: 25, disablewebhook: true // disable webhook posting. }); /* access simplesmtp server instance. */ mailin.on('authorizeuser', function(connection, username, password, done) { if (username == "johnsmith" && password == "mysecret") { done(null, true); } else { done(new error("unauthorized!"), false); } }); /* event emitted when connection mailin smtp server initiated. */ mailin.on('startmessage', function(connection) { /* connection = { from: 'sender@somedomain.com', to: 'some

android studio - not able to find bugs in Log cat -

Image
i'm not able find bugs in logcat , throwing out of memory it oom problem bitmap, think need search reason problem. caused size of bitmap large think.

how to loop through gridview android -

i creating calendar in android uses gridview, have listview contains selected dates. need have compare each data every item listview gridview. how do it? here adapter: public class calendaradapter extends baseadapter { private context mcontext; private java.util.calendar month; public gregoriancalendar pmonth; // calendar instance previous month /** * calendar instance previous month getting complete view */ public gregoriancalendar pmonthmaxset; private gregoriancalendar selecteddate; int firstday; int maxweeknumber; int maxp; int calmaxp; int lastweekday; int leftdays; int mnthlength; string itemvalue, curentdatestring; dateformat df; private arraylist<string> items; public static list<string> daystring; private view previousview; public calendaradapter(context c, gregoriancalendar monthcalendar) { calendaradapter.daystring = new arraylist<string>(); loc

php - Laravel 5.2 - Session::get not working -

i want display 'falsh-message' user start redirect him in routes.php following code : route::get('/alert',function () { return redirect()->route('home')->with('message', 'this test message!'); }); in alerts.blade.php include in home view read message with: route::group(['middleware' => ['web']], function () { route::get('/alert',function () { return redirect()->route('home')->with('message', 'this test message!'); }); }); my session set under storage\framework\sessions following code : a:5:{s:6:"_token";s:40:"8304u3fjr9ehva88qmvgqngcgducwozj9lrhadph";s:7:"message";s:23:"this test message!";s:5:"flash";a:2:{s:3:"new";a:0:{}s:3:"old";a:1:{i:0;s:7:"message";}}s:9:"_previous";a:1:{s:3:"url";s:22:"http://localhost/alert";}s:9:"_sf2_meta"

java - JavaFX thread does not die although I set Platform.setImplicitExit(true)? -

in application used javafx.stage.filechooser , javafx thread start. frame i set default close operation windowconstants.dispose_on_close . when user exit application gui disappear application continue running because of javafx thread still being alive. interesting thing i set platform.setimplicitexit(true); . documentation of function says:"if attribute true, javafx runtime implicitly shutdown when last window closed;", did not happen. problem solved setting default close operation windowconstants.exit_on_close or using javax.swing.jfilechooser instead of filechooser. i have fixed it, interested , understand why javafx thread did not shutdown though set implicit exit , nothing opened. here small example program (click button->close file chooser->close application): public class jfxproblm { public static void main(string[] args) { eventqueue.invokelater(() -> { new myframe(); }); } private static class myframe exte

android - IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class -

i'm getting ise when call cookiemanager.getinstance().getcookie(url) i/dalvikvm( 1022): java.lang.illegalstateexception: call cookiesyncmanager::createinstance() or create webview before using class i/dalvikvm( 1022): @ android.webkit.jniutil.checkinitialized(jniutil.java:45) i/dalvikvm( 1022): @ android.webkit.jniutil.getdatabasedirectory(jniutil.java:66) i/dalvikvm( 1022): @ android.webkit.cookiemanager.nativegetcookie(native method) i/dalvikvm( 1022): @ android.webkit.cookiemanager.getcookie(cookiemanager.java:496) i/dalvikvm( 1022): @ android.webkit.cookiemanager.getcookie(cookiemanager.java:460) could please point me out why happens , how resolve it? thanks lot in advance!

How to define Union polymorphic data structure's instance in Typed Racket? -

from typed racket guide , define union type, use (define-type some-type (u type1 type2)) . to define polymorphic data structures, use (define-type (opt a) (u ...)) . i want define polymorphic binary tree (define-type (tree a) (u (leaf a) node)) (struct (a) leaf ([val : a])) (struct node ([left : tree] [right : tree])) (define t1 (leaf 5)) (define t2 (leaf 8)) (define t3 (node t1 t2)) i wondering why type of t1 leaf not tree , , how make tree ? > t1 - : (leaf positive-byte) #<leaf> when this: (define-type (tree a) (u (leaf a) node)) you're defining tree type constructor. shouldn't think of tree type, (tree some-concrete-type) type. rename treeof : (define-type (treeof a) (u (leaf a) node)) (struct (a) leaf ([val : a])) (struct node ([left : treeof] [right : treeof])) now problem clearer. node struct expects treeof , tree of what? want this: (define-type (treeof a) (u (leaf a) (node a))) (struct (a) leaf ([val : a])) (struct (a) node

javascript - AngularJS call function from controller in Drag & Drop directive -

i have directive natively drag & drop angularjs , working fine: mydesigner.directive('draggable', function() { return function(scope, element) { // gives native js object var el = element[0]; el.draggable = true; el.addeventlistener( 'dragstart', function(e) { e.datatransfer.effectallowed = 'move'; e.datatransfer.setdata('text', this.id); this.classlist.add('drag'); return false; }, false ); el.addeventlistener( 'dragend', function(e) { this.classlist.remove('drag'); var uielement = $(e.target); console.log(uielement); if(uielement.attr('id') === 'design-navbar') { $(e.target).removeclass('k-item k-state-default k-first'); $(e.target).children().removeclass('k-link k-state-hover'); $(e.target).css('border', '1px solid black'); } return false; }, false ); el.addevent

How To Skip "Cross Origin Requests" Using JavaScript/JQuery? -

i trying read .xml file feed using javascript/jquery in pc show data on browser. can view feed.xml file online saved googleblogxmlfeed . when tried read via following codes in index.html file in same folder feed.xml file is... <script src="http://code.jquery.com/jquery-2.2.0.min.js"></script> <script> $.ajax({ url: "feed.xml", success: function(xml){ var xmldoc = $.parsexml(xml), $xml = $(xmldoc), title = $xml.find("title").text(); alert(title); } }); </script> but on opening file in chrome, getting below error. xmlhttprequest cannot load file:///d:/feed.xml cross origin requests supported protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. i not using server/host wamp,iis,xamp etc. there way remove error , read file data normal xml...??? no. chrome not allow cross-origin requests files loa

pandas - Ingest data once in python -

i have dataframe in python contains of data binary classification. ingest data in 2 iterations - once of data of 1 class , of data of other class. run randomisation of rows. problem have every time rerun script rows data frame recreated , randomised creating unreproducible results. should run dataframe creation , randomisation external file? there common practices data ingestion in model building? i haven't tried attempted in regard. wondering if makes sense statistical point of view or common practice ? try such as: import data_ingest data_ingest.function_data_call() but again every time run script calls external script forms data , randomises it. not solution looking for. i can't show example, loading in documents (text files) - document binary classification. structure of dataframe following: row| content | class -------------------------------------- 1 | sky blue | 0 2 | river runs deep purple| 0 3 | yellow fever |

android - When is SQLiteOpenHelper onCreate() / onUpgrade() run? -

i create tables in sqliteopenhelper oncreate() receive sqliteexception: no such table or sqliteexception: no such column errors. why? note: (this amalgamated summary of tens of similar questions every week. attempting provide "canonical" community wiki question/answer here questions can directed reference.) sqliteopenhelper oncreate() , onupgrade() callbacks invoked when database opened, example call getwritabledatabase() . database not opened when database helper object created. sqliteopenhelper versions database files. version number int argument passed constructor . in database file, version number stored in pragma user_version . oncreate() run when database file did not exist , created. if oncreate() returns (doesn't throw exception), database assumed created requested version number. implication, should not catch sqlexception s in oncreate() yourself. onupgrade() called when database file exists stored version number

r - joining strings in a table according to values in another column -

this question has answer here: collapse text group in data frame [duplicate] 2 answers i got table this: id words 1 school. 2 hate school. 3 cakes. 1 cats. here's want do, joining strings in each row according id. id words 1 school. cats. 2 hate school. 3 cakes. is there package in r? we can paste 'words' grouped 'id'. can done of group operations. 1 way data.table . convert 'data.frame' 'data.table' ( setdt(df1) ) , operation mentioned above. # install.packages(c("data.table"), dependencies = true) library(data.table) setdt(df1)[, list(words = paste(words, collapse=' ')), = id] a base r operation use aggregate aggregate(words~id, df1, fun= paste, collape=' ')

laravel - Lumen, authentication attempt always returns false (jwt or auth) -

i made small api php lumen framework. now i'm integrating jwt authentication (following tuto http://laravelista.com/json-web-token-authentication-for-lumen/ ) application attempt login, returns false... it doesn't seem problem jwt directly because token generation works login doesn't work. saw, jwt use lumen auth:: login, sure tried login auth::attempt() directly instead of jwtauth::attempt , result false too... here code: try { $validation = $this->validate($request, [ 'email' => 'required|email', 'password' => 'required' ]); $credentials = $request->only('email', 'password'); $isauthenticated = auth::attempt($credentials) || jwtauth::attempt($credentials); $user = user::first(); $token = jwtauth::fromuser($user); $result = [ 'isauthenticated' => $isauthenticated, 'token' => $token ]; // ... catch exceptions + return $result

git - When should I not use patience diff? -

what `git diff --patience` for? explains how patience diff may better myers (the default one). is there reason against using default? name hints may noticeably slower, speed issues mentioned in examples of different results produced standard (myers), minimal, patience , histogram diff algorithms running time never issue me - real problem massive files or other pathological situations? patience algorithm has poor result cases (like https://gist.github.com/roryokane/79b8ebcb3813ebd934c4 ) @ least in experience better on typical source code diff (cases https://gist.github.com/roryokane/6f9061d3a60c1ba41237 ) - though entirely own observation, of noticed result may placebo.

erlang - jsx:decode json into string value instead of binary -

i read doc of jsx removed post_decode option because prevented evolution of jsx. so what's option if want post_decode can do. example, can have function convert binary value string value option. f = fun(e) when is_binary(e) -> binary_to_list(e) end, jsx:decode(binaryjsonstring, [{post_decode,f}]). how do now?

.htaccess - codeigniter htaccess 301 -

hi have normal htaccess file codeigniter , want 301 1 url another i've had obfuscate links able post :( ie h2tp://www domain com/controller/method/value1 ->h2tp://www domain com/controller/method/value2 but i'm having hell of time... here's htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^(home(/index)?)/?$ / [l,r=301] rewriterule ^(.*)/index/?$ $1 [l,r=301] #removes trailing slashes #had remove ajaxquery search else fails rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !(search/ajaxsearch) rewriterule ^(.+)/$ $1 [l,r=301] #rewrite non-www www based filenames #should rid of canonical issues rewritecond %{http_host} ^domain\.es [nc] rewriterule ^(.*)$ http://www.domain\.es/$1 [r=301,l] #removes access system folder users. #additionally

java - Constructor this() unnecessary? -

there class u1 extending class u. class u empty... in constructor of u1 there first line, calling constructor of superclass... public u1(plate plate, int order) { super(plate, order); ... } now want delete class u1 , in class u whatever done in u1 far... so, not need call constructor of superclass since class u not gonna have superclass... is this(plate, order) unnecessary , can omit it? this how constructor of u gonna like: public u(plate plate, int order) { this(plate, order); ... } it unnecessary , expect results in stack overflow, because call constructor within constructor.

android - Prevent mocked GPS position from reverting to real values -

i'm developing mock location application myself , had success far. can set de desired location , shown in google maps. my problem location switches real location provided gps module of nexus 7 lte (2013) android 6.0.1. i set location service device , use provider locationmanager.gps_provider this use set desired location: newlocation.setlatitude(lat); newlocation.setlongitude(lon); newlocation.settime(system.currenttimemillis()); newlocation.setelapsedrealtimenanos(systemclock.elapsedrealtimenanos()); newlocation.setspeed((float) (speed / 3.6)); accuracy = (float) generaterandomdouble(accuracy_min, accuracy_max); newlocation.setaccuracy(accuracy); newlocation.setaltitude(altitude); what did try solve this: setting new location every 200ms setting time stamps future setting accuracy 1 similar questions location mocking mock gps location issue didn't either. what noticed jumps occur less if gps can't signal. does have suggestions on how avoid 'j

php - $_POST is empty even though I can see the $_POST data in firebug post, html, and response tabs -

so i'm grabbing state of jquery date picker , dropdown select menu , trying send 2 variables php file using ajax. var_dump($_post); results in on webpage: array(0) { } but, when @ net panel in firebug, can see post , urls , shows post, response, , html showing variables sent php file, when dumping, shows nothing on page. i've been looking through other similar issues on has led me changing php.ini file increase post size , updating ajax call use json objects , parse through on php side. currently i'm trying passing string work, , code looks this: ajax: $("#submit_button").click(function() { // date if selected var selected_date = $("#datepicker").datepicker("getdate"); // show id if selected var selected_dj = $("#show-list").val(); // put variables json object var json = {demo : 'this simple json object'}; // convert json var post_data = json.stringify(json); //

How to develop firefox add-on -

Image
i developing firefox add-on using sdk, , use jpm run test it. but everytime changed someting in code, have close browser , use jpm run start browser , test it. can update without restart firefox? i have made search on google, people told me should use extension auto-installer add-on.( https://addons.mozilla.org/en-us/firefox/addon/autoinstaller/ ) as description says, extension listen port @ localhost(by default, @ 8888) after installed it, use command wget --post-file=tieba.xpi http://localhost:8888/ post add-on, , here wget returned and nothing happend in firefox. is there mistake in operation? or there way debug add-on without restart firefox?

java - Can't select Test class in Edit Configuration -

Image
i have created espresso/uiautomator unit test. however, when try run it, android studio won't recognize it. button select testlogin.java greyed out. i'm using android studio 2.0 preview 5. package com.greenrobot.yesorno.test.testlogin import android.support.test.rule.activitytestrule; import android.support.test.runner.androidjunit4; import android.test.suitebuilder.annotation.largetest; import org.junit.rule; import org.junit.test; import org.junit1.runner.runwith; import android.support.test.espresso.*; /** * created andytriboletti on 1/15/16. */ @runwith(androidjunit4.class) @largetest public class testlogin extends activityinstrumentationtestcase2<startactivity> { public testlogin(class<startactivity> activityclass) { super(activityclass); } private uidevice mdevice; @rule public activitytestrule<home> mactivityrule = new activitytestrule(home.class); @test public void testlogin() { mdevice = uidev