Daily Archives

Articles indexed Wednesday March 24 2010

Page 9/131 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • DAO design pattern and using it across multiple tables

    - by Casey
    I'm looking for feedback on the Data Access Object design pattern and using it when you have to access data across multiple tables. It seems like that pattern, which has a DAO for each table along with a Data Transfer Object (DTO) that represents a single row, isn't too useful for when dealing with data from multiple tables. I was thinking about creating a composite DAO and corresponding DTO that would return the result of, let's say performing a join on two tables. This way I can use SQL to grab all the data instead of first grabbing data from one using one DAO and than the second table using the second DAO, and than composing them together in Java. Is there a better solution? And no, I'm not able to move to Hibernate or another ORM tool at the moment. Just straight JDBC for this project.

    Read the article

  • Incoming SMS - redirect to server via HTTP

    - by Colin Kinsella
    Hi I am looking for a windows application which will receive SMS via a GSM modem. The application needs to forward the 'raw' PDU via HTTP Post to a page on our server. The app needs to deal receive a confirmation reciept from our server and deal with undelivered PDU strings. I would be happy for someone to quote for building this straightforward application. Thanks CKxion

    Read the article

  • Communication between modules

    - by David Elentok
    I have an application that consists from the following three modules: Search (to search for objects) List (to display the search results) Painter (to allow me to edit objects) - this module isn't always loaded (Each object is a figure that I can edit in the painter). When I open an object in the painter it's added to the objects that are already in the painter and I can move it and alter it. I'm using an object similar to the EventAggregator to communicate between the modules. For example, to show the search results I publish a "ShowList" event that is caught by the List module (I'm not sure this is the best way to do this, if anyone has better idea please comment...). One of the features of the search module requires it to get the selected object in the painter (if the painter is available), and I'm not sure what would be the best way to do that... I thought of these solutions: Whenever the selected object in the painter changes it will publish a "PainterSelectedObjectChanged" event which will be caught by the search module and stored for later use. When the selected object is needed by the search module it will publish a "RequestingPainterSelectedObject" event which will be caught by the painter module. The painter module will then set the "SelectedObject" property in the EventArgs object, and when the publish is complete and we're back in the search module we will have the painter's selected object in the EventArgs object. What do you think? what is the right way to do this?

    Read the article

  • Comparing Nested object properties using C#

    - by Kumar
    I have a method which compares two objects and returns a list of all the property names which are different. public static IList<string> GetDifferingProperties(object source, object) { var sourceType = source.GetType(); var sourceProperties = sourceType.GetProperties(); var targetType = target.GetType(); var targetProperties = targetType.GetProperties(); var properties = (from s in sourceProperties from t in targetProperties where s.Name == t.Name && s.PropertyType == t.PropertyType && s.GetValue(source,null) != t.GetValue(target,null) select s.Name).ToList(); return properties; } For example if I have two classes as follows: public class Address { public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } } public class Employee { public string FirstName { get; set; } public string MiddleName { get; set; } public string LastName { get; set; } public Address EmployeeAddress { get; set; } } I am trying to compare the following two employee instances: var emp1Address = new Address(); emp1Address.AddressLine1 = "Microsoft Corporation"; emp1Address.AddressLine2 = "One Microsoft Way"; emp1Address.City = "Redmond"; emp1Address.State = "WA"; emp1Address.Zip = "98052-6399"; var emp1 = new Employee(); emp1.FirstName = "Bill"; emp1.LastName = "Gates"; emp1.EmployeeAddress = emp1Address; var emp2Address = new Address(); emp2Address.AddressLine1 = "Gates Foundation"; emp2Address.AddressLine2 = "One Microsoft Way"; emp2Address.City = "Redmond"; emp2Address.State = "WA"; emp2Address.Zip = "98052-6399"; var emp2 = new Employee(); emp2.FirstName = "Melinda"; emp2.LastName = "Gates"; emp2.EmployeeAddress = emp2Address; So when I pass these two employee objects to my GetDifferingProperties method currently it returns FirstName and EmployeeAddress, but it does not tell me which exact property (which in this case is Address1) in the EmployeeAddress has changed. How can I tweak this method to get something like EmployeeAddress.Address1?

    Read the article

  • Best way to deal with session handling in Zend Framework

    - by JACK IN THE CRACK
    So I'm starting up in Zend framework and looking to implement a site-wide "User" session.... something I can easily access from ALL modules/controllers in the application. I'm like, should I make a new namespace in the library and extend the controller, like: MyLib_Controller_Action extends Zend_Controller_Action { protected $_userSession; function preDispatch(Zend_Controller_Request_Abstract $req) { $this->_userSession = new Zend_Session_Namespace('user'); } } ANd then have all my controllers/modules/etc extend from that? Or should I create a Plugin or what? How would you go about making this plugin to pass the user session to the controller? Or do I do it in the bootstrap?? Again how to pass to controller? Also should I use Zend_Session_Namespace or Zend_Http_Cookie and also how do I encrypt and xss clean the cookie or is that did automagically?

    Read the article

  • Prompting user for multiple selections in an iphone app

    - by Matt Delves
    I'm currently looking for a way to provide the user with being able to select multiple items from a collection of values. I know this is done in the mail app whereby you can go into the edit mode of a folder and select multiple items by clicking on the circle on the left hand side. What I'm unsure about is how this is achievable. Is anyone familiar with how to reproduce such functionality? Thanks, Matt Delves

    Read the article

  • Flex: replace all spaces with comma

    - by Treby
    im new with regexp, so can i ask for some assistance Using string.replace function what code that can replace spaces with comma Input:The quick brown fox jumps over the lazy dog. Output:The,quick,brown,fox,jumps,over,the,lazy dog. Thanks

    Read the article

  • Update element values using xml.dom.minidom

    - by amnesia-55
    Hello, I have an XML structure which looks similar to: <Store> <foo> <book> <isbn>123456</isbn> </book> <title>XYZ</title> <checkout>no</checkout> </foo> <bar> <book> <isbn>7890</isbn> </book> <title>XYZ2</title> <checkout>yes</checkout> </bar> </Store> Using xml.dom.minidom only (restrictions) i would like to 1)traverse through the XML file 2)Search/Get for particular element, depending on its parent Example: checkout element for author1, isbn for author2 3)Change/Set that element's value 4)Write the new XML structure to a file Can anyone help here? Thank you! UPDATE: This is what i have done till now import xml.dom.minidom checkout = "yes" def getLoneChild(node, tagname): assert ((node is not None) and (tagname is not None)) elem = node.getElementsByTagName(tagname) if ((elem is None) or (len(elem) != 1)): return None return elem def getLoneLeaf(node, tagname): assert ((node is not None) and (tagname is not None)) elem = node.getElementsByTagName(tagname) if ((elem is None) or (len(elem) != 1)): return None leaf = elem[0].firstChild if (leaf is None): return None return leaf.data def setcheckout(node, tagname): assert ((node is not None) and (tagname is not None)) child = getLoneChild(node, 'foo') Check = getLoneLeaf(child[0],'checkout') Check = tagname return Check doc = xml.dom.minidom.parse('test.xml') root = doc.getElementsByTagName('Store')[0] output = setcheckout(root, checkout) tmp_config = '/tmp/tmp_config.xml' fw = open(tmp_config, 'w') fw.write(doc.toxml()) fw.close()

    Read the article

  • PHP mcrypt usage class?

    - by kavoir.com
    I'm pretty new at this. Tried to make sense of the manual page for mcrypt at PHP.net when I thought a good tutorial would do a better job. So I searched yet without anything substantial. I also tried one of the examples of using mcrypt to perform the encryption and decryption with 2 functions, but it gives a warning of "Size of key is too large for this algorithm". Can anyone please write me a two-way class to do the encryption / decryption using mcrypt so I can make sense of the library? Thanks!

    Read the article

  • Cheat Sheets for System Administrators?

    - by splattne
    I'd like to start a collection of good, free cheat sheet resources for system administrators. Please add your favorite ones. From the Wikipedia "cheat sheet" article: In more general usage, a "cheat sheet" is any short (one or two page) reference to terms, commands, or symbols where the user is expected to understand the use of such terms etc but not necessarily to have memorized all of them.

    Read the article

  • syncML to sync contact

    - by Rupesh
    hi all, i want to develop the application for iPhone which sync contacts to server and vice-versa. i read some information about syncML. which is used to sync PIM data to server (and vice-versa).up till now, i am unable to get the correct detail. i want to sync the PIM data to server and vice -versa. Anyone have idea about Prerequisite on client side Prerequisite on Server side Any website which provide some API and sample code to apply syncML.

    Read the article

  • Storage device not found on ESX4 with AIC-9410

    - by Mads
    I am trying to install ESX 4.0 update 1 on a Supermicro X7DBR-3 system with an embedded AIC-9410 HBA (this HBA is listed on the HCG with Vendor ID 9005 and Device ID 041f) . All SATA controllers are disabled in the BIOS and the logical drive shows up in the Adaptec device summary during POST, however there is nothing listed on the Storage Device screen. The HBA itself is listed if I run esxcfg-info but not if I run esxcfg-scsidevs -a (under ESXi for that last command) Any ideas where I can look next or what might be wrong?

    Read the article

  • How to change the firmware of my NETGEAR WGT624 v2 to DD-WRT

    - by Lirik
    In reference to my previous question: I can't find the appropriate firmware for my NETGEAR WGT624 v2 router. I went on the dd-wrt web site and I read the wiki, but I didn't see any files or instructions on how to change the firmware. The router database lists my router, but as I said: no files. In addition the "Supported" column lists "wip", what is wip? Router Database 4 routers found Manufacturer Model Revision Supported Activation required Netgear WGT624 v1 wip no Netgear WGT624 v2 wip no ... The only thing listed for my router on the dd-wrt web site is: Router details Chipset: AR2312A RAM: 16 MB FLASH: 4 MB Additional information * OpenWRT Wiki: Netgear WGT624 * Unbrick procedure Is the router supported? Can I change the firmware? If yes, then how can I change it?

    Read the article

  • xp mode in Windows 7 - capture mouse?

    - by Mike Blandford
    I'm running Windows 7 but it doesn't quite work right with Starcraft. (Colors are messed up). So I installed Windows XP Mode and I can get it to play starcraft but it changes the resolution to 640x480 and it does not stretch - so it's running in a tiny window in the middle of my screen. (If I resize the VM then the screen either goes blank, or it doesn't resize the contents) Also the mouse isn't captured - the mouse can go inside/outside the virtual pc easily, and it should get stuck on the edges.

    Read the article

  • Windows 7 systeminfo reporting incorrect System Boot Time?

    - by rdingwall
    I work 9-5 and switch my PC off when I leave the office each day. When doing timesheets I need to know what time I got to work, so I usually use cmd systeminfo for finding the System Boot Time. Since upgrading to Windows 7 however, it's started reporting bizarre numbers between 11pm-2am instead of 8-9am. Today it says it booted at 11:34pm last night! I checked the event log and there is no entries between when I shutdown at 5:30pm yesterday and booted around 8am this morning. Has anyone else encountered this?

    Read the article

  • Looking for a windows-based WebDAV enabled editor (for code)

    - by Evert
    Hi guys, I'm looking for a good editor for windows with built-in WebDAV support. I'm aware of Netdrive, Webdrive and Windows' built-in WebDAV client, but these don't work as well, because they need to emulate a true filesystem. Has anyone came across this? I'm used to Coda on OS/X, so I'm hoping for something similar.

    Read the article

  • String search and write into file in jython

    - by kdev
    hi Everyone , i wish to write a program that can read a file and if a particular str_to_find is found in a bigger string say AACATGCCACCTGAATTGGATGGAATTCATGCGGGACACGCGGATTACACCTATGAGCAGAAATACGGCCTGCGCGATTACCGTGGCGGTGGACGTTCTTCCGCGCGTGAAACCGCGATGCGCGTAGCGGCAGGGGCGATCGCCAAGAAATACCTGGCGGAAAAGTTCGGCATCGAAATCCGCGGCTGCCTGACCCAGATGGGCGACATTCCGCTGGAGATTAAAGACTGGCGTCAGGTTGAGCTTAATCCGTTTTC then write that line and the above line of it into the file and keep repeating it for all the match found. Please suggest i have written the program for printing that particular search line but i dont know how to write the above line. Thanks everyone for your help. import re import string file=open('C:/Users/Administrator/Desktop/input.txt','r') output=open('C:/Users/Administrator/Desktop/output.txt','w') count_record=file.readline() str_to_find='AACCATGC' while count_record: if string.find(list,str_to_find) ==0: output.write(count_record) file.close() output.close()

    Read the article

  • Method collect on Scala 2.7

    - by Brian Heylin
    I'm looking for a collect method in scala 2.7 but I can't seem to find an applicable call. Is there something equivalent to collect that I can use in scala? To be clear I'm looking to filter elements from a list and map those filtered to a new type.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >