Daily Archives

Articles indexed Thursday May 20 2010

Page 21/120 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Bit convector : Get byte array from string

    - by nCdy
    When I have a string like "0xd8 0xff 0xe0" I do Text.Split(' ').Select(part => byte.Parse(part, System.Globalization.NumberStyles.HexNumber)).ToArray(); But if I got string like "0xd8ffe0" I don't know what to do ? also I'm able for recommendations how to write byte array as one string.

    Read the article

  • Use interface between model and view in ASP.NET MVC

    - by Icerman
    Hi, I am using asp.net MVC 2 to develop a site. IUser is used to be the interface between model and view for better separation of concern. However, things turn to a little messy here. In the controller that handles user sign on: I have the following: IUserBll userBll = new UserBll(); IUser newUser = new User(); newUser.Username = answers[0].ToString(); newUser.Email = answers[1].ToString(); userBll.AddUser(newUser); The User class is defined in web project as a concrete class implementing IUser. There is a similar class in DAL implementing the same interface and used to persist data. However, when the userBll.AddUser is called, the newUser of type User can't be casted to the DAL User class even though both Users class implementing the interface (InvalidCastException). Using conversion operators maybe an option, but it will make the dependency between DAL and web which is against the initial goal of using interface. Any suggestions?

    Read the article

  • C++ book for a c# developer

    - by Eldila
    I am a c# developer which finds himself having to relearn c++. The last time I programmed in c++ was in school and am looking for good books as a refresher. I want something that assumes previous programming exposure and gets straight to the point. Is there a book similar to K&R for c++? I know the language is bloated so a book that covers a subset of c++ would be ideal.

    Read the article

  • How can I get a distinct list of elements in a hierarchical query?

    - by RenderIn
    I have a database table, with people identified by a name, a job and a city. I have a second table that contains a hierarchical representation of every job in the company in every city. Suppose I have 3 people in the people table: [name(PK),title,city] Jim, Salesman, Houston Jane, Associate Marketer, Chicago Bill, Cashier, New York And I have thousands of job type/location combinations in the job table, a sample of which follow. You can see the hierarchical relationship since parent_title is a foreign key to title: [title,city,pay,parent_title] Salesman, Houston, $50000, CEO Cashier, Houston, $25000 CEO, USA, $1000000 Associate Marketer, Chicago, $75000 Senior Marketer, Chicago, $125000 ..... The problem I'm having is that my Person table is a composite key, so I don't know how to structure the start with part of my query so that it starts with each of the three jobs in the cities I specified. I can execute three separate queries to get what I want, but this doesn't scale well. e.g.: select * from jobs start with city = (select city from people where name = 'Bill') and title = (select title from people where name = 'Bill') connect by prior parent_title = title UNION select * from jobs start with city = (select city from people where name = 'Jim') and title = (select title from people where name = 'Jim') connect by prior parent_title = title UNION select * from jobs start with city = (select city from people where name = 'Jane') and title = (select title from people where name = 'Jane') connect by prior parent_title = title How else can I get a distinct list (or I could wrap it with a distinct if not possible) of all the jobs which are above the three people I specified?

    Read the article

  • Is there an application that can help someone create an XML document based on the Relax NG schema?

    - by meowsqueak
    I've spent a bit of time creating a Relax NG schema for use within our team to validate XML documents we use for exchanging information. The schema is not complicated, but it is reasonably large. I am wondering if there exists a tool that can read in such a Relax NG schema and assist a user in creating a corresponding instance document, using the schema as a template. Perhaps an application with a GUI that creates fields and drop-down selections for each part of the document? For example, the tool might create an outline XML document and prompt the user to select multiples of certain elements, fill in each field, perhaps with permitted values read directly from the schema. It might also show the user via visual feedback when their document is 'complete', or highlight validation problems as they come up. I could anticipate writing a custom GUI tool to create such an XML document, but I'd really like changes to the schema to be automatically reflected by the GUI - and I really wonder if this hasn't already been done. I know some editors can automatically validate an XML document against a schema as it's being written, but I would really like to get my users one step away from the XML so they don't have to worry about the details of the XML syntax.

    Read the article

  • OpenSolaris and its killer features. Coming to a GNU/Linux near you?

    <b>Free Software Magazine:</b> "When we think of free operating systems we tend to think overwhelmingly of the big hitters (all GNU/Linux) like Debian, Ubuntu, Fedora and Mandriva and then of those niche distros that have been designed for low end systems or for specialist purposes like security and forensics. But Oranges are not the only fruit"

    Read the article

  • The Perfect Desktop - Linux Mint 9 (Isadora)

    <b>Howtoforge:</b> "This tutorial shows how you can set up a Linux Mint 9 (Isadora) desktop that is a full-fledged replacement for a Windows desktop, i.e. that has all the software that people need to do the things they do on their Windows desktops."

    Read the article

  • remote control android, a reverse ssh tunnel

    <b>Handle With Linux:</b> "Reasons for using a reverse shell include: you can bypass firewalls, you can connect to your phone without knowing the ip, the connection is initiated from the phone so you don't need to have a ssh server listening on your phone. Just think of all the fun this makes possible!"

    Read the article

  • Linux Servers to Get Kernel Refresh

    <b>ServerWatch:</b> "A new version of a major Linux server OS distro: interesting. A new version of Windows: intriguing. A new version of OS X: could be fun to play with. But a new Linux kernel? Big deal."

    Read the article

  • Write STDOUT & STDERR to a logfile, also write STDERR to screen

    - by Stefan Lasiewski
    I would like to run several commands, and capture all output to a logfile. I also want to print any errors to the screen (or optionally mail the output to someone). Here's an example. The following command will run three commands, and will write all output (STDOUT and STDERR) into a single logfile. { command1 && command2 && command3 ; } > logfile.log 2>&1 Here is what I want to do with the output of these commands: STDERR and STDOUT for all commands goes to a logfile, in case I need it later--- I usually won't look in here unless there are problems. Print STDERR to the screen (or optionally, pipe to /bin/mail), so that any error stands out and doesn't get ignored. It would be nice if the return codes were still usable, so that I could do some error handling. Maybe I want to send email if there was an error, like this: { command1 && command2 && command3 ; } logfile.log 2&1 || mailx -s "There was an error" [email protected] The problem I run into is that STDERR loses context during I/O redirection. A '2&1' will convert STDERR into STDOUT, and therefore I cannot view errors if I do 2 error.log Here are a couple juicier examples. Let's pretend that I am running some familiar build commands, but I don't want the entire build to stop just because of one error so I use the '--keep-going' flag. { ./configure && make --keep-going && make install ; } > build.log 2>&1 Or, here's a simple (And perhaps sloppy) build and deploy script, which will keep going in the event of an error. { ./configure && make --keep-going && make install && rsync -av --keep-going /foo devhost:/foo} > build-and-deploy.log 2>&1 I think what I want involves some sort of Bash I/O Redirection, but I can't figure this out.

    Read the article

  • Using strtotime for dates before 1970

    - by ctroy
    I have a text column in mysql and it stores a date value in the format yyyy-mm-dd. Now, in my php page, I use this code to parse into a date value. date("F j, Y", strtotime($row['value'])); Now, I just read that strtotime() parses values only after January 1, 1970. I have lot of date values before that date. Is there a work around? I don't want to change my database structure.

    Read the article

  • 'Previous' Button in HTML/PHP

    - by vlad
    Hi there, I thought hours about that problem but I didn't come to any conclusion. My problem here is that I need a 'Previous' Button added to a form. The user should fill out a formular that is splitted up in 13 parts. Every part is an own formular having a 'Next' button for submitting everything to a database and redirecting to the next page. How do I integrate a 'Previous' button there? ... I don't if it might be usefull for you to know that I'm using cakePHP, and well I'm pretty new to it.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >