|
Zombywuf posted:ORLY That doesn't resolve the "IE Javascript debugging in Linux" issue, which is kinda the point. At the very least, you should be doing a pass of your site within Windows, and if there are problems, sometimes you have to suck it up and use Windows to have access to decent development tools for IE (unless you can get them working in WINE).
|
# ? Apr 14, 2008 20:12 |
|
|
# ? May 14, 2024 10:26 |
|
Avenging Dentist posted:That doesn't resolve the "IE Javascript debugging in Linux" issue, which is kinda the point. At the very least, you should be doing a pass of your site within Windows, and if there are problems, sometimes you have to suck it up and use Windows to have access to decent development tools for IE (unless you can get them working in WINE). All the dev tools I've seen for IE have been plugins. It's possible (never tried it) that they will work under this setup.
|
# ? Apr 14, 2008 20:38 |
|
I've been having no luck finding out ways to connect to a mySQL database through C#. I'm working on a small app that needs to access a database on a remote server from a client machine. Every single article on mySQL and C# seems to assume that I'm running the app from the server, not the client. Here's what's tripping me up: (bolded area) myConn = new OleDbConnection("Provider=NO IDEA WHAT TO PUT HERE; Data Source= http://mysite.web???; Initial Catalog= user_db; User Id=root; Password=;"); All the examples I've found online use Provider=mySQLProv with no explanation as to what mySQLProv is. Is it something installed on the SQL server or is it just a parameter specifying that mySQL is used?
|
# ? Apr 15, 2008 21:24 |
|
Plank Walker posted:I've been having no luck finding out ways to connect to a mySQL database through C#. I'm working on a small app that needs to access a database on a remote server from a client machine. Every single article on mySQL and C# seems to assume that I'm running the app from the server, not the client. Here's what's tripping me up: (bolded area)
|
# ? Apr 15, 2008 21:29 |
|
Plank Walker posted:I've been having no luck finding out ways to connect to a mySQL database through C#. I'm working on a small app that needs to access a database on a remote server from a client machine. Every single article on mySQL and C# seems to assume that I'm running the app from the server, not the client. Here's what's tripping me up: (bolded area) I used this: http://csharp.codenewbie.com/articles/csharp/1433/MySQL_and_NET__Using_MySQLDriverCS-Page_1.html I assume you just change localhost with the relevant address, though I have only tested it on my own computer.
|
# ? Apr 15, 2008 22:44 |
|
There's also the official one at http://dev.mysql.com/downloads/connector/net/5.1.html Sample code: code:
|
# ? Apr 16, 2008 01:30 |
|
Can someone recommend me a book or books for learning C# and .Net? I've been coding Java, C, and C++ for a few years each but I need some help and some reference material for all of this new stuff.
|
# ? Apr 16, 2008 02:41 |
|
Check the book request / recommendation thread, or you can ask in the .NET Megathread for specific topics.
|
# ? Apr 16, 2008 03:01 |
|
Why doesn't this program see the arguments I pipe to it?code:
What really happens: nothing. argv is empty, I guess? Why is this?
|
# ? Apr 16, 2008 18:47 |
|
When you pipe commands, the piped data comes in via STDIN.
|
# ? Apr 16, 2008 18:55 |
|
magicalblender posted:Why doesn't this program see the arguments I pipe to it? First off, wrong thread. Second, you misunderstand what the pipe does. It ties stdout of the first program to stdin of the second, it doesn't put stuff on the command line for the second program. If you printed values put to stdin in your showargs program you'd see the contents of myfile.
|
# ? Apr 16, 2008 18:55 |
|
6174 posted:First off, wrong thread. Whoops vv Well, anyway, here's the solution I came up with, after my ignorance about piping had been corrected: code:
|
# ? Apr 16, 2008 21:36 |
|
magicalblender posted:As a follow-up, why is it that "cat myfile | ./showargs" works, but "cat myfile | showargs" does not work? What is the significance of the dot and slash? The dot and slash specify where to find the file "showargs". The "." means the current working directory, and the "/" is the standard directory separator. When those are not present the shell looks for the file "showargs" in the directories listed in the PATH variable (in the order they appear). Since the current directory is normally not part of the PATH, if you do not put the ./ the shell can't find "showargs".
|
# ? Apr 16, 2008 22:03 |
|
magicalblender posted:Whoops vv In Unix, when you use a command like "showargs", it tries to find a program called "showargs" in each directory in your PATH environment variable, and runs the first one it finds. Unlike in Windows, the current directory (which can be abbreviated as a dot) is not generally included in your PATH. You can also refer directly to a specific program, regardless of whether it's in your PATH, by specifying a full or relative path to it. So ./showargs means "showargs, in the current directory."
|
# ? Apr 16, 2008 22:06 |
|
6174 posted:First off, wrong thread.
|
# ? Apr 17, 2008 11:51 |
|
I'm doing some Haskell coursework and I've hit a dead end. It's about tree structures. Here's the question: quote:Define a function pathEnum :: BTree a -> [Path] which takes as input a binary tree and returns the list of all the paths in the tree from the root to a leaf Here are the relevant definitions: data BTree a = Leaf a | Node (BTree a) (BTree a) data Dir = L | R type Path = [Dir] Sample tree: tree1 :: BTree Int tree1 = Node (Leaf 4) (Node (Leaf 2) (Leaf 1) Here is my attempt, but it doesn't work (won't even compile). Can anyone give me some tips? What am I doing wrong? pathEnum :: BTree a -> [Path] pathEnum (Leaf x) = [[]] pathEnum (Node x y) = [L ++ pathEnum x] ++ [R ++ pathEnum y]
|
# ? Apr 17, 2008 12:18 |
|
Orlen posted:I'm doing some Haskell coursework and I've hit a dead end. You've got absolutely the right idea, but the types are a little subtly wrong in the last line of your code. Let's first create a function, leftPathEnum, that only considers paths on the left. > leftPathEnum :: BTree a -> [Path] leftPathEnum on leafs returns a single result: the empty path. > leftPathEnum (Leaf x) = [ [ ] ] On interior nodes, leftPathEnum needs to take all the paths from its left child, and stick a 'L' in front of them. We use map for this. > leftPathEnum (Node l r) = map (L (leftPathEnum l) Hopefully you've been introduced to map before. It takes a function, and a list, and returns the list with that function applied to every element. In this case, the function I've provided is (L . The ( operator is called "cons", and its type is: ( :: a -> [a] -> [a] It takes a single element, and a list, and prepends the element to the list. The type of (L is: (L :: [Dir] -> [Dir] It takes a list of Dirs, and prepends L to the list. Do you think you can write a pathEnum function now, with the same technique? You'll have to call map twice, and you'll be concatenating the results of the maps with ++.
|
# ? Apr 17, 2008 17:07 |
|
Avenging Dentist posted:That doesn't resolve the "IE Javascript debugging in Linux" issue, which is kinda the point. At the very least, you should be doing a pass of your site within Windows, and if there are problems, sometimes you have to suck it up and use Windows to have access to decent development tools for IE (unless you can get them working in WINE). http://www.getfirebug.com/lite.html - Check this out. It may prove useful.
|
# ? Apr 17, 2008 17:18 |
|
ShoulderDaemon posted:Do you think you can write a pathEnum function now, with the same technique? You'll have to call map twice, and you'll be concatenating the results of the maps with ++. Thanks very much for your help, it's much appreciated. I've got it working now! I owe you one!
|
# ? Apr 18, 2008 13:31 |
|
magicalblender posted:Whoops vv What you should be doing is while (fgets(foo,100,0) != NULL) {
|
# ? Apr 18, 2008 23:55 |
|
Scaevolus posted:What happens when you pipe a line with more than 100 characters into this program? Foo is only defined to be 100 characters, so you end up writing to other memory. This is a buffer overflow, and you need to beware of them when you write C. At least he does not instantly get a segfault from passing null pointers as streams.
|
# ? Apr 19, 2008 00:06 |
|
What do you mean "at least"? An instant segfault is the best kind of error to have, because it's immediately obvious that something's wrong and it's easy to find out exactly where the error happened.
|
# ? Apr 19, 2008 00:28 |
|
JoeNotCharles posted:What do you mean "at least"? An instant segfault is the best kind of error to have, because it's immediately obvious that something's wrong and it's easy to find out exactly where the error happened. He means you should pass in stdin, not 0. code:
|
# ? Apr 19, 2008 00:38 |
|
Vanadium posted:At least he does not instantly get a segfault from passing null pointers as streams. vv Yeah, I know. Difference between int fd and FILE *stream and all that. Scaevolus fucked around with this message at 02:40 on Apr 19, 2008 |
# ? Apr 19, 2008 00:52 |
|
Scaevolus posted:Woops, for some reason I thought 0 worked as stdin-- on some systems stdin isn't defined in <stdio.h>, and 0 works fine. 0 is the file descriptor for stdin, but fgets() (along with fread, fwrite, fopen, etc) takes a FILE*. It also wouldn't work if you did read(stdin, buff, 100).
|
# ? Apr 19, 2008 00:59 |
|
I want to make an RSVP website where people can log in with a username and password and indicate whether or not they will be attending an event as well as how many others they will be bringing with them. I've never really done web work before, so I don't know where to start on something like this. What language(s) should I use? I will also need some kind of database; what's easiest/most useful for something like this? If I could just get pointed to a few tutorials, that would be great. Thanks!
|
# ? Apr 19, 2008 17:22 |
|
My C skills are really shaky and as such OS is going to be the death of me. Basically I'm trying to add a syscall to store and retrieve data and be identified by a string and I sometimes I get segfaults when I try to store or retrieve data. My test program for my syscalls is as follows: It should be noted that when the syscall doesn't give me a segfault on retrieving the value it prints out a 1 (which is baffling, because I can't figure out where 1 is coming from).code:
code:
code:
Any help is greatly appreciated. I'm open to any sort of suggestions, I really won't be pissed if you guys tell me my approach is entirely wrong.
|
# ? Apr 20, 2008 23:21 |
|
clockwork automaton posted:
|
# ? Apr 21, 2008 01:46 |
|
Jethro posted:Your approach is totally wrong. You should try posting in the C/C++ questions thread instead. It's okay though, because I figured it out. It was an issue with user space memory and kernel space memory all I had to do was use strcpy and it was saved.
|
# ? Apr 21, 2008 02:06 |
|
clockwork automaton posted:It's okay though, because I figured it out. It was an issue with user space memory and kernel space memory all I had to do was use strcpy and it was saved. I've responded to you here.
|
# ? Apr 21, 2008 17:10 |
|
So I'm working with LISP and I need a way to determine if a certain list is a member of another list. eg is (1 0) inside ((0 0)(1 0) (4 3)(6 6)) Any idea why it declares a statement like this NIL? (member '(1 0) '((0 0)(1 0)(4 3)(6 6)))
|
# ? Apr 23, 2008 07:22 |
|
Presumably because MEMBER defaults to checking with EQ or EQL or whatever (which don't go into sublists), with :test #'equal it should work.
|
# ? Apr 23, 2008 11:11 |
|
Ok, so I haven't really done any coding at all, ever. I just started reading "Structure and Interpretation of Computer Programs". I was wondering if someone could direct me to what I can use to get some hands-on practice for general programming?
Jack Black fucked around with this message at 03:16 on Apr 24, 2008 |
# ? Apr 24, 2008 03:03 |
|
I just started learning basic GUI programming and I have some very general design questions. Let's say I'm writing a CAD or paint program and I have the following classes. class ApplicationWindow {...main window that contains everything...} class DataModel {...data representation...} class RenderView extends JScrollPane {...visual way to display/modify data...} class ModelEditor extends JPanel {...text display/edit data...} My question is how to synchronize data presentation in different GUI components? I can think of couple ways to do this: 1. instantiate data object in one of the classes and save reference variable/pointer to data object in the other classes. So it's just passing the data object to whatever class that needs it. 2. instantiate data object in ApplicationWindow and create event handlers to handle all data access/updates. Pretty much centralizing interaction between data and different GUI panels. I realize this is a really general question. Are there other ways to do this? How do programs like gimp handle this?
|
# ? Apr 24, 2008 04:57 |
|
Say I have a string like code:
Much appreciated. Edit: Nevermind, I molested a html tag sample to work. SixPabst fucked around with this message at 21:38 on Apr 24, 2008 |
# ? Apr 24, 2008 21:11 |
|
CrusaderSean posted:I just started learning basic GUI programming and I have some very general design questions. Let's say I'm writing a CAD or paint program and I have the following classes. In general, you don't ever want to store "master" data in GUI objects. You should put the data in DataModel and have the GUI objects retrieve it from there when they need to draw. You'd implement the edit operations as methods of DataModel as well (which would be called by ApplicationWindow by the event handlers). This is one aspect of the MVC school of design, look up that if you want a better explanation. haveblue fucked around with this message at 00:04 on Apr 25, 2008 |
# ? Apr 25, 2008 00:02 |
|
I'll try to explain this as good as I can but seeing as I'm stuck and don't really know where to start searching I hope you can filter out the parts that matter. Backstory: I recently changed hosting and in the progress of doing so decided to rework the design of my wordpress site, I'm not a web designer by trade but i use photoshop from time to time so i figured I might be able to produce something close to decent. The horror: After completing the new design I thought everything was working fine until I tried the navigation links, it seems clicking any of the category or archives links breaks the site. Have a look. Fixed site I think this might be PHP issue, but I'm not sure. For some reason the sites footer appears in the sidebar, so I've been trying to go true the code for that but I really can't figure out what the problem is, maybe one of you guys can. EDIT: The solution: I looked at the code again this morning with fresh eyes, and figured it out it's working great now. The problem was in my commenting out a part of the code that was needed for the site to render correctly. Eldoran fucked around with this message at 12:25 on Apr 26, 2008 |
# ? Apr 25, 2008 16:46 |
|
I was looking through this thread originally to find books to read, as a CS student. Found them on the first page, but just wanted to ask some questions. I'm just finishing my second year now. The books listed were Code Complete and Practice of Programing, as well as the Art of Programming. Would all these books be useful for me? I imagine most of the Knuth book would be beyond me at this stage Second question, pretty much everything we've done has been just in Java, with a tiny bit of C in one of my modules. I've picked up the K&R C book to help me learn C over the summer. Since I want to know more than just Java, what else is worth learning? Edit: I was reading reviews on the Knuth books and saw they code in them is in MIX? This would make them pretty out dated would it not? Donald Duck fucked around with this message at 03:51 on Apr 26, 2008 |
# ? Apr 26, 2008 03:01 |
|
Can someone explain to me the purpose of putting "java script:" at the begining of a function when running a javascript function from within html? For instance:code:
|
# ? Apr 26, 2008 04:46 |
|
|
# ? May 14, 2024 10:26 |
|
There is none. It's just an alternative syntax.
|
# ? Apr 26, 2008 07:26 |