Search Results

Search found 4955 results on 199 pages for 'range'.

Page 130/199 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • asp.net mvc validation must be a number custom error

    - by Para
    Hi, I am new to asp.net and I have a problem. When the users insert in a editor for a decimal field something other than numbers, they get an error "Field name" is not a number. But I don't want them to receive this message I want them to receive another message. I have no problem with this with required and range validators. Is there any way for me to do this? I am not refering necessarily to changing the culture just displaying another message. Thanks.

    Read the article

  • What's the proper technical term for "high ascii" characters?

    - by moodforaday
    What is the technically correct way of referring to "high ascii" or "extended ascii" characters? I don't just mean the range of 128-255, but any character beyond the 0-127 scope. Often they're called diacritics, accented letters, sometimes casually referred to as "national" or non-English characters, but these names are either imprecise or they cover only a subset of the possible characters. What correct, precise term that will programmers immediately recognize? And what would be the best English term to use when speaking to a non-technical audience?

    Read the article

  • Storing a bucket of numbers in an efficient data structure

    - by BlitzKrieg
    I have a buckets of numbers e.g. - 1 to 4, 5 to 15, 16 to 21, 22 to 34,.... I have roughly 600,000 such buckets. The range of numbers that fall in each of the bucket varies. I need to store these buckets in a suitable data structure so that the lookups for a number is as fast as possible. So my question is what is the suitable data structure and a sorting mechanism for this type of problem. Thanks in advance

    Read the article

  • What are some best practices for making sure your .NET code will scale well?

    - by billmaya
    Last week I interviewed for a position at a TripleA MMORPG game company here in NE. I didn't get the job but one of the areas that came up during the interview was the about the scalability of the code that you write and how it should be considered early on in the design of your architecture and classes. Sadly to say I've never thought very much about the scalability of the .NET code that I've written (I work with single user desktop and mobile applications and our major concerns are usually with device memory and rates of data transmission). I'm interested in learning more about writing code that scales up well so it can handle a wide range of remote users in a client server environment, specifically MMORPGs. Are there any books, web sites, best practices, etc. that could get me started researching this topic?

    Read the article

  • Higlight selected date in VB.NET MonthCalender

    - by fireBand
    Hi , I am using MonthCalender control in vb.net to select a date. I am able to save the selected date to DB and also retrieve and bold the previous selected date. But even though date is bolded it is not displayed when the form loads. It still highlights today's date. What Do i do to highlight the previous chosen dates. Also i want to disable choosing date range. I have my code below. 'StartDate is a datetime object 'check if there is any date chosen If Not IsNothing(StartDate) Then Me.mcSelectedDate.AddAnnuallyBoldedDate(StartDate) Me.mcSelectedDate.UpdateBoldedDates() End If

    Read the article

  • Create an automatic date stamp in excel from an entry.

    - by Obfus
    I am trying to have a date stamp event happen in column B when an entry is made in column A. Now i can do this in VBA with no problem, the trouble i am running into is there is also a entry that will eventually go in say column D and would need a date stamp in column E as well. is this possible. here is a sample of the code i have used so far. Private Sub Worksheet_Change(ByVal Target As Range) For Each Cell In Target If Cell.Column <= 3 Then If Cells(Cell.Row, 1) < "" Then Cells(Cell.Row, 2) = Now End If Next Cell End Sub

    Read the article

  • Plotting 3D Polygons in python-matplotlib

    - by Developer
    I was unsuccessful browsing web for a solution for the following simple question: How to draw 3D polygon (say a filled rectangle or triangle) using vertices values? I have tried many ideas but all failed, see: from mpl_toolkits.mplot3d import Axes3D from matplotlib.collections import PolyCollection import matplotlib.pyplot as plt fig = plt.figure() ax = Axes3D(fig) x = [0,1,1,0] y = [0,0,1,1] z = [0,1,0,1] verts = [zip(x, y,z)] ax.add_collection3d(PolyCollection(verts),zs=z) plt.show() I appreciate in advance any idea/comment. Updates based on the accepted answer: import mpl_toolkits.mplot3d as a3 import matplotlib.colors as colors import pylab as pl import scipy as sp ax = a3.Axes3D(pl.figure()) for i in range(10000): vtx = sp.rand(3,3) tri = a3.art3d.Poly3DCollection([vtx]) tri.set_color(colors.rgb2hex(sp.rand(3))) tri.set_edgecolor('k') ax.add_collection3d(tri) pl.show() Here is the result:

    Read the article

  • How to determine pixel color of System.Windows.Controls.Image?

    - by csciguy
    I have an Image from (System.Windows.Controls.Image). This image is positioned on a main canvas. I want to determine the alpha channel value of the mouse cursor when I click on any portion of this image. When doing something like the following, I'm getting an exception. {"Value does not fall within the expected range."} System.Exception {System.ArgumentException} Code: try{ CroppedBitmap cb = new CroppedBitmap(ac.displayImage.Source as BitmapSource, new Int32Rect((int)mousePoint.X, (int)mousePoint.Y, 1, 1)); byte[] pixels = new byte[4]; cb.CopyPixels(pixels, 4, 0); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } The mousePoint.X, and mousePoint.Y are obtained when the user clicks on the main window. Is there a better way to do this?

    Read the article

  • Why does PHP overwrite values when I iterate through this array twice (by reference, by value)

    - by jeremy
    If I iterate through an array twice, once by reference and then by value, PHP will overwrite the last value in the array if I use the same variable name for each loop. This is best illustrated through an example: $array = range(1,5); foreach($array as &$element) { $element *= 2; } print_r($array); foreach($array as $element) { } print_r($array); Output: Array ( [0] = 2 [1] = 4 [2] = 6 [3] = 8 [4] = 10 ) Array ( [0] = 2 [1] = 4 [2] = 6 [3] = 8 [4] = 8 ) Note that I am not looking for a fix, I am looking to understand why this is happening. Also note that it does not happen if the variable names in each loop are not each called $element, so I'm guessing it has to do with $element still being in scope and a reference after the end of the first loop.

    Read the article

  • What are Android different screens dimensions in dp for different screens (e.g. xlarge = 960dp x 720dp)?

    - by Zizo
    in this link: Range of screens supported, Android team mentioned that: As you design your UI for different screen sizes, you'll discover that each design requires a minimum amount of space. So, each generalized screen size above has an associated minimum resolution that's defined by the system. These minimum sizes are in "dp" units—the same units you should use when defining your layouts—which allows the system to avoid worrying about changes in screen density. xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x 320dp So, If I want to support all Android screens, can I create images, for full screen view, in those dimensions and that will be sufficient condition to support all available screens? or they are just the minimum sizes, and I need other dimensions? If other dimensions are needed, Please list them as in the list above. Thanks in Advance.

    Read the article

  • determine if a restaurant is open now (like yelp does) using database, php, js

    - by vee
    i was wondering if anyone knows how yelp determines what restaurants are "open now"? i'm developing a similar application using html/javascript/php. i was going to have a column in my database for each day, with comma separated hours written in "2243" format (10:43 pm). so for example if a restaurant is open for lunch and dinner it might be "1100,1400,1700,2200". then i'd check (using js) if the current time falls in one of the ranges for the current day. i'd also like to be able to determine if a restaurant is "open tonight", "open late", etc. for those i guess i'd check whether the open range overlaps with certain ranges. is there a better way to do this? particularly, how to store the hours in the database and then determine if they overlap with a given set of hours. thanks.

    Read the article

  • What is the advantage of using static methods in Python?

    - by Curious2learn
    I ran into unbound method error in python with the code class Sample(object): '''This class defines various methods related to the sample''' def drawSample(samplesize,List): sample=random.sample(List,samplesize) return sample Choices=range(100) print Sample.drawSample(5,Choices) After reading many helpful posts here, I figured how I could add @staticmethod above to get the code working. I am python newbie. Can someone please explain why one would want to define static methods? Or, why are not all methods defined as static methods. Thanks in advance.

    Read the article

  • I need data structure for effective handling with dates

    - by ante.sabo
    What I need is something like Hashtable which I will fill with prices that were actual at desired days. For example: I will put two prices: January 1st: 100USD, March 5th: 89USD. If I search my hashtable for price: hashtable.get(February 14th) I need it to give me back actual price which was entered at Jan. 1st because this is the last actual price. Normal hashtable implementation won't give me back anything, since there is nothing put on that dat. I need to see if there is such implementation which can find quickly object based on range of dates.

    Read the article

  • Is it possible to have a sound play before/during the splash screen?

    - by Jeff
    My app takes a few seconds to load and I have a splash screen. Once "viewDidLoad" I have a little sound play. I feel that the sound would be in better use if it started playing when the splash screen popped up. Is it possible to have a sound start before/during the splash screen? Here is my code: (under viewDidLoad) NSString *soundFilePath = [[NSBundle mainBundle] pathForResource: @"intorSound" ofType: @"aif"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath]; player = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: nil]; [player setVolume: soundVolumeValue]; // available range is 0.0 through 1.0 [player play]; [fileURL release]; Thank you for your time!

    Read the article

  • Opening Large (24 GB) File In C

    - by zacaj
    I'm trying to read in a 24 GB XML file in C, but it won't work. I'm printing out the current position using ftell() as I read it in, but once it gets to a big enough number, it goes back to a small number and starts over, never even getting 20% through the file. I assume this is a problem with the range of the variable that's used to store the position (long), which can go up to about 4,000,000,000 according to http://msdn.microsoft.com/en-us/library/s3f49ktz%28VS.80%29.aspx, while my file is 25,000,000,000 bytes in size. A long long should work, but how would I change what my compiler(Cygwin/mingw32) uses or get it to have fopen64?

    Read the article

  • Get a DB result with a value between two column values

    - by vitto
    Hi, I have a database situation where I'd like to get a user profile row by a user age range. this is my db: table_users username age email url pippo 15 [email protected] http://example.com pluto 33 [email protected] http://example.com mikey 78 [email protected] http://example.com table_profiles p_name start_age_range stop_age_range young 10 29 adult 30 69 old 70 inf I use MySQL and PHP but I don't know if there is some specific tacnique to do this and of course if it's possible. # so something like: SELECT * FROM table_profiles AS profiles INNER JOIN table_users AS users # can I do something like this? ON users.age IS BETWEEN profiles.start_age_range AND profiles.stop_age_range

    Read the article

  • java string detection of ip

    - by user384706
    Hi, Assume a java string that contains an IP (v4 or v6) or a hostname. What is the best way to detect among these cases? I am not interested so much on whether the IP is in valid range (e.g. 999.999.999.999 for IPv4). I am interested in just a way to detect if a String is a hostname or an IP (v4 or v6). Initially I though this: if(theString.indexOf("@")!=-1){ //Not an Ip } but I am not sure if I should always expect a format containing @ always. Thanks

    Read the article

  • How Do I create a synchronous version of NSURLConnection

    - by quinn
    I am using NSURLConnection inside of an NSIncrementalStore to synchronize my NSManagedObject with rest based web service built in Rails. I am aware of +sendSynchronousRequest:returningResponse:error but my understanding is that will not allow me to access such things as the HTTP response status code which I will need to properly handle the response, my understanding is sendSynchronousRequest returns the data if it responds in the 200 range and fails if it doesn't and doesn't really give you much more than that. I'm assuming I will somehow have to block the current method call after the NSURLConnection is instantiated and unblock it after NSURLConnection's delegate sets some value that can be returned by the blocked method. I'm assuming this will involve some combination of NSLock and NSThread but I really don't know where to start with this, any help will be greatly appreciated, thank you.

    Read the article

  • Java string too long?

    - by wrongusername
    I have the following code in Java (which worked just fine in C++ for some reason) which produces an error: int a; System.out.println("String length: " + input.length()); for(a = 0; ((a + 1) * 97) < input.length(); a++) { System.out.print("Substring at " + a + ": "); System.out.println(input.substring(a * 97, 97)); //other code here... } Output: String length: 340 Substring at 0: HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHe Substring at 1: Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -97 //long list of "at ..." stuff Substring at 2: Using a string of length 200, however, the following output is produced: String length: 200 Substring at 0: HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHe Substring at 1: That is it; no exceptions raised, just... nothing. What is happening here?

    Read the article

  • How do I handle a low job offer for an entry level position?

    - by user229269
    Hi guys! I recently graduated with MS in CS and I am excited because I just received a job offer from a company I really like for an entry-level sw engineer position. The thing is that, although the salary is not my priority and I care way more about gaining experience, their offer unfortunately is way below of what I expected. Actually after I did some research I realized that, comparing to the average salary range for the entry-level sw engineering positions in my area (one of the most expensive areas in the US) supposedly [X - Y]$ (where X is the lowest average and Y the highest), their offer is 20% below X! I wouldnt have a problem accepting an offer around X but this one is even lower than the lowest. Can I counter offer the X which is 20% more than what they offered me but at the same time is the minimum average? -- And mind you that I didnt even take under consideration the fact that I hold a MS degree which in many cases yields to a 5-10% more pay.

    Read the article

  • MSSQL 2000 Stored Procedure to Split Shift Times

    - by JClaspill
    I am being asked to alter a system to include the ability to have pay differentials based on hours worked. The old method included a stored procedure (MSSQL2000 db) that did the basics, but simply knows the start and end of every shift. So, this is the information I start with: EMPLOYEE | TYPE | HOURS | INSTAMP | OUTSTAMP Dave | Hourly | 8.643055 | 2011-01-08 07:57:35.557 | 2011-01-08 16:36:10.120 And I need to turn that into something like: EMPLOYEE | TYPE | HOURS | INSTAMP | OUTSTAMP Dave | Hourly | 4.00 | 2011-01-08 08:00:00.000 | 2011-01-08 12:00:00.000 Dave | ShiftDiff1 | 4.50 | 2011-01-08 12:00:00.000 | 2011-01-08 16:30:00.000 The ShiftDiff's range from hours to certain days, to a combo of both. Should I try to make the SQL2000 SP do this or pass the info back to my ASP.NET(C#) app and let it handle it, then send back?

    Read the article

  • create zip files with arabic characters

    - by fatiDev
    i have the following situation i have to modify an existing files and return a zip containing this modified files , i'm in web application context what i done up to now is : ///////////////// modifying the existing file with poi librairy FileInputStream inpoi = new FileInputStream("file_path"); POIFSFileSystem fs = new POIFSFileSystem(inpoi); HWPFDocument doc = new HWPFDocument(fs); Range r = doc.getRange(); r.replaceText("<nomPrenom>","test"); byte[] b = doc.getDataStream(); //////////////////////// create the zip file and copy the modified files into it ZipOutputStream out = new ZipOutputStream(new FileOutputStream("my.zip")); out.putNextEntry(new ZipEntry("file")); for (int j = 0; j < b.length; j++) { out.write(b[j]); } the created zipped file can't be read correctly with word given that the original file is wrotten in arabic

    Read the article

  • Problem while configuring the file Delimeter("\t") in app.config(C#3.0)

    - by Newbie
    In my app.config file I made the setting like the following <add key = "Delimeter" value ="\t"/> Now while accessing the above from the program by using the below code string delimeter = ConfigurationManager.AppSettings["FileDelimeter"].ToString(); StreamWriter streamWriter = null; streamWriter = new StreamWriter(fs); streamWriter.BaseStream.Seek(0, SeekOrigin.End); Enumerable .Range(0, outData.Length) .ToList().ForEach(i => streamWriter.Write(outData[i].ToString() + delimiter)); streamWriter.WriteLine(); streamWriter.Flush(); I am getting the output as 18804\t20100326\t5.59975381254617\t 18804\t20100326\t1.82599797249479\t But if I directly use "\t" in the delimeter variable I am getting the correct output 18804 20100326 5.59975381254617 18804 20100326 1.82599797249479 I found that while I am specifying the "\t" in the config file, and while reading it into the delimeter variable, it is becoming "\\t" which is the problem. I even tried with but with no luck. I am using C#3.0. Need help

    Read the article

  • Top x rows and group by (again)

    - by Tibor Szasz
    Hello, I know it's a frequent question but I just can't figure it out and the examples I found didn't helped. What I learned, the best strategy is to try to find the top and bottom values of the top range and then select the rest, but implementing is a bit tricky. Example table: id | title | group_id | votes I'd like to get the top 3 voted rows from the table, for each group. I'm expecting this result: 91 | hello1 | 1 | 10 28 | hello2 | 1 | 9 73 | hello3 | 1 | 8 84 | hello4 | 2 | 456 58 | hello5 | 2 | 11 56 | hello6 | 2 | 0 17 | hello7 | 3 | 50 78 | hello8 | 3 | 9 99 | hello9 | 3 | 1 I've fond complex queries and examples, but they didn't really helped.

    Read the article

  • Google app engine error when I login.

    - by zjm1126
    i am using http://code.google.com/p/gaema/source/browse/#hg/demos/webapp, and this is my traceback: Traceback (most recent call last): File "D:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 510, in __call__ handler.get(*groups) File "D:\gaema\demos\webapp\main.py", line 31, in get google_auth.get_authenticated_user(self._on_auth) File "D:\gaema\demos\webapp\gaema\auth.py", line 641, in get_authenticated_user OpenIdMixin.get_authenticated_user(self, callback) File "D:\gaema\demos\webapp\gaema\auth.py", line 83, in get_authenticated_user url = self._OPENID_ENDPOINT + "?" + urllib.urlencode(args) File "D:\Python25\lib\urllib.py", line 1250, in urlencode v = quote_plus(str(v)) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128) how to do this thanks updated i change the code from args = dict((k, v[-1]) for k, v in self.request.arguments.iteritems()) args["openid.mode"] = u"check_authentication" url = self._OPENID_ENDPOINT + "?" + urllib.urlencode(args) to args = dict((k, v[-1].encode('utf-8')) for k, v in self.request.arguments.iteritems()) args["openid.mode"] = u"check_authentication" url = self._OPENID_ENDPOINT + "?" + urllib.urlencode(args) but also error.

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >