Search Results

Search found 2396 results on 96 pages for 'alex nauda'.

Page 86/96 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • Java / MySQL - How to access connection from another class?

    - by Alex
    I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket. I'm not even sure if they both need separate classes, but here's what I have so far: http://pastebin.com/qzMFFTrY (it wouldn't all go in a code tag) The variable I need is con for line 86.

    Read the article

  • How do I send this email in Python, opening files and stuff?

    - by alex
    msg = EmailMessage(subject, body, from_email, [to_email]) msg.content_subtype = "html" msg.send() This is how I send an email in Django. But what if I want to open a text file and take into account all its line breaks and tabs. I want to take the body of the text file (with line breaks \n) and email it as text of the "body".

    Read the article

  • SElinux integrety check

    - by Alex
    How can i check (with SELinux) access to the file by process name? For examle: we have 2 process: * /usr/bin/foo1 * /usr/bin/foo2 They are run under account with username userA and try to open for modify file: /home/userA/test.txt I want that if foo1 try to open file - it's ok. But if foo2 try to open this file - i have message about this in /var/log Problem is that both processes have the same user ID. And i cant use RBAC by username.

    Read the article

  • Are there actually lag times to remove an email address from "the system"? [closed]

    - by Alex Gosselin
    For example, you send an unsubscribe message to a legitimate company or a spam, they reply that they will remove you and it may take up to 72 hours to take effect. I find it hard to believe anything that simple could take more than 3/4 of a second to take effect system wide. Another example would be when you call the visa activation line, there is a "delay" of several minutes while they try to sell you some kind of insurance. Usually just as you get the point across that you don't want it they will tell you your card has been activated and let you go. Are these delays real?

    Read the article

  • Remove a character from a given position on Oracle

    - by alex
    Is there anyway to remove a character from a given position? Let's say my word is: PANCAKES And I want to remove the 2nd letter (in this case, 'A'), so i want PNCAKES as my return. Translate doesnt work for this. Replace doesnt work for this. Regex is damn complicated... Ideas?

    Read the article

  • How to make UPDATE queries in LINQ to SQL?

    - by Alex
    I like using LINQ to SQL. The only problem is that I don't like the default way of updating tables. Let's say I have the following table with the following columns: ID (primary key), value1, value2, value3, value4, value5 When I need to update something I call UPDATE ... WHERE ID=@id LINQ to SQL call UPDATE ... WHERE ID=@id and value1=@value1 and value2=@value2 and value3=@value3 and value4=@value4 and value5=@value5 I can override this behavior by adding UpdateCheck=UpdateCheck.Never to every column, but with every update of the DataContext class with the GUI, this will be erased. Is there any way to tell LINQ to use this way of updating data?

    Read the article

  • What is most efficient way of setting row to zeros for a sparce scipy matrix?

    - by Alex Reinking
    I'm trying to convert the following MATLAB code to Python and am having trouble finding a solution that works in any reasonable amount of time. M = diag(sum(a)) - a; where = vertcat(in, out); M(where,:) = 0; M(where,where) = 1; Here, a is a sparse matrix and where is a vector (as are in/out). The solution I have using Python is: M = scipy.sparse.diags([degs], [0]) - A where = numpy.hstack((inVs, outVs)).astype(int) M = scipy.sparse.lil_matrix(M) M[where, :] = 0 # This is the slowest line M[where, where] = 1 M = scipy.sparse.csc_matrix(M) But since A is 334863x334863, this takes like three minutes. If anyone has any suggestions on how to make this faster, please contribute them! For comparison, MATLAB does this same step imperceptibly fast. Thanks!

    Read the article

  • mysql connect error issue

    - by Alex
    I've php page which update Mysql Db. I don't understand why my following php code is saying that "Could not update marker. No database selected". Strange!! can you please tell me why it's showing error message. Thanks. Php code: <?php // database settings $db_username = 'root'; $db_password = ''; $db_name = 'parkool'; $db_host = 'localhost'; //mysqli $mysqli = new mysqli($db_host, $db_username, $db_password, $db_name); if (mysqli_connect_errno()) { header('HTTP/1.1 500 Error: Could not connect to db!'); exit(); } ################ Save & delete markers ################# if($_POST) //run only if there's a post data { //make sure request is comming from Ajax $xhr = $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'; if (!$xhr){ header('HTTP/1.1 500 Error: Request must come from Ajax!'); exit(); } // get marker position and split it for database $mLatLang = explode(',',$_POST["latlang"]); $mLat = filter_var($mLatLang[0], FILTER_VALIDATE_FLOAT); $mLng = filter_var($mLatLang[1], FILTER_VALIDATE_FLOAT); $mName = filter_var($_POST["name"], FILTER_SANITIZE_STRING); $mAddress = filter_var($_POST["address"], FILTER_SANITIZE_STRING); $mId = filter_var($_POST["id"], FILTER_SANITIZE_STRING); /*$result = mysql_query("SELECT id FROM test.markers WHERE test.markers.lat=$mLat AND test.markers.lng=$mLng"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } $row = mysql_fetch_row($result); $id=$row[0];*/ //$output = '<h1 class="marker-heading">'.$mId.'</h1><p>'.$mAddress.'</p>'; //exit($output); //Update Marker if(isset($_POST["update"]) && $_POST["update"]==true) { $results = mysql_query("UPDATE parkings SET latitude = '$mLat', longitude = '$mLng' WHERE locId = '94' "); if (!$results) { //header('HTTP/1.1 500 Error: Could not Update Markers! $mId'); echo "coudld not update marker." . mysql_error(); exit(); } exit("Done!"); } $output = '<h1 class="marker-heading">'.$mName.'</h1><p>'.$mAddress.'</p>'; exit($output); } ############### Continue generating Map XML ################# //Create a new DOMDocument object $dom = new DOMDocument("1.0"); $node = $dom->createElement("markers"); //Create new element node $parnode = $dom->appendChild($node); //make the node show up // Select all the rows in the markers table $results = $mysqli->query("SELECT * FROM parkings WHERE 1"); if (!$results) { header('HTTP/1.1 500 Error: Could not get markers!'); exit(); } //set document header to text/xml header("Content-type: text/xml"); // Iterate through the rows, adding XML nodes for each while($obj = $results->fetch_object()) { $node = $dom->createElement("marker"); $newnode = $parnode->appendChild($node); $newnode->setAttribute("name",$obj->name); $newnode->setAttribute("locId",$obj->locId); $newnode->setAttribute("address", $obj->address); $newnode->setAttribute("latitude", $obj->latitude); $newnode->setAttribute("longitude", $obj->longitude); //$newnode->setAttribute("type", $obj->type); } echo $dom->saveXML();

    Read the article

  • Get page url using javascript

    - by Alex
    Hello, could some one recommend a way to get page name from a url using JavaScript? For instance if I have http://www.cnn.com/news/1234/news.html?a=1&b=2&c=3 I just need to get "news.html" string Thanks!

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >