Daily Archives

Articles indexed Friday September 28 2012

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Scala always returning true....WHY?

    - by jhamm
    I am trying to learn Scala and am a newbie. I know that this is not optimal functional code and welcome any advice that anyone can give me, but I want to understand why I keep getting true for this function. def balance(chars: List[Char]): Boolean = { val newList = chars.filter(x => x.equals('(') || x.equals(')')); return countParams(newList, 0) } def countParams(xs: List[Char], y: Int): Boolean = { println(y + " right Here") if (y < 0) { println(y + " Here") return false } else { println(y + " Greater than 0") if (xs.size > 0) { println(xs.size + " this is the size") xs match { case xs if (xs.head.equals('(')) => countParams(xs.tail, y + 1) case xs if (xs.head.equals(')')) => countParams(xs.tail, y - 1) case xs => 0 } } } return true; } balance("()())))".toList) I know that I am hitting the false branch of my if statement, but it still returns true at the end of my function. Please help me understand. Thanks.

    Read the article

  • sql select with php variable

    - by user1572526
    I'm trying to print out a html-table from db-table 'dimensions'. I only want dimensions from the selected pipetype which I get from a dropdownbox. For now I just put in "Steel" manually. Steel has pipe_id = 2 in db-table 'pipes'. I've run the first query in my db-tool and it returns 2 so there's nothing wrong there. The second query returns nothing. But when I manually set $wq = 2 (which I comment out below) it prints out the html-table perfectly. What am I doing wrong here? $wq="SELECT pipe_id FROM pipes WHERE title_en = 'Steel'"; //$wq = '2'; $sql="SELECT * FROM dimensions WHERE pipe_id = '".$wq."'";

    Read the article

  • Oracle curcular join sometimes give duplicates, but sometimes does not

    - by Kaushik
    By mistake I wrote a query like this: select * from a,b,c where a.col=b.col and b.col2=c.col2 and c.col3=a.col4 So there is a circular join here. Now the thing is sometimes this query returns duplicate result, sometimes it returns unique(correct) results. I am trying to understand why it does not give duplicate results always. Also if circular joins are not allowed, how come Oracle does not throw an error. EDIT: This is the actual query. After reading ti carefully, I am not sure anymore if this is a circular join or not.It does not seem so...but why I get duplicates only sometime? select * from a,b,c,d where a.col=b.col and b.col=c.col and c.col2=d.col2 and d.col2 =a.col2

    Read the article

  • The truth value of an array with more than one element is ambigous when trying to index an array

    - by user1440194
    I am trying to put all elements of rbs into a new array if the elements in var(another numpy array) is =0 and <=.1 . However when I try the following code I get this error: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() rbs = [ish[4] for ish in realbooks] for book in realbooks: var -= float(str(book[0]).replace(":", "")) bidsred = rbs[(var <= .1) and (var >=0)] any ideas on what I'm doing wrong?

    Read the article

  • Why do not C++11's move constructor/assignment operator act as expected

    - by xmllmx
    #include <iostream> using namespace std; struct A { A() { cout << "A()" << endl; } ~A() { cout << "~A()" << endl; } A(A&&) { cout << "A(A&&)" << endl; } A& operator =(A&&) { cout << "A& operator =(A&&)" << endl; return *this; } }; struct B { // According to the C++11, the move ctor/assignment operator // should be implicitly declared and defined. The move ctor // /assignment operator should implicitly call class A's move // ctor/assignment operator to move member a. A a; }; B f() { B b; // The compiler knows b is a temporary object, so implicitly // defined move ctor/assignment operator of class B should be // called here. Which will cause A's move ctor is called. return b; } int main() { f(); return 0; } My expected output should be: A() A(A&&) ~A() ~A() However, the actual output is: (The C++ compiler is: Visual Studio 2012) A() ~A() ~A() Is this a bug of VC++? or just my misunderstanding?

    Read the article

  • Passing parameter to controller from route in laravel

    - by bretterer
    Given the following route Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show')); And the URL I would like to use, http://www.example.com/groups/1 I would like to be able to use the (:any) value in my controller. My controller looks like class Groups_Controller extends Base_Controller { public $restful = true; public function get_show($groupID) { return 'I am group id ' . $groupID; } } How is this possible to do? I have tried a few things including the following Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show((:1))')); but it did not work. UPDATE Anytime I try to pass in the arguments as show above i get a 404 error. Thanks for the help!

    Read the article

  • How to define RequestMapping prioritization

    - by James Skidmore
    I have a situation where I need the following RequestMapping: @RequestMapping(value={"/{section}"}) ...method implementation here... @RequestMapping(value={"/support"}) ...method implementation here... There is an obvious conflict. My hope was that Spring would resolve this automatically and map /support to the second method, and everything else to the first, but it instead maps /support to the first method. How can I tell Spring to allow an explicit RequestMapping to override a RequestMapping with a PathVariable in the same place? (Edit - this is simplified, I know that having those two RequestMapping alone wouldn't make much sense)

    Read the article

  • Avoiding NPE in trait initialization without using lazy vals

    - by 0__
    This is probably covered by the blog entry by Jesse Eichar—still I can't figure out how to correct the following without residing to lazy vals so that the NPE is fixed: Given trait FooLike { def foo: String } case class Foo( foo: String ) extends FooLike trait Sys { type D <: FooLike def bar: D } trait Confluent extends Sys { type D = Foo } trait Mixin extends Sys { val global = bar.foo } First attempt: class System1 extends Mixin with Confluent { val bar = Foo( "npe" ) } new System1 // boom!! Second attempt, changing mixin order class System2 extends Confluent with Mixin { val bar = Foo( "npe" ) } new System2 // boom!! Now I use both bar and global very heavily, and therefore I don't want to pay a lazy-val tax just because Scala (2.9.2) doesn't get the initialisation right. What to do?

    Read the article

  • Using awk to return only certain chunks of data

    - by Koriar
    I'm not 100% certain how to phrase my question simply, so I apologize if this has been answered somewhere and I was just unable to find it. What I have are debug logs with authentication packets in them along with a bunch of other output. I need to search through about 2 million lines of logs to find every packet that contains a certain mac address. The packets look something like this (slightly censored): -----------------[ header ]----------------- Event: Authd-Response (1900) Sequence: -54 Timestamp: 1969-12-31 19:30:00 (0) ---------------[ attributes ]--------------- Auth-Result = Auth-Accept Service-Profile-SID = 53 Service-Profile-SID = 49 RADIUS-Access-Accept-Attr/WiMAX-Capability = 0x(numbers) Session-Timeout = 3600 Service-Profile-SID = 4 Service-Profile-SID = 29 Chargeable-User-Identity = "(Numbers)" User-Password = "(the MAC address I'm looking for)" -------------------------------------------- However there are about 10 different possible types with different possible lengths. They all start with the header line and end with the all-dashes line. I've had success using awk to get the code blocks themselves using this: awk '/-----------------\[ header \]-----------------/,/--------------------------------------------/' filename.txt But I was hoping to be able to use it to return only the packets which contain the MAC address that I need. I've been trying to figure this out for a few days now and I'm pretty stuck. I could try and write a bash script, but I could swear that I've used awk to do something like this before...

    Read the article

  • How do I translate this Matlab bsxfun call to R?

    - by claytontstanley
    I would also (fingers crossed) like the solution to work with R Sparse Matrices in the Matrix package. >> A = [1,2,3,4,5] A = 1 2 3 4 5 >> B = [1;2;3;4;5] B = 1 2 3 4 5 >> bsxfun(@times, A, B) ans = 1 2 3 4 5 2 4 6 8 10 3 6 9 12 15 4 8 12 16 20 5 10 15 20 25 >> EDIT: I would like to do a matrix multiplication of these sparse vectors, and return a sparse array: > class(NRowSums) [1] "dsparseVector" attr(,"package") [1] "Matrix" > class(NColSums) [1] "dsparseVector" attr(,"package") [1] "Matrix" > NRowSums * NColSums (I think) w/o using a non-sparse variable to temporarily store data.

    Read the article

  • Perl cron job stays running

    - by Dylan
    I'm currently using a cron job to have a Perl script that tells my Arduino to cycle my aquaponics system and all is well, except the Perl script doesn't die as intended. Here is my cron job: */15 * * * * /home/dburke/scripts/hal/bin/main.pl cycle And below is my Perl script: #!/usr/bin/perl -w # Sample Perl script to transmit number # to Arduino then listen for the Arduino # to echo it back use strict; use Device::SerialPort; use Switch; use Time::HiRes qw ( alarm ); $|++; # Set up the serial port # 19200, 81N on the USB ftdi driver my $device = '/dev/arduino0'; # Tomoc has to use a different tty for testing #$device = '/dev/ttyS0'; my $port = new Device::SerialPort ($device) or die('Unable to open connection to device');; $port->databits(8); $port->baudrate(19200); $port->parity("none"); $port->stopbits(1); my $lastChoice = ' '; my $pid = fork(); my $signalOut; my $args = shift(@ARGV); # Parent must wait for child to exit before exiting itself on CTRL+C $SIG{'INT'} = sub { waitpid($pid,0) if $pid != 0; exit(0); }; # What child process should do if($pid == 0) { # Poll to see if any data is coming in print "\nListening...\n\n"; while (1) { my $incmsg = $port->lookfor(9); # If we get data, then print it if ($incmsg) { print "\nFrom arduino: " . $incmsg . "\n\n"; } } } # What parent process should do else { if ($args eq "cycle") { my $stop = 0; sleep(1); $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; $stop = 1; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); while ($stop == 0) { sleep(2); } die "Done."; } else { sleep(1); my $choice = ' '; print "Please pick an option you'd like to use:\n"; while(1) { print " [1] Cycle [2] Relay OFF [3] Relay ON [4] Config [$lastChoice]: "; chomp($choice = <STDIN>); switch ($choice) { case /1/ { $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); $lastChoice = $choice; } case /2/ { $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2"; $lastChoice = $choice; } case /3/ { $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1"; $lastChoice = $choice; } case /4/ { print "There is no configuration available yet. Please stab the developer."; } else { print "Please select a valid option.\n\n"; } } } } } Why wouldn't it die from the statement die "Done.";? It runs fine from the command line and also interprets the 'cycle' argument fine. When it runs in cron it runs fine, however, the process never dies and while each process doesn't continue to cycle the system it does seem to be looping in some way due to the fact that it ups my system load very quickly. If you'd like more information, just ask. EDIT: I have changed to code to: #!/usr/bin/perl -w # Sample Perl script to transmit number # to Arduino then listen for the Arduino # to echo it back use strict; use Device::SerialPort; use Switch; use Time::HiRes qw ( alarm ); $|++; # Set up the serial port # 19200, 81N on the USB ftdi driver my $device = '/dev/arduino0'; # Tomoc has to use a different tty for testing #$device = '/dev/ttyS0'; my $port = new Device::SerialPort ($device) or die('Unable to open connection to device');; $port->databits(8); $port->baudrate(19200); $port->parity("none"); $port->stopbits(1); my $lastChoice = ' '; my $signalOut; my $args = shift(@ARGV); # Parent must wait for child to exit before exiting itself on CTRL+C if ($args eq "cycle") { open (LOG, '>>log.txt'); print LOG "Cycle started.\n"; my $stop = 0; sleep(2); $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; $stop = 1; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; print LOG "Alarm is being set.\n"; alarm (420); print LOG "Alarm is set.\n"; while ($stop == 0) { print LOG "In while-sleep loop.\n"; sleep(2); } print LOG "The loop has been escaped.\n"; die "Done."; print LOG "No one should ever see this."; } else { my $pid = fork(); $SIG{'INT'} = sub { waitpid($pid,0) if $pid != 0; exit(0); }; # What child process should do if($pid == 0) { # Poll to see if any data is coming in print "\nListening...\n\n"; while (1) { my $incmsg = $port->lookfor(9); # If we get data, then print it if ($incmsg) { print "\nFrom arduino: " . $incmsg . "\n\n"; } } } # What parent process should do else { sleep(1); my $choice = ' '; print "Please pick an option you'd like to use:\n"; while(1) { print " [1] Cycle [2] Relay OFF [3] Relay ON [4] Config [$lastChoice]: "; chomp($choice = <STDIN>); switch ($choice) { case /1/ { $SIG{ALRM} = sub { print "Expecting plant bed to be full; please check.\n"; $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2\n"; }; $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1\n"; print "Waiting for plant bed to fill...\n"; alarm (420); $lastChoice = $choice; } case /2/ { $signalOut = $port->write('2'); # Signal to set pin 3 low print "Sent cmd: 2"; $lastChoice = $choice; } case /3/ { $signalOut = $port->write('1'); # Signal to arduino to set pin 3 High print "Sent cmd: 1"; $lastChoice = $choice; } case /4/ { print "There is no configuration available yet. Please stab the developer."; } else { print "Please select a valid option.\n\n"; } } } } }

    Read the article

  • Arduino - AdHoc Network Setup

    - by methodMan
    I`m currently working with an arduino trying to build an adhoc network to which a device can connect to and send web request to. The problem I am currently having is that I can only set up one connection and then when that connection is terminated (client.stop()) all subsequent connections are not picked up by the server, even a curl command just sits there spinning. The first connection I start when I reset the server works fine and I am able to talk to the server; but after that, the arduino can no longer find new clients (even though it's trying with the library given). I`m using the sparkfun library for the wifly shield cloned from github, along with an Arduino Uno. My current code is based off their default example 'WiFly_AdHoc_Example' but I had to remove a few things to get the network to start up which might be the cause of this problem. Here is the .ino file that I am running. #include <SPI.h> #include <WiFly.h> //#include <SoftwareSerial.h> //SoftwareSerial mySerial( 5, 4); //Part from example not used(see below) WiFlyServer server(80); void setup() { Serial.begin(9600); //The code below is from the example but when I run it the WiFly will hang // on Wifly.begin(). Without it the WiFly starts up fine but only works for // one request. //mySerial.begin(9600); //WiFly.setUart(&mySerial); // Tell the WiFly library that we are not //using the SPIUart Serial.println("**************Starting WiFly**************"); // Enable Adhoc mod WiFly.begin(true); Serial.println("WiFly started, creating network."); if (!WiFly.createAdHocNetwork("wifly")) { Serial.print("Failed to create ad hoc network."); while (1) { // Hang on failure. } } Serial.println("Network created"); Serial.print("IP: "); Serial.println(WiFly.ip()); Serial.println("Starting Server..."); server.begin(); Serial.print("Server started, waiting for client."); } void loop() { delay(200); WiFlyClient client = server.available(); if (client) { Serial.println("Client Found."); // a string to store received commands String current_command = ""; while (client.connected()) { if (client.available()) { //Gets a character from the sent request. char c = client.read(); if (c=='#' || c=='\n') //End of extraneous output { current_command = ""; } else if(c!= '\n') { current_command+=c; } if (current_command== "get") { // output the value of each analog input pin for (int i = 0; i < 6; i++) { client.print("analog input "); client.print(i); client.print(" is "); client.print(analogRead(i)); client.println("<br />"); } } else if(current_command== "hello") { client.println("Hello there, I'm still here."); } else if (current_command== "quit") { client.println("Goodbye..."); client.stop(); current_command == ""; break; } else if (current_command == "*OPEN*") { current_command == ""; } } } // give the web browser time to receive the data delay(200); // close the connection client.stop(); } } If anyone understands this better then I (I`m new to arduino) please leave some helpful comments. Or just help me out on getting this little web server up and running so that I can hit it with more then one request. If there is any other helpful information I can provide please let me know. Thanks for reading and hope you can help. EDIT: Using telnet I can successfully connect (the first time) and send commands to the arduino including one to terminate the connection (calls the client.stop() method). But when I try to reconnect though telnet, it says the connection was successful but on the arduino it's still looping thinking the client is still false. WHAT??? I know right, I'm getting mixed messages from telnet vs arduino. None of the commands work obviously since the ardunio is still looping waiting for a client that evaluates to true. I'm gonna take a look at WiFlyServer from the library I imported and see if I can dig up the problem because somehow that server.available() method isn't finding new clients. Noticing a lot of TODO's in the library code.... EDIT: So I found the reason for the problem, it was in WiFlyServer.cpp file from the sparkfun library. The code that was causing the reconnect issue was infact in the server.availible() method. Right at the top of the method, there is a check: // TODO: Ensure no active non-server client connection. if (!WiFly.serverConnectionActive) { activeClient._port = 0; } For some reason when I comment this out, I can reconnect fine and everything works as it should. I will now dive into the library and see if I can fix this, I'm not exactly sure what this is doing but it gets called when the server connection is not active and is somehow blocking subsequent connections. Does anyone have any ideas how I might get to the root of this problem without using this commenting hack? Please help, no-one has commented or answered yet! Don't you want to join in on the fun???

    Read the article

  • Retrieve XML from URL

    - by Pl4za
    I am having some problems retrieving a xml from url with the following code: private static String getAlbumArt(String artistName, String albumName){ try{ XMLParser xml_parser = new XMLParser(); String xml = xml_parser.getXmlFromUrl(getAlbumURL(artistName, albumName)); Document doc = xml_parser.getDomElement(xml); NodeList N = doc.getElementsByTagName("album"); Node node = N.item(0); NodeList N2 = node.getChildNodes(); System.out.println("1------"); for (int i = 0; i < N2.getLength(); i++) { Node detailNode = N2.item(i); if (detailNode.getNodeType() == Node.ELEMENT_NODE) { System.out.println("2------"); if (detailNode.getNodeName().equalsIgnoreCase("image")) { String sizeVal = ((Element) detailNode).getAttribute("size"); String url = detailNode.getTextContent(); if (sizeVal.equalsIgnoreCase("large")) { return url; } } } } } catch (Exception e){ } return null; } The xml function which i call in the above code: public String getXmlFromUrl(String url) { String xml = null; try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); xml = EntityUtils.toString(httpEntity); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return xml; } getAlbumURL: public static String getAlbumURL(String artist, String album){ return URL_METHOD + METHOD_GETALBUM + AMPERSAND + API_KEY + AMPERSAND + PARAM_ARTIST + artist + AMPERSAND + PARAM_ALBUM + album; } XMLparser: public class XMLParser { // constructor public XMLParser() { } //Get XML from URL public String getXmlFromUrl(String url) { String xml = null; try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(url); HttpResponse httpResponse = httpClient.execute(httpPost); HttpEntity httpEntity = httpResponse.getEntity(); xml = EntityUtils.toString(httpEntity); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return xml; } //Get dom element public Document getDomElement(String xml){ Document doc = null; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(xml)); doc = db.parse(is); } catch (ParserConfigurationException e) { Log.e("Error: ", e.getMessage()); return null; } catch (SAXException e) { Log.e("Error: ", e.getMessage()); return null; } catch (IOException e) { Log.e("Error: ", e.getMessage()); return null; } return doc; } //Get nod element public final String getElementValue(Node elem ) { Node child; if( elem != null){ if (elem.hasChildNodes()){ for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() ){ if( child.getNodeType() == Node.TEXT_NODE ){ return child.getNodeValue(); } } } } return ""; } //Get element value public String getValue(Element item, String str) { NodeList nlList = item.getElementsByTagName(str).item(0).getChildNodes(); Node nValue = (Node) nlList.item(0); return nValue.getNodeValue(); } } Any ideas ? I seriously don't know what is wrong.. I used this before and it worked.

    Read the article

  • Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    - by Fotis
    I am a newbie programmer, so I will need your help! Locally the webapp works ok with the db on it! When I uploaded the application on the cloudcontrol, it comes up with the following error: CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)! I suppose I have not uploaded the db. This is the very first time I upload a webapp on a server so I do not know the exact steps that I have to follow in order to upload the db on a server. Cloudcontrol has documentation about mysql! I did follow the steps but the webapp comes with the same error! Could you please tell me what steps I have to follow in order to make it working? I am sure that this error is due to lack of knowledge!

    Read the article

  • Are There Specific CSS Selectors Targeting IE10?

    - by kunambi
    Since IE is getting rid of conditional comments in version 10, I'm in dire need to find a "CSS hack" targeting IE10 specifically. NB! It has to be the selector that's getting "hacked" and not the CSS-properties. In Mozilla, you can use: @-moz-document url-prefix() { h1 { color: red; } } While in Webkit, you usually do: @media screen and (-webkit-min-device-pixel-ratio:0) { h1 { color: blue; } } How would I do something similar in IE10? TYIA.

    Read the article

  • Using Java PDFBox library to write Russian PDF

    - by Brad
    I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It seems the problem is in the font used, but i am not so sure about that, so i hope if anyone could guide me through this. Here is the important code lines : PDTrueTypeFont font = PDTrueTypeFont.loadTTF( pdfFile, new File( "fonts/VREMACCI.TTF" ) ); // Windows Russian font imported to write the Russian text. font.setEncoding( new WinAnsiEncoding() ); // Define the Encoding used in writing. // Some code here to open the PDF & define a new page. contentStream.drawString( "??????? ????????????" ); // Write the Russian text. The WinAnsiEncoding source code is : Click here --------------------- Edit on 18 November 2009 After some investigation, i am now sure it is an Encoding problem, this could be solved by defining my own Encoding using the helpful PDFBox class called DictionaryEncoding. I am not sure how to use it, but here is what i have tried until now : COSDictionary cosDic = new COSDictionary(); cosDic.setString( COSName.getPDFName("Ercyrillic"), "0420 " ); // Russian letter. font.setEncoding( new DictionaryEncoding( cosDic ) ); This does not work, as it seems i am filling the dictionary in a wrong way, when i write a PDF page using this it appears blank. The DictionaryEncoding source code is : Click here Thanks . . .

    Read the article

  • Configurating JOOMLA's e-mail notification for new account

    - by Dion
    I'm using Joomla 1.5 to create a local site for my office. The site will be accessed locally via intranet, and my PC will be the localhost for the site. I'm using a Login pluggin, so that anyone who wanted to enter the site should create an account. In JOOMLA, all user who created their account for the first time will receive a notification e-mail like : "Hello pras, You have been added as a User to Information Center by an Administrator. This e-mail contains your username and password to log in to http://localhost/yaddayadda/ Username: hadisuryo.prasetio Password: xxxx Please do not respond to this message as it is automatically generated and is for information purposes only." but if the user click the URL in the mail, which is, "localhost/yaddayadda/" they will not be directed to my site, but to their own PC's localhost.... My question is : How can I Modified the e-mail or the site configuration so that the URL will not be "localhost/yaddayadda/" anymore, but will be "(My-IP adress)/yaddayadda" I'm not going to host my site to a web hosting service, just using my PC as a host. I've been trying to trace on each config and .ini files...it seems that i have to do something with the "JURI" function or the "$mosConfig_live_site" on the backlink.php file $mosConfig_absolute_path = JPATH_SITE; $mosConfig_live_site = JURI :: base(); $url_array = explode('/', $_SERVER['REQUEST_URI']); Can anyone give me assistance ? Thank You

    Read the article

  • cPanel FTP account access to sym links from parent directory

    - by totbar
    I would like to give a potential developer temporary access to some of my projects. I have almost everything in its own subdomain, and each directory is a sibling to my public_html directory. It looks something like: ("developer" is the cPanel account name.) developer/ *This is the top level directory for the cPanel account. "/home/developer" site1/ *site1.mysite.com site2/ *site2.mysite.com site3/ *site3.mysite.com public_html/ *www.mysite.com ... etc I created a directory inside public_html called tempdev and I added symbolic links to each of the sibling directories listed above. My understanding of cPanel is that I can only assign one user with "Special FTP Access" per domain. I really dont want to give a complete stranger my login creds, (its just a development environment but still). So I used the cPanel FTP account creator UI. It will not allow me to assign the user access to the directories outside of public_html. I cant even give access to public_html either. So I made the tempdev directory in www and created the symlinks. Using the new account, I can see the symlinks, but I can go into them. Is there a better way to accomplish what I am attempting?

    Read the article

  • Ubuntu 12.04 3.2 Kernel showing incorrect "cache size" in cpuinfo?

    - by Tom G
    2x Xeon E5620 . 16 Cores altogether. /proc/cpuinfo shows cache is only @ 4096kb According to intel this should have 12MB of "smart cache". Doing searched for E5620 and CPUinfo shows the correct number: cache size : 12288 KB However mine shows this: processor : 15 v endor_id : GenuineIntel cpu family : 6 model : 44 model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz stepping : 2 microcode : 0x1 cpu MHz : 2400.104 cache size : 4096 KB fpu : yes fpu_exception : yes cpuid level : 11 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx bogomips : 4800.20 clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual Any idea on why it shows like it's missing 8MB in CPU cache? .

    Read the article

  • file system that allow to specify different RAID level per directory and change it afterward

    - by Adam Ryczkowski
    I have 5 hard drives, where I want to keep my data. Some of my files are more important, and some of them are less. So some of them I wish to put on RAID-6, and for some it RAID-5 is sufficient. It is difficult to predict at the moment of creation of the arrays how much space of each type to declare. What I would do if I didn't hear about zfs, is partition the hard drives into identical 100GB partitions, and as my needs grow, assemble those partitions into md devices using linux-raid. Then, I'd combine those devices using lvm into logical volumes where I'd put my data. So when I'd need more space of e.g. RAID-6, I'd take 100GB partition from each hard drive and assemble them into another RAID-6 md device and would use it as physical storage for the logical volume group dedicated for RAID-6 data. Then I could grow the file system on this logical volume. On top of RAID-6 and RAID-5 Volume Groups (managed by lvm) would reside completely independent file systems, which I'd later merge with multiple mount --bind into a single directory structure that would reflect the logical structure of data rather that of the storage. But now, when I heard about the ZFS with all the performance, data-healing and compression capabilities I cannot stop thinking if it can help me. If so, what do you think would be the best setup?

    Read the article

  • Hyper-v dynamic memory client machines always use maximum memory

    - by Eric P
    When I create a virtual machine in Hyper-V and set it up to use dynamic memory, the virtual machine will always use the maximum memory within the virtualized OS. Hyper-V will show the assigned memory at 514mb, but when I log into the server and pull up task manager, it will show 90% memory used. When I bump the maximum memory up to 4gb, I get the same result: 90% memory usage. Nothing is even running on the virtual machine other than a clean instal of Windows Server 2008 R2. I have also tried it with Windows 7 with the same results. Is this the expected behavior or is something setup wrong

    Read the article

  • Scaling a video processing application on EC2?

    - by Stpn
    I am approaching the need to scale a video-processign application that runs on EC2. So far the setup is one machine: Backbonejs frontend Rails 3.2 Postgresql Resque + S3 for storage The flow of the app is as follows: 1) Request from frontend. Upload a video. 2) Storing video 3) Quering external APIs. 4) Processing / encoding videos. 5) Post to frontend. I can separate the backend and frontend without any problems, but when it comes to distributing the backend between several servers I am a bit puzzled. I can probably come up with a temporary solution (like just duplicating apps making several instances), but since I don't really have expertise in backend system administration, there can be some fundamental mistakes.. Also I would rather have something that is scalable. I wonder if anyone can give some feedback on the following plan: A) Frontend machine. Just frontend, talks to backend via REST Api of sorts. B) Backend server (BS), main database. Gets request from 1), posts to 2) saves uploads to 3) C) S3 storage. D) Server for quering APIs. Basically just a Resque workers, that post info back to 2) E) Server for video encoding. Processes videos uploaded on 3) and uploads them back. So I will have: A)frontend \ \ B)MAIN_APP/DB ----- C)S3 Storage (Files) / \ / / \ / D)ExternalAPI_queries E)Video_Processing (redundant DB) (redundant DB) All this will supposedly talk to each other via HTTP requests. My reason for this is that Video Processing part is really the most resource-intensive and I would just run barebones application that accepts requests and starts processing them. Questions: 1) In this setup I will have the main database at B) and all other servers will communicate with it via HTTP requests (and store duplicates of databases also I guess..for safety reasons). Is it the right approach or should I have 1 database that everyone connects to (how then?) 2) Is it a good idea to separate API queries from Video Processing part? Logically they are very close (processing is determined by the result of API queries), but resource-wise Video Processing is waaay more intensive. 3) what should I use to distribute calls between backend apps based on load?

    Read the article

  • I can't access phpmyadmin on ubuntu after successfull installation

    - by Rana
    I have ready LAMP environment on my amazon Ec2 micro instance(Ubuntu). I have installed phpmyadmin distribution of ubuntu. selected apache2 as the server, then selected 'yes' for 'db-common-config' option. after its completed, I suppose to access it via http://server/phpmyadmin, right? But I can't access it. Is there any way to verify whether its been installed properly and running properly plz? Or do I have to do anything further? Thanks in advance.

    Read the article

  • What are some SMART Criteria I can use when comparing "green" datacenters?

    - by makerofthings7
    I'm looking to reduce my carbon footprint and want to find a "green" datacenter. There are so many ways to define a "green datacenter' I'm looking for examples of SMART Criteria such as 20% of power from renewable resources Low Power Usage Effectiveness When it comes to running a green datacenter, what are additional key factors I need to look for? What key words or technologies might those energy efficient datacenters be using?

    Read the article

  • Apache / PHP Begins to Deny SQL Requests after about 2000

    - by Daniel Stern
    We have a web page on our server that we use to run administrative scripts. For example, we might run the script "unenrolStudents()" which runs 5,000 SQL SET commands one after another and sets 5000 student entries in an SQL database to unenrolled. However, we are finding that after running a few thousand queries (it is not totally consistent) we will be "locked out" by our server. SYMPTOMS OF LOCKING OUT: - unable to connect to server with winSCP - opening putty with that connection shows a blank screen (no login / pass) - clearing cookies / cache in chrome does NOT fix locking out - other computers in the office ALSO become locked out - locking out can be triggered with a high frequency of requests (10000 in 1 second) or by less over time (10000 in 500 seconds - this will still cause a lockout even though the frequency is much less) We believe this is a security feature of our own Apache. I know we are using Suhosin but I didn't configure it so I don't know. How can I disable this locking effect so that I can confidently run all my SQL requests and they will go through? Has anyone else dealt with this and found workarounds? Thanks DS

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >