Search Results

Search found 3846 results on 154 pages for 'life sciences'.

Page 124/154 | < Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >

  • How do I find Microsoft APIs?

    - by Stephen
    I'm a java programmer, and if I see something that: I don't know about or just want to find a method description without opening an ide or am on support I type java [classname] into google, and there it is. If I try this crazy stunt for C# I'll come up with a whole heap of tutorials (how do I use it etc). If I manage to get to MSDN, I have to wade through a page describing every .net technology to see how their syntax references the same object, and then I have to find the appropriate page from there ([class name] Constructor) for example. This is even more pronounced, because I don't have Visual Studio, so I've got nothing to make it easier. There must be something I'm missing or don't know... how does this situation work for Microsoft developers? how can I make my life easier/searches better? are there techniques that work no matter what computer I'm on (e.g. require no computer setup/downloads) Notes It could be thought that java is just "java", but it's just that the java apis are only referenced/defined in the core language. For all the other languages on the JVM, it's assumed that you will just learn the correct syntax to use the java apis. I presume that .Net only lists a whole heap of languages as the api classes are actually different and have different interfaces capabilities (or some approximation of this presumption). Edit While searching msdn works... in the java space I can type 'java [anyclass]' and it will generally be found... whether it's a java core api or a third party library

    Read the article

  • how can exec change the behavior of exec'ed program

    - by R Samuel Klatchko
    I am trying to track down a very odd crash. What is so odd about it is a workaround that someone discovered and which I cannot explain. The workaround is this small program which I'll refer to as 'runner': #include <stdio.h> #include <unistd.h> #include <string.h> #include <errno.h> int main(int argc, char *argv[]) { if (argc == 1) { fprintf(stderr, "Usage: %s prog [args ...]\n", argv[0]); return 1; } execvp(argv[1], argv + 1); fprintf(stderr, "execv failed: %s\n", strerror(errno)); // If exec returns because the program is not found or we // don't have the appropriate permission return 255; } As you can see, all this program does is use execvp to replace itself with a different program. The program crashes when it is directly invoked from the command line: /path/to/prog args # this crashes but works fine when it is indirectly invoked via my runner shim: /path/to/runner /path/to/prog args # works successfully For the life of me, I can figure out how having an extra exec can change the behavior of the program being run (as you can see the program does not change the environment). Some background on the crash. The crash itself is happening in the C++ runtime. Specifically, when the program does a throw, the crashing version incorrectly thinks there is no matching catch (although there is) and calls terminate. When I invoke the program via runner, the exception is properly caught. My question is any idea why the extra exec changes the behavior of the exec'ed program?

    Read the article

  • check whether mmap'ed address is correct

    - by reddot
    I'm writing a high-loaded daemon that should be run on the FreeBSD 8.0 and on Linux as well. The main purpose of daemon is to pass files that are requested by their identifier. Identifier is converted into local filename/file size via request to db. And then I use sequential mmap() calls to pass file blocks with send(). However sometimes there are mismatch of filesize in db and filesize on filesystem (realsize < size in db). In this situation I've sent all real data blocks and when next data block is mapped -- mmap returns no errors, just usual address (I've checked errno variable also, it's equal to zero after mmap). And when daemon tries to send this block it gets Segmentation Fault. (This behaviour is guarantedly issued on FreeBSD 8.0 amd64) I was using safe check before open to ensure size with stat() call. However real life shows to me that segfault still can be raised in rare situtaions. So, my question is there a way to check whether pointer is accessible before dereferencing it? When I've opened core in gdb, gdb says that given address is out of bound. Probably there is another solution somebody can propose.

    Read the article

  • Serialize Object

    - by Mark Pearl
    Hi.. I am new to serialization and I cannot for the life of me figure out how to fix this exception I am getting... I have an object that has the following structure [XmlRoot("MaxCut2")] public class MaxCut2File : IFile { public MaxCut2File() { MyJob = new Job(); Job.Reference = "MyRef"; } [XmlElement("JobDetails", typeof(Job))] public IJob MyJob { get; set; } } An inteferface... public interface IJob { string Reference { get; set; } } And an class [Serializable()] public class Job : IJob { [XmlElement("Reference")] public string Reference { get; set; } } When I try to serialize an instance of the MaxCut2File object I get an error {"Cannot serialize member 'MaxCut2File.MaxCut2File.MyJob' of type 'MaxCut2BL.Interfaces.IJob', see inner exception for more details."} "There was an error reflecting type 'MaxCut2File.MaxCut2File'." However if I change my property MyJob from the IJob type to the Job type it works fine... Any ideas?

    Read the article

  • C#/LINQ: How to define generically a keySelector for a templated class before calling OrderBy

    - by PierrOz
    Hi Folks, I have the following class defined in C# class myClass<T,U> { public T PropertyOne { get; set; } public U PropertyTwo { get; set; } } I need to write a function that reorder a list of myClass objects and takes two other parameters which define how I do this reorder: does my reordering depend on PropertyOne or PropertyTwo and is it ascending or descending. Let's say this two parameters are boolean. With my current knowledge in LINQ, I would write: public IList<myClass<T,U>> ReOrder(IList<myClass<T,U>> myList, bool usePropertyOne, bool ascending) { if (usePropertyOne) { if (ascending) { return myList.OrderBy(o => o.PropertyOne).ToList(); } else { return myList.OrderByDescending(o => o.PropertyOne).ToList(); } } else { if (ascending) { return myList.OrderBy(o => o.PropertyTwo).ToList(); } else { return myList.OrderByDescending(o => o.PropertyTwo).ToList(); } } } What could be a more efficient/elegant way to do that ? How can I declare the Func,TResult keySelector object to reuse when I call either OrderBy or OrderByDescending? I'm interesting in the answer since in my real life, I can have more than two properties.

    Read the article

  • Setting Connection Parameters via ADO for MSSQL

    - by taspeotis
    Is it possible to set a connection parameter on a connection to SQL Server and have that variable persist throughout the life of the connection? The parameter must be usable by subsequent queries. We have some old Access reports that use a handful of VBScript functions in the SQL queries (let's call them GetStartDate and GetEndDate) that return global variables. Our application would set these before invoking the query and then the queries can return information between date ranges specified in our application. We are looking at changing to a ReportViewer control running in local mode, but I don't see any convenient way to use these custom functions in straight T-SQL. I have two concept solutions (not tested yet), but I would like to know if there is a better way. Below is some psuedo code. Set all variables before running Recordset.OpenForward Connection->Execute("SET @GetStartDate = ..."); Connection->Execute("SET @GetEndDate = ..."); // Repeat for all parameters Will these variables persist to later calls of Recordset->OpenForward? Can anything reset the variables aside from another SET/SELECT @variable statement? Create an ADOCommand "factory" that automatically adds parameters to each ADOCommand object I will use to execute SQL // Command has been previously been created ADOParameter *Parameter1 = Command->CreateParameter("GetStartDate"); ADOParameter *Parameter2 = Command->CreateParameter("GetEndDate"); // Set values and attach etc... What I would like to know if there is something like: Connection->SetParameter("GetStartDate", "20090101"); Connection->SetParameter("GetEndDate", 20100101"); And these will persist for the lifetime of the connection, and the SQL can do something like @GetStartDate to access them. This may be exactly solution #1, if the variables persist throughout the lifetime of the connection.

    Read the article

  • Deleting objects with FK constraints in Spring/Hibernate

    - by maxdj
    This seems like such a simple scenario to me, yet I cannot for the life of my find a solution online or in print. I have several objects like so (trimmed down): @Entity public class Group extends BaseObject implements Identifiable<Long> { private Long id; private String name; private Set<HiringManager> managers = new HashSet<HiringManager>(); private List<JobOpening> jobs; @ManyToMany(fetch=FetchType.EAGER) @JoinTable( name="group_hiringManager", joinColumns=@JoinColumn(name="group_id"), inverseJoinColumns=@JoinColumn(name="hiringManager_id") ) public Set<HiringManager> getManagers() { return managers; } @OneToMany(mappedBy="group", fetch=FetchType.EAGER) public List<JobOpening> getJobs() { return jobs; } } @Entity public class JobOpening extends BaseObject implements Identifiable<Long> { private Long id; private String name; private Group group; @ManyToOne @JoinColumn(name="group_id", updatable=false, nullable=true) public Group getGroup() { return group; } } @Entity public class HiringManager extends User { @ManyToMany(mappedBy="managers", fetch=FetchType.EAGER) public Set<Group> getGroups() { return groups; } } Say I want to delete a Group object. Now there are dependencies on it in the JobOpening table and in the group_hiringManager table, which cause the delete function to fail. I don't want to cascade the delete, because the managers have other groups, and the jobopenings can be groupless. I have tried overriding the remove() function of my GroupManager to remove the dependencies, but it seems like no matter what I do they persist, and the delete fails! What is the right way to remove this object?

    Read the article

  • How do I overload the square-bracket operator in C#?

    - by Coderer
    DataGridView, for example, lets you do this: DataGridView dgv = ...; DataGridViewCell cell = dgv[1,5]; but for the life of me I can't find the documentation on the index/square-bracket operator. What do they call it? Where is it implemented? Can it throw? How can I do the same thing in my own classes? ETA: Thanks for all the quick answers. Briefly: the relevant documentation is under the "Item" property; the way to overload is by declaring a property like public object this[int x, int y]{ get{...}; set{...} }; the indexer for DataGridView does not throw, at least according to the documentation. It doesn't mention what happens if you supply invalid coordinates. ETA Again: OK, even though the documentation makes no mention of it (naughty Microsoft!), it turns out that the indexer for DataGridView will in fact throw an ArgumentOutOfRangeException if you supply it with invalid coordinates. Fair warning.

    Read the article

  • How does the PHP IteratorIterator class work?

    - by WilliamMartin
    Try as I might I cannot get my head around what the IteratorIterator class actually does. I understand that classes can implement Traversable so the engine knows it can loop using foreach and I realise that IteratorIterator is supposed to convert anything that is Traversable into an Iterator but I cannot for the life of me understand how. Take for example, the PDOStatement class; how would the standard Iterator methods (next, key, rewind, etc) be implemented to allow iteration over a PDOStatement? Sorry if my question is unclear, I am just struggling to grasp the exact reason for this class and the documentation on it is scant. Thanks, Will Update: Going through the phpt files, I found one test which uses IteratorIterator: <?php $root = simplexml_load_string('<?xml version="1.0"?> <root> <child>Hello</child> <child>World</child> </root> '); foreach (new IteratorIterator($root->child) as $child) { echo $child."\n"; } ?> The expected output is: Hello World I don't really follow how the IteratorIterator construct takes $root-child as an argument and how it manages to iterate over the child elements.

    Read the article

  • Looking for a specific featured content slider script - PHP (and jQuery, I think)

    - by Sootah
    I was looking around a few days ago for a new script to replace the featured content area on my website's current implementation. Randomly, I can across a gorgeous one that I have not been able to find again because, like an idiot, I didn't bookmark the page. It's difficult to explain what the slider looked like, so I'll try to make a crude ASCII image of it: When you would hover your mouse over one of the "title" areas that were visible, the rest of the tags would slide to the right and show the one you were hovering on. You could also hover the mouse over a tab on the right and the tabs would collapse left for the same effect. I don't know if this particular effect has a specific name to it, but for the life of me I cannot find this script again, or anything even like it. It was gorgeous. I've resorted to combing through my browser history, but there is sooooo much of it, and I cannot remember what day I saw it. So, if any of you know either what the name of this effect is, or even BETTER, what script I'm talking about, I would REAAAAALLLLYYY appreciate a link! Thanks as always! -Sootah

    Read the article

  • are there java based auto-updating tools other than WebStart & Eclipse P2?

    - by DaddyB
    Hi, I am working on a java based application and we are looking to ease our deployment of updates. Up until now, we've always simply sent out new install packs & had the sysadmin's on our customer sites roll out the upgrades - painful for a large number of users. what I'd like to do is something similar to java webstart (or eclipse p2) - when the application starts, it checks for updates in a specified location and then downloads the updates prior to starting. But here's my problem - I want more control over what's done outside of the scope of plugins & jar files. For example: I'd like to be able to upate my JVM (we ship a modified version with additional security features). I need to install DLL's - possibly local to the jar files, sometimes to windows Occasiontally run MSI's to install windows components (e.g. printer drivers). I need to modify config files & the registry. I have found a few applications that support this (such as AppLifeUpdate at http://www.kineticjump.com/) but they tend to be .NET focused and it seems a bit perverse to introduce a .NET dependancy on a java application ;) I know I could write my own here, but if there is already a 3rd party library out there that supports this kind of facility, then it would make my life a lot easier. So, has anyone else had a similar problem & knows of some products I could look at? Thanks, Brian.

    Read the article

  • Benefits of migrating my work to a new web development framework?

    - by John
    When I first started programming with PHP, I was ignorant of other php frameworks (like code igniter, cake php, etc...). So I fell into the trap of re-inventing wheels, which had the benefit of being "fun" and "educational". Overtime, I discovered other open source products that I found useful, like smarty templating engine, jquery library, tcpdf library, fdf etc...so I started bundling these technologies along with things I've built over the years into a LAMP development framework to make life easier for myself. This pass year, I've been having fun developing on the code igniter framework. It does many of the things I do in my framework. Coding in CI feels natural because the MVC and ORM feels similar to the MVC and ORM of my framework. So now I'm contemplating migrating a lot of the plugins in my framework over to CI. The pros and cons I can think of for such a project are: Pros: benefit from the vast community of CI developers lots of other developers will be familiar with it better documentation Cons: I've built a lot of useful plugins against my own framework, and it will take a lot of time to move even just the essential ones at the moment, I still, work faster against my own framework than CI, just because I'm more familiar with it even if I did migrate to CI, there will always be newer and better frameworks in the near future, and i'll be contemplating this scenario again So my question is the following: perhaps I should leave my old framework as is, and for each new project I receive, I make a decision on whether the requirements are best served by developing with CI or my own framework. Is this the right approach?

    Read the article

  • Oracle why does creating trigger fail when there is a field called timestamp?

    - by Omar Kooheji
    I've just wasted the past two hours of my life trying to create a table with an auto incrementing primary key bases on this tutorial, The tutorial is great the issue I've been encountering is that the Create Target fails if I have a column which is a timestamp and a table that is called timestamp in the same table... Why doesn't oracle flag this as being an issue when I create the table? Here is the Sequence of commands I enter: Creating the Table: CREATE TABLE myTable (id NUMBER PRIMARY KEY, field1 TIMESTAMP(6), timeStamp NUMBER, ); Creating the Sequence: CREATE SEQUENCE test_sequence START WITH 1 INCREMENT BY 1; Creating the trigger: CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON myTable REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT test_sequence.nextval INTO :NEW.ID FROM dual; END; / Here is the error message I get: ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed Any combination that does not have the two lines with a the word "timestamp" in them works fine. I would have thought the syntax would be enough to differentiate between the keyword and a column name. As I've said I don't understand why the table is created fine but oracle falls over when I try to create the trigger... CLARIFICATION I know that the issue is that there is a column called timestamp which may or may not be a keyword. MY issue is why it barfed when I tried to create a trigger and not when I created the table, I would have at least expected a warning. That said having used Oracle for a few hours, it seems a lot less verbose in it's error reporting, Maybe just because I'm using the express version though. If this is a bug in Oracle how would one who doesn't have a support contract go about reporting it? I'm just playing around with the express version because I have to migrate some code from MySQL to Oracle.

    Read the article

  • Making Javascript and HTML5 games

    - by Jeff Meatball Yang
    A long time ago (Netscape 4-era), I wrote Javascript-based games: Pong, Minesweeper, and John Conway's Life among them. I'm getting back into it, and want to get my hands even dirtier. I have a few games in mind: Axis & Allies clone, with rugged maps and complex rules. Tetris clone, possibly with real-time player-vs-player or player-vs-computer mode Breakout clone, with a couple weapons and particle velocities In all of these, I have only a few objectives: Use JavaScript and HTML 5 - it should run on Chrome, Safari, or maybe an iPad. Start small and simple, then build-up features. Learn something new about game design and implementation. So my questions are: How would you implement these games? Do you have any technology recommendations? If you've written these games, what was the hardest part? N.B. I also want to start from first-principles - if you recommend a framework/library, I would appreciate some theory or implementation details behind it. These games are different enough that I should learn something new from each one.

    Read the article

  • How do I render *parts* of a svg file?

    - by Fake Code Monkey Rashid
    Hello good people! :) I want to render parts of a svg file by name but for the life of me I cannot figure out how to do so (using python + gtk). Here's the svg file in question: http://david.bellot.free.fr/svg-cards/files/SVG-cards-2.0.1.tar.gz On his site, David, says: You can draw a card either by rendering the file onto a pixmap and clipping each card manually or by using the card's name through a DOM interface. All cards are embedded into a SVG group. I don't know what he means by a DOM interface. I have done some searching and the best result I found that seems to fit what I want to do is: QSvgRenderer *renderer = new QSvgRenderer(QLatin1String("SvgCardDeck.svg")); QGraphicsSvgItem *black = new QGraphicsSvgItem(); QGraphicsSvgItem *red = new QGraphicsSvgItem(); black->setSharedRenderer(renderer); black->setElementId(QLatin1String("black_joker")); red->setSharedRenderer(renderer); red->setElementId(QLatin1String("red_joker")); Notice however that it is for Qt and is not even written in python. This is what I have so far: #!/usr/bin/env python from __future__ import absolute_import import cairo import gtk import rsvg from xml import xpath from xml.dom import minidom window = gtk.Window() window.set_title("Foo") window.set_size_request(256, 256) window.set_property("resizable", False) window.set_position(gtk.WIN_POS_CENTER) window.connect("destroy", gtk.main_quit) window.show() document = minidom.parse("cards.svg") element = xpath.Evaluate("//*[@id='1_club']", document)[0] xml = element.toxml() svg = rsvg.Handle() svg.write(xml) pixbuf = svg.get_pixbuf() image = gtk.Image() image.set_from_pixbuf(pixbuf) image.show() window.add(image) gtk.main() It doesn't work, of course. What am I missing?

    Read the article

  • Setting Connection Parameters via ADO for SQL Server

    - by taspeotis
    Is it possible to set a connection parameter on a connection to SQL Server and have that variable persist throughout the life of the connection? The parameter must be usable by subsequent queries. We have some old Access reports that use a handful of VBScript functions in the SQL queries (let's call them GetStartDate and GetEndDate) that return global variables. Our application would set these before invoking the query and then the queries can return information between date ranges specified in our application. We are looking at changing to a ReportViewer control running in local mode, but I don't see any convenient way to use these custom functions in straight T-SQL. I have two concept solutions (not tested yet), but I would like to know if there is a better way. Below is some pseudo code. Set all variables before running Recordset.OpenForward Connection->Execute("SET @GetStartDate = ..."); Connection->Execute("SET @GetEndDate = ..."); // Repeat for all parameters Will these variables persist to later calls of Recordset->OpenForward? Can anything reset the variables aside from another SET/SELECT @variable statement? Create an ADOCommand "factory" that automatically adds parameters to each ADOCommand object I will use to execute SQL // Command has been previously been created ADOParameter *Parameter1 = Command->CreateParameter("GetStartDate"); ADOParameter *Parameter2 = Command->CreateParameter("GetEndDate"); // Set values and attach etc... What I would like to know if there is something like: Connection->SetParameter("GetStartDate", "20090101"); Connection->SetParameter("GetEndDate", 20100101"); And these will persist for the lifetime of the connection, and the SQL can do something like @GetStartDate to access them. This may be exactly solution #1, if the variables persist throughout the lifetime of the connection.

    Read the article

  • Yet another Haskell vs. Scala question

    - by Travis Brown
    I've been using Haskell for several months, and I love it—it's gradually become my tool of choice for everything from one-off file renaming scripts to larger XML processing programs. I'm definitely still a beginner, but I'm starting to feel comfortable with the language and the basics of the theory behind it. I'm a lowly graduate student in the humanities, so I'm not under a lot of institutional or administrative pressure to use specific tools for my work. It would be convenient for me in many ways, however, to switch to Scala (or Clojure). Most of the NLP and machine learning libraries that I work with on a daily basis (and that I've written in the past) are Java-based, and the primary project I'm working for uses a Java application server. I've been mostly disappointed by my initial interactions with Scala. Many aspects of the syntax (partial application, for example) still feel clunky to me compared to Haskell, and I miss libraries like Parsec and HXT and QuickCheck. I'm familiar with the advantages of the JVM platform, so practical questions like this one don't really help me. What I'm looking for is a motivational argument for moving to Scala. What does it do (that Haskell doesn't) that's really cool? What makes it fun or challenging or life-changing? Why should I get excited about writing it?

    Read the article

  • Errors when creating a custom Querable object with MVC and Subsonic pagedlist

    - by minus4
    hiya, i have the following code but when i try and create a new IQuerable i get an error that the interface cannot be implemented, if i take away the new i get a not implemented exception, have had to jump back and work on some old ASP classic sites for past month and for the life of me i can not wake my brain up into C# mode. Could you please have a look at below and give me some clues on where i'm going wrong: The code is to create a list of priceItems, but instead of a categoryID (int) i am going to be showing the name as string. public ActionResult ViewPriceItems(int? page) { var crm = 0; page = GetPage(page); // try and create items2 IQueryable<ViewPriceItemsModel> items2 = new IQueryable<ViewPriceItemsModel>(); // the data to be paged,but unmodified var olditems = PriceItem.All().OrderBy(x => x.PriceItemID); foreach (var item in olditems) { // set category as the name not the ID for easier reading items2.Concat(new [] {new ViewPriceItemsModel {ID = item.PriceItemID, Name = item.PriceItem_Name, Category = PriceCategory.SingleOrDefault( x => x.PriceCategoryID == item.PriceItem_PriceCategory_ID).PriceCategory_Name, Display = item.PriceItems_DisplayMethod}}); } crm = olditems.Count() / MaxResultsPerPage; ViewData["numtpages"] = crm; ViewData["curtpage"] = page + 1; // return a paged result set return View(new PagedList<ViewPriceItemsModel>(items2, page ?? 0, MaxResultsPerPage)); } many thanks

    Read the article

  • Problem with using malloc in link lists (urgent ! help please)

    - by Abhinav
    I've been working on this program for five months now. Its a real time application of a sensor network. I create several link lists during the life of the program and Im using malloc for creating a new node in the link. What happens is that the program suddenly stops or goes crazy and restarts. Im using AVR and the microcontroller is ATMEGA 1281. After a lot of debugging I figured out that that the malloc is causing the problem. I do not free the memory after exiting the function that creates a new link so Im guessing that this is eventually causing the heap memory to overflow or something like that. Now if I use the free() function to deallocate the memory at the end of the function using malloc, the program just gets stuck when the control reaches free(). Is this because the memory becomes too clustered after calling free() ? I also create reference tables for example if 'head' is a new link list and I create another list called current and make it equal to head. table *head; table *current = head; After the end of the function if I use free free(current); current = NULL: Then the program gets stuck here. I dont know what to do. What am I doing wrong? Is there a way to increase the size of the heap memory Please help...

    Read the article

  • Passing Binary Data to a Stored Procedure in SQL Server 2008

    - by Joe Majewski
    I'm trying to figure out a way to store files in a database. I know it's recommended to store files on the file system rather than the database, but the job I'm working on would highly prefer using the database to store these images (files). There are also some constraints. I'm not an admin user, and I have to make stored procedures to execute all the commands. This hasn't been of much difficulty so far, but I cannot for the life of me establish a way to store a file (image) in the database. When I try to use the BULK command, I get an error saying "You do not have permission to use the bulk load statement." The bulk utility seemed like the easy way to upload files to the database, but without permissions I have to figure a work-a-round. I decided to use an HTML form with a file upload input type and handle it with PHP. The PHP calls the stored procedure and passes in the contents of the file. The problem is that now it's saying that the max length of a parameter can only be 128 characters. Now I'm completely stuck. I don't have permissions to use the bulk command and it appears that the max length of a parameter that I can pass to the SP is 128 characters. I expected to run into problems because binary characters and ascii characters don't mix well together, but I'm at a dead end... Thanks

    Read the article

  • Sell me Distributed revision control

    - by ring bearer
    I know 1000s of similar topics floating around. I read at lest 5 threads here in SO But why am I still not convinced about DVCS? I have only following questions (note that I am selfishly worried only about Java projects) What is the advantage or value of committing locally? What? really? All modern IDEs allows you to keep track of your changes? and if required you can restore a particular change. Also, they have a feature to label your changes/versions at IDE level!? what if I crash my hard drive? where did my local repository go? (so how is it cool compared to checking in to a central repo?) Working offline or in an air plane. What is the big deal?In order for me to build a release with my changes, I must eventually connect to the central repository. Till then it does not matter how I track my changes locally. Ok Linus Torvalds gives his life to Git and hates everything else. Is that enough to blindly sing praises? Linus lives in a different world compared to offshore developers in my mid-sized project? Pitch me!

    Read the article

  • Enforce strong type checking in C (type strictness for typedefs)

    - by quinmars
    Is there a way to enforce explicit cast for typedefs of the same type? I've to deal with utf8 and sometimes I get confused with the indices for the character count and the byte count. So it be nice to have some typedefs: typedef unsigned int char_idx_t; typedef unsigned int byte_idx_t; With the addition that you need an explicit cast between them: char_idx_t a = 0; byte_idx_t b; b = a; // compile warning b = (byte_idx_t) a; // ok I know that such a feature doesn't exist in C, but maybe you know a trick or a compiler extension (preferable gcc) that does that. EDIT: I still don't really like the Hungarian notation in general, I couldn't used it for this problem because of project coding conventions, but I used it now in another similar case, where also the types are the same and the meanings are very similar. And I have to admit: it helps. I never would go and declare every integer with a starting "i", but as in Joel's example for overlapping types, it can be life saving.

    Read the article

  • {DCC Warning} W1036 Variable '$frame' might not have been initialized?

    - by Gad D Lord
    Any ideas why I get this warning in Delphi XE: [DCC Warning] Form1.pas(250): W1036 Variable '$frame' might not have been initialized procedure TForm1.Action1Execute(Sender: TObject); var Thread: TThread; begin ... Thread := TThread.CreateAnonymousThread( procedure{Anonymos}() procedure ShowLoading(const Show: Boolean); begin /// <------------- WARNING IS GIVEN FOR THIS LINE (line number 250) Thread.Synchronize(Thread, procedure{Anonymous}() begin ... Button1.Enabled := not Show; ... end ); end; var i: Integer; begin ShowLoading(true); try Thread.Synchronize(Thread, procedure{Anonymous}() begin ... // some UI updates end Thread.Synchronize(Thread, procedure{Anonymous}() begin ... // some UI updates end ); finally ShowLoading(false); end; end ).NameThread('Some Thread Name'); Thread.Start; end; I do not have anywhere in my code a variable names frame nor $frame. I am even not sure how $frame with $ sign can be a valid identifier. Smells like compiler magic to me. PS: Of course the real life xosw is having other than Form1, Button1, Action1 names.

    Read the article

  • Which version of Grady Booch's OOA/D book should I buy?

    - by jackj
    Grady Booch's "Object-Oriented Analysis and Design with Applications" is available brand new in both the 2nd edition (1993) and the 3rd edition (2007), while many used copies of both editions are available. Here are my concerns: 1) The 2nd edition uses C++: given that I just finished reading my first two C++ books (Accelerated C++ and C++ Primer) I guess practical tips can only help, so the 2nd edition is probably best (I think the 3rd edition has absolutely no code). On the other hand, the C++ books I read insist on the importance of using standard C++, whereas Booch's 2nd edition was published before the 1998 standard. 2) The 2nd edition is shorter (608 pages vs. 720) so, I guess, it will be slightly easier to get through. 3) The 3rd edition uses UML 2.0, whereas the 2nd edition is pre-UML. Some reviews say that the notation in the 2nd edition is close enough to UML, so it doesn't matter, but I don't know if I should be worrying about this or not. 4) The 2nd edition is available in good-shape used copies for considerably less than what the 3rd one goes for. Given all the above factors, do you think I should buy the 2nd or the 3rd edition? Recommendations on other books are also welcome but I would prefer it if whoever answers has read at least one of the versions of Booch's book (preferably both!). I have already bought but not read GoF and Riel's books. I also know that I should practice a lot with real-life code. Thanks.

    Read the article

  • Fastest way to modify a decimal-keyed table in MySQL?

    - by javanix
    I am dealing with a MySQL table here that is keyed in a somewhat unfortunate way. Instead of using an auto increment table as a key, it uses a column of decimals to preserve order (presumably so its not too difficult to insert new rows while preserving a primary key and order). Before I go through and redo this table to something more sane, I need to figure out how to rekey it without breaking everything. What I would like to do is something that takes a list of doubles (the current keys) and outputs a list of integers (which can be cast down to doubles for rekeying). For example, input {1.00, 2.00, 2.50, 2.60, 3.00} would give output {1, 2, 3, 4, 5). Since this is a database, I also need to be able to update the rows nicely: UPDATE table SET `key`='3.00' WHERE `key`='2.50'; Can anyone think of a speedy algorithm to do this? My current thought is to read all of the doubles into a vector, take the size of the vector, and output a new vector with values from 1 => doubleVector.size. This seems pretty slow, since you wouldn't want to read every value into the vector if, for instance, only the last n/100 elements needed to be modified. I think there is probably something I can do in place, since only values after the first non-integer double need to be modified, but I can't for the life of me figure anything out that would let me update in place as well. For instance, setting 2.60 to 3.00 the first time you see 2.50 in the original key list would result in an error, since the key value 3.00 is already used for the table.

    Read the article

< Previous Page | 120 121 122 123 124 125 126 127 128 129 130 131  | Next Page >