Posts

Showing posts from January, 2015

ssl - Chef Server - How to deal with self signed certificate? -

i installing chef server version 12.8.0-1 on debian 8.5. by downloading .deb package files direct chef.io website have got chef-server , chef-manage modules installed, configured , running. i have got stuck trying install push jobs server. used command below... chef-server-ctl install opscode-push-jobs-server when command runs following errors... chef client failed. 0 resources updated in 06 seconds [2016-07-12t12:02:23+01:00] fatal: stacktrace dumped /var/opt/opscode/local-mode-cache/chef-stacktrace.out [2016-07-12t12:02:23+01:00] fatal: please provide contents of stacktrace.out file if file bug report [2016-07-12t12:02:24+01:00] fatal: openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=error: certificate verify failed i believe cause of problem self signed certificate used on our corporate firewall allow security team decode ssl traffic. what need know how either chef accept certificate or ignore self signed certs. i know manually download , install mod

SQL Server CE: how to save an amound of time? -

i need save amount of time (3 days, 1 month, 5 years, etc). datetime seems saving date , time (4/5/14 21:03). save number of days number, able save in different units (days, weeks, months...) is there way of doing it? sql dynamic datepart when using datediff so stuck dynamic sql or using case statement. basically, need store datepart , number apply dateadd (datepart , number , date) date . splitting 1 string on each value might resource-consuming, might best use 2 separate fields: char(1) datepart , smallint (-32,768 32,767 should enough) number save on storage space. without user functions , dynamic sql support in sql server compact option implement logic seems through case statement: select case [datepart] when 'y' dateadd (yy, [number], [date]) when 'm' dateadd (mm, [number], [date]) when 'w' dateadd (ww, [number], [date]) else dateadd (dd, [number], [date]) end [new date] ...

angularjs - Angular 2 using both typescript and javascript -

i have angular 2 application written on javascript. want migrate typescript. js code is: (function (app) { app.someservice = ng.core .class({ constructor: [app.anotherservice, function someservice(s) { this._anotherservice = s; }], somefunction: function(){ ... } ..... }); }) (window.app || (window.app = {})); i want inject service typescript component. how can that? i tried use this: @component({...}) export class somecomponent { constructor(public someservice: window.app.someservice) { } } but not work. the way i've managed mix js , ts have file js, in case let's it's src/app.js , code posted above. at point can 1 of 2 things: you create component going use said js code, like: import {component} "angular2/core"; @component({ selector: 'app', template: ` <a> <onclick='app()'&g

c++ - What compile speed improvement can I expect with modules in Visual Studio 2015 -

visual studio 2015 supports modules . i'm excited feature, , although know has important implications on , above build time, that's interest right now. i'm thinking of larger code bases of order of half million lines of code or more, have lot of #include s in header files. my previous approach have been manually or automatically remove unnecessary includes in favor of forward declarations, etc, , use precompiled headers. result typically significant improvement in build times, memory of order of 2-3 times. seems should consider using modules, might lot less effort , deliver arguably better engineered , more future-proof solution. can comment potential effect on compile speed of going down module route instead, larger code bases measured in 100s of thousands or millions of lines of code?

python - dask dataframe apply not executing in parallel -

i have following python script, create dask dataframe using existing pandas dataframe. i'm using multiprocessing scheduler, since function use pure python. scheduler creates 8 processes (one each partition) running sequentially, 1 @ time. dask_data = ddf.from_pandas(data, npartitions=8) dask_data = dask_data.assign( images_array_1=dask_data.images_array_1.apply(lambda x: [] if x == "" else [int(el) el in x.split(',')], name='images_array_1'), images_array_2=dask_data.images_array_2.apply(lambda x: [] if x == "" else [int(el) el in x.split(',')], name='images_array_2') ) dask_data.compute(get=dask.multiprocessing.get) i'm using dask parallelize computation, dataset small enough stay in main memory. is possible run every process in parallel?

java - Groovy HTTP ResponseParseException not found -

i trying make simple get request using groovy http request. expecting json response in form: {records:[]} so far have done in code: def getcountries(def cookies) { if (!cookies) { println("cookies list empty!") return false } println("get countries, cookies list: ") println(cookies) try{ def http = new httpbuilder("https://www.evisitor.hr/test_api/rest/") http.request(get, contenttype.json) { uri.path = "htz/country/recordsandtotalcount?psize=20&page=1&sort=namenational%20desc" headers.accept = 'application/json' headers.'user-agent' = 'mozilla/5.0 ubuntu/8.10 firefox/3.0.4' string c = cookies.join(";") println("before appending in header: ") println(c) headers.'set-cookie' = c response.success = { respnse, reader ->

go - Decode any JSON value to string in Golang -

is there way in golang decode json value string. similar json.number why isn't there json.string? for example, following decoded indicated {"number": 123} => "123" {"string": "123"} => "123" {"float" : 123.45} => "123.45" {"bool" : true} => "true" {"empty" : ""} => "" {"null" : null} => "" inspired post created jsonstring type. decode string, number, boolean or null values string. https://play.golang.org/p/ucaxwril2k type jsonstring string type jsonstring jsonstring func (st *jsonstring) unmarshaljson(barr []byte) (err error) { j, n, f, b := jsonstring(""), uint64(0), float64(0), bool(false) if err = json.unmarshal(barr, &j); err == nil { *st = jsonstring(j) return } if err = json.unmarshal(barr, &n); err == nil { *st = j

directory - How can I compare the content of 3 directories in powershell -

after looking while, i've found lot of people trying same thing haven't yet been able find complete answer i'm hoping can us! what give 2 directories, , b, , compare inside inside b , if there files or folders in b not in generate output file detailing path item in b , not a. here, id use list of items , if of items in these paths contain different files in 2 directories (the names same documents\folder\b.txt contains different desktop\folder\b.txt) generate list showing different or showing file path items different if cant show text different. i've looked doing .hash i'm not sure if that's best way go it? like: $sourcedocs = get-childitem –path c:\documents1 | foreach {get-filehash –path $_.fullname} $destdocs = get-childitem –path c:\documents2 | foreach {get-filehash –path $_.fullname} in terms of have physical comparison, trying 3-way comparison code below isn't accurate i've got yet. $foldera = 'c:\users\username\desktop\folder

imageview - Appcelerator - Image from Camera gets rotated to 90 degree for Android -

i'm trying take image camera , post server android.the problem when take image gets rotated 90 degree. tried different solutions didn't meet success.i tried capture orientation of screen in camera open can rotate imageview, didn't work. if faced problem , knows solution, please help. grateful. android sd : 5.2.0, testing device : samsung a700fd, os : 5.0.2. this known bug, there workaround module: https://github.com/ricardoalcocer/androidrotateimage "there's annoying, yet rare issue when taking photos andorid devices, orientation information not properlly identified titanium, causing photo taken in portrait format returned landscape. [...] besides rotating image, library scales image specified width, , compresses specified percentage. particulary useful, since android camera images can huge , potentially make device run out-of-memory."

c# - Is there any way to remove this white line next to a WinForms scrollbar? -

Image
i've noticed scrollbar on system.windows.forms.panel appears have white line going down left-side of vertical scrollbar. . . the horizontal scrollbar has (the white line appears above it): . i've noticed devexpress.xtraeditors.xtrascrollablecontrol when it's got usewindowsxptheme set true, i'm guessing may system thing (as example, haven't tagged question devexpress tag). i've noticed in visual studio 2015 options screen, has example of scrollbar white line (the 1 on left), , without (the 1 on right): . my question is: there way remove white line scrollbar? if so, how? know may seem minor, it's noticeable enough annoying. i've tagged question both vb.net , c# happy accept answers in either language. you cannot unless use own custom controls scrolling. 3d highlight effect on scrollbar , scrollbar not have override property change style flat. but here fancy custom scrollbars can use. codeproject: scrolling panel co

c# - How to show navigation bar in my android app created with unity -

i'm creating android app unity. although deleted statement androidmanifest.xml android:theme="@android:style/theme.notitlebar" it's still not showing navigation bar in app. can me someone? folder path myunityproject/assets/plugins/android/androidmanifest.xml , androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installlocation="preferexternal" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="14" android:targetsdkversion="22" /> <uses-feature android:name="android.hardware.camera" /> <supports-screens android:smallscreens="true" android:normalscreens="true" android:largescreens="true" andr

java - synchronize on array is not showing outcome as expected -

public class threaddemo implements runnable { integer ar [] = new integer[100]; @override public void run() { synchronized (ar) { system.out.println("start: in run method"); for(int =0; i<100;i++) { ar[i]=i; } for(int i=0;i<100; i++) { ar[i]= ar[i]*1000; system.out.println(ar[i]+"\t"); } system.out.println("end:in run method"); } } other driver calls created 2 threads thread pool executor task = executors.newfixedthreadpool(10); task.execute(new threaddemo()); task.execute(new threaddemo()); output : start: in run method start: in run method 0 0 1000 1000 2000 2000 3000 3000 why 2 threads accessing array simultaneously when array synchronized. ideally when 1 thread access array, acquires lock on array , in case, other thread should wait till first thread doesnot leaves lock on array. synchronized triggered when 2 or more t

html - Center Svg svg gradients text title to center -

i need top center title in svg gradient,i in posts here , nothing me. want title @ top of page in center try add display: block , margin: auto , still nothing. html <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="styles.css"> <title>page title</title> </head> <body> <div class="contain"> <svg width="750px" height="300px" fill="url(#gradient-1)"> <defs> <lineargradient id="gradient-1" x2="0%" y2="100%"> <stop offset="10%" stop-color="#b4c63b" /> <stop offset="20%" stop-color="#ef5b2b" /> <stop offset="30%" stop-color="#ab6294" /> <stop o

android - onChildAdded is fired on every app start, but no new entries in the database -

on every start of app, receive same "onchildadded" actions. app thinks, these child added recently. in database beginning. when close app , start again, receive these actions again. everytime. i call firebasedatabase.getinstance().setpersistenceenabled(true); in application class. how can solve issue, listeners called, when new data added database? the easiest way keep key of newest item user has seen in local storage (e.g. sharedpreferences ). when start activity again, start @ key: string lastseenkey = sharedpreferences.getstring("lastseenkey", "-"); ref.orderbykey(). .startat(lastseenkey) .addchildeventlistener(... and in onchildadded() make sure store latest key in shared preferences.

Java Serial Ports Run Confguration -

i want read , write serial data on same laptop , try code. works ports chosen run configurations selecting com1 , com2 1 one. however; when want use ports again in same way, error appears nosuchportexception there anyway disconnect ports second usage? package javaserial; import java.util.scanner; import gnu.io.commportidentifier; import gnu.io.serialport; public class rs232 { public void connect(string portname) throws exception { commportidentifier portidentifier = commportidentifier.getportidentifier(portname); if (portidentifier.iscurrentlyowned()) { system.out.println("port in use!"); } else { // points owns port , connection timeout serialport serialport = (serialport) portidentifier.open("rs232example", 2000); // setup connection parameters serialport.setserialportparams( 38400, serialport.databits_8, serialport.stopbits_1,

jquery - rotate image before upload using blueimp upload -

i'm using blueimp upload widget upload images file server, works fine. the issue that, want rotate image correctly before upload server, when link through url displays in right orientation. any idea on setting use? maybe need plugin, https://fengyuanchen.github.io/cropper/ preview image rotate, crop image

google cloud dataflow - can I get "event-time" from meta-data? -

greeting developers, know dataflow(df) can event-time i/o (like pubsub), , can assign "event-time" data. but, can attribute value data? understanding, can input timestamp(processing-time) data, not event-time. q1: can event-time data ? q2: if can, how ? thanks helping :d to timestamp of element in dofn, can call processcontext.timestamp() . set timestamp of element according own application logic, can use context.outputwithtimestamp() . like so: @override public void processelement(processcontext c) { // generate timestamp falls somewhere in 2 hours after event time. long randmillis = (long) (math.random() * duration.standardhours(2).getmillis()); instant randomtimestamp = c.timestamp().plus(randmillis); c.outputwithtimestamp(c.element(), new instant(randomtimestamp)); }

wpf - how to bind path data from StreamGeometry -

i new wpf. want draw icon path.i have xaml file including path data in streamgeometry this <streamgeometry x:key="iconlogin" > f1m9.377,5.632c9.5,5.562 9.652,5.562 9.775,5.632 9.775,5.632 17.63,10.156 17.63,10.156 17.753,10.227 17.829,10.358 17.829,10.5 17.829,10.642 17.753,10.773 17.63,10.844 17.63,10.844 9.775,15.367 9.775,15.367 9.714,15.403 9.645,15.42 9.576,15.42 9.507,15.42 9.439,15.402 9.377,15.367 9.254,15.296 9.178,15.165 9.178,15.023 9.178,15.023 9.178,12.917 9.178,12.917 9.178,12.917 2.397,12.917 2.397,12.917 2.177,12.917 1.999,12.739 1.999,12.52 1.999,12.52 1.999,8.48 1.999,8.48 1.999,8.26 2.177,8.082 2.397,8.082 2.397,8.082 9.178,8.082 9.178,8.082 9.178,8.082 9.178,5.976 9.178,5.976 9.178,5.835 9.254,5.703 9.377,5.632z m9.945,1c9.945,1 18.059,1 18.059,1 19.681,1 21.001,2.316 21.001,3.934 21.001,3.934 21.001,17.066 21.001,17.066 21.001,18.683 19.681,19.999 18.059,19.999 18.059,19.999 9.945,19.999 9.945,19.999 9.725,19.999 9.547,19.821 9.547,19.602

database - unable to connect python to external sql datatbase -

i have python program works fine xamp server when trying access database on hostinger. getting following errors : traceback (most recent call last): file "c:\python34\lib\site-packages\mysql\connector\network.py", line 472, in open_connection self.sock.connect(sockaddr) timeouterror: [winerror 10060] connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond during handling of above exception, exception occurred: traceback (most recent call last): file "f:/python_3.4/rpi_connect.py", line 5, in <module> class database: file "f:/python_3.4/rpi_connect.py", line 13, in database cnx = mysql.connector.connect(user='u341930730_m', password='abcd', host='mysql.hostinger.in', database='u341930730_rooms') file "c:\python34\lib\site-packages\mysql\connector\__init__.py", line 179, in conn

android - Fatal Exception: java.lang.NoClassDefFoundError okio.Okio -

i have integrated paypal service in application using try { //paypal intent intent = new intent(vodactivity.this, paypalservice.class); intent.putextra(paypalservice.extra_paypal_configuration, config); startservice(intent); //paypal } catch (exception e) { e.printstacktrace(); } and application gradle file looks : dependencies { compile filetree(include: ['*.jar'], dir: 'libs') testcompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'me.drakeet.materialdialog:library:1.2.2' compile 'com.mcxiaoke.volley:library:1.0.17' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'se.simbio.encryption:library:1.2.0' compile 'com.daasuu:animatehorizontalprogressbar:0.2.0' compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') { transi

android - Can I print an information message in JUnit tests? -

Image
i running junit tests part of android app tests. in case it's testing responses of api rely on may changed (in order validate later tests) when these tests pass output window of android studio shows no messages. we'd instead start each method message saying endpoint testing (e.g. "tests /oranges//segments") message shows first message both passing , failing tests. i tried android logs log.println(log.assert, "...", "...") did not show in android studio output. is there way this? output window refer 1 displayed below (when test marked ignored, can supply message display. i'd same behaviour other tests) the old fashioned java styled system.out.println(); work.

jhipster - Navbar reloading issue -

i have problem jhipster application. in navbar, have couple of "inbox" icons, , want them have "unread messages" notifications on them. number of unread messages depend on of data got in application. i managed make right, reason notifications don't appear after logging in, have reload page first, kind of kills point of whole notification thing. been looking answer everywhere, hope can me out. thanks in advance! your navbar using data returned $http or $resource service use before promise gets resolved.

java - want to check if a table exists before making transaction -

i writing application using java , sqlite database. making many inserts database. each time before inserting have used following sql statement , executed using java create table if not exists table_name " + " (id int not null, " + " percent int not null, " + " task_data varchar(1000) ," + " constraint pk_progressid primary key (id)) however not practice execute statement each time. alternative such checks table exists or not , creates if doesn't? database migration this problem called “database migration”. on every database connection made app, need know database structure , data in known expected condition , configuration. one solution internally label current state of database, sort of version number. of course database table might perfect place store versioning info. i go on , guide through kinds of versioning do, how have app run sql scripts , java code needed bring instance of databa

ios - Static TableView transparent header -

Image
i want achieve next things in uitableviewcontroller: have transparent table header view fixed height. have solid colored table footer view (for example white color). to achieve need set tableviews’ background clearcolor. once set whole tableview backgroundcolor clearcolor header , footer gets transparent, , don’t need footerview transparent. you may say: use tableview inside uiviewcontroller , can’t it, because i’m using static cells dynamic height, , static tableview never conform uitableviewdatasource protocol (only way change cell heights dynamically), because haven’t got methods tableview(cellforrowatindexpath). try setting tablefooterview property: tableview.tablefooterview = uiview() hope helps!

GetOption PERL to Python -

how write perl line in python? getoptions('help|?' => \$help, 'man' => \$man, 'debug!' => \$debug, 'devpath:s' => \$devpath, 'dev2:s' => \$dev2,'rev1:s' => \$prj_rev1, 'rev2:s' => \$prj_rev2, 'prj:s' => \$prj) thanks! there module in python called argparse . can use module solve problem. code example : test.py import argparse import os commandlineargumentparser = argparse.argumentparser() commandlineargumentparser.add_argument("-fname", "--fname", help="first name") commandlineargumentparser.add_argument("-lname","--lname", help="last name") commandlinearguments = commandlineargumentparser.parse_args() fname = commandlinearguments.fname lname = commandlinearguments.lname print "%s\n%s" %(fname,lname) run example python test.py -fname ms -lname = dhoni output ms dhoni

Android (How to find list of dates with a interval of 10 days) -

i developing android application , getting start date , end date server. eg: 20-06-2016 , 20-06-2017 i want find list of dates between these 2 dates interval of 10 days. excluding saturday , sunday . for example: 20-06-2016 monday next date should 04-07-2016 (excluded saturday , sunday). , on. after on each date(from list of dates) want add event in calendar on particular date can notify user message. i wrote code adds event in calendar , notify user on particular time. want list of dates. please me out. thank you. i somehow managed accomplished task. here code public list<string> finddates(string startdate,string enddate) throws parseexception { list<date> dates = new arraylist<date>(); //this list store dates startdate enddate list<string> intervaldates = new arraylist<>(); //this list store dates excluding saturday , sunday. dateformat formatter; formatter = new simpledateformat("mm-d

java - How to maintain ManyToMany -

there entities cookbook , recipe . it's manytomany relation: cookbook can have multiple recipes , recipe can assigned multiple cookbooks. added entity cookbookrecipe , connected entities onetomany. where put method add/remove relation between cookbook , recipe - method has add new cookbookrecipe , add cookbookrecipe cookbook , recipe ? in understanding expect public void addrecipe(recipe recipe) { cookbookrecipe relation = new cookbookrecipe(); relation.setcookbook(this); relation.setrecipe(recipe); this.cookbookrecipes.add( relation ); } is right direction? add method cookbook dao or recipe dao or put service? @entity public class cookbook { private integer id; private string title; private collection<cookbookrecipe> cookbookrecipes; private collection<cookbooksortlevel> cookbooksortlevels; @id @generatedvalue(strategy = generationtype.identity) @column(name = "id") public integer getid() {

c++ - QtQuick key press event propagation -

i have qt gui application. main window contains qtquick component placed on using window container: qquickview * view = new qquickview (); qwidget * container = qwidget::createwindowcontainer (view, this); i'd handle key press events under whole window. faced problem can't handle key events when focus acquired qtquick component if i've set window parent it. the documentation such behaviour expected: qwidget *qwidget::createwindowcontainer(qwindow *window, qwidget *parent = > q_nullptr, qt::windowflags flags = qt::windowflags()) ... window container has number of known limitations: ... focus handling; possible let window container instance have focus policy , delegate focus window via call qwindow::requestactivate(). however, returning normal focus chain qwindow instance qwindow instance implementation itself. instance, when entering qt quick based window tab focus, quite further tab presses cycle inside qml application. also, whether qwindow::

android - How to check front Cam ID? also getting captured image is mirror image from front camera. -

i trying use default camera intent both image , video capture. when turn front camera , capture image or video preview (captured image or video ) inverted . want put prescale in frontcamera . didn't know find camera id in default camera .!! note : not custom camera.!! problem : captured image front camera getting image mirror image. if there problem ? didnt ! thx even stored captured image in sdcard mirror image! how prescale or other idea correct it?? help! photo.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { captureimage(); } }); catureimage method private void captureimage() { context context = this; packagemanager packagemanager = context.getpackagemanager(); if (packagemanager.hassystemfeature(packagemanager.feature_camera) == false && packagemanager .hassystemfeature(packagemanager.feature_camera_any) == false) {

.htaccess - Redirect cronjob output to http instead of https joomla -

a little stuck coding isn't thing thought i'd ask, ive trolled through google , stackoverflow can't find answer works. need redirect https://www.doughillardsports.co.uk/index.php?option=com_akeeba&view=check&key=srtb8wwqmjqq4yaqaivqn4mcsfshfplp http in .htaccess file. here code. ## no directory listings indexignore * ## can commented out if causes errors, see notes above. options +followsymlinks options -indexes ## mod_rewrite in use. rewriteengine on ## begin - rewrite rules block out common exploits. # if experience problems on site block out operations listed below # attempts block common type of exploit `attempts` joomla! # # block out script trying base64_encode data within url. rewritecond %{query_string} base64_encode[^(]*\([^)]*\) [or] # block out script includes <script> tag in url. rewritecond %{query_string} (<|%3c)([^s]*s)+cript.*(>|%3e) [nc,or] # block out script trying set php globals variable via url. rewritecond %{query

.net - Timer ticker Event is delay on some computer -

my .net project insert timer , set interval = 100 textbox set value every 0.5 second using below event : timer1.interval = 100 private sub timer1_tick(sender object, e eventargs) handles timer1.tick textboxweight.text= m_dblwg '* 1000 textboxqty.text= m_dblwg / iif(m_dblweightperpcs = 0, 1, dblweightperpcs) end sub but it's work when run program on desctop when run on user's computer low spec, it's delay 3 second.

java - JPA CriteriaBuilder SELECT two Columns WHERE values IN Collection of Tuples -

i have question jpa criteriabuilder. i have table 2 foreign keys a_id , b_id . want select records pair of (a_id, b_id) in set of tuples. possible build query criteriabuilder? in oracle database followed query work: select a.id table_name (a.a_id, a.b_id) in ((123, 21), (423, 32)); but have difficulty build clause criteriabuilder. in expression work single value? or maybe possible same thing subquery?

Gradle, create and copy javadoc jars from multiple dependencies -

i have following project structure: project 1 project 2 depends on project 1 project 3 depends on project 1 (there external dependencies) i create source jars , javadoc jars with task sourcesjar(type: jar) { destinationdir = file("./../../build/export/$project.name") classifier 'sources' sourcesets.main.allsource } task javadocjar(type: jar, dependson: javadoc) { destinationdir = file("./../../build/export/$project.name") classifier 'javadoc' javadoc.destinationdir } artifacts { archives sourcesjar archives javadocjar } now need create folder contains jar file of project , jar files of dependencies. current version is task makelibsdir(type: copy, dependson: ['jar', 'sourcesjar', 'javadocjar']) { description 'builds relevant jar files use project dependency , copies them libs folder' jar // copying jar configuration file outdir = file("./../../build/$

linux - updating product/vendor id on Raspberry Pi (CP210X) -

running "uname -a" on raspberry pi yield following: linux tm-gw 4.4.14-v7+ #896 smp sat jul 2 15:09:43 bst 2016 armv7l gnu/linux my problem have usb device vendor , product id isn't registered in cp210x.c file, - again - means though can found, raspberry not allow communication (/dev/ttyusb0 doesn't exist). i have tried download kernel, add id pair cp210x.c file, rebuild , install, works. (dmesg show "usb 1-1.4: cp210x converter attached ttyusb0") since have install program on more 1 raspberry takes long, i'd know if possible inject usb id's without recompiling kernel ?? i did try take cp210x.ko file kernel build , install new raspberry typing "sudo insmod cp210x.ko" didn' work. /karsten thanks ian abbott solution. run "sudo modprobe cp210x" sudo sh -c 'echo 10c4 84cc > /sys/bus/usb-serial/drivers/cp210x/new_id' when plugging in device works :-)

tomcat - Difference between Xms and Xmx and XX:MaxPermSize -

what difference between -xms4096m -xmx2048m -xx:maxpermsize=712m i getting confused of 2 -xmx2048m , -xx:maxpermsize=712m and happen if use -xmx2048 m or -xmx2048 m java objects reside in area called heap , while metadata such class objects , method objects reside in permanent generation or perm gen area. permanent generation not part of heap. the heap created when jvm starts , may increase or decrease in size while application runs. when heap becomes full, garbage collected. during garbage collection objects no longer used cleared, making space new objects. -xms size specifies initial heap size. -xmx size specifies maximum heap size. -xx:maxpermsize= size sets maximum permanent generation space size. option deprecated in jdk 8, , superseded -xx:maxmetaspacesize option. sizes expressed in bytes. append letter k or k indicate kilobytes, m or m indicate megabytes, g or g indicate gigabytes. references: how java memory pool divided? what

python 2.7 - Hashed or random values getting inserted in google cloud datastore -

task = datastore.entity(client.key('modeldatatest', prod_id)) task.update({ 'productid': '1234', 'listofrankedrelevantitems.productid': ['345', '456','567'], 'listofrankedrelevantitems.similarityscore': ['0.98', '0.89','0.77'] }) client.put(task) using above code i'm creating entity in gc-datastore i'm getting prod_id blob 'mtizndu=' instead of string '1234' , productid ["mzix","mzq1","ndu2"] instead of ['345', '456','567'] , similarityscore ["mc45oa==","mc44nw==","mc43nw=="] instead of ['0.98', '0.89','0.77'] 1 having idea why , how proper values. the issue in python 2 string represented bytestream , have convert unicode see results in gcloud datastore. use unicode() method solve issue.

javascript - Infinite-scroll keeps loading everything even if scroll-bar is not moved -

i'm trying use infinite scroll, , works not way want it. when open page loads infinitely. want load 15 picture when open page , load 15 more when scroll bottom increasing url's "index". angular.module('home', ['infinite-scroll']) .controller('anasayfa', ['$scope', '$http', function ($scope, $http, $location) { $scope.method = 'get'; var index = 0; $scope.url = 'http://api.donanimhaber.com/api/v1/site/newssite?pageindex=' + index + '&pagesize=15'; $scope.loadcompleted = true; $scope.loadmore = function () { if (index > 0) { if ($scope.loadcompleted == false) return; $scope.loadcompleted = false; $http({ method: $scope.method, url: $scope.url }). then(function (response) { $scope.status = respon

javascript - Shift focus of buttons with angularjs -

navigate through button group , down arrow key angularjs? no jquery please. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="button-wrapper"> <div class="btn btn-primary">one</div> <div class="btn btn-primary" >two</div> <div class="btn btn-primary">three</div> </div>

c++ - Errors compiling a DLL in Visual studio -

i have create dll function in c++. created project choosing dll , used default sample example created automatically in beginning. i edited 2 files : ocr2.h using namespace std; #ifdef ocr2_exports #define ocr2_api __declspec(dllexport) #else #define ocr2_api __declspec(dllimport) #endif // cette classe est exportée de ocr2.dll class ocr2_api cocr2 { public: cocr2(void); // todo: ajoutez ici vos méthodes. }; extern ocr2_api int nocr2; ocr2_api int fnocr2(void); ocr2_api bool comparer(bool latin, string lieninitial, string lienstr1, string lienstr2, string lienstr3); and ocr2.cpp #include <sstream> #include <string> #include <iostream> #include <cstring> #include <fstream> using namespace std; // il s'agit d'un exemple de variable exportée ocr2_api int nocr2=0; // il s'agit d'un exemple de fonction exportée. ocr2_api int fnocr2(void) { return 42; } ocr2_api bool comparer(bool latin, string lieninitial, strin

mysql - PHP/MYSL - creating avatar upload function for users using BLOB -

i creating forum , trying allow users able update profile picture (avatar). attempting blob. aware storing images on database not idea self-learning project , unlikely considered real life use in future. i coming across issue of image not being saved in database , resulting in following error: notice: undefined index: user_avatar in c:\wamp64\www\latest_try\editprofile.php on line 24 i newb in php (clearly) , appreciate if me understand need make save image database. i wonder if can save image or need complete seperate table somehow link users information using foreign key. below mysql table using in relation function , issue. mysql -> describe users; +-----------------+-------------+------+-----+---------+--------------+ | field | type | null | key | default | | +-----------------+-------------+------+-----+---------+--------------+ | user_id | int(8) | no | pri | null |auto_increment| | user_name | varchar(30) | no