Search Results

Search found 639 results on 26 pages for 'literal'.

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

  • When should I use static variables with primitive types?

    - by Felipe Cypriano
    Recently I came across the question NSString: Why use static over literal? and in the comments arrived a new question. In Objective-C there some "special" types that are just maps to C primitives. Like the NSInteger. #if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 typedef long NSInteger; #else typedef int NSInteger; #endif I know how to use the static keywords for objects but I don't understand the implications on C primitive types. When should I use a static NSInteger x instead of NSInteger x? What happens with the memory in both cases?

    Read the article

  • Querying Literals in Entity SQL

    Entity SQL might surprise you if you are building query expressions with some non-string types. Ive blogged about this before with the DateTime literal after trying to use a string to represent the date in my query as Im used to with TSQL. Here is a snip from that post: SELECT VALUE BAModel.Contact(c.ContactID,c.FirstName,c.LastName,c.Title,c.AddDate,c.ModifiedDate) FROM dbo.Contact as c WHERE c.AddDate>="1/1/2007" I was trying to emulate T-SQL here but I need...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How to move a line of sprites in a sine wave?

    - by electroflame
    So, I'm spawning a horizontal line of enemies that I would like to have move in a nice wave. Currently I tried: Enemy.position.X += Enemy.velocity.X; Enemy.position.Y += -(float)Math.Cos(Enemy.position.X / 200) * 5; This...kind of works. But the wave is not a true wave. The top and bottom of one pass are not the same (e.g. 5 for the top, and -5 for the bottom (I don't mean literal points, I just meant that it's not symmetrical)). Is there a better way to do this? I would like the whole line to move in a wave, so it looks fluid. By that, I mean that it should look like each enemy is "following" the one in front of it. The code I posted does have this fluidity to it, but like I said, it's not a perfect wave. Any ideas? Thanks in advance.

    Read the article

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    Hi to every one. I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific apis. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in wich case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program? thanks in advance, and looking forward to see your considerations.

    Read the article

  • "A", "an", and "the" in method and function names: What's your take?

    - by Mike Spross
    I'm sure many of us have seen method names like this at one point or another: UploadTheFileToTheServerPlease CreateATemporaryFile WriteTheRecordToTheDatabase ResetTheSystemClock That is, method names that are also grammatically-correct English sentences, and include extra words purely to make them read like prose. Personally, I'm not a huge fan of such "literal" method names, and prefer to be succint, while still being as clear as possible. To me, words like "a", "an", and "the" just look plain awkward in method names, and it makes method names needlessly long without really adding anything useful. I would prefer the following method names for the previous examples: UploadFileToServer CreateTemporaryFile WriteOutRecord ResetSystemClock In my experience, this is far more common than the other approach of writing out the lengthier names, but I have seen both styles and was curious to see what other people's thoughts were on these two approaches. So, are you in the "method names that read like prose" camp or the "method names that say what I mean but read out loud like a bad foreign-language-to-English translation" camp?

    Read the article

  • Checking whether the user input is a str in Python [migrated]

    - by Sahil Babbar
    I checked various questions on Stack Overflow but one thing every logic lacks. Let me demonstrate using Python: while True: user_input = raw_input() if type(user_input) == str: print 'ERROR' else: print 'BINGO' Also, we cannot use input() in place of raw_input() as it gives the error:Traceback (most recent call last): File ".\test.py", line 3, in <module> user_input = int(input()) File "<string>", line 1, in <module> NameError: name 'asdf' is not defined The problem here is that raw_input converts the user input into string so it always prints 'ERROR' and if I change the second line to user_input = int(raw_input) then, it gives an error: Traceback (most recent call last): File ".\test.py", line 3, in <module> user_input = int(raw_input()) ValueError: invalid literal for int() with base 10: 'asdf' I tried this with try and except but it shall work fine to check integer but not a string. I feel that this question may be marked as a duplicate but I think that this query is important, if logically taken.

    Read the article

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific APIs. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in which case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program?

    Read the article

  • How to Do htaccess 301 Redirect from Old Filename Pattern to New Filename Pattern?

    - by user249493
    I have a bunch of old files prefixed with "old-" (e.g. "old-abcde.php"). I need an htaccess rule to set up a 301 redirect so that any request for a file starting with "old-" goes to its corresponding new version (e.g. "abcde.php"). To be clear, I have many files, not just one, so I can't do a literal filename match. I basically just need to strip off the "old-" from request and redirect to the version without it. I know I probably just need a simple regular expression, but I'm not good at writing them. Can anyone provide assistance?

    Read the article

  • Where to find current information on quality of released games as software products?

    - by Tom
    As a gamer, one thing I have learned I need to be savvy about is knowing whether SomeBigGame is actually unstable or otherwise problematic as a piece of software (riddled with invasive DRM products, only runs well on a particular video driver version, crashes on non-English-language systems, etc.). I know that game news media can sometimes be relied upon to report on some problems, but I doubt they bother to cover smaller or indie titles. An example: I've started playing Transformice on Kongregate, and I'm considering installing the downloadable client (it is an online multiplayer game). The part of me that cares about data privacy and maintaining a clean-and-healthy PC wants to know whether there is a place I can check to find out more about a title-as-software than "it is not a literal virus." Put another way: where would you not want to see your game receive lots of attention?

    Read the article

  • VS2010 Extension like Smart Paster?

    - by Eric J.
    Alex Papadimoulis' Smart Paster is a great little tool that can paste text in programmer-friendly ways (e.g. as a StringBuilder, as a language-specific string literal, etc.). However, it doesn't seem to be available for VS2010. Anyone know of a similar extension or of plans to port Smart Paster?

    Read the article

  • javascript regular expression search a pattern A(xyz).

    - by Paul
    I need to find all substrings from a string that starting with a given string following with a left bracket and then any legal literal and then the right bracket. For example, a string is abcd(xyz)efcd(opq), I want to a function that returns "cd(xyz)" and "cd(opq)". I wrote a regular expression, but it returns only cd( and cd(...

    Read the article

  • Iphone-exif 0.91 not working when I add it to my project, gives error ".objc_class_name_EXFJpeg", r

    - by user295944
    When I add libiphone-exif.a to snapandrun in objectiveflickr I get this error: ".objc_class_name_EXFJpeg", referenced from: literal-pointer@__OBJC@__cls_refs@EXFJpeg in SnapAndRunViewController.o ld: symbol(s) not found collect2: ld returned 1 exit status I do not know what this means, I follow the guide to add it, add all of the .h files and the libiphone-exif.a Is there something special I have to do?

    Read the article

  • Oracle 10gR2 CLOB Data type

    - by Dhiv
    I am having table with clob column & trying to insert SIGNED character data which contains =176048 characters, it throws error has Insert exception data transaction java.sql.SQLException: ORA-01704: string literal too long

    Read the article

  • Render an asp.net control from a text string

    - by madness
    Hi All, I'm not sure if it is possible to render an asp.net control from a string. The string contains fragments of html code and I've tried rendering that string to a div tag with runat="server" set, asp panel contain, asp lalbel control and asp literal control. All of them doesn't render the asp control in that text to an actual control, it just come up as a string. I've tried adding <% % around them and it appears it doesn't like it. Thanks in advance.

    Read the article

  • How do you 'clone' WebControls in C# .NET ?

    - by Adz
    My basic question is, in .NET, how do I clone WebControls? I would like to build a custom tag, which can produce multiple copies of its children. Ultimately I intend to build a tag similar to in JSP/Struts. But the first hurdle I have is the ability to duplicate/clone the contents of a control. Consider this rather contrived example; <custom:duplicate count="2"> <div> <p>Some html</p> <asp:TextBox id="tb1" runat="server" /> </div> </custom:duplicate> The HTML markup which is output would be something like, <div> <p>Some html</p> <input type="text" id="tb1" /> </div> <div> <p>Some html</p> <input type="text" id="tb1" /> </div> Note: I know i have the id duplicated, I can come up with a solution to that later! So what we would have is my custom control with 3 children (I think) - a literal control, a TextBox control, and another literal control. In this example I have said 'count=2' so what the control should do is output/render its children twice. What I would hope to do is write some "OnInit" code which does something like: List<WebControl> clones; for(int i=1; i<count; i++) { foreach(WebControl c in Controls) { WebControl clone = c.Clone(); clones.Add(clone); } } Controls.AddRange(clones); However, as far as I can tell, WebControls do not implement ICloneable, so its not possible to clone them in this way. Any ideas how I can clone WebControls?

    Read the article

  • postgres - regex_replace in distinct clause?

    - by n00b0101
    Ok... changing the question here... I'm getting an error when I try this: SELECT COUNT ( DISTINCT mid, regexp_replace(na_fname, '\\s*', '', 'g'), regexp_replace(na_lname, '\\s*', '', 'g')) FROM masterfile; Is it possible to use regexp in a distinct clause like this? The error is this: WARNING: nonstandard use of \\ in a string literal LINE 1: ...CT COUNT ( DISTINCT mid, regexp_replace(na_fname, '\\s*', ''...

    Read the article

  • Convert string to variable in PHP?

    - by iamdadude
    Hey guys, How do I go about setting a string as a literal variable in PHP? Basically I have an array like $data['setting'] = "thevalue"; and I want to convert that 'setting' to $setting so that $setting becomes "thevalue". Thanks for any help!

    Read the article

  • Problem using date when querying the appengine datastore

    - by manu1001
    I'm running this query: SELECT FROM com.Data WHERE entryDate DATE('2010-3-16') I get this error: org.datanucleus.store.appengine.query.DatastoreQuery$UnsupportedDatastoreFeatureException: Problem with query DATE('2010-3-16'): Unsupported method while parsing expression: InvokeExpression{[null].DATE(Literal{2010-3-16})} The same query works when I use it on the admin console. But it does not work for code (java), either locally or when deployed. Any ideas?

    Read the article

  • Why would Ruby fail equality on 2 floats that appear the same?

    - by btelles
    Hi there, I have a calculation that generates what appears to be the Float 22.23, and a literal 22.23 like so: some_object.total => 22.23 some_object.total.class => Float 22.23 => 22.23 22.23.class => Float But for some reason, the following is false: some_object.total == 22.23 ? true : false Wacky, right? Is there some kind of precision mechanism being used that maybe isn't completely transparent through the some_object.total call?

    Read the article

  • Missing backslahes in filename using C#

    - by CL4NCY
    Hi, I have a string literal as follows: string filename = @"C:\myfolder\myfile.jpg"; When I use File.Exists(filename) it works most of the time but sometimes I get an error saying the following file doesn't exist: C:myfoldermyfile.jpg Something seems to strip the backslashes out of the filename. This code is sometimes accessed via an ajax request. Does anyone know why/how this could be happening?

    Read the article

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