Search Results

Search found 1369 results on 55 pages for 'jc martin'.

Page 35/55 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Managing inverse relationships without CoreData

    - by Nathaniel Martin
    This is a question for Objective-J/Cappuccino, but I added the cocoa tag since the frameworks are so similar. One of the downsides of Cappuccino is that CoreData hasn't been ported over yet, so you have to make all your model objects manually. In CoreData, your inverse relationships get managed automatically for you... if you add an object to a to-many relationship in another object, you can traverse the graph in both directions. Without CoreData, is there any clean way to setup those inverse relationships automatically? For a more concrete example, let's take the typical Department and Employees example. To use rails terminology, a Department object has-many Employees, and an Employee belongs-to a Department. So our Department model has an NSMutableSet (or CPMutableSet ) "employees" that contains a set of Employees, and our Employee model has a variable "department" that points back to the Department model that owns it. Is there an easy way to make it so that, when I add a new Employee model into the set, the inverse relationship (employee.department) automatically gets set? Or the reverse: If I set the department model of an employee, then it automatically gets added to that department's employee set? Right know I'm making an object, "ValidatedModel" that all my models subclass, which adds a few methods that setup the inverse relationships, using KVO. But I'm afraid that I'm doing a lot of pointless work, and that there's already an easier way to do this. Can someone put my concerns to rest?

    Read the article

  • Haskell - Parsec Parsing <p> element

    - by Martin
    I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this: This is the first paragraph example\n with two lines\n \n And this is the second paragraph\n And my output should be: <p>This is the first paragraph example\n with two lines\n</p> <p>And this is the second paragraph\n</p> I defined: line= do{ ;t<-manyTill (anyChar) newline ;return t } paragraph = do{ t<-many1 (line) ;return ( p << t ) } But it returns: <p>This is the first paragraph example\n with two lines\n\n And this is the second paragraph\n</p> What is wrong? Any ideas? Thanks!

    Read the article

  • Sending SMTP e-mail at a high rate in .NET

    - by Martin Liversage
    I have a .NET service that processes a queue on a background thread and from the items in the queue sends out a large number of small e-mail messages at a very high rate (say 100 messages per second if that is even possible). Currently, I use SmtpClient.Send() but I'm afraid that it may hamper performance. Each call to Send() goes through a full cycle of opening the socket, performing the SMTP conversation (HELO, MAIL FROM, RCPT TO, DATA) and closing the socket. In pseudo code: for each message { open socket send HELO send MAIL FROM send RCPT TO send DATA close socket } I would think that the following pseudo code would be more optimal: open socket send HELO for each message { send MAIL FROM send RCPT TO send DATA } send QUIT close socket Should I be concerned about the performance of SmtpClient.Send() when sending e-mail at a high rate? What are my options for optimizing the performance?

    Read the article

  • What is the preferred way in C++ for converting a builtin type (int) to bool?

    - by Martin
    When programming with Visual C++, I think every developer is used to see the warning warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' from time to time. The reason obviously is that BOOL is defined as int and directly assigning any of the built-in numerical types to bool is considered a bad idea. So my question is now, given any built-in numerical type (int, short, ...) that is to be interpreted as a boolean value, what is the/your preferred way of actually storing that value into a variable of type bool? Note: While mixing BOOL and bool is probably a bad idea, I think the problem will inevitably pop up whether on Windows or somewhere else, so I think this question is neither Visual-C++ nor Windows specific. Given int nBoolean; I prefer this style: bool b = nBoolean?true:false; The following might be alternatives: bool b = !!nBoolean; bool b = (nBoolean != 0); Is there a generally preferred way? Rationale? I should add: Since I only work with Visual-C++ I cannot really say if this is a VC++ specific question or if the same problem pops up with other compilers. So it would be interesting to specifically hear from g++ or users how they handle the int-bool case. Regarding Standard C++: As David Thornley notes in a comment, the C++ Standard does not require this behavior. In fact it seems to explicitly allow this, so one might consider this a VC++ weirdness. To quote the N3029 draft (which is what I have around atm.): 4.12 Boolean conversions [conv.bool] A prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member type can be converted to a prvalue of type bool. A zero value, null pointer value, or null member pointer value is converted to false; any other value is converted to true. (...)

    Read the article

  • Algorithm to classify a list of products?

    - by Martin
    I have a list representing products which are more or less the same. For instance, in the list below, they are all Seagate hard drives. Seagate Hard Drive 500Go Seagate Hard Drive 120Go for laptop Seagate Barracuda 7200.12 ST3500418AS 500GB 7200 RPM SATA 3.0Gb/s Hard Drive New and shinny 500Go hard drive from Seagate Seagate Barracuda 7200.12 Seagate FreeAgent Desk 500GB External Hard Drive Silver 7200RPM USB2.0 Retail For a human being, the hard drives 3 and 5 are the same. We could go a little bit further and suppose that the products 1, 3, 4 and 5 are the same and put in other categories the product 2 and 6. We have a huge list of products that I would like to classify. Does anybody have an idea of what would be the best algorithm to do such thing. Any suggestions? I though of a Bayesian classifier but I am not sure if it is the best choice. Any help would be appreciated! Thanks.

    Read the article

  • Eclipse PDT "tips" ?

    - by Pascal MARTIN
    Hi ! (Yes, this is a quite opened and general and subjective question -- it's by design, cause I want tips you think are great !) I'm using Eclipse PDT 2.1 to work in PHP, either for small and/or big projects -- I've been doing so for quite some times, now, actually (since before 1.0 stable, if I remember well)... I was wondering if any of you did know "tips" to be more efficient. Let met explain more in details : I know about things like plugins like Aptana (better editor for JS/CSS), Subversive (for SVN access), RSE, Filesync, integrating Xdebug's debugger, ... What I mean by "tips" is more some little things you discovered one day and since use all the time -- and allow you to be more efficient in your PHP projects. Some examples of "tips" that come to my mind, and that already know and use : ctrl+space to open the list of suggestions for functions / variables names ctrl+shift+R (navigate > open resource) to open a popup which show only files which names contain what you type ; ie, quick opening of files this one might be the perfect example : I know this one is not often known by coworkers and they find it as useful as I do ; so, I guess there might be lots of other things like this one I don't know myself ^^ ctrl+M to switch to full-screen view for the editor (instead of double-click on tabs bar) shift+F2 while on a function name, to open it's page if the PHP manual in a browser Attention Mac Users use Command instead Control. I guess you get the point ; but I'm really open to any suggestion (be it eclipse-related in general, of more PHP/PDT-specific) that can help be be more efficient :-) Anyway, thanks in advance for your help !

    Read the article

  • MySQL treats ÅÄÖ as AAO?!

    - by Martin
    These two querys gives me the exact same result: select * from topics where name='Harligt'; select * from topics where name='Härligt'; How is this possible? Seems like mysql translates åäö to aao when it searches. Is there some way to turn this off? I use utf-8 encoding everywhere as far as i know. The same problem occurs both from terminal and from php.

    Read the article

  • Excel: Make conditional formatting static

    - by Martin
    Is there any way to convert conditional formatting to static formatting in Excel? I'm trying to export a range of a Excel Sheet to a new Workbook, with identical appearance but no formulas, links, etc. The problem here is that I have conditional formatting that relies on calculations outside exported range. I've tried saving the workbook to .html, oddly enough the formatting shows in IE but not when reopening it in Excel.

    Read the article

  • Calling services from the Orchestrating layer in SOA?

    - by Martin Lee
    The Service Oriented Architecture Principles site says that Service Composition is an important thing in SOA. But Service Loose Coupling is important as well. Does that mean that the "Orchestrating layer" should be the only one that is allowed to make calls to services in the system? As I understand SOA, the "Orchestrating layer" 'glues' all the services together into one software application. I tried to depict that on Fig.A and Fig.B. The difference between the two is that on Fig.A the application is composed of services and all the logic is done in the "Orchestrating layer" (all calls to services are done from the "Orchestrating layer" only). On Fig.B the application is composed from services, but one service calls another service. Does the architecture on Fig.B violate the "Service Loose Coupling" principle of SOA? Can a service call another service in SOA? And more generally, can the architecture on Fig.A be considered superior to the one on Fig.B in terms of service loose coupling, abstraction, reusability, autonomy, etc.? My guess is that the A architecture is much more universal, but it can add some unnecessary data transfers between the "Orchestrating layer" and all the called services.

    Read the article

  • sbt: "test" works "test:run" not

    - by Martin
    I try to establish a build pipeline on Jenkins with a Play(2.0.2) project. As I want to just build the sources once and use the classes for downstream builds, I now have created a "compile"-job, that runs "sbt test:compile". That works so far. The next job should then just run the compiled tests. If I use "sbt test" it works as expected, but compiles the sources again. But if I try to run "sbt test:run" it says: [info] Loading project definition from ~/myproject/project [info] Set current project to myproject (in build file: ~/myproject/) java.lang.RuntimeException: No main class detected. at scala.sys.package$.error(package.scala:27) [error] {file:~/myproject/test:run: No main class detected. The same happens locally. I can run "sbt test" but not "sbt test:run". Same error. Is there someone who can point me to the right direction?

    Read the article

  • Mapping an instance of IList in NHibernate

    - by Martin Kirsche
    I'm trying to map a parent-child relationship using NHibernate (2.1.2), MySql.Data (6.2.2) and MySQL Server (5.1). I figured out that this must be done using a <bag> in the mapping file. I build a test app which is running without yielding any errors and is doing an insert for each entry but somehow the foreign key inside the children table (ParentId) is always empty (null). Here are the important parts of my code... Parent public class Parent { public virtual int Id { get; set; } public virtual IList<Child> Children { get; set; } } <class name="Parent"> <id name="Id"> <generator class="native"/> </id> <bag name="Children" cascade="all"> <key column="ParentId"/> <one-to-many class="Child"/> </bag> </class> Child public class Child { public virtual int Id { get; set; } } <class name="Child"> <id name="Id"> <generator class="native"/> </id> </class> Program using (ISession session = sessionFactory.OpenSession()) { session.Save( new Parent() { Children = new List<Child>() { new Child(), new Child() } }); } Any ideas what I did wrong?

    Read the article

  • What is the relationship between IRimTable and PersistenceStore?

    - by Martin
    The BlackBerry Desktop API has the interface IRimTable which apparently maps an "application database" on a BlackBerry device to a virtual structure (i.e, IRimTable has IRimRecords, each of which has IRimField) that developer can browse the handheld device data when it is connected to a desktop computer. Meanwhile, applications in the handheld device can store its data in PersistenceStore databases. The point where I'm stuck is the PersistenceStore API doesn't define any Table or Records or Fields. Does anybody knows what is the relationship between these two classes? And how does the mapping work (if at all) ?

    Read the article

  • Copy NSArray and replace text items with bool values

    - by Frank Martin
    I utilize a (nested) plist to populate UITableViews where users can select entries at the deepest levels and set a checkmark (or not). I want to save these selections in a same structured list where at the deepest level the NSArray contains bool values instead the text strings that are displayed in the UITableView. So how can i build from a hierarchy like the following: Root - Item 0 (Dictionary) - Group (Dictionary) - Items (NSArray) - Item 0: @"Please check me" (String) a hierarchy like this? Root - Item 0 (Dictionary) - Group (Dictionary) - Items (NSArray) - Item 0: 0 (NSNumber) // NSNumber for bool values I'm trying to create a deep mutable copy and replace the items at the deepest levels but have somehow the feeling that this can be done easier. Thanks for any help with this in advance. Frank

    Read the article

  • How do I get a div to float to the bottom of its container?

    - by Stephen Martin
    I have floated images and inset boxes at the top of a container using float:right (or left) many times. Recently I hit a need to float a div at the bottom right corner of another div with the normal text wrap that you get with float (text wrapped above and to the left only). I thought this must be relatively easy even though float has no bottom value but I haven't been able to do it using a number of techniques and searching the web hasn't come up with anything other than using absolute positioning but this doesn't give the correct word wrap behaviour. I had thought this would be a very common design but apparently it isn't. If nobody has a suggestion I'll have to break my text up into separate boxes and align the div manually but that is rather precarious and I'd hate to have to do it on every page that needs it.

    Read the article

  • Custom Online Backup Solution Advice

    - by Martín Marconcini
    I have to implement a way so our customers can backup their SQL 2000/5/8 databasase online. The application they use is a C#/.NET35 Winforms application that connects to a SQL Server (can be 2000/2005/2008, sometimes express editions). The SQL Server is on the same LAN. Our application has a very specific UI and we must code each form following those guidelines. There’s lots of GDI+ to give it the look and feel we want. For that reason, using a 3rd party application is not a very good idea. We need to charge the customer on a monthly/annual basis for the service. Preferably, the customer doesn’t need to care about bandwidth and storage space. It must be transparent. Given the above reqs., my first thoughts are: Solution 1: Code some sort of FTP basic functionality with behind the scenes SQL Backup mechanism, then hire a Hosting service and compress-transfer the .BAK to the Hosting. Maintain a series of Folders (for each customer). They won’t see what’s happening. They will just see a list of their files and a big “Backup now” button that will perform the SQL backup, compress it and upload it (and update the file list) ;) Pros: Not very complicated to implement, simple to use, fairly simple to configure (could have a dedicated ftp user/pass) Cons: Finding a “ftp” only hosting plan is not probably going to be easy, they usually come with a bunch of stuff. FTP is not always the best protocol. more? Solution 2: Similar to 1, but instead of FTP, find a cloud computing service like Amazon S3, Mosso or similar. Pros: Cloud Storage is fast, reliable, etc. It’s kind of easy to implement (specially if there are APIs like AWS or Mosso). Cons: I have been unable to come up with a service optimized for resellers where I can give multiple sub-accounts (one for each customer). Billing is going to be a nightmare cuz these services bill per/GB and with One account it’s impossible to differentiate each customer. Solution 3: Similar to 2, but letting the user create their own account on Amazon S3 (for example). Pros: You forget about billing and such. Cons: A mess for the customer who has to open the Amazon (or whatever) account, will be charged for that and not from you. You can’t really charge the customer (since you’re just not doing anything). Solution 4: Use one of the many backup online solutions that use the tech in cloud storage. Pros: many of these include SQL Server backup, and a lot of features that we’d have to implement. Plus web access and stuff like that will come included. Cons: Still have the billing problem described in number 2. Little of these companies (if any) offers “reseller” accounts. You have to eventually use their software (some offer certain branding). Any better approach? Summary: You have a software (.NET Winapp). You want your users to be able to backup their SQL Server databases online (and be able to retrieve the backups if needed). You ideally would like to charge the customer for this service (i.e. XX € a year).

    Read the article

  • How to write a spinlock without using CAS

    - by Martin
    Following on from a discussion which got going in the comments of this question. How would one go about writing a Spinlock without CAS operations? As the other question states: The memory ordering model is such that writes will be atomic (if two concurrent threads write a memory location at the same time, the result will be one or the other). The platform will not support atomic compare-and-set operations.

    Read the article

  • Windows Mobile: "My network card connects to" registry settings

    - by Martin Robins
    Can anybody please tell me the registry setting(s) that are affected in Windows Mobile 6.1 when a user selects Start - Settings - Connections - Wi-Fi and then changes the value of the "My network card connects to" drop down list on the "Network Adapters" tab? I have a device that seems to default this to "The Internet" when in fact the Wi-Fi connects to the corporate network and I would like to be able to change this programatically rather than expecting 250+ users to have to do it manually every time they reboot their devices. Thanks.

    Read the article

  • WPF validation on Enter Key Up

    - by Martin
    I'm trying to validate a UI change when Enter key is pressed. The UI element is a textbox, which is data binded to a string. My problem is that the data binding hasn't updated TestText when Enter key is Up. It is only updated when I press the button which brings up a message box. /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window, INotifyPropertyChanged { String _testText = new StringBuilder("One").ToString(); public string TestText { get { return _testText; } set { if (value != _testText) { _testText = value; OnPropertyChanged("TestText"); } } } public Window1() { InitializeComponent(); myGrid.DataContext = this; } private void OnPropertyChanged(string property) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(property)); } } public event PropertyChangedEventHandler PropertyChanged; private void onKeyUp(object sender, KeyEventArgs e) { if (e.Key != System.Windows.Input.Key.Enter) return; System.Diagnostics.Trace.WriteLine(TestText); } private void button1_Click(object sender, RoutedEventArgs e) { MessageBox.Show(TestText); } } Window XAML: Window x:Class="VerificationTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" KeyUp="onKeyUp" TextBox XAML: TextBox Name="myTextBox" Text="{Binding TestText}" Button XAML: Button Name="button1" Click="button1_Click"

    Read the article

  • Best Practice: User generated HTML cleaning

    - by Martin
    I'm coding a WYSIWYG editor width designMode="on" on a iframe. The editor works fine and i store the code as is in the database. Before outputing the html i need to "clean" with php on the server-side to avoid cross-site-scripting and other scary things. Is there some sort of best practice on how to do this? What tags can be dangerous? UPDATE: Typo fixed, it's What You See Is What You Get. Nothing new :)

    Read the article

  • Example of forum in Object Oriented PHP

    - by Martin Trigaux
    Hello, I'm trying to learn to use PHP with an object oriented scheme. I think I understand the concept but I need real example, a forum exactly (the closest to what I want to do). I know PhpBB but it's maybe too complicated to fully understand it so I'm looking for something simpler but still in object oriented. Do you know any ? Thank you

    Read the article

  • data not reloading into tableview from core data on minor update

    - by Martin KS
    I've got a basic photo album application, on the first view a list of albums is displayed with a subtitle showing how many images are in each album. I've got everything working to add albums, and add images to albums. The problem is that the image count lines are accurate whenever the app loads, but I can't get them to update during execution. The following viewdidload correctly populates all lines of the tableview when the app loads: - (void)viewDidLoad { [super viewDidLoad]; // Set the title. self.title = @"Photo albums"; // Configure the add and edit buttons. self.navigationItem.leftBarButtonItem = self.editButtonItem; addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addAlbum)]; addButton.enabled = YES; self.navigationItem.rightBarButtonItem = addButton; /* Fetch existing albums. Create a fetch request; find the Album entity and assign it to the request; add a sort descriptor; then execute the fetch. */ NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Album" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // Order the albums by name. NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"albumName" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptor release]; [sortDescriptors release]; // Execute the fetch -- create a mutable copy of the result. NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. } LocationsAppDelegate *mainDelegate = (LocationsAppDelegate *)[[UIApplication sharedApplication] delegate]; // Set master albums array to the mutable array, then clean up. [mainDelegate setAlbumsArray:mutableFetchResults]; [mutableFetchResults release]; [request release]; } But when I run similar code inside viewdidappear, nothing happens: { /* Fetch existing albums. Create a fetch request; find the Album entity and assign it to the request; add a sort descriptor; then execute the fetch. */ NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Album" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // Order the albums by creation date, most recent first. NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"albumName" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptor release]; [sortDescriptors release]; // Execute the fetch -- create a mutable copy of the result. NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. } LocationsAppDelegate *mainDelegate = (LocationsAppDelegate *)[[UIApplication sharedApplication] delegate]; // Set master albums array to the mutable array, then clean up. [mainDelegate setAlbumsArray:mutableFetchResults]; [self.tableView reloadData]; [mutableFetchResults release]; [request release]; } Apologies if I've missed the answer to this question elsewhere, but what am I missing?

    Read the article

  • Why "cannot use an object as a parameter to a method"?

    - by Martin
    I have the following ViewController class #import <UIKit/UIKit.h> @interface SampleViewController : UIViewController { IBOutlet UITextField *field1; } @property (nonatomic, retain) UITextField *field1; - (IBAction) method1:(id)sender; @end When I change the method1:(id)sender to method1:(UITextField)sender, I get the error "Cannot use an object as a parameter to a method". I searched and found this post which says "it [using an object as a method parameter] is not a good idea in Objective-C because Objective-C does not allow statically allocated object". Can anyone point out where I can find a more detailed explanation for this? Thank you.

    Read the article

  • Twisted chainDeferred not working as expected

    - by Martin Gergov
    I have a problem figuring out a somewhat simple twisted python code. From what I have red in the docs, the code here should work without Unhandled Error. I get this: HELLO! HANDLED! HANDLED 2! Unhandled error in Deferred: Unhandled Error Traceback (most recent call last): File "package_tester.py", line 31, in <module> a().callback(2) File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 368, in callback self._startRunCallbacks(result) File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 464, in _startRunCallbacks self._runCallbacks() --- <exception caught here> --- File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 551, in _runCallbacks current.result = callback(current.result, *args, **kw) File "package_tester.py", line 5, in c raise Exception() exceptions.Exception: Isn't the failure from the chained deferred passed to end() errback ?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >