Posts

Showing posts from April, 2010

.htaccess - Apache server config redirect from IP to domain name EC2 -

i running apache webserver on linux ec2 instance. the problem can access server using ip address, dns , domain name. causes problem seo , want tidy up. i have read on apache documentation can mod_rewrite , needs done in httpd.conf if have root access otherwise in .htaccess per directory override. have root access trying change httpd.conf if user types in http://52.17.12.123/ or http://ec2-52.17.12.123.eu-west-1.compute.amazonaws.com/ i want them redirected www.example.com this tried <virtualhost *:80> documentroot "/var/www/html/my-website" # other directives here rewriteengine on rewritecond %{http_host} !^52.17.12.123.com$ rewriterule /* http://www.example.com/ [r] </virtualhost> it seems partially work www.example.com not load due to many redirects. --edit-- thanks, in httpd.conf have following configuration listen 80 namevirtualhost *:80 documentroot "/var/www/html/my-website" rewriteengine on rewritecond %{http_ho

web services - How to do header authentication using NuSOAP in PHP? -

i using nusoap create soap api want authentication using headers in nusoap. don't want create authentication function that. please guide me how can using headers? i have gone through example: how authenticate soap header in nusoap server in php? . problem not able understand how header on server side.

php - Drupal: How to add exposed filter in views which have data from external db tab -

drupal - 7.36 views: 7.x-3.10 data module: 7.x-1.0-alpha7 db: mysql i use data module adopt custom table views, after views generated data module, start make configuration on views page. right hit issue, how pick data , showed in "exposed filter" users. want add "exposed filters" @ views table "select box", , inside select box, contains possible values of specific column of data in database. right now, "exposed filters" has 1 value "-any-". how can adopt other column data exposed filters? for example. in database table "test", has 2 column "id", , "name". , there 3 rows of data inside table. (1, "alice"), (2, "bob") , (3, "cindy"). after adopt table "test" view data module, edit view , add "exposed filter" "name". wish filter can "select box" , inside there 3 values "alice", "bob" , "cindy". can tha

Interactive Brokers Symbol list -

i want use ib api, cannot figure our how request complete symbol list , information. in documentation found: reqscannerparameters() - not clear how list example of nasdaq stocks ? is there better way ? as far aware ib not offer symbol list. news is easy , free elsewhere. eoddata.com source of , can download them, or automate rather easily. go here , click download link @ top right of table: eoddata symbol list not sure language using ib api have simple tutorial in c# covers reading tickers stocks , options on website: get real-time stock data interactive brokers api

javascript - error when loading a saved game -

i've create puzzle game yesterday , i've made save system, i'm getting error when loading save: here's website and here's save here's function gets launched when loading save: function loadsave(){ var savedata = $("#savetext").text(); var piecedata = savedata.split("|"); var posdata = []; var puzzleinfo = piecedata[0].split(","); creategrid(parseint(puzzleinfo[1])); createpieces(parseint(puzzleinfo[1]), puzzleinfo[0]); oldsource = imgsource; imgsource = puzzleinfo[0]; console.log(savedata); $("#puzzlecontainer img").attr("src", imgsource); for(i=1; < pieceamount+1; i++){ posdata = piecedata[i].split(";"); $(".piece:nth-child("+i+")").css({ top: posdata[0], left: posdata[1], }); } $( "#pieceamount" ).slider({ value: puzzleinfo[1], }); $("

javascript - Variable not updating properly -

this relevant code : this sends request server, takes username argument. function send_client_lookup(username) { send( auth.aocp.client_lookup, [ [ 's', username.tostring() ] ] ) } this part handles response server. handle[auth.aocp.client_lookup] = function (data, u) { console.log('client_lookup') var userid = u.i() var username = u.s() u.done() console.log({ userid : userid, username : username }) // works var idresult = userid; // can use userid assigned idresult make code easier understand. } the above 2 functions work how supposed to, nothing change/fix there. now have function receives request 1 user , sends request user, takes 2 arguments: first arg userid of user sends request , second username of user request sent server/game works userids username has converted: var commands = { invite: function(userid, username) { send_client_lookup

java - Display text only for a couple seconds -

i have made simple register , login page. after user registered or logged in, message display result. this working fine, want text displayed couple seconds. after 5 seconds text gone. int = ps.executeupdate(); if (i > 0) { out.print("successfully logged in..."); requestdispatcher rs = request.getrequestdispatcher("/loggedin.html"); rs.include(request, response); } i've searched online, can't find on how it. tips / comments welcome! to delete you've printed print backspace character \b . so fit needs: string s = "successfully logged in..."; // better use system.out.print() out.print() * system.out.print(s); thread.sleep(2000); // wait 2 seconds // print backspaces charactes printed using commonlangs stringutils.repeat("\b", s.length); // print backspaces charactes printed loop (i = 0; < s.length; i++) { system.out.print("\b"

android - How to get the path of an image stored in internal storage? -

i want path of image internal storage. if (requestcode == take_photo_code && resultcode == result_ok) { log.d("camerademo", "pic saved"); string whatsappmessage = "this number plate of vehicle in going travel "; //you can read image external drove uri uri = uri.parse("here want path of image stored in internal storage"); intent intent = new intent(); intent.setaction(intent.action_send); intent.putextra(intent.extra_text, whatsappmessage); intent.settype("text/plain"); intent.putextra(intent.extra_stream,uri); intent.settype("image/jpg"); intent.setpackage("com.whatsapp"); startactivity(intent); } how it? for internal environment.getdatadirectory() for external environment.getexternalstoragedirectory()

Is R able to compute contingency tables on big file without putting the whole file in RAM? -

let me explain question: i know functions table or xtabs compute contingency tables, expect data.frame, stored in ram. it's painful when trying on big file (say 20 gb, maximum have tackle). on other hand, sas able this, because reads file line line, , updates result in process. hence there ever 1 line in ram, more acceptable. i have done same sas ad-hoc python programs on occasion, when had more complicated stuff either didn't know how in sas or thought cumbersome. python syntax , integrated features (dictionaries, regular expressions...) compensate weaknesses (speed, mainly, when reading 20 gb, speed limitated hard drive anyway). my question, then : know if there packages in r. know it's possible read file line line, in python, computing simple statistics (contingency tables instance) on big file such basic task feel there should more or less "integrated" feature in statistical package. please tell me if question should asked on "cross valida

javascript - Saving some contenteditables localstorage - - - -

i'm trying save more 1 entry of contenteditable content localstorage chrome extension. current code saves 1 contenteditable section fine, when try add id of seperate contenteditable section either deletes saved information or doesn't @ all. i'm pretty novice in js, hope i'm making simple mistake. html looks this: <div id = "content"> <div id= "tcontent" contenteditable="true" data-ph=" make note . . . " style= "height: 300px; overflow: auto"></div> <div id = "content2"> <div id= "tcontent2" contenteditable="true" data-ph= " make note . . . " style= "height: 300px; overflow: auto"></div> </div> and javascript: window.addeventlistener('load', onload); function onload() { checkedits(); } function checkedits() { if(localstorage.useredits!=null) { document.getelementbyid("tcontent", "tcontent2"

ruby on rails - RubyOnRails - Does not keep the selected language when I refresh the page -

in development mode work fine. not in production mode on heroku. when select locale , refresh page, displays language default half time , language selected otherwise. not know do. tried clear cache rails.cache.clear command, not work. guess problem cache system. i'm new ruby on rails. have idea how fix this? to understand problem, can go website, select french language , refresh page several times. once page in french. time in english. https://releaseit.herokuapp.com/ my application_controller: before_action :set_locale def set_locale if params[:locale].in? %w(en fr) i18n.locale = params[:locale] end end the config files same here: https://github.com/starterkits/rails4-starterkit/tree/master/config sorry english (i french , use google translator) i don't know (or see) pass locale in url. far know in order use params[:locale] url should like: https://releaseit.herokuapp.com/fr/something https://releaseit.herokuapp.com/en/somethin

javascript - Collapsed Bootstrap navbar button won't work on pages that aren't located in the root folder -

i'm having issue opening collapsed menus pages aren't located in root folder. navbar part of masterpage , works fine on pages located in root folder when page located in subfolder button open collapsed menu won't respond (for instance: ./default menu appears , when collapsed button drops down menu intended, ./admin/default menu visible onced collapsed button unresponsive). being it's part of code masterpage, don't understand why occuring on pages. <%@ master language="vb" codefile="masterpage.master.vb" inherits`="masterpage" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <asp:contentplaceholder id="head" runat="server"></asp:contentplaceholder> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link href="css/boot

Silverstripe - Different tabs and fields per page -

in silverstripe 3.1 possible add different tabs , fields on page example. and different tabs , fields on services page example. about page - images tab / attachments tab services page - images tab / attachments tab / staff person tab the following code example. have added if statements around snippet work. seems work pages showing same tabs on pages. i've been doing video lessons on silverstripe website , can see can create page types need know if can achieve without having create page types. // want on page // if page=about { class page extends sitetree { private static $has_one = array ( 'photo' => 'image', 'brochure' => 'file', ); public function getcmsfields() { $fields = parent::getcmsfields(); $fields->addfieldtotab('root.images', $photo = uploadfield::create('photo')); $fields->addfieldtotab('root.attachments', $brochure = uploadfield::

Customizing emacs in .emacs file -

i want emacs start specific settings default. found need edit .emacs file in home directory , use lisp language. errors. need have: windows split vertical line (i work in c++ headers , source files) column number mode cua-mode enabled (to work normal copy, cut & paste shortcuts) that's have in .emacs file: (column-number-mode) (load "cua-mode") (cua-mode t) (split-window-right) i'ver tried coding 2 middle settings in 1 - (cua-mode) . didn't work out well. the column-number-mode works, cua not load , window split horizontally (top , bottom window). error? feedback. from comments question: if you're using emacs 24.1 or later, (column-number-mode) (load "cua-mode") (cua-mode t) (split-window-right) but if you're using earlier version, (column-number-mode) (load "cua-mode") (cua-mode t) (split-window-horizontally) by way, split-window-horizontally works in later versions of emacs (i'm using emac

python - Groupby with function remembering state -

i processing many lines, want group them based on whether 1 value x in current line within 100 of value x in previous line. for example 5, "hello" 10, "was" 60, "bla" 5000, "qwerty" "hello", "was" , "bla" should 1 group, "qwerty" another. is there way neatly solve groupby? solutions can think of feel bit hackish, taking dict default argument previous value in , updating each time function (key) in groupby called. you write simple class encapsulate temp variables, use method of class key function: class keyclass(object): def __init__(self): self.lastvalue = none self.currentkey = 1 def handleval(self, val): if self.lastvalue not none , abs(val - self.lastvalue) > 100: self.currentkey += 1 self.lastvalue = val return self.currentkey >>> [(k, list(g)) k, g in itertools.groupby(data, keyclass().handleval)] [(1, [1,

sas - How to print one observation in one single line? -

sas automatically split long observation several pages. wonder how can use options print 1 obs in 1 single line. another option using ods output, wont cut line: ods html file='filename.xls' style=minimal; proc print data=dataset(obs=1); run; ods html close;

javascript - add html when drop down changes in a razor -

i trying make view user picks golf course drop-down , holes course appear when course changes. i have following code in view. @model golf_statz.models.record @{ viewbag.title = "create"; } <h2>create</h2> <script> function dropdownchange(dd) { $('#courseholes').empty(); $('#courseholes').html(@html.editorfor(m => m.recordholes)); $('#courseholes').trigger('create'); }; </script> @using (html.beginform()) { @html.antiforgerytoken() <div class="form-horizontal"> <h4>record</h4> <hr /> @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @html.labelfor(model => model.dateplayed, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorfor(

compiler construction - haskell grammar for cup file -

i working on haskell compiler written in java using jlex , cup .i finished lexer file , working on parser.cup file should define terminals , non-terminals , grammar. have finished terminal , non-terminal part stuck in grammar part can or redirect me link can find grammar haskell in form : variable ::= nonterminal:name terminal:name {:result = /* code execute when rule matched , result printed out */ ;:} | blablabla ; any appreciated .

javascript - Live realtime graph with Highstock, PHP and Mysql -

i working on web app , have no idea on how this, using highstock static charts, retrieve temperatures mysql database, , using php class myself designed send data through use of json javascript. know trying it's possible, there's jsfiddle example ( http://jsfiddle.net/ovhb3jp1/ ) in highcharts webpage graphs random js generated data. my guess have make js script retrieves temperatures php script , sends highstock script graphs, correct? how write such script? know lot of php , mysql, knowledge of js pretty vague, apreciated. this existing js script <script> $(function () { $('#container').highcharts('stockchart', <?php echo $chart; ?>); }); </script> this part of class generates json $chart variable function __tostring(){ $this->datos(); return json_encode($this->hs); } the hs attribute of class array loaded parameters of highstock api, through above php code converted json , put above js script. thanks!

jquery - Triggering JavaScript events in Qunit tests -

i trying test when user clicks in form existing error message go away. reason last test failing , i'm not sure why. i'm new jquery , qunit. test.html <!doctype html> <html> <head> <meta charset="utf-8"> <title>javascript tests</title> <link rel="stylesheet" href="qunit.css"> </head> <body> <div id="qunit"></div> <div id="qunit-fixture"> <form> <input name="text" /> <div class="has-error">error text</div> </form> </div> <script src="http://code.jquery.com/jquery.min.js"></script> <script src="qunit.js"></script> <script src="../list.js"></script> <script type="text/javascript"> test("errors should hidden on key press", function() { $('input[name="text&

java - What is wrong with my method isReverse -

write recursive method called isreverse("word1", "word2") accepts 2 strings parameters , returns true if 2 strings contain same sequence of characters each other in opposite order, ignoring case, , returning false otherwise. example, call of: isreverse("desserts", "stressed") would return true. [so eat desserts when stressed?] null, empty , 1 letter strings return true (if both parameters same value). homework , having trouble making code work appropriately. returns true no matter do. public static boolean isreverse(string word1, string word2) { if(word1 == null || word2 == null) { if(word1!= null && word2 != null) { return false; } return false; } else if(word1.length() == word2.length()) { string firstword = word1.substring(0, word1.length()); string secondword = word2.substring(word2.length()-1); if (firstword.equalsignorecase(secondwor

c# - error in objConnect.Sql = Properties.Settings.Default.SQL; -

Image
i have project graduate need work database. i wrote code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace _11111 { public partial class form1 : form { databaseconnection objconnect; string constring; dataset ds; datarow drow; int maxrows; int inc = 0; public form1() { initializecomponent(); } private void form1_load(object sender, eventargs e) { try { objconnect = new databaseconnection(); constring = properties.settings.default.employeesconnectionstring; objconnect.connection_string = constring; objconnect.sql = properties.settings.default.sql; ds = objconnect.getconnection;

php - Check another columns on login with default auth on Laravel 5 -

this first attempt @ using php framework, decided go laravel 5. but have problem: want check user status @ login, enabled == 1 users login. checked authenticatesandregistersusers.php , , followed functions on guard.php , not understand check actual columns, , should place check column is_enabled . some people won't agree me, i'd make own auth controller. default 1 obscure. if want can remove comes laravel php artisan fresh , remove auth controller , bunch of other things. it quite simple make own, login method this: public function login(request $request) { $credentials = $request->only('email', 'password'); $remember = $request->get('remember') == 'on' ? true : false; if(\auth::attempt($credentials, $remember)) { $enabled = \auth::user()->enabled; if(!$enabled) { \auth::logout(); return redirect()->withmessage('user not enabled login'); } }

dart - Retrieving the selected item in a paper-element dropdown -

i have following code following examples @ https://github.com/dart-lang/polymer-core-and-paper-examples/blob/master/web/paper_dropdown.html , https://github.com/dart-lang/polymer-core-and-paper-examples/blob/master/web/paper_dropdown.dart edited .html <paper-dropdown-menu label='click select..' on-core-select='{{oncoreselectcountryhandler}}'> <paper-dropdown class='dropdown'> <core-menu id='country' class='menu'> <template repeat='{{country in countries}}'> <paper-item>{{country.name}}</paper-item> </template> </core-menu> </paper-dropdown> </paper-dropdown-menu> .dart final list<country> countries = [ const country('afghanistan', 'af'), const country('Ã…land islands', 'ax')]; class country { final string name; final string code; const country(this.name, this.code); } void oncore

android - ListView Item not loading images from url -

i have custom baseadapter loading images custom listview of sorts urls using async tasks images not showing. here adapter: private class horizontaladapter extends baseadapter{ public horizontaladapter() { super(); final checkpoint current = localcheckpoints[checkpointposition]; urls[0] = current.getgallery()[0].geturl(); urls[1] = current.getyoutube(); urls[2] = current.getsoundcloud(); } @override public int getcount() { return 3; } @override public object getitem(int position) { return urls[position]; } @override public long getitemid(int position) { return position; } @override public view getview(int position, view convertview, viewgroup parent) { string urltoload = urls[position]; if(convertview == null){ convertview = layoutinflate

python - Adding New Field In order line Odoo 8 -

there problem in odoo 8 while trying add new field in sale order line, form doesn't save, don't if anything's wrong code. attaching code here: the sale_view.xml: <?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record id="view_order_line_tree_inherited" model="ir.ui.view"> <field name="name">sale.order.line.tree.inherited</field> <field name="model">sale.order.line</field> <field name="inherit_id" ref="sale.view_order_line_tree"/> <field name="arch" type="xml"> <xpath expr="//field[@name='name']" position="after"> <field name='no_end_product'/> <field name='length'/> <field name='width'/> </xpath> &l

c# - How do i run a mysql app without mysql connector installed? -

i made c# application on visual studio, , application connects mysql server, works nice on computer since installed full developer version of it. but doesn't run on other machines unless install mysql connector, if don't, stop working , not launch. is there anyway run without having mysql connector installed? or add mysql connector installation app? you need bundle mysql connector/net program. connector/net available msi file visual studio installer project in same solution program's project can include alongside program's installer dependency. the connector licensed under gpl, make sure understand obligations if choose distribute in manner.

android - When set the background with a selector,it cause resouce not found -

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <relativelayout android:id="@+id/rellay_action_bar_bg" android:layout_width="match_parent" android:layout_height="@dimen/action_bar_height" android:background="@color/blue" > <button android:id="@+id/btn_action_bar_left" android:layout_width="20dp" android:layout_height="30dp" android:layout_alignparentleft="true" android:layout_centervertical="true" android:layout_marginleft="5dp" android:background="@drawable/selector_btn_back" android:contentdescription="@string/a

c - strlen sometimes equal to sizeof for null-terminated strings -

i know strlen counts number of characters until (and excluding) null character '\0' (or 0 ) , sizeof gives amount of space needed store string including null character, confused output of code. question: i expect result of strlen consistently 1 less result of sizeof because strings null-terminated, seems case string of length 4 , 8, excluding '\0' (i.e. 3rd , 5th results below). suspect same reason rubbish being printed @ end of string 1st, 2nd, , 3rd results. explain behavior? i read related question, don't think that's what's happening here: strlen - length of string increased 1 . what code does: in main , creates array of integers 0, 2, 4, 6, , 8. , each of lengths, calls on function make_and_print_msgs to: create string of length + 1 (for null character), e.g. length of 4, string "aaaa\0" created print message letter-by-letter using %c in printf print string using %s in printf finds strlen of string finds sizeof

spring mvc - My sql IN function not working in jasper ireport -

i passing po no parameter ('aerotech/ata/05/12','acspl/po-0333/2013-14','acspl/po-0333/2013-14') in jasper sql query .single value working fine multiple value not working . please help......... parameter name="po_no" class="java.lang.string" select cus.project_customername,cus.project_customer_billaddress, cus.line2_billaddress,cus.line3_billaddress,cus.project_customer_phoneno, cus.project_customer_fax,cus.project_customer_email,cus.city,cus.project_customerstate1, cus.project_customer_country,cus.project_customer_postcode cus_comercial_invoice inn, cus_comercial_invoice_reference inr, customer_purchase_order po, customer_quatotion cq,enquiry_master_item ey, cutomer_mater cus po.purchase_id in ($p{po_no}) , po.quotation_no=cq.quotation_no , cq.enqueryid=ey.enquiry_id , ey.customer_id=cus.projet_customer_id , inn.cus_invoice_idno=inr.invoice_idno , inr.quantity!=0 , inn.cus_invoice_idno=$p{quatation_cus_id} the syntax need i

java - Call a class from a Service, or call a Service from a Class? -

a lot of questions going pop here make in order. 3 guys here managed set service on android application, works charm. so calling service: startservice(new intent(getbasecontext(),myservice.class)); this service starting activity : public int onstartcommand(intent intent,int flage,int startid){ // toast.maketext(this, "yes please", toast.length_long).show(); intent mintent=new intent(myservice.this,trackingactivity.class); mintent.setflags(intent.flag_activity_new_task); startactivity(mintent); return start_sticky; } and when algorithm calculating activity finished set service again: (at end of trackingactivity.class (.java )) startservice(new intent(getbasecontext(),myservice.class)); when hit button after couple of algorithm activations (each time enter 3 float numbers usb algorithm activated) , see previous services each trackingactivity.class opened. (hope explained right). question #1: ok? mean, there better way setting algorit

objective c - Xcode 6 Don't Apply Vibrant Effect to Child View -

good evening, everyone! is possible apply "vibrant" visual effect parent view, without child view inheriting it? my main window has vibrant effect applied entire view, when using popover segue display new view, view transparent. there way prevent this? thanks! you can set popover view's window appearance in controller's viewwillappear() : swift override func viewwillappear() { self.view.window?.appearance = nsappearance(named: nsappearancenamevibrantdark) } obj-c - (void)viewwillappear { self.view.window.appearance = [nsappearance appearancenamed:nsappearancenamevibrantdark]; }

xaml - wpf customControl binding itemscontrol DataTemplate button -

i new wpf stuck binding on customcontrol click button. i have textbox has watermark , selcteditems properties. control if selecteditems != null display them in control this: link picture [ http://s29.postimg.org/p25qgqzwn/image.jpg][1] now need wire x buttons delete item selecteditems source. trying in onapplytemplate method dont know how button in itemscontrol attach mouse click event. my xaml <style targettype="{x:type local:textboxpicker}"> <setter property="background" value="{dynamicresource {x:static systemcolors.windowbrushkey}}"/> <setter property="borderbrush" value="{staticresource textbox.static.border}"/> <setter property="foreground" value="{dynamicresource {x:static systemcolors.controltextbrushkey}}"/> <setter property="borderthickness" value="1"/> <setter property="keyboardnavigation.tabnavigation" value=&

c# - Updating database gives "The multi-part identifier could not be bound." Error -

i'm trying update bookingid in counselordb table. it's null . cid string contains predefined counselorid. the error i'm getting multi-part identifier "x" not bound; x being cid. thank you. using (sqlconnection connection = new sqlconnection(connectionstring)) { string sql = string.format("update counselordb set bookingid = @bookingid counselorid = " + cid); sqlcommand cmd = new sqlcommand(sql, connection); cmd.commandtype = commandtype.text; cmd.connection = connection; cmd.parameters.addwithvalue("@bookingid", getbookingid()); connection.open(); cmd.executenonquery(); } you try this: using (sqlconnection connection = new sqlconnection(connectionstring)) { string sql = "update counselordb "+ "set bookingid = @bookingid "+ "where counselorid = @counselorid"; sqlcommand cmd = new sqlcommand

java - How to install and use openEHR libraries with maven -

i need use these libraries https://github.com/openehr/java-libs netbeans , installation guide tells do: requirements: java 1.6 or higher maven 3.0.4 or higher instalation instructions: installation: java-libs/mvn clean install i meet java requirements , netbeans has bundled maven 3.0.5, can't find way install , use libraries in java project, me? these instructions installing java-libs artifact local maven artifacts repository, can referenced project. installing actually, you'll first need clone java-libs repo machine. then run mvn clean install inside new directory created cloned repo. using after install artifact, can use in project adding dependency project's pom.xml file: <dependency> <groupid>openehr</groupid> <artifactid>ref_impl_java</artifactid> <version>1.0.11-snapshot</version> <dependency> how know parameters above? looking @ java-libs' pom.xml file . edit: @jack

php - How can I kill a process as user www-data -

i start python file via webpage user www-data. how can kill process @ later time running different python script? my php webpage contains code start process: echo shell_exec("sudo python /home/pi/desktop/picontrol/motion_sensor.py"); method 1 (this answers question on title): let www-data admin in server. adduser www-data sudo then remove sudo password while executing commands reference: execute sudo without password? sudo visudo in bottom of file, type follow: www-data all=(all) nopasswd: note: there high security risk, hackers may shutdown server, can imagine server! @ own risk method 2: write service(with other php or python) , run root/admin user, once it's called, kill python on server. method 3: a stupid method: let python create empty file on start up, set file permission 777 user can delete it. check if file exist every 5 seconds, if not exist, exit itself. finally, if want stop python, let php delete file. method 4:

Why do I get this Method not found error anytime I click on a Sitecore template? -

Image
we're using sitecore 7.5 our sites. in content editor, time click on template, following error: method not found: 'boolean sitecore.data.templates.templatefield.get_ignoredictionarytranslations()'. i have no idea why receive this. happens in both web , master databases. i think bug in version of sitecore.kernel.dll using. using version 7.5.4932.0. once replaced version 7.5.5064.0 error went away.

java - Hibernate. Keep reference to last child -

i have simple parent-child relationship @onetomany , @manytoone annotations. @entity public class parent { @onetomany(cascade = cascadetype.all, mappedby = "parent", fetch = fetchtype.lazy) private list<child> children = new arraylist<>(); } public class child { @manytoone( fetch = fetchtype.lazy, optional = false) @joincolumn( name = "parent_id" ) @foreignkey( name = "fk_child_parent" ) private parent parent; } but want keep reference current(last) child inside parent entity. how in right way? should introduce new undirectional @onetoone relationship in parent ? this: @onetoone( optional = true, cascade = cascadetype.all, fetch = fetchtype.eager) @joincolumn( name = "current_child_id", nullable = false ) @foreignkey( name = "fk_parent_child" ) private child currentchild; so gonna have issue of determining insertion order of child elements existing

ruby - Updating jekyll using gem -

i wanted try out jekyll on windows. unfortunately machine trying did not gave me installation rights. decided go portable jekyll . put repo in d:\program files\jekyll folder. updated path in system environment variables. however jekyll setup has older gems sass, jekyll. updated sass. worked fine. when tried updating jekyll below command gem update jekyll it gave me following errors: updating jekyll-mentions fetching: jekyll-mentions-0.2.1.gem (100%) installed jekyll-mentions-0.2.1 temporarily enhancing path include devkit... building native extensions. take while... error: error installing jekyll-mentions: error: failed build gem native extension. "d:/program files/jekyll/ruby/bin/ruby.exe" extconf.rb d:/program files/jekyll/ruby/bin/ruby.exe: invalid switch in rubyopt: -f (runtimeerror) gem files remain installed in d:/program files/jekyll/ruby/lib/ruby/gems/2. 0.0/gems/yajl-ruby-1.2.1 inspection. results logged d:/program files/jekyll/

html - Why is Safari not listening to CSS? -

does safari have issues media queries , positioning? website looks fine in chrome , firefox, looks ok in ie. in safari, there weird margins , forms fall apart. ideas on how fix it? sorry it's not specific don't know what's causing issue. when change browser size, things start move right place. appears fall apart when it's above 718px in contact , portfolio section. my website tiffanymackins.com. use vendor prefixed display flex , inline-flex, see this: https://css-tricks.com/using-flexbox/

Trying to get html source code (dynamically changing) from URL (does not change) in android? -

so may seem simple question, haven't had luck searching because it's kind of specific. i have website, use webview , called wv, load via wv.load(url) on website, there php forms, generate html tables when user interacts (by clicking submit). since html table generated, source code html table generated, url stays same. newly generated source code has html table in 1 want grab. please see code below: private final string url = "http://google.com"; private webview wv; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); wv = (webview) findviewbyid(r.id.wvpage); wv.getsettings().setjavascriptenabled(true); wv.loadurl(url); wv.setwebviewclient(new webviewclient() { @override public void onpagefinished(webview view, string url) { //view.loadurl(url); new asyncclass().execute(url); log