Search Results

Search found 1534 results on 62 pages for 'dan gibson'.

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

  • iPhone to iPhone communication

    - by Dan
    Hi, I have been looking into communication methods between two iPhone devices and as I understand it there are two main methods to do this: Bluetooth and WiFi. However I wanted to know if anyone knows of any other way of sharing information between two iPhones? If I were in an area with no WiFi or mobile signal, and couldn't use Bluetooth for whatever reason, is there anything that could be done to broadcast data from one iPhone to another? I'm sure its a bit of a silly question, but if you don't ask, you don't get; and if someone knows of anything I might be able to look into with regards to this, I would be very appreciative. Thanks, Dan

    Read the article

  • Combobox in bound DataGridView

    - by Dan
    Hi. I've got a DataGridView control which is bound to a database table. I want one of the columns in the gridview to be of combobox type. The combobox should contain a list of hardcoded strings, which is the same for all rows in the datagridview. One of the fields in my database table is an index for this list of hardcoded strings. I've programatically added a new column to the gridview of type "DataGridViewComboBoxColumn", which successfully creates the column with comboboxes in it. However, that's then not bound to the index field in my DB table. The index field in my DB table is actually automatically bound to a column via the DataAdapter::Fill method. I've set this column to hidden, so it's hidden to the user. Obviously just before updating the dataadapter, I can programatically fixup the hidden column in my datatable with the SelectedIndex of my combobox. Just wondering if there's a better way of doing this? Thankyou for any help with this, Dan.

    Read the article

  • Scheme Editor/IDE for Mac

    - by Carlton Gibson
    I've begun working through Structure and Interpretation of Computer Programs. Dutifully, I've installed mit-scheme. What I need now is an editor/IDE for the Mac that can handle the indentation and balance parentheses (or advice on how to best to configure the packaged tools). Any suggestions? TIA

    Read the article

  • Execute C++ exe from C# form using Process.start()

    - by Dan
    Hi, I'm trying to create a C# form app that will allow me to use all of my previous C++ programs from one central program. I'm able to open the exes with Process.start, however it does not compile the code correctly. Example code: Process.Start("C:\\Documents and Settings\\dan\\Desktop\\test.exe"); This will bring up the console and act like it's running, but it does not run like when I normally compile out of the C++ editor. Is there a startinfo variable I need to set to signify that it's a c++ program or something along that line? Also, is there any way to execute a C++ program using process.start that will allow me to pass it variables through the command line via argc and argv? Thanks

    Read the article

  • How do I close a database connection in a WCF service?

    - by Dan
    I have been unable to find any documentation on properly closing database connections in WCF service operations. I have a service that returns a streamed response through the following method. public virtual Message GetData() { string sqlString = BuildSqlString(); SqlConnection conn = Utils.GetConnection(); SqlCommand cmd = new SqlCommand(sqlString, conn); XmlReader xr = cmd.ExecuteXmlReader(); Message msg = Message.CreateMessage( OperationContext.Current.IncomingMessageVersion, GetResponseAction(), xr); return msg; } I cannot close the connection within the method or the streaming of the response message will be terminated. Since control returns to the WCF system after the completion of that method, I don't know how I can close that connection afterwards. Any suggestions or pointers to additional documentation would be appreciated. Dan

    Read the article

  • How to create Shared VB Array Initialisors for NerdDinner

    - by David A Gibson
    Hello, I am trying to work my way through the NerdDinner tutorial - and as an exercise I'm converting it to VB as I go. I'm not very far in and after having gotten past the C# Yield statement I'm stuck on Shared VB Array Initialisors. static IDictionary<string, Regex> countryRegex = new Dictionary<string, Regex>() { { "USA", new Regex("^[2-9]\\d{2}-\\d{3}-\\d{4}$")}, { "UK", new Regex("(^1300\\d{6}$)|(^1800|1900|1902\\d{6}$)|(^0[2|3|7|8]{1}[0- 9]{8}$)|(^13\\d{4}$)|(^04\\d{2,3}\\d{6}$)")}, { "Netherlands", new Regex("(^\\+[0-9]{2}|^\\+[0- 9]{2}\\(0\\)|^\\(\\+[0-9]{2}\\)\\(0\\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\\- \\s]{10}$)")}, Can anyone please help me write this in VB? Public Shared countryRegex As IDictionary(Of String, Regex) = New Dictionary(Of String, Regex)() {("USA", New Regex("^[2-9]\\d{2}-\\d{3}-\\d{4}$"))} This code has an error as it does not accept the String and the Regex as an item for the array. Thanks

    Read the article

  • Upload/Download images to FTP without bothering the user

    - by Dan B
    Hi, I know a lot of posts have been made in regards to FTP, but none have led me to what I need. I'm trying to upload a picture to a server (currently attempting FTP) but do it without notifying requiring the user to be involved. I want to be able to seamlessly upload/download the image when a certain user action occurs, but I don't want to use a third-party app like AndFTP. The idea is that a user will upload a picture, and then another user will be able to grab that picture based on which user put it up. No user will know where it's going or where it came from, nor will they navigate the FTP. Alternatively, does anyone have thoughts on a better way to do that? I thought of using the imgur api, but it can't be used commercially. It would, however, be perfect for my purposes. Is there a similar open-source alternative? Any help is greatly appreciated. Dan

    Read the article

  • Setting TreeView.DataContext doesn't refresh the tree

    - by dan gibson
    I have a List that I've bound to a TreeView. Setting TreeView.DataContext works - everything displays correctly. I then change the list (add an item to it) and set TreeView.DataContext again (to the same value) but the tree does not refresh with the new items. How do I get the treeview to refresh? This is basically my code: public class xItemCollection : ObservableCollection<xItem> { } public class xItem : INotifyPropertyChanged { xItemCollection _Items; public xItem() { _Items = new xItemCollection(); } public xItemCollection Items {get{return _Items;}} } ... this.RootItem = new xItem(); treeView.DataContext = this; Adding items to the list works until the tree is rendered for the first time. After it is rendered, adding/removing items does not refresh the tree.

    Read the article

  • JFrame not working correctly

    - by Nick Gibson
    This is making me very angry, I have worked on this for 2 days, have 2 books open and have looked through them, and STILL can't get this program to run the way I want it run. I'm getting to the point where if this doesn't help, I quit. I want a SIMPLE Frame application. It has a JComboBox centered at the top. Next to it is a text field big enough to show numeric digits such as "$49.99" Below it is a spot for a Text area showing terms of service Below that is the checkbox agreeing to the terms of service Below that is 2 buttons "Accept" and "Decline" I Have worked on this for 2 days, here is the coding: public class Bar extends JFrame implements ActionListener { public Bar(final JFrame frame) { String[] tests = { "A+ Certification", "Network+ Certification", "Security+ Certification", "CIT Full Test Package" }; JButton button = new JButton("Click Meh"); add(new JLabel("Welcome to the CIT Test Program ")); add(new JLabel("Please select which Test Package from the list below.")); frame.setVisible(true); frame.setSize(250,250); JPanel pane1 = new JPanel(new FlowLayout()); JPanel pane2 = new JPanel(new FlowLayout()); JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenu editMenu = new JMenu("Edit"); JMenu helpMenu = new JMenu("Help"); menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(helpMenu); JMenuItem newMenu = new JMenuItem("New (Ctrl+N)"); JMenuItem openMenu = new JMenuItem("Open (Ctrl+O)"); JMenuItem saveMenu = new JMenuItem("Save (Ctrl+S)"); saveMenu.addActionListener(this); JMenuItem exitMenu = new JMenuItem("Exit (Ctrl+W)"); JMenuItem cutMenu = new JMenuItem("Cut (Ctrl+X)"); JMenuItem copyMenu = new JMenuItem("Copy (Ctrl+C)"); JMenuItem pasteMenu = new JMenuItem("Paste (Ctrl+V)"); JMenuItem infoMenu = new JMenuItem("Help (Ctrl+H)"); fileMenu.add(newMenu); fileMenu.add(openMenu); fileMenu.add(saveMenu); fileMenu.add(exitMenu); editMenu.add(cutMenu); editMenu.add(copyMenu); editMenu.add(pasteMenu); helpMenu.add(infoMenu); frame.setJMenuBar(menuBar); JComboBox packageChoice = new JComboBox(tests); frame.add(packageChoice); } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); { } } EDIT: Forgot to add the second program public class JFrameWithPanel { public static void main(String[] args) { JPanel panel = new Bar(new JFrame("CIT Test Program")); } } How do I get this to have everything where I want it and show up? I'm very confused because of this and now barely even get how Frames work.

    Read the article

  • One large file or multiple small files?

    - by Dan
    I have an application (currently written in Python as we iron out the specifics but eventually it will be written in C) that makes use of individual records stored in plain text files. We can't use a database and new records will need to be manually added regularly. My question is this: would it be faster to have a single file (500k-1Mb) and have my application open, loop through, find and close a file OR would it be faster to have the records separated and named using some appropriate convention so that the application could simply loop over filenames to find the data it needs? I know my question is quite general so direction to any good articles on the topic are as appreciated as much as suggestions. Thanks very much in advance for your time, Dan

    Read the article

  • Static lib that links another static lib and qmake? Odd linking error

    - by Dan O
    I have two qt .pro files, both using the lib TEMPLATE and staticlib CONFIG. The first library (lets call it 'core') is a dependency for the second lib (I'll call it 'foo'). In fact, there's a class in foo that extends a class in core, I will call this class Bar. When I instantiate the class (which is defined and implemented in foo, but extends a class (Bar) from core) in another project (not a lib) I get the following linking error: /usr/bin/ld: Undefined symbols: Bar::Bar() Basically, the linker cannot find the class in the core lib that has been derived in the foo lib, but ONLY when I instantiate the class in a third project that is using both libs. Is this behaviour expected? Regards, Dan O Update: I fixed it by directly invoking the Bars constructor in the third project before using derived class... does anyone know why I need to do this?

    Read the article

  • How to create database records for a financial year

    - by David A Gibson
    Hello, I need to create entities (specifically contracts) in a database table that are associated with a financial year. These contracts will be applied to projects. Any contract variation will be recorded by creating a new contract record for the same financial year but the original will remain associated with the project as a history. The projects can last several years and so at any one time a project will have a live contract record for each year as well as any number of historic contracts for that year. All of which is incidental but I'm trying to provide some context. If the contracts where for the year - it would be easy and I'd just store the Year either as a date field with the 1st of January or just an Integer. However the contracts run for financial years and I don't know how to approach this. I don't want a separate table containing the financial years as I don't want the users to have to maintain this. I don't want to store the financial year as a string "2009/2010" as this is not ideal for sorting/extracting the data. Any ideas will be helpful, my best so far is to have starting and ending year in 2 columns and just "KNOW" that starting is April of the year etc Thanks

    Read the article

  • What is the proper way to URL encode Unicode characters?

    - by Josh Gibson
    I know of the non-standard %uxxxx scheme but that doesn't seem like a wise choice since the scheme has been rejected by the W3C. Some interesting examples: The heart character. If I type this into my browser: http://www.google.com/search?q=? Then copy and paste it, I see this URL http://www.google.com/search?q=%E2%99%A5 which makes it seem like Firefox (or Safari) is doing this. urllib.quote_plus(x.encode("latin-1")) '%E2%99%A5' which makes sense, except for things that can't be encoded in Latin-1, like the triple dot character. … If I type the URL http://www.google.com/search?q=… into my browser then copy and paste, I get http://www.google.com/search?q=%E2%80%A6 back. Which seems to be the result of doing urllib.quote_plus(x.encode("utf-8")) which makes sense since … can't be encoded with Latin-1. But then its not clear to me how the browser knows whether to decode with UTF-8 or Latin-1. Since this seems to be ambiguous: In [67]: u"…".encode('utf-8').decode('latin-1') Out[67]: u'\xc3\xa2\xc2\x80\xc2\xa6' works, so I don't know how the browser figures out whether to decode that with UTF-8 or Latin-1. What's the right thing to be doing with the special characters I need to deal with?

    Read the article

  • Using bash shell from within PHP

    - by Dan
    Hi everyone, In my terminal window (using Max OS X) my shell is bash. However when I run a command in PHP via shell_exec or backtick operators I see that PHP is using the Bourne Shell (sh). Here's an example of what I'm seeing: From within my terminal window: $ echo $0 - bash Also if I call php as follows: $ php -r "echo shell_exec('echo $0');" -bash However, if I create a script called test.php with the following: <?php echo shell_exec('echo $0'); ?> And then run test php I get the following: $ php test.php sh I'm wanting to use the bash shell when calling shell_exec - why is it choosing the Bourne shell and can I force it to use bash? Thanks! Dan

    Read the article

  • Using TextOptions.TextFormattingMode with FormattedText

    - by dan gibson
    With WPF4 you can have non-blurry text by adding TextOptions.TextFormattingMode="Display" and TextOptions.TextRenderingMode="Aliased" to your xaml: <Window TextOptions.TextFormattingMode="Display" TextOptions.TextRenderingMode="Aliased"> This works fine for me except for when I draw text with DrawingContext.DrawText like this: void DrawText(DrawingContext dc) { FormattedText ft = new FormattedText("Hello World", System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, new Typeface(FontFamily, FontStyle, FontWeight, FontStretch), FontSize, brush); dc.DrawText(ft, new Point(rect.Left, rect.Top)); } How can I draw non-blurry text with FormattedText? ie I want TextOptions.TextFormattingMode="Display" and TextOptions.TextRenderingMode="Aliased" to be used.

    Read the article

  • Get list of named queries in NHibernate

    - by Dan
    I have a dozen or so named queries in my NHibernate project and I want to execute them against a test database in unit tests to make sure the syntax still matches the changing domain/database model. Currently I have a unit test for each named query where I get and execute the query, for example: IQuery query = session.GetNamedQuery("GetPersonSummaries"); var personSummaryArray = query.List(); Assert.That(personSummaryArray, Is.Not.Null); This works fine, but I would like to have one unit test that loops thru all of the named queries and executes them. Is there a way to discover all of the available named queries? Thanks Dan

    Read the article

  • Complicated football league Dynamic Ordering in MySQL?

    - by Dan
    I have a table 'games' for a football league as follows: date home_team_id away_team_id home_score away_score - 1 2 6 21 - 3 1 7 19 I can't figure out how to dynamically generate a list of team ID's ordered by Wins (then points for if poss)? -- I have this query which works fine when I have a $team_id but of cause then I can only do 1 team at a time, and that doesn't allow for ordering at query level ((SELECT COUNT(*) FROM `games` WHERE ((`home_score` > `away_score`) AND `home_team_id` = '.$team_id.')) + (SELECT COUNT(*) FROM `games` WHERE ((`home_score` < `away_score`) AND `away_team_id` = '.$team_id.'))) AS `wins` I wonder if i can use this with some form of GROUP, or mySQL can know the $team_id itself? I've also tried some multiple JOINs with the 'team' table but they didn't work either. Thanks, Dan

    Read the article

  • IDispatchMessageInspector to log plain-text soap messages?

    - by Dan Thomas
    I've written a WCF IDispatchMessageInspector, so I can log incomming and outgoing messages. But I'm not sure how to get a nicely-formatted XML string to log. My code looks something like this: public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext) { MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue); request = buffer.CreateMessage(); Log("Received", request.ToString(); return null; } The result of this logging includes things like "ampersand lt;" and some sort of binary-encoded data. How do I get something that looks like a standard soap XML document? I know this should be obvious, but I'm just too dense to figure it out. Thanks. Dan

    Read the article

  • How to close a JFrame in the middle of a program

    - by Nick Gibson
    public class JFrameWithPanel extends JFrame implements ActionListener, ItemListener { int packageIndex; double price; double[] prices = {49.99, 39.99, 34.99, 99.99}; DecimalFormat money = new DecimalFormat("$0.00"); JLabel priceLabel = new JLabel("Total Price: "+price); JButton button = new JButton("Check Price"); JComboBox packageChoice = new JComboBox(); JPanel pane = new JPanel(); TextField text = new TextField(5); JButton accept = new JButton("Accept"); JButton decline = new JButton("Decline"); JCheckBox serviceTerms = new JCheckBox("I Agree to the Terms of Service.", false); JTextArea termsOfService = new JTextArea("This is a text area", 5, 10); public JFrameWithPanel() { super("JFrame with Panel"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); pane.add(packageChoice); setContentPane(pane); setSize(250,250); setVisible(true); packageChoice.addItem("A+ Certification"); packageChoice.addItem("Network+ Certification "); packageChoice.addItem("Security+ Certifictation"); packageChoice.addItem("CIT Full Test Package"); pane.add(button); button.addActionListener(this); pane.add(text); text.setEditable(false); text.setBackground(Color.WHITE); text.addActionListener(this); pane.add(termsOfService); termsOfService.setEditable(false); termsOfService.setBackground(Color.lightGray); pane.add(serviceTerms); serviceTerms.addItemListener(this); pane.add(accept); accept.addActionListener(this); pane.add(decline); decline.addActionListener(this); } public void actionPerformed(ActionEvent e) { packageIndex = packageChoice.getSelectedIndex(); price = prices[packageIndex]; text.setText("$"+price); Object source = e.getSource(); if(source == accept) { if(serviceTerms.isSelected() == false) { JOptionPane.showMessageDialog(null,"Please accept the terms of service.", "Terms of Service", JOptionPane.ERROR_MESSAGE); } else { JOptionPane.showMessageDialog(null,"Thank you. We will now move on to registering your product."); pane.dispose(); } } else if(source == decline) { System.exit(0); } } public void itemStateChanged(ItemEvent e) { int select = e.getStateChange(); } public static void main(String[] args) { String value1; int constant = 1, invalidNum = 0, answerParse, packNum, packPrice; JOptionPane.showMessageDialog(null,"Hello!"+"\nWelcome to the CIT Test Program."); JOptionPane.showMessageDialog(null,"IT WORKS!"); } }//class How do I get this frame to close so that my JOptionPane Message Dialogs can continue in the program without me exiting the program completely. EDIT: I tried .dispose() but I get this: cannot find symbol symbol : method dispose() location: class javax.swing.JPanel pane.dispose(); ^

    Read the article

  • A Guide to Windows Hacking for Mac Users?

    - by Carlton Gibson
    I am a long-time Mac user looking to gain a decent understanding of Windows. I'm not really interested in the history except as it is still relevant to Windows 7. I'm competent with the Mac and UNIX/Linux environment. I'm live in C, Objective-C, Bash, Python, JavaScript, AppleScript and PHP. As such I want something that is introductory but not aimed at beginners. Can anyone recommend a decent book (or other resource) to get me started? TIA

    Read the article

  • assistance required, hangman game.

    - by Phillip Gibson
    I am making a hangman game and am having trouble with part of it. I have selected a random word from a file, but I want to display the word as a series of undersocres __ and then match the letter chosen to a position in the undersocres. Can anyone help me? cout <<"1. Select to play the game\n"; cout <<"2. Ask for help\n"; cout <<"3. Select to quit the game\n"; cout << "Enter a selection: "; int number; cin >> number; while(number < 1 || number > 3 || cin.fail()) { if(cin.fail()) { cin.sync(); cin.clear(); cout << "You have not entered a number, please enter a menu selection between 1 and 3\n"; cin >> number; } else { cout << "Your selection must be between 1 and 3!\n"; cin >> number; } } switch (number) { case 1: { string word; string name; cout << " Whats your name? "; cin >> name; Player player(); ifstream FileReader; FileReader.open("words.txt"); if(!FileReader.is_open()) cout << "Error"; //this is for the random selection of words srand(time(0)); int randnum = rand()%10+1; for(int counter = 0; counter < randnum; counter++) { getline(FileReader, word, '\n'); } cout << "my word: " << word << "\n"; // get length of word int length; //create for loop for(int i = 0; i < length; i++) cout << "_"; //_ _ _ _ _ SetCursorPos(2,10); FileReader.close(); break;

    Read the article

  • string maniupulations, oops, how do I replace parts of a string

    - by Joe Gibson
    I am very new to python. Could someone explain how I can manipulate a string like this? This function receives three inputs: complete_fmla: has a string with digits and symbols but has no hyphens ('-') nor spaces. partial_fmla: has a combination of hyphens and possibly some digits or symbols, where the digits and symbols that are in it (other than hyphens) are in the same position as in the complete_formula. symbol: one character The output that should be returned is: If the symbol is not in the complete formula, or if the symbol is already in the partial formula, the function should return the same formula as the input partial_formula. If the symbol is in the complete_formula and not in the partial formula, the function should return the partial_formula with the symbol substituting the hyphens in the positions where the symbol is, in all the occurrences of symbol in the complete_formula. For example: generate_next_fmla (‘abcdeeaa’, ‘- - - - - - - - ’, ‘d’) should return ‘- - - d - - - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d - - - - ’, ‘e’) should return ‘- - - d e e - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d e e - - ’, ‘a’) should return ‘a - - d e e a a’ Basically, I'm working with the definition: def generate_next_fmla (complete_fmla, partial_fmla, symbol): Do I turn them into lists? and then append? Also, should I find out the index number for the symbol in the complete_fmla so that I know where to append it in the string with hyphens??

    Read the article

  • How to check if something is stored in CoreData

    - by Terrel Gibson
    Hi I want to be able to tore some information in core data and but i am unsure of how to check if the file was saved properly. I tried using NSLog but it returns null when its called. I have a dictionary which has a uniqueID and a title which I want to save. I pass this in along with the context of the database. I then sort the database to check if it has any duplicates or not, if not then I add the file. +(VacationPhoto*) photoWithFlickrInfo: (NSDictionary*) flickrInfo inManagedObjectContext: (NSManagedObjectContext*) context{ //returns the dictionary NSLog(@"Photo To Store =%@", flickrInfo); VacationPhoto * photo = nil; NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"VacationPhoto"]; request.predicate = [NSPredicate predicateWithFormat:@"uniqueID = %@", [flickrInfo objectForKey:FLICKR_PHOTO_ID]]; NSSortDescriptor * descriptor = [NSSortDescriptor sortDescriptorWithKey:@"title" ascending:YES]; request.sortDescriptors = [NSArray arrayWithObject:descriptor]; NSError *error = nil; NSArray *matches = [context executeFetchRequest:request error:&error]; if (!matches || [matches count] > 1) { // handle error } else if ( [matches count] == 0){ photo.title = [flickrInfo objectForKey:FLICKR_PHOTO_TITLE]; //Returns NULL when called NSLog(@"title = %@", photo.title); photo.uniqueID = [flickrInfo objectForKey:FLICKR_PHOTO_ID]; //Returns NULL when called NSLog(@"ID = %@", photo.uniqueID); } else { //If photo already exists this is called photo = [matches lastObject]; } return photo; }

    Read the article

  • Javascriptlibrary more efficient than Rickshaw for realtime visualizations

    - by dan kutz
    I want to visualize data as time-series graphs on mobile devices(tablets) and therefore stumbled upon rickshaw, which is based on D3. First I must say I was a little bit confused when I realized that realtime in web design is defined totally different to realtime in engineering which has fixed(and often very short) timeframes. Anyway my aim is to visualize the data as fast as possible, and on older tablets visualization with rickshaw is quite slow. Can anybody recommend another library, which may be more efficient in rendering? Or is there no way out and I have to go native? regards Dan.

    Read the article

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