Daily Archives

Articles indexed Thursday May 27 2010

Page 4/122 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Possible to exclude or reorder a column from `*` ?

    - by Earlz
    Is it possible to exclude a column from a select * from table statement with SQL Server? I have a need for this and this is my only option other than parsing a raw SQL string to get out the required field names (I really don't want to do that). Just to be bold. When the query is made I do not have access to the list of fields needed from the table but I do know which field I do not need. This is part of a complex multi-part query. Surely there must be some way even if it's "hackish" such as using table variables or views My other option is to reorder the columns. My problem is with ExecuteScalar SQL functions which get the first row and first column.

    Read the article

  • Why do I not get low memory issues until images are draw on the screen?

    - by maxpower
    I am able to load over 200 UIImage objects into a NSMutableDictionary without any memorry warning issues. When I start displaying them on the screen (after about showing 10-20 images) I get low memory warnings and an eventual crash. Only about 8 images are displayed at anyone time. Does it take additional memory to actually draw a UIImage on the screen? No memory leaks are showing up and i've reviewed code for leaks many many times.

    Read the article

  • Noise with multi-threaded raytracer

    - by herber88
    This is my first multi-threaded implementation, so it's probably a beginners mistake. The threads handle the rendering of every second row of pixels (so all rendering is handled within each thread). The problem persists if the threads render the upper and lower parts of the screen respectively. Both threads read from the same variables, can this cause any problems? From what I've understood only writing can cause concurrency problems... Can calling the same functions cause any concurrency problems? And again, from what I've understood this shouldn't be a problem... The only time both threads write to the same variable is when saving the calculated pixel color. This is stored in an array, but they never write to the same indices in that array. Can this cause a problem? Multi-threaded rendered image (Spam prevention stops me from posting images directly..) Ps. I use the exactly same implementation in both cases, the ONLY difference is a single vs. two threads created for the rendering.

    Read the article

  • Dragged external events from div overflow do not appear using FullCalender and FCDraggable

    - by user327066
    I am using the FCDraggable version of FullCalendar and everything is working well. However, I would like my external events to be contained in a div with an overflow (ex. JQuery UI Accordian) and dragged onto the calendar. When overflow is on, the external event gets hidden behind the calendar and does not appear until dropped onto the calendar. Without overflow, the external events show fine during the dragging process onto the calendar. Has anyone else encountered this scenario? I know FCDraggable isn't part of the official release branch of FullCalendar but it works so well except for this one issue.

    Read the article

  • Ensuring that all callbacks were completed before sending a new request through a DuplexChannel usin

    - by Etan
    I am experiencing some issues when using a Callback in a WCF project. First, the server invokes some function Foo on the client which then forwards the request to a Windows Forms GUI: GUI CLASS delegate void DoForward(); public void ForwardToGui() { if (this.cmdSomeButton.InvokeRequired) { DoForward d = new DoForward(ForwardToGui); this.Invoke(d); } else { Process(); // sets result variable in callback class as soon as done } } } CALLBACK CLASS object _m = new object(); private int _result; public int result { get { return _result; } set { _result = value; lock(_m) { Monitor.PulseAll(_m); } } } [OperationContract] public int Foo() { result = 0; Program.Gui.ForwardToGui(); lock(_m) { Monitor.Wait(_m, 30000); } return result; } The problem now is that the user should be able to cancel the process, which doesn't work properly: SERVER INTERFACE [OperationContract] void Cleanup(); GUI CLASS private void Gui_FormClosed(object sender, EventArgs e) { Program.callbackclass.nextAction = -1; // so that the monitor pulses and Foo() returns Program.server.Cleanup(); } The problem with this is that Cleanup() hangs. However, when I close the form when Process() is not running, it works properly. The source seems to be that the Cleanup() is called before the monitor pulses etc and therefore a new request is sent to the server before the last request from the server has not yet been responded. How can I solve this problem? How can I ensure before calling Cleanup() that no Foo() is currently being executed?

    Read the article

  • Rails/SQl query help: Find all created Categories past 7 days per each day?

    - by Senthil
    I'm unable to get SQL and Rails to play properly when trying to find Categories that are created each day, the past 7 days. So basically I want to find each Category sorted by the day they were created for the past 7 days. I found this on stackoverflow, but it isn't finding a Category that I just created: Category.all(:conditions => ["created_at > ? AND created_at < ?", t.at_beginning_of_day, t.tomorrow.at_beginning_of_day]) Any help?

    Read the article

  • iPhone OS: Is there a way to set up KVO between two ManagedObject Entities?

    - by nickthedude
    I have 2 entities I want to link with KVO, one a single statTracker class that keeps track of different stats and the other an achievement class that contains information about achievements. Ideally what I want to be able to do is set up KVO by having an instance of the achievement class observe a value on the statTracker class and also set up a threshold value at which the achievement instance should be "triggered"(triggering in this case would mean showing a UIAlertView and changing a property on the achievement class.) I'd like to also set these relationships up on instantiation of the achievement class if possible so kind of like this: Achievement *achievement1 = (Achievement *)[NSEntityDescription insertNewObjectForEntityForName:@"Achievement" inManagedObjectContext:[[CoreDataSingleton sharedCoreDataSingleton] managedObjectContext]]; [achievement1 setAchievementName:@"2 time launcher"]; [achievement1 setAchievementDescription:@"So you've decided to come back for more eh? Here are some achievement points to get you going"]; [achievement1 setAchievementPoints:[NSNumber numberWithInt:300]; [achievement1 setObjectToObserve:@"statTrackerInstace" propertyToObserve:@"timesLaunched" valueOfPropertToSatisfyAchievement:2] Anyone out there know how I would set this up? Is there some way I could do this by way of relationships that I'm not seeing? Thanks, Nick

    Read the article

  • Ul Li last element not aligning properly

    - by Chase
    I am having a problem where the last li element in a ul is pushing itself to the left further than the rest of all my pieces. Attached is a screen shot and my code. I have tried using the last-child element but it doesn't work in Safari or Chrome. #attending ul { display: inline; margin: 0 5px 0 0; padding-left: 0px; } #attending ul li { display: inline; list-style-image:none; padding: 5px; } #attending li:last-child { margin-right:-4px; } Suggestions? TIA, Chase http://desmond.yfrog.com/Himg338/scaled.php?tn=0&server=338&filename=screenshot20100526at808.jpg&xsize=640&ysize=640

    Read the article

  • Nstableview group style for nsoutlineview

    - by joels
    I like the look of the group rows in the nstableview. In apple mail, the group sections like mailboxes and rss with that style too. Is there an easy way to make a group row or root item in an nsoutlineview to look like that? I think I have to override the willDisplayCell method...

    Read the article

  • Is the Windows VPN secure?

    - by Tor Haugen
    I have used a few VPN solutions over the years. Most are hard to set up, slow to connect and/or rather ill-behaved (replacing system drivers, disrupting each other etc). One solution I have never used earlier is the one built into Windows. This is mostly because the infrastructure guys always refuse to use it because they claim it's 'not secure'. Now I have finally had the chance to use it (on Windows 7), and wow, it's a breeze! Easy to set up, well-behaved, it connects almost instantly, automatically authenticates with my logged-in credentials, and integrates excellently with the UI. I have to say, unless it really isn't secure, I'll be happy if I never have to use another VPN product ever again. I gather the Windows VPN used to rely on PPTP, which is not considered secure. But in Windows 7/2008, it supports L2TP/IPSec, SSTP and IKEv2, and authenticates with EAP or CHAP/CHAPv2. That seems pretty up-to-date to me. But I'm just a lowly developer. Can someone in the know give me the lowdown on this?

    Read the article

  • Hidden/best features of TextPad

    - by Binoj Antony
    I use Textpad as a text editor, so far I have found few of the features to be invaluable, please list features and keyboard shortcuts you find to be useful. CTRL + SHIFT + G : Selecting a file name and pressing this key combination will open this file in the editor. ALT + Mouse Left click + drag : This will let you select (to copy or cut) text vertically. CTRL + F5 : Find in files in subfolders. CTRL + M : To locate the matching end/begin braces. Regular expression support in find and replace. CTRL + F9 : Compare files Editable syntax hilighting Macros Abundance of free extensions Hope there are people out there who use Textpad.

    Read the article

  • Why does my 64-bit IIS app pool show 3 gigabytes more virtual memory than private memory?

    - by Brett
    I have an ASP.Net application that I am running on 64-bit IIS 6 on Windows XP x64. When I open performance counters after one page hit of a trivial page, I see a Private Bytes of about 88 megs, but a Virtual Bytes of about 3 Gigs. When I try the same thing with a VERY trivial ASP.Net app, I get the same result. We see something similar on Windows Server 2003 in production -- there it is an issue because we recycle when the virtual memory consumed outgrows a limit. Before we make any changes to our recycling settings, we'd like to answer the following questions: Why does the app pool grab such a large hunk of virtual memory? Is the amount of virtual memory headroom the app requests configurable? Thanks! Brett

    Read the article

  • Web Service URL Problem

    - by user221330
    H!, I have a solution in which there is several other sub projects (windows application). in every project I have some web services added. Now the problem : how can i set the URL of each web service individually from the app.Config file?? is there a setting I missed to set ? can it be automatically done or I have to code for it ? Thank you friends.

    Read the article

  • Web History: Early examples of collapsing and expanding content in an essay

    - by jes5199
    I vaguely remember that in the early days of the browser, one notion of what hypertext could be used for was a "zoom in" detail for academic essays: if you wanted a brief overview, you'd take the outermost level, and if you wanted to delve, you would click something and more sentences would appear. I know this sounds trivial and now, but in the mid-1990s it was thought-provoking. Has anyone seen any web fossils like this lying around, ideally still live on the web somewhere?

    Read the article

  • calling calloc - memory leak valgrind

    - by Mike
    The following code is an example from the NCURSES menu library. I'm not sure what could be wrong with the code, but valgrind reports some problems. Any ideas... ==4803== 1,049 (72 direct, 977 indirect) bytes in 1 blocks are definitely lost in loss record 25 of 36 ==4803== at 0x4C24477: calloc (vg_replace_malloc.c:418) ==4803== by 0x400E93: main (in /home/gerardoj/a.out) ==4803== ==4803== LEAK SUMMARY: ==4803== definitely lost: 72 bytes in 1 blocks ==4803== indirectly lost: 977 bytes in 10 blocks ==4803== possibly lost: 0 bytes in 0 blocks ==4803== still reachable: 64,942 bytes in 262 blocks Source code: #include <curses.h> #include <menu.h> #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define CTRLD 4 char *choices[] = { "Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5", "Choice 6", "Choice 7", "Exit", } ; int main() { ITEM **my_items; int c; MENU *my_menu; int n_choices, i; ITEM *cur_item; /* Initialize curses */ initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); /* Initialize items */ n_choices = ARRAY_SIZE(choices); my_items = (ITEM **)calloc(n_choices + 1, sizeof(ITEM *)); for (i = 0; i < n_choices; ++i) { my_items[i] = new_item(choices[i], choices[i]); } my_items[n_choices] = (ITEM *)NULL; my_menu = new_menu((ITEM **)my_items); /* Make the menu multi valued */ menu_opts_off(my_menu, O_ONEVALUE); mvprintw(LINES - 3, 0, "Use <SPACE> to select or unselect an item."); mvprintw(LINES - 2, 0, "<ENTER> to see presently selected items(F1 to Exit)"); post_menu(my_menu); refresh(); while ((c = getch()) != KEY_F(1)) { switch (c) { case KEY_DOWN: menu_driver(my_menu, REQ_DOWN_ITEM); break; case KEY_UP: menu_driver(my_menu, REQ_UP_ITEM); break; case ' ': menu_driver(my_menu, REQ_TOGGLE_ITEM); break; case 10: { char temp[200]; ITEM **items; items = menu_items(my_menu); temp[0] = '\0'; for (i = 0; i < item_count(my_menu); ++i) if(item_value(items[i]) == TRUE) { strcat(temp, item_name(items[i])); strcat(temp, " "); } move(20, 0); clrtoeol(); mvprintw(20, 0, temp); refresh(); } break; } } free_item(my_items[0]); free_item(my_items[1]); free_menu(my_menu); endwin(); }

    Read the article

  • Server http://www.myopenid.com/server responds that the 'check_authentication' call is not valid

    - by viatropos
    I've been struggling with this for a few days now, haven't pinpointed the problem. I am trying to get OpenID to work in Rails 2.3 and Rails 3, using ruby-openid rack-openid open_id_authentication I am logging in using my viatropos.myopenid.com account, but it consistently returns this error: Server http://www.myopenid.com/server responds that the 'check_authentication' call is not valid What could that be from, it's not a very descriptive error... Does it have to do with something ruby-specific, or is this entirely on the OpenID protocol side of things? More specifically, I am using Authlogic and ActiveRecord, so could this be a problem with my User or UserSession models somehow? Or is it more to do with the header or request? In ruby response I'm getting (from puts inside ruby-openid) is: #<OpenID::Consumer::FailureResponse:0x25e282c @reference=nil, @endpoint=#<OpenID::OpenIDServiceEndpoint:0x2601984 @local_id="http://viatropos.myopenid.com/", @display_identifier=nil, @type_uris=["http://specs.openid.net/auth/2.0/signon", "http://openid.net/sreg/1.0", "http://openid.net/extensions/sreg/1.1", "http://schemas.openid.net/pape/policies/2007/06/phishing-resistant", "http://openid.net/srv/ax/1.0"], @used_yadis=true, @server_url="http://www.myopenid.com/server", @canonical_id=nil, @claimed_id="http://viatropos.myopenid.com/">, @message="Server http://www.myopenid.com/server responds that the 'check_authentication' call is not valid", @contact=nil> Any tips would be greatly appreciated. Thanks

    Read the article

  • Convert this SQL statement to LINQ-to-SQL

    - by goforebroke
    I have struggled converting this SQL statement to LINQ to SQL VB.Net 9.0. I have used Linqer but no success. Any help would be appreciated select t.TeeId, t.DescriptionId, t.[Description], t.Rating, t.Slope, case when d.TotalHoles <> h.TotalHoles then 0 else 1 end [Status] from dbo.CourseDescription d inner join dbo.CourseTees t on t.DescriptionId = d.DescriptionId inner join (select TeeId, count(*) as TotalHoles from dbo.CourseHoles group by TeeId) h on h.TeeId = t.TeeId where d.CourseId = 1

    Read the article

  • How to get java to recognize symbolic links under cygwin

    - by Keith Randall
    Here's a very simple java program to print the first line of a file: import java.io.* public class test { public static void main(String[] args) throws IOException { System.out.print(new BufferedReader(new FileReader(args[0])).readLine()); } } When I run this program under cygwin and pass it the name of a symbolic link, it prints the contents of the symbolic link, not the target of that link: $ echo foo > testfile $ ln -s testfile symlink_to_testfile $ java test testfile foo $ java test symlink_to_testfile !<symlink> ?t e s t f i l e How do I convince java to follow the symlink? I was hoping there was something simpler than implementing the redirect myself.

    Read the article

  • Loading external SWF with masked content - need width/height

    - by AZSL
    I am loading an external swf using the SWFLoader component. The swf that is being loaded is masked so that only a portion is being shown. However, when it's loaded the actual size of the swf (loader.content.width/loader.content.height) is the complete swf including the masked area. Therefore, the loaded swf does not display properly in the itemrenderer Is there a way to to grab the size of the just the masked area as opposed to getting the size of the entire swf's contents? One item to note that is complicating the issue, is that these are swf files that have already been created and there are many of them. In some instances, the size of the stage matches up with the size of the masked area. In other instances, the stage is larger (or possibly smaller) than the masked area movieclip as well as possibly the actual size of the movieclip (w/o the mask). I am currently loading the external swf in using a Loader. Once loaded, I make a copy (screen shot) of the swf by creating a bmp of the loader.content.This is done as I don't want to have any animations being shown on screen at this moment. I am setting the size of the bmp using using loader.content.width & loader.content.height. I then set the SWFLoader.source to the bitmap.

    Read the article

  • Folder Renaming After Tar Extraction

    - by Chris S
    I have an tarball, myarchive.tar.gz. When I uncompress it using "tar -zxvf myarchive.tar.gz", it creates a folder myarchive-x980-2303-ssioo. What's the easiest way to automatically rename the extracted folder to ensure it matches the name of the archive? I've checked tar's manpage, but it doesn't seem to have an option for this.

    Read the article

  • clear properties from stylesheets

    - by jeremydouglas
    I'm wondering if anyone knows of a script to clear all the properties from a css stylesheet, but leave the selectors. For instance: body {background: #000; font-size:10px; width:100%;} becomes: body {} This would be done to the whole stylesheet. Thanks if anyone knows of a script to do this.

    Read the article

  • Serialization Performance and Google Android

    - by Jomanscool2
    I'm looking for advice to speed up serialization performance, specifically when using the Google Android. For a project I am working on, I am trying to relay a couple hundred objects from a server to the Android app, and am going through various stages to get the performance I need. First I tried a terrible XML parser that I hacked together using Scanner specifically for this project, and that caused unbelievably slow performance when loading the objects (~5 minutes for a 300KB file). I then moved away from that and made my classes implement Serializable and wrote the ArrayList of objects I had to a file. Reading that file into the objects the Android, with the file already downloaded mind you, was taking ~15-30 seconds for the ~100KB serialized file. I still find this completely unacceptable for an Android app, as my app requires loading the data when starting the application. I have read briefly about Externalizable and how it can increase performance, but I am not sure as to how one implements it with nested classes. Right now, I am trying to store an ArrayList of the following class, with the nested classes below it. public class MealMenu implements Serializable{ private String commonsName; private long startMillis, endMillis, modMillis; private ArrayList<Venue> venues; private String mealName; } And the Venue class: public class Venue implements Serializable{ private String name; private ArrayList<FoodItem> foodItems; } And the FoodItem class: public class FoodItem implements Serializable{ private String name; private boolean vegan; private boolean vegetarian; } IF Externalizable is the way to go to increase performance, is there any information as to how java calls the methods in the objects when you try to write it out? I am not sure if I need to implement it in the parent class, nor how I would go about serializing the nested objects within each object.

    Read the article

  • With MSDN and BizSpark, Cloud Computing is Closer than You Think

    Cloud computing offers significant advantages for businesses of all sizes, and it's easier to get started than you think. Microsoft makes Windows Azure compute time available for MSDN subscribers, as well as for software start-ups through the Microsoft BizSpark program. Learn why cloud computing is a good fit for you and how you can get started.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >