Daily Archives

Articles indexed Friday April 2 2010

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

  • Running Visual Studio 2005, 2008, and 2010 on same system.

    - by thelsdj
    I have around 50 projects in Visual Studio 2005 that I am building a new development machine for and I'd like to slowly move those projects to VS 2008 but also have 2010 available for select new projects. Can this work? Are there any gotchas for this sort of setup? Any general advice for running multiple versions of Visual Studio on the same system would be greatly appreciated. Specifically related to managing a controlled migration of projects to new versions but being able to selectively keep some on old versions.

    Read the article

  • How can I add the column data type after adding the column headers to my datatable?

    - by Kevin
    Using the code below (from a console app I've cobbled together), I add seven columns to my datatable. Once this is done, how can I set the data type for each column? For instance, column 1 of the datatable will have the header "ItemNum" and I want to set it to be an Int. I've looked at some examples on thet 'net, but most all of them show creating the column header and column data type at once, like this: loadDT.Columns.Add("ItemNum", typeof(Int)); At this point in my program, the column already has a name. I just want to do something like this (not actual code): loadDT.Column[1].ChangeType(typeof(int)); Here's my code so far (that gives the columns their name): // get column headings for datatable by reading first line of csv file. StreamReader sr = new StreamReader(@"c:\load_forecast.csv"); headers = sr.ReadLine().Split(','); foreach (string header in headers) { loadDT.Columns.Add(header); } Obviously, I'm pretty new at this, but trying very hard to learn. Can someone point me in the right direction? Thanks!

    Read the article

  • Using the groupby method in Python, example included

    - by randombits
    Trying to work with groupby so that I can group together files that were created on the same day. When I say same day in this case, I mean the dd part in mm/dd/yyyy. So if a file was created on March 1 and April 1, they should be grouped together because the "1" matches. Here's the code I have so far: #!/usr/bin/python import os import datetime from itertools import groupby def created_ymd(fn): ts = os.stat(fn).st_ctime dt = datetime.date.fromtimestamp(ts) return dt.year, dt.month, dt.day def get_files(): files = [] for f in os.listdir(os.getcwd()): if not os.path.isfile(f): continue y,m,d = created_ymd(f) files.append((f, d)) return files files = get_files() for key, group in groupby(files, lambda x: x[1]): for file in group: print "file: %s, date: %s" % (file[0], key) print " " The problem is, I get lots of files that get grouped together based on the day. But then I'll see multiple groups with the same day. Meaning I might have 4 files grouped that were created on the 17th. Later on I'll see another unique set of 2 files that are also created on the 17th. Where am I going wrong?

    Read the article

  • Vim syntax highlighting for ruby 1.9

    - by Peter
    Ruby 1.9 has a few new syntax elements, such as the {key: value} hash literal syntax. Has anyone written or seen an updated syntax/ruby.vim highlighting file that will highlight key: just like it highlights :key in {:key => value}?

    Read the article

  • overloaded stream insetion operator with a vector

    - by julz666
    hi, i'm trying to write an overloaded stream insertion operator for a class who's only member is a vector. i dont really know what i'm doing. (lets make that clear) it's a vector of "Points" which is a struct containing two doubles. i figure what i want is to insert user input (a bunch of doubles) into a stream that i then send to a modifier method? i keep working off other stream insertion examples such as... std::ostream& operator<< (std::ostream& o, Fred const& fred) { return o << fred.i_; } but when i try a similar..... istream & operator >> (istream &inStream, Polygon &vertStr) { inStream >> ws; inStream >> vertStr.vertices; return inStream; } i get an error "no match for operator etc etc. if i leave off the .vertices it compiles but i figure it's not right? (vertices is the name of my vector ) and even if it is right, i dont actually know what syntax to use in my driver to use it? also not %100 on what my modifier method needs to look like. here's my Polygon class //header #ifndef POLYGON_H #define POLYGON_H #include "Segment.h" #include <vector> class Polygon { friend std::istream & operator >> (std::istream &inStream, Polygon &vertStr); public: //Constructor Polygon(const Point &theVerts); //Default Constructor Polygon(); //Copy Constructor Polygon(const Polygon &polyCopy); //Accessor/Modifier methods inline std::vector<Point> getVector() const {return vertices;} //Return number of Vector elements inline int sizeOfVect() const {return (int) vertices.capacity();} //add Point elements to vector inline void setVertices(const Point &theVerts){vertices.push_back (theVerts);} private: std::vector<Point> vertices; }; #endif //Body using namespace std; #include "Polygon.h" // Constructor Polygon::Polygon(const Point &theVerts) { vertices.push_back (theVerts); } //Copy Constructor Polygon::Polygon(const Polygon &polyCopy) { vertices = polyCopy.vertices; } //Default Constructor Polygon::Polygon(){} istream & operator >> (istream &inStream, Polygon &vertStr) { inStream >> ws; inStream >> vertStr; return inStream; } any help greatly appreciated, sorry to be so vague, a lecturer has just kind of given us a brief example of stream insertion then left us on our own thanks. oh i realise there are probably many other problems that need fixing

    Read the article

  • Synchronization requirements for FileStream.(Begin/End)(Read/Write)

    - by Doug McClean
    Is the following pattern of multi-threaded calls acceptable to a .Net FileStream? Several threads calling a method like this: ulong offset = whatever; // different for each thread byte[] buffer = new byte[8192]; object state = someState; // unique for each call, hence also for each thread lock(theFile) { theFile.Seek(whatever, SeekOrigin.Begin); IAsyncResult result = theFile.BeginRead(buffer, 0, 8192, AcceptResults, state); } if(result.CompletedSynchronously) { // is it required for us to call AcceptResults ourselves in this case? // or did BeginRead already call it for us, on this thread or another? } Where AcceptResults is: void AcceptResults(IAsyncResult result) { lock(theFile) { int bytesRead = theFile.EndRead(result); // if we guarantee that the offset of the original call was at least 8192 bytes from // the end of the file, and thus all 8192 bytes exist, can the FileStream read still // actually read fewer bytes than that? // either: if(bytesRead != 8192) { Panic("Page read borked"); } // or: // issue a new call to begin read, moving the offsets into the FileStream and // the buffer, and decreasing the requested size of the read to whatever remains of the buffer } } I'm confused because the documentation seems unclear to me. For example, the FileStream class says: Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe. But the documentation for BeginRead seems to contemplate having multiple read requests in flight: Multiple simultaneous asynchronous requests render the request completion order uncertain. Are multiple reads permitted to be in flight or not? Writes? Is this the appropriate way to secure the location of the Position of the stream between the call to Seek and the call to BeginRead? Or does that lock need to be held all the way to EndRead, hence only one read or write in flight at a time? I understand that the callback will occur on a different thread, and my handling of state, buffer handle that in a way that would permit multiple in flight reads. Further, does anyone know where in the documentation to find the answers to these questions? Or an article written by someone in the know? I've been searching and can't find anything. Relevant documentation: FileStream class Seek method BeginRead method EndRead IAsyncResult interface

    Read the article

  • Rails Authlogic - no documentation about SingleAccessToken

    - by northox
    I been searching how to use the single access token in Authlogic but there is no consistent documentation on the web. Anyone knows how it work? Presently, I have this: class UserSession < Authlogic::Session::Base single_access_allowed_request_types = :all end And been using this url: www.mysite.com/?user_credentials=xyz but it does not work and the CSRF protection (protect_from_forgery()) is in the way too. thanks,

    Read the article

  • Does disabling third party cookies also disable cookies created by third party javasript?

    - by Sean
    When a page includes third party javascript (via script src=...) and that javascript that sets a cookie, that cookie "becomes" a first party cookie, even though it's originally set by a third party source. My question is this. If someone has disabled third party cookies in their browser, does that also apply cookies set by third party javascript? Or does it only block cookies that are explicitly set in the headers for requests to the third party domain? And either way, do all browsers handle this the exact same way or do some block javascript cookies but others allow it?

    Read the article

  • Help with Design for Vacation Tracking System (C#/.NET/Access/WebServices/SOA/Excel) [closed]

    - by Aaronaught
    I have been tasked with developing a system for tracking our company's paid time-off (vacation, sick days, etc.) At the moment we are using an Excel spreadsheet on a shared network drive, and it works pretty well, but we are concerned that we won't be able to "trust" employees forever and sometimes we run into locking issues when two people try to open the spreadsheet at once. So we are trying to build something a little more robust. I would like some input on this design in terms of maintainability, scalability, extensibility, etc. It's a pretty simple workflow we need to represent right now: I started with a basic MS Access schema like this: Employees (EmpID int, EmpName varchar(50), AllowedDays int) Vacations (VacationID int, EmpID int, BeginDate datetime, EndDate datetime) But we don't want to spend a lot of time building a schema and database like this and have to change it later, so I think I am going to go with something that will be easier to expand through configuration. Right now the vacation table has this schema: Vacations (VacationID int, PropName varchar(50), PropValue varchar(50)) And the table will be populated with data like this: VacationID | PropName | PropValue -----------+--------------+------------------ 1 | EmpID | 4 1 | EmpName | James Jones 1 | Reason | Vacation 1 | BeginDate | 2/24/2010 1 | EndDate | 2/30/2010 1 | Destination | Spectate Swamp 2 | ... | ... I think this is a pretty good, extensible design, we can easily add new properties to the vacation like the destination or maybe approval status, etc. I wasn't too sure how to go about managing the database of valid properties, I thought of putting them in a separate PropNames table but it gets complicated to manage all the different data types and people say that you shouldn't put CLR type names into a SQL database, so I decided to use XML instead, here is the schema: <VacationProperties> <PropertyNames>EmpID,EmpName,Reason,BeginDate,EndDate,Destination</PropertyNames> <PropertyTypes>System.Int32,System.String,System.String,System.DateTime,System.DateTime,System.String</PropertyTypes> <PropertiesRequired>true,true,false,true,true,false</PropertiesRequired> </VacationProperties> I might need more fields than that, I'm not completely sure. I'm parsing the XML like this (would like some feedback on the parsing code): string xml = File.ReadAllText("properties.xml"); Match m = Regex.Match(xml, "<(PropertyNames)>(.*?)</PropertyNames>"; string[] pn = m.Value.Split(','); // do the same for PropertyTypes, PropertiesRequired Then I use the following code to persist configuration changes to the database: string sql = "DROP TABLE VacationProperties"; sql = sql + " CREATE TABLE VacationProperties "; sql = sql + "(PropertyName varchar(100), PropertyType varchar(100) "; sql = sql + "IsRequired varchar(100))"; for (int i = 0; i < pn.Length; i++) { sql = sql + " INSERT VacationProperties VALUES (" + pn[i] + "," + pt[i] + "," + pv[i] + ")"; } // GlobalConnection is a singleton new SqlCommand(sql, GlobalConnection.Instance).ExecuteReader(); So far so good, but after a few days of this I then realized that a lot of this was just a more specific kind of a generic workflow which could be further abstracted, and instead of writing all of this boilerplate plumbing code I could just come up with a workflow and plug it into a workflow engine like Windows Workflow Foundation and have the users configure it: In order to support routing these configurations throw the workflow system, it seemed natural to implement generic XML Web Services for this instead of just using an XML file as above. I've used this code to implement the Web Services: public class VacationConfigurationService : WebService { [WebMethod] public void UpdateConfiguration(string xml) { // Above code goes here } } Which was pretty easy, although I'm still working on a way to validate that XML against some kind of schema as there's no error-checking yet. I also created a few different services for other operations like VacationSubmissionService, VacationReportService, VacationDataService, VacationAuthenticationService, etc. The whole Service Oriented Architecture looks like this: And because the workflow itself might change, I have been working on a way to integrate the WF workflow system with MS Visio, which everybody at the office already knows how to use so they could make changes pretty easily. We have a diagram that looks like the following (it's kind of hard to read but the main items are Activities, Authenticators, Validators, Transformers, Processors, and Data Connections, they're all analogous to the services in the SOA diagram above). The requirements for this system are: (Note - I don't control these, they were given to me by management) Main workflow must interface with Excel spreadsheet, probably through VBA macros (to ease the transition to the new system) Alerts should integrate with MS Outlook, Lotus Notes, and SMS (text messages). We also want to interface it with the company Voice Mail system but that is not a "hard" requirement. Performance requirements: Must handle 250,000 Transactions Per Second Should be able to handle up to 20,000 employees (right now we have 3) 99.99% uptime ("four nines") expected Must be secure against outside hacking, but users cannot be required to enter a username/password. Platforms: Must support Windows XP/Vista/7, Linux, iPhone, Blackberry, DOS 2.0, VAX, IRIX, PDP-11, Apple IIc. Time to complete: 6 to 8 weeks. My questions are: Is this a good design for the system so far? Am I using all of the recommended best practices for these technologies? How do I integrate the Visio diagram above with the Windows Workflow Foundation to call the ConfigurationService and persist workflow changes? Am I missing any important components? Will this be extensible enough to support any scenario via end-user configuration? Will the system scale to the above performance requirements? Will we need any expensive hardware to run it? Are there any "gotchas" I should know about with respect to cross-platform compatibility? For example would it be difficult to convert this to an iPhone app? How long would you expect this to take? (We've dedicated 1 week for testing so I'm thinking maybe 5 weeks?) Many thanks for your advices, Aaron

    Read the article

  • I want to plot ocean current with a GPS in a bottle.

    - by Fantomas
    Thinking of using a wine bottle with a cork that barely sticks out. Anyhow, I want to put in a GPS, a battery and a transmitter and to be able to collect position about every minute or so. Off-the-shelf components are preferred. What are my options as far as hardware and software choices? Thank you in advance!

    Read the article

  • Throttle network bandwidth per application in Mac OS X

    - by Kio Dane
    I notice that iTunes seems to suck up all my bandwidth and doesn’t play nice with other applications that use the web when it's downloading. In fact, it doesn't even give itself enough bandwidth when browsing the iTunes Store while downloading large or many files (podcasts, TV shows, large apps, etc). I'm not concerned with getting all my downloads as soon as possible, they're really low priority, and I'd rather not have to do this while I'm awake, but I can't hit the refresh button if I'm in bed and forgot it already. Is there an application or tool via the Terminal to limit the download bandwidth that iTunes gets without also hindering web browsers or other applications? FOSS/GPL software is preferable, but pay software might be acceptable too.

    Read the article

  • SQL SERVER – Simple Installation of Master Data Services (MDS) and Sample Packages – Very Easy

    - by pinaldave
    I twitted recently about: ‘Installing #sql Server 2008 R2 – Master Data Services. Painless.‘ After doing so, I got quite a few emails from other users as to why I thought it was painless. The reason was very simple- I was able to install it rather quickly on my laptop without any issues. There were a few requests along with these emails sent to me, which regards to how to install MDS, as well sample databases. Please note that I am the admin of my machine and I installed this MDS as the admin as well. Talk to your network administrator to figure out the best suitable settings for better security of login users. Additionally, since MDS is only supported on a 64-bit machine, I had rebuilt my computer a week before with a 64-bit OS and 64-bit SQL Server to go with it. Here is a quick picture tour of the installation. First of all, go to your SQL Server 2008. Install self-extracted folder and find the .msi file for C:\1033_enu_lp\x64\setup\masterdataservices.msi. Once you clicked on the file, follow the image tour below. You can ask me any questions in case you are still confused with any of the steps of the installation. While searching the internet for a similar installation process, I have landed on the official blog of MDS team where they have many interesting posts about it. If any concept written on my posts are contradictory to the information on the official blog, I suggest that you should follow the advice of official blog. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Accessing frame info in gdb

    - by Maelstrom
    In gdb, is there a way to access the contents of info frame in a script? I'm debugging a problem somewhere between Apache, PHP, APC and my own code, and I have about a hundred cores to choose from. Following the instructions here http://bugs.php.net/bugs-generating-backtrace.php I end up with a stacktrace like: #0 0x0121a31a in do_bind_function (opline=0xa94dd750, function_table=0x9b9cf98, compile_time=0 '\0') at /usr/src/debug/php-5.2.7/Zend/zend_compile.c:2407 #1 0x0124bb2e in ZEND_DECLARE_FUNCTION_SPEC_HANDLER (execute_data=0xbfef7990) at /usr/src/debug/php-5.2.7/Zend/zend_vm_execute.h:498 #2 0x01249dfa in execute (op_array=0xb79d5d3c) at /usr/src/debug/php-5.2.7/Zend/zend_vm_execute.h:92 #3 0x01261e31 in ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER (execute_data=0xbfef80d0) at /usr/src/debug/php-5.2.7/Zend/zend_vm_execute.h:7809 #4 0x01249dfa in execute (op_array=0xb79d55ec) at /usr/src/debug/php-5.2.7/Zend/zend_vm_execute.h:92 ... #26 0x09caa894 in ?? () #27 0x00000000 in ?? () The stack will always look similar, with function execute and ZEND_something interleaved several times. I need to go up to the last instance of execute (up 2 in this case) and print myVar. Obviously gdb knows the function names, but does it surface them in any user variables I could access? Typing frame 2 shows a one-line version, and info frame shows a single stackframe in detail. I want to do something like while ($current_frame.function_name != "execute") {up;} print myVar but I don't see how to do it strictly within gdb. Is there a variable / structure / special memory location / something that allows access to gdb's information on either the whole stack (like bt) or to the current stack frame (like info frame)?

    Read the article

  • Creating a png with specific rgb values (mac)

    - by Switch
    I'm using a Mac. When I try creating a png with specific rgb values (i.e. 128,0,0), this is fine (I've tried using both GIMP and photoshop). Now when I open the png file, the color looks slightly different. And when I use the DigitalColor Meter, the rgb values don't match anymore (the 128,0,0 file became 106,7,0). What's going on? Thanks

    Read the article

  • Agile and Scrum burning me down please help me figuring out the truth

    - by jadook
    hi all, in the last while I installed MS-TFS 2008 then started to get myself prepared to use Agile Process Guidance template shipped with the TFS. with little googling I passed through Mike Cohn materials: I watched his conference in youtube "sponsored by google: http://www.youtube.com/watch?v=fb9Rzyi8b90 http://www.youtube.com/watch?v=jeT0pOVg0EI Read his book "Agile Estimating and Planning" Watching the video series in his website: http://www.mountaingoatsoftware.com/presentations-tag/video-recorded I was very happy while absorbing and eating the techniques he is using with the teams and how agile and scrum is such a great software process/methodology until I saw Mike answering a question regarding an architect role and talking about the requirements document... at that point everything start falling apart due to the following: Last year I had been assigned to make full analysis "including requirements gathering" for big project "very high priority project". within 2 months of hardwork, dedication and commitment I delivered the whole analysis with full satisfaction of the customer and my BOSS and ZERO amendments. Later on, the project entered the architecting, development ... phases. due to the fact that the system included many competitive and exciting features I requested patenting it and its going in the process... so imagine you are the kind of person who used to love facing all kind of challenges and returning with excellent experience and results for the stakeholders and yourself, How fairly agile and scrum processes will credit and admit your talent and passion while the scrum master/coach treat the team as one unit that accomplish user stories and converge through trial and error approach??!!!! with that dark thoughts about agile and scrum I found many people "anti agile" and on top of them is "Crispin Rogers Johnson": http://agile-crispin.blogspot.com/ that guy made anti statement for everything Mike Cohn used to talk about. I really don't know what to do next! so any guidance will be appreciated. Thanks,

    Read the article

  • if I set up the expire http header of a css file to 1 year, if I modify that file, will it be ignore

    - by user39511
    I'm using rails with nginx/passenger. If I set up the expire http header of a css file to 1 year, if I modify that file, will it be ignored by the browser (ie, it will not request the new version)? Given that Rails adds a different timestamps to each asset such as foo.css?1270165626 every time I restart the server? That's the config I use right now (nginx/passenger): location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; break; }

    Read the article

  • Does more RAM on Mac really improve performance?

    - by Moshe
    I'm coming from a PC, loaded with a Core 2 Quad CPU and 8GB of DDR2 RAM. I was running Premiere CS3. I'm new to Mac so I'm not sure if this will help performance: Will increasing my 21.5" Core 2 Duo iMac's memory from 4GB (DDR3) to 8GB improve performance of Premiere CS4 significantly? I am not impressed with Premiere as it is now. The iMac is the newest one as of this post.

    Read the article

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