Posts

Showing posts from July, 2010

javascript - Swap divs (rows) only in tablet view -

i have 2 basic divs display side side in bootstrap layout. in using mobile first, have search panel div display first, followed div. in desktop mode, using push/pull correctly first div go right. in middle view, tablet view, divs stacked, want swap order. i've created bootply: http://www.bootply.com/i8iuuyntwk# in summary: mobile: [search] [slideshow] tablet: [slideshow] [search] desktop: [slideshow] [search] <div class="container"> <div class="row"> <div id="search_div" class="col-md-3 col-md-push-9"> search form here (this should on right on desktop, on top mobile, , second tablet) </div> <div id="slideshow_div" class="col-md-9 col-md-pull-3"> slide show here (this should on left desktop, second mobile , on top tablet) </div> </div> </div> i've seen dozens of ways attempt

django - Python package always trying to install latest version of requirement -

i'm developing application based on django==1.7.x . the problem have setup.py of 1 of dependencies (let's call foo ) specifies django>=1.3 1 of requirements, when such foo being installed, tries install latest version of django, of 1.8.3. i thought when specifying dependencies package>=min_version in setup.py file, pip see package installed, installed version suffies minimum required version , respect installation of package . why pip trying install latest version? , how can force respect current installed version? update: fyi, i'm using pip==7.1.0 update: happens when installing manually, pip install foo==x.y . when dependency in requirements file , installed via pip install -r requirements.txt , installed versions of required packages respected pip. thanks!

Java android eclipse, starting activity in thread: application stopped working -

hey doing simple android app , trying start new activity thread this: public void startui (){ thread t = new thread(){ public void run () { runonuithread(new runnable() { @override public void run() { intent gotomenu = new intent(getapplicationcontext(), mainmenu.class); startactivity(gotomenu); } }); ;} }; t.start; } but when code comes line intent gotomenu = new intent(getapplicationcontext(), mainmenu.class); it crashes , writes: "application stopped working". if want start activity need use activity context first parameter. if use application context mainmenu activity must have flag_activity_new_task flag set. cannot start new activity in same task application context. refer: http://developer.android.com/reference/android/content/intent.html#flag_activity_new_task as @raghunandan mentioned, if want delay

gulp.watch only runs once when passed a run-sequence task -

i have gulpfile , uses run sequence , gulp.watch(). here example task uses run sequence. gulp.task('rebuild', function (callback) { runsequence('clean', 'lint', ['process-js', 'process-styles', 'move-fonts', 'move-static-content']); }); when make change file, watch task run task specified once. in case, task should executed "run", same default task except doesn't run dev server , watch task again. nothing happens when make further edits, whether in same file or different one. if pass gulp.watch plain gulp task (without run sequence), example clean task, watch run clean task every time. i'm sure i'm doing wrong, don't understand what. think might silently erroring , disconnecting stream, can't figure out how debug this. you aren't passing callback run-sequence, therefore task never completes. - overzealous so run sequence task needs

python - How to groubpy with hierarchical columns? -

i have dataframe multi-level columns, , not able find way groupby columns. there addressing columns or should go route of joining names in this question ? solution: addressing columns ['a','x'] instead of ('a','x') you can still use .groupby on columns. below simple example. import pandas pd import numpy np # data # ========================================== np.random.seed(0) multi_col = pd.multiindex.from_product([['a', 'b'], ['x', 'y']], names=['ab', 'xy']) df = pd.dataframe(np.random.randint(1,5, (10,4)), columns=multi_col) df ab b xy x y x y 0 1 4 2 1 1 4 4 4 4 2 2 4 2 3 3 1 4 3 1 4 1 1 3 2 5 3 4 4 3 6 1 2 2 2 7 2 1 2 1 8 4 1 4 2 9 3 4 4 1 # groupby 1 column # =================================== g_name, g in df.groupby([('a', 'x')]): print(g_name) print(g) 1 ab b xy x y x y 0 1

Random number array without duplicates in C -

i trying create random integer array generator no duplicate using this: int pt_rand(int nbits) { int mask; if (0 < nbits && nbits < sizeof(int)*8) { mask = ~(~((unsigned int) 0) << nbits); } else { mask = ~((unsigned int) 0); } return rand() & mask; } int *gen_rand_int_array_nodups(int length, int nbits) { int * = malloc(sizeof(int)*length); (int = 0; < length; i++) { a[i] = pt_rand(nbits); (int j = 0; j < i; j++) { { a[i] = pt_rand(nbits); } while (a[i] == a[j]); } } shuffle_int_array(a, length); return a; } this code trying generate unique random integers within given nbits checking elements 1 one. however, i'm still getting duplicates in result , i've not figured out why. know bad practice of using method generate unique random numbers requirement of assignment requires me somehow make use of nbits param. i've

