Posts

Showing posts from July, 2014

email - PHP contact form mail bad codification -

i have contact form , i'm having little bit of trouble codificatio. dont know why special characters (it's spanish) show badly in email received. i'm begginner in dont know problem. web declared in utf-8 , here code <?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'from: web.com'; $to = 'email@email.com'; $subject = 'formulario contacto web'; $body = "nombre: $name<br> e-mail: $email<br> mensaje:<br> $message"; $headers = "mime-version: 1.0" . php_eol; $headers .= "content-type: text/html; charset=utf-8" . php_eol; $headers .= "from: " . $from . "\n"; if ($_post['submit']) { if (mail($to, $subject, $body, $headers)) { echo '<script type="text/javascript">alert("su mensaje ha sido enviado");</script>'; } else { echo '<script type="tex...

ffmpeg - H264 decoder in opencv for real time video transmission -

i writing client-server application real time video transmission android based phone server. captured video phone camera encoded using android provided h264 encoder , transmitted via udp socket. frames not rtp encapsulated. need reduce overhead , hence delay. on receiver, need decode incoming encoded frame. data being sent on udp socket not contains encoded frame other information related frame part of header. each frame encoded nal unit. i able retrieve frames received packet byte array. can save byte array raw h264 file , playback using vlc , works fine. however, need processing on frame , hence need use opencv. can me decoding raw h264 byte array in opencv? can ffmpeg used this?

Is function parameter validation using errors a good pattern in Go? -

is parameter validation using error return codes considered practice ? mean should use errors vs panics (are there guidelines?). for instance: is checking non-nil + returning error if nil practice ? or checking correct integer ranges etc. i imagine using errors make go feel c-ish , pretty bad. panics alternative in situations ? or should gopher use python/ruby/js-approach "just let fail" ? i'm bit confused because panics real "errors" in understanding. using errors time bad . and if return error code: if passes wrong parameter function ignores errors codes ? -> nothing! panics nice situations in language error codes used on panics not clear. "escaping" panic s 1 in go (i mean, might produced functions comprising public api of package) deal errors programmers do. so, if function gets pointer object, , can't nil (say, indicate value missing) go on , dereference pointer make runtime panic if happens nil . if functio...

javascript - remove/delete data using jquery modal form using codeigniter framework -

hi have add button add multiples data on it. im using jquery modal form add multiple data's. problem how able delete data added jquery modal form? im adding class='remove' using javascipt on it. delete data passed not totally removed. here's code below <script type="text/javascript"> $(document).ready(function(){ // here code when delete click $('tbody').on('click', '.remove', function(e) { e.preventdefault(); $("#added-events").val( $("#added-events").val() + id.val() + '*' + event.val() + '*' + description.val() + '|'); $(this).parent().remove(); $("#date").remove(); $("#event").remove(); $("#description").remove(); $("#added-events").removedata(); }); $("#dialog-form").dialog({ autoopen: false, height: 300, widt...

c++ - Initialize vectors in classes -

is possible initialize vector in sruct or class. here example how want make work class menuitem { std::string name; // name of menu item void (*func)(); // function of menu item menupage* subpage; // pointer submenu }; class menupage { std::string menutitle; std::vector<menuitem> menuitems; }; static const menupage menumain = { "main menu", {{ "item1", 0, 0 }, { "item2", 0, 0 }, { "item3", 0, 0 }} }; this structure should represent dynamic console menu in windows. use singleton pattern access menu. membervar of type menupage* saved menu entry point in object. so if isn't possible, alternative methods advise? make members public , initialized in c++11. otherwise can use initializer list , constructor: class menupage { std::string menutitle; std::vector<menuitem> menuitems; public: menupage (std::string s, std::vector<menuitem> m...

Android Fragment Back Button overlays other fragment and keeps active -

in app have 3 fragments. app starts [1], user can navigate [2] , optionally [3]. since [3] deep down, want [3] go [1] directly. currently call [2] using addtobackstack(null). since not call addtobackstack on [3] assumed go [1]. what happens is, [3] returns [1], both fragments displayed overlapping. fragment [3] not call onpause(). calling fragment [2] again display [2] on top of others, not clearing screen. navigating , forth crash app. on opening new fragment, when hitting button. "fragment added" error (which extremely odd button, check before switching fragments). any ideas might cause odd behavior? using addtobackstack or [3] eliminates problem, not solve requirement. call super methods appropriate. info: code sample download @ http://beadsoft.de/android/fragmenttest.zip same behavior on 2.x, 4.2.2. using actionbarcompat. code adding fragment: fragmentmanager fm = getactivity().getsupportfragmentmanager(); fragment fragment = fm.findfragmen...

button - Create arrow sign pointing 45 degrees in android -

i create black arrow button facing 45 degrees. have no idea how go this. i want arrow 1 found on screen. https://cloud.google.com/developers/images/articles/developing-mobile-games-on-gcp/sample-q.png can specify whats purpose? if have image of arrow want. can create button, , place background image see: see link or if want create own arrow, can create custom-view, extending view class, , draw in ondraw() method, using canvas operations in opinion, if somthing basic, take first option

javascript - Disable underline for lowercase characters: g q p j y? -

Image
sometimes don't want underline blindly cutting through underlined page title! is there way automatically elegantly disable underline lowercasee characters? in these cases it's nicer not underline these lowercase letters {g,q,p,j, y} css: h1{ text-decoration: underline; } page title: george quietely jumped! a ) there any way 1 achieve such delicate , advanced styling rule? b ) other latin characters want un-underline? c ) how set thickness/thinness of underline? you can fake underline border-bottom. can work single lines , if display properties allows element shrink on content. (just avoid block ). here example display:table allow center text , break line before , after : http://codepen.io/gc-nomade/pen/vjokb/ what's idea ? setting smaller line-height font-size, cause text overflow container. draw bottom border underline text svg offers stroke , in css , can similar increasing text-shadow same color background. demo , you ...

javascript - Why won't this slideshow work -

Image
okay, i'm trying create slide show using example below. problem animation not work. design wise looks images not rotate in browser. because have use window.settimeout() thanks! http://tutorialzine.com/2010/09/html5-canvas-slideshow-jquery/ also seems having similar problem not quite same code mine: why won't slideshow code work? heres html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>an html5 slideshow w/ canvas & jquery | tutorialzine demo</title> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <div id="slideshow"> <ul class="slides"> <li><img src="img/photos/1.jpg" width="620" height="320" alt="marsa alam" /></li> ...

c - How to copy a sentence into a char array -

i trying copy sentence char array. have tried using scanf("%[^\n]) , scanf("%[^\n]\n within if statement doesn't work. can please me figure out? using c language. works first code not second. file #1 #include <stdio.h> int main () { char c[10]; printf ("enter text.\n"); scanf("%[^\n]", c); printf ("text:%s", c); return 0; } file #2 #include <stdio.h> #include <string.h> int main(void) { char command[10]; char c[10]; printf("cmd> "); scanf( "%s", command); if (strcmp(command, "new")==0) { printf ("enter text:\n"); scanf("%[^\n]", c); printf ("text:%s\n", c); } return 0; } put space before %[^\n] so: #include <stdio.h> #include <string.h> int main(void) { char command[10]; char c[10]; printf("cmd> "); scanf( "%s", command); if (strcmp(...

how to retrieve url from a html format in R? -

in website " http://www.amazon.com/logitech-910-002974-wireless-mouse-scrolling/dp/b007t1ctde/ref=sr_1_4?ie=utf8&qid=1396676617&sr=8-4&keywords=logitech+mouse " i want retrieve link "/product-reviews/b002hwrjbc/ref=sp_detail_page_cr_lnk" in <a class="a-size-base" href="/product-reviews/b002hwrjbc/ref=sp_detail_page_cr_lnk">520</a> can me xpath? thank you! are trying scrape amazon reviews? wrote package this in response another stackoverflow question .

html - I have forced my IP address to go to a different page with htaccess -

i have made code in htaccess below: # make different page specified ip-adres rewriteengine on #deny specified ip-adres or redirect page (=something iframe) #rewritecond %{remote_addr} !^1\.2\.3\.4$ #rewriterule index\.html$ index2\.html [l] let's ip address 1.2.3.4. how can delete code , go normal index.html instead of being redirect index2.html ?

linux - Using grep to find lines that each contain ALL search strings -

i have file contains lot of lines similar this: {"id": 2796, "some_model": "profile", "message_type": "model_save", "fields": {"account": 14, "address": null, "modification_timestamp": "2014-03-19t10:46:33.543z", "was_deleted": false}} but want find lines contain pieces of respective lines want only. example applied in example line above be: ~$ grep '2796' file.log | grep 'profile' | grep 'another_more' | grep 'so_on' i tried doing same way above, edited : did work, not quite enough bring necessary data. mean, there missing data in results of search. :( following idea of grep 'word' filename works, 1 word in mountain of data not enough. so, how pass multiple 'word' match want? want search ' id ', '*some_model*' , ' account ' using grep @ same time. how do search match possible lines argumen...

node.js - Simple webservice with node-soap -

i trying implement simple web service using soap using node js , node-soap, client side seems have problems using server. assert.js:92 throw new assert.assertionerror({ ^ assertionerror: invalid message definition document style binding my wsdl file is: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions name="wscalc1" targetnamespace="http://localhost:8000/wscalc1" xmlns="http://localhost:8000/wscalc1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <wsdl:message name="sumarrequest"> <wsdl:part name="a" type="xs:string"></wsdl:part> <wsdl:part name=...

How to load Images from a package in java -

i use load same package image image; string img = "image.png"; imageicon = new imageicon(this.getclass().getresource(img)); image = i.getimage(); how can load image package specified images? image image; string img = "image.png"; imageicon = new imageicon(this.getclass().getresource(img)); image = i.getimage(); suggests "image.png" resides within same package class represented this you can paths reference resources reside within different packages string img = "/path/to/images/image.png"; imageicon = new imageicon(this.getclass().getresource(img)); the important concept here understand path suffixed class path personally, should using imageio on imageicon , apart supporting more formats, throws ioexception when goes wrong , guaranteed return loaded image (when successful). see how read images more details

c# - Unknown server tag cc1: ToolkitScriptManager -

i using ajaxcontrols , in controls working had not found of control named toolkitscriptmanager had copied tag in .html page. what shall do? version of framework in hosting server 2. my web.config file is: <pages> <controls> <add tagprefix="asp" namespace="system.web.ui" assembly="system.web.extensions, version=1.0.61025.0, culture=neutral, publickeytoken=31bf3856ad364e35"/> <add tagprefix="ajaxtoolkit" assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit"/> </controls> </pages> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="system.web.extensions" publickeytoken="31bf3856ad364e35" tagprefix="cc1"/> <bindingredirect oldversion="3.5.0.0" newversion="1.0.61025.0"/> </dependen...

java - Is it possible to disable injection of implicit constructor methods/calls? -

the java compiler generates constructors , injects super constructor calls in many circumstances. for example, class foo { foo() {} } becomes class foo { foo() { super(); } } i not keen on different circumstances , make code explicit. how disable java compiler doing if possible? you cannot disable java compiler making calls super - 1 of core principles how object orientation designed in java. you might able tell ide display these calls (or not). however i recommend stick standard - every java developer knows , might bit odd , unfamiliar become reasonable after short time... :)

AppFabric Server Caching Service Configuration Store Error -

Image
i have installed appfabric in windows 8.1 pro machine , i'm facing problems while configuring it. i getting below error when clicked on "configure" button inside "caching service" section of "appfabric server configuration wizard". i have googled error text, not find useful information. can please tell missing! see article - walkthrough: deploying windows server appfabric in workgroup environment : this section describes how install , configure windows server appfabric on multiple computers in workgroup environment. in scenario, configure appfabric hosting services feature use sql server data stores, , configure appfabric caching services feature use xml file in shared file store configuration information. in workgroup environment, sql server database not supported configuration data caching services feature, must use shared file store. you attempting use sql server database caching services feature in workgro...

mysql - "Failed to build gem native extension" error when installing mysql2 on mac -

this question has answer here: ruby gem install json fails on mavericks , xcode 5.1 - unknown argument: '-multiply_definedsuppress' 10 answers i installing mysql2 in terminal on mac there error message. know how solve problem? lot! my osx version 10.9 , have installed xcode , command line tool. joe@~ $sudo gem install mysql2 password: building native extensions. take while... error: error installing mysql2: error: failed build gem native extension. /system/library/frameworks/ruby.framework/versions/2.0/usr/bin/ruby extconf.rb checking ruby/thread.h... yes checking rb_thread_call_without_gvl() in ruby/thread.h... yes checking rb_thread_blocking_region()... yes checking rb_wait_for_single_fd()... yes checking rb_hash_dup()... yes checking rb_intern3()... yes ----- using mysql_config @ /usr/local/bin/mysql_config ----- checking mysql.h... yes checking er...

javascript - How do you keep multiple collapses open in Bootstrap 3? -

bootstrap closes other collapses when click on 1 open it. is there option or hack make keep collapses open unless explicitly closed without changing , layout of panel-group? you can remove data-parent attribute normally used in accordion markup . <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a class="accordion-toggle" data-toggle="collapse" href="#collapseone"> collapsible group item #1 </a> </h4> </div> ... http://bootply.com/127843

android - Is there a way to make a hitTest in AS3 faster? -

i have made game in as3 android, , when test on pc works great, when try on android, hittests slow game down bit, example have 1 level have collect 9 coins, , whenever characters collect it, game freezes bit, , code use is if (coin1.hittestobject(hero)){ coin1.visible=false; gate.y-=10; } that all, 2 tasks program execute on hittest, slows down game... game 600kb big, don't think it's other parts of code, doesn't have sounds or else, hittests in game basically... you swap hittestobject approach. calculate distance coins hero, , remove them, if close enough. such math should work faster: var somedistance: number = 4; var dx: number = hero.x - coin.x; var dy: number = hero.y - coin.y; if(math.sqrt(dx*dx + dy*dy) <= somedistance){ //gotcha! hero "collided" coin }

webgl - Background transparency three.js shaderMaterial -

i having spot of bother shader using tests three.js. when apply plane geometry has black background. ok, know if add "transparent: true" code black background should go, does, left actual star being transparent. i have tried try , make star not transparent background transparent no avail. the code im using adding shader plane geometry is. uniforms = { resolution: { type: "v2", value: new three.vector2(1.0,1.0) }, basestartexture: { type: "t", value: three.imageutils.loadtexture('images/tex06.jpg') }, overlaystartexture : {type: "t", value: three.imageutils.loadtexture('images/tex07.jpg') }, time: { type: "f", value: 0.5 } }; uniforms.basestartexture.value.wraps = uniforms.basestartexture.value.wrapt = three.repeatwrapping; uniforms.overlaystartexture.value.wraps = uniforms.overlaystartexture.value.wrapt = three.repeatwrapping; ...

I need a good example of how to load and draw an image in Java -

i need example of how load , draw image on java. i've checked oracle , javalobby, , seem great, i'm new this, nearing end of semester too, oop class end , may not have local person ask this, turn guys. all need example actual image locations , stuff... stuff (string ref) doesn't me compared ("c:\\lalala.jpg") , know? i'm asking see actual code laods , draws image. simpler better. also, here code i'm working now; class of image work: package chatmain; import javax.swing.*; import java.io.*; import java.awt.*; import java.awt.image.*; import javax.imageio.*; public class chatimage extends jpanel { public static bufferedimage bgimg; public chatimage () { super(); try { bgimg = imageio.read(new file("dnframe.png")); } catch (ioexception e) { joptionpane.showmessagedialog(null, "the image did not load properly!", "oh oh!", joptionpane.error_mess...

android - How make layout for Samsung S2 size and another for Note2 size -

i want make layout samsung s2 size , note2 size make multi layouts normal , large , xlarge s2 , note2 @ same category for galaxy s2 screen resolution 480x800 while note 2 720x1280 making layout s2 place in folder layout-hdpi while note 2 place in layout-xhdpi do give reading of official documentation here www.developer.android.com/guide/practicesscreens_support.html

unable to create a new issue through jira python rest api -

This summary is not available. Please click here to view the post.

c# - ADO.NET data model generate from database is leaving out one of my tables -

i trying add ado.net asp.net project. it generates correctly, except leaves out 1 of tables, i have feeling might due naming issue or something, it add 1 tables called users table excluding called 'usercompany how ever have tried turning off option to pluralize or singulise generated object names` , still same, the usercompany table simple table consisting of 2 ints, userid , companyid is there issue or common bug not aware of? , how cna work aroudn this, have been using model until need use 1 table aint there. i found out issue, my 1 table did not have primary key, , far know ef requires table have primary key.

html - Landing page occupying the entire height of the monitor - for every resolution -

i want effect on website: http://make-lemonade.co/themes/kodax/ landing page occupying entire height of monitor to page use bootstrap 3.1.1. my code: html: <div id="panorama-home"> <div class="container"> <div class="header"> <ul class="nav nav-pills pull-right"> <li class="active"><a href="#">home</a></li> <li><a href="#">page 1</a></li> <li><a href="#">page 2</a></li> </ul> <h3 class="text-muted"> <img src="img/logo1.png" /> </h3> </div> <div class="row"> <div class="col col-md-12"> <h1 sty...

jsf - Cannot click on selected Item when the value is null primefaces -

i have selectonemenu, in xhtml page, when want click in selectitem itemvalue null, there no effect, shows default selection <p:selectonemenu id="cout" style="width: 120px;" value="#{servicemanagedbean.selectedservice.coutsmscalc}"> <f:selectitem itemlabel="sélectionnez une" itemvalue="" /> <f:selectitem itemlabel="oui" itemvalue="oui" /> <f:selectitem itemlabel="non" itemvalue="" /> </p:selectonemenu> so, when click in itemlabel "non", remains on "sélectionnez une" try if item value string <f:selectitem itemlabel="sélectionnez une" itemvalue="{null}" /> <f:selectitem itemlabel="oui" itemvalue="oui" /> <f:selectitem itemlabel="non" itemvalue="non" /> or try if it...

sql - Find next certain weekday with mysql stored procedure -

in database have column 4 cases: 1: tuesday 2: wednesday 3: thursday 4: friday im trying make stored procedure based on current date finds next weekday. instance if wednesday xx.xx.xxxx , case 1, next tuesday yy.yy.yyyy upcoming week. here hard catch :) if wanted weekday next day, should select date of next week. what have far: begin select case case_number when 1 '' when 2 '' when 3 '' when 4 '' else 'unknown' end customer customer_id = customerid; end im looking code between ' ' of course :) know need play date_add(curdate(), interval x day), (i think..) cant figure out! suggestion? use dayofweek(now()) in fact naad case inside case. depending on day of week number add appropriate amount of days now() select case case_number when 1 case dayofweek(now()) when 0 date_add(curdate(), interval x day) when 1 date_add(curdate(), interval x da...

image does not get retrieved from database into html form using php -

getimage.php <?php $hostname="localhost"; $username="root"; $password="tiger"; /* @var $dbhandle type */ $dbhandle = \mysqli_connect($hostname, $username, $password) or die("unable connect mysql"); /* @var $select type */ $select= \mysqli_select_db($dbhandle,"sample") or mysqli_error($dbhandle); /* @var $itemid type */ $itemid= (\filter_input(\input_get,'name')); $sql="select img starterveg itemid=$itemid"; $res2=mysqli_query($dbhandle,$sql); $row= mysqli_fetch_assoc($res2); mysqli_close($dbhandle); header("content-type: image/jpeg"); echo $row['img']; ?> <body> <img src="getimage.php?itemid=oepsv1086" alt="image" id="img1"> </body> > i'm not able display image database html for.instead alt message appears inside html form try in getimage.php header("content-type:image/jpeg"); stripslashe...

apache - Unable to create the cache directory (/vagrant/app/cache/dev) -

Image
i using vagrant tool, below version number of os , tools using. ubuntu : 13.04 vagrant : vagrant 1.5.1 vm box : 4.2.10_ubuntur84101 below vagrant file content # -*- mode: ruby -*- # vi: set ft=ruby : # vagrantfile api/syntax version. don't touch unless know you're doing! vagrantfile_api_version = "2" vagrant.configure(vagrantfile_api_version) |config| # vagrant configuration done here. common configuration # options documented , commented below. complete reference, # please see online documentation @ vagrantup.com. # every vagrant virtual environment requires box build off of. config.vm.box = "hashicorp/precise32" config.vm.provision :shell, :path => "getmyltd_bootstrap.sh" config.vm.network :forwarded_port, host: 4567, guest: 80 # url 'config.vm.box' box fetched if # doesn't exist on user's system. # config.vm.box_url = "http://domain.com/path/to/above.box" # create forwarded po...

.htaccess - clean url with htaccess not working -

i'm trying 'clean up' urls looking http://www.smokescreencreative.co.uk/index.php?pid=graphicdesign to looking this http://www.smokescreencreative.co.uk/graphicdesign i have tried using htaccess can't work, ideas or suggestions welcome. htaccess code i've tried below (the first line in file put there web host) addtype application/x-httpd-php .php .html .htm options +followsymlinks rewriteengine on rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^/(\w+)*$ ./index.php?pid=$1 i have tried variations remove / after ^, ./ before index, . before index , * before $ none of these variations seem make difference. thanks helps guys! make sure links on in this http://www.smokescreencreative.co.uk/graphicdesign and use code in .htaccess. rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.+)$ /index.php?pid=$1 [l]

php - How to get encrypted password value in laravel? -

i trying change password of user need check old password of user match value getting html "oldpass" text box. if existing password value , "oldpass" value matches new password updated in database.the password value getting database encrypted. $userpass = user::where('id', '=', session::get('userid'))->get(array('password')); problem $userpass returns null value . here code: $oldpass = hash::make(input::get('oldpass'));//getting password html form $userpass = user::where('id', '=', session::get('userid'))->get(array('password'));//getting password value database users table if ($oldpass === $userpass) { user::where('id', '=', session::get('userid')) ->update(array( 'password' => hash::make(input::get('newpass')) )); } else { return view::make('changepass.changepass...

java - SAP programming without ABAP Workbench -

first post here excuse mistakes. a little background: work in company uses sap daily work, use daily work. have programming skills, know c, java vba. what need: want make program interacts sap in order automate of tasks me , ppl on department do. i can't use sap macro tool because need info outside sap, e-mail , excel. of no use ask sap admins , developers on company because massively huge company , doubt attention. i need know program, net beans, code block , kind of stuff, can begin because impossible abap workbench, , in language. can learn programming language needed, need guidance. i know there sap plugin eclipse allows java development paid. need open, free solution here. can't nor need development access on sap, want program automate several actions , roles, macro, can interact other programs excel , e-mail. thanks in advance, , ask away if did not made self clear since sap macro tool runs client-side vba scripts, work want. external data no prob...

javascript - NodeJS Event Loops & Listening for Events -

i have door sensor attached raspberry pi. check if door has been opened, below script runs on 2 second interval. if has been opened, post request made external api server. this works great, goal make post request containing information of how long door opened , when opened. first thought use node events & eventemitter capabilities i'm unsure on implementation of this. var rest = require('restler'); var gpio = require('pi-gpio'); setinterval(function(){ gpio.read(16, function(err, value) { // sensor attached pin 16 if(err) throw err; if(value === 1){ // if closed, value 0 console.log("door opened"); rest.post('http://192.168.6.109:3000/door/save', { data: { door: 'open' } }).on('complete', function(data, response){ console.log('door status code: ' + response.statuscode); }); } }); },2000); you need 2 things: t...

Wamp localhost send email -

i have followed link , here php code. issue have tried many times , didn't receive emails. please point out went wrong? thank http://blog.techwheels.net/send-email-from-localhost-wamp-server-using-sendmail/ if($result) { $to = $email; $subject = "your comfirmation email"; $header = "from: name <your email>"; $message = "thank registering us. can login account"; if(mail($to, $subject,$header,$message)) { echo 'your confirmation email has been sent email address. <a href="login.php">click here login</a>'; } else { echo 'cannot send confirmation link e-mail address. <a href="login.php">click here register</a>'; } } do have mail server configured on system? windows not come mail server *nix. simple answer use library phpmailer, allows use gmail /yahoo /etc mail account send email.

How do I run a PHP enabled server from the command line? -

i started developing php via wamp/mamp stacks. these work, there lot of painful caveats deal with. more recently, i've begun working other software stacks, rails, can run server arbitrary directories minimum of configuration, muss, or fuss. simple rails -s or python -m simplehttpserver 8000 . (ok, second 1 might not simple). unfortunately, rails 1 running rails server. python 1 sets simple http server. neither 1 appropriate running php code. are there alternatives out there run php based server arbitrary directory -- in case, development directory of app want work on? i'd prefer mac osx, if there's windows version available well, i'd love hear it. as of 5.4, php includes built-in web server can used development. for example: php -s localhost:8000 index.php documentation: built-in web server but keep in mind: this web server designed aid application development. may useful testing purposes or application demonstrations run in contro...

ios - setting navigationcontroller bar to opaque moves detail scroll view down -

i using search bar plus controller uitableview in mastercontroller. when view shows up, navigationbar in mastercontroller black until view loads (not sure why?). in order fix set self.navigationcontroller.navigationbar.translucent = false; fixed issue having navigation bar being black initially, looks when click cell in uitableview of mastercontroller, content in detailview loads shifts down approximately size of search bar, it's blank space above content has been shifted... when remove translucent property in mastercontroller content in detailview fine , not shifted... so question is, shifting content down , how can stop content being shifted , having opaque navigation bar... in ios 7, default view controller's view extends under translucent navigation bar when contained in uinavigationcontroller not on opaque one. set extendedlayoutincludesopaquebars property of view controller if want extend under opaque nav bars too. when scroll view shifted on detail vie...

Python and JSON via Redis does not seem to work -

i having trouble python , json. 1) send dictionary redis via json. use json dump dict on producer , loads consumer: #this dictionary args = {"last_observed_date": "2014-04-08t02:05:00", "tau": 2, "interval": 5, "backcast": 5, "series": "exr:eur_usd:2014-04-08t02:05:00", "k": 5, "is_difference": false, "m": 3, "is_log": false, "last_time": null, "pair": "eur_usd", "granularity": "minute", "series_name": "closebid", "method": [{"ols": {"alpha": 0.5}}]} producer server: args = json.dumps(args) r.lpush(model_queue,args) consumer server: args = r.brpop(model_queue,0)[1] args = json.loads(args) traceback (most recent call last): file "/home/ubuntu/workspace/forex-trading/chaos/chaos_worker.py", line 38, in <module> data = json.loads(data) file ...

javascript - Focus a contenteditable div after double clicking on it -

i have div has contenteditable=false. <div contenteditable="false" tabindex='1' style="width:100px;height:100px" id="my_div" >def text</div> i want make contenteditable=true and focus after double click. function make_focus() { $("#my_div").prop('contenteditable','true'); $("#my_div").focus(); } $(function() { $("#my_div").dblclick(function(e) { make_focus(); }) }); if call make_focus() directly , without dblclick event this <input type=button value='make focus' onclick="make_focus()"> then #my_div focused the way need . however, when check how works dblclick different result. first thing after double click text gets selected , i don't need it . second thing in ie div doesn't focused after double click . again, want double click work function called directly. here link jsfiddle shows how should work http://jsfiddle.net...

c# - MemoryStream seems be closed after NPOI workbook.write? -

i using npoi convert datatable excel in asp.net web api project. but got nothing response. here's code: public httpresponsemessage getexcelfromdatatable(datatable dt) { iworkbook workbook = new xssfworkbook(); // create *.xlsx file, use hssfworkbook() creating *.xls file. isheet sheet1 = workbook.createsheet(); irow row1 = sheet1.createrow(0); (int = 0; dt.columns.count > i; i++) { row1.createcell(i).setcellvalue(dt.columns[i].columnname); } (int = 0; dt.rows.count > i; i++) { irow row = sheet1.createrow(i + 1); (int j = 0; dt.columns.count > j; j++) { row.createcell(j).setcellvalue(dt.rows[i][j].tostring()); } } memorystream ms = new memorystream(); workbook.write(ms); httpresponsemessage result = new httpresponsemessage(httpstatuscode.ok); result.content = new streamcontent(ms); result.content.headers.contenttype = new mediatypeheadervalue("applicat...

json - Double names in PHP -

Image
i have php code: <?php include 'imagem.php'; $imagem = new image(502, 500, '#ffffff'); $imagem->setfont('verdana', 14, '#fade45'); $helpers = json_decode(file_get_contents("http://api.formice.com/helper/online.json")); foreach($helpers $server=>$list) { $line = new line(); $line->margintop = 2; $line->addtext(strtoupper($server) . ':', 'verdana bold', 12, '#009d9d'); $line->addlinebreak(); $line->addtext(implode(', ', $list), 'verdana', 12, '#6c77c1', 4); $imagem->drawline($line); } $imagem->flushimg(); ?> and seems names duplicating because they're added twice in json file. can prevent via php, without modifying json file? $line->addtext(implode(', ', array_unique($list)), 'verdana', 12, '#6c77c1', 4); the function array_unique() gives abil...

java - Making scrolls in GridBagLayout -

good time of day, i'm trying add scrolls gridbaglayout missing correct way it. the code: public gui(map map) { //declare image icons , try read them imageicon missing = new imageicon(); imageicon wall = new imageicon(); imageicon floor = new imageicon(); //set texture missing cases try { image tempimage = imageio.read(this.getclass().getresource("/resources/images/missing.png")); missing = new imageicon(tempimage.getscaledinstance(16, 16, image.scale_default)); } catch(exception e) { e.printstacktrace(); } try { image tempimage = imageio.read(this.getclass().getresource("/resources/images/wall.png")); wall = new imageicon(tempimage.getscaledinstance(16, 16, image.scale_default)); tempimage = imageio.read(this.getclass().getresource("/resources/images/floor.png")); floor = new imageicon(tempimage.getscaledinstance(16, 16, image.scale_defa...