Posts

Showing posts from June, 2012

php - how to specify cache validator for Google fonts -

gtmetrix result specify cache validator (92) - server high what's mean? following resources missing cache validator. resources not specify cache validator cannot refreshed efficiently. specify last-modified or etag header enable cache validation following resources: http://fonts.googleapis.com/css?family=lato%3a100%2c100italic%2c300%2c300italic%2cregular%2citalic%2c700%2c700italic%2c900%2c900italic&ver=4.6.1 http://fonts.googleapis.com/css?family=lato%3a100%2c300%2c400%2c600%2c700%2c900%7copen+sans%3a700%2c300%2c600%2c400%7craleway%3a900%7cplayfair+display%7c&ver=4.6.1 the check you've performed complaining there not being either last-modified or etag header on resources being served fonts.googleapis.com site. unfortunately there isn't can (i assume) not in charge of servers. if want rid of warning can fonts google servers , serve them own server. can setup caching headers way want. note though, not of issue. thing happens when these headers

sql - can we replace full join with union of left and right join? why not? -

can replace full join union of left , right join? if no,why? 'yes' if t1 , t2 sets (no duplicated rows), otherwise answer 'no'. create table t1 (i int); create table t2 (i int); insert t1 values (1); insert t1 values (2); insert t1 values (2); insert t2 values (3); full join select * t1 full join t2 on t1.i=t2.i order 1,2 1 (null) 2 2 2 2 (null) 3 union select * t1 left join t2 on t1.i=t2.i union select * t1 right join t2 on t1.i=t2.i order 1,2 1 (null) 2 2 (null) 3 union all select * t1 left join t2 on t1.i=t2.i union select * t1 right join t2 on t1.i=t2.i order 1,2 1 (null) 2 2 2 2 2 2 2 2 (null) 3

php - Laravel - document extension validation rule -

i have document upload field , validate in laravel using rule: 'document' => 'required|mimes:doc,docx,rtf,txt,xls,xlsx,ppt,pdf|max:1536' it works fine on validations. realized allowed csv too, came know mime type csv text that's allows it. tried upload .sql worked too. what best way have validation based on extension of document?

How to raise validation errors (HTTP status code 400) in Delphi DataSnap REST -

by default - if datasnap method (which declared inside {$methodinfo on} , {$methodinfo off} ) experiences exception, datasnap returns http response status code 500 , simple message {"error":"sql error... whatever..."} . fine system errors, handle validation errors separately - returning extended error message , http code 400. possible do?

postgresql - How to identify the last row in the result set postgres? -