.net - Get paper size of the layer in autocad c# -

i have method create layout. want set width , height of layout can't find properties. how , set dimension of layout ? you need call setcanonicalmedianame correct paper size available. check sample below [commandmethod("setclosestmedianamecmd")] public void setclosestmedianamecmd() { document doc = application.documentmanager.mdiactivedocument; database db = doc.database; editor ed = doc.editor; plotsettingsvalidator psv = plotsettingsvalidator.current; // let's first select device stringcollection devlist = psv.getplotdevicelist(); ed.writemessage("\n--- plotting devices ---"); (int = 0; < devlist.count; ++i) { ed.writemessage("\n{0} - {1}", i+1, devlist[i]); } promptintegeroptions opts = new promptintegeroptions( "\nenter device number: "); opts.lowerlimit = 1; opts.upperlimit = devlist.count; promptintegerresult pir = ed.getinteger(opts);

perl - How to get multiple values of Hash based on key -

i getting data csv , storing in data in hash.from there want provide key , based on key want values of hash.there can duplicate key that's want values of hash . for ex : **specid note_text** 300000111166 ldpe bottle/jar 300000111166 poly-lined steel drum 300000057768 amber glass bottle/jar now if give key : 300000111166 i should values : ldpe bottle/jar,poly-lined steel drum.how can done. use array references values of hash. when going on input, push values hash instead of assigning them. when retrieving hash values, remember hash value must dereferenced see contents. while (<fh>) { ($key,$value) = split /\t/; push @{$hash{$key}}, $value; } ... foreach $key (keys %hash) { print "values $key: "; print join(",", @{$hash{$key}}), "\n"; } use multi-dimensional hash. advantage of approach duplicate values won't printed twice (or disadvantage, depending how want handle duplic

android - Play local aes128 cbc encrypted mp3 with ExoPlayer -

i wonder best way play local aes128-cbc encrypted mp3 file exoplayer. there class aes128datasource seems exist purpose, can't exoplayer play file. returns -1 track duration indicates file somehow corrupt. there not information error since there nothing in logs. mp3 not played. guess file not decrypted correctly. can give example of how it? here do: key , iv: private byte[] iv = hextobytes("..."); //32 hex symbols here string private byte[] key = hextobytes("..."); //32 hex symbols here string hextobytes function converts given key , iv hex string byte[]: private byte[] hextobytes(string str) { if (str == null) { return null; } else if (str.length() < 2) { return null; } else { int len = str.length() / 2; byte[] buffer = new byte[len]; (int = 0; < len; i++) { buffer[i] = (byte) integer.parseint(str.substring(i * 2, * 2 + 2), 16); } return buffer; } } an

java - How to combine mysql Jar with the application jar file in IntelliJ IDEA 14 -

Image
i used idea14 make dbms application in java swing gui. try run jar file, i'm having class not found exception mysql jdbc connector. i'm stuck , have no clue on how resolve issue... you trying put mysql.jar dependency in same jar , reference manifest's class-path, , not possible default java class loader. see details official java documentation @ https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html one way of fixing move mysql.jar out of smsreminder.jar artifact, on same level smsremider.jar. change class-path entry become class-path: mysql.jar (note there no full path here c:/ideaprojects/..). when building artifact, idea place both jars in 1 , same folder. running java -jar smsreminder.jar should work. another way use custom or opensource class loader, described here: classpath including jar within jar

r - Replicate values of column along rows -

given following data frame: df1 <- data.table( v1=c(0,0,0,0),v2=c(0,0,0,0),v3=c(0,2,0,2)) df1 v1 v2 v3 1: 0 0 0 2: 0 0 2 3: 0 0 0 4: 0 0 2 i seek replicate values of v3 along entire row, that: df2 v1 v2 v3 1: 0 0 0 2: 2 2 2 3: 0 0 0 4: 2 2 2 how can achieve this? many in advance. you use base-r syntax: # overwrite df1[] <- df1$v3 # make new table df2 <- copy(df1) df2[] <- df1$v3 i think data.table-ish way modify many columns set : # overwrite (j in setdiff(names(df1),"v3")) set(df1, j = j, value = df1$v3) # make new table -- simple extension finally, there several other ideas @akrun, @davidarenburg , @veerendragadekar: # overwrite df1[, (1:ncol(df1)) := v3] # david/veerendra # make new table df2 <- setdt(rep(list(df1$v3), ncol(df1))) # akrun df2 <- df1[, rep("v3",ncol(df1)), = false] # david

sorting - What does this sort algorithm do? -

Image
i studying exam , in 1 of professors older exams, had algorithm given, should analyzed... it's array field 1 2n-1 , n power of two, in task a) n equals 8 , keys 8-15 given , shall try out algorithm , tell him, m value being returned. me have m=4, not sure whether right or wrong , rather know, algorithm does... unfortunately have copy image , not find code in internet... i come conclusion while loop runs indefinitely because both f(1) , f(2) equal 2. m f(3) indeed 4. in first loop elements accessed in groups of 2 , smaller 1 gets assigned corresponding element @ index i isn't defined yet. after 4 iterations former defined numbers accessed , 2 smaller numbers (from execution before) accessed. in addition f gets pair information. now array should [2,2,4,3,2,5,4, 3,7,2,8,5,6,9,4] note: first element , f(1) smallest number of range a[n...2n-1] n power of 2. than m gets defined bigger 1 of 2 or 4 (a[2] , a[3]) 4. k f(1) same in array: 2 (in if m get

android - ripple to an ImageButton not working -

i trying add ripple on image button won't work <imagebutton android:id="@+id/imagebutton" android:layout_width="250dp" android:layout_height="60dp" android:layout_alignparentbottom="true" android:layout_centerhorizontal="true" android:layout_marginbottom="139dp" android:background="@drawable/googleback" android:scaletype="fitxy" android:src="@drawable/google" /> this ripple code <?xml version="1.0" encoding="utf-8"?> <ripple android:color="#fafafa"> <item android:id="@android:id/mask"> <shape android:shape="rectangle"> <solid android:color="?android:attr/colorcontrolhighlight" /> </shape> </item> </ripple> your code incomplete ripple works in android 5.0. sure you're running app on 5.0 or newer versio

react jsx - Looping in Render() function of ReactJS -

i have array of objects need loop output on getting stuck. tried using jquery's .each() without success. render: function() { return ( $.each(events, function(k, e) { <div classname="event-item-wrap"> <div classname="event-item" style="backgroundimage:e.image"> <div classname="event-item-date">e.date</div> <div classname="event-item-title">e.title</div> <div classname="event-item-price">e.price</div> <div classname="event-item-bottom"> <div classname="event-item-tags"> <ul> <li>#professional</li> <li>#livejazz</li> <li>#courtet</li> </ul> </div> </div> </div> </div> }); ); } my array contains simple javascript objects

javascript - Toggle Slide Navigation Not Working -

hi i'm having issue code... $(document).ready(function () { var $active, togglerselector = '.ghdr .gmain .gholder nav#gnav-primary-nav .nav-primary li a', toggledselector = '.ghdr .gmain .gholder nav#gnav-primary-nav .nav-primary li ul', $items = $(togglerselector), animationduration = 300, activeclassname = 'gactive', activestyle = {height: auto}, notactivestyle = {height: 0}, hideactive = function() { $active && $active .stop() .animate(notactivestyle, function() { $(this).removeclass(activeclassname).hide(); }); $active = void 0; }, showactive = function($element) { $element && ($active = $element) .stop() .show() .animate(activestyle) .addclass(activeclassname) }; $items.on('click', function(event) { var $this = $(this), $overlay = $th

gwtp - Issue while parsing half-width Katakana in GWT -

i have used gwt in our application. here client send half-width katakana string server. client have issue while parsing of strings in half-width katakana server. so, there issue gwt parse or handle katakana chars? below findings: application work fine string "アイウエオ" application crashes string "カキクケコ" , "サシスセソ" have body faced issue before?

javascript - How to use Functional $scope methods in HTML templates without using ng-click? -

i learning angular next project, confused how use $scope variable (call function) in template file, example find use ng-click, or more general how access business logic of controller in templates views? example have function $scope.rows = function(){ var rownumber; rownumber = math.floor($scope.itemnumber / 6); var rows = []; for(var = 0; < rownumber; i++){ rows.push('row'+ i); console.log(rows); } return rows; }; i want access rows array getting dynamically generated in ng-repeat? its easy, use <div ng-repeat="row in rows()"> <span>{{ row }} </span> </div> here more information ng-repeat https://docs.angularjs.org/api/ng/directive/ngrepeat

angularjs - Angular UI Router states -

i have 2 states. 1 state table domains , second state information domain. table has filters (dropdown selects, dropdown checkboxes) can applied table data. can click domain table triggers second state (state1.domain). my question when click away state1 state1.domain , click state1 how can preserve filtered data , not reinitialize controller? currently, when click state1 filters have been cleared , table data. $stateprovider .state ('state1', { url: '/state1', views: { "main@": { controller: 'stateonectrl', templateurl: 'folder/state1.tpl.html' } }, ncybreadcrumb: { label: 'state one' }, data: { pagetitle: 'state one', showtitle: false} }) .state('state1.domain', { url: '/:domain', views: { "main@": { controller: 'stateonedomainctrl', templateurl: 'folder/state1-domain.tpl.html'

angular ui - Using bootstrap datepicker methods with AngularJS ui-date -

i use setdatedisabled method in bootstrap-datepicker, unsure on how use in angular. https://bootstrap-datepicker.readthedocs.org/en/latest/methods.html#setdatesdisabled i managed initialize datepicker nicely with <input ui-date="datepickeroptions" ng-model="rigdate.date" /> and on javascript side $scope.datepickeroptions = { orientation: 'top', startdate: payperiodservice.getstartdate(), enddate: payperiodservice.getenddate(), format: 'yyyy-mm-dd', }; using angular-ui https://github.com/angular-ui/ui-date i able use bootstrap datepicker using directives , have link object within directive manipulate datepicker using jquery code.

mysql - Performance issues and optimisation of a sql query with union and group by -

i have list of users want group criteria. simplified, grouped a, b, c, d, e. e column can have value picked in list : 000, 071, 072, 2c, 2d, 2m, 3m, 3d. can't regroup users have different value e, except 000, 072 , 071 can grouped (so e in not in group clause these users). that, did first union looking (the real query contains several join instead of "users", adds complexity , useless question) : select a, b, c, d, e users e not in ('071','072','000') group a,b,c,d,e union select a, b, c, d, group_concat(e) users e in ('071','072','000') group a,b,c,d until got job done. had add new column. column represents how user added our database. before, done automatically. can done manually, doing so, columns left empty, , e 1 of them because e table don't fill manual method. these users must regrouped '000', '071' , '072' (because default value when e null '000'). so imagined : sele

Missing content on a page in Umbraco -

okay, i'm sure obvious i'm editing site in umbraco (i'm supposed change out simple email address), , believe have found page edit in body text box there isn't text state "this page edit!" i'm @ stand still because of i'm hoping can me. i'm sure simple but...

Python - Returning the output as a dictionary - MySQL -

i have coded class handle mysql connecting using external modules when data want returned like: { 'id': '1', 'username': 'test'} it's returned: (1, u'test') the code use is: def executequery(self, query): if(self.mysqlsuccess): cursor = self.cnx.cursor() cursor.execute(query) row in cursor: print row executequery('select * `users`') you can use dictcursor when initializing connection mysql. import mysqldb.cursors cnx = mysqldb.connect(user='joe', passwd='password', db='dbname', cursorclass=mysqldb.cursors.dictcursor) if using diff mysql package check docs dictcursor .

python - How to install MySQLdb with Anaconda on Mac -

i have anaconda distribution python version 2.7. tried several commands such sudo , pip nothing seems work. told in shell installation complete every time try send in console "import mysqldb" following error: traceback (most recent call last): file "", line 1, in import mysqldb file "build/bdist.macosx-10.5-x86_64/egg/mysqldb/ init .py", line 19, in file "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 7, in file "build/bdist.macosx-10.5-x86_64/egg/_mysql.py", line 6, in bootstrap importerror: dlopen(/users/andreasportelli/.python-eggs/mysql_python-1.2.5-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so, 2): library not loaded: libssl.1.0.0.dylib referenced from: /users/andreasportelli/.python-eggs/mysql_python-1.2.5-py2.7-macosx-10.5-x86_64.egg-tmp/_mysql.so reason: image not found what should install it? consider using pymysql can install by conda install pymysql fyi what pymysql , how differ mysq

java - Left aligning text in print statements -

this question has answer here: align printf output in java 4 answers i have list of keys , values , print them values left aligned 1 another. instance if map is: {(key9, val9), (key10, val10)} want print as: key9: val9 key10: val10 my current solution pretty ugly: int maxkeylength = findmaxkeylength(mymap); (string key : mymap.keyset()) { int numspaces = maxkeylength - key.size() + 1; // todo: use stringbuilder instead. string toprint = key + ":"; (int = 0;i < numspaces;++i) { toprint += " "; } toprint += mymap.get(key); print(toprint); } this works bit ugly. question is, there better way this? you try formatted strings, so for (string key : mymap.keyset()) { system.out.printf( "%-9s %-15s %n", key+":", mymap.get(key)); } reference

php - Calculating time difference between events in mysql -

Image
assuming have table following structure : how calculate time difference between events login , logout specific users? want aggregate of session times each user had(so aggregate of times between each login , logout sessions). aware datediff can used i'm not sure syntax , how able use multiple users the final out put : +-------------+-------------------------+ | agent | total session time | +-------------+-------------------------+ | user - 194 | 00:30:00 | | user - 195 | 00:40:00 | +-------------+-------------------------+ my version outputs difference between last logout , login actions: select t1.agent, timediff(t2.lot, t1.lit) (select agent, max(time) lit log event = 'login' group 1) t1 join (select agent, max(time) lot log event = 'logout' group 1) t2 on t1.agent = t2.agent group 1; i used following table definition: create table `log` ( `time` datetime default nu

jquery - acceptFileTypes Blueimp fileupload -

i have implemented jquery fileupload, have small issue accepted file types: $('#fileupload'). url: '/upload/uploaddoc', // url zum file upload type: 'post', datatype: 'json', uploadtemplate: 'template-upload', acceptfiletypes: /^.*\.(?!exe$|lnk$)[^.]+$/i, maxfilesize:allowed_file_size ....... } i using regex recognize filetypes not allowed. want pass variable contains accepted file types in maxfilesize not seem accept lists , strings. do know passed acceptfiletypes ? you may use regexp constructor. something like: acceptfiletypes: new regexp("^.*\\." + my_condition_lookahead + "[^.]+$", "i"), note need double escape special regex meta characters when declaring regex using constructor notation.

android - Fragments inside ViewPager dissapear when orientation changes -

i have read several posts ( http://tinyurl.com/pb8es74 , http://tinyurl.com/p9pcfcv.. .) cannot find solution. i have mainactivity loads layout containing viewpager 3 fragments (which have different layouts depending on orientation). i have added feature activity not destroyed when orientation changes might have dialogs or popips opened: android:configchanges="keyboardhidden|orientation|screensize|screenlayout|uimode" therefore, have overwritten method "onconfigurationchanged" calls method loadlayout, regarding view made: private void loadlayout() { setcontentview(r.layout.layout_main_activity); pager = (viewpager) this.findviewbyid(r.id.pager); pager.setpagetransformer(true, new depthpagetransformer()); adapter = new myfragmentpageradapter(getsupportfragmentmanager()); adapter.addfragment(fragment1.getinstance()); adapter.addfragment(fragment2.getinstance()); adapter.addfragment(fragment3.getinstance()); pager.setad

Google Direction API directionsService.route() does not return result -

i have tried utilise direction api calculate distance between 2 places. however, .route() service not seem hold. $scope.getres = function(id) { $scope.bookingreference = {}; $http.get('/api/carpooler/'+id) .success(function(data) { data.traveldate = new moment(data.traveldate).format("mmm yyyy"); data.traveltime = new moment(data.traveltime).format("h:mm:ss a"); $scope.bookingreference = data; }) .error(function(data) { console.log('error: ' + data); }); for(i = 0;i<$scope.bookings.length;i++) { dd = calcroute($scope.bookings[i].destination,$scope.bookingreference.destination); if( dd < 5000) {// 5 km $scope.bookingresultarray.push($scope.bookings[i]); } } $scope.status2 = true; }; i calling calcroute return distance. var directionsservice = new google.maps.directionsservice(); function calcroute(re

YQL yahoo.finance.analystestimate results -

i trying use yql yahoo financial data. checked show community table on yql console see database under yahoo tag. posted sample yql: https://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=select+*+from+yahoo.finance.analystestimate+where+symbol%3d'prlb' got result this: "results": { "results": { "symbol": "prlb" } } i have expected formatted data, taken here , earnings estimates, eps trends... same happens similar tables. doing wrong? the js table not working anymore ie needs fixed. this partially formatted... <?xml version="1.0" encoding="utf-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <author><!-- name or company name --></author> <description><!-- description of table --></description> <documentationurl><

ruby on rails - How to upload to local storage? -

i have model method below, uploads aws s3 bucket in production. works. problem did same within development , testing environment (before added if...else statement). therefore, extend model method uploads local file storage when within development or testing environment. but i'm not sure how add this. i've been following hartl's railstutorial , basic image uploading uses fog gem. uses uploader there, not apply situation. not sure if , how should use fog gem in situation. suggest code else part of model method below? def self.upload_file(id) if rails.env.production? s3 = aws::s3::resource.new( region: rails.application.secrets.aws_region, credentials: aws::credentials.new( rails.application.secrets.s3_access_key, rails.application.secrets.s3_secret_key) ) myfile = 'app/assets/emptyfile.xml' filename = "myfiles/#{id}/file-#{id}.xml" obj = s3.bucket(rails.application.secrets.

Get contents of a site behind cloudflare in c# -

i want contents of site behind cloudflare use webclient webcl = new webclient(); string content = webcl.downloadstring("http://example.com"); but doesn't work shows code cloudflare , don't contain site contents cloudflare appears blocking whatever reason. in order around need whitelist c# server in cloudflare itself or add subdomain doesn't go through cloudflare. in event ip changing, either need whitelist through cloudflare api or route through proxy static ip.

visual studio 2013 - How do I get Intellisense inside Behavior classes using MSpec? -

i´m using mspec-framework implement bdd our new project. i´m new concept of bdd , therefore mspec , have problems adress object of interest (_obj2 in example), @ least visual studio intellisense doesn't propose in behavior-class , inside should_do_some_fancy_magic -context. namespace examplespace{ public partial class exampleclass{ private objectofanotherclass _obj2 private void test(objectofanotherclass _co) ... } } namespace examplespace.test{ [behaviors] class exampleclassbehavior{ establish context =()=>{...}; should_do_some_fancy_magic() =()=> shouldbeequal(examplevalue, _ex.test(_ex._obj2); private static exampleclass _ex; } } any ideas how intellisense working inside behavior-class ? you don't need set [behaviors] context. behaviors used reuse it s between contexts. that's use-case comes infrequently. this should work, despite being untested: namespace examplespace{ public partial class exam

java - Test a method without initialize the class -

i'm new unit testing, i'm wondering if there way test method without initializing class. reason i'm asking because there lot of object passing in constructor meaning lot of mocking stubbing while thorough check methodtotest seems not use object attribute. it's not code otherwise method converted static. class exampleclass { public exampleclass(firstclass fc, secondclass sc, thirdclass tc) {} public void methodtotest(fourthclass foc) {} } you have options here: make method static don't need reference actual object. work if method not need state of exampleclass (i.e. needs passed in method arguments). extract method class (perhaps using method object pattern) that's easier test on own. refactoring called replace method method object .

Possible to access Piwik getVisitorLog through HTTP API? -

i'm building reporting tool. ideally want avoid going through web server logs myself , use (some of) power of piwik. the stuff visitor log start, @ http://example.com/piwik/index.php?module=corehome&action=index&idsite=1&period=day&date=yesterday#/module=live&action=getvisitorlog&idsite=1&period=day&date=yesterday unfortunately can't find getvisitorlog action in http api docs @ http://developer.piwik.org/api-reference/reporting-api#actions (and it's not undocumented feature, method=actions.getvisitorlog gives me the method 'getvisitorlog' not exist or not available in module '\piwik\plugins\actions\api'. is there way this? or should write plugin piwik? apparently it possible through live plugin api: http://developer.piwik.org/api-reference/reporting-api#live this works desired: http://example.com/piwik/index.php?module=api&method=live.getlastvisitsdetails&format=json&idsite=1&

git diff - How to list files which are not in another branch using git? -

i have 2 branches master , develop. master has been merged develop. develop has code not in master. how see files exist in develop , not in master? on develop branch : git diff master or files added (new files): git diff master --diff-filter=a

c# - Get CPU frequency (Ghz) on android devices -

i'm using latest unity 5 , working on android project. found out unity can show processor type , core count systeminfo.processortype , systeminfo.processorcount . could possible show cpu freqeuncy in ghz on android devices? can either written in c# or unityscript code. this though task, witch may require lot of work do. first thought there have way android os hold kind of data somewhere in storage. found http://android-er.blogspot.com/2009/09/read-android-cpu-info.html . in short read data manufacturer, on different phones there might or may not data looking for. second thought have count on own https://stackoverflow.com/a/27821658/2531209 might come in handy, not perfect since need make calculations , wont receive result in hz. third thought if core of application , want support may want create list of phones , processors architectures (or find 1 in convenient form) , display associated score in ghz.

php - Laravel Authentication With External User Table -

i made laravel based web app uses it's default auth methods. has slight modifications suit needs, role management, not issue here. the client i'm working has existing php based app/website has it's own custom user auth table/db. the main problem here - he log in laravel site using session data old site, without authenticating twice. is there way achieve , if yes, how solved? thanks in advance. i had similar issue. problem little simpler — all cared having logged-in-session, actual user profile or permissions weren’t necessary — but anyway should on right path. i created file called index_laravel.php, , used .htaccess route requests instead of index.php. <?php $path = "../../bootstrap/"; require($path . 'autoload.php'); $app = require_once($path . 'app.php'); $app->make('illuminate\contracts\http\kernel')->handle(illuminate\http\request::capture()); if( !$app['auth']->check() ) { echo('ple

c# - How to execute FetchXml to get EntityColletion in CRM -

i have fetchxml using need entitycollection. when googled got results using particular service class object follows fetchexpression fetch = new fetchexpression(fetchxml); entitycollection quickfindviewentitycollection = _service.retrievemultiple(fetch); i want know class _service object belongs to. can give me full details of class. _service instance of class implements iorganizationservice interface. if code crm plugin or custom workflow, can create instance of context. if code external application consuming crm services, can create use organizationservice class part of microsoft.xrm.client library.

windows - How to get list of directories except some directories -

i need list of directories , exclude directories name. i linux may this: ls -d */ | egrep -v '^common/$|^static/$|^static_src/$|^templates/$ how in windows cmd ? dir /ad /b | findstr /v /x /c:"common" /c:"static" /c:"static_src" /c:"templates" or, if folder names don't contain spaces, dir /ad /b | findstr /v /x "common static static_src templates"

if statement - Perl, how to choose a directory -

i'm trying determine of content of folder directory , file, wrote following result not expect: opendir dh, $dir or die "cannot open dir: $!"; @dirs = grep !/^\.\.?$/, readdir dh ; foreach $files (@dirs) { print $files."<br>"; if ( -d $files ) { print $files." directory<br>"; } } closedir dh; the result example below: .file1 file.log file3.zip file4 file5.zip dir1.name1.suffix1.yyyy.mm.dd.hh.mm.ss file5.zip file6.tar dir2 dir3.name1.suffix1.yyyy.mm.dd.hh.mm.ss where item starting dir actual directory, question why if failing discover them such? doing wrong? $dir is missing... if ( -d "$dir/$files" ) { print $files." directory<br>"; }

event bus - How to unregister GWT eventbus handlers in a Popup/DialogBox? -

i have dialog box, contains button , tablayoutpanel. button outside tablayoutpanel. tab contents separate custom widgets. the problem: want respond clicks on button performing action inside 1 of tab content widgets. i tried using gwt eventbus way: fire event upon button click add handler event inside tab but here's problem: if close/open tab multiple times, event handler registered again. , when button clicked, event handler start multiple times (for every handler registration/however many times tab opened). since dialog box doesn't have activity/place, cannot use gwt's activity.start(... eventbus eventbus) automatic activity deregistration. a possible solution manually remember registered handlerregistration (s) , .removehandler() them when navigate away tab. rather ugly solution. question: there way unregister events in dialog box without remembering them? it's hard give concrete answer without code, i'd this: add clickhandler bu

elasticsearch - Maven Shade - change file name and replace text -

i trying use maven shade , wrap elasticsearch jar. the reason, why doing because have conflict between lucene version in project. but found problem, when using shade. doesn't change name of file in meta-inf/services , doesn't change fqn in particular files. i need change org.apache.lucene.codecs.codec file , content. because if file keep name, error "caused by: java.lang.illegalargumentexception: spi class of type shaded_lucene_4_10_4.org.apache.lucene.codecs.codec name 'lucene410' not exist. need add corresponding jar file supporting spi classpath. current classpath supports following names: []" is possible wrap elasticsearch maven shade plugin? here pom.xml yes possible, need add servicesresourcetransformer entry. this: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-shade-plugin</artifactid> <version>2.4.1</version> <executions> <

iOS 9: Different push tokens returned for the same app (between installes) -

i'm seeing different tokens returned same app on same device: -(void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken between installs. for example after first install return token 'a' , if remove app , re-install return token 'b'. i'm seeing behavior on ios 9 latest beta, , wonder if design or bug. i tested on device running ios 8, ios 9.0.1 , 1 running ios 9.0.2. devices 8 & 9.0.2 behaved same (returns same device token between installs); so, appears bug introduced in ios 9 fixed in ios 9.0.2.

php - Symfony2 mapping works for one entity but not the other -

i have 2 entitites mapped together. skin.php : /** * @var cmselement * * @orm\manytoone(targetentity="cmselement") * @orm\joincolumns({ * @orm\joincolumn(name="homepage_id", referencedcolumnname="id") * }) */ private $homepage; cmselement.php : /** * @var skin * * @orm\manytoone(targetentity="skin") * @orm\joincolumns({ * @orm\joincolumn(name="skin_id", referencedcolumnname="id") * }) */ private $skinid; and thats it. skin table mapped correctly, id of cmselement. in cmselement dont needed skinid... stays null. codes identical, why doesnt work? an example better understanding: skin: id: 1 homepage_id: 2 cmselement: id: 2 skin_id: null in order set manytoone relation, have specify in both ways this: // skin.php /** * @var cmselement * * @orm\onetomany(targetentity="cmselement", mappedby="skinid") * @orm\joincolumns({ * @orm\joincolumn(name="hom

ember.js - Saving models and their relationships using the new Ember Data JSONAPISerializer/Adapter -

i have implemented json-api backend , i'm using ember (1.13.4) , ember data (1.13.5) pull data in store using new jsonapiadapter / jsonapiserializer. working , store populated of models , attributes/relationships. however, when call .save() method on models json-api-formatted request generated doesn't contain "included" key related models inside it. means if modify attribute in related model , save primary model don't see changed attribute related model in json payload. what correct way save models , relationships embedded using new jsonapiadapter / jsonapiserializer? tried embeddedrecordsmixin resulted in null attribute values within "attributes" key of payload. if can assist me i'd grateful. thanks. ok, has been answered on ember forum follows: "the standard not support @ moment , scheduled v1.1 ( http://discuss.jsonapi.org/t/json-api-weekly-meeting-june-22nd-2015/23 ). your best bet inherit serializer , impl

jdbc - Java ResulSet anormally returns empty fields -

i struggling resultset presents empty fields there should values (i tested query in oracle sql dev). strange because 1 of field ("opendate" -> rs.getdate(5)) correctly fetched not other ones. here code : public void refreshdata() { try { globals.itrackdatabase.connect(); resultset rs; rs = globals.itrackdatabase.execquery(globals.caserankingquery + " case_num = '19816641'"); // resultsetmetadata metadata = rs.getmetadata(); // int numberofcolumns = metadata.getcolumncount(); while (rs.next()) { system.out.println(rs.getstring(1)); case caseobj = new case(rs.getstring(1), rs.getstring(2), rs.getstring(3), rs.getstring(4), rs.getdate(5), rs.getstring(6), rs.getstring(7), rs.getstring(8), null, rs.getstring(9), rs.getstring(10), 0); globals.caselist.add(caseobj);

windows - Incorrect folder locations returned from SHGetPathFromIDList -

i trying restrict users access location (windows, program files, etc.) , doing implementing ifolderfilter interface. everything seems going fine until shouldshow function gets called , seems fall apart. initial folder pass in of c:\programdata\company\app\year , see that, file dialog shows hanging off desktop why when inspect folders contained in pidl c:\users\graham.reeds\desktop\windows, c:\users\graham.reeds\desktop\program files, etc. seemingly preventing them being matched csidl_ variables want prevent user selecting. i tried using shgetpathfromidlistex , shgetknownfolderidlist vs2010 gives me 'identifier x undefined' including shlobj , link shell32.lib. hresult stdmethodcalltype shouldshow(ishellfolder* sf, lpcitemidlist pidlfolder, lpcitemidlist pidlitem) { hresult resultcode = s_ok; ulong attributes = 0ul; if (succeeded(sf->getattributesof(1, &pidlitem, &attributes))) { char szpath[_max_path]; bool f = sh

Auto send form (JSP) and load page in iframe -

i have page (jsp) form , submit button. after clicking button form data posted jsp creates output (a table links). my problem is, need automatic, can fill form via url thats not problem how can force post other page without clicking button. want include result (table links) on page (with php or iframe) result has generated when page opened. i can not change of jsp pages, part of closed system can't change. thanks...

java - Supporting multiple versions of web-services -

i have web-services implemented dropwizrad. these web-services being developed mobile app. consider scenarios version 1.0 of application out, multiple users accessing it. there major changes done web-services compatible new version of application. tackle have host 2 versions of web-services, 1 legacy users , other latest version of application. there way can run different versions of same web-services in same container . clients make choice between the version of web-services user more http://myhost/web-services-v1 http://myhost/web-services-v2 as long web service self-contained in own webapp (war file), own dependencies ( web-inf/classes , web-inf/lib ), can run 2 separate webapps on 2 different context roots , neither 1 aware of each other.

jqGrid: Error: Invalid XML -

i have jqgrid filled custom xml response server. managed run datatype: "xmlstring", when xml string hard-coded locally, managed run when xml response jqxhr.responsetext, , pass xml string, still using datatype: "xmlstring", when set datatype: "xml", following error: an error occured during request: error: invalid xml: and after error there listed code of html page of that, instead of xml response, seems odd me. the error happens when set data: data, or data: jqxhr.responsetext, or data: jqxhr.responsexml. any ideas on one? when using datatype: "xml", should correct thing should pass jqgrid data - data, jqxhr.responsetext, jqxhr.responsexml or member of data? also benefit of using datatype: "xml", on datatype: "xmlstring"? if don't manage run datatype: "xml", use datatype: "xmlstring" xml coming response, , there issue approach? p.s. versions: jqgrid v. 4.7.0, jquery v. 2.1.3, firefox v.