Search Results

Search found 487 results on 20 pages for 'nasty'.

Page 9/20 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Why doesn't Microsoft release a 'proper' AJAX grid for ASP.Net

    - by Maxim Gershkovich
    Why doesn't Microsoft release a 'proper' AJAX grid for ASP.Net either as part of Visual Studio or the AJAX control toolkit? Has there been any discussion that anyone is aware of regarding this issue? Also does anyone have any open source suggestions for 'proper' AJAX gridviews? So far I have found one.... http://dotnetslackers.com/projects/AjaxDataControls/Default.aspx PS: By proper I mean a grid that actually uses XML responses rather than the nasty html javascript based injection that is the current nastyness of the gridview (EVEN IN VS 2010).

    Read the article

  • How to determine if birthday or anniversary occured during date range

    - by davekaro
    Given I have a birthday/anniversary DateTime, how can I determine if that date occurred during a specific date range? For example, Birthday = 1/2/2000 Date Range = 12/25/2008 - 1/3/2009 I need a method to determine whether or not this person's birthday happened during that date range - preferably in C#. I first went about changing the year of the birthday DateTime to match the date range, then just check if the "new" birthday DateTime is between the start and end date of the date range... but when the date range spans different years, like in my example above - I had to add a nasty if statement. Is there no better way?

    Read the article

  • How would I strip an '&' symbol out of an ESRI dropdown before any of it's default control logic is

    - by Carter
    I have an ESRI dropdown control inside of an ESRI toolbar. One of the items in the dropdown needs to have an '&' symbol in it. As it turns out ESRI stuff builds it's callback strings as & delimited strings, so when an item is selected the parent toolbar immediately builds and handles the callback string. At one point it splits strings based on the '&' crashing the app. In effect, having an ampersand in an esri dropdown causes nasty stuff to happen when you select the item. What I need to do is find out how I can hop in before the callback stuff starts happening and strip that & out. I was thinking that perhaps I'd have to create a custom esri toolbar control, but I'm not sure and that'd be pretty undesirable. Any ideas?

    Read the article

  • Style question: Writing "this." before instance variable and methods: good or bad idea?

    - by Uri
    One of my nasty (?) programming habits in C++ and Java is to always precede calls or accesses to members with a this. For example: this.process(this.event). A few of my students commented on this, and I'm wondering if I am teaching bad habits. My rationale is: 1) Makes code more readable — Easier to distinguish fields from local variables. 2) Makes it easier to distinguish standard calls from static calls (especially in Java) 3) Makes me remember that this call (unless the target is final) could end up on a different target, for example in an overriding version in a subclass. Obviously, this has zero impact on the compiled program, it's just readability. So am I making it more or less readable? Related Question Note: I turned it into a CW since there really isn't a correct answer.

    Read the article

  • OO and Writing Drupal Modules

    - by Aaron
    Preface: Yes, I've read: http://drupal.org/node/547518 I am writing 'foo' module for Drupal6, where I am organizing the code in an OO fashion. There's a class called Foo that has a bunch of setters and accessors, and it is working quite well at abstracting some pretty nasty code and SQL. The question is is it common practice to expose a class for other modules, or is it better to wrap things in the more typical foo_myfnname()? For example, if I am writing the module's docs, should I tell people to do this: $foo = new Foo(); $something = $foo->get_something(); or tell them to call: foo_get_something(); which under the hood does: function foo_get_something() { $foo = new Foo(); return $foo->get_something(); }

    Read the article

  • Antialiased fonts in emacs 23.2 on Windows

    - by Damyan
    I'm having trouble getting antialiased fonts to work correct in emacs 23.2, to the extent that it appears that it doesn't actually support antialised fonts. If I do the following in emacs 23.1: (set-face-font 'default "DejaVu Sans Mono-9.0:antialias=subpixel") (describe-font nil) Then this reports the full name as "DejaVu Sans Mono-9.0:antialias=subpixel", and the font looks nice and smooth. However, doing the same thing in emacs 23.2 gives the full name as "DejaVu Sans Mono-9.0" and the font looks nasty and chunky. Is there something I'm doing wrong?

    Read the article

  • finding an adjacent node in xml through xpath

    - by kolosy
    i have a deeply nested structure (actually parsing out xhtml, so lots of nasty), like so: <tr> <td> <font id="blah"> stuff </font> </td> </tr> <tr> <td> more stuff </td> </tr> and this repeats in a long table. i need an xpath expression that will select the second font tag (or rather it's text()). i was looking at the preceding-sibling axis, but something isn't quite working right. something along the lines of (and pardon me if this is ridiculous, my xpath is rusty) //tr[preceding-sibling::tr/td/font/b]/td/text()

    Read the article

  • How to do Linq aggregates when there might be an empty set?

    - by Shaul
    I have a Linq collection of Things, where Thing has an Amount (decimal) property. I'm trying to do an aggregate on this for a certain subset of Things: var total = myThings.Sum(t => t.Amount); and that works nicely. But then I added a condition that left me with no Things in the result: var total = myThings.Where(t => t.OtherProperty == 123).Sum(t => t.Amount); And instead of getting total = 0 or null, I get an error: System.InvalidOperationException: The null value cannot be assigned to a member with type System.Decimal which is a non-nullable value type. That is really nasty, because I didn't expect that behavior. I would have expected total to be zero, maybe null - but certainly not to throw an exception! What am I doing wrong? What's the workaround/fix?

    Read the article

  • Essential Dojo

    - by Carl Manaster
    I'm starting to use Dojo; this is (essentially) my introduction to AJAX. We have a Java backend (torque / turbine / velocity) and are using the jabsorb JSON-RPC library to bridge Java and Javascript. What do I need to know? What is the big picture of Dojo and JSON, and what are the nasty little details that will catch me up? What did you spend a couple of days tracking down, when you started with Dojo, that you now take for granted? Thanks for any and all tips.

    Read the article

  • Get last element of pipeline in powershell

    - by dozacinc
    Hi, This might be weird, but stay with me. I want to get only the last element of a piped result to be assigned to a varaiable. I know how I would do this in "regular" code of course, but since this must be a one-liner. More specifically, I'm interested in getting the file extension when getting the result from an FTP request ListDirectoryDetails. Since this is done within a string expansion, I can't figure out the proper code. Currently I'm getting the last 3 hars, but that is real nasty. New-Object PSObject -Property @{ LastWriteTime = [DateTime]::ParseExact($tempDate, "MMM dd HH:mm",[System.Globalization.CultureInfo]::InvariantCulture) Type = $(if([int]$tempSize -eq 0) { "Directory" } else { $tempName.SubString($tempName.length-3,3) }) Name = $tempName Size = [int]$tempSize } My idea was doing something similar to $tempName.Split(".") | ? {$_ -eq $input[$input.Length-1]} that is, iterate over all, but only take out where the element I'm looking at is the last one of the input-array. What am I missing ? Fire at will /M

    Read the article

  • Rails: Different prices for different branches, association depending on two other models combined

    - by Greg Lemond
    I have three models: Service has_many :prices has_many :groups, through: prices Price belongs_to :service belongs_to :group Group has_many :prices I want to have an input field (Simple_Form) for every price. In views/services/_form.html.haml I do: simple_form_for @service do |f| simple_fields_for :groups do |g| simple_fields_for :prices do |p| p.input :price With this setup I only get input fields for already saved prices. How I can get a price field for every group? I tried to do it manually, but it got really nasty and didn't work either. Thanks for any ideas!

    Read the article

  • Oracle data provider hangs IIS worker process when web site is stopped

    - by Greg
    We're experiencing a nasty issue in Oracle 11g Release 2 where the w3wp process takes over and entire processor core, and debugging shows that the Oracle data provider is throwing ThreadAbortExceptions infinitely. A developer found this issue by doing the following: 1) Browse a web site that uses Oracle data connections locally (http://localhost/OracleWebSite) - we use IIS, not the ASP.NET dev server, for all of our sites. This ensures that the w3wp process is running and that an active Oracle pool of connections exists in the app pool. 2) Stop the web site (or perform a Rebuild All operation in Visual Studio on the web site in question). Our Oracle connection handling in the affected applications (all Oracle web apps) is well-established and robust. This issue does not occur if we disable connection pooling. This issue does not occur in Oracle 11g Release 1.

    Read the article

  • Where does ASP.Net get its rendered IDs from?

    - by NeilD
    Hi, I've inherited a project with some nasty JavaScript that depends on hard coded object ids. i.e. There are lots of places where it does things like this var magazine = document.getElementById('repModuleDisplay__ctl3_chkCats_0'); When the page renders in my UAT environment, the HTML looks like this, and everything works OK. <input id="repModuleDisplay__ctl3_chkCats_0" type="checkbox" name="repModuleDisplay:_ctl3:chkCats:0" ... etc However, when I put it on my Production environment, the HTML is suddenly rending like this: <input id="repModuleDisplay_ctl03_chkCats_0" type="checkbox" name="repModuleDisplay$ctl03$chkCats$0" ... etc The difference in ids means that the JavaScript can't find the Element, and fails. In an ideal world, I'd scrap the buggy JavaScript and do it again properly, but for a quick fix, I'd like to know what is causing the difference in rendering between the two environments. Does anyone have any ideas? Thanks, Neil

    Read the article

  • Download and replace Android resource files

    - by Casebash
    My application will have some customisation for each company that uses it. Up until now, I have been loading images and strings from resource files. The idea is that the default resources will be distributed with the application and company specific resources will be loaded from our server after they click on a link from an email to launch the initialisation intent. Does anyone know how to replace resource files? I would really like to keep using resource files to avoid rewriting a lot of code/XML. I would distribute the application from our own server, rather than through the app store, so that we could have one version per company, but unfortunately this will give quite nasty security warnings that would concern our customers.

    Read the article

  • mouse tracking on IE

    - by Gotys
    Consider the following snippet: $(document).bind('mousemove', function(e) { $('#someDiv').css({left: e.pageX+'px', top: e.pageY+'px'}); }); This should make #someDiv follow the mouse (tooltip), when the css value for "position" is set to absolute. Works as expected, except when you Zoom IN or OUT in IE7 ( dind't try other version of IE). Then the e.pageX gets completely off. The more you zoom in (using your mousewheel + CTRL), the more off the positioning gets. I've tried to break jQuery's UI demos (sliders) and it seems not even jQuery guys have this figured out. Is there any genius out there who knows how to fix this nasty thing? Thanks in advance!

    Read the article

  • What's the silliest programming mistake you've ever done? [closed]

    - by bgo
    Despite not being a professional programmer, i use python or c to accomplish simple tasks. Once I needed a nasty equation to use with various data for physics lab. I thought that it would take a few hours if i used some mechanic calculator. Then i've written a python script to make things easier but something was wrong. After finding my mistakes one of which was forgetting to put ":", i realized that it had already took 2-3 hours, not to mention inventing satanic arithmetic techniques since i thought the errors was caused by my math :) Sometimes when you don't see it, you don't see it! Now i can find the syntax errors without thinking for a moment :) Any similar annoying mistakes that you've experienced?

    Read the article

  • Is there a difference between NSString compare: and isEqual(ToString): ?

    - by frenetisch applaudierend
    Occasionally I find code which tests if two NSStrings are the same like this: if ([str1 compare:str2] == NSOrderedSame) { // Do something } Now, I believe this is less readable than using isEqualToString: and it also has some nasty side effects, like if str1 == nil the if(..) evaluates to true, or when str2 == nil havoc might break upon us according to the Apple docs. But before I crusade against those statements in my companys code, I wanted to make sure I didn't miss some important point. So my question basically boils down to: Is there any difference between a compare: to NSOrderedSame and isEqual:?

    Read the article

  • storing huge amount of records into classic asp cache object is SLOW

    - by aspm
    we have some nasty legacy asp that is performing like a dog and i narrowed it down to because we are trying to store 15K+ records into the application cache object. but that's not the killer. before it stores it, it converts the ADO stream to XML then stores it. this conversion of the huge record set to XML spikes the CPU and causes all kinds of havoc on users when it's happening. and unfortunately we do this XML conversion to read the cache a lot, causing site wide performance problems. i don't have the resources to convert everything to .net. so that's out. but i need to obviously use caching, but int his case the caching is hurting instead of helping. is there a more effecient way to store this data instead of doing this xml conversion to/from every time we read/update the cache?

    Read the article

  • Searching for the right pattern to handle login data

    - by stevebot
    Hi all, I'm working on a controller that handles logins for a Web app. These logins will come from multiple clients but will all contain the same data. However, depending on the client, this data will be interpreted into common entities for our webapp differently. For instance, we have a user code that gets sent in, and in one case we may use the first four digits of the code, and in another case 12 digits of the code to map to a field on a User entity. Instead of handling this all in the controller and having big nasty if blocks of logic, I would like to use a pattern to handle how this information gets ingested into our application. What are your opinions?

    Read the article

  • Controling CRT memory initialization

    - by Ofek Shilon
    Occasionally you meet bugs that are reproducible only in release builds and/or only on some machines. A common (but by no means only) reason is uninitialized variables, that are subject to random behaviour. E.g, an uninitialized BOOL can be TRUE most of the time, on most machines, but randomly be initialized as FALSE. What I wish I would have is a systematic way of flushing out such bugs by modifying the behaviour of the CRT memory initialization. I'm well aware of the MS debug CRT magic numbers - at the very least I'd like to have a trigger to turn 0xCDCDCDCD (the pattern that initializes freshly allocated memory) to zeros. I suspect one would be able to easily smoke out nasty initialization pests this way, even in debug builds. Am I missing an available CRT hook (API, registry key, whatever) that enables this? Anyone has other ideas to get there?

    Read the article

  • Attach to Property's setter

    - by StupidDeveloper
    I haven't found similiar post so I'm asking this. Let's say I defined somewhere an application wide available static Property (I mean it's not local) and in one class I would like to know when this property is being changed. Apart from aop (transparentproxy etc.) which I think doesn't suit me well here (and I can't add that to project anyway), what are the options here? One solution I can think of, which is probably a very nasty one, is to use some event that would be executed in the setter and just attach it in the class(es) which needs that. Something like: public static event EventHandler CurrentNumberChanged= delegate {}; public static int CurrentNumber { get { return currentNumber; } set { currentNumber = value; CurrentNumberChanged(null, EventArgs.Empty); } } I know it's really unsafe to use such events ( read here ). And since I would use it in asp.net makes it even more ugly. Do you have any advices ?

    Read the article

  • CDateTimeCtrl - preventing 'focus' change when setting date

    - by WalderFrey
    I'd like to use a CDateTimeCtrl to allow the user to select a non-weekend date. So, if the user increments the day (via a keypress) - and the resulting day is found to fall on a weekend - then the control should skip forward to the following Monday (don't let issues about month changes distract you, it's not relevant). Usually it's not a problem: when I handle the DTN_DATETIMECHANGE notification I can check the new date/time and if it's found to be a weekend then I can call SetTime on the control to update the date. However, if I set the style to DTS_SHOWNONE, this call to SetTime causes the control to shift the input 'focus' (term used loosely) to the 'none' checkbox, e.g. away from the day field. This prevents the user from using keyboard input to continue incrementing the date unless they subsequently use the right arrow key to reset the 'focus', which is just nasty. I would dearly like to prevent this focus shift from occurring. Is it even possible?

    Read the article

  • JQuery selector value escaping

    - by user53794
    I have a dropdown list that contains a series of options: <select id=SomeDropdown> <option value="a'b]&lt;p>">a'b]&lt;p></option> <option value="easy">easy</option> <select> Notice that the option value/text contains some nasty stuff: single quotes closing square bracket escaped html I need to remove the a'b]<p option but I'm having no luck writing the selector. Neither: $("#SomeDropdown >option[value='a''b]&lt;p>']"); or $("#SomeDropdown >option[value='a\'b]&lt;p>']"); are returning the option. What is the correct way to escape values when using the "value=" selector?

    Read the article

  • result set using two different views (from an if statement)

    - by mailman1979
    Hi All, I have a bit of code that works with a result set called "result" (original I know) but depending on the incoming variable I'd like to fire the specific query depending. I have the below in an if statement but that just makes the "result" recordset gets those nasty red lines and it doesn't work. I'm sure this is easy to work out. if (area == "dashboard") { IQueryable<ViewGetNavigationMainItem> result = (from m in _entities.ViewGetNavigationMainItems where m.area.Trim() == area.Trim() where m.state == "Online" where m.parentID == parentID orderby m.sequence ascending select m); } else { //Get the Content Items IQueryable<ViewGetNavigationContentItem> result = (from m in _entities.ViewGetNavigationContentItems where m.navID == navID where m.parentID == parentID orderby m.contentOrder ascending select m); } maxRecords = result.Count(); foreach (var item in result) { etc etc etc

    Read the article

  • Cleanest way to store lists of filter coefficients in a C header

    - by Nick T
    I have many (~100 or so) filter coefficients calculated with the aid of some Matlab and Excel that I want to dump into a C header file for general use, but I'm not sure what the best way to do this would be. I was starting out as so: #define BUTTER 1 #define BESSEL 2 #define CHEBY 3 #if FILT_TYPE == BUTTER #if FILT_ROLLOFF == 0.010 #define B0 256 #define B1 512 #define B2 256 #define A1 467 #define A2 -214 #elif FILT_ROLLOFF == 0.015 #define B0 256 #define B1 512 // and so on... However, if I do that and shove them all into a header, I need to set the conditionals (FILT_TYPE, FILT_ROLLOFF) in my source before including it, which seems kinda nasty. What's more, if I have 2+ different filters that want different roll-offs/filter types it won't work. I could #undef my 5 coefficients (A1-2, B0-2) in that coefficients file, but it still seems wrong to have to insert an #include buried in code.

    Read the article

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