Posts

Showing posts from January, 2010

Passing Parameters in a SAS Macro -

i writing macro school assignment pass name of airline macro, sure has character strings , " , ' missing, not run. please tell me doing wrong. %macro select airine=; proc means data=mytables.airtraffic noprint ; bosflights gt 0 , bospassengers gt 0; &airline; var bosflights bospassengers; output out=mytables.bosflightsairport sum (bosflights bospassengers)= flights passengers;` run; %mend select; %select airline = envoy air; you missing () in macro definition , call. %macro select(airline=); ... %mend select; %select(airline = envoy air); are passing in name of variable or value of variable? way have written passing in 2 variable names envoy , air want use group data in airtraffic dataset. if meant parameter value used subset data assuming have variable named airline in dataset want body of macro. proc means data=mytables.airtraffic noprint ; bosflights gt 0 , bospassengers gt 0; airline="&airline"; var bosflights bospass...

Designing a Kalaman filter -

i working on project monitor water tank energy storage. have large water tank, 10 thermometers attached. measuring temperature, can estimate energy stored in tank. quite simple, want add feature. by sampling amount of energy in time, want determine power flowing in or out of tank. measuring energy in tank every minute , determining current power comparing last measurement. direct result noisy (for example jumping between 2-4 kw), need kind of filtering. i started averaging, works fine,(current power average last 10 measurements) wanted try bit fancier. wrote simple kalman filter, 1 described in video - https://www.youtube.com/watch?v=pzrffg5_sd0&list=plx2gx-ftpvxu3oufnatxgxy90auliqnwt&index=5 problem is, guess, filter designed static measurements, , measurement changes quite bit. example, in plot, there 60 measurements (1 every minute) , line output of kalman filter: image is possible modify filter follow actual value more accurately? or not suitable system filter ki...

swift - MapBox MGLFeature identifier should be a unique identifier? -

i'm using mapbox , i'm getting features of building using following code: let features = self.mapview.visiblefeatures(at: pointmapview) if features.count > 0 { let feature:mglfeature = features[0] print("feature.identifier:\(f.identifier)") } everything works correctly, when print feature's identifier number 3, 4 , on. reading documentation of mglfeature, identifier: "an object uniquely identifies feature in containing tile source value of property nsnumber object may in future instance of class, such nsstring. the identifier corresponds feature identifier (id) in tile source. if source not specify feature’s identifier, value of property nil." since identifier should unique, expect more complex number or string 3 or 4. why "simple" identifier?

python - How can I check to see if some data exists and return a boolean value using SQLAlchemy -

i building flask web-app using sqlalchemy. how can check see if data exists , if exists return true , vice-versa? you : exists = db.session.query(your_id).filter_by(your_filter).scalar() not none

interface - Double wifi connection (lan / internet) Ubuntu Server -

i got ubuntu server 16.04.1 2 wireless usb adapters. connect 2 different wifi: to own router wlan0; lan only, ssh server to enterprise network (802.1x/aes/aes) wlan1 internet access i can establish both connections simultaneously don't know how tell wlan0 connect lan (and not internet). /etc/network/interfaces . configuration, both wlan connected wlan0 has got internet access , wlan1 shows no internet traffic. is there way connect wlan0 router, no internet access? # auto wlan0 → lan connection (?) auto wlan0 iface wlan0 inet static address 192.168.1.xx netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.254 wireless-essid <my_essid> wireless-mode managed wpa-driver wext wpa-conf /home/<my_username>/<my_essid>.psk.conf # auto wlan1 → internet connection auto wlan1 iface wlan1 inet dhcp wireless-mode managed wpa-ssid wow fi - fastweb wpa-driver wext wpa-ap-scan 1 wpa-proto rsn wpa-pairwise ccmp ...

node.js - Proper request template mapping or process in order to upload a photo to s3 using Serverless Framework -

i using serverless version 1.0.0 , node version 5.7.1 i have endpoint updating photo of table in mysql database. prior inserting said photo, uploading formdata browser s3, , update photo url using return image url. the problem don't know proper way define request mapping template in serverless.yml extract photo, , path parameters , $context variable principal id here current serverless.yml function definition updateboardphoto: handler: handler.updateboardphoto events: - http: path: boards/{boardid}/photo method: put integration: lambda parameters: headers: authorization: false body: photo: true paths: boardid: true request: passthrough: when_no_templates template: multipart/form-data: '{"principalid" : "$context.authorizer.principalid", "body" : $input.json("$"), "boardid": "$input....

css - How to select only table rows with specific content inside -

i'm scraping email has many table rows, of want exclude. table rows need exactly like: <tr> <td class="quantity"> empty </td> <td class="description"> empty </td> <td class="price"> empty </td> </tr> none of table rows have class or id. moreover, there unwanted <table> rows contain cells these classes no values, need table rows have these 3 classes of cells, , 3 cells non-empty values. i'm not sure of syntax this: body = nokogiri::html(email) wanted_rows = body.css('tr').select{ not sure how encapsulate logic here } this straightforward xpath: wanted_rows = body.xpath('//tr[td[(@class = "quantity") , normalize-space()] , td[(@class = "description") , normalize-space()] , td[(@class = "price") , normalize-space()]]') the normalize-space() calls same normalize-space(.) != "" , i.e. check current node (the t...

javascript - Setting a column value in an enhanced datagrid -

if have xpage datagrid on using rest service. in datagrid 2 records stored individual records in notes . user edits xpage , goes edit 1 of columns in data grid row. there column a, column b , column c. column c calculated using script library "abc" 2 values on column , column b, create background notes document , displayed on datagrid. as example, column = 12 , column b = 24 , column c calculated coming 397. column has change , recalculate using script library abc. in save changes button, give me example code showing how select changed row, set 2 variables column , column b, call script library "abc" , either update background notes document , redisplay datagrid or update datagrid , have update background notes document. column editable column. here code var rsstore = restserviceobj; var items = gridobj.selection.getselected(); dojo.foreach(items, function(selecteditem) { if(selecteditem != null) { viewscope.cola = rsentry.getcolumnval...

How to replace bundle css with external css in webpack? -

for example import codemirror 'codemirror' import markdownit 'markdown-it'; import $ 'jquery'; require('codemirror/mode/markdown/markdown');; require('codemirror/keymap/vim'); require('codemirror/lib/codemirror.css'); i add external js file externals: { 'markdown-it': 'markdownit', "react": 'react', 'react-dom': 'reactdom', 'jquery': 'jquery', 'autobahn': 'autobahn' } but if want add external css file codemirror/lib/codemirror.css . need remove statement , manually add css file stylesheet link in html page?

java - Null Pointer Exception in FXML -

so have 1 controller class looks this. isn't whole thing, important part. in handle button action method, i'm trying input text fields in 1 scene , transfer string , set them on label in scene. i have code public class fxmldocumentcontroller implements initializable { @fxml private radiobutton newcustomer; @fxml private radiobutton regularcustomer; @fxml private label total; @fxml private textfield nameinput; @fxml private textfield phonenumberinput; @fxml private textfield emailinput; @fxml private textfield addressinput; @fxml private checkbox brakes; @fxml private checkbox tirerotation; @fxml private checkbox fluidcheck; @fxml private checkbox carwash; @fxml private checkbox inspection; @fxml private checkbox tirereplacement; @fxml private checkbox oilchange; @fxml private combobox<string> tirechoices; @fxml private c...

r - Comparison of differences or ratios (relative potencies) of ED50 in relation to a reference treatment in drc -

i analysing data ecotoxicological experiments using package drc. have 3 treatments named "0", "1" , "2" (see example below), treatment "0" reference. dataframe has data on chemical concentration (conc) , fraction of mortality (death) treatments. fitted ll.4 model using drm , calculated ed50 values using ed. in next step of analysis, compared ratio , difference of ed50 between 3 treatments. using compparm able calculate estimates ratios of ed50 treatments ("1"/"2", "1"/"0" , "2"/"0") , differences ("1"-"2", "1"-"0" , "2"-"0"). according drc documentation, compparm produces "a matrix columns containing estimates, estimated standard errors, values of t-statistics , p-values null hypothesis ratio equals 1 or difference equals 0 (depending on operator argument)." now know if ratios or differences of ec...

c - segmentation fault: cache lab -

my cache simulator file generates segmentation fault error when run in command line using command: ./csim.c -s 1 -e 1 -b 1 -t traces/yi2.trace. i not familiar segmentation fault errors. any appreciated. edit: used gdb find this program received signal sigsegv, segmentation fault. strcmp () @ ../sysdeps/x86_64/multiarch/../strcmp.s:132 132 ../sysdeps/x86_64/multiarch/../strcmp.s: no such file or directory. (gdb) bt #0 strcmp () @ ../sysdeps/x86_64/multiarch/../strcmp.s:132 #1 0x00007ffff7deb1a5 in _dl_name_match_p (name=0x400459 "libm.so.6", map=0x7ffff7ffe1c8) @ dl-misc.c:289 #2 0x00007ffff7de402f in do_lookup_x (new_hash=new_hash@entry=193502747, old_hash=old_hash@entry=0x7fffffffe200, result=result@entry=0x7fffffffe210, scope=<optimized out>, i=<optimized out>, i@entry=0, flags=flags@entry=1, skip=skip@entry=0x0, undef_map=undef_map@entry=0x7ffff7ffe1c8) @ dl-lookup.c:462 #3 0x00007ffff7de4961 in _dl_loo...

Rails how to get attribute from other controller -

model material(it has attribute arrive_date:date) controller materials_controller, urgent_controller in urgent_controller want find out materials should received within 5 days doing this class urgentcontroller < applicationcontroller def index @materials = material.where((time.zone.now.to_date - arrive_date).to_i <= 5) end end but urgent_controller not know attribute , show error undefined local variable or method `arrive_date' for how can fix this? in advance. in case should create scope in material model. scope :last_5_days, -> { where('arrive_date >= ?', 5.days.ago.to_date) } then call in controller def index @materials = material.last_5_days end hope helps.

php - Email Validaion are not Working in Cakephp 3.0 -

email validation not working , if take name of field email take email not perfect validation 'a@a' working if take email otherwise non-empty working only. recommendtable.php <?php namespace app\model\table; use app\model\entity\recommend; use cake\orm\query; use cake\orm\ruleschecker; use cake\validation\validator; class recommendtable extends table { public function initialize(array $config) { parent::initialize($config); $this->table('recommend'); $this->displayfield('id'); $this->primarykey('id'); $this->addbehavior('timestamp'); } public function validationdefault(validator $validator) { $validator = new validator(); $validator ->requirepresence('name') ->notempty('name', 'please fill field') ->add('name', [...

Android Custom Button Ripple/pulse Effect -

i have created custom circular button using following : <button android:id ="@+id/startbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start" android:background="@drawable/button_bg_round" android:padding="15dp" android:textsize="30sp" android:textstyle="bold" android:textcolor="#ffffff" android:layout_centervertical="true" android:layout_centerhorizontal="true" /> here button_bg_round defined below : <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="oval"> <stroke android:color="#ffffff" android:width="5dp" /> <solid android:color="#3aeaee"/> <siz...

c++ - Can someone explain to me how this loop works within function only? -

studying linked lists , not sure how loop works assignment. the code intended find intersection of 2 linked lists. listnode *getintersectionnode(listnode *heada, listnode *headb) { listnode *cur1 = heada, *cur2 = headb; while(cur1 != cur2){ cur1 = cur1 ? cur1->next : headb; cur2 = cur2 ? cur2->next : heada; } return cur1; } i'm not sure how cur1 = cur1 evaluated assignments rather boolean condition. understand how iteration works unsure of why can't do: while(cur1 != cur2){ cur1 = cur1->next; cur2 = cur2->next; } return cur1; with i'm pretty sure end runtime error though. cur1 = cur1?cur1->next:headb; is ternary operator. checking if cur1 null before trying "move on next node" equivalent to: if (cur1 != null){cur1 = cur1->next;} else {cur1 = headb;} the issue version proposed if cur1 happens null, segmentation fault.

finite automata - W(WR)* regular? -

l= {w(wr)* },w=(a+b)* wr reverse of w. language regular? according me should not regular there can case when can have w(wr) not regular in book answer regular. can explain ? the trick star. (wr)* includes empty word. l includes words w catenated empty word, i.e. words w. , set of words is, of course, regular. for w(wr)^+ things quite different. star reverses of many, many words of language.

javascript - How do I parse a long number string to just a number? -

i have ids need converted strong numbers whenever use parseint() or number(), double type decimal 1.01038295007818e+016.0 i need convert string number. the parseint() function takes first number of string , removes decimal places, returns integer: var = parseint("1.000350001"); var b = parseint("456789.1"); var c = parseint("20"); console.log(a); console.log(b); console.log(c); the math.floor() method rounds number downward nearest integer: var d = math.floor("1234.00101"); console.log(d); the number() function converts string number represents strings value: var e = number("1000.12"); console.log(e); for question, believe either parseint or math.floor work fine, unless number greater javascripts largest available number

android - Json array and object inside json object -

this question has answer here: how parse json in android 4 answers { "status": 200, "message": "api executed successfully.", "data": [{ "data": [{ "shoptoken": "nq2", "id": 5, "userid": 5, "shopname": "test", "contactname": "test", "contactnumber": "test", "address": null, "isactive": true, "ownername": "test" }], "recordsfiltered": 1, "recordstotal": 1, "draw": 0, "pageindex": 0, "pagesize": 1 }] } how can parse json in android? @override protected s...

java - Android service onDestroy method runs on delay after stopService() called -

i using service run timer controlled using main activity. however, lines of code comes after calling stopservice() seems run before ondestroy() method in service. here's code in mainactivityclass calls stopservice() : public void onclicklayouts(view v){ //on click layout s //behaviour stopservice(intenttimerservice); sharedpreferences.edit().putboolean("issselected", true).apply(); updatelayout(); if(sharedpreferences.getboolean("isplaying", false)){ runtimerservice(); } } where runtimerservice() is: public void runtimerservice(){ sharedpreferences.edit().putint("inttimeonbegin", (int) systemclock.elapsedrealtime()).apply(); startservice(intenttimerservice); } this ondestroy() method in serviceclass : @override public void ondestroy() { super.ondestroy(); //runs on service end //behaviour handler.removecallbacks(runnable); if(sharedpreferences.getboolean("issse...

Run contents of string in java -

this question has answer here: run piece of code contained in string 7 answers lets have string: string run = "system.out.println\(\"hello\"\)" . want run in string output hello in console. maybe there method string.run()? try beanshell , build app jar library. import bsh.interpreter; private void runstring(string code){ interpreter interpreter = new interpreter(); try { interpreter.set("context", this);//set variable, can refer directly string interpreter.eval(code);//execute code } catch (exception e){//handle exception e.printstacktrace(); } }

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

what undefined reference/unresolved external symbol errors? common causes , how fix/prevent them? feel free edit/add own. compiling c++ program takes place in several steps, specified 2.2 (credits keith thompson reference) : the precedence among syntax rules of translation specified following phases [see footnote] . physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed. [snip] each source character set member in character literal or string literal, e...

How to open javascript items array in a new window instead of the same window? -

i have great working code opens link in same window when click it, it's inside dropdown menu. this in javascript. problem open in new tab instead of same window. how can this? here code: items["linkeee"] = { "label": "mylabel", "action": function(obj) { openurl('http://mypageaa.com/page' + addid); } }; update -- html looks this: <a href="#">mylabel</a> but don't have direct access html without messing stuff up. gotta there javascript update how combine 'http://mypageaa.com/page' + addid add , "_blank" please thanks turn off pop-up blockers domain @ browser preferences or settings, see chrome pop-up blocker when re-check after allowing page . use window.open() var w; items["linkeee"] = { "label": "mylabel", "action": function(obj) { w = window.open("http://mypageaa.com/page...

r - plot.lm Error: $ operator is invalid for atomic vectors -

i have following regression model transformations: fit <- lm( i(newvalue ^ (1 / 3)) ~ i(currentvalue ^ (1 / 3)) + age + type - 1, data = datareg) plot(fit) but plot gives me following error: error: $ operator invalid atomic vectors any ideas doing wrong? note : summary , predict , , residuals work correctly. this quite interesting observation. in fact, among 6 plots supported plot.lm , q-q plot fails in case. consider following reproducible example: x <- runif(20) y <- runif(20) fit <- lm(i(y ^ (1/3)) ~ i(x ^ (1/3))) ## `which = 2l` (qq plot) fails; `which = 1, 3, 4, 5, 6` work stats:::plot.lm(fit, = 2l) inside plot.lm , q-q plot produced follow: rs <- rstandard(fit) ## standardised residuals qqnorm(rs) ## fine ## inside `qqline(rs)` yy <- quantile(rs, c(0.25, 0.75)) xx <- qnorm(c(0.25, 0.75)) slope <- diff(yy)/diff(xx) int <- yy[1l] - slope * xx[...

javascript - Textarea does not auto resize with pre-filled value -

i have textarea resizes based on type. used solution kylemit it. html: <textarea onkeyup="textareaadjust(this)" style="overflow:hidden"></textarea> js: function textareaadjust(o) { o.style.height = "1px"; o.style.height = (25+o.scrollheight)+"px"; } this works fine when user has type on textarea textarea has pre-filled value in it. resizing not work pre-filled value. resizes when user starts typing on textarea. example of pre-filled textarea <textarea onkeyup="textareaadjust(this)" style="overflow:hidden">identify, formulate, research literature, , analyze user needs , taking them account solve complex information technology problems, reaching substantiated conclusions using fundamental principles of mathematics, computing fundamentals, technical concepts , practices in core information technologies, , relevant domain disciplines.</textarea> is there way can solve problem through cs...

php - Password reset in Laravel 5.1 -

kindly tell me how implement password reset functionality in laravel 5.1 application. using jwt give user access system. please, tell me how implement 'forgot passsword' functionality. web api consumed mobile device , user follow steps given below when user understands has forgotten password 1) in login screen user click 'forgot password' 2) in next step, user enter email address , submits. 3) server-side code compares email email registered within system. if match found link(self-destructing) reset password sent email address. 4) user checks email account find link , use reset password. right code have in user table given down below. <?php namespace app; use illuminate\foundation\auth\user authenticatable; class user extends authenticatable { /** * attributes mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', ]; /** * attributes should h...

download - Magento 2 restrict product buy to specific coupon codes -

here scenario i'm trying achieve. my website sell instrument play electronic music. comes software. i limit software download (downloadable product) people have key or coupon find in hardware box. i thinking import these coupons in magento2 (cart price rules) , limit checkout people have valid coupon (instead of applying discount). is there way that? thanks lot in advance!

jquery - Javascript error embedding redbubble -

hi trying embed redbubble code site client (his red bubble store) joomla site , there wrong script. <script type="text/javascript" src="http://www.redbubble.com/assets/external_portfolio.js"></script> <script id="rb-xzfcxvzx" type="text/javascript">new rbexternalportfolio('www.redbubble.com', 'classiceggshell', 5, 5).renderiframe();</script> the link includes returns 404 error when check on devtools in chrome tested script on jslint gave me these 8 warnings expected identifier , instead saw '<'. expected assignment or function call , instead saw expression. missing semicolon. expected assignment or function call , instead saw expression. missing semicolon. missing semicolon. unclosed regular expression. unrecoverable syntax error. (85% scanned). so there fundamentally wrong code please able fix , give me correct code connect store. have tried l...

c# - Connecting Two SQL Server Tables -

i'm trying connect following 2 tables together: create table [dbo].[groups] ( [group_id] int identity (1, 1) not null, [group_name] nvarchar (50) null, [group_desc] nvarchar (50) null, primary key clustered ([group_id] asc) ); create table [dbo].[events] ( [event_id] int identity (1, 1) not null, [event_group_id] int null, [event_type] nvarchar (50) null, [event_title] nvarchar (50) null, primary key clustered ([event_id] asc), constraint fk_event_group foreign key (event_group_id) references groups (group_id) ); first question: have created tables correctly? i've been able add events following code haven't been able connect pk of groups fk in events . does have suggestions? sqlconnection conn = new sqlconnection(configurationmanager.connectionstrings["ballinoradbconnectionstring1"].connectionstring); conn.open(); string findgroupofevent = "select group_id groups grou...

python - How to use Junos PyEZ configuration table to extract all interface units? -

i trying use pyez interfacetable extract interface configuration. problem can see 1 unit per interface while there more 1 configured on interfaces. the script from jnpr.junos import device jnpr.junos.resources.interface import interfacetable device(host=host_test, user='lab', passwd='lab123') dev: tabl = interfacetable(dev) tabl.get() print(tabl.keys()) print(tabl['ge-0/0/4'].unit_name) in case have 2 units on ge-0/0/4 interface lab@srx# show interfaces ge-0/0/4 vlan-tagging; unit 108 { vlan-id 108; family inet { address 172.20.108.1/24; } } unit 109 { vlan-id 109; family inet { address 172.20.109.1/24; } } but result giving me 1 unit (in 2nd line of output): ['ge-0/0/0', 'ge-0/0/1', 'ge-0/0/2', 'ge-0/0/3', 'ge-0/0/4', 'lo0'] 108 ideally, work units , confuguration options under each unit (such family , address). please refer ...

ruby - Sort an array of words by the last letter -

i trying sort array of words last character. def array_sort_by_last_letter_of_word(array) list = array[-1,1] list.sort { |a,b| b <=> } end puts array_sort_by_last_letter_of_word ['sky', 'puma', 'maker'] the output "maker" . def array_sort_by_last_letter_of_word(array) array.sort_by { |word| word[-1] } end rails version (using string# last ): def array_sort_by_last_letter_of_word(array) array.sort_by(&:last) end

amp html - Understanding about Google AMP page -

Image
i evaluating google amp pages. static pages, have implemented valid amp based version & linked them per documentation. please correct me if i'am wrong. end uesr sill hit original page, & request intercepted amp based version ? (note amp not "google amp" - , should not confused " google amp cache " either) the amp faq states: amp files can cached in cloud in order reduce time content takes user’s mobile device. using amp format, content producers making content in amp files available cached third parties. under type of framework, publishers continue control content, platforms can cache or mirror content optimal delivery speed users. so google amp cache 1 possible amp cache, there might others. the documentation google amp cache states: each time user accesses amp content cache, content automatically updated, , updated version served next user once content has been cached. this further elaborated upon in update amp con...

php - How to change reset password email subject in laravel? -

Image
i beginner in laravel. learning framework. curent laravel version 5.3. i scaffolding auth using php artisan make:auth working fine. configured gmail smtp in .env file , mail.php in config directgory. working. saw by-default forgot password email subject going reset password . want change that. i saw blog. found blog. have implement in site. same output coming. i followed these links - https://laracasts.com/discuss/channels/general-discussion/laravel-5-password-reset-link-subject https://laracasts.com/discuss/channels/general-discussion/reset-password-email-subject https://laracasts.com/discuss/channels/laravel/how-to-override-message-in-sendresetlinkemail-in-forgotpasswordcontroller you can change password reset email subject, need work. first, need create own implementation of resetpassword notification. create new notification class inside app\notifications directory, let's named resetpassword.php : <?php namespace app\notifications; use illum...

tsql - Is there a way to detect a cycle in Hierarchical Queries in SQL Server? -

in oracle, can use function connect_by_iscycle detect cycle in hierarchical queries. try same in sql server. there way this? thanks lot! concatenate records ids / build bitmap based on row_numbers of records , verify each new record against list/bitmap create table t (id int,pid int) insert t values (1,3),(2,1),(3,2) list identify cycles with cte (id,pid,list,is_cycle) ( select id,pid,',' + cast (id varchar(max)) + ',',0 t id = 1 union select t.id,t.pid,cte.list + cast (t.id varchar(10)) + ',' ,case when cte.list '%,' + cast (t.id varchar(10)) + ',%' 1 else 0 end cte join t on t.pid = cte.id cte.is_cycle = 0 ) select * cte is_cycle = 1 id pid list is_cycle -- --- ---- -------- 1 3 ,1,2,3,1, 1 traverse thorough graph cycles with cte (id,pid,list) ( select id,pid,',' + cast (id varchar(m...

php - Permission denied when trying to write file -

i'm getting error: warning: fopen(name.txt): failed open stream: permission denied in /applications/xampp/xamppfiles/htdocs/phptests/post.php on line 5 not write file i'm trying retrieve form data , pass text file so: <?php $name = $_post['name']; $surname = $_post['surname']; $fh = fopen("name.txt", "w") or die("could not write file"); fwrite($fh, $name, $surname); fclose($fh); ?> i'm using komodo edit , php files saved in "htdocs" folder provided xampp. can tell me why i'm not able write file? as error telling file not writable. to fix , can update file permission cd <directory of name.txt> chmod 777 name.txt

visual c++ - How to build OpenImageIO 1.4.12 with VS2015 -

i trying build dependencies project, based on vs2013, vs2015. of them building without problems, either or patch, totally @ loss openimageio 1.4.12. passing parameters cmake , msbuild set use of vs2015 everything, , indeed generated solution files indicate "vc140_xp" chosen toolset. @ link time receive error one, indicating somewhere there reference boost libraries built vs2013: link : fatal error lnk1104: cannot open file 'libboost_thread-vc120-mt-1_56.lib' [f:\...\deps\x64\oiio-release-1.4.12\build\src\libopenimageio\openimageio.vcxproj] of course have bunch of libboost_xxx-vc140-mt-1_56.lib in place, since i've built them vs2015. dependencies set in solution file correctly refer libboost_xxx-vc140-mt-1_56.lib files , correct path, , doing findstr in openimageio build tree i'm not able find reference older vs version. same command lists lot of .obj files containing references, such (put on multiple lines better readability): build\src\lib...

How to include Internet Permission in Kivy? (Android 6) -

i want use standard python module urllib2 in kivy app requires access internet. when uncomment #android.permissions = internet , package app app doesn't inform me internet permission while installing .apk , when i'm using urllib2 app crashes (probably because no internet permission) thx in advance!

how to use assignment operator with classes instead of new () Like wrapper class in java? -

how use assignment operator classes instead of new() wrapper class integer = 3; newclass c = 3; // didn't work newclass c = 3; --> didn't work i know there overloading operators in c++ this, how overload assignment operator in java ?! it's not "equal operator," it's assignment operator. no, can't that. must use new (or reflection). java doesn't have operator overloading. (the reason can integer = 3; because autoboxing of primitives built language, not because integer class overloading.)

html - How to remove blog name from post title in search engines -

i have blog in search engines every post show me blog name @ end of posts title. want remove blog name @ end of each post title because think it's bad idea seo. title code within template. <b:if cond='data:blog.pagetype == "index"'> <b:if cond='data:blog.pagetype == "item"'> <title> <data:blog.pagename/> | <data:blog.title/> </title> <b:else/> <title> <data:blog.pagetitle/> - cad drawing library engineers </title> </b:if> <b:else/> <title> <data:blog.pagename/> | <data:blog.title/> </title> </b:if> use this <b:if cond='data:blog.pagetype == "index"'> <title> <data:blog.title/> </title> <b:else/> <title> <data:blog.pagename/> </title> </b:if>

hover - Changing image when hovering text depending on dropdown options -

i trying make simple webpage shows merely 1 figure changes depending on 1) hover options , 2) dropdown menu. that is, way figure changes when hovering on hover options should depend on options chosen in dropdown menu. so far have got. <html> <head> <script> function changeimage(towhat,url){ if (document.images){ document.images.targetimage.src=towhat.src gotolink=url } } function warp(){ window.location=gotolink } </script> <script language="javascript1.1"> var myimages=new array() var gotolink="#" function preloadimages(){ (i=0;i<preloadimages.arguments.length;i++){ myimages[i]=new image() myimages[i].src=preloadimages.arguments[i] } } preloadimages("figure 1.gif","figure 2.gif","figure 3.gif") </script> </head> <center> choose options <br> <select> <option value="1"> option 1 </option> <option value="2"> optio...

.htaccess redirect to subfolder, non-www to www and https -

so i'm having website stored inside public_html/www/. other domains stored in -for example- public_html/test/. in public_html have .htaccess file lot of redirects in it, apply website inside /www/ folder. inside /www/ folder have .htaccess (i don't know why, colleague did , left me without information). since have no idea how .htaccess works, have no idea , in file. what need redirect domain.nl https://www.domain.nl (some folders should excluded, can see in code below - emailtemplates, paymentupdate, autocode, nieuwsbrieven, etc.) domain.nl stored inside public_html/www/ folder, needs redirect subfolder (which should not visible in web browser). at moment, in root .htaccess file following: # use https rewritecond %{http_host} ^(www\.)?domain\.nl [nc] rewritecond %{https} off rewritecond %{request_uri} !^/emailtemplates rewritecond %{request_uri} !^/paymentupdate_ideal rewritecond %{request_uri} !^/autocode rewritecond %{request_uri} !^/nieuwsbrieven rewritecond %{req...