i using postgres 9.5 , using golang library lib/pq interact database. execute select query returns multiple rows , iterate using for rows.next() there anyway ca stop before lat record. want print else on console if last record. following: for rows.next() { var id string err = rows.scan(&id) if err != nil { log.printf("error in rows.scan: %s\n", err) } if (row not last) { fmt.println(id + "i not last") } else { fmt.println(id + "i last") } } you can impliment while loop in go. notlast := rows.next() notlast { //... rows.scan notlast = rows.next() if notlast { fmt.println(id + "i not last") } else { fmt.println(id + "i last") } }

sql server - Find (and possibly remove) duplicate entries in not straight forward table structure -

problem description i have following tables: business (id uniqueidentifier, other columns) address (id uniqueidentifier, businessid uniqueidentifier, type nvarchar, validfrom datetime, validto datetime, other columns) addresscomponent (id uniqueidentifier, addressid uniqueidentifier, value nvarchar, type nvarchar, other columns) an address unique if there no other addresses valid attached same business same address type, , and same number of components same value s , type s. in production have managed several duplicate entries on years. i'm confident it's possible find duplicate values (and thereby remove them) tsql-query, exact details of solution keep eluding me. what i've tried far i've found lot of great answers come close (such examples found here finding duplicate values in sql table ). i've managed myself along lines of: select b.id, ac.text, ac.type, count(ac.value) amount, count(b.id) numbiz businesse b inner join

PHP Environment Variables Undefined -

i having bit of trouble setting , using environment variables in php. i have php file follows http://localhost/site/include.php <?php define("env_location", "http://localhost/site/resources/addition"); ?> which including in following file http://localhost/site/home.php <html> <?php include("include.php"); ?> <body> <?php // bit works echo env_location; // bit works include(env_location . "/test.php"); ?> </body> </html> but seems lose environment variable when try use in last file including http://localhost/site/resources/addition/test.php <?php // fails echo env_location; ?> why file unable see environment variable? getting following error notice: use of undefined constant env_location - assumed 'env_location' in /var/www/html/site/resources/addition/test.php on line 3 env_location what you'

android - Read content of JSON File from Internal Storage -

every bigger in , wanted know how can output content of json file internal storage. following working it. string filename = "names.json"; final file file = new file(environment.getdatadirectory(), filename); log.d(tag, string.valueof(file)); the log shows as: /data/names.json names.json [ "names", { "name": "john doe" } ] read string file , convert jsonobject or jsonarray string jsongstring = readfromfile(); jsonarray jarray = new jsonarray(str); use below method read data internal storage file , return string . private string readfromfile() { string ret = ""; try { inputstream inputstream = openfileinput("names.json"); if ( inputstream != null ) { inputstreamreader inputstreamreader = new inputstreamreader(inputstream); bufferedreader bufferedreader = new bufferedreader(inputstreamreader); string receivestring = "";

arrays - Python: Issue with animation from 3D matrix -

i´ve tried run following code: import matplotlib.pyplot plt import numpy np import matplotlib.animation animation mpl_toolkits.mplot3d import axes3d matplotlib import cm #color map u = np.array([[[0,0,0],[0,1,0],[0,0,0]],[[0,0,0],[0,2,0],[0,0,0]],[[0,0,0],[0,3,0],[0,0,0]]]) x = [-1,0,1] y = [-1,0,1] x,y = np.meshgrid(x,y) fig = plt.figure() ax = axes3d.axes3d(fig) def update(i, ax, fig): ax.cla() wframe = ax.plot_surface(x, y, u[:,:,i],rstride=1,cstride=1,cmap=cm.coolwarm) ax.set_zlim3d(-1,1) print("step= ",i) return wframe ani = animation.funcanimation(fig,update,frames=3,fargs=(ax, fig),interval=1000) ani.save('ani.mp4',bitrate=-1,codec="libx264") the animation is, however, not functioning - takes 2 times prime step (i=0) , then, looping on over again. can please me issue? added init function , repeat=false import matplotlib.pyplot plt import numpy np import matplotlib.animation animation mpl_toolkits.mplot3d imp

Angular ui-router clear cache(with ui-bootstrap doesn't work) -

Image
when want clean angular template cache, have 2 ways: 1. $templatecache.removeall(); 2. templateurl+ new date().gettime() template cache normal clearance, when uses ui-bootstrap, throws error: this effective way solve angular template cache, 1 problem template cache clear, ui-bootstrap not work because requires caching. how solve this, not clear cache, allows normal use of angular ui-bootstrap?

javascript - getting Uncaught SyntaxError: Unexpected token } while trying to remove table row dynamically -

i have looked same problem in other threads not find solution. trying clone table row , append same table changing index of input field , removing add glyph-icon , replacing new glyph-icon has onclick function , when try remove row on click of glyph-icon getting this( uncaught syntaxerror: unexpected token } ) error. checked code again , again not find solution. here code $(document).ready(function(){ var glyphremove=""; glyphremove="<span class='glyphicon glyphicon-minus glyph_size' id='remove' onclick='$(this).closest('tr').remove()' aria-hidden='true'></span>"; $("#add").click(function() { var clone= $("#cloneobject").clone(); clone.removeclass('hide'); clone.prop('disabled',false); clone.find('#

c# - Changing my application exe icon at runtime programatically -

this question has answer here: apply changes mainforms form.icon @ runtime 4 answers changing external exe icon @ runtime 2 answers programmatically change icon of executable 3 answers can change applicatipn exe icon 1 @ runtime programatically? example: if create application c# 3 check time, , make condition that: (if time am) { application set exe icon icon1.ico } else { application set exe icon icon2.ico }

php - How can I select some columns of table? -

here code: $arr = users::all()->toarray(); it returns array of table's columns. don't need columns. need return these columns: 'id', 'name', 'email', 'age' . i've searched , figured out: (using pluck() function) $arr = users::pluck('id', 'name', 'email', 'age')->toarray(); but doesn't return expected result. returns this: array:7 [▼ "john" => 1 "peter" => 2 "jack" => 3 "ali" => 4 "teresco" => 5 "mark" => 6 "barman" => 7 ] as see, there isn't email , age columns. how can fix it? you can collect arrays of columns in get() this: $arr = users::get(array('id', 'name', 'email', 'age'))->toarray();

winforms - C# || How to call methodes of FontDialog without opening the dialog itself? -

Image
i have these buttons on windows form: i code each button functionality.(bold, italic, font style, font size). but wondering if call methodes of fontdialog , put them in own buttons. to more clear: when click bold button, dont want richtextbox.selectionfont = new font(richtextbox.font,fontstyle.bold); instead call methods fontdialog fd = new fontdialog(); fd.somemethode....

android - UNIQUE constraint failed: ParseObjects.className, ParseObjects.objectId (code 2067) -

i error while i'm calling pininbackground on custom object, id random positive integer (not objectid): parsequery<remoteobject> syncquery = remoteobject.getquery().whereequalto("id", id).include("others"); remoteobject = syncquery.getfirst(); remoteobject.pininbackground(); what cause of error, objectid internal , i'm not setting/changing it, how can not unique? caused by: android.database.sqlite.sqliteconstraintexception: unique constraint failed: parseobjects.classname, parseobjects.objectid (code 2067) @ android.database.sqlite.sqliteconnection.nativeexecuteforchangedrowcount(native method) @ android.database.sqlite.sqliteconnection.executeforchangedrowcount(sqliteconnection.java:734) @ android.database.sqlite.sqlitesession.executeforchangedrowcount(sqlitesession.java:754) @ android.database.sqlite.sqlitestatement.executeupdatedelete(sqlitestatement.java:64) @ android.database.sqlite.sqlitedatabase.updatewithonconflict(sqlitedatabase.java:

java - How to speed up eager loading of foreign collections? -

i have database table mapped ormlite, contains data (18 columns) , contains foreigncollectionfield(eager = true) . problem when loading data table ... ormlite creating query every item instead using joins. resulting in 67124 queries , taking forever load objects table. this done in right join query under few seconds? why generate thousands of queries instead? how can speed up? have write raw query , rawrowmapper , makes using orm pointless.. how deal loading eager collections in ormlite? because queryforall not way.. problem when loading data table ... ormlite creating query every item instead using joins. resulting in 67124 queries , taking forever load objects table. it's orm_lite_ reason. lot of people have asked join support on foreign collections i've not gotten yet. it's not easy. if still want use ormlite i'd recommend not using eager = true , doing 2 queries instead. 1 query main item , query using dao associated collection ent

Excel/VBA: Cannot get Variant/Boolean to return (should be trivial) -

i cannot function return values output column in excel: to overcome intense lookup tables , speed computation, using pivot table slicers output row numbers filtering. these rows need converted column of true/false cells large table want perform more calculations. avoid lookups or matching need step through list of rows , turn cells "true" in output vector. function includedinslicer(input_range variant) variant dim n long, j long, r long n = input_range.height ' height of column of reference values ' every row in input_range contains row number in output should true ' other rows should false dim output_range variant redim output_range(1 300000) ' covers maximum number of rows ' initialise rows false j = 1 300000 output_range(j) = false next j ' set rows listed in reference true j = 1 n r = input_range(j).value if r = 0 ' if r=0 beyond end of reference table , have captured blank rows exit ' exit, avoid outside-of-

javascript - Ionic 2: best way to check if is running in browser environment -

i can't find out in docs best way know, in ionic 2 app, if it's runnning in browser (with ionic serve command) or in device/emulator. actually i'm doing check if window object has 'plugins' attribute, don't know if there best way. if(!window['plugins']) { //browser } oh, found in docs platform object, has methods. http://ionicframework.com/docs/v2/api/platform/platform/ 1 is(key), can match import { platform } 'ionic-angular'; @component({...}) export mypage { constructor(platform: platform) { this.platform = platform; ... if(this.platform.is('core')) { //it's in browser } } }

How to display Disqus plugin correctly in wordpress? -

i'm using disqus plugin wordpress have few problems: when page post loading before plugin placed in right spot can see old standard comment want replace witn plugin, how can prevent display old comment section? why need use combination <?php comments_template();?> <?php wp_footer(); ?> to display plugin , not one <?php comments_template();?>

c# - POSTing self referencing model back to controller results in null object? -

is possible pass never ending self referencing model view controller? when submit form fiddler captures posting method settings[index].settings[index].value. actionresult save(settingsection settings) doesn't capture values being posted form. details below of code. here self referencing model public class settingsection : setting { public list<settingsection> children { get; set; } public list<settingsection> settings { get; set; } #region public methods public string getvalue(string path) { // find value json structure based on path return ""; } here base class public class setting { #region fields private string _name; private string _text = ""; private string _description = ""; private string _enumerationname = ""; private string _overridevalue = null; private datatype _settingtype; private string _value; private propertyinfo _propertyinf

User defined table types in Oracle -

first of working mssql. have stored procedure in mssql, need use in oracle , since absolutely new oracle have no idea @ how correct. i needed use user defined table types in ms sql stored procedure because using "logical" tables in stored procedure, need pass them dynamic sql statement within procedure (using column names of "physical" tables variables/parameters). i've started add oracle function in package made before function. looks like type resultrec record ( [result columns] ); type resulttable table of resultrec; function myfunctionname([a lot parameters]) return resulttable pipelined; i described layout of tables (the user defined table types in mssql), want use within function in package header. far good, don't know have declare table variables or user defined table types. tried put them in package header, if trying use these tables in package body, describing function, oracle tells met, table or view not exist. tried describe tab

Find the memory location of variables using assembly language -

Image
hello m new assembly language. trying memory location variables m using dosbox , masm compilor here code .model small .stack 100h .data vara byte 10 ;address ds:xxxx varb byte 0bh ;address ds:xxxx+1 varc word ? vard sbyte ? vare dword ? arr byte 20 dup(?) varf sword 010b arrb word 10 dup(?) varz byte 0 .code main proc mov ax,@data mov ds,ax mov ax,offset vara mov ah,09 int 21h mov ax,offset varb mov ah,09 int 21h mov ax,offset varc mov ah,09 int 21h mov ax,offset vard mov ah,09 int 21h mov ax,offset vare mov ah,09 int 21h mov ax,offset arr mov ah,09 int 21h mov ax,offset varf mov ah,09 int 21h mov ax,offset arrb mov ah,09 int 21h mov ax,offset varz mov ah,09 int 21h mov ah,4ch int 21h main endp end main how can find memory address these variables? u can see error in image use offset modifier, eg: mov ax, offset vara to load address of vara ax register. can use lea instruction achieve s

asp.net mvc - Action does not find View or its master -

i have following action: public class articlescontroller : controller { public actionresult article01() { return view(); } } which returns view , seems work fine. now try add actionname: [actionname("bla-bla-article-1")] public actionresult article01() { return view(); } now calling: /article/article01 returns 'the resource cannot found.' now try this: [actionname("bla-bla-article-1")] public actionresult article01() { return view("~/content/views/articles/article01.cshtml"); } and here get: the view '~/content/views/articles/article01.cshtml' or master not found or no view engine supports searched locations. following locations searched: ~/content/views/articles/articles01.cshtml you have realize default, method name action name. but, once you're overriding convention using [actionname] attribute, url through access action subject change we

xamarin.forms - Xamarin Forums How to change style for Switch on Android 6 to like in Holo theme -

for android 4.2.2 able achieve following examples forum: https://forums.xamarin.com/discussion/30526/custom-texton-textoff-for-switch-possible-to-override-or-support-on-roadmap but moved android 6, not working more. find way customize switch on/off text , color. can me this? i need this: holoswtich

ios - Swift - Sorting By Date Issue -

i'm using nssortdescriptor s sort array date element. date set string using formatter formats in style : "dd/mm/yy hh:mm". date element stored inside dictionaries stored in array. parts of code below: // date formatting let currenttime = date() let timeformatter = dateformatter() timeformatter.locale = locale.current timeformatter.dateformat = "hh:mm dd/mm/yy" let convertedtime:string! = timeformatter.string(from: currenttime) // descriptor let descriptord: nssortdescriptor = nssortdescriptor(key: "date", ascending: false) // dictionary let newuserrecord = [ "name" : enteredname!, "score" : self.gamescore, "date" : convertedtime ] [string : any] // sorting newuserarray.sort(using: [descriptord]) however problem date being sorted time (hh:mm) , not taking in account (dd/mm/yy) part. example if sort date , have date of 13:12 19/11/16 , date of 09:12 18/11/16 09:12 date appear first though should

Android: File did not load when first opening the App -

i have written android app read txt file in oncreate of main activity. works okay. found on android 6, when open app first time, required me allow permission reading file storage. result app cannot read file first time because needed wait user's action. how can read file after user grant permission? i asked permission android 6 below: if (build.version.sdk_int >= build.version_codes.m) { if (contextcompat.checkselfpermission(this, manifest.permission.write_external_storage) != packagemanager.permission_granted) { requestpermissions(new string[]{manifest.permission.write_external_storage}, mainactivity.request_permission_write_external_storage); } if (contextcompat.checkselfpermission(this, manifest.permission.read_external_storage) != packagemanager.permission_granted) { requestpermissions(new string[]{manifest.permission.read_ext

java - HTTP Status 500 - Error instantiating servlet class com.app.RegisterServlet -

i know there're similar questions still couldn't figure out. please me out. have attached directory structure in picture , rest codes listed follows click here see directory structure index.html <!doctype html> <html> <head> <meta charset="iso-8859-1"> <title>insert title here</title> </head> <body> <form action="reg" method="post"> rno:<input type="number" name="rno"><br> name:<input type="text" name="name"><br> mark:<input type="number" name="mark"><br><br> <input type="submit" value="register"> <input type="reset" value="clear"> </form> </body> </html> web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3

ios - How to receive push notification from APNs while the app is terminated/Not working in background or foreground -

apns used in application deployment target set 8.0 . in application need perform operations in order determine whether generate local notification , show user on moment or not. when payload sent apns generate push notification, application receives push notification whether in background or foreground state , following method gets called. - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler where app generates local notification. the problem when application terminated/closed completely/does not appear in tabs, app not receive push notification. development certificates fine because working in background/foreground state. background mode in capabilities on background fetch , remote notifications checked push notifications on in capabilities the payload contains aps contains "content-avilable" : 1 , other data. the payload not

Set "sideload apps" from Windows 10 powershell (Update & Security > For developers) -

is possible set "update & security > developers" attribute "sideload apps" powershell script on windows 10 anniversary (just plain "old" win10)? according https://msdn.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development#which-settings-should-i-choose-sideload-apps-or-developer-mode : run powershell administrator privileges. enable sideloading, run command: ps c:\windows\system32> reg add "hkey_local_machine\software\microsoft\windows\currentversion\appmodelunlock" /t reg_dword /f /v "allowalltrustedapps" /d "1" to enable developer mode, run command: ps c:\windows\system32> reg add "hkey_local_machine\software\microsoft\windows\currentversion\appmodelunlock" /t reg_dword /f /v "allowdevelopmentwithoutdevlicense" /d "1"

angularjs - HTTP GET not being fired -

i'm trying create simple messageboard mongodb, angular, node.js , express. for reason first time call getmessages() goes fine. when call getmessages() after postmessage(), no request being send. these routes: app.get('/api/message', function(req, res) { message.find({}).exec(function(err, result) { res.send(result); }); }); app.post('/api/message', function(req, res) { console.log(req.body); var message = new message(req.body); message.save(); res.status(200).send('message added'); }) and angular controller: (function() { 'use strict'; angular .module('app') .controller('maincontroller', maincontroller); function maincontroller(navigationfactory, $http, $timeout, apifactory, $scope) { var = this; // jshint ignore: line function init() { that.getmessages(); } that.postmessage = function() { apifactory.postmessage(that.message).then(functi

how to show multiple users current location on google map in android -

i developing app using google map, want show multiple users location 1 admin on google map. following code show user current location.now please suggest me how can show multiple users location on google map? //java activity public class locationactivity extends fragmentactivity implements com.google.android.gms.location.locationlistener, googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener { private static final string tag = "locationactivity"; private static final long interval = 1000 * 60 * 1; //1 minute private static final long fastest_interval = 1000 * 60 * 1; // 1 minute private static final float smallest_displacement = 0.25f; //quarter of meter button btnfusedlocation; textview tvlocation; locationrequest mlocationrequest; googleapiclient mgoogleapiclient; location mcurrentlocation; string mlastupdatetime; googlemap googlemap; private double longitude; priva

Is there a non-eval way to expand braces in the string of a bash variable? -

normally, if shell input given expansion (e.g. curly braces), bash expand it: $ a=a{b,c,d}e $ echo $a abe ace ade however, if string quoted such expansion doesn't happen, or received variable populated, braces become part of variable string: $ a="a{b,c,d}e" $ echo $a a{b,c,d}e how expand it? if have var value a{b,c,d}e , there native bash way other eval echo $a ?

validation - How to validate field in datasource in Dynamics AX -

i make validation connected datasource select query. how should write validate() method in field in datasource? to validate field of form datasource need override validate() method of field datasource. for example in datasource in field validate press right click / override method / validate. here put code, save changes.

unit testing - How to use helper class from tests for one module in tests in other module? -

i have project like: -module1 --test ---(many tests cases) ---somehelperclass -module2 --test ---(many tests cases) the class somehelperclass work tests in module1 . , need use same work tests in module2 . but can't import tests in module2 . i've tried add module2 's gradle file: testcompile project(':module1') but module2 's test still not see somehelperclass .

scala - Sort a Spark data frame/ Hive result set -

i'm trying retrieve list of columns hive table , store result in spark dataframe. var my_column_list = hivecontext.sql(s""" show columns in $my_hive_table""") but i'm unable alphabetically sort dataframe or result of show columns query. tried using sort , orderby(). how sort result alphabetically? update: added sample of code import org.apache.spark.{ sparkconf, sparkcontext } import org.apache.spark.sql.dataframe import org.apache.spark.sql.hive.hivecontext val hivecontext = new hivecontext(sc) hivecontext.sql("use my_test_db") var lv_column_list = hivecontext.sql(s""" show columns in mytable""") //warn lazystruct: bytes detected @ end of row! ignoring similar problems lv_column_list.show //works fine lv_column_list.orderby("result").show //error arises the show columns query produces dataframe column named result . if order column, want : val df = hivecontext.sql(s&qu

openerp - where can I find manual_reconciliation_view in odoo 9 (accounting module) -

Image
in pic below want source code view of manual_reconciliation_view can use techniques in project, developer menu doesn't contain items when open view open have open accounting module first , click on " dashboard" click on reconcile items shown in pics below https://drive.google.com/a/lodigroup.net/file/d/0bzsa94_iwlaum2zndc1ldnpzu3m/view?usp=drivesdk you need activate developer mode in order see menu. best regards

ios - String.Encoding is not getting translated to NSStringEncoding in swift 3 to objective C conversion -

am converting existing swift source code base swift 3 , have method in swift class earlier returning nsstringencoding. in swift 3, compiler asks me convert nsstringencoding string.encoding. method not getting reflected in objective-c's generated interface , not able call method in objective-c classes. this sample code snippet : @objc open class myclass: nsobject{ open var textencoding: string.encoding { { return self.getencoding() } } fileprivate func getencoding() -> string.encoding{ // conversion code return encoding } } in objective-c class, -(void)demofunc:(myclass * _nonnull)response{ (i) nsstringencoding responseencoding = response.textencoding; } the compiler throwing error above line, property 'textencoding' not found on object of type 'myclass *' how fix issue cannot declare/use nsstringencoding in swift file , in objective c cannot use string.encoding ? foundation defines typedef nsuintege

android - Error:FAILURE: Build failed with an exception -

pleas solve problem. ? error:failure: build failed exception. what went wrong: execution failed task ':app:transformclasseswithdexfordebug'. com.android.build.api.transform.transformexception: com.android.ide.common.process.processexception: java.util.concurrent.executionexception: com.android.dex.dexexception: multiple dex files define lcom/google/android/gms/auth/api/signin/internal/zzk; try: run --stacktrace option stack trace. run --debug option more log output. i suggest try add on build.gradle (app module). android { ... defaultconfig { ... multidexenabled true } } i hope work per code snippets.

javascript - Where do the files and folders created by a Chrome App reside in file system? -

first have i'm new google chrome app development. i'm using webkitrequestfilesystem create folders , files dynamically app. now can find folders , files in file system, or there other way see them? it buried deep chrome profile, with file names , paths obfuscated , complex metadata dependencies . something along lines (from root of profile folder): storage/ext/your_app_id_here/def/file system/ the filesystem virtual: it's not expected map location within user's filesystem, , you're not expected able access outside chrome . fact it's stored collection of files correspond virtual files technical implementation detail. if want interact real filesystem, need request access folder user using chrome.filesystem.chooseentry api chrome apps instead of webkitrequestfilesystem .

automated tests - Kill a separate powershell script from the main script -

i'm using powershell script perform automated testing on web application. part of script runs small, separate script monitors web app pop ups , closes them if appear. called during main script so: start-process powershell.exe -argumentlist "-file c:\users\documents\monitor.ps1" at point though close monitor script, perform commands, , start monitor script again. is there way me kill monitor script main, without closing main script in process? you want save variable: $a = start-process notepad.exe -passthru $a.id 10536 so later kill it.

Selenium Firefox then Chrome and IE -

is possible run selenium test on firefox , same test on chrome , ie? how can this? using java, can handle automatically required binaries ( chromedriver , geckodriver , , iedriverserver.exe ) means of webdrivermanager . take complete example parameterized junit test case. notice test code single, , in test parameters (method data() ) chose browsers want run code (chrome, firefox, , internet explorer): @runwith(parameterized.class) public class multiplebrowserstest { protected webdriver driver; @parameter public class<? extends webdriver> driverclass; @parameters(name = "{index}: {0}") public static collection<object[]> data() { return arrays.aslist(new object[][] { { chromedriver.class }, { firefoxdriver.class }, { internetexplorerdriver.class } }); } @before public void setuptest() throws exception { webdrivermanager.getinstance(driverclass).setup(); driver = driverclass.newinstance(); } @after publi

javascript - Best way to use multiple functions in jquery plugin development -

suppose have plugin named jquery.area.js , have various methods triangle, square etc $.fn.area = function( options ){ if(options == 'sqaure') { square(); }else if(options == 'circle') { circle(); } ......and on } how use this? proper way have multiple function in jquery plugin? $("#show").click( function(){ $(".area1").area('circle',{ x : 5 }); is right way?

makefile - How can I get CMake to allow for "make clean"ing just one target? -

i have cmakelists.txt multiple targets, of them not part of all . i want able cleanup (using make) files used in building of 1 of targets, not files used build second target. what should do? i see 2 additional options: using internally each target generated - unfortunately not directly accessible through make root - cmake_clean.cmake scripts. e.g. target named foo be: cmake -p cmakefiles/foo.dir/cmake_clean.cmake using ninja instead of make generators call ninja -t clean foo

html - Showing content of a PDF in an iFrame (path to file) -

Image
i have stored pdf , want display in iframe. appropriate way calculate src? i used did not work me: <set field="resourcereference" from="ec.resource.getlocationreference('dbresource://mantle/content/cv/100000/content_100006/161107_hs.pdf')"/> then, in html added: src="${resourcereference.geturl()}" without success. a url resourcereference internal url (starting dbresource:// in example) , not valid url web client. you'll need add screen transition or streams file web client (using ec.web.sendresourceresponse(string location) method). there various examples of transitions using method in framework, simplescreens, etc.

scipy - using python to do 3-D surface fitting -

i can use module(scipy.optimize.least_squares) 1-d curve fitting(of course,i can use curve_fit module directly) , this def f(par,data,obs): return par[0]*data+par[1]-obs def get_f(x,a,b): return x*a+b data = np.linspace(0, 50, 100) obs = get_f(data,3.2,2.3) par = np.array([1.0, 1.0]) res_lsq = least_squares(f, par, args=(data, obs)) print res_lsq.x i can right fitting parameter (3.2,2.3),but when generalize method multi-dimension,like this def f(par,data,obs): return par[0]*data[0,:]+par[1]*data[1,:]-obs def get_f(x,a,b): return x[0]*a+b*x[1] data = np.asarray((np.linspace(0, 50, 100),(np.linspace(0, 50, 100)) ) ) obs = get_f(data,1.,1.) par = np.array([3.0, 5.0]) res_lsq = least_squares(f, par, args=(data, obs)) print res_lsq.x i find can not right answer, i.e (1.,1.),i have no idea whether have made mistake. the way generate data , observations in "multi-dimensional" case results in get_f returning (a+b)*x[0] (input values x[0] , x[1]

c++ - Strange MySql Qt4.8 issue -

i'm trying insert qsqlrecord in empty table. field isptzonvif defined as: isptzonvif bool not null default false but following error: failed submit. column 'isptzonvif' cannot null qmysql3: unable execute statement if print contents of record before trying insert get: qsqlrecord( 27 ) " 0:" qsqlfield("id", uint, length: 10, precision: 0, required: yes, generated: yes, typeid: 3) "-1" " 1:" qsqlfield("host", qstring, length: 150, precision: 0, required: no, generated: yes, typeid: 253) "" " 2:" qsqlfield("port", uint, length: 10, precision: 0, required: no, generated: yes, typeid: 3) "0" ... " 7:" qsqlfield("isptzonvif", int, length: 1, precision: 0, required: yes, generated: yes, typeid: 1) "0" ... i cannot image happening here because isptzonvif has default value (represented 0 "0"). i'm using qt4

excel - Change Background when formula removed by user change -

aim: change background colour if there no formula (when user overrides defaults formula goes , needs highlighted) private sub worksheet_change(byval target range) set currentsheet = activeworkbook.sheets("audit findings") '############# 'check if missing formulas not allowed dim rng range dim row range dim cell range set rng = currentsheetrange("j7:j11") each cell in rng if cell.hasformula range(cell.address).interior.colorindex = 37 ' msgbox "cell " & cell.address & " contains formula." else range(cell.address).interior.color = rgb(255, 0, 0) 'msgbox "the cell has no formula." end if next cell '############# 'check if blanks not allowed on error goto whoa application.enableevents = false 'set range check if not intersect(target, range("e7:j11")) nothing 'check length , reverse if blank has value '#############

Android app crashed if the main activity isn't MainActivity -

i want start loading view crashed when open if main activity in androidmanifiest.xml isn't mainactivity. on emulator fine problem when install apk in phone. help? androidmanifiest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.daniel.jaentodayapp"> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".mainactivity" android:screenorientation="portrait" android:theme="@style/apptheme.noactionbar"> </activity> <activity android:name=".loadingscreen" android:screenorientation="portrait" android:theme="@style/apptheme.noactionbar"> <intent-filter> <

javascript - How to call a native app that can read barcode and return the data to html -

there lots of possibilities not solved problem yet. first tried use phonegap not anymore because of indexeddb problems. want call native application can read barcode web app , use data eventually. couldn't figure out , appreciate if can explain have looked @ barcode scanning in web apps smartphone/tablet browsers , how open native ios app web app . many in advance.

sass - css grid with nth-child -

is possible create repeating pattern of uneven columns using nth-child? have, works first row: .three-cols > div:nth-child(1n) { width: 50%; } .three-cols > div:nth-child(2n) { width: 25%; } .three-cols > div:nth-child(3n) { width: 25%; } .three-cols > div:nth-child(3n) { margin-right: 0; } so want every row split:50%,25%,25% http://codepen.io/garethj/pen/knpqyd there 3 items per row need use 3n each selector. offset 1, 2 or 3 depending on element wish target: .three-cols > div:nth-child(3n+1) { width: 50%; } .three-cols > div:nth-child(3n+2) { width: 25%; } .three-cols > div:nth-child(3n+3) { width: 25%; } .three-cols > div:nth-child(3n+3) { margin-right: 0; } .block { overflow: hidden; } .block > div { box-sizing: border-box; float: left; border: 3px solid purple; } <footer> <div class="block three-cols"> <div>50%</div> <div>25%