Posts

Showing posts from August, 2014

Oracle Database versions supported by Weblogic 12c -

i have been trying find oracle databases supported weblogic 12c. have been trying find on web, unable proper list. any appreciated. have @ these oracle certification matrix 12c releases : for weblogic version 12.1.1 for weblogic version 12.1.2 for weblogic version 12.1.3

Copy tables from 1 Oracle to another Oracle instance -

i have 2 oracle instance: oracle 1 oracle 2 i have created database link on oracle 1 connect oracle 2. i need copy tables oracle 1 oracle 2 oracle 1. possible? please note know about: create tmp_table select * table@oracle_2 but create table in oracle 1 , not oracle 2. note: need oracle 1, because have many oracle instances , want copy instances in automated way without logging on each oracle. if there more couple of tables should try using expdp network_link something this: expdp test/test@oracle1 tables=tmp_table,tmp_table2 network_link=oracle_2 directory=test_dir dumpfile=tmp.dmp logfile=expdptmp.log

c# - Memoryleak when using ICollectionView with Entity Framework -

so in application use icollectionview of products, bound datagrid databinding. products come ms-sql table , table quiet big (~30.000 entries). @ points need reload table contents might have changed. whenever call reloadproducts() ~30.000 new objects created. previous objects not freed , remain in memory whole live of application. any idea how force disposal of old objects? viewmodel: private icollectionview _productcollectionview; public icollectionview productcollectionview { set { _productcollectionview = value; } { if (_productcollectionview == null) { reloadproducts(); } return _productcollectionview ; } } public void reloadproducts() { list<products> productlist = entities.products.tolist(); productcollectionview = collectionviewsource.getdefaultview(productlist); notifypropertychanged("productcollectionview"); } view: <datagrid itemssource="{binding productcollectionview}

java - Find class marked with annotation of a specific value -

i'm using java reflections api i'm finding quite convenient far: https://github.com/ronmamo/reflections find classes marked specific annotation dead easy, however, can't figure out how add filter in scanner retrieve classes have annotation configured in way. for example, if have 3 classes: @important(level="high") public class highlyimportant { } @important(level="medium") public class moderatelyimportant { } @important(level="low") public class notsoimportant { } i can 3 classes scanning @important annotation, how restrict @important(level=high) ? thanks

javascript - Playing DRM Mpeg-DASH video with VideoJS -

i'm building website use videojs 5 play dash videos. while player plays pure dash videos fine i'm having problems playing widevine drm encrypted dash videos. video source defined below; player.src({"type": videotype, "src": urlofvideosource , "keysystemoptions": [{ "name": "com.widevine.alpha", "options": {"licenseurl": "https://proxy.uat.widevine.com/proxy"} }]}); the strange thing when play file: ( https://bitdash-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd ) player plays fine. when try play ( http://html5.cablelabs.com:8100/cenc/wv/dash.mpd ) player return me 'post 403 error. both drm encrypted. none of cablelabs test content widevine videos dashif website working player currently.

mysql - SQL select rows having count > certain number -

i don't know how search this, it's quite easy it, don't know how this. have sql table: | c1 | c2 | c3 | c4 | c5 | data data data data data so i've 5 columns, , want select rows following (c1, c2, c3) row appears more 5 times in table this: select c1, c2, c3 table having count(*) > 5 , (all in count, rows must have same values on c1, c2, c3) can basical sql queries. functions, declarations , etc not allowed. don't know if i'm explaining myself well. not absolutely sure understand, guess be select c1, c2, c3 <yourtable> group c1, c2, c3 having count(*) > 5

installing android studio on ubuntu -

Image
everybody, android developer, using ubuntu 14.04 lts. because of hardware problem, have format pc. before android studio , sdk , java working perfectly. after formatting pc. installed jdk1.8.0_71. after extract android studio deb file command sudo dpkg -i android-studio_4.13.0-ubuntu0_all.deb , 'android-studio' folder extracted @ /opt directory. after that, try run /opt/android-studio/bin/studio.sh command. sh ./studio.sh , gives me error i have tried ./studio.sh execute same error. please solve. to install oracle java on ubuntu, this: sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer i every time install android studio , works flawlessly. , java 8 kept date, too. environment variables automatically set procedure.

java - Call parent method instead of the overriden one -

i have class c1 : public class c1 { public void method() { //do } protected void anothermethod() { if (something) { method(); /*here, want call method c1.method, * c2.method called */ } } } and class c2 extends , overrides method : public class c2 extends c1 { @override public void method() { if (something) { anothermethod(); } else { super.method(); } } } my problem described in code comment. can't run parent method in parent class. reason? annoyingly, can't (setting aside reflective hacks). but on lines public class c1 { public final void _method() /*rename taste*/{ } public void method(){ _method(); } } and override method in derived class. if require base class method, call _method() . think that's nearest writing c1::method() permissible in c++.

php - How to minimize .htaccess rules? -

i have following .htaccess rules seo friendly url : .htaccess rules : options -multiviews errordocument 404 http://localhost/aponit/dev/not-found.php errordocument 500 http://localhost/aponit/dev/404.php rewriteengine on rewriterule ^(?:zones/)?update/(\w+)/?$ zones/update.php?z=$1 [l,qsa,nc] rewriterule ^(?:cable-types/)?update/(\w+)/?$ cable-types/update.php?cbl=$1 [l,qsa,nc] rewritecond %{request_filename} !-d rewritecond %{request_filename}.php -f rewriterule ^(.+?)/?$ $1.php [l] now, using rules can access following url : http://localhost/aponit/dev/zones/update/63 http://localhost/aponit/dev/cable-types/update/3 now have create type of url many more! there anyway in .htaccess rules minimize rules ? i mean if need 10 different url have add 10 rules .htaccess file. e.g: rewriterule ^(?:another/)?another-f/(\w+)/?$ another/another-f.php?another-id=$1 [l,qsa,nc] i want 1 rules in this .htaccess file type of url. update: in index.php file under zones fo

ansible - ERROR! 'file' is not a valid attribute for a Play -

new playbook test not working. newbie ansible have read throuugh docs , samples etc. wrong ? error! 'file' not valid attribute play the error appears have been in '/home/ntnet/mresnick/testdel.yml' : line 10, column 3, may elsewhere in file depending on exact syntax problem. the offending line appears be: - file: "path=/tmp/{{ item }} state=absent recurse=no" ^ here --- - name: test playbooktestdel - hosts: temp3 tasks: - name: "delete old files aveksa" - file: path=/tmp/{{ item }} state=absent recurse=no with_items: - { aveksa.tar } - { sudo_commands } - { baz } ... you wrote tasklist , tried run playbook. when have playbook, can have tasks key in given play, , list preferred task there. --- - hosts: hosts tasks: - name: delete sg file: path: "/tmp/{{ item }}" state: absent recurse: no ...

How to install node.js and create project in Eclipse -

Image
the steps i've tried: 1.(ok) install node official website: https://nodejs.org/en/download/ result: i'm able open cmd(in location, type node use commands "console.log" , prints messages) 2.(failure) install express using npm install -g express cmd gives me error(picture attached 3.(ok) i've succeed installing express using following command npm install express (without -g) 4.(ok) writing simple hello world program works. javascript file: var http = require('http'); // configure our http server respond hello world requests. var server = http.createserver(function (request, response) { response.writehead(200, {"content-type": "text/plain"}); response.end("hello world\n"); }); // listen on port 8000, ip defaults 127.0.0.1 server.listen(8000); // put friendly message on terminal console.log("server running @ http://127.0.0.1:8000/"); 5.(failure) however, wanna run bigger project, besides 1 js file,

java - Mock final new instance created? -

how mock private final mockclass mockclass = new mockclass(); public class simpleclass { private final mockclass mockclass = new mockclass(); } use dependency injection; can have whatever want in field: class simpleclass { private final mockclass mockclass; simpleclass(mockclass mockclass) { this.mockclass = mockclass; } } see misko hevery's guide writing testable code : code example of warning sign "new keyword in constructor or @ field declaration".

php - Sort the big array according to the value of another array which is inside the big array -

{ "result": true, "users": [{ "id": 11, "expected_count": 13, "user_id": 1, "event_id": 2, "user": { "id": 1, "name": "moiz jamali" } }, { "id": 12, "expected_count": 12, "user_id": 2, "event_id": 2, "user": { "id": 2, "name": "juzer samiwala" } }] } above output of big array ('users'). what want sort big array ('users') according name value inside small array ('user') in php. can ple

c# - Xamarin.Forms: How to have a Pie Chart using data from the Database? -

i'm creating xamarin.forms portable application wherein able display pie chart using oxyplot. chart has pre-defined items. want make items database in visual studio displayed on chart , not pre-defined items. i have 2 projects in 1 solution. webformsproject , xamarin.forms (portable) in webformsproject , created salescontroller used linq expression data in database need. created salesviewmodel there have declared properties have. tried test in web api if return value or not, , return value. in portable project, have created sales model has same properties salesviewmodel in webformsproject . have salesvm.cs wherein tried access records webformsproject using salesservices , restclient. i have tried using these codes didn't work. think reason behind this? here codes: webforms 1.) salesviewmodel.cs using system; using system.collections.generic; using system.linq; using system.web; namespace webformsdemo.viewmodel { public class salesviewmodel {

c# - Pass list of object from View to controller using HttpPost -

i struggling bit passing list of object c# code view. if pass simple string works fine. not working list. sure missing here. view <div class="row control-actions"> @{ list<myobject> test = viewbag.objectslist; <button type="button" class="btn btn-primary btn-wide" onclick="addallobjectstoexp('@test')">add all</button> } </div> <script type="text/javascript"> function addallobjectstoexp(objlist) { $.post('@url.action("addallobjectstoexp", "exportobjects")', { objectslist: objlist}, function (result) { $('#numbers').html(result); }); } </script> code [httppost] [outputcache(location = system.web.ui.outputcachelocation.none, nostore = false, duration = 0)] public int addallobjectstoexp(list<myobject> objectslist) { foreach(myobject obj in objectlist) { //do here } //and r

c# - Enable WPF button based on checkbox list selection in MVVM -

i have checkbox list items , submit button. submit button need disabled. button needs enabled selection of single checkbox selection or multiple selections. add below code in xaml , backend code need have view model suing mvvm. xaml.. <listbox grid.row="1" borderthickness="0" background="transparent" name="list" itemssource="{binding items}" margin="10 5 20 0" selectionmode="extended"> <listbox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <checkbox name="check" ischecked="{binding ischecked, mode=twoway}" margin="5 5 0 10" verticalalignment="center" /> <contentpresenter content="{binding value}" margin="5 5 0 10"/> </st

Python Gmail API 'not JSON serializable' -

i want send email through python using gmail api. everythingshould fine, still error "an error occurred: b'q29udgvudc1uexbloib0zxh0l3bsywluoybjagfyc2v0psj1cy1hc2npasiktulnrs..." here code: import base64 import httplib2 email.mime.text import mimetext apiclient.discovery import build oauth2client.client import flow_from_clientsecrets oauth2client.file import storage oauth2client.tools import run_flow # path client_secret.json file downloaded developer console client_secret_file = 'client_secret.json' # check https://developers.google.com/gmail/api/auth/scopes available scopes oauth_scope = 'https://www.googleapis.com/auth/gmail.compose' # location of credentials storage file storage = storage('gmail.storage') # start oauth flow retrieve credentials flow = flow_from_clientsecrets(client_secret_file, scope=oauth_scope) http = httplib2.http() # try retrieve credentials storage or run flow generate them credentials = storage.get() if crede

c++ - Why does a const reference behave differently when assigned an l-value and r-value? -

given code sample below; #include<iostream> using namespace std; int main(){ int = 4; const int &b = a; const int &c = * 2; = 10; cout << b << endl; cout << c << endl; return 0; } when run this, output 10 8 why c++ designed behave differently when assigning l-value , r-value const references? the expression: const int &c = * 2; does not bind resulting reference c a . instead binds rvalue result of expression a * 2 , temporary object no longer has a - changing a not affect it. this opposed b , reference object a .

Hidden Google Doc iframe won't load -

on webpage, i've got several tabs and, in 1 of them, want display iframe containing google doc. when iframe displayed, google doc loaded , there no problem. default, tab hidden (so, iframe inside too) something like <div id="tab-1">...</div> <div id="tab-2" hidden>...</div> <div id="tab-3" hidden><iframe src="https://docs.google.com/document/d/......../edit?usp=sharing&embed=true"></iframe></div> with jquery handle actions and, when iframe hidden, seems can't load until it's not hidden anymore. problem endlessly popup saying this error has been reported google , examined possible. continue, please refresh page. in page without tab, if iframe has "hidden" attribute, bug occurs too i around problem "hiding" iframe "heigth=0" when it's hidden in tab, problem comes back have ever met problem , find way solve ? have "dynam

angularjs - Script section in angular controller function was not hit also the values are not assigned -

in application want load external html file when click navigation links. [index.html] <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" ng-app="defaultapp"> <head> </head> <body ng-controller="defaultctrl"> <!--dynamic content load external html files--> </body> </html> in app.js file, have defined default routing values controller function external file navigation. [app.js] var mainapp = angular.module('defaultapp', ['ngroute']); mainapp.controller("defaultctrl", ['$scope', '$rootscope','$compile', function ($scope, $rootscope,$compile) { $scope.$on('$viewcontentloaded', function (event) { $compile($('#sync').contents())($scope); }); }]) mainapp.config(['$routeprovider',

numerical analysis - Calculate derivative of an array with apache-commons-math -

good morning, have array 3000 double values, need find local minimum , maximum, i'm interested first , second derivative, what's best way achieve apache commons math? trouble i'm starting directly array, not function sin(x). thanks with array wont able find min/max. if array calcualted known function, differentiate numerically (just calculate @ x , x + epsilon , , divide epsilon , assuming there's single parameter you're differentating respect to). alternatively, array list of coefficients of big polynomial? if so, same approach might work.

java - Memory Allocation Eclipse NDK Netbeans ImageProcessing -

my problem picturized. hi all. i'm new stackoverflow. want ask guys intern project. i coded functions in c++, , want design gui java in netbeans. communicate each other via ndk. it's imageviewer, , i'm able crop, rotate, paint, resize in c++ code. they're real-time operations, image done @ c++ transferred java platform. when gui , running, have memory allocation problem. since both c++ , java libraries hold copy of image in memory. is there kind of way eliminate problem? thought saving/reloading/flushing each time, when file size large, means long wait times in between operations. i might not spesific, can ask me parts couldnt explain well. i'm looking forward getting can. edit: have google "heap size" , found out helps increasing memory allocated java application. real concern creating same image in both language memories. can way 1 stores image itself, , other pointer? know java language can't deep till ram allocation, need do? th

javascript - How to format JS Date as a C# compatible DateTime? -

i've passed javascript datetime picker date view mvc controller action. the format of string when passed controller action thu jul 28 2016 17:05:00 gmt+0100 causes invalid operation exception converting string datetime. in c#. this how assign value of date picker hidden field value: $('#outagestart').val(e.date) how can format js date string c# compatible datetime? the binding error thrown in c# custom model binder tries bind js date string value nullable<datetime> : public class datetimebinder : system.web.mvc.imodelbinder { public object bindmodel(controllercontext controllercontext, system.web.mvc.modelbindingcontext bindingcontext) { var value = bindingcontext.valueprovider.getvalue(bindingcontext.modelname); bindingcontext.modelstate.setmodelvalue(bindingcontext.modelname, value); return value.convertto(typeof(datetime), cultureinfo.currentculture); } } alternatively can use timestamp conversion ,

ASP.Net MVC: How to use razor variable in CSS file -

as per scenario need store path /img/product.png of image in razor variable , later want use razor variable in css file. below css code in css file .test{ background: url('/img/product.png') no-repeat scroll 0 0 transparent; } so use code way below no luck still .test{ background: url('@model.logourl') no-repeat scroll 0 0 transparent; } i see post http://www.codeproject.com/articles/171695/dynamic-css-using-razor-engine not want solve issue per post. let me know how sort issue. thanks by default, mvc not support writing server side codes in external css file , external javascript files. for case work, can add internal stylesheet in view file itself, work. eg: @{ viewbag.title = "title"; } <style> .test { background: url('@model.logourl') no-repeat scroll 0 0 transparent; } </style>

Call shell skript with specific working directory from R -

i have sh script, can run specific directory because looks files in directory , don't want change sh file. suppose file in ./sub/script.sh , r working directory ./ what works is wd = getwd() setwd("./sub") system2("./script.sh") setwd(wd) but find rather unhandy. how can without changing r working direcotry? this isn't pretty, job # function call script test <- function(){ # current working directory cur <- getwd(); # on exit, come on.exit(setwd(cur)); # change directory setwd("~"); # run command system("pwd"); # return null } then call function test() .

How to get Facebook profile picture from Android App? -

i have created simple test app on android "login facebook". this code: public class mainactivity extends appcompatactivity { private textview info; private loginbutton loginbutton; private callbackmanager callbackmanager; string email; string birthday; string name; string gender; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); facebooksdk.sdkinitialize(getapplicationcontext()); setcontentview(r.layout.activity_main); callbackmanager = callbackmanager.factory.create(); info = (textview)findviewbyid(r.id.fb_text); loginbutton = (loginbutton)findviewbyid(r.id.fb_login); loginbutton.setreadpermissions(arrays.aslist("public_profile", "email", "user_birthday")); loginbutton.registercallback(callbackmanager, new facebookcallback<loginresult>() { @override pub

source maps - Webpack 2 - compile scss to css and miniffy, together with sourcemaps -

i'm new webpack (been using gulp since... forever). however, i've decided use webpack. decided go webpack 2 (2.1.0-beta.20 currently). been looking over, still couldn't simple task "give webpack bootstrap.scss file (which imports other bootstrap partial scss files needed) , have returned bootstrap.custom.min.css , bootstrap.custom.min.css.map ". i have own bootstrap.scss file imports need bootstrap (not using of it), after custom custom-variables.scss file imported @ top, overwrite default bootstrap variables - colors, grid columns etc. anyway, i'm sure not relevant... issue compiling scss css custom output file name , sourcemap. not make difference, start with, here's custom bootstrap.scss : @import "custom-variables"; // overwrite default bootstrap variables /** * twitter bootstrap * copy/paste original bootstrap file, changed paths */ // core variables , mixins @import "../../../../node_modules/bootstrap/scss/variabl

android - Google Nexus Camera app Panorama Feature -

i trying create application similar google nexus camera feature panorama/photosphere . want display predefined 3d sherical points camera preview. have used sensor fusion demo displaying points. not able achieve stability google nexus camera application's feature panorama/photosphere provides when device in motion. assuming sphere around device , trying display points on equator. when start application preview seems correct start rotate equator of sphere tilts @ angle if using gyroscope(type_gyroscope(in android)) data rotate. when using rotation vector(type_rotation_vector(in android)) points not totally stable , tilting problem occurs here also. i have tried every other sensor fusion think of. cannot understand missing or there else should considered. can me decode/understand google nexus camera application's feature panorama/photosphere ???

html - Bootstrap markdown not working -

Image
hey guys trying use this: http://www.codingdrama.com/bootstrap-markdown/ . using ionic framework , working on single page web application. includes in header of index.html: <!-- jquery --> <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-bbhdlvqf/xty9gja0dq3hiwqf8lacrtxxzkrutelt44=" crossorigin="anonymous"></script> <!-- jquery animated scrolling plugin --> <script src="//cdn.jsdelivr.net/jquery.scrollto/2.1.2/jquery.scrollto.min.js"></script> <!-- markdown --> <link href="css/bootstrap-markdown.min.css" rel="stylesheet"> <!-- bootstrap --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnhvp9aj7xs" crossorigin="anonymous"></script> <link href="https://maxcdn.bootstrapcdn.com/boo

c - Taking user input and using a function to check if its valid -

i'm trying create program in user enters 3 integers, , function checks see input valid. if input not valid, user must input 3 new numbers. #include <stdio.h> int sanitizedinput(int a, int b, int c) { if(scanf("%d", &a)==0) { printf("not number\n"); return 1; } else if(scanf("%d", &b)==0) { printf("not number\n"); return 1; } else if(scanf("%d", &c) == 0) { printf("not number\n"); return 1; } else return 0; } int main() { int a; int b; int c; int check = 1; { check = 0; printf("enter number:"); scanf("%d",&a); printf("enter number:"); scanf("%d",&b); printf("enter number:"); scanf("%d",&c);

datastax - How can I realize a solution where data from a running Labwindows/CVI program gets stored in a Cassandra database? -

i using (or @ least trying use) free datasax distribution windows, , found c++ driver, video/description found visualstudio. possible use cassandra labwindows/cvi? since product c ide, think best bet use datastax c++ driver apache cassandra. there binary distributions windows, described here .

c# - Unreachable code detected. Why? -

im trying learn c# reading herbert schildt "c# 4.0 complete reference" , in 1 of examples have warning cs0162 unreachable code detected , underlined console. how fix , why happened? using system; class prodsum { static void main() { int prod; int sum; int i; sum = 0; prod = 1; (i = 1; 1 <= 10; i++) { sum = sum + i; prod = prod * i; } console.writeline("summ = " + sum); console.writeline("prod = " + prod); console.readkey(); } } 1 <= 10 true, code follow loop never reached. meant i <= 10 for (i = 1; <= 10; i++)

c# - How to access only for admin to login the page? -

i want staff role a (a=administrator) in staff table can access administrator module. want mary tan can access login while rest of staff cannot access. here output: click image database: click db table here's code: sqlconnection conn = null; sqlcommand cmd = null; string connectionstring = null; string staffname = null; protected void page_load(object sender, eventargs e) { } public bool checkvaliduser(string username, string password) { bool valid = false; sqldatareader dr = null; connectionstring = configurationmanager.connectionstrings["leavemanagementcs"].connectionstring; string sql = "select * staff username=@username , password=@pwd"; try { conn = new sqlconnection(connectionstring); cmd = new sqlcommand(sql, conn); cmd.parameters.addwithvalue("

api - Set custom thumbnail via YoutubeAPI doesn't work. Can someone tell me why? -

i try upload custom thumbnail video. official documentation link: https://developers.google.com/youtube/v3/docs/thumbnails/set used scopes requested access token was: https*://www.googleapis.com/auth/youtube.force-ssl https*://www.googleapis.com/auth/youtubepartner https*://www.googleapis.com/auth/userinfo.profile https*://www.googleapis.com/auth/userinfo.email https*://www.googleapis.com/auth/youtube https*://www.googleapis.com/auth/youtube.upload then response: error calling put https://www.googleapis.com/upload/youtube/v3/thumbnails/set?videoid=my_video_id&uploadtype=resumable&upload_id=my_upload_id : (403) authenticated user doesnt have permissions upload , set custom video thumbnails. i set needed scopes , still have not permissions. how can resolve it? thanks. i had same problem. found solution: please verify account putting telephone number , enable "customised thumbnails" in account's panel. docs: https://support.google.com

c# - How to create a matrix without a loop -

i know if possible create matrix without writing loop. try start simple list of range don't know how go further. enumerable.range(1, 4).tolist() here code 3 loops : private static int[][] calculpossiblecombinaison(){ int l; (int = 1; < 5; i++) { (int j = 1; j < 5; j++) { (int k = 1; k < 5; k++) { l = (i*j*k)-1; combinaison[l][0] = i; combinaison[l][1] = j; combinaison[l][2] = k; console.writeline("["+combinaison[l][0]+","+combinaison[l][1]+","+combinaison[l][2]+"]"); } } } return combinaison; } this result of matrix [1,1,1] [1,1,2] [1,1,3] [1,2,1] [1,2,2] [1,2,3] [1,3,1] [1,3,2] [1,3,3] [2,1,1] [2,1,2] [2,1,3] [2,2,1] [2,2,2] [2,2,3] [2,3,1] [2,3,2] [2,3,3] [3,1,1] [3,1,2] [3,1,3] [3,2,1] [3,2,2] [3,2,3] [3,3,1] [3,3,2] [3,3,3] do think it's possible ? thx lot try

node.js - REPL session for a ClojureScript library in the vein of `lein try` -

sometimes want try out library in repl. example when need know date 100 days now, do: lein try clj-time (require '[clj-time.core :as t]) (t/plus (t/today) (t/days 100)) or boot: boot -d clj-time repl -e "(require '[clj-time.core :as t])" (t/plus (t/today) (t/days 100)) this great, still has few seconds of start time. my question: can same functionality using clojurescript , node , perhaps have faster startup time? how can example above cljs-time ? you can use planck jar you're wanting try adding planck's "classpath" (it's not actual classpath since there's no jvm involved). see planck dependencies documentation . e.g.: planck -c ~/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar

r - Error in prettyDate range too small for min.n in ggplot2 facet chart -

i have dataset olympics results in athletics. need make facet ggplot different categories, example 100m , marathon subset: ath.sub <- subset(ath, event_std%in%c('100m','marathon')) i got dataframe > head(ath.sub) event event_std athlete country result medal year unit sex time 1261 100m men 100m usain bolt jam 9.69 gold 2008 time men 2011-01-01 1262 100m men 100m donovan bailey can 9.84 gold 1996 time men 2011-01-01 1263 100m men 100m justin gatlin usa 9.85 gold 2004 time men 2011-01-01 1264 100m men 100m francis obikwelu por 9.86 silver 2004 time men 2011-01-01 1265 100m men 100m maurice greene usa 9.87 gold 2000 time men 2011-01-01 1266 100m men 100m maurice greene usa 9.87 bronze 2004 time men 2011-01-01 > tail(ath.sub) event event_std athlete country result medal year unit sex time 3370 marathon women marathon vale

javascript - AngularJS: add/destroy detail table row -

i have angular 1.4.12 app, table created nested ng-repeat showing set of data. <tr ng-repeat-start="item in pmt.table.data"> ...main data... </tr> <tr class="table-details" ng-repeat-end="item in pmt.table.data"> <td colspan="15"> <div uib-collapse="!item.showdetails"> <div class="table-details-content">hello world</div> </div> </td> </tr> each row has disclosure icon show additional row contains details. in past, have loaded data , used angular ui bootstrap's "collapse" directive hide , show detail rows. you can see entire thing in pen: https://codepen.io/smlombardi/pen/kxpqpj?editors=1010 the problem approach has become apparent when recordset has lot of data; such 1000 rows of json data. despite using one-way binding, performance slow. what i'd rather not have detail rows included @ all, , when d

android - Pausing Service during alarm, resuming it afterwards -

so have service want able listen alarms , temporarily shut down/pause whilst alarm rings, , resume afterwards. service inflates view using windowmanager on top of screen - it's lock screen app.. such, it's on top of else.. this easy enough implement incoming calls using phonestatelistener haven't seen handy alarms - guess implement alarmmanager.onalarmlistener shuts service down once alarm rings, i'm not sure of how turn on again afterwards. thankful help! finally figured out! you can time of next alarm so: alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); alarmmanager.getnextalarmclock().gettriggertime() so add service oncreate method: alarmmanager alarmmanager = (alarmmanager) getsystemservice(alarm_service); if (alarmmanager.getnextalarmclock() != null) { uihandler.postattime(new runnable() { @override public void run() { stopself();

xamarin.forms - How to handle Orientation (Landscape or Portrait ) in ListView using Xamarin Forms -

i using itemtemplate ( viewcell ). got know orientation article in xamarin documentation there no point handling listview orientation. hope answer screen shots http://i.stack.imgur.com/lkmvc.png http://i.stack.imgur.com/5prjj.png as can see screenshots, not orientation problem, listview full width in both cases, quite possibly wrong layout options. can show item template definition? you using grid inside viewcell? in case, first make sure grid's horizontal options set fillandexpand, check grid column size definition. can show grid's column size definitions? if have fixed sizes assigned, size, no matter how unsued space there is. there 2 ways make them use more space. if possible, should use "star" sizes. give columns sizes portions of available space. if give first column size 1* , second column size 1* both take half of available width. you can use other numbers select portions, such 3 columns sizes 5* 3* 1* make first column 5 time

Parsing XML into Java object -

i trying determine best way parse xml response webservice call java object. using jaxb seems easiest way every example requires have template java class java type xml converted into. xml below <?xml version="1.0" encoding="utf-8" ?> <entry_list version="1.0"> <entry id="main[1]"> <hw highlight="yes" hindex="1">main</hw> <sound><wav>main0001.wav</wav></sound> <pr>ˈmeɪn</pr> <fl>adjective</fl> <lb>always used before noun</lb> <def><dt>:most important :<sx>chief</sx> <sx>principal</sx> <vi>the <it>main</it> idea/point</vi> <vi>the <it>main</it> goal/purpose</vi> <vi>speed <it>main</it> advantage of approach.</vi> <vi>the company's <it>main</it> office located in new york.</vi> <vi>the n

plot - plotting histograms in pandas -

Image
i looking plot sets of data each 10 points in them in overlapping bins. values1 = [29, 31, 24, 30, 30, 14, 25, 35, 27, 31] values2 = [36, 29, 29, 29, 34, 33, 27, 34, 36, 39] when add them dataframe come out 2 columns. looking plot 2 rows each 10 overlapping columns. df1 = pd.dataframe(values1, values2) and subsequently when plot them using histograms not come out correctly df1.plot.hist(stacked = true) plt.show() so aim pairwise comparison between each of numbers in arrays. 29 - 36 , 31 - 29 , 24 - 29 etc. i plot them overlap example http://pandas.pydata.org/pandas-docs/stable/_images/hist_new_stacked.png have values instead of 3 in example. you can pass them values dict: values1 = [29, 31, 24, 30, 30, 14, 25, 35, 27, 31] values2 = [36, 29, 29, 29, 34, 33, 27, 34, 36, 39] df1 = pd.dataframe({'values1':values1, 'values2':values2}) df1.plot.hist(stacked = true) what did caused ctor interpret passed values single column of data , i

sql - Django Q&Q versus filter.filter -

while hunting bug, found out following 2 statements different things: query 1 order.objects \ .filter(items__name__icontains="foo") \ .filter(items__name__icontains="bar") \ .distinct() query 2 order.objects \ .filter( q(items__name__icontains="foo") & q(items__name__icontains="bar") ) \ .distinct() the result follows: query 1 include orders have items either contain "foo" or "bar" . example 1 item's name "foo" while item's name "bar" . query 2 includes orders have at least 1 item contains all keywords , example item name of "foo bar" . looking @ queries, can see filter() method adds inner join query while other doesn't. i can see reasoning behind this, wonder if that's intended behavior. the difference first query has 2 filter() calls, , second query has one. the first query tries find object related item containin

Kinvey-Xamarin: How to recieve Data from a User instance? -

i'm working on kinvey project right now, , i'm having problems reading username or special attributes user instance. first tried same way getting _user.id calling _user.username , didnt return anything(but id did curiously). searched on google, there weren't articles it. hope can help, appreciated! for special attributes, use .attributes array on user class. code: console.writeline ("custom attribute is: " + kinveyclient.user ().attributes["myattribute"]); for username, try .username() seems must explicit retrieval of user object before field populated user retrieved; try { retrieved = await kinveyclient.user().retrieveasync(); } catch (exception e) { console.writeline("{0} caught exception: ", e); retrieved = null; } console.writeline ("logged in as: " + retrieved.username ); console.writeline ("custom attribute is: " + retrieved.attributes["myattribute"]); documentation: http:

javascript - compare first property of two object and merge -

i have 1 question compate 2 object property have 2 object different value want compare object , if first property in both object change property value object 1) obj1 = {a: 1001, b: 3147020, c: 30}, {a: 1002, b: 3147021, c: 30}, {a: 1003, b: 3147022, c: 30}; 2) obj2 = {a: 1001, b: 3147020, c: 30}, {a: 1002, b: 3147021, c: 30}, {a: 1004, b: 3147022, c: 30}; when compare if find same value in both object change obj1 b value obj2 b value , if have ides check in both object obj1 value not same obj2 value please me question those not objects. this object: obj1 = {a: 1001, b: 3147020, c: 30}; this array arr1 = ['hello', 'world', '!']; and can make array of objects, example: items = [{a: 1001, b: 3147020, c: 30}, {a: 1002, b: 3147021, c: 30}, {a: 1003, b: 3147022, c: 30}]; so, question? rephrase?

c++ - WMI SoftwareLicensingProduct class doesn't show Partial Product Key for MS Office on some systems ( Windows 10) -

using wmi softwarelicensingproduct class fetching partial product key / license key microsoft product. compatible windows vista , above. still not able retrieve key ms office on few windows10 system, rest of systems, working expected. code : int _tmain(int argc, _tchar* argv[]) { hresult hres; // initialize com. hres = coinitializeex(0, coinit_multithreaded); if (failed(hres)) { cout << "failed initialize com library. " << "error code = 0x" << hex << hres << endl; return 1; // program has failed. } // initialize hres = coinitializesecurity( null, -1, // com negotiates service null, // authentication services null, // reserved rpc_c_authn_level_default, // authentication rpc_c_imp_level_impersonate, // impersonation null, // authentication info eoac_none, // additional capabilities null

JSON data to dataframe in R -

i have json file importing data mylist = rjson::fromjson(file = "jsdata.json") mylist [[1]] [[1]]$key [1] "type1|new york, ny|nyc|hit" [[1]]$doc_count [1] 12 [[2]] [[2]]$key [2] "type1|omaha, ne|omaha|hit" [[2]]$doc_count [2] 8 but when trying convert data frame function below , do.call(rbind, lapply(mylist, data.frame)) i getting error.- error in (function (..., row.names = null, check.rows = false, check.names = true, : arguments imply differing number of rows: 1, 0 i need parse data can used in excel csv. looked @ solution getting imported json data data frame in r output not coming in proper usable format in excel. and jsdata.json sample data looks this: [{"key":"type1|new york, ny|nyc|hit","doc_count":12}, {"key":"type1|omaha, ne|omaha|hit","doc_count":8}, {"key":"type2|yuba city, ca|yuba|hit","doc_count":9}] you can try : req

How to add TIKA into build.gradle using android studio? -

i'm trying put apache tika project. returns error, unfortunately, couldn't solve problem myself. how can put apache tika using android studio? error:(27, 0) gradle dsl method not found: 'runtime()' possible causes: the project 'audiotest' may using version of gradle not contain method. open gradle wrapper file the build file may missing gradle plugin. apply gradle plugin apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "com.example.test.audiotest" minsdkversion 16 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'lib