Posts

Showing posts from March, 2010

php - finfo_file(): Failed identify data 0:(null) when creating Ad Image Facebook -

i using code creating ad image retrieve image hash ad creative $image = new adimage(null, $this->accountid); $image->{adimagefields::filename}'http://koferafb.dev/image/dummy.jpeg'; $image->create(); echo $image->{adimagefields::hash}.php_eol; the problem encounter error finfo_file(): failed identify data 0:(null) do need extension make run? or doing correctly?

android - Firebase database data retrieving -Java -

Image
here db structure: code used data reading: user="hrcj7"; mdatabase = firebasedatabase.getinstance().getreference().child("user"); query phonequery = mdatabase.orderbychild(user); phonequery.addchildeventlistener(new childeventlistener() { @override public void onchildadded(datasnapshot datasnapshot, string prevchildkey) { user dinosaur = datasnapshot.getvalue(user.class); system.out.println(datasnapshot.getkey() + " " + dinosaur.getemail() + " meters tall."); } @override public void onchildchanged(datasnapshot datasnapshot, string s) {

c - Read() is reading junk data before reading actual data -

im having issue using read() function in c. i have file lets filex has contents: data outputted however when open file , use read on garbage data using code below ssize_t reader = 0; ssize_t writer = 0; char buffer[256]; reader = read(myfile, buffer, 256); //check if reader -1, if exit(1) writer = write(1, buffer, 256); //check if writer -1, if exit(1) the read function seems run twice. once bunch of garbage data followed actual data in file. idea how remedy this? are sure buffer filled '\0', finished '\0' ? , call write 256 - in 3rd arg #include <fcntl.h> int main() { const int max_size = 256; char buffer[max_size] = {}; int my_input = open("input", o_text, s_iread); ssize_t reader; ssize_t writer; reader = read(my_input, buffer, max_size); if(reader != -1) writer = write(1, buffer, reader); return 0; }

recursion - Unbound variable in edwin scheme -

i'm learning scheme first time, , practice i'm trying write program returns list of specified length values equal 1. i'm using mit/gnu edwin editor on windows 10. here's code typed: (define (listlength n) (if (= n 1) (list 1) (append (list 1) (listlength (- n 1))))) (listlength 5) i hope c-x c-e return (1 1 1 1 1) , instead unbound variable error: ;unbound variable: listlength ;to continue, call restart option number: ; (restart 3) => specify value use instead of listlength. ; (restart 2) => define listlength given value. ; (restart 1) => return read-eval-print level 1. ;start debugger? (y or n): the reason can think of doesn't me calling listlength in definition of listlength, that's supposed part of makes scheme scheme, so??? i'm @ loss?? can give me! you should check if use c-x c-e @ end of function. c-x c-e evaluate expression @ left of cursor. or can use m-z ,which evaluate whole expression not matter cur

NET-SNMP: create ifTable with mib2c -

using mib2c created iftable code scratch. ran agent with: ./snmpd -f -c ../etc/snmpd.conf -lo --master=agentx -i-iftable , got: turning on agentx master support. created directory: /var/agentx net-snmp version 5.7.2 then ran sub agent: ./iftable -f -l , got: error parsing iftable row; no columns found error parsing iftable row; no columns found error parsing iftable row; no columns found ... net-snmp version 5.7.2 agentx subagent connected what doing wrong ? seems mib2c tutorial in not date. the error comes from: _iftable_container_row_restore(const char *token, char *buf) but code not modified me. the above errors not deterministic. i'm not getting them. can please ? thank you, zvika

hl7 v2 - HL7 Integration in .Net -

i have requirement develop small demo application hipaa , hl7 . don't have clear idea can start. found question related subject 10 years old, want integrate hl7 version 2.x , 3.x .net project. can't clear documentation hl7 message pattern version 2.x , 3.x. trying implement nhapi using install-package nhapi but what's next can't example related this. please give me suggestion , guidance. the problem hl7 it's loose standard. there hl7 versions 2.1 through 2.7 , 3. within standards flexibility hospital or vendor of product mix , match newer former standards , add own fields. while know want build it, package may interested in mirth . can many of transformations might looking already. i don't want discourage protocol problem.

python - Why the tensorflow script doesn't work? -

i'm learning tensorflow , got strange error. when type code in text editor , run .py file, doesn't work, if type line line in python interactive command line, works , gives expected result. code official tutorial: import tensorflow tf import numpy np features = [tf.contrib.layers.real_valued_column("x", dimension=1)] estimator = tf.contrib.learn.linearregressor(feature_columns=features) x = np.array([1., 2., 3., 4.]) y = np.array([0., -1., -2., -3.]) input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x}, y, batch_size=4,num_epochs=1000) estimator.fit(input_fn=input_fn, steps=1000) estimator.evaluate(input_fn=input_fn) using python tf_contrib_learn_basic_usage.py , results: i c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfu lly opened cuda library cublas64_80.dll locally c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135]

spring - Loading Java Properties Files by Profile -

i want load properties files in java code. use profile config -dspring.profiles.active=local or dev... how load properties files profile this: classpath:${spring.profiles.active}/test.properties how in java code ? did below, null. properties prop = new properties(); inputstream istream = helper.class.getclassloader().getresourceasstream("test.properties"); try { prop.load(istream); } catch (ioexception e) { log.error(e.getmessage(), e); } { try { istream.close(); } catch (ioexception e) { log.error(e.getmessage(), e); } }

python - Round Sympy Mul with Units -

i'm trying round output of solve evaluation has units attached it. for example: solve(eq(x, 22/7 * seconds), x)[0] outputs: 3.14285714285714*s is there way round 3.14*s while keeping s ? sympy expressions have .evalf() method approximate numbers. accepts optional parameter n , specifies number of digits approximate expression contain. supposing expression contained in expr variable: in [5]: expr out[5]: 3.14285714285714⋅s in [6]: expr.evalf(n=10) out[6]: 3.142857143⋅s in [7]: expr.evalf(n=2) out[7]: 3.1⋅s in [8]: expr.evalf(n=3) out[8]: 3.14⋅s

java - Closing up blank space in JFreeChart bar chart -

Image
i using jfreechart , display bar chart of player's scores, score on y-axis , player's games grouped on x-axis. e.g. string[] {player name, score, game number} player 1, 10 , 1 player 1, 12 , 2 player 1, 15 , 3 player 2, 11 , 1 player 3, 18 , 1 because players not have play same number of games, results in lot of blank space when dataset created, tries plot bar player 2 & 3 games 2 & 3. data.addvalue(score, game number, player name); output: (the numbers dont quite match, quick test knocked up) can me how close blank space? in theory player 1 go on play 100s of games player 2 , 3 playing few, quite ridiculous! new jfreechart there obvious solution! thank in advance help. first @ picture here explanation w.r.t numbers. setlowermargin(double margin). setuppermargin(double margin). setcategorymargin(double margin). setitemmargin(double margin). here how can use methods in chart categoryplot p = chart.getcategoryplot(); categoryax

Python Selenium Xpath get text -

please how can find text invalid email address. inside xpath: driver.find_element_by_xpath(".//*[@id='create_account_error']/ol/li") and verify assert? you can check website - http://automationpractice.com/index.php?controller=authentication put in wrong email address in "create account tab" , click "create account", , see error message. how can verify error message xpath make sample test case? i giving sample code work want, put in testcase accordingly . from selenium import webdriver selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec selenium.webdriver.common.by import url="http://automationpractice.com/index.php?controller=authentication" driver =webdriver.chrome() driver.maximize_window() driver.get(url) driver.find_element(by.id,'email_create').send_keys("this test") driver.find_element(by.id,'submitcreate').click() we

How to track changes in records in SQL Server? -

i have following table has tracking records of students. |==========================================| | id | department | date | |==========================================| | 001 | english | feb 3 2017 | | 001 | english | feb 4 2017 | | 001 | science | mar 1 2017 | | 001 | science | apr 2 2017 | | 001 | maths | apr 7 2017 | | 002 | maths | feb 1 2017 | | 002 | maths | apr 7 2017 | | 003 | maths | apr 3 2017 | | 004 | science | feb 1 2017 | | 004 | maths | apr 7 2017 | |==========================================| i need fetch previous record before when student has changed department. example above, record set returned should for 001, | 001 | english | feb 4 2017 | | 001 | science | apr 2 2017 | for 002 , 003 no changes for 004 | 004 | science | feb 1 2017 |

sql - Generating 6 digit unique random number generator sequence in oracle -

i have tried using noorder clause in oracle sql still getting generated sequence in ascending order. below sequence creation script create sequence otp_seq minvalue 100000 maxvalue 999999 increment 1 nocycle noorder; when run below command repeatedly: select otp_seq.nextval dual; it gives values in sequence: 100000 100001 100002 what want values generated randomly given domain i.e. between minvalue , maxvalue , should unique . regarding noorder clause, the documentation says : "specify noorder if not want guarantee sequence numbers generated in order of request. " the key word guarantee . noorder not promise randomness, means nextval may generate numbers out of order. of concern in rac environments each node has cache of sequence numbers; in these scenarios noorder means cannot infer sequence of nextval requests sequence of given values i.e. cannot use numbers sort records in order of creation. on requirements. your re

php break statement for different title for every page -

i'm not familiar php. apologies if posted already. i'm using following code set title of every page. config.php have -> $pag = $_server['php_self']; switch ($pag){ case '/artist.php': $title= $db->query('select name artist'); $description = $db->query('select des artist'); break; case '/album.php': $title= $db-query('select name album'); $description = $db->query('select des album'); break; } artist.php have -> print_r($title); print_r($description); everything working fine. want know when land on artist.php 4 query executed or case /artist.php 's 2 queries? answer twinfriends correct. because of break , program execute 1 branch of switch . you can find yourself. 1 way debugger, can go step-by-step. way test print ( echo() or var_dump() ) in each branch of switch . see, gets printed, , not.

osx - Importing tifffile in Python 2.7 on mac -

i trying import tifffile in pycharm on mac, keep getting error message: importerror: failed find tiff library. make sure libtiff installed , location listed in path|ld_library_path|.. of course, libtiff downloaded, , tried edit ld_library_path , $path, , added path libtiff installed, still not working! my $path is: /library/frameworks/python.framework/versions/2.7/bin:/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin my $ld_library_path is: /library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages/libtiff:/library/frameworks/python.framework/versions/2.7/lib/python2.7/site-packages and when close terminal , reopen it, $ld_library_path gone, isn't reserved path name? thank much.

c# 4.0 - cveCvtColor causing error OpenCV: u->origdata == data -

i doing face detection using emgu cv in c#.net v4.0, below code code detection. image<bgr, byte> imageframe = new image<bgr, byte>(currentimg); rectangle[] facesdetected; using (umat ugray = new umat()) { cvinvoke.cvtcolor(imageframe, ugray, emgu.cv.cvenum.colorconversion.bgr2gray); cvinvoke.equalizehist(ugray, ugray); facesdetected = evidencelibrary.face.detectmultiscale(ugray, 1.2, 4, new size(20, 20)); } ... full stack trace is: 29/3/2017 12:04:46.132 pm: opencv: u->origdata == data :cvecvtcolor(0,0) stacktrace:: @ emgu.cv.cvinvoke.cverrorhandler(int32 status, intptr funcname, intptr errmsg, intptr filename, int32 line, intptr userdata) @ emgu.cv.cvinvoke.cvecvtcolor(intptr src, intptr dst, colorconversion code, int32 dstcn) @ emgu.cv.cvinvoke.cvtcolor(iinputarray src, ioutputarray dst, colorconversion code, int32 dstcn) @ evidencerepository.camerapreview.currentimage() inner exception as: according stacktrace causing issue @ line c

c# - ONVIF wsdl service: unable to authenticate -

i developing onvif driver using .net 4 (windows forms, not wcf). started importing wsdl files service in visual studio. able send command device in way: httptransportbindingelement httptransportbindingelement = new httptransportbindingelement(); [...] textmessageencodingbindingelement messegeelement = new textmessageencodingbindingelement(); [...] custombinding binding = new custombinding(messegeelement, httptransportbindingelement); [...] endpointaddress serviceaddress = new endpointaddress(url); deviceclient deviceclient = new deviceclient(binding, serviceaddress); device channel = deviceclient.channelfactory.createchannel(); deviceservicecapabilities dsc = channel.getservicecapabilities(); but not able manage http digest authentication. spent days searching on google examples , solutions, ways seems hand write xml code. there not clean solution like: deviceclient.channelfactory.credentials.httpdigest.clientcredential.username = username; deviceclient.channelfactory.cr

javascript - Send an Email to a Static Email Address based on a Trigger Word in a Column of a Google Spreadsheet -

i have following code, 'if' argument send 'message' array doesn't seem execute every row has alert text in col[19]. rather, 1 email being sent each time script run, though there several alerts in col[19]. function analyzealerts() { var sheet = spreadsheetapp.getactivesheet(); var startrow = 4; // first row of data process var numrows = 30; // number of rows process // fetch range of cells a2:b3 var datarange = sheet.getrange(startrow, 1, numrows, 30) // fetch values each row in range. var data = datarange.getvalues(); (i in data) { var col = data[i]; var subject = "upcoming bill alerts"; var message = "the bill "+col[13]+" invoice #:"+col[11]+" $"+col[12]+" due on "+col[14]; if (col[19]="alert") { mailapp.sendemail("hello@world.com", subject, message); } } }

python - How to update object returned in query -

so i'm flask/sqlalchemy newbie seems should pretty simple. yet life of me can't work , can't find documentation anywhere online. have complex query run returns me list of database objects. items = db.session.query(x, func.count(y.x_id).label('total')).filter(x.size >= size).outerjoin(y, x.x_id == y.x_id).group_by(x.x_id).order_by('total asc')\ .limit(20).all() after list of items want loop through list , each item update property on it. for in items: it.some_property = 'xyz' db.session.commit() however what's happening i'm getting error it.some_property = 'xyz' attributeerror: 'result' object has no attribute 'some_property' i'm not crazy. i'm positive property exist on model x subclassed db.model. query preventing me accessing attributes though can see exist in debugger. appreciated. class x(db.model): x_id = db.column(db.integer, primary_key=true) size = db.column(db.int

git - Github push only one branch issue -

i have master , dev branches. i need reset dev branch , did. git push --force --set-upstream origin dev it updated, on github page appeared button "pull request" offering merge changes master branch. dont want merge master yet. should ignore "pull request" button? the pull request button convenience of github, sees have modified code in dev branch , offers simple way create pull request that. if not want create pull request (yet), don't press button.

qt5.7 - Dual display using QT on IMX6 Android platform -

we need start qt application on 1 display(hdmi) , show video playback on display(lvds). video playback started qt application. can 1 suggest how qt on embedded platform? setup details : platform : imx6q sabre-ai os : android marshmallow qt : 5.7 display : hdmi , lvds

java - SOAP Server-Push with TomCat, CXF, Atmosphere over Websockets -

my application needs send , receive soap messages using websockets. of time client (written in python) talks server (java) in simple request-response pattern working. sometimes, if client updates data in centralized database managed server, other clients should notified updated data or other kind of notifcation happend (broadcast) my current stack consists of following technologies: server written in java client written in python 3.4 tomcat 8.5.12 apache cxf 3.1.10 atmosphere 2.4.9 the stack can changed, except following: the languages server , client written in the messages transferred need soap tomcat servlet manager websockets can changed long-polling if it's not possible otherwise. talking server in request-response pattern working. however, don't know how server push working. played around @websocketprocessorservice, @managedservice, @atmosphereresourcelistenerservice listed within atmosphere wiki. either have access plain message no automatic so

docker - Ansible-container setup errors -

i trying give ansible-container spin , following the official guide . note: running docker docker toolbox in win10. inside project folder run $ ansible-container init ansible.django-gulp-nginx but responds execution failed join() takes @ least 1 argument (0 given) if , first run ansible-container init , ansible-container install ansible.django-gulp-nginx , ok. $ ansible-container install ansible.django-gulp-nginx attaching ansible_ansible-container_1 [36mansible-container_1 |[0m running pip install of ansible/requirements.txt [36mansible-container_1 |[0m - downloading role 'django-gulp-nginx', owned ansible [36mansible-container_1 |[0m [warning]: ansible.django-gulp-nginx container app role , should [36mansible-container_1 |[0m installed using ansible container [36mansible-container_1 |[0m - downloading role https://github.com/ansible/django-gulp-nginx/archive/master.tar.gz [36mansible-container_1 |[0m - extracting ansible.django-gulp-nginx /tmp/tmpxz1

android - Why is fullscreen image slider still slow? -

i'm trying swipe through gallery images using pager adapter , glide load images. working faster. i'd have fast android's gallery app. i've tried many glide options. gets fast want if set .override(600,200) not appropriate solution of course. tried imageview size treeobserver first image scale following ones appropriate size. doesn't make faster unfortunately. so why still slow , can make faster? @override public object instantiateitem(viewgroup container,final int position) { imageview imgview; inflater = (layoutinflater) _activity.getsystemservice(context.layout_inflater_service); view viewlayout = inflater.inflate(r.layout.layout_fullscreen_image, container,false); imgview = (imageview) viewlayout.findviewbyid(r.id.img_view); glide.with(_activity).load(_imagepaths.get(position)) .diskcachestrategy(diskcachestrategy.source) .dontanimate() //.override

javascript - Filter things with changeable arguments -

let products = [ { "name": "lenovo", "price": "18000", "model": "v580c" }, { "name": "apple", "price": "30000", "model": "iphone 6" }, { "name": "nikon", "price": "25000", "model": "g290" }] i need filter products array getproduct function, accepts changeable list of arguments. argument can either name of product and/or price within minprice , maxprice , and/or model . function getproduct(productname, minprice, maxprice, productmodel) { return products.filter(product => { return product.price < maxprice && product.price > minprice && product.name == productname; }); } console.log(getproduct("apple", 3540, 3000000000)); console.log(getproduct("lenovo", 3540, 3000000000, "v580c")); yo

path - Run notepad++ from windows command prompt -

i'm new windows (i'm using win7 right now). have downloaded notepad++ , added path c:\program files\notepad++\notepad++.exe; path environment variable. quit command prompt , opened again when type notepad++, notepad++ or notepadd++.exe says is not recognized internal or external command, operable program or batch file. i checked path again echo command , shows included path. i'm doing wrong? you should add directory containing .exe path instead. notice existing entries in path environment variable example. i.e. add path: c:\program files\notepad++

user - Find out from JavaScript the unique ID of the blog's visitor (their Google account, GMail, etc) -

question: how can find out id (i need unique account number in google) of blogger.com visitor - if, of course, logged google account (for example, via gmail)? for example, here page blog: " http://ariturlearn.blogspot.com/2017/02/olurum-sana-69-1.html " can access in 1 of 3 roles: the author of publication the author of blog an visitor of blog. about publication author, information specified in tag containing line href = " http://www.blogger.com/profile/06919529600336241866 " about author of blog, information indicated in tag containing line href = " https://www.blogger.com/profile/06919529600336241866 " and, finally, blog visitor, information specified in tag or, more precisely, in embedded tag. there containing string "id = av-06919529600336241866" here code (06919529600336241866) same in 3 places, because in once: visitor, author of blog, , author of article. if enter blog user, example rom130811, in "id = av-1

DCT coefficients and MV extraction in ffmpeg Mpeg-4 encoding -

i'm using ffmpeg , libx264 encode video , want extract dct coefficients , motion vector of each frame during encoding process. what best way this? i read in ffmpeg manual possible use debug mode flags extract these values. tried ffmpeg -debug dct_coeff output dct coefficients option doesn't work me; deprecated or related specific ffmpeg version? another option modify , recompile ffmpeg source code don't know in part of code dct , mv calculated. any debug mode or code modification suggestions appreciated. multiple options try: -->using x264 source code better ffmpeg because of complex code in ffmpeg. can download x264 here , @ encoder/me.c file. has several block matching algorithms out of 1 selected based on encoding settings. there, after searching, can mv_x , mv_y -->using ffmpeg code suggested aergistal or use ffplay/mplayer display motion vectors while decoding below: ffplay -flags2 +export_mvs input.mp4 --> can use ready-made too

mysql - How to execute 2 SQL queries one after the other using mysqli_multi_query in PHP -

i trying insert values simultaneously mysql database using mysqli_multi_query it's not executing , going if part showing alert message stating record insertion failed. below php code query while (($emapdata = fgetcsv($file, 10000, ",")) !== false) { $sql_tableone = "insert inverterlog (`id`,`timestamp`,`irradiance`,`ambienttemp`,`photovoltaictemp`,`pv1voltage`,`pv2voltage`,`pv3voltage`,`pv1current`,`pv2current`,`pv3current`,`pv1power`,`pv2power`,`pv3power`,`pv1energy`,`pv2energy`,`pv3energy`,`gridvoltagegv1`,`gridvoltagegv2`,`gridvoltagegv3`,`gridcurrentgc1`,`gridcurrentgc2`,`gridcurrentgc3`,`gridpowergp1`,`gridpowergp2`,`gridpowergp3`,`sumofapparentpower`,`gridpowertotal`,`gridenergyge1`,`gridenergyge2`,`gridenergyge3`,`socounter`,`gridcurrentdcgc1`,`gridcurrentdcgc2`,`gridcurrentdcgc3`,`gridresidualcurrent`,`gridfrequencymean`,`dcbusupper`,`dcbuslower`,`temppower`,`tempaux`,`tempctrl`,`temppower1`,`temppowerboost`,`apparentpowerap1`,`apparentpowerap2`,

asp.net - File get from local paths in C# -

i have code below code file file input in view im mvc project. have files in local folder. want read these files without use file input in view. have local paths of files. dont know how can change file string file public static string uploadfile(string category = "external", string guid = null) { string result = ""; httppostedfile file = httpcontext.current.request.files.get(0); result = save(file.contenttype, category, guid, null, file); if (file_save_error.equals(result)) return result; if (string.isnullorempty(result)) return result; return result + ";" + category; } how can solve problem, in advance

c++ - Got empty string - Qt -

i have funktion in class returns qstring value code below: qstring mini_artikel::get_bez()const { return (m_bez); } i initailise m_bez code: bool mini_artikel_transporter::loadartikeldata(int artikelnummer) { mini_artikel ma; db_artikelstamm as_db; if(m_as_t==nullptr) m_as_t= new db_artikelstammtransporter(conwws); if(!m_as_t->load_dbartikelstamm(&as_db,artikelnummer)) { critical()<<"mini_artikel_transporter::loadartikeldata("<<artikelnummer<<"): failed"; return(false); } ma.m_bez=as_db.get_bez(); return (true); } and fill string function in cpp file` if(ma_transporter.loadartikel(b.get_artikelkorr())) str_bez=ma.get_bez(); the problem got str_bez="" ! wrong? your problem not qt, code. have bug. the function load_dbartikelstamm doesn't initialise first argument, db_artikelstamm as_db, making call as_db.get_bez() return empty

.net - nest API 5.3 [Elasticproperty] -

i trying out new .netapi elasticsearch nest version 5.3 not able declare property type [elasticproperty(name = "sys_updated_on", store = true, index = fieldindexoption.notanalyzed, type = fieldtype.date) public datetimeoffset sys_updated_on { get; set; } how declare in new nest version 5.3. please help! elasticpropertyattribute deprecated in nest 2.0+ in favour of type specific attributes. in case, replacement be [date(name = "sys_updated_on", store = true)] public datetimeoffset sys_updated_on { get; set; } a few points index = fieldindexoption.notanalyzed not valid on date (one reason why attributes split out separate types); it's either indexed or not , represented bool in attribute mapping if you're indexing name "sys_updated_on" , can use idiomatic .net property name e.g. sysupdatedon . unless need retrieve field separately using stored_fields , original value stored , retrievable _source , don't need use s

android - Show divider line in between menu items of native menu -

Image
i want edit horizontal line between menu titles , refer many solutions not of them able find solution.please me find solution this <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <group android:id="@+id/grp1" android:checkablebehavior="single" > <item android:id="@+id/contact" android:icon="@mipmap/contact" android:title="contact us" android:checked="true" app:showasaction="collapseactionview"/> </group> <group android:id="@+id/grp2" android:checkablebehavior="single" > <item android:id="@+id/latest" android:icon="@mipmap/latest" android:title="latest ***" android:checked="true" app:showasaction="collapseactionview"/> </group&

google chrome - Blockly workspace background shows random image? -

Image
i'm facing weird bug cause background of blockly shows random image the correct background should this: but shows random image (mostly favicon?) instead it's weird describe in words, please take @ screen record i extract svg blockly (which used in video) can reproduce bug <svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" class="blocklysvg" width="1209px" height="270px" style="display: block;"> <defs> <pattern id="blocklygridpattern5105292194395497" patternunits="userspaceonuse" width="25" height="25" x="1202" y="219"> <line stroke="#ccc" stroke-width="1" x1="11" y1="12.5" x2="14" y2="12.5"></line> <line stroke="#ccc" s

php - how to get date and time respecting user's timezone -

i'm totally confused php/mysql date/time functions. date column timestamp - defalult value - current_timestamp . date_default_timezone_set("europe/belgrade"); //my timezone $stmt = $db->query("select * cinema order date desc"); while($row = $stmt->fetch()){ $date = strtotime($row['date']); $datea = date("d-m-y", $date); $time = date("h:i", $date); ... i'm getting difference of -2 hours comparing local time. how can correct time (respecting timezone), , if possible each user, whereever located on globe, data respecting own timezone? mysql not saves time zones @ all. depending you'd use data stored, should either store date-time value in "utc" (this gmt, no tz offset @ all) or in cases store offset set. second option, should store tz or offset somewhere else (again mysql date-time unable store this) in order reconstruct object db. for example, add created_at, updated_at f

android - How to retrieve and update specific values in firebase -

Image
i have been working on application user getting awarded point completing challenge. user getting awarded 10 points each completed challenge. need make user score updating each time user completes challenge, in other words points pulled database , added points. (points needs update userid match userid) how approach problem, suggestions. public void stopactivity(){ alertdialog.builder builder = new alertdialog.builder(this); builder.settitle("confirm"); builder.setmessage("are sure want stop?"); builder.setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // activity results string speedtext = speedtxt.gettext().tostring(); string distancetext = distancetxt.gettext().tostring(); string timetext = timetxt.gettext().tostring(); toast.maketext(getapplicationcontext(),"your result is: " +

r - How to use do.call to add elements to a ggplot object? -

objection i use do.call combine list of layers e main plot g . intention use annotation_custom(ggplotgrob(x)) objects (where x independent ggplot object) overlay main plot with. e : objects of class layerinstance / layer / ggproto g : object of class gg / ggplot simplified problem this simplified example uses list e of calls geom_* functions: library(ggplot2) # data d <- data.frame(a = 1:3, x = 1:3, y = 1:3) # main plot g <- ggplot(d, aes(x, y, label = a)) # plot elements e <- list(geom_point(), geom_text()) undesired solution to combine plot g elements in e , use single elements (which works) in: g + e[[1]] + e[[2]] but intention (for automation reasons) use do.call . problem using do.call + , list of g , e s fails: do.call(`+`, c(list(g), e)) # error in .primitive("+")(list(data = list(a = 1:3, x = 1:3, y = 1:3), : # unused argument (<environment>) question how can use do.call , + method , list of g , e s c

Jquery easyui autocomplete combobox error -

good morning! i'm using jeasyui framework , have populated combobox on form json cities. when type search city, see inconsistent data , console error. part of form: <div style="margin-bottom:20px"> <input class="easyui-combobox" name="comune_azienda" style="width:100%" data-options="label:'comune azienda:',labelposition:'top',required:true, url:'getcomuni.php', method:'get', valuefield:'id', textfield:'text', panelheight:'200px' "> </div> error console: uncaught typeerror: cannot read property 'tolowercase' of null @ htmlinputelement.filter (jquery.easyui.min.js:14150) @ jquery.easyui.min.js:13808 @ function.map (jquery.min.js:2) @ _a60 (jquery.easyui.min.js:13801) @ htmlinputelement.query (jquery.easyui.min.js:14126) @ jquery.easyui.min.js:13370 thank advice. the error self explanatory: uncaught typee

facebook - AWS Cognito , logins method of AWSIdentityProviderManager protocol is not getting called for iOS -

we trying use aws cognito facebook login, when integrating code per aws documentation below class facebookprovider: nsobject, awsidentityprovidermanager { func logins() -> awstask<nsdictionary> { if let token = accesstoken.current?.authenticationtoken { return awstask(result: [awsidentityproviderfacebook:token]) } return awstask(error:nserror(domain: "facebook login", code: -1 , userinfo: ["facebook" : "no current facebook access token"])) } } this code have written in appdelegate.swift in didfinishlaunchingwithoptions method fbsdkapplicationdelegate.sharedinstance().application(application, didfinishlaunchingwithoptions: launchoptions) let obj = facebookprovider() let credentialsprovider = awscognitocredentialsprovider(regiontype:.useast1, identitypoolid:"somepoolid",identityprovidermanager: obj) let configuration =

objective c - How to upload image to server with headers in ios -

i'm trying upload image server headers hope code fine don't know cannot upload. code { nsdictionary *headers = @{ @"content-type":@"multipart/form-data; boundary=----webkitformboundary7ma4ywxktrzu0gw", @"p-auth-token":self.token}; nsstring *urlstring = [ nsstring stringwithformat:@"http://ica.com/facilitator/server/v1/media"]; uiimage *image= profile_image; nsdata *imagedata = uiimagejpegrepresentation(image, 0.1); double my_time = [[nsdate date] timeintervalsince1970]; nsstring *imagename = [nsstring stringwithformat:@"%d",(int)(my_time)]; nsstring *string = [nsstring stringwithformat:@"%@%@%@", @"content-disposition: form-data; name=\"file\"; filename=\"", imagename, @".jpg\"\r\n\""]; nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init]; [request seturl:[nsurl urlwithstring:urlstri

javascript - image carousel/slideshow with prev/next button -

Image
i have follow tutorial w3school now want improve prev / next indicators, not slider this want achieve also code example or var slideindex = 1; showdivs(slideindex); function plusdivs(n) { showdivs(slideindex += n); } function currentdiv(n) { showdivs(slideindex = n); } function showdivs(n) { var i; var x = document.getelementsbyclassname("myslides"); var dots = document.getelementsbyclassname("demo"); if (n > x.length) {slideindex = 1} if (n < 1) {slideindex = x.length} (i = 0; < x.length; i++) { x[i].style.display = "none"; } (i = 0; < dots.length; i++) { dots[i].classname = dots[i].classname.replace(" w3-opacity-off", ""); } x[slideindex-1].style.display = "block"; dots[slideindex-1].classname += " w3-opacity-off"; } #indi { width: 200px; float:left; } <body> <div class="w3-content" sty

ajax - CORS issue while requesting access token + google oauth 2 -

i making ajax call client google oauth 2 api 'https://accounts.google.com/o/oauth2/auth?redirect_uri=http://blah.com&response_type=token&client_id....' access token, following error: response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource. origin ' http://blah-blah.com ' therefore not allowed access i want call ajax user not disturbed when call made through url or window.location.href or in other words, how can access token such whole page not load, , possible resolve above error??? oauth2 auth endpoint doesn't support ajax design. it's entry point authentication system, must there redirect. result of authentication again redirect url provide, ajax doesn't make sense there.

DBFlow: How to migrate tables from an other database? -

i have columns of table in "old" database want migrate new one, using dbflow. dbflow provides @migration annotation databases, seems works migragte tables in same database. what best approach import columns new/different database using dbflow?

android - Retrofit2: serializer doesn't get called for @Field-annotated parameters -

i need send http put request custom json object in 1 of request's parameter. here problem: when use retrofit2, serializer doesn't called. my object should looks this: { "ignore":["item1", "item2"] } when call directly works well: final gson gson = new gsonbuilder() .registertypeadapter(mymodel.class, new mymodelserializer()) .create(); string s = gson.tojson(new mymodel(mymodel.actionname.accept, new arraylist<string>())); log.d("tag", s); i {"accept":[]} . when call retrofit see in logs this: d/okhttp: name=abc&items=ru.bartwell.myapp.mymodel%4010a3d8b i make request code: try { mymodel mymodel = new mymodel(mymodel.actionname.accept, new arraylist<string>()); response<resultmodel> response = getmyapi().getresult(1, "abc", mymodel).execute(); if (response.issuccessful()) { resultmodel resultmodel = response.body(); // handle result

c++ - Ogre3d: iterating through childnode error -

Image
i have city node houses many building nodes, each of these wish grant new child-node. tells house role , sign have/role. can later used other functions. same .mesh (will later make sign) identify house what. shall randomly assigned. if try run following error. new ogre , adds weird code int citymanager::assignbuildingrole(ogre::scenenode * _citynode, int _numberofbuildings) { std::stringstream nodename("buildingrolenode"); ogre::scenenode::childnodeiterator cnode = _citynode->getchilditerator(); std::vector <ogre::scenenode*> detachable; while (cnode.hasmoreelements()) { detachable.push_back((ogre::scenenode *)cnode.getnext()); } (int = 0; < detachable.size(); i++) { nodename << childiteration << "_" << parentiteration << "_" << i; switch (rand() % 5) // assign building random proffessions giving them rolenode { case 0:

excel vba - VBA macro for text-to-columns -

Image
i'm trying write code following: using text-to-columns,the data should divided in different columns. data in cells a1-a8 this: this data should appear in different columns. like this? sub macro() selection.texttocolumns destination:=range("a1"), datatype:=xldelimited, _ textqualifier:=xldoublequote, consecutivedelimiter:=false, tab:=false, _ semicolon:=false, comma:=false, space:=false, other:=true, otherchar _ :=":", fieldinfo:=array(array(1, 1), array(2, 1)), end sub

linux - Upon logging into sqlplus why does it always print the username? -

upon logging sqlplus why print username in linux? $ sqlplus sql*plus: release 11.2.0.4.0 production on fri apr 7 06:32:57 2017 copyright (c) 1982, 2013, oracle. rights reserved. enter user-name: scott enter password: connected to: oracle database 11g enterprise edition release 11.2.0.4.0 - 64bit production partitioning, olap, data mining , real application testing options user "scott" i don't want print "user "scott" ". one clue message "user is", can see in /software/oracle/cli-11.02.00.04/sqlplus/mesg/sp2us.msg sqlplus/mesg/sp2us.msg:572:00291,0, "user \"%s\"\n" do need change settings somewhere? that's not default sql*plus behavior. have show user command (which it) in personal login.sql or global glogin.sql files. have in $oracle_home/sqlplus/admin sub-directory glogin.sql file. login.sql can in directory in $sqlpath , sql*plus starts search in current directory. luck file