Search Results

Search found 21001 results on 841 pages for 'spelling check'.

Page 172/841 | < Previous Page | 168 169 170 171 172 173 174 175 176 177 178 179  | Next Page >

  • Complex SQL query... 3 tables and need the most popular in the last 24 hours using timestamps!

    - by Stefan
    Hey guys, I have 3 tables with a column in each which relates to one ID per row. I am looking for an sql statement query which will check all 3 tables for any rows in the last 24 hours (86400 seconds) i have stored timestamps in each tables under column time. After I get this query I will be able to do the next step which is to then check to see how many of the ID's a reoccurring so I can then sort by most popular in the array and limit it to the top 5... Any ideas welcome! :) Thanks in advanced. Stefan

    Read the article

  • jQuery to get the text attribute of a checkbox

    - by Andriyev
    Hi I'm adding a check box to a page using the following statement; <script language="C#" runat="server"> protected void Page_Load ( object src, EventArgs e ) { if (!IsPostBack) { CheckBox XChkBox = new CheckBox(); //instance of System.Web.UI.WebControls.CheckBox XChkBox.ID = "someId" XChkBox.Text = "someText" somePlaceHolder.Controls.Add(XChkBox); } } </script> I need to get the Text attribute of that check box on click. I tried $(this).attr('Text'); inside $('input[type=checkbox]').click(function(){}); but it returns undefined. Where am I going wrong? Please suggest. cheers

    Read the article

  • OpenGL/GLSL checking if shader compiled fine on intel cards

    - by clamp
    hello, i am using this code to check if my glsl shader compiled fine. glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength); if (infologLength > 1) { int charsWritten = 0; char * const infoLog = new char[infologLength]; glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog); tError(infoLog, false); delete infoLog; } } the length of the returned string is empty on nvidia and ATI cards, but on intel cards this one returns the string "no errors." now what is the best way to find out, if there are really no errors? should i just check for this string? or is there a convention what this function glGetInfoLogARB should return?

    Read the article

  • Correct algorith for checking leap year

    - by Debanjan
    What will be the exact definition of leap year ? AFAIK "A year which is divisible by 4 is a leap year.But for century years' the years which are divisible by 400 is a leap year." But that definition makes 100, 200, 300, 400.... upto 1700 NOT LEAP years! But in Gregorian calender all of them are all leap year,check this out. You can also try "call 1700" in Linux to verify. So the correct algorithm foe leap year would be if ( (year % 4 == 0) && ( year <= 1700 || year % 100 != 0 || year % 400 == 0 )) printf("%d is a leap year.\n", year); else printf("%d is not a leap year.\n", year); But is this specific to Gregorian calender ? Even if that is the case why is it not mentioned here ? Regards, PS:The history of Gregorian callender seems interesting check out the September month of 1752.

    Read the article

  • Packet Crafting on a Mac

    - by JayCrossler
    I think (based on searching the forums), that NetCat is the best option, but wanted to hear if others are preferable. Anyone have good success with a packet-crafting tool (specifically on Mac)? I've tried HPing, but had some issues. I'm looking into NetCat ('nc' on mac) now, but it's not working as I had thought. Basically, I captured some packets that a remote control sends over a wifi network to turn lights on and off (using X10 controllers), and am looking for a way to replay them by crafting a TCP packet from the command line. I used Wireshark to sniff the traffic, so I know the package is: DEVICE -sendplc-"C4 DIM 10" I'm trying: echo 'DEVICE -sendplc-"C4 DIM 10"' nc 192.168.2.196 6003 but there's no response from the receiving system. The exact bytestream is (if anyone wants to check that I got the right dataframe): 08004642f1b400260897ad6308004500004b08e240004006aaf5c0a802c1c0a802c4d8d7177399aab39 e57ff4753801880ae37ea00000101080a323353ce01b406424445564943457e73656e64706c637e2243 34204f4e220a Next step I'm going to check is to make sure the packet arrives exactly by sniffing and compare it to the original. [EDIT: Also at ServerFault now: Packet Crafting on a Mac, so this one becomes a duplicate across the two sites]

    Read the article

  • Roles / Permissions framework for c#?

    - by mark smith
    Hi there, Does anyone know of a good framework to allow me design permission and roles against users. Basically allowing me to automatically check a user can do a certain thing, and then disabling or enabling menu items etc I am not really looking for asp.net security ... as i need to use it in my own service layer and clients both WEB and WPF will use it. I was hoping for something that allows me to create new roles and groups against users and then check what type of permissions a user has or a group has Any help really appreciated.. I am sure some kind of open source framework is available, well i was hoping not having to create my own Thanks

    Read the article

  • aws-s3 can't find xml-simple, but in gem list

    - by Dan Donaldson
    I'm transitioning to heroku, and need to have AWS-s3 connections to deal with a variety of graphics. I've installed the aws-s3 gem, but one of its dependencies is not being found: xml-simple. My belief is that this is a standard part of RoR, and it is in the gem list. When I deploy to heroku, all is fine, but on my development server, it isn't being found when the code uses it to check the existence of a graphic. It works fine from the console, using s3sh. I'm not quite sure why this is -- what do I need to check? Using OS X 10.6, on a 64 bit machine -- can this be part of it?

    Read the article

  • Help with game development. Render loop?

    - by John
    Hello, I'm working on a simple game, this is my first game project. Most of the samples I find have a Render Loop where all the game logic is made too and I just don't like this. Let's say I have a ball with X=0, and a wall in X=10 and in a slow machine, the first loop places the ball in X=7 and in a second loop, it places the ball in X=14. It would just crash the game! Is this "render loop" the right way to make games? Should I write code to check for things like this in every frame? Example, new frame X=14, last frame have X=7, so I should check if there's anything from X=7 to X=14?? I was thinking that I should have a separated thread for the game logic and in the render loop, I should just "take a snapshot" of the current game logic and display that, no? How do you guys, experienced game developers work around this? thanks!

    Read the article

  • Javascript how many characters replaced in a regex?

    - by macca1
    I am sanitizing an input field and manually getting and setting the caret position in the process. With some abstraction, here's the basic idea: <input type="text" onkeyup"check(this)"> And javascript... function check(element) { var charPosition = getCaretPosition(element); $(element).val( sanitize( $(element).val() ) ); setCaretPosition(element, charPosition); } function sanitize(s) { return s.replace(/[^a-zA-Z0-9\s]/g, ''); } This is working fine except when a character does actually get sanitized, my caret position is off by one. Basically I'd like a way to see if the sanitize function has actually replaced a character (and at what index) so then I can adjust the charPosition if necessary. Any ideas?

    Read the article

  • Tell The Program What To Do When No Save Data Is Found NSUserDefaults, iPhone

    - by Stumf
    Hello all, I have saved data which was saved using NSUserDefaults. I was under the impression that if there was nothing saved to the key already (first time app is run) it would default to 0. This however doesn't seem to be the case. Here is what I have: To save: - (void)viewWillDisappear:(BOOL)animated { [[NSUserDefaults standardUserDefaults] setInteger:setbatteryHealthCalculated forKey:@"healthValue"]; [[NSUserDefaults standardUserDefaults] synchronize]; } To load: - (void) viewWillAppear:(BOOL)animated { NSInteger setbatteryHealthCalculated = [[NSUserDefaults standardUserDefaults] integerForKey:@"healthValue"]; } To check for save value: - (IBAction)check{ NSInteger setbatteryHealthCalculated = [[NSUserDefaults standardUserDefaults] integerForKey:@"healthValue"]; if (setbatteryHealthCalculated = 0) { [self performSelector:@selector(displayAlert) withObject:nil]; }

    Read the article

  • Subversion for version control

    - by Gabriel Parenza
    Hi, I am working on an application whose primary purpose would be to provide source control management. My idea is to use to SVNKit for file check-out and check-in. However, while working with SVNKit, I realised it does not have the speed I was looking for. For instance, whenever developers create a ChangeRequest, which can encompass change in 3-40 files, I have to create a directory structure distributed across 32 folders. Doing so takes around 50 seconds, Another instance is that after creating change request developers can add files to the request. Copying even a single file from Trunk to branch takes around 6-7 secs. My question is has anyone had experience like this and what did you do to improve the performance? Moreover, is my approach correct? NOTE: I am using "http" protocol and can't use "svn" protocol.

    Read the article

  • ASP.NET MVC authorization & permission to use model classes

    - by Tomek
    Hi, This is my first post here, so hello :) Okey, let's get to the point... I am writing my first app in ASP.NET MVC Framework and i have a problem with checking privileges to use instances of model classes (read, edit). Sample code looks like this: // Controller action [CustomAuthorize(Roles="Editor, Admin")] public ActionResult Stats(int id) { User user = userRepository.GetUser(id); if (user == null || !user.Activated || user.Removed) return View("NotFound"); else if (!user.IsCurrentSessionUserOwned) return View("NotAuthorized"); return View(user); } So far authorize attribute protects only controller actions, so my question is: how to make (custom) authorize attribute to check not only user role, usernames but also did i.e. resources instantiated in action methods (above: User class, but there are other ORM objects like News, Photos etc.) All of these object to check have their unique ID's, so user have own ID, News have their ID and UserID field referecned to Users table (i mean these objects are LINQ2SQL classes). How should i resolve that problem?

    Read the article

  • c printing string syntax

    - by user535256
    Hello guys, Just stuck on c syntax regarding strings. Say I have a string like (name[5]="peter";) in c say if I just wanted to print the last character of string or check the last character of the string, which in this case would be 'r' how can I do this? The way I was thinking does not seem to work name[5]="peter"; if(name[5]=="r") printf("last character of name is r"); Question: is there some sort of function to do this that can check one character of array, is a certain value, like name[5] is 'r' in string peter or likewise name[1] is 'n' Also how do I use printf to print that certain char, having problems using printf("last character of name is %s",name[5]) ??? Thanks

    Read the article

  • PerformanceCounterCategory.Exists is very slow if category doesn't exists

    - by Shrike
    I have kind of library which uses a bunch of its own perf counters. But I want my library works fine even if that perf counters weren't installed. So I've created wrappers aroung PerformanceCounter and on the first use check if PerfCounter exists or not. If they exists then I'm using native PerformanceCounter instead I'm using a wrapper which do nothing. So to check perf counter existence I use PerformanceCounterCategory.Exists The problem is that if there isn't such category then PerformanceCounterCategory.Exists call takes (on my machine) about 10 seconds! Needless to say it's too slow. What can I do? Code to try it by youself: using System; using System.Diagnostics; class Program { static void Main(string[] args) { var ts = Stopwatch.StartNew(); var res = PerformanceCounterCategory.Exists("XYZ"); Console.WriteLine(ts.ElapsedMilliseconds); Console.WriteLine("result:" + res); } }

    Read the article

  • Good practices for intialising properties ?

    - by Rubans
    HI, I have a class property that is a list of strings, List. Sometimes this property is null or if it has been set but the list is empty then count is 0. However elsewhere in my code I need to check whether this property is set, so currently my code check whether it's null and count is 0 which seems messy. if(objectA.folders is null) { if(objectA.folders.count == 0) { // do something } } Any recommendation on how this should be handled? Maybe I should always initialise the property so that it's never null? Appolgies if this is a silly question.

    Read the article

  • Remote SQL server connection failure

    - by Sevki
    I am trying to connect to my MSSQL server 2008 web instance and im failing horribly... i get the error 26 and before you jump on me i have done these Check the spelling of the SQL Server instance name that is specified in the connection string. Use the SQL Server Surface Area Configuration tool to enable SQL Server to accept remote connections over the TCP or named pipes protocols. For more information about the SQL Server Surface Area Configuration Tool, see Surface Area Configuration for Services and Connections. Make sure that you have configured the firewall on the server instance of SQL Server to open ports for SQL Server and the SQL Server Browser port (UDP 1434). Make sure that the SQL Server Browser service is started on the server. in addition to theese i have disabled the firewall completely and tried other ports nothing works the same credentials work on the server but not on the client. this is the exact error message A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider) Can anybody help?

    Read the article

  • biginteger calucation prfoblem

    - by murali
    hi i am using the following code but the parameters are not passed to the methods. BigInteger p = BigInteger.valueOf(0); BigInteger u1 = obj.bigi_calc(g1, l); in this g1,l are long values the method is private BigInteger bigi_calc(long g1, long l){ BigInteger cal = BigInteger.valueOf(g1); BigInteger cal1= BigInteger.valueOf(l); for(BigInteger f = BigInteger.ONE;f.compareTo(cal1)>0;f=f.add(BigInteger.ONE)){ //BigInteger p= BigInteger.valueOf(0); p = cal.multiply(cal1); System.out.println("check p"+p); } // System.out.println("check p"+p); return p; } the elipse shows that it may be out of sync.. but the paramerters are not passed to the functions.. can you plz help me to slove this problem

    Read the article

  • Querying current number of touches on screen without using events on iPhone

    - by nikhil
    I have an application that starts playing a sound when user touches the uiview and changing to different tones as the user slides the finger on the screen. The sound stops when the user lifts the finger. I am using the touchesBegan, Moved and Ended Events for this. My problem is touches Ended (and/or cancelled) is sometimes not fired properly and the sound keeps playing even after the finger is lifted from screen. So as a workaround I would like to implement a timer that would check for the number of touches on the screen and if it is zero it will check and stop the audioplayer if playing. I have been searching for some code that could get me the number of touches like UITouch *touches=[self getAllTouchesonScreen]; or something :)

    Read the article

  • Asp.net Website Performance Improvement Checklist

    - by Jordon
    Hello Friends, I have asp.net website name http://www.go4sharepoint.com I have tried almost all ways to improve performance of this site, I have even check firebug and page speed addon on Firefox, but somehow i am not pleased with the result. I also tried like removing whitespace, remove viewstate, optimizing code which renders it, applied GZip, I have also no heavy session variables used, but still when i compare with other popular websites it is not upto the mark. I have check CodeProject website and was surprise that even though they have lot of stuff displayed there website is loading fast and they also have good loading rate. To all experts, Please suggest me where i am going wrong in my development. Thank you.

    Read the article

  • Optimising Database Calls

    - by Dwaine Bailey
    I have a database that is filled with information for films, which is (in turn) read in to the database from an XML file on a webserver. What happens is the following: Gather/Parse XML and store film info as objects Begin Statement For every film object we found: Check to see if record for film exists in database If no film record, write data for film Commit Statement Currently I just test for the existence of a film using (the very basic): SELECT film_title FROM film WHERE film_id = ? If that returns a row, then the film exists, if not then I need to add it... The only problem is, is that there are many many hundreds of records in the database (lots of films!) and because it has to check for the existence of a film in the database before it can write it, the whole process ends up taking quite a while (about 27 seconds for 210 films) Is there a more efficient method of doing this, or just any suggestions in general? Programming Language is Objective-C, database is in sqlite3 Thanks, Dwaine

    Read the article

  • How to use thread in Django

    - by zomboid
    I want to check users' subscribed dates for certain period. And send mail to users whose subscription is finishing (ex. reminds two days). I think the best way is using thread and timer to check dates. But I have no idea how to call this function. I don't want to make a separate program or shell. I want to combine this procedure to my django code. I tried to call this function in my settings.py file. But it seems it is not a good idea. It calls the fucntion and creates thread everytime i imported settings.

    Read the article

  • C++ type-checking at compile-time

    - by Masterofpsi
    Hi, all. I'm pretty new to C++, and I'm writing a small library (mostly for my own projects) in C++. In the process of designing a type hierarchy, I've run into the problem of defining the assignment operator. I've taken the basic approach that was eventually reached in this article, which is that for every class MyClass in a hierarchy derived from a class Base you define two assignment operators like so: class MyClass: public Base { public: MyClass& operator =(MyClass const& rhs); virtual MyClass& operator =(Base const& rhs); }; // automatically gets defined, so we make it call the virtual function below MyClass& MyClass::operator =(MyClass const& rhs); { return (*this = static_cast<Base const&>(rhs)); } MyClass& MyClass::operator =(Base const& rhs); { assert(typeid(rhs) == typeid(*this)); // assigning to different types is a logical error MyClass const& casted_rhs = dynamic_cast<MyClass const&>(rhs); try { // allocate new variables Base::operator =(rhs); } catch(...) { // delete the allocated variables throw; } // assign to member variables } The part I'm concerned with is the assertion for type equality. Since I'm writing a library, where assertions will presumably be compiled out of the final result, this has led me to go with a scheme that looks more like this: class MyClass: public Base { public: operator =(MyClass const& rhs); // etc virtual inline MyClass& operator =(Base const& rhs) { assert(typeid(rhs) == typeid(*this)); return this->set(static_cast<Base const&>(rhs)); } private: MyClass& set(Base const& rhs); // same basic thing }; But I've been wondering if I could check the types at compile-time. I looked into Boost.TypeTraits, and I came close by doing BOOST_MPL_ASSERT((boost::is_same<BOOST_TYPEOF(*this), BOOST_TYPEOF(rhs)>));, but since rhs is declared as a reference to the parent class and not the derived class, it choked. Now that I think about it, my reasoning seems silly -- I was hoping that since the function was inline, it would be able to check the actual parameters themselves, but of course the preprocessor always gets run before the compiler. But I was wondering if anyone knew of any other way I could enforce this kind of check at compile-time.

    Read the article

  • How to tell if a user is a fan of the fan page

    - by Dominic Godin
    Hi, I'm working on a FBML fan page for a client. I need to perform a check to see if the current user is a fan of the page. I tried using the JavaScript API but I've found this is not compatible with FBML. I have looked through the FBML page on the developer wiki and found checks for practically everything else but no is user fan check. Any pointers in the right direction would be most appreciated. Thanks in advance.

    Read the article

< Previous Page | 168 169 170 171 172 173 174 175 176 177 178 179  | Next Page >