Posts

Showing posts from September, 2013

javascript - KendoUI grid not showing up with the data on the screen -

Image
hi developing angular 2 application kendo ui controls. following example of kendo ui site set kendo grid. reason there no errors nothing showing on screen. data stored in local products.js file referred in application , bound datasource. please see code below product.html <!doctype html> <html> <head> <title></title> <link href="../../assets/css/kendo/2016.3.1028/kendo.common.min.css" rel="stylesheet" /> <link href="../../assets/css/kendo/2016.3.1028/kendo.default.min.css" rel="stylesheet"/> <link href="../../assets/css/kendo/2016.3.1028/kendo.default.mobile.min.css" rel="stylesheet" /> <script src="../../scripts/kendo/2016.3.1028/jquery.min.js"></script> <script src="../../scripts/kendo/2016.3.1028/kendo.all.min.js"></script> </head> <body> ...

multithreading - C#, Thread, Memory -

today know how save image stream (really in memory it's possible don't use appropriate term) , read thread. to think proceed these steps : - in first thread : 1 - create image object (system.drawing) file 2 - create thumbnail 3 - save thumbnail stream (system.io) 4 - send stream object second thread. b - in second thread : 1 - receive stream first thread 2 - create bitmapimage object stream 3 - displaying on ui. (wpf) thks. i've retrieve part of code show did : in thread check images in folders : public void createimgobj(object sender) { try { filestream fs = file.open((string)sender, filemode.open); bitmap dimg = new bitmap(fs); memorystream ms = new memorystream(); dimg.save(ms, system.drawing.imaging.imageformat.jpeg); bitmapimage bi_img = new bitmapimage(); bi_img.begininit(); bi_img.streamsource = new memorystream(ms.toarray()); bi_img.endinit(); ...

c++ - "typename qualified-id" referring to a type in a non-type parameter-declaration -

14.1 [temp.param], paragraph 2 ... typename followed unqualified-id names template type parameter. typename followed qualified-id denotes type in non-type parameter-declaration ... i'm bit confused meaning of bold text. specifically, typename can occur in 2 different contexts ( type-specifier or template-parameter ), 1 refer to? for former case, considered: struct { struct x { }; int x; }; struct b { struct x { }; }; template<class t> void f(t t) { typename t::x x; // t can or b } however, neither a::x nor b::x non-type parameter-declaration (they member-declaration s). for latter case, i'm not sure why that's necessary. why not directly write down type qualified-id ? parameterization necessary? this about struct s { typedef int x; }; template <typename t, typename t::x> void f() { } int main() { f<s, 1>(); } here, typename t means t named template type parameter, typename t::x type of un...

python - invalid salt still even when using decode utf -

can tell me im doing wrong, keep getting invalid salt, want hash password using bcrypt. here code views.py @app.route('/login',methods=['get','post']) def login(): if request.method == 'get': return render_template('login.html') username = request.form['username'] password =request.form['password'] user = user.query.filter_by(username=username).first() if user , bcrypt.check_password_hash(user.password, request.form['password']): login_user(user) session['logged_in'] = true flash('logged in successfully') return redirect(request.args.get('next') or url_for('index')) else: flash('invalid username or password') return redirect(url_for('login')) models.py from app import db, bcrypt class user(db.model): __tablename__ = "users" id = db.column(db.integer, primary_key...

java - Building Google Maps example project with Android Studio 2.2.2 -

i have downloaded android studio 2.2.2 , try build example projects. blank activity project builds, deploys , runs on phone. then try build google maps project. obtained api key, copied google_maps_api.xml , didn't change else. then, if press build -> build apk, fails following messages in gradle console: executing tasks: [:app:assembledebug] incremental java compilation incubating feature. :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportanimatedvectordrawable2500library up-to-date :app:preparecomandroidsupportappcompatv72500library up-to-date :app:preparecomandroidsupportmediarouterv72400library up-to-date :app:preparecomandroidsupportpalettev72400library up-to-date :app:preparecomandroidsupportsupportcompat2500library up-to-date :app:preparecomandroidsupportsupportcoreui2500library up-to-date :app:preparecomandroidsupportsupportcoreutils2500library up-to-date :app:preparecoman...

c# 4.0 - How to insert data from datetimepicker to ms access using c#? -

i beginners using inserting data datetimepicker ms access. code is: private void savesale() { string connstring = configurationmanager.connectionstrings["saledbx"].connectionstring; string cmdstring = "insert sale (date, sale, expense) values (@date, @sale, @expense)"; using(oledbconnection con = new oledbconnection(connstring)) { using(oledbcommand cmd = new oledbcommand(cmdstring, con)) { con.open(); cmd.parameters.addwithvalue("@date", todaydatepicker.text); cmd.parameters.addwithvalue("@sale", saletextbox.text); cmd.parameters.addwithvalue("@expense", expensetextbox.text); cmd.executenonquery(); messagebox.show("today sale added successfully!", "sale saved", messageboxbuttons.ok, messageboxicon.information); } } } i fac...

node.js - How to allow NodeJS app live on external IP -

i trying run nodejs app on google cloud compute engine. can access preview page of app. when tried access app through external ip. there nothing happened. has use command add new firewall rule: gcloud compute firewall-rules create default-allow-http-8080 \ --allow tcp:8080 \ --source-ranges 0.0.0.0/0 \ --target-tags http-server \ --description "allow port 8080 access http-server" i figured out problem. when accessed google cloud console, though instance console, installed app in this. that's why when tried access ip of instance, there's nothing happened.

google apiclient php vison 403 Request had insufficient authentication scopes -

trying use google vision api having following error: error calling post https://vision.googleapis.com/v1/images:annotate : (403) request had insufficient authentication scopes. < i using laravel in server not google (cloudways) , using google/apiclient instaleld via composer. i have similar code google calendar information , works charm. this code : //i have google.php uner app/config information $client_id = config::get('google.client_id'); $service_account_name = config::get('google.service_account_name'); $key_file_location =config::get('google.key_file_location');// base_path() . $this->client = new \google_client(); $this->client->setapplicationname("my webapp"); /* if have access token */ if (cache::has('service_token')) { $this->client->setaccesstoken(cache::get('service_token')); } $key = file_get_contents($key_file_location); //in documentation have read talk scope $scopes = ar...

VBA Excel Macro error: 1004 unable to get the substitute property of the WorkbooFunction class -

Image
i using vba macro find big string in text file. read text file , read text compare (which saved in 1 of cell). after replace crlf cr (since saved text not contain crlf). compare. working fine if file size less. throwing error when file size high (around 50 kb fine). guess maximum size of file? the below part of code throwing error open logfilepath input #ifile strfilecontent = input(lof(ifile), ifile) close #ifile strfilecontent = application.worksheetfunction.substitute(strfilecontent, vbcrlf, "") strsearch = application.worksheetfunction.substitute(strsearch, vblf, "") strfilecontent = application.worksheetfunction.substitute(strfilecontent, vbtab, " ") if instr(1, strfilecontent, strsearch, vbbinarycompare) > 0 searchtextfile = "success" else searchtextfile = "failed" end if any guess or suggestion please. i note error refers substitute property , using application.worksheetfunctio...

android - How I can go Activity to Layout Resource file by using Intent? -

when want go 1 activity activity can go using intent this, intent gointent = new intent(home.this, another.class); startactivity(gointent); but when want go 1 activity layout resource (which has no activity.java) file, how can work? if want change layout activity, best use viewflipper . need put both layouts in 1 xml file. layout.xml <viewflipper android:id="@+id/viewflipper"> <relativelayout> // here youre first layout </linearlayout> <relativelayout> // here youre second layout </relativelayout> </viewflipper> to switch layouts in youre activity, need call shownext() : viewflipper vf = (viewflipper) findviewbyid( r.id.viewflipper ); vf.shownext();

c# - Create a list of DataTables from a single DataTable, but grouped by day -

i hope can me puzzling question! in past i've used following statement in order obtain list<datatable> each datatable in list comprises of records each of distinct names in "name" column of "inputdt" datatable. in other words, code outputs list of tables each table contains data specific name: list<datatable> listofserialnumberdatatables = inputdt.asenumerable().groupby(row => row.field<string>("name")).select(g => g.copytodatatable()).tolist(); i similar thing, except group datetime column, each of datatable s in list<datatable> comprises of records have same date (regardless of time). so i'm trying create code creates list table in list<datatable> contain data specific date. so example, 1 of tables contain data dated 1st oct 2016, , table in list contain data 3rd oct, etc. [ps i'm not worried format of output of column - question list of datatables data in them specific day .] [note...

swift - TableView Section Change Header Alignment -

Image
i have tableview here : with default left text alignment change right text alignment . how can ? edit: now looks : you have in uitableview datasource method viewforheaderinsection : swift 2.3: func tableview(tableview: uitableview, viewforheaderinsection section: int) -> uiview? { let headertext = uilabel() headertext.textcolor = uicolor.lightgraycolor() headertext.adjustsfontsizetofitwidth = true switch section{ case 0: headertext.textalignment = .center headertext.text = "this header centered" case 1: headertext.textalignment = .right headertext.text = "this header aligned right" default: headertext.textalignment = .left headertext.text = "default left" } return headertext } edit: modified code above. can use section argument identify section want modify.

python - Find array with the maximum sum of elements -

i have problem task: "in given array of integers 𝑁 of size 𝑛 × 𝑛 𝑀 find array of given size 𝑚 × 𝑚, 𝑚 <𝑛 such sum of elements in array 𝑀 largest possible." wanted create loop check every possible 𝑚 × 𝑚 array , sum failed @ cutting list of lists given size. how can cut array of 𝑛 × 𝑛 𝑚 × 𝑚? i'm using build-in functions. if understand problem correctly, use iloc in pandas. see below example. import pandas pd import numpy np df = pd.dataframe(np.arange(16).reshape(4,4)) # blocks of size m=2 in dataframe of size 4 m = 2 n = 4 # prints mxm block of df , corresponding sum in range(0, n-m+1): j in range(0, n-m+1): tmp_df = df.iloc[i:i+m, j:j+m] print(tmp_df) print('sum:', tmp_df.values.sum(), '\n') edit: saw stipulation of built-in functions. if pandas doesn't fit bill, form of data? second shot below using list comprehensions instead of pandas. array = [list(range(x, x+4)) x in range(0,13...

html - Media query not running for small sizes -

inside panel want set text center align when page sizes < 768, media query not working center text. here fiddle @@media , (min-width : 768px) { .text-left { text-align: center; } } <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mynavbar"> <span class="icon-bar"></span> <span class="icon-bar...

java - Getting operation timed out exception on socket read -

if set msocket.setsotimeout(1000); java.net.sockettimeoutexception: read timed out after 1 second of wait on msocket.getinputstream().read() expected. but, if msocket.setsotimeout(0); get java.net.socketexception: operation timed out after around minute(55 seconds in of runs) of wait puzzling. i have tried increasing sysctl tcp settings on mac os el capitan no avail. if settings restricted timeout around minute, should have gotten same read timed out exception before. what's operation timed out exception? edit: worth mentioning deliberately bringing network down using pfctl , since using websockets on tcp expect connection not break given large timeout , flow continue once bring network once again. the stack trace both exceptions same ie at java.net.socketinputstream.socketread0(native method) @ java.net.socketinputstream.read(socketinputstream.java:150) @ java.net.socketinputstream.read(socketinputstream.java:121) @ java.net.socketinputstream.read(...

How to get innerHTML of XML tag has specific id attribute using php? -

having xml file, how can content with/without attribute? example having as: <book id="1"> <title>...</title> <author>...</author> </book> <book id="2"> <title>...</title> <author>...</author> </book> <book id="3"> <title>...</title> <author>...</author> </book> giving input tagname book , id 2 , should return inside it, in case: <title>...</title> <author>...</author> i have solved problem looking xml file string , working string want ask possible using xml-file without scroll directly content. in real have big xml file (something 30-40 mb) , want search content in giving coordinates tag-name , (if present) attribute/s. structure of file not "constant". domxpath::query method filter selected elements xpath . can select elements has specific attribute. code find book tag value of ...

javascript - HTML 5 Currency format -

this question has answer here: html5 form input pattern currency format 7 answers i using lots of html 5 input controls in pages. 1 of requirement have textbox currency feature. tried this: <input type="number" pattern="(d{3})([.])(d{2})" /> this allows me type values 10,000.00 but still not meeting requirements. want if user types in 10000 should convert currency format 10,000 onblur. and when read value input type in javascript, should give me float instead of string value cannot use calculate without parsing. here's workaround additional input type="text" : http://jsfiddle.net/uevv6/2/ html <input type="text" id="userinput" pattern="[0-9]*"> <br> <input type="number" id="number"> js document.getelementbyid("userinput").o...

Xamarin Forms / Android ScrollView with Paging, same as UIScrollView.PagingEnabled -

i want create scroll view pages can scrolled vertically , horizontally well. scroller should slideshow on website, slide between images (content). scrollview, stop @ point when scrolled. i using in xamarin.forms, i'll need create custom renderer (android) , set content of pages forms. i tried viewpagers, want able set content forms page, not predefined layouts... i couldn't find clear example/tutorial can understand how approach problem. think overriding methods scrollviewrenderer class, intercept , slide point, have no idea methods , properties change. something carouselpage on xf, can used inside layout. any or examples appreciated. thanks! i'm searching 2 days solution problem.

python - Web scraping (getting error while using jupyter) -

this first time working python , related packages , tools.so trying follow examples given in this lecture here code import pandas pd # pass in column names each csv u_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code'] users = pd.read_csv( 'http://files.grouplens.org/datasets/movielens/ml-100k/u.user', sep='|', names=u_cols) users.head() i errors while executing code using jupyter urlerrortraceback (most recent call last) <ipython-input-4-cd2489d7386f> in <module>() 6 users = pd.read_csv( 7 'http://files.grouplens.org/datasets/movielens/ml-100k/u.user', ----> 8 sep='|', names=u_cols) 9 10 users.head() /opt/conda/envs/python2/lib/python2.7/site-packages/pandas/io/parsers.pyc in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false...

java - Android application throws Guice exception -

i'm new in android applcation , wrong. i've tried compile application javampd modue throws exception: "com.google.inject.internal.util.$computationexception: com.google.inject.internal.util.$computationexception: java.lang.exceptionininitializererror" @ biulder creation: try { mpd.builder mpdbuilder = new mpd.builder(); } catch (exception error) { string text = error.getmessage(); toast.maketext(this, "exception: " + text, toast.length_long).show(); } i've traced exception guice , figured out exception throwing inside javampd module injector = guice.createinjector(new mpdmodule()); here full stack trace: w/nalizablereferencequeue: not load finalizer in own class loader. loading finalizer in current class loader instead. result, not able garbage collect class loader. support reclaiming class loader, either resolve underlying issue, or move google collections system class path. java.io.filenotfoundexcept...

html - How to get a div to have the dimensions of the image it contains -

Image
i learning css , having trouble understanding logic , default behaviour when placing content inside divs. in project, have png play button: it's 233 px 67 px. in page, have "play button" inside div called "buttons" html: <div id="buttons"> <div id='play'> <div class="letters"> <img src="buttons/play/playrest.png" width="100%"> </div> </div> </div> i have added borders divs try understand better. my "buttons" divs has red border , goes down, other buttons in etc... green border "play" div holds play button. css #buttons { position: absolute; width: 28.5%; min-height: 80%; transform: translate(-50%, 0); left: 50%; top: 10%; z-index: 1; border: 1px solid red; } #play { position: relative; min-height: 5vw; display: block; border: 1px s...

c# - Improving EF Query Performance - checking if rows exist in a prefetched List<string> -

i have following (generalized) query: var listofpossiblecars= new list<string>(); var listofcars = db.cars.where(s => listofpossiblecars.contains(s.carname)).tolist(); but listofpossiblecars large contains hundreds of thousands of records. query causing delay , i'm wondering how can improved. instead of doing in-memory collection insert data of listofpossiblecars database temporary table defined indexes , partitions , have happen in database. defined tables database perform hash-join. after data in database query like: //instead data database car in db.cars join possiblecar in db.possiblecars on car.carname equals possiblecar.carname select car;

Dynamic/lazy imports in Elm -

i lazily import definition of function in elm. use case browser, may have multiple views not need render initial page load, i'd defer network requests speed initial load. polymer prpl pattern , can lazy load definition of custom element. have looked around, haven't been able find suggest possible in elm. any ideas appreciated. if none surface, i'll assume it's not possible. i don't think possible in elm. dynamic imports specifically, intentionally impossible in language in order statically check them @ compile time. you might able work out ports js program dynamically run or fetch other elm modules, giving lot of benefits you'd elm compiler.

web scraping - Python -- AttributeError: 'NoneType' object has no attribute 'find_all' -

i'm trying image links , description pages in python keep getting attributeerror: traceback (most recent call last): file "d:\downloads\test.py", line 78, in <module> get_detail_book_list( get_book_list() ) file "d:\downloads\test.py", line 59, in get_detail_book_list image = div.find_all('img') attributeerror: 'nonetype' object has no attribute 'find_all' here's code: from bs4 import beautifulsoup selenium import webdriver class book(): """docstring book""" def __init__(self): self.title = "" self.link = "" self.image = "" #add new items class self.des = "" def get_book_list(): driver = webdriver.phantomjs(executable_path = r'd:\programs\phantomjs\bin\phantomjs.exe') url = 'https://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3daps&field-keywords=python+progr...

java - Spring mvc resources files can't include into jsp page (Tomcat v9.0, Spring Tool Suite, Maven) -

i want include css file jsp page. tried solutions stackoverflow, google... still nothing, doesn't recognize css code. i tried 3 solutions: <link href="<c:url value="/resources/css/main.css" />" rel="stylesheet"> <spring:url value="/resources/css/main.css" var="maincss" /> <link type="text/css" href="${pagecontext.request.contextpath}/css/main.css" rel="stylesheet" /> servlet-context.xml <?xml version="1.0" encoding="utf-8"?> <beans:beans xmlns="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd ...

java - Android image/video slider library -

im creating android app allows user find place (restaurant example) , tha app has home page displayed , images , videos slider. im looking android library offers images , videos slider. any appreciated !! you can use android image slider get github this amazing image slider android platform. decided open source because there not attractive, convenient slider widget in android. you can load images internet url, drawable, or file. , there many kinds of amazing animations can choose. :-d add slider layout: <com.daimajia.slider.library.sliderlayout android:id="@+id/slider" android:layout_width="match_parent" android:layout_height="200dp" /> copyright : daimajia

wordpress - How does WPs CSS work in a WP site merged with another CMS system (genealogy)? -

i working on merging new installation of wordpress site tng ( http://www.tngsitebuilding.com/ ) site have had while ( http://www.legstadaleit.hafdal.dk ). i followed 5 steps described here: http://www.kloosterman.be/info/how-i-made-my-tng-wp-website/ and result can seen here (menu point tng): http://www.hafdal.dk/test/tng/cemeteries.php now, problem wp seems somehow block css settings tng site. have added css code custom css part in wp, didn’t help. if compare http://www.hafdal.dk/test/tng/cemeteries.php css setup i’d have can seen here: http://www.legstadaleit.hafdal.dk/cemeteries.php can see f.ex. texture background missing, table width , height not correct, font not right etc. why css have tng, not work when combined wp , how can fix this? i really greatful if me this. have asked several people no 1 has been able me far. , css experience not big, stuck :-/

entity framework - EF Code First Migration Files Source Control -

wanted ask bluntly can't seem find answer out there. when run 'add-migration...' 3 new file migration files created (.cs, .resx, .designer.cs). in regards source control, files should commit repo , files can ignore? i'm interested in files absolutely necessary reconstruct tables if needed. when run 'add-migration...' 3 new file migration files created (.cs, .resx, .designer.cs). in regards source control, files should commit repo , files can ignore? all 3 files necessary reconstruct database. the .cs file contains up , down method you, respectively, updgrade or downgrade database. the .resx file contains metadata used migrations. contains name of default schema use (dbo default value) , snapshot of model @ time migration generated. the .designer.cs here because of presence of .resx . contains properties make easy access settings on .resx file. all 3 files need committed , pushed in source control , no 1 should edit them. ...

javascript - Sequelize include model attributes not working -

i need select 2 instances same model eager loading fields need, attributes property not working on include objects db.company.findall({ where: { industry: stock.industry }, attributes:['id'], include:[{ model: db.price, as: 'lastprice', attributes:['adjclose'], limit: 1, order: '"createdat" desc' }, { model: db.price, as: 'comparisonprice', attributes:['adjclose'], where:{ createdat:{ $lte: comparisondate, $gte: limitdate } }, limit: 1, order: '"createdat" ...

Failing to upload JSON file through Chrome to Firebase Database -

this frustrating. have 104 mb json file want upload firebase database through web front end, after random period of time (i've timed it, it's not constant, anywhere 2 20 seconds) error: there problem contacting server. try uploading file again. so try again, , keeps failing. i've uploaded files big before, , limit stored data in realtime db 1 gb, i'm not close that. why keep failing upload? this error in chrome dev tools: failed load resource: net::err_connection_aborted https://project.firebaseio.com/.upload?auth=eyjhbgcioijiuzi1niisinr5cci6…q3niwiywrtaw4ionrydwusinyiojb9.cihvjvlslx43nobynajeyibkbrtygerlg4yo1t3jkva failed load resource: net::err_connection_aborted if click on link shows in error, it's page words post request required . turns out answer ignore web importer entirely , use firebase-import . worked first time, , took minute upload whole json. , has merging capabilities.

r - String replacement using sub function -

i attempting extract names of nba players column in database. however, format of the names in names column following: "lebron james\\jamesle01" i used following regex expression inside sub function attempt keep name portion: sub("([a-z]\\w+\\s*-*'*[a-z]*\\s*\\.*|[a-z]\\.\\s*)\\*\\*[a-z]*\\d*\\d*", replacement = "\\1", x = nba_salaries$names) the expression meant take account unusual names contain more alphanumeric characters (e.g. michael kidd-gilchrist, de'andre jordan, luc mbah moute, etc.) however, when run following, head(nba_salaries$names) the names end being in same format. i have used regexr.com ensure regex expression captures strings properly. how this, can split text "\\" string, , take first element: text <- c( "lebron james\\jamesle01", "michael jordan\\jamesle01" ) sapply( strsplit( text, "\\\\" ), "[", 1 ) which gives [1] "lebron james"...

django - IE will not open my website instead trying to download it -

chrome, safari, , firefox display website normally. yet, seems ie not see website html file , instead asks download when input url. when select open downloads file , asks program open as. when select ie displays normal webpage. if there code answer question happy share, not sure begin. i on aws/ubuntu/django stack. i able fix switching render_to_response render.

wpf - How to use a lock in threads -

i'm using threads in wpf project. , control threads flow, i'm using spinlock in wpf. however, faced on "this lock using thread" error log @ runtime.( original log not english, translate english. ) so, think spinlock cannot used threads. hope know way of using lock in many threads. or want know lock can used in case. you need post code. documentation spinlock says: all members of spinlock thread-safe , may used multiple threads concurrently. spin locks needed rarely. might investigate other locking primitives.

c - Basic Bool function giving segmentation fault -

so i'm trying learn functions bit better , able write 1 useful , in 1 recursive , sorts list of number given program. i'm getting segmentation fault here. feel occuring when try read argv[i+1] when have run out of entries in argv[] . why doesn't if(i < argc){ statement checking preclude happening? here's code. #include <stdio.h> #include <ctype.h> #include <math.h> #include <string.h> #include <stdbool.h> bool compare(val1,val2) { if(val1 > val2){return false;} else{return true;} } // int values[], int n int main(int argc, char *argv[]) { for(int i=1; i<argc; i++){ //print unsorted list printf("%s\n",argv[i]); if(i < argc){ if(compare(*argv[i],*argv[i+1])) { printf("true\n"); } else { printf("false\n"); } } // add else odd numbered l...

Influxdb authentication fail using Ruby -

i trying connect influxdb using influxdb-ruby gem. with: influx -username admin -password secret > show databases; name: databases --------------- name _internal metrics works fine. but if try ruby: client = influxdb::client.new(host: "host", port: 8086, database: "metrics", user:"admin", password: "secret") client.list_databases influxdb::authenticationerror: {"error":"authorization failed"} any tip here ? thanks in advance you must replace user argument username . client = influxdb::client.new(host: "host", port: 8086, database: "metrics", username:"admin", password: "secret")

How can i diseable information block in prestashop 1.6? -

Image
please have problem informations block. shows 2 blocks , want diseable please. can't find when can it. thanx ps : here's screenshot : you need disable 'cms block' (or blockcms) module admin panel.

ios - (Swift3) Can return the full JSON file but I cannot return a specific value, what am I doing incorrectly? -

i have local json file named such: testthejson.json {"myjson": [{ "id1" : {"name":"stack", "lastname": "overflow" }, "id2" : {"name":"cat", "last":"dog", } } ] } and try read in file such: func parsejson() { let path = bundle.main.path(forresource: "testthejson", oftype: "json") let jsondata : nsdata = nsdata(contentsoffile: path!)! nsdata! let readablejson = json(data: jsondata data, options: jsonserialization.readingoptions.mutablecontainers, error: nil) var name = readablejson["myjson","id1","name"] print(readablejson) //returns full json script print (name) //returns null } why print(readablejson) return full json file , print(name) return null? doing var name = readablejson["myjson","id1","name"] line incorrectly? thanks! edit...

javascript - Moving Item from arrows -

the following code should make controller html element arrows. right arrow should make move right; left arrow should stop car. movedown() function should check if car moving , stop move , make move down , moveup() should same process move up; problem movedown() , moveup() not working ,could me ? thanks! <!doctype html> <html> <body > <p id="demo">a function triggered when user pressing key in input field.</p> <input type="text" id="car" style="position:relative;"> <script> document.addeventlistener("keydown", myfunction); var left=0; var interval=0; var down=0; var up=0; function myfunction(e) { var car=document.getelementbyid("car"); //move right if(e.keycode == 39){ moveright(car);} //stop move if(e.keycode == 37){stopmove(car);} //move down if(e.keycode ==40){movedown(car)}; //move if(e.keycode==38){moveup(car)}; } //move car function mov...

java - How do I add text to a ScrollView at run time? -

i know how add text scroll view @ run time. working in android studio. have file reading , have put lines of text stringbuilder buffer object. how display text in scrollview? need use .addview? thanks scrollview single-element container, meaning should have 1 element in it. a scrollview framelayout, meaning should place 1 child in containing entire contents scroll; child may layout manager complex hierarchy of objects. child used linearlayout in vertical orientation, presenting vertical array of top-level items user can scroll through. so should add linearlayout in scrollview , add views instead.

javascript - trying to use the getUserMedia framerate constraint -

i trying adjust framerate display of getusermedia webcam stream. method trying use is var constraints = { video: { framerate: { ideal: 10, max: 15 } } }; as referenced in moz developer network. i create several functions can called change framerate different settings, in trying implement constraint not seem have effect. i've tried using alone function setfps1() { var constraints ... } and within functions (re)declare stream function usevideo(){ // query user device permission navigator.mediadevices.getusermedia({video: true}) // if granted .then(function(stream) { // stream & play video webcam var video = document.getelementbyid('uservideo'); var constraints = { video: { framerate: { ideal: 10, max: 15 } } }; video.src = window.url.createobjecturl(stream); video.play(); }) // if not .catch(function(error) { alert(error.message); }); } and tried f...

amazon web services - Prometehus target Invalid Urls syntax -

im trying add target configured in aws ec2 container gnu nano 2.5.3 file: prometheus.yml # global config global: scrape_interval: 15s # default, scrape targets every 15 seconds. evaluation_interval: 15s # default, scrape targets every 15 seconds. # scrape_timeout set global default (10s). # attach these labels time series or alerts when communicating # external systems (federation, remote storage, alertmanager). external_labels: monitor: 'codelab-monitor' # load rules once , periodically evaluate them according global 'evaluation_interval'. rule_files: # - "first.rules" # - "second.rules" # scrape configuration containing 1 endpoint scrape: # here it's prometheus itself. scrape_configs: # job name added label `job=<job_name>` timeseries ...

node.js - Running webpack on Mac -

i have project uses webpack. run webpack, first installed node (v. 6.9.1) , npm (v. 3.10.8), used sudo npm install webpack -g install webpack globally. when try run webpack in project, says following error: module.js:471 throw err; ^ error: cannot find module 'webpack' @ function.module._resolvefilename (module.js:469:15) @ function.module._load (module.js:417:25) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) @ object.<anonymous> (/path/to/myproj/webpack.config.js:1:77) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) i searched lot online, , best suggestion install locally. tried install locally, got error: npm err! not package /path/to/myproj/webpack npm err! addlocal not install /path/to/myproj/webpack npm err! darwin 15.6.0 npm err! arg...

batch file - I need help writing an if () then command -

i trying write file kills every task runs. know how kill these tasks need writing if () then command. want make if command prompt closed then computer logs off . mention, know how log off command shutdown /l. can please me this? use autohotkey run in background: @echo off :loopme start /wait "c:\path\to\batch.file.bat" goto loopme put in startup folder in start menu... and... voila! hope helps! ~css

sql - Slowly Changing Dimension Type 1 - access -

say have product table contains descriptions mistake. unit of measurement misspelled “garms” instead of “grams”. how implemented query statement represent type 1 - scd technique. i managed answer question. looking this: begin select product table update product table set [product unit of measure] = “grams” [product unit of measure] = “garms” end