Search Results

Search found 770 results on 31 pages for 'mid'.

Page 20/31 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Mysql query - problem with order by

    - by Sergio
    I'm using two tables for selecting messages between users. Table "messages" for recording the messages and table "members" for checking users data (are they activ or deleted). This query working fine. What I need to do is list the received messsages order by last received. I tried to do with "ORDER BY messages.id DESC" at the end of this query but it didn't work. All messages are listed from first received. This is the mysql join table query that I'm using: sql = "select distinct messages.fromid, messages.readed, messages.fromid, messages.toid, members.id as pid From messages Inner Join members on members.id = messages.fromid Where messages.toid = ".$mid." AND members.status = 7 AND messages.kreaded !='1' AND messages.subject != 'readed' GROUP BY fromid" Is there any way to do this?

    Read the article

  • How bad is opening and closing a SQL connection for several times? What is the exact effect?

    - by Eren
    For example, I need to fill lots of DataTables with SQLDataAdapter's Fill() method: DataAdapter1.Fill(DataTable1); DataAdapter2.Fill(DataTable2); DataAdapter3.Fill(DataTable3); DataAdapter4.Fill(DataTable4); DataAdapter5.Fill(DataTable5); .... .... Even all the dataadapter objects use the same SQLConnection, each Fill method will open and close the connection unless the connection state is already open before the method call. What I want to know is how does unnecessarily opening and closing SQLConnections affect the performance of the application. How much does it need to scale to see the bad effects of this problem (100,000s of concurrent users?). In a mid-size website (daily 50000 users) does it worth bothering and searching for all the Fill() calls, keeping them together in the code and opening the connection before any Fill() call and closing afterwards?

    Read the article

  • Error(2,7): PLS-00428: an INTO clause is expected in this SELECT statement

    - by omgzor
    I'm trying to create this trigger and getting the following compiler errors: create or replace TRIGGER RESTAR_PLAZAS AFTER INSERT ON PLAN_VUELO BEGIN SELECT F.NRO_VUELO, M.CAPACIDAD, M.CAPACIDAD - COALESCE(( SELECT count(*) FROM PLAN_VUELO P WHERE P.NRO_VUELO = F.NRO_VUELO ), 0) as PLAZAS_DISPONIBLES FROM VUELO F INNER JOIN MODELO M ON M.ID = F.CODIGO_AVION; END RESTAR_PLAZAS; Error(2,7): PL/SQL: SQL Statement ignored Error(8,5): PL/SQL: ORA-00933: SQL command not properly ended Error(8,27): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe Error(2,1): PLS-00428: an INTO clause is expected in this SELECT statement What's wrong with this trigger?

    Read the article

  • BASH SHELL IF ELSE run command in background

    - by bikerben
    I have used the & command before to make a script run another script in the background like so: #!/bin/bash echo "Hello World" script1.sh & script2.sh & echo "Please wait..." But lets say I have another script with an IF ELSE statment and I would like to set an ELIF statement mid flow as a background task witht the & and then carry on with processing the rest of my script knowing that while rest of the ELIF will carry running in the back ground: #!/bin/bash if cond1; then stuff sleep 10 & stuff stuff elif cond2; then something else else echo "foo" fi stuff echo "Hello World" I really hope this makes sense any help would be greatly appreciated.

    Read the article

  • Scanning FedEx labels into a visual basic program

    - by 0bfus
    I have a program that has tracking numbers entered into it and it stores them in a database and i would like to add a scanner to the mix. The scanner is acting like a keyboard and scannes just fine, the problem is scanning a FedEx number gives a 32 digit number and i am only iterested in the tracking number portion of it. I saw an example on the web for an excel macro and tried to modify it but it doesnt seem to work. Is there something i could do to just get the 12 digit number? This is what it looks like so far. Any help would be greatly appreciated. With BarcodeText If .Text < "1z99999999999999999" Then .Text = Mid(.Text, 17, 12) End If

    Read the article

  • Using DAO's or static methods in Domain Object with nHibernate

    - by mickyjtwin
    I am using nHibernate for the first time, and after alot of reading/researching, plus looking at other projects done with nHibernate, have seen a couple of implementation practices. I am looking for opinions about which would be best to use and why. Essentially the two methods are as follows: Using Data Access Objects and a DAO Factory. Example usage: INotificationListDAO nListDAO = NHDaoFactory.GetNotificationListDAO(); NotificationList list = nListDAO.GetByListID(""); Use Static methods in the Domain Object. Example usage: NotificationList list = NotificationList.GetByListID(""); NHHelper.Session.Get(id); NHHelper.Session basically calls the NHibernateSessionManager.Instace.GetSessionFrom(""). While both look similar, it is more to do with best practice. From what I understand, the first option is more so if you are developing enterprise level applications, where my requirements are more for mid-range websites.

    Read the article

  • How to get last 12 digits from a sting in MySQL?

    - by Nick Gorbikoff
    Hello. How would I get last 12 digits of a string using mysql? Let's say I have a varchar field with a tracking number, that may be anywhere from 5 to 20 varchars long. But I only need to select last 12 digits or less if there are less. so in a field = 12345678123456789012 I would only need to get what's in brackets field = 12345678[123456789012] I saw a few examples using mid, etc, but they dont' produce the desired result or I can't find an example that makes sense :-( Thank you.

    Read the article

  • Is there a semantic difference <span>'s and <div>'s?

    - by DavidR
    I know when coding HTML, I'm supposed to keep semantics in mind, e.g., h1 needs to be a main header, h2 needs to be a subheader, tables need to be tables, use <em> for emphasis instead of <i>, etc. Is there a proper difference between divs and spans except one is a block and the other is in-line? When I was learning I was told that <span>'s were for styling text mid-line. If I had a small blurb of text that I needed positioned at a certain point in my webpage, one that doesn't warrent a <p> tag, would I use a span should I stick with div's? What if that text needs to cover two lines (i.e., it needs a width) if it contains nothing but text, what should I use?

    Read the article

  • glBlendFunc() with 32-bit RGBA textures

    - by oldSkool
    I have a texture that is semi-transparent with varying opacity at different locations. I have the main texture bitmap, and a mask bitmap. When the program executes, the alpha values from the mask bitmap are loaded into the alpha values of the main texture bitmap. The areas that I want to be transparent have a value of 255 alpha, and the areas that I want to remain totally opaque have values of 0 alpha. There are in-between values also for mid-transparency. I have tried all manner of glBlendFunc() settings, but it is either completely invisible or it acts on the RGB colors of the source texture. Any help out there?

    Read the article

  • Rails test across multiple environments

    - by DSimon
    Is there some way to change Rails environments mid-way through a test? Or, alternately, what would be the right way to set up a test suite that can start up Rails in one environment, run the first half of my test in it, then restart Rails in another environment to finish the test? The two environments have separate databases. Some necessary context: I'm writing a Rails plugin that allows multiple installations of a Rails app to communicate with each other with user assistance, so that a user without Internet access can still use the app. They'll run a local version of an app, and upload their work to the online app by saving a file to a thumbdrive and taking it to an Internet cafe. The plugin adds two special environments to Rails: "offline-production" and "offline-test". I want to write functional tests that involve both the "test" and "offline-test" environments, to represent the main online version of the app and the local offline version of the app respectively.

    Read the article

  • Do I need to syncronize thread access to an int

    - by Martin Harris
    I've just written a method that is called by multiple threads simultaneously and I need to keep track of when all the threads have completed, the code uses this pattern: private void RunReport() { _reportsRunning++; try { //code to run the report } finally { _reportsRunning--; } } This is the only place within the code that _reportsRunning's value is changed, and the method takes about a second to run. Occasionally when I have more than six or so threads running reports together the final result for _reportsRunning can get down to -1, if I wrap the calls to _runningReports++ and _runningReports-- in a lock then the behaviour appears to be correct and consistant. So, to the question: When I was learning multithreading in C++ I was taught that you didn't need to synchronize calls to increment and decrement operations because they were always one assembly instruction and therefore it was impossible for the thread to be switched out mid-call. Was I taught correctly, and if so how come that doesn't hold true for C#?

    Read the article

  • best method for background uploader in Android

    - by Dr.Dredel
    Problem: I want to write a process that will allow a user to take photos with the device and for those photos to then be uploaded to some listener in the cloud. The user should not have to do anything to initiate the upload, a background listener would just watch the folder and as long as it finds files in it it would upload them and delete them. Two problems: 1) how to keep the program running in the background even after the user is no longer taking pictures (and if they reboot the device for it to wake up and finish the uploads, if any remain) 2) assuming the connection is spotty (as it always is) how to verify that a given image has completed its upload, and if not, to resubmit it. I don't need any code examples, I just would like opinions on the best strategy to get this implemented. I was going to use Apache commons and just do an upload to a PHP, but am not sure what sort of error checking exists to take into account a connection drop mid file. TIA.

    Read the article

  • Free icons for mobile applications. Where?

    - by Geltrude
    I know that in the sdk folders I can find some (not very well grouped, imho) icon. But, there is a site online specialized that let you download free icons useful for mobile app? Ie world flags, up, down... save, revert..., next..., play, stop..., etc. It would be more appriciated also if you can find these sets in many different colors, and in 2 or 3 sizes (32x32, 64x64, etc.). Have a nice day (ot. Especially my mom - her 62 birthday :-) Edit: those are all good sites, but to green-check the answer I need a small set with the common icons (I think moreabout 50-70 icons), in many different colors and in 2 or 3 different sizes (for lo-mid-hi definition devices). - If a so done site exists for free :-)

    Read the article

  • Get Element with jQuery .on()

    - by Gabriel Ryan Nahmias
    If I'm using jQuery's .on() function like this (there's more to it but this is the main problem area extracted): $(document).on("click", $("#contcont a, #leftnav li a, #leftnav li ul a, #mainarea-home a").not(".secitem-mid a") , function clicker(event, sData) { var $this = $(this); sHREF = $this.attr("href"); alert(sHREF); } ); I'm getting undefined so what would be the best way to actually get the element that's being clicked? I need .on() so that it always occurs, obviously, instead of having to attach it to all the elements every time new data is loaded (this is through Yahoo! stores so it's a necessity to do it this way). Thanks.

    Read the article

  • How to get last 12 digits from a string in MySQL?

    - by Nick Gorbikoff
    Hello. How would I get last 12 digits of a string using mysql? Let's say I have a varchar field with a tracking number, that may be anywhere from 5 to 20 varchars long. But I only need to select last 12 digits or less if there are less. so in a field = 12345678123456789012 I would only need to get what's in brackets field = 12345678[123456789012] I saw a few examples using mid, etc, but they dont' produce the desired result or I can't find an example that makes sense :-( Thank you.

    Read the article

  • how to calculate the beginning of a day given milliseconds?

    - by conman
    i want to figure out the time from the beginning of the day given a days milliseconds. so say i'm given this: 1340323100024 which is like mid day of 6/21/2012. now i want the milliseconds from the beginning of the day, which would be 1340262000000 (at least i think that's what it's supposed to be.) how do i get 1340262000000 from 1340323100024? i tried doing Math.floor(1340323100024/86400000) * 86400000 but that gives me 1340236800000, which if i create a date object out of it, says its the 20th. i know i can create a date object from 1340323100024, then get the month, year, and date, to create a new object which would give me 1340262000000, but i find it ridiculous i can't figure out something so simple. any help would be appreciated. btw, i'm doing this in javascript if it makes any difference.

    Read the article

  • Help need to convert this code to C#

    - by Raj Aththanayake
    I 'm not familiar with VB.NET at all. I need to convert this function to C#. Can anyone please give me a hand? Public Function GetAppGUID(ByVal sectionId As String) As String Dim hexString As String = Nothing Dim i As Integer Dim guidlen As Integer guidlen = 16 If sectionId.Length < guidlen Then sectionId = sectionId & New String(" ".Chars(0), guidlen - sectionId.Length) End If For i = 1 To guidlen hexString = hexString & Hex(Asc(Mid(sectionId, i, 1))) Next GetAppGUID = hexString End Function

    Read the article

  • ASP SaveToDisk method takes an incredible amount of time

    - by burnt_hand
    This is a method in ASP Classic that saves a file to disk. It takes a very long time but I'm not sure why. Normally, I wouldn't mind so much, but the files it handles are pretty large so need this needs to faster than 100kB a second save. Seriously slow. (old legacy system, band aid fix till it gets replaced...) Public Sub SaveToDisk(sPath) Dim oFS, oFile Dim nIndex If sPath = "" Or FileName = "" Then Exit Sub If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\" '" Set oFS = Server.CreateObject("Scripting.FileSystemObject") If Not oFS.FolderExists(sPath) Then Exit Sub Set oFile = oFS.CreateTextFile(sPath & FileName, True) For nIndex = 1 to LenB(FileData) oFile.Write Chr(AscB(MidB(FileData,nIndex,1))) Next oFile.Close End Sub I'm asking because there are plenty of WTF's in this code so I'm fighting those fires while getting some help on these ones.

    Read the article

  • Greasemonkey,jquery and elements from links to new link

    - by Bulfen
    Hi all, I'm pretty new to jquery and greasemonkey. So if someone could help me out it would be great. Here is an example url I get values from. Org: http://www.example.com/index.php?value1=blabla1&sid=blabla2&mid=blabla3 Result I want: link://www.example.com/blabla1/data/blabla2/blabla3.ext example: var sid=document.URL.substring(document.URL.indexOf('sid=')+15); // How do I set the lenght of blabla2 ? -7 ? Anyway, Hopefully someone understand what I mean and can help me out alittle.

    Read the article

  • Porting existing code from C# 2.0 to C#3.0 and .Net 3.5 (possibly .net 4.0)

    - by kanad
    Our one and only enterprise application suite has been developed over last 3 years using C# 2.0 on .Net 3.0. We use winforms and WCF heavily. The development tools is VS 2005 Pro / TFS 2005 / Resharper 3.1 As technical lead I obviously understand the benefits in a move to C#3.0 and .Net 3.5. But I want to convince management for a move to C#3.0, .Net 3.5, VS 2008 and TFS 2008. They will obviously be interested in things like productivity, cost, quality etc. Please suggest me some ideas on how best to make my case. Given that this may not happen till mid next year am I better off to hold till VS 2010 and .Net 4.0 is out.

    Read the article

  • What happens when a OSGi service using JNI is unregistered while in use?

    - by schngrg
    As I understand, OSGi services can be unregistered anytime, including when they are in use. Consider an OSGi service which internally makes a long-running JNI call. And while that JNI call is executing, the service is unregistered by OSGi. Will the JNI call be allowed to finish or terminated mid-way? What if it was just a normal non-jni long running Java call? Will that call be allowed to finish execution or will OSGi terminate everything immediately and unregister? What is the expected behavior in such a case? Does the expected behavior depend on if the service was loaded using a 'tracker' or not? SG

    Read the article

  • What's the status of the HTML 5 <video> tag and webcam integration?

    - by JorenB
    Even though it seems to be in some kind of jeopardy, the open video standard is a great idea. I saw some demos on motion tracking with it - just proofs-of-concept, but interesting nonetheless. Now, I'd say that concepts like these would really be a gain, if there would be access to the user's webcam... Just imagine browsing through Flickr with your hands in mid-air. I have Googled a little, but I can't find any detailed discussion on the subject. It is mentioned in some places, but that doesn't get me very far. Does anybody know whether support for this is planned? If yes, any prognosis on the 'when'? ;-) Of course, I guess they'd have to dream up a pretty good security model for it...

    Read the article

  • SqlDataAdapter.Fill suddenly taking a long time

    - by WraithNath
    I have an application with a central DataTier that can execute a query to a data table using an SQLDataAdapter. None of this code has changed but now all queries are taking at least 10x as long to execute a query returning even one record. The only difference is that I have been using the app in a VM but the issue has started mid way through using the application. eg, the speed issue has not manifested itself from the start of using the VM, rather half way through. Has anyone else had an issue with the SQL Data Adapter taking a long time to fill for no reason? executing the query in Management studio it runs in less than a second. Firewalls are disabled

    Read the article

  • PHP setcookie warning

    - by Ranking
    Hello guys, I have a problem with 'setcookie' in PHP and I can't solve it. so I receive this error "Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\VertrigoServ\www\vote.php:14) in C:\Program Files\VertrigoServ\www\vote.php on line 86" and here is the file.. line 86 is setcookie ($cookie_name, 1, time()+86400, '/', '', 0); is there any other way to do this ?? <html> <head> <title>Ranking</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#EEF0FF"> <div align="center"> <br/> <div align="center"><div id="header"></div></div> <br/> <table width="800" border="0" align="center" cellpadding="5" cellspacing="0" class="mid-table"> <tr><td height="5"> <center> <table border="0" cellpadding="0" cellspacing="0" align="center" style="padding-top:5px;"> <tr> <td align="center" valign="top"><img src="images/ads/top_banner.png"></td> </tr> </table> </center> </td></tr> <tr><td height="5"></td></tr> </table> <br/> <?php include "conf.php"; $id = $_GET['id']; if (!isset($_POST['submitted'])) { if (isset($_GET['id']) && is_numeric($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $query = mysql_query("SELECT SQL_CACHE id, name FROM s_servers WHERE id = $id"); $row = mysql_fetch_assoc($query); ?> <form action="" method="POST"> <table width="800" height="106" border="0" align="center" cellpadding="3" cellspacing="0" class="mid-table"> <tr><td><div align="center"> <p>Code: <input type="text" name="kod" class="port" /><img src="img.php" id="captcha2" alt="" /><a href="javascript:void(0);" onclick="document.getElementById('captcha2').src = document.getElementById('captcha2').src + '?' + (new Date()).getMilliseconds()">Refresh</a></p><br /> <p><input type="submit" class="vote-button" name="vote" value="Vote for <?php echo $row['name']; ?>" /></p> <input type="hidden" name="submitted" value="TRUE" /> <input type="hidden" name="id" value="<?php echo $row['id']; ?>" /> </div></td></tr> <tr><td align="center" valign="top"><img src="images/ads/top_banner.png"></td></tr> </table> </form> <?php } else { echo '<font color="red">You must select a valid server to vote for it!</font>'; } } else { $kod=$_POST['kod']; if($kod!=$_COOKIE[imgcodepage]) { echo "The code does not match"; } else { $id = mysql_real_escape_string($_POST['id']); $query = "SELECT SQL_CACHE id, votes FROM s_servers WHERE id = $id"; $result = mysql_query($query) OR die(mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $votes = $row['votes']; $id = $row['id']; $cookie_name = 'vote_'.$id; $ip = $_SERVER['REMOTE_ADDR']; $ltime = mysql_fetch_assoc(mysql_query("SELECT SQL_CACHE `time` FROM `s_votes` WHERE `sid`='$id' AND `ip`='$ip'")); $ltime = $ltime['time'] + 86400; $time = time(); if (isset($_COOKIE['vote_'.$id]) OR $ltime > $time) { echo 'You have already voted in last 24 hours! Your vote is not recorded.'; } else { $votes++; $query = "UPDATE s_servers SET votes = $votes WHERE id = $id"; $time = time(); $query2 = mysql_query("INSERT INTO `s_votes` (`ip`, `time`, `sid`) VALUES ('$ip', '$time', '$id')"); $result = mysql_query($query) OR die(mysql_error()); setcookie ($cookie_name, 1, time()+86400, '/', '', 0); } } } ?> <p><a href="index.php">[Click here if you don't want to vote]</a></p><br/> <p><a href="index.php">Ranking.net</a> &copy; 2010-2011<br> </p> </div> </body> </html> Thanks a lot!

    Read the article

  • Friday Fun: Play 3D Rally Racing in Google Chrome

    - by Asian Angel
    Are you a racing fan in need of a short (or long) break from work? Then get ready to enjoy a mid-day speed boost with the 3D Rally Racing extension for Google Chrome. 3D Rally Racing in Action This is the opening screen for 3D Rally Racing. You can start game play, view current best times, and read through the instructions from here. The first thing that you should do is have a quick look at the instructions to help you get set up and started. Click on “Play” to start the process. Before you can go further you will need to choose a “User Name”. Once you have done that click “Select Track”… Note: The extension will retain your name for later use even if you close your browser. When you first start out you will only have access to two tracks…the others require reaching a certain score/level to unlock them. Once you select a track you will be taken to the next screen. After you have selected a track you will need to choose your car and car color. All that is left to do afterwards is click on “Go Race”. Note: You will be competing against three other vehicles in the race. Here is a look at the “Desert Race Track”… And a look at the “Snow Race Track”. This game moves quickly and it is easy to fall behind if you are not careful! You can have a lot of fun playing this game while you are waiting for the day to end. Conclusion If you love racing games and want a fun way to waste the rest of afternoon at work, then you should definitely give 3D Rally Racing a try. Links Download the 3d Rally Racing extension (Google Chrome Extensions) Similar Articles Productive Geek Tips Friday Fun: Uphill RushFriday Fun: Racing Fun with SuperTuxKart RacerHow to Make Google Chrome Your Default BrowserEnable Vista Black Style Theme for Google Chrome in XPIncrease Google Chrome’s Omnibox Popup Suggestion Count With an Undocumented Switch TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 PCmover Professional Enable Check Box Selection in Windows 7 OnlineOCR – Free OCR Service Betting on the Blind Side, a Vanity Fair article 30 Minimal Logo Designs that Say More with Less LEGO Digital Designer – Free Create a Personal Website Quickly using Flavors.me

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >