Daily Archives

Articles indexed Sunday June 30 2013

Page 6/13 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Mail function wont send eMail. ERROR

    - by Peter
    I think i tried to fix this issue fr 3 days now and cant seem to find the problem. I use XAMPP and use this code: <?php $to = "[email protected]"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "[email protected]"; $headers = "From: $from"; $res= mail($to,$subject,$message,$headers); echo " $res Mail Sent."; ?> when i enter that page i get an error that says: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set( My php.init file in xampp are as follow: [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = smpt.gmail.com ; http://php.net/smtp-port smtp_port = 25 That is all my codes.

    Read the article

  • How should I best store these files?

    - by Triton Man
    I have a set of image files, they are generally very small, between 5k and 100k. They can be any size though, upwards of 50mb but this is very rare. When these images are put into the system they are not ever modified. There is about 50 TB of these images total. They are currently chunked and stored in BLOBs in Oracle, but we want to change this since it requires special software to extract them. These images are access sometimes at a rate of over 100 requests per second among about 10 servers. I'm thinking about Hadoop or Cassandra, but I really don't know which would be best or how best to index them.

    Read the article

  • RAW key generation in IOS with AES

    - by sudheer
    I am novice to the cryptography in ios . I got a requirement to convert android encryption code into IOS . Below is the android code part. I need that in IOS . Can any one please help me out in this . I need this below android code in IOS. private static byte[] getRawKey(byte[] seed) throws Exception { KeyGenerator kgen = KeyGenerator.getInstance("AES"); SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); sr.setSeed(seed); kgen.init(256, sr); SecretKey skey = kgen.generateKey(); byte[] raw = skey.getEncoded(); return raw; }

    Read the article

  • Reverse Data With BIT TYPE for MS SQL

    - by Milacay
    I have a column using a BIT type (1/0). I have some records are set to 1 and some are set to 0. Those are record flag needs to be reversed. So basically, I want all records with 1 set 0, and all records with 0 set to 1. If I run "Update Table1 Set Flag = 1 Where Flag = 0" first, then I am afraid all record flags will be 1 now, and will not able to know which ones are flag = 0. any suggestions, Thanks!

    Read the article

  • angular js scope property is undefined

    - by user2071301
    why is $scope.orderBy undefined? Shouldnt it be "test" ? http://jsfiddle.net/XB4QA/4/ var app = angular.module("Foo", []); app.directive("two", function () { return { scope: { orderBy: '@' }, restrict: 'E', transclude: true, controller: function ($scope, $element, $attrs) { console.log($scope.orderBy); // is undefined, why? }, template: '<div></div>', replace: true }; }); <div ng-app="Foo"> <two order-by="test">test</two> </div>

    Read the article

  • Getting dynamic childs for a parent in SQL

    - by Islam
    I have a table called Categories which contains category_Id and parent_category_Id, so each category can has a child and the child can has a child and so on (it is dynamic). So if i have category A and category A has child B and child B has child C and child C has child D. I want to get all the child tree of A using SQL so when I give this query the id of A its result will be the ids of A's child which is B,C & D.....any ideas. Thanks in regards,

    Read the article

  • Animate 3D model programmatically-where to start?

    - by amile
    I am having a task to create a 3D model face that can talk like humans.without having any knowledge about 3D modeling. I have no clue where to start.I have searched a lot and find some of these things.OpenGL,WebGL,XNA and other similar tool can be helpful. please guide me where to start a step by step approach and which platform is better as i have programming background in JAVA. here is an idea what I need to do https://docs.google.com/viewer?a=v&pid=gmail&attid=0.2&thid=13f65486a46a1f67&mt=application/pdf&url=https://mail.google.com/mail/?ui%3D2%26ik%3D49f1f393c6%26view%3Datt%26th%3D13f65486a46a1f67%26attid%3D0.2%26disp%3Dsafe%26realattid%3Df_hi6ylzbv2%26zw&sig=AHIEtbQc8KQNHdprmEnL4UXyD3ox8vlKKQ

    Read the article

  • Get the src part of a string [duplicate]

    - by Kay Lakeman
    This question already has an answer here: Grabbing the href attribute of an A element 7 answers First post ever here, and i really hope you can help. I use a database where a large piece of html is stored, now i just need the src part of the image tag. I already found a thread, but i just doesn't do the trick. My code: Original string: <p><img alt=\"\" src=\"http://domain.nl/cms/ckeditor/filemanager/userfiles/background.png\" style=\"width: 80px; height: 160px;\" /></p> How i start: $image = strip_tags($row['information'], '<img>'); echo stripslashes($image); This returns: <img alt="" src="http://domain.nl/cms/ckeditor/filemanager/userfiles/background.png" style="width: 80px; height: 160px;" /> Next step: extract the src part: preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $image, $matches); echo $matches ; This last echo returns: Array What is going wrong? Thanks in advance for your anwser.

    Read the article

  • Container of Generic Types in java

    - by Cyker
    I have a generic class Foo<T> and parameterized types Foo<String> and Foo<Integer>. Now I want to put different parameterized types into a single ArrayList. What is the correct way of doing this? Candidate 1: public class MMM { public static void main(String[] args) { Foo<String> fooString = new Foo<String>(); Foo<Integer> fooInteger = new Foo<Integer>(); ArrayList<Foo<?> > list = new ArrayList<Foo<?> >(); list.add(fooString); list.add(fooInteger); for (Foo<?> foo : list) { // Do something on foo. } } } class Foo<T> {} Candidate 2: public class MMM { public static void main(String[] args) { Foo<String> fooString = new Foo<String>(); Foo<Integer> fooInteger = new Foo<Integer>(); ArrayList<Foo> list = new ArrayList<Foo>(); list.add(fooString); list.add(fooInteger); for (Foo foo : list) { // Do something on foo. } } } class Foo<T> {} In a word, it is related to the difference between Foo<?> and the raw type Foo. Update: Grep What is the difference between the unbounded wildcard parameterized type and the raw type? on this link may be helpful.

    Read the article

  • Is there a way to programatically check dependencies of an EXE?

    - by Mason Wheeler
    I've got a certain project that I build and distribute to users. I have two build configurations, Debug and Release. Debug, obviously, is for my use in debugging, but there's an additional wrinkle: the Debug configuration uses a special debugging memory manager, with a dependency on an external DLL. There's been a few times when I've accidentally built and distributed an installer package with the Debug configuration, and it's then failed to run once installed because the users don't have the special DLL. I'd like to be able to keep that from happening in the future. I know I can get the dependencies in a program by running Dependency Walker, but I'm looking for a way to do it programatically. Specifically, I have a way to run scripts while creating the installer, and I want something I can put in the installer script to check the program and see if it has a dependency on this DLL, and if so, cause the installer-creation process to fail with an error. I know how to create a simple CLI program that would take two filenames as parameters, and could run a DependsOn function and create output based on the result of it, but I don't know what to put in the DependsOn function. Does anyone know how I'd go about writing it?

    Read the article

  • Why can't I get the value of this text input?

    - by Spilot
    It seems simple enough, but nothing I try is working. I have a jquery ui datepicker, I use val() to get the value of that input on button click(), then log it. The click event is working. I can log a string I write myself, but when I pass console.log() the variable that stores the datepicker value...nothing. I've tried using html() and text() instead of val(), still nothing //JS $(function(){ $("button").button(); $("#date").datepicker(); var date = $("#date").val(); $("button").click(function(){ // this logs console.log("event working"); // but this logs nothing console.log(date); });//close click });//closes function //HTML <!DOCTYPE html> <html> <head> <script src="http://www.parsecdn.com/js/parse-1.2.8.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="http://myDomain/bn/lbStyle.css"/> <script src="http://myDomain/index.js"></script> <title> Welcome to The Bringer Network </title> </head> <body> <form id="dialog"> <p>Date <input type="text" id="date"/></p> <button>Submit</button> </form> </body> </html>

    Read the article

  • How To Parse String File Txt Into Array With C++

    - by Ibnu Syuhada
    I am trying to write a C++ program, but I am not familiar with C++. I have a .txt file, which contains values as follows: 0 0.0146484 0.0292969 0.0439453 0.0585938 0.0732422 0.0878906 What I have done in my C++ code is as follows: #include <iostream> #include <fstream> using namespace std; int main() { string line; ifstream myReadFile; myReadFile.open("Qi.txt"); if(myReadFile.is_open()) { while(myReadFile.good()) { getline(myReadFile,line); cout << line << endl; } myReadFile.close(); } return 0; } I would like to make the output of the program an array, i.e. line[0] = 0 line[1] = 0.0146484 line[2] = 0.0292969 line[3] = 0.0439453 line[4] = 0.0585938 line[5] = 0.0732422 line[6] = 0.0878906

    Read the article

  • Galaxy Nexus (Specificaly) camera startPreview failed

    - by Roman
    I'm having a strange issue on a galaxy nexus when trying to have a live camera view in my app. I get this error in the log cat: 06-29 16:31:26.681 I/CameraClient(133): Opening camera 0 06-29 16:31:26.681 I/CameraHAL(133): camera_device open 06-29 16:31:26.970 D/DOMX (133): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001005 - Error returned from OMX API in ducati 06-29 16:31:26.970 E/CameraHAL(133): Error while configuring rotation 0x80001005 06-29 16:31:27.088 I/am_on_resume_called(21274): [0,digifynotes.Activity_Camera] 06-29 16:31:27.111 V/PhoneStatusBar(693): setLightsOn(true) 06-29 16:31:27.205 E/CameraHAL(133): OMX component is not in loaded state 06-29 16:31:27.205 E/CameraHAL(133): setNSF() failed -22 06-29 16:31:27.205 E/CameraHAL(133): Error: CAMERA_QUERY_RESOLUTION_PREVIEW -22 06-29 16:31:27.252 I/MonoDroid(21274): UNHANDLED EXCEPTION: Java.Lang.Exception: Exception of type 'Java.Lang.Exception' was thrown. 06-29 16:31:27.252 I/MonoDroid(21274): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr) <0x00068> 06-29 16:31:27.252 I/MonoDroid(21274): at Android.Hardware.Camera.StartPreview () <0x0007f> 06-29 16:31:27.252 I/MonoDroid(21274): at DigifyNotes.CameraPreviewView.SurfaceChanged (Android.Views.ISurfaceHolder,Android.Graphics.Format,int,int) <0x000d7> 06-29 16:31:27.252 I/MonoDroid(21274): at Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceChanged_Landroid_view_SurfaceHolder_III (intptr,intptr,intptr,int,int,int) <0x0008b> 06-29 16:31:27.252 I/MonoDroid(21274): at (wrapper dynamic-method) object.4c65d912-497c-4a67-9046-4b33a55403df (intptr,intptr,intptr,int,int,int) <0x0006b> That very same source code works flawlessly on a Samsung Galaxy Ace 2X (4.0.4) and an LG G2X (2.3.7). I will later test on a galaxy s4 if my friend lends it to me. Galaxy Nexus runs Android 4.2.2 I believe. Any one have any ideas? EDIT: Here are my camera classes: [Please note I am using mono] [The formatting is more readable if you view it as raw] Camera Activity: http://pastebin.com/YPcGXJRB Camera Preview View: http://pastebin.com/zNf8AWDf

    Read the article

  • How to redirect Sub domain as attribute in page with .htaccess

    - by rkaartikeyan
    I want like this Ex: http://user1.mysite.com or http://user2.mysite.com if anyone enter URL Like these on browsers it should go as bellow http://mysite.com/user.php?userName=user1 How can i solve this with .htaccess With help of Prix i solved this Issue RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC] RewriteCond %{HTTP_HOST} ^(.*)\.mysite\.com RewriteRule ^(.*)$ http://mysite.com/user.php?userName=%1 [R=301] Its working fine :) http://user1.mysite.com http://mysite.com/user.php?userName=user1 -> This one is working fine with Prix Code Now i want Like Bellow. I have tried lot but not working. So again i don't have anyway rather than ask here. I want like this http://user1.mysite.com/inbox/ http://mysite.com/inbox.php?userName=user1 And also Like this http://user1.mysite.com/message/1 http://mysite.com/view-message.php?userName=user1&messageID=1

    Read the article

  • matching images inside a link in regex

    - by user225269
    What is wrong with regex pattern that I created: $link_image_pattern = '/\<a\shref="([^"]*)"\>\<img\s.+\><\/a\>/'; preg_match_all($link_image_pattern, $str, $link_images); What I'm trying to do is to match all the links which has images inside of them. But when I try to output $link_images it contains everything inside the first index: <pre> <?php print_r($link_images); ?> </pre> The markup looks something like this: Array ( [0] = Array ([0] = " <p>&nbsp;</p> <p><strong><a href="url">Title</a></strong></p> <p>Desc</p> <p><a href="{$image_url2}"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="{$image_url2}" width="569" height="409"></a></p> But when outputting the contents of the matches, it simply returns the first string that matches the pattern plus all the other markup in the page like this: <a href="{$image_url}"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="{$image_url}" width="568" height="347"></a></p> <p>&nbsp;</p> <p><strong><a href="url">Title</a></strong></p> <p>Desc</p> <p><a href="{$image_url2}"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="{$image_url2}" width="569" height="409"></a></p>")

    Read the article

  • mod_rewrite: check if isn't a certain domain

    - by weingage
    I'm migrating some code from a working web app, but can't get it to work on the new server. Everything seems to be configured correctly, but I'm getting internal redirect limit errors in Apache2. Here are my rewrites and explanation This WORKS - any subdomains that aren't cdn. or manage. should be redirected to u.php RewriteCond %{HTTP_HOST} ^(^.*)\.mediasprk\.com$ [NC] RewriteCond ^(.*)$ !^(cdn|manage)$ RewriteCond %{REQUEST_URI} !\.(png|gif|jpg)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST} This is no longer working. Goal here is to handle CName pointing. So if it's not my app domain (mediasprk.com), then handle it by sending it to u.php. RewriteCond %{HTTP_HOST} !^mediasprk\.com$ [NC] RewriteCond %{REQUEST_URI) !\.(png|gif|jpg)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ u.php?uri=$1&hostName=%{HTTP_HOST} Can anyone see the issue here in the second block that would cause the redirect limit errors? Maybe something wrong in the rewrites? Thanks.

    Read the article

  • Unexpected output on initializing array by using both `element-by-element` & `designated` technique

    - by haccks
    C99 provides a feature to initialize arrays by using both element-by-element & designated method together as: int a[] = {2,1,[3] = 5,[5] = 9,6,[8] = 4}; On running the code: #include <stdio.h> int main() { int a[] = {2,1,[3] = 5,[0] = 9,4,[6] = 25}; for(int i = 0; i < sizeof(a)/sizeof(a[0]); i++) printf("%d ",a[i]); return 0; } (Note that Element 0 is initialized to 2 and then again initialised by designator [0] to 9) I was expecting that element 0(which is 2) will be replaced by 9(as designator [0] = 9) and hence o/p will become 9 1 0 5 4 0 25 Unfortunately I was wrong as o/p came; 9 4 0 5 0 0 25 Any explanation for unexpected o/p?

    Read the article

  • ExtJS panel does not render properly unless I open Firebug - WTF?

    - by Huuuze
    I have the following ExtJS Panel embedded in another Panel, which then resides in a TabPanel and the TabPanel is in a FormPanel. With that being said, these start/end date fields are initially displayed in very small cells -- the cells are so small that I see horizontal scroll bars. Now here's the weird part: if I open Firebug, everything pops into place. Does anyone know what's going on? Why isn't it rendering properly in the first place and why does Firebug cause everything to work properly simply by opening Firebug? var dateFields = new Ext.Panel({ id: 'dateFields', labelAlign: 'bottom', border: false, items: [{ layout: 'column', defaults: { columnWidth: 0.5 }, items: [{ layout: 'form', border: false, items: [{ xtype: 'datefield', name: 'start_date', fieldLabel: 'Start Date' }] }, { layout: 'form', border: false, items: [{ xtype: 'datefield', name: 'end_date', fieldLabel: 'End Date' }] }] }] });

    Read the article

  • What is the best way to recover from a mysql replication fail?

    - by Itai Ganot
    Today, the replication between our master mysql db server and the two replication servers dropped. I have a procedure here which was written a long time ago and i'm not sure it's the fastest method to recover for this issue. I'd like to share with you the procedure and I'd appreciate if you could give your thoughts about it and maybe even tell me how it can be done quicker. At the master: RESET MASTER; FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; And copy the values of the result of the last command somewhere. Wihtout closing the connection to the client (because it would release the read lock) issue the command to get a dump of the master: mysqldump mysq Now you can release the lock, even if the dump hasn't end. To do it perform the following command in the mysql client: UNLOCK TABLES; Now copy the dump file to the slave using scp or your preferred tool. At the slave: Open a connection to mysql and type: STOP SLAVE; Load master's data dump with this console command: mysql -uroot -p < mysqldump.sql Sync slave and master logs: RESET SLAVE; CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=98; Where the values of the above fields are the ones you copied before. Finally type START SLAVE; And to check that everything is working again, if you type SHOW SLAVE STATUS; you should see: Slave_IO_Running: Yes Slave_SQL_Running: Yes That's it! At the moment i'm in the stage of copying the db from the master to the other two replication servers and it takes more than 6 hours to that point, isn't it too slow? The servers are connected through a 1gb switch.

    Read the article

  • How reliable is HDD SMART data?

    - by andahlst
    Based on SMART data, you can judge the health of a disk, at least that is the idea. If I, for instance, run sudo smartctl -H /dev/sda on my ArchLinux laptop, it says that the hard drive passed the self tests and that it should be "healthy" based on this. My question is how reliable this information is, or more specifically: If according to the SMART data this disk is healthy, what are the odds of the disk suddenly failing despite this? This assumes the failure is not due to some catastrophic event that impossibly could have been predicted, such as the laptop falling down on the floor causing the drive heads to hit the disk. If the SMART data does not say the disk is in good shape, what are the odds of the disk failing within some amount of time? Is it possible that there will be false positives and how common are these? Of course, I keep backups no matter what. I am mostly curious.

    Read the article

  • Developing high-performance and scalable zend framework website

    - by Daniel
    We are going to develop an ads website like http://www.gumtree.com/ (it will not be like this one but just to give you an ideea) and we are having some issues regarding performance and scalability. We are planning on using Zend Framework for this project but this is all that I'm sure off at this point. I don't think a classic approch like Zend Framework (PHP) + MySQL + Memcache + jQuery (and I would throw Doctrine 2 in there to) will fix result in a high-performance application. I was thinking on making this a RESTful application (with Zend Framework) + NGINX (or maybe MongoDB) + Memcache (or eAccelerator -- I understand this will create problems with scalability on multiple servers) + jQuery, a CDN for static content, a server for images and a scalable server for the requests and the rest. My questions are: - What do you think about my approch? - What solutions would you recommand in terms of servers approch (MySQL, NGINX, MongoDB or pgsql) for a scalable application expected to have a lot of traffic using PHP?...I would be interested in your approch. Note: I'm a Zend Framework developer and don't have to much experience with the servers part (to determin what would be best solution for my scalable application)

    Read the article

  • How does a private intra network connect to the internet?

    - by user24454
    Yesterday I visited the offices of RailTel - a public company in India that provides communication backbone to the Indian Railways, they had a very sophisticated setup of Optical Fiber cables for data transmission. They said that this is a private network for internal use only. Then when I was in the Exchange Office - the main communication office, a place where they actually use those communication channels. They said that we could connect to the Intranet and as well as the Internet! My question is, that how is this possible? How can privately laid optical fibers connect globally? On google, I picked up the term internet exhange? But this has got me confused further, why would a private network want to go to this exchange? Please explain me in very simple terms, how does this all work? If this is just a connection of wires, then why charge so much for little bandwidth? Thanks.

    Read the article

  • Can I host multiple sites with one Amazon EC2 instance [duplicate]

    - by user22
    This question already has an answer here: Can you help me with my capacity planning? 2 answers I currently have VPS server and I pay around $75 per month and I get: 40GB HD 2Gb RAM 100GB BW 6 core cpu (but i dont use much) I have only one live website running and traffic is only max 100 user visit per day. I mostly do the my testing stuff and some of my inter sites for playing with coding. But I do need one server. I am thinking of moving to Amazon EC2 if the price diff is not so much because then I can learn some more stuff. I am thinking of getting the 3 years Heavy utilization Reserved instance because my server will be running all day and night. I tried their online caluclator with Medium Instance Heavy reserved for 3 years for EC2 it comes $31 per month(effective price) and for EBS and S3 , I think even if thats it $40 for all other stuff. I will be at no loss for what I am getting at present. Am i correct or I missed something?? Now In my current VPS I have Apache for PHP sites and MOD wsgi for python sites. I am not sure if I will be able to do all that stuff in Amazon EC2. Can I host python and PHP sites both in Amazon EC2 instance using Named Virtual Hosts and Ngnix

    Read the article

  • forwarding packets from wireless nic wlan0 to another Wireless nic wlan1

    - by user179759
    I have two wireless interfaces wlan0, wlan1 I want wlan0 to be connected to the internet via a wireless router and I want wlan1 to be in AP mode acting as a router to give internet access to whoever connectes to it. So basically all packets coming through wlan1 should be forwarded to wlan0 = Router = Internet. That's including DNS/DHCP/etc.. [A]~~~~~(Wi-Fi)~~~~~~v [B]~~~~~(Wi-Fi)~~~> [me] ~~~~(Wi-Fi)~~~~~>[AP/Router]------->[internet] [C]~~~~~(Wi-Fi)~~~~~~^ Any idea how can I do this? ps: I tried using bridges but I always get 'operation not supported' using the brctl tool.

    Read the article

  • Why should I use $[ EXPR ] instead of $(( EXPR ))?

    - by qdii
    On the paragraph explaining arithmetic expansion, Bash's user guide uncovers 2 different ways of evaluating an expression, the first one uses $((?EXPRESSION?)) and the second one uses $[?EXPRESSION?]. The two ways seem pretty similar as the only difference I have found is: $[?EXPRESSION?] will only calculate the result of EXPRESSION, and do no tests: Yet, I am intrigued because the same document recommends using $[?EXPRESSION?] rather than $((?EXPRESSION?)). Wherever possible, Bash users should try to use the syntax with square brackets: Why would you want that if less tests are being done?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >