Daily Archives

Articles indexed Sunday April 18 2010

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

  • MS Access Print Report using VBA

    - by LanguaFlash
    I have a very VBA intensive report. When I preview it everything is great but when I print it after previewing things go wacky. I have spent many hours narrowing down the possibilities and I have conclude with a certain level of confidence that it is a but in MS Access. Up to this point my method for printing reports was to open the report using docmd.openreport "report". I then use the docmd.printout command so that I can set the page range, collation etc. Is there a way to print a report directly and still be able to set options like page rage, collate etc without doing a preview first? Thanks, Jeff

    Read the article

  • Netbeans autocomplete unusably slow/nonfunctional in Netbeans 6.8 Latest

    - by Stefan Kendall
    I'm running a 2.5Ghz C2D with 4GB RAM, so there's no reason hardwre-wise why Netbeans should be peforming so poorly. Using the latest Netbeans release and grails plugin (installed via the plugin manager), automcomplete is either too slow to use or doesn't work at all. If I'm within a class, and I attempt to auto-complete a field, it takes 3-4 seconds before being able to finish the field name. If I'm in a class of the same package (like a unit test), I can't get any of the properties to appear on the object. Furthermore, it says "Scanning in progress" for a full 5-6 seconds before pulling up the method list. Is there a way to fix this behavior?

    Read the article

  • Keep Window Inactive In Appearance Even When Activated

    - by Zach Johnson
    Is there a way to keep a window inactive looking, even if it contains focus? I have two forms (A and B). After the user interacts with A, I transfer focus back to B. The result of the focus transfers (the user clicking on the A, then focus being transferred back to B) is that form A blinks from active to inactive. This looks ugly (especially on Vista where A momentarily gets a bigger shadow). How can I make A stay inactive looking so this blinking will not happen?

    Read the article

  • Ruby on Rails protect_from_forgery best practice

    - by randombits
    I'm currently working on building a RESTful web api with ruby on rails. I haven't bothered putting a proper authentication scheme into the API yet as I'm ensuring that tests and the basic behavior of the API is working all locally first. Upon testing non-HTTP GET type requests such as HTTP POST/DELETE/PUT, stuff chokes because protect_from_forgery is on by default. How does this work when I'm working in practice since essentially the idea is in a RESTful API that there is no state. The client does not have a session or a cookie associated with the server. Each request is an atomic, self-executed request. The user will supply some credentials to ensure they are who they say they are, but other than that, does protect_from_forgery make sense at this point? Should it remain enabled?

    Read the article

  • Getting SHOUTcast metadata on the Mac

    - by Fernando Valente
    I'm creating an application in Objective-C and I need to get the metadata from a SHOUTcast stream. I tried this: NSURL *URL = [NSURL URLWithString:@"http://202.4.100.2:8000/"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; [request addValue:@"1" forHTTPHeaderField:@"icy-metadata"]; [request addValue:@"Winamp 5/3" forHTTPHeaderField:@"User-Agent"]; [request addValue:@"audio/mpeg" forHTTPHeaderField:@"Content-Type"]; [NSURLConnection connectionWithRequest:request delegate:self]; I would have to get the headers from this request in order to get the information, right? Unfortunately it keeps returning these headers: Date = "17 Apr 2010 21:57:14 -0200"; "Max-Age" = 0; What I'm doing wrong?

    Read the article

  • C# 4.0: Alternative To Optional Arguments

    - by Paulo Morgado
    Like I mentioned in my last post, exposing publicly methods with optional arguments is a bad practice (that’s why C# has resisted to having it, until now). You might argument that your method or constructor has to many variants and having ten or more overloads is a maintenance nightmare, and you’re right. But the solution has been there for ages: have an arguments class. The arguments class pattern is used in the .NET Framework is used by several classes, like XmlReader and XmlWriter that use such pattern in their Create methods, since version 2.0: XmlReaderSettings settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Auto; XmlReader.Create("file.xml", settings); With this pattern, you don’t have to maintain a long list of overloads and any default values for properties of XmlReaderSettings (or XmlWriterSettings for XmlWriter.Create) can be changed or new properties added in future implementations that won’t break existing compiled code. You might now argue that it’s too much code to write, but, with object initializers added in C# 3.0, the same code can be written like this: XmlReader.Create("file.xml", new XmlReaderSettings { ValidationType = ValidationType.Auto }); Looks almost like named and optional arguments, doesn’t it? And, who knows, in a future version of C#, it might even look like this: XmlReader.Create("file.xml", new { ValidationType = ValidationType.Auto });

    Read the article

  • How do I get the Windows 7 installer onto a USB drive?

    - by Rod
    I'm having trouble installing Windows 7 onto my old laptop. The problem appears to be the laptop's DVD-ROM no longer seems to work. Sucks. So, I'm trying to figure out how to get a bootable USB with my Windows 7 DVD info onto it. I found this link here on superuser.com: http://superuser.com/questions/66948/place-a-bootable-iso-on-a-usb-drive That looks good, except for the detail about making the USB bootable. It said that the OS you're making it bootable on must be the same as the machine you're going to be installing it on. I can't do that. The machine I would make it bootable from is a 64-bit version of Windows 7. The target machine is 32-bit. So, how's this going to work?

    Read the article

  • Retrieve 2 last posts for each category.

    - by Savageman
    Hello, Lets say I have 2 tables: blog_posts and categories. Each blog post belongs to only ONE category, so there is basically a foreign key between the 2 tables here. I would like to retrieve the 2 lasts posts from each category, is it possible to achieve this in a single request? GROUP BY would group everything and leave me with only one row in each category. But I want 2 of them. It would be easy to perform 1 + N query (N = number of category). First retrieve the categories. And then retrieve 2 posts from each category. I believe it would also be quite easy to perform M queries (M = number of posts I want from each category). First query selects the first post for each category (with a group by). Second query retrieves the second post for each category. etc. I'm just wondering if someone has a better solution for this. I don't really mind doing 1+N queries for that, but for curiosity and general SQL knowledge, it would be appreciated! Thanks in advance to whom can help me with this.

    Read the article

  • Will this Java regex return a single result or multiple

    - by Blankman
    If my HTML is: <tr><td>....</td><hr></tr> <tr><td>....</td><hr></tr> <tr><td>....</td><hr></tr> <tr><td>....</td><hr></tr> <tr><td>....</td><hr></tr> <tr><td>....</td><hr></tr> If my regex is: Patterp p = Pattern.compile("<tr>(.*)<hr></tr>"); Should this get 1 result or all the individual rows? Is there a way to force it to get all the rows and not just the entire html from the top <tr> to the last instance of <hr></tr> ?

    Read the article

  • Remove characters after specific character in string, then remove substring?

    - by sah302
    I feel kind of dumb posting this when this seems kind of simple and there are tons of questions on strings/characters/regex, but I couldn't find quite what I needed (except in another language: http://stackoverflow.com/questions/2176544/remove-all-text-after-certain-point). I've got the following code: [Test] public void stringManipulation() { String filename = "testpage.aspx"; String currentFullUrl = "http://localhost:2000/somefolder/myrep/test.aspx?q=qvalue"; String fullUrlWithoutQueryString = currentFullUrl.Replace("?.*", ""); String urlWithoutPageName = fullUrlWithoutQueryString.Remove(fullUrlWithoutQueryString.Length - filename.Length); String expected = "http://localhost:2000/somefolder/myrep/"; String actual = urlWithoutPageName; Assert.AreEqual(expected, actual); } I tried the solution in the question above (hoping the syntax would be the same!) but nope. I want to first remove the queryString which could be any variable length, then remove the page name, which again could be any length. How can I get the remove the query string from the full URL such that this test passes?

    Read the article

  • WCF communication using Channel Factory.

    - by Rob Ferno
    How do I get 2 WCF services to communicate with each other using a Channel Factory in C#? Can someone point me in the right direction. Saw a few examples but was confused how the communication really happens and what code needs to be written to support this.

    Read the article

  • Objective c string formatter for distances

    - by nevan
    I have a distance as a float and I'm looking for a way to format it nicely for human readers. Ideally, I'd like it to change from m to km as it gets bigger, and to round the number nicely. Converting to miles would be a bonus. I'm sure many people have had a need for one of these and I'm hoping that there's some code floating around somewhere. Here's how I'd like the formats: 0-100m: 47m (as a whole number) 100-1000m: 325m or 320m (round to the nearest 5 or 10 meters) 1000-10000m: 1.2km (round to nearest with one decimal place) 10000m +: 21km If there's no code available, how can I write my own formatter? Thanks

    Read the article

  • Rails "NoMethodError" with sub-resources

    - by Tchock
    Hi. I'm a newbie Rails developer who is getting the following error when trying to access the 'new' action on my CityController: undefined method `cities_path' for #<#<Class:0x104608c18>:0x104606f08> Extracted source (around line #2): 1: <h1>New City</h1> 2: <%= form_for(@city) do |f| %> 3: <%= f.error_messages %> 4: 5: <div class="field"> As some background, I have a State model with many Cities. I'm getting this error after clicking on the following link coming from a State show page: <p>Add a city: <%= link_to "Add city", new_state_city_path(@state) %></p> When I run 'rake:routes' it says this is a legit route... For more background, here is the CityController 'new' action: def new @city = City.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @city } end end Here is the (complete) form in the view: <%= form_for(@city) do |f| %> <%= f.error_messages %> <div class="field"> <%= f.label :name %><br /> <%= f.text_field :name %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> This initially made me think that it's a resources/routes issue since it came back with a mention of 'cities_path' (in fact, that's what another person posting to Stack Overflow had wrong (http://stackoverflow.com/questions/845315/rails-error-nomethoderror-my-first-ruby-app). However, that doesn't seem to be the case from what I can see. Here are how my resources look in my routes file: resources :states do resources :cities end I can get it working when they are not sub-resources, but I really need to keep them as sub-resources for my future plans with the app. Any help would be very much appreciated, since I've been racking my brains on this for more hours than I would care to admit... Thanks! (Not sure this matters at all, but I'm running the very latest version of Rails 3 beta2).

    Read the article

  • Deleting Duplicates in MySQL

    - by elmaso
    Query was this: CREATE TABLE `query` ( `id` int(11) NOT NULL auto_increment, `searchquery` varchar(255) NOT NULL default '', `datetime` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM first I want to drop the table with: ALTER TABLE `querynew` DROP `id` and then delete the double entries.. I tried it with: INSERT INTO `querynew` SELECT DISTINCT * FROM `query` but with no success.. :( and with ALTER TABLE query ADD UNIQUE ( searchquery ) - is it possible to save the queries only one time?

    Read the article

  • Virtual dedicated server repetitive draining RAM, OOM constantly

    - by Deerly
    My linux (fedora red hat 7) virtual dedicated server has been experiencing OOM multiple times a day for the past several days. I thought the issue was with spamd/spamassassin but after disabling this the errors remains. The highest usage displayed on ps faux --cumulative: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 28412 8.7 0.5 309572 109308 ? Sl 22:15 0:17 /usr/java/jdk1. mysql 7716 0.0 0.0 136256 18000 ? Sl 22:12 0:00 _ /usr/libexe named 17697 0.0 0.0 120904 15316 ? Ssl 22:09 0:00 /usr/sbin/named I'm not running any java applications so I'm not sure why the top issue is showing up. It is frustrating as I barely have anything running on the server and use the tiniest fraction of bandwidth. Any help or suggestions on zeroing in on the source of the drain would be much appreciated! Thanks!

    Read the article

  • apache2 VirtualHost in Mac OS X home directory

    - by aaron
    I am running Macports apache2 on Mac OS X 10.5. Whenever I configure a virtual host in the default folder, it works, however when I configure the virtual host in my home directory I get a "403 Forbidden" error. How do I configure a vhost in my home directory? Here is the configuration that yields "403 Forbidden" when I access "devel.mysite.com": /opt/local/apache2/conf/extra/httpd-vhosts.conf: DocumentRoot "/opt/local/apache2/htdocs" ServerName * #CustomLog "" common <VirtualHost *:80> #DocumentRoot "/opt/local/apache2/htdocs/mysite" DocumentRoot "/Users/myuser/Sites/mysite" ServerName devel.mysite.com </VirtualHost> The error message in /opt/local/apache2/logs/devel.mysite.com-error_log: [Sat Apr 17 19:54:49 2010] [error] [client 127.0.0.1] client denied by server configuration: /Users/myuser/Sites/mysite/ When I uncomment the line to make DocumentRoot in /opt/local/apache2/htdocs/mysite, it works: DocumentRoot "/opt/local/apache2/htdocs" ServerName * #CustomLog "" common <VirtualHost *:80> DocumentRoot "/opt/local/apache2/htdocs/mysite" #DocumentRoot "/Users/myuser/Sites" ServerName devel.mysite.com </VirtualHost> I get no errors or warnings when I start apache, and the only thing that is logged on startup is this (in /opt/local/apache/logs/error_log): [Sat Apr 17 19:56:29 2010] [notice] Digest: generating secret for digest authentication ... [Sat Apr 17 19:56:29 2010] [notice] Digest: done [Sat Apr 17 19:56:29 2010] [notice] Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8m DAV/2 configured -- resuming normal operations A few notes: * The permissions of /Home/myuser/Sites/mysite is 755, owned by myuser, group is staff * Everything else works as expected, until I move the ServerRoot of the vhost to the directory in my home

    Read the article

  • creating a heirarchy of terminals or workspaces

    - by intuited
    <rant This question occurred to me ('occurred' meaning 'whispered seductively in my ear for the 100th time') while using GNU-screen, so I'll make that my example. However this is a much more general question about user interfaces and what I perceive as a flawmissing feature in every implementation I've yet seen. I'm wondering if there is some way to create a heirarchy/tree of terminals in a screen session. EG I'd like to have something like 1 bash 1.1 bash 1.2 bash 2 bash 3 bash 3.1 bash 3.1.1 bash 3.1.2 bash It would be good if the terminals could be labelled instead of having to be navigated to via some arrangement that I suspect doesn't exist. So then you could jump to one using eg ^A:goto happydays or ^A:goto dykstra.angry. So to generalize that: Firefox, Chrome, Internet Explorer, gnome-terminal, roxterm, konsole, yakuake, OpenOffice, Microsoft Office, Mr. Snuffaluppagus's Funtime Carousel™, and Your Mom's Jam Browser™ all offer the ability to create a flat set of tabs containing documents of an identical nature: web pages, terminals, documents, fun rideable animals, and jams. GNU-screen implements the same functionality without using tabs. Linux and OS/X window managers provide the ability to organize windows into an array of workspaces, which amounts to again, the same deal. Over the past few years, this has become a more or less ubiquitous concept which has been righteously welcomed into the far reaches of the computer interface funfest. Heavy users of these systems quickly encounter a problem with it: the set of entities is flat. In the case of workspaces, an option may be available to create a 2d array. However none of these applications furnish their users with the ability to create heirarchies, similar to filesystem directory structures, containing instances of their particular contained type. I for one am consistently bothered by this, and am wondering if the community can offer some wisdom as to why this has not happened in any of the foremost collections of computational functionality our culture has yet produced. Or if perhaps it has and I'm just an ignorant savage. I'd like to be able to not only group things into a tree structure, but also to create references (aka symbolic links, aka pointers) from one part of the structure to another, as well as apply properties (eg default directory, colorscheme, ...) recursively downward from a given node. I see no reason why we shouldn't be able to save these structures as known sessions, and apply tags to particular instances. So then you can sort through them by tag, find them by name, or just use the arrow keys (with an appropriate modifier) to move left or right and in or out of a given level. Another key combo would serve to create a branch in the place of the current terminal/webpage/lifelike statue/spreadsheet/spreadsheet sheet/presentation/jam and move that entity into the new branch, then create a fresh one as a sibling to it: a second leaf node within the same branch node. They would get along well. I find it a bit astonishing that this hasn't happened yet, and the only reason I can venture as a guess is that the creators of these fine systems do not consider such functionality to be useful to a significant portion of their userbase. I posit that the probability that that such an assumption would be correct is pretty low. On the other hand, given the relative ease with which such structures can be implemented using modern libraries/languages, it doesn't seem likely that difficulty of implementation would be a major roadblock. If it could be done in 1972 or whenever within the constraints of a filesystem driver, it should be relatively painless to implement in 2010 in a fullblown application. Given that all of these systems are capable of maintaining a set of equivalent entities, it seems unlikely that a major infrastructure overhaul would be necessary in order to enable a navigable heirarchy of them. </rant Mostly I'm just looking to start up a discussion and/or brainstorming on this topic. Any ideas, examples, criticism, or analysis are quite welcome. * Mr. Snuffaluppagus's Funtime Carousel is a registered trademark of Children's Television Workshop Inc. * Your Mom's Jam Browser is a registered trademark of Your Mom Inc.

    Read the article

  • Best practice to use MS Excel as a database

    - by Ying
    In office, it is popular to use MS Excel to store data. In most cases, the data is structured, which means it is suitable for a database. I know peole prefer MS Excel for it is easy to change the data structure and data value. So I have an idea to use MS Excel as a database IF people follow a general rule to store data. In other words, by a best practice to use MS Excel as a database. I have thought to use MS Access to store data, but it is expensive and not popular as MS Excel. I don't mind to buy such a solution, especially when it is for .Net platform. Any ideas or suggestions are welcome.

    Read the article

  • iPhone: Memory leak when using NSOperationQueue...

    - by MacTouch
    Hi, I'm sitting here for at least half an hour to find a memory leak in my code. I just replaced an synchronous call to a (touch) method with an asynchronous one using NSOperationQueue. The Leak Inspector reports a memory leak after I did the change to the code. What's wrong with the version using NSOperationQueue? Version without a MemoryLeak -(NSData *)dataForKey:(NSString*)ressourceId_ { NSString *path = [self cachePathForKey:ressourceId_]; // returns an autoreleased NSString* NSString *cacheKey = [self cacheKeyForRessource:ressourceId_]; // returns an autoreleased NSString* NSData *data = [[self memoryCache] valueForKey:cacheKey]; if (!data) { data = [self loadData:path]; // returns an autoreleased NSData* if (data) { [[self memoryCache] setObject:data forKey:cacheKey]; } } [[self touch:path]; return data; } Version with a MemoryLeak (I do not see any) -(NSData *)dataForKey:(NSString*)ressourceId_ { NSString *path = [self cachePathForKey:ressourceId_]; // returns an autoreleased NSString* NSString *cacheKey = [self cacheKeyForRessource:ressourceId_]; // returns an autoreleased NSString* NSData *data = [[self memoryCache] valueForKey:cacheKey]; if (!data) { data = [self loadData:path]; // returns an autoreleased NSData* if (data) { [[self memoryCache] setObject:data forKey:cacheKey]; } } NSInvocationOperation *touchOp = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(touch:) object:path]; [[self operationQueue] addOperation:touchOp]; [touchOp release]; return data; } And of course, the touch method does nothing special too. Just change the date of the file. -(void)touch:(id)path_ { NSString *path = (NSString *)path_ NSFileManager *fm = [NSFileManager defaultManager]; if ([fm fileExistsAtPath:path]) { NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSDate date], NSFileModificationDate, nil]; [fm setAttributes: attributes ofItemAtPath:path error:nil]; } }

    Read the article

  • Using Ribbon as tab control

    - by zendar
    I would like to create application with ribbon interface that looks and behaves like this: application have one main form with ribbon ribbon has multiple tabs when user switches tab on ribbon, panel below ribbon changes and displays content related to ribbon panel. That way, ribbon tab acts as if it is tab over whole window. For example, ribbon have two tabs: people and tasks. When current ribbon panel is "people", below ribbon is displayed grid with people data. Ribbon contains command for manipulating people data. When user switches to "tasks" tab on ribbon, application should display form with tasks below ribbon. Question is can ribbon be used in this scenario? I read "OFFICE FLUENT™ USER INTERFACE DESIGN GUIDELINES" that describe what you can and cannot do with ribbon, but I could not find anything about this.

    Read the article

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