Search Results

Search found 28877 results on 1156 pages for 'do good'.

Page 113/1156 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • Is it a good idea to use an integer column for storing US ZIP codes in a database?

    - by Yadyn
    From first glance, it would appear I have two basic choices for storing ZIP codes in a database table: Text (probably most common), i.e. char(5) or varchar(9) to support +4 extension Numeric, i.e. 32-bit integer Both would satisfy the requirements of the data, if we assume that there are no international concerns. In the past we've generally just gone the text route, but I was wondering if anyone does the opposite? Just from brief comparison it looks like the integer method has two clear advantages: It is, by means of its nature, automatically limited to numerics only (whereas without validation the text style could store letters and such which are not, to my knowledge, ever valid in a ZIP code). This doesn't mean we could/would/should forgo validating user input as normal, though! It takes less space, being 4 bytes (which should be plenty even for 9-digit ZIP codes) instead of 5 or 9 bytes. Also, it seems like it wouldn't hurt display output much. It is trivial to slap a ToString() on a numeric value, use simple string manipulation to insert a hyphen or space or whatever for the +4 extension, and use string formatting to restore leading zeroes. Is there anything that would discourage using int as a datatype for US-only ZIP codes?

    Read the article

  • What is a good CPU/PC setup to speed up intensive C++/templates compilation?

    - by ApplePieIsGood
    I currently have a machine with an Opteron 275 (2.2Ghz), which is a dual core CPU, and 4GB of RAM, along with a very fast hard drive. I find that when compiling even somewhat simple projects that use C++ templates (think boost, etc.), my compile times can take quite a while (minutes for small things, much longer for bigger projects). Unfortunately only one of the cores is pegged at 100%, so I know it's not the I/O, and it would seem that there is no way to take advantage of the other core for C++ compilation?

    Read the article

  • NLP: any easy and good methods to find semantic similarity between words?

    - by sadawd
    Dear Everyone, I don't know whether stackoverflow covers NLP, so I am gonna give this a shot. I am interested to find the semantic relatedness of two words from a specific domain, i.e. "image quality" and "noise". I am doing some research to determine if reviews of a cameras are positive or negative for a particular attribute of the camera. (like image quality in each one of the reviews). However, not everybody uses the exact same wording "image quality" in the posts, so I am out to see if there is a way for me to build something like that: "image quality" which includes ("noise", "color", "sharpness", etc etc) so I can wrap all everything within one big umbrella. I am doing this for another language, so Wordnet is not necessarily helpful. And no, I do now work for Google or Microsoft so I do not have data from people's clicking behavior as input data either. However, I do have a lot of text, pos-tagged, segmented etc. Thanks

    Read the article

  • Pagebreak (or table break?) to obtain a good formated PDF

    - by iker
    Hi! I had develop an intranet on CakePHP witch in one part generates a custom PDF using DOMPDF. The problem is that i have a memo field (mysql text) witch i print after getting the result from PHP nl2br function. The problems is that in some ocasions, this text is too long (even on font-size: 6px) and i need some way to make a page break (get again de header, and footer etc)... or maybe a nice way to get a second column to continue with the text inside. any ideas? thanks so much

    Read the article

  • Error in VC++ for code that looks perfectly good C++?

    - by Ram Bhat
    Hey guys. Check out this piece of sample code. #include "stdafx.h" #include<conio.h> #include<string.h> class person{ private char name[20]; private int age; public void setValues(char n[],int a) { strcpy(this->name,n); this->age=a; } public void display() { printf("\nName = %s",name); printf("\nAge = %d",age); } }; int _tmain(int argc, _TCHAR* argv[]) { person p; p.setValues("ram",20); p.display(); getch(); return 0; } I am getting the following errors : 1------ Build started: Project: first, Configuration: Debug Win32 ------ 1 first.cpp 1c:\documents and settings\dark wraith\my documents\visual studio 2010\projects\first\first\first.cpp(9): error C2144: syntax error : 'char' should be preceded by ':' 1c:\documents and settings\dark wraith\my documents\visual studio 2010\projects\first\first\first.cpp(10): error C2144: syntax error : 'int' should be preceded by ':' 1c:\documents and settings\dark wraith\my documents\visual studio 2010\projects\first\first\first.cpp(12): error C2144: syntax error : 'void' should be preceded by ':' 1c:\documents and settings\dark wraith\my documents\visual studio 2010\projects\first\first\first.cpp(17): error C2144: syntax error : 'void' should be preceded by ':' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Read the article

  • Is there a good .Net CSS aggregator that combines style sheets and minifies them?

    - by vfilby
    I am looking to see if there is an open source/free project that provides a CSS manager. I am looking for this mainly for performance tweaking and hoping there is a readymade project rather than building from scratch. Features I am looking for include: Combines multiple .css files into a single css file Optionally minifies the resulting .css file Works well with .Net (a user control, custom handler, etc) Is there a project out that that handles this?

    Read the article

  • What is a good way of Enhancing contrast of color images?

    - by erjik
    I split color image for 3 channels and made a contrast enhancement of each channel. Then merged them together, I like the image at the result, but it has different colors. Black objects became yellow and so on... EDIT: The algorithm I used is to calculate the 5th percentile and the 95th percentile as min and max values, and then expand the values of image so that it will have min and max values as 0 and 255. If there is a better approach please tell me.

    Read the article

  • What are possible/good ways to prototype iPhone applications?

    - by Ted Johnson
    This is intentionally left broad. If you wanted to show users what iPhone/mobile applications could to for them. The more interactive the better, but it must be quick to build as you can't code up every idea. Let us assume real-time games are out of scope. Throw out ideas or state which approach would be best. Here are some of my ideas, what are yours? Hack a app that loads mostly web or image content, but has hyperlinks to get around in. This would mean static data. Build screens which look great but can only be navigated in a story board type fashion. Load the web version or equivalent on the iPhone and say: now image the buttons and navigation is better. A paper based prototype. Flash or video walk through running on the phone. String existing iPhone apps and web pages together with minimal glue just to convey the idea. Can anyone share prototyping methods for other mobile devices? Ex: The palm prototype was just a block of wood and note pad that was carried around.

    Read the article

  • Are there any good resources on developing ASP.NET for Windows CE Internet Explorer?

    - by IronicMuffin
    I've been tasked with creating a web app to be consumed by a mobile device sporting Windows CE 5.0 (and some with Windows CE 4.2). I've found a host of things that seem to work fine in IE6 on my desktop, but fail when rendered in IE for Windows CE. IE6 is bad enough as it is...does it lose any more functionality on an embedded system? Are there quirks that a developer would need to know about? AJAX seems extremely unlikely. JavaScript seems quirky when linking to a .js file. Panels with scrollbars are finicky. Textboxes can't get focus. DefaultButtons on a form don't work. Any help or resources you can provide would be greatly appreciated.

    Read the article

  • True or False: Good design calls for every table to have a primary key, if nothing else, a running i

    - by Velika
    Consider a grocery store scenario (I'm making this up) where you have FACT records that represent a sale transaction, where the columns of the Fact table include SaleItemFact Table ------------------ CustomerID ProductID Price DistributorID DateOfSale Etc Etc Etc Even if there are duplicates in the table when you consider ALL the keys, I would contend that a surrogate running numeric key (i.e. identity column) should be made up, e.g., TransactionNumber of type Integer. I can see someone arguing that a Fact table might not have a unique key (though I'd invent one and waste the 4 bytes, but how about a dimension table?

    Read the article

  • What good open source programs exist for fuzzing popular image file types?

    - by JohnnySoftware
    I am looking for a free, open source, portable fuzzing tool for popular image file types that is written in either Java, Python, or Jython. Ideally, it would accept specifications for the fuzzable fields using some kind of declarative constraints. Non-procedural grammar for specifying constraints are greatly preferred. Otherwise, might as well write them all in Python or whatever. Just specifying ranges of valid values or expressions for them. Ideally, it would support some kind of generative programming to export the fuzzer into various programming languages to suit cases where more customization was required. If it supported a direct-manipulation GUI for controlling parameter values and ranges, that would be nice too. The file formats that should be supported are: GIF JPEG PNG So basically, it should be sort of a toolkit consisting of ready-to-run utility, a framework or library, and be capable of generating the fuzzed files directly as well as from programs it generates. It needs to be simple so that test images can be created quickly. It should have a batch capability for creating a series of images. Creating just one at a time would be too painful. I do not want a hacking tool, just a QA tool. Basically, I just want to address concerns that it is taking too long to get commonplace image rendering/parsing libraries stable and trustworthy.

    Read the article

  • What is a good generic sibling control Javascript communication strategy?

    - by James
    I'm building a webpage that is composed of several controls, and trying to come up with an effective somewhat generic client side sibling control communication model. One of the controls is the menu control. Whenever an item is clicked in here I wanted to expose a custom client side event that other controls can subscribe to, so that I can achieve a loosely coupled sibling control communication model. To that end I've created a simple Javascript event collection class (code below) that acts as like a hub for control event registration and event subscription. This code certainly gets the job done, but my question is is there a better more elegant way to do this in terms of best practices or tools, or is this just a fools errand? /// Event collection object - acts as the hub for control communication. function ClientEventCollection() { this.ClientEvents = {}; this.RegisterEvent = _RegisterEvent; this.AttachToEvent = _AttachToEvent; this.FireEvent = _FireEvent; function _RegisterEvent(eventKey) { if (!this.ClientEvents[eventKey]) this.ClientEvents[eventKey] = []; } function _AttachToEvent(eventKey, handlerFunc) { if (this.ClientEvents[eventKey]) this.ClientEvents[eventKey][this.ClientEvents[eventKey].length] = handlerFunc; } function _FireEvent(eventKey, triggerId, contextData ) { if (this.ClientEvents[eventKey]) { for (var i = 0; i < this.ClientEvents[eventKey].length; i++) { var fn = this.ClientEvents[eventKey][i]; if (fn) fn(triggerId, contextData); } } } } // load new collection instance. var myClientEvents = new bsdClientEventCollection(); // register events specific to the control that owns it, this will be emitted by each respective control. myClientEvents.RegisterEvent("menu-item-clicked"); Here is the part where this code above is consumed by source and subscriber controls. // menu control $(document).ready(function() { $(".menu > a").click( function(event) { //event.preventDefault(); myClientEvents.FireEvent("menu-item-clicked", $(this).attr("id"), null); }); }); <div style="float: left;" class="menu"> <a id="1" href="#">Menu Item1</a><br /> <a id="2" href="#">Menu Item2</a><br /> <a id="3" href="#">Menu Item3</a><br /> <a id="4" href="#">Menu Item4</a><br /> </div> // event subscriber control $(document).ready(function() { myClientEvents.AttachToEvent("menu-item-clicked", menuItemChanged); myClientEvents.AttachToEvent("menu-item-clicked", menuItemChanged2); myClientEvents.AttachToEvent("menu-item-clicked", menuItemChanged3); }); function menuItemChanged(id, contextData) { alert('menuItemChanged ' + id); } function menuItemChanged2(id, contextData) { alert('menuItemChanged2 ' + id); } function menuItemChanged3(id, contextData) { alert('menuItemChanged3 ' + id); }

    Read the article

  • What are good strategies for organizing single class per query service layer?

    - by KallDrexx
    Right now my Asp.net MVC application is structured as Controller - Services - Repositories. The services consist of aggregate root classes that contain methods. Each method is a specific operation that gets performed, such as retrieving a list of projects, adding a new project, or searching for a project etc. The problem with this is that my service classes are becoming really fat with a lot of methods. As of right now I am separating methods out into categories separated by #region tags, but this is quickly becoming out of control. I can definitely see it becoming hard to determine what functionality already exists and where modifications need to go. Since each method in the service classes are isolated and don't really interact with each other, they really could be more stand alone. After reading some articles, such as this, I am thinking of following the single query per class model, as it seems like a more organized solution. Instead of trying to figure out what class and method you need to call to perform an operation, you just have to figure out the class. My only reservation with the single query per class method is that I need some way to organize the 50+ classes I will end up with. Does anyone have any suggestions for strategies to best organize this type of pattern?

    Read the article

  • Is there really such a thing as "being good at math"?

    - by thezhaba
    Aside from gifted individuals able to perform complex calculations in their head, I'm wondering if proficiency in mathematics, namely calculus and algebra, has really got to do with one's natural inclination towards sciences, if you can put it that way. A number of students in my calculus course pick up material in seemingly no time whereas I, personally, have to spend time thinking about and understanding most concepts. Even then, if a question that requires a bit more 'imagination' comes up I don't always recognize the concepts behind it, as is the case with calculus proofs, for instance. Nevertheless, I refuse to believe that I'm simply not made for it. I do very well in programming and software engineering courses where a lot of students struggle. At first I could not grasp what they found to be so difficult, but eventually I realized that having previous programming experience is a great asset -- once I've seen and made practical use of the programming concepts learning about them in depth in an academic setting became much easier as I have then already seen their use "in the wild". I suppose I'm hoping that something similar happens with mathematics -- perhaps once the practical idea behind a concept (which authors of textbooks sure do a great job of concealing..) is evident, understanding the seemingly dry and symbolic ideas and proofs would be more obvious? I'm really not sure. All I'm sure of is I'd like to get better at calculus, but I don't yet understand why some of us pick it up easily while others have to spend considerable amounts of time on it and still not have complete understanding if an unusual problem is given.

    Read the article

  • What to read as a good quick review and intro into development process methodologies?

    - by Ivan
    Being mostly self-taught freestyle developer and having no experience of working in teams of professionals in serious software companies, having only a very general idea of how the software development is should really be done, I think I've came to a point, when I begin struggling from lack of order in my work. I think I should get acquainted with professional software development technologies to optimize my own productivity and to extend my choice of work by increasing capabilities to work in teams and bigger companies. What should I begin with? Of course I am googling on this subject right now, but maybe hou have some real experience based recommendations to share?

    Read the article

  • Detecting Screen Resolution to load alternative CSS a good idea?

    - by jdln
    Im working with a graphic designer who constantly wants to make websites larger than the 960 pixels i recommend. I can do a certain amount with liquid layouts but id really love to be able to load different CSS for larger resolutions. I googled it and found the link below, but im worried that I havnt heard more about this. Is this is a reliable method? Im concerned as I would have thought that more people would want to do this. http://www.ilovecolors.com.ar/detect-screen-size-css-style/ Thanks

    Read the article

  • Is this a good starting point for iptables in Linux?

    - by sbrattla
    Hi, I'm new to iptables, and i've been trying to put together a firewall which purpose is to protect a web server. The below rules are the ones i've put together so far, and i would like to hear if the rules makes sense - and wether i've left out anything essential? In addition to port 80, i also need to have port 3306 (mysql) and 22 (ssh) open for external connections. Any feedback is highly appreciated! #!/bin/sh # Clear all existing rules. iptables -F # ACCEPT connections for loopback network connection, 127.0.0.1. iptables -A INPUT -i lo -j ACCEPT # ALLOW established traffic iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # DROP packets that are NEW but does not have the SYN but set. iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP # DROP fragmented packets, as there is no way to tell the source and destination ports of such a packet. iptables -A INPUT -f -j DROP # DROP packets with all tcp flags set (XMAS packets). iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP # DROP packets with no tcp flags set (NULL packets). iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP # ALLOW ssh traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport ssh -m limit --limit 1/s -j ACCEPT # ALLOW http traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport http -m limit --limit 5/s -j ACCEPT # ALLOW mysql traffic (and prevent against DoS attacks) iptables -A INPUT -p tcp --dport mysql -m limit --limit 25/s -j ACCEPT # DROP any other traffic. iptables -A INPUT -j DROP

    Read the article

  • Do you think functional language is good for applications that have a lot of business rules but very

    - by StackUnderflow
    I am convinced that functional programming is an excellent choice when it comes to applications that require a lot of computation (data mining, AI, nlp etc). But is it wise to use functional programming for a typical enterprise application where there are a lot of business rules but not much in terms of computation? Please disregard the fact that there are very few people using functional programming and that it's kind of tough. Thanks

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >