Sunday, 15 January 2012

php - Give Server Write Access To Folders -



php - Give Server Write Access To Folders -

i'm hosting lamp ec2 instance via amazon aws.

part of website allows users upload files. unfortunately, server not able store permanent copies in "uploads" folder because lacking necessary permissions.

a php script called store file "uploads" folder. upload fail while upload folder has standard 755 , 775 permissions. however, when alter folder permissions 777 (world permissions), works.

for obvious reasons, don't want utilize 777 world permissions. how can create server has permission write files "uploads" folder?

thanks guys.

this might issue ownership of upload folder. ownership of folder can checked next command ls -l sample output: -rw-r--r-- 1 root root 0 aug 31 05:48 demo.txt . here can seen both user of file root , grouping of file root. executing command within directory show permissions , ownership of files , folders in folder. lamp stack need create sure ownership apache user i.e. www-data , apache grouping 1 time again www-data. can done going in root folder of application , and executing command

chown -r www-data:www-data sample output: -rw-r--r-- 1 www-data www-data 0 aug 31 05:48 demo.txt

this recursively alter ownership of files , folders within root directory apache user , group. mutual cause of issue when have downloaded bundle or files , have done local or root user , apache not having permissions it. or have created directory manually. basic thought solve issue, might want consider execute command , alter ownership of "uploads" directory .

php amazon-web-services amazon-ec2 file-permissions folder-permissions

javascript - How can i get the drop point indormation? [drag and drop] -



javascript - How can i get the drop point indormation? [drag and drop] -

now im trying implement drag , drop on html5. i'd know how can grab info drop content. example...

<div id="droppoint"></div><ul> <li draggable="true">1</li> <li draggable="true">2</li> <li draggable="true">3</li> <li draggable="true">4</li> <li draggable="true">5</li> </ul>

when drag li element droppoint , drop this, want grab id attribute(droppoint).

erea.addeventlistener("drop", function(evt) { var droptext = evt.datatransfer.getdata("text"); console.log('============================'); console.log(droptext); console.log('============================'); evt.preventdefault(); }, false);

function drag_over(event) { console.log(event.clientx); console.log(event.clienty); event.preventdefault(); homecoming false; } function drop(event) { console.log(event.clientx); console.log(event.clienty); event.preventdefault(); homecoming false; }

http://jsfiddle.net/robertc/kkuqh/30/

clientx , clienty current client's coordinates (his pointer), if client's coordinates while drops, know dropped item.

found here: html5: dragover(), drop(): how current x,y coordinates?

have day =)

javascript html html5 drag-and-drop draggable

ios - Pass from UIUserNotificationTypeNone to UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound -



ios - Pass from UIUserNotificationTypeNone to UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound -

do know way pass uiusernotificationtypenone uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound (ios8)?

to pass uiusernotificationtypenone works not when user seek switch 1 time again enable ...

this code:

// register force notifications, if running ios 8 if ([application respondstoselector:@selector(registerusernotificationsettings:)]) { uiusernotificationtype usernotificationtypes = (uiusernotificationtypealert | uiusernotificationtypebadge | uiusernotificationtypesound); uiusernotificationsettings * settingsavailable = [uiusernotificationsettings settingsfortypes:usernotificationtypes categories:nil]; [application registerusernotificationsettings:settingsavailable]; [application registerforremotenotifications]; } else { // register force notifications before ios 8 [application registerforremotenotificationtypes:(uiremotenotificationtypebadge | uiremotenotificationtypealert | uiremotenotificationtypesound)]; }

after switch enable method of delegate "didregisterusernotificationsettings"

// register receive notifications [application registerforremotenotifications]; nslog(@"the app registered types: %@", notificationsettings);

returns:

the app registered types: <uiusernotificationsettings: 0x15e9e790; types: (none);>

thanks in advance

that's because notification setting has been turned off in scheme setting.

ios objective-c xcode

php - Find content in specific DIV with Behat/Selenium -



php - Find content in specific DIV with Behat/Selenium -

i creating behat/selenium automated test script. want create statement says:

given on "/" should see <content> in <specific div>

i want create function in featurecontext.php file allow me verify content (text) exists within specified div tag. can please point me in right direction?

if want pointed in right direction, should avoid doing things such – contradict behat ideology. scenario describes actions user performs , assertions makes verify result user looks @ page, not developer looks code. logic of lastly must done behind scenes. in other words, step should read more this:

given on homepage page title should read "hello world" , user list should contain "john doe" , dialogue title should "foo bar"

if want reply initial question, can such:

/** * @then /^(?:|i )should see "(?p<text>.+)" in "(?p<selector>\w+)" element$/ */ public function assertelementtext($text, $selector) { $page = $this->getsession()->getpage(); $element = $page->findall('css', $selector); foreach($this->getsession()->getpage()->findall() $element) { if (strpos(strtolower($text), strtolower($element->gettext()) !== false) { return; } } throw exception("text '{$text}' not found in '{$selector}' element."); }

and utilize this:

then should see "hello world" in "div#title" element should see "john doe" in "ul#users > li" element

php html xpath behat mink

google app engine - gae cloud sql active connections not closing (keeping the instance running) -



google app engine - gae cloud sql active connections not closing (keeping the instance running) -

i stopped instance running in app still cloud sql have 1 active connection, have no thought why.. keeping cloud sql instance running.. , i'm getting charged hours used.. please help

there few places flag set maintain cloud sql instance alive.

go dev console project -> cloud sql -> sql instance -> edit -> "show advanced options..." -> activation policy create sure set "on demand".

if still seeing then:

go here , fill out information. under fields select 'settings' click execute , scroll down. 'activationpolicy' , see whats set to. can utilize api browser alter setting or gcloud

google-app-engine google-cloud-sql

Loading JSON into Hbase and modelling the database -



Loading JSON into Hbase and modelling the database -

i have more 600gb of data. want load info hbase , build restful service serving data.

the info have of next format

file1:

{key1:value1, key2:value2 .......} {key1:value3, key2:value4 .......} ................................. (arbitary number of entries) .................................

file2:

{key1:value5, key2:value6 .......} {key1:value7, key2:value8 .......} ................................. (arbitary number of entries) .................................

..............................................................................

(large number of files this)

..............................................................................

one of keys id key , 1 more timestamp key. in restful service, request should take in id , timestamp , homecoming entries(in of 600gb info set).

i confused couple of things

i have worked postgres , mysql (rdbms databases), have worked couchdb(not proficient). confused how should model hbase database considering requirements.

what procedure load hbase given in format mentioned above.

json hbase

Change colors for accumulation curve in R? -



Change colors for accumulation curve in R? -

i using biodiversityr bundle generate species accumulation curves pooled individuals per plot in habitat type. have 3 different habitat types , each habitat type has 3 different sites (as rows). species presented columns. want each site of specific habitat represented in same color, different habitat types in different colors. now, rainbow. how alter color scheme?

here how did it.

library(biodiversityr) com.honey <- sub.honey[, 5:ncol(sub.honey)] env.frame.honey <- data.frame(env.honey) env.frame.honey$site.totals <- apply(com.honey,1,sum) accum.honey1 <- accumcomp(com.honey, y=env.frame.honey, factor="env.honey",scale="site.totals",ci=1,ci.type ="line", ci.lty= 3, conditioned=false, method="exact", ylab= "",xlab="", col=1,legend= f)

i added test dataset here. help highly appreciated.

i looking other possibilities accumulation curve biodiversityr bundle doesn't work new mac update.

https://www.dropbox.com/s/6stfg3ouqa399d5/test%20data.csv?dl=0

r