Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 111
Search took 0.02 seconds.
Search: Posts Made By: mbd
Forum: C Jun 19th, 2008, 1:53 AM
Replies: 6
Views: 262
Posted By mbd
Re: Correct use of malloc?

what is anyone's opinion of

char *s = calloc(10, sizeof(char));

vs

char *s = calloc(10, sizeof(*s));
Forum: Software Design and Algorithms Jun 7th, 2008, 11:33 AM
Replies: 42
Views: 1,417
Posted By mbd
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

Sane, my escalator solution is o(n^4) in floors and o(n^2) in escalators. It ran in way less than 10 seconds on my computer with a worst case set of data. Did you find it to take longer than that?
Forum: Software Design and Algorithms Jun 5th, 2008, 3:14 PM
Replies: 42
Views: 1,417
Posted By mbd
Forum: Software Design and Algorithms Jun 5th, 2008, 2:44 PM
Replies: 42
Views: 1,417
Posted By mbd
Re: Sane's Monthly Algorithms Challenge #2 [06-08]

i am wondering who else is attempting the senior and advanced level problems. i just finished my solution to cards (my first attempt was way off proven by some new inputs i came up with). it might be...
Forum: Coder's Corner Lounge Jun 4th, 2008, 11:44 PM
Replies: 18
Views: 421
Posted By mbd
Re: Best programming language

i think the hammer/screwdriver analogy is way off. it is more like asking would it be better to write your love letter in german or italian. all the languages can express the same thing, but some...
Forum: Coder's Corner Lounge May 28th, 2008, 9:38 PM
Replies: 4
Views: 184
Posted By mbd
Re: Quickly select random lines

im not sure why you could not do this yourself, but here ya go

#!/usr/bin/perl

@lines = <STDIN>;
for (1 .. (($ARGV[0] < $#lines + 1) ? $ARGV[0] : $#lines + 1))
{
print splice @lines, rand() %...
Forum: C++ May 28th, 2008, 12:50 PM
Replies: 19
Views: 664
Posted By mbd
Re: C++ compilers?

what type of project did you create? you should have created an "Empty Project". then you should go to the menu and choose "Project" > "Add New Item ...". Then you should choose Visual C++ as the...
Forum: Visual Basic .NET May 23rd, 2008, 10:37 AM
Replies: 9
Views: 531
Posted By mbd
Re: Counting Number of Letters in a String

of course .net has easier built in functions:

using System;
using System.Text.RegularExpressions;

namespace RegExTest
{
class Program
{
static void Main(string[] args)
Forum: Java May 22nd, 2008, 1:22 PM
Replies: 3
Views: 173
Posted By mbd
Re: running a console application .jar file by double clicking

i do not know how netbeans builds jars.
Forum: C May 22nd, 2008, 11:24 AM
Replies: 9
Views: 383
Posted By mbd
Re: Implement a queue using share memory?

fall back son, what language would you want to do this in?
Forum: Java May 22nd, 2008, 9:18 AM
Replies: 3
Views: 173
Posted By mbd
Re: running a console application .jar file by double clicking

have you already done this: http://java.sun.com/docs/books/tutorial/deployment/jar/appman.html?
Forum: C May 21st, 2008, 9:34 AM
Replies: 9
Views: 383
Posted By mbd
Re: Implement a queue using share memory?

if you think i am joking, then you are mistaken. obviously you can implement a queue in many ways. however if you are using memory shared between threads, you must provide protection for that shared...
Forum: C May 19th, 2008, 1:50 PM
Replies: 9
Views: 383
Posted By mbd
Re: Implement a queue using share memory?

you need to google for "producer consumer problem" or "bounded buffer". you should find what you are looking for.
Forum: C++ May 13th, 2008, 10:38 AM
Replies: 9
Views: 338
Posted By mbd
Re: simple questions about maps

searching for a key takes log(n) in a map. it would easily be possible to implement map as a hash table, but that will have to wait for a new standard. sgi provides a hash_map.
Forum: C++ May 13th, 2008, 12:42 AM
Replies: 9
Views: 338
Posted By mbd
Re: simple questions about maps

you can check if a key exists using the find method.

if (mymap.find("test") != mymap.end())
{
// we found it
}
else
{
// we did not find it
}
Forum: Software Design and Algorithms May 12th, 2008, 12:51 AM
Replies: 31
Views: 1,408
Posted By mbd
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

so i corrected my senior solution using a recursive algorithm in java. it now craps out at 13 worst case hurdles. now that i have a correct solution, i just need to improve it.
Forum: C++ May 11th, 2008, 3:18 PM
Replies: 9
Views: 338
Posted By mbd
Re: simple questions about maps

using the operator[] to access a key in a map will create that key. the value returned will depend on the value type. it will use the default constructor to create the value type. if a map contains...
Forum: Paid Job Offers May 7th, 2008, 4:41 PM
Replies: 19
Views: 828
Posted By mbd
Re: $$$ Need C programmer for Operating Systems programs

i am pretty sure ancient's million dollar (not thousand dollar) quote is pulling your leg.
Forum: Paid Job Offers May 7th, 2008, 3:23 PM
Replies: 19
Views: 828
Posted By mbd
Re: $$$ Need C programmer for Operating Systems programs

program 1 I would estimate 3 hours, program 2 6 hours, program 3 1 hour. That is a nice round 10 hours. I will do it at $50/hour.
Forum: Software Design and Algorithms May 5th, 2008, 9:40 AM
Replies: 31
Views: 1,408
Posted By mbd
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

i think i get it, but i just dont really want to invent my own boundary cases to test my solution. i am just going to submit what i have. do i really need to wait a month before i get any results?
Forum: Software Design and Algorithms May 5th, 2008, 5:39 AM
Replies: 31
Views: 1,408
Posted By mbd
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

do you have any more test cases for the hurdles problem
Forum: C May 2nd, 2008, 11:21 AM
Replies: 1
Views: 139
Posted By mbd
Re: what gcc -lrt do???

-lrt links librt
Forum: C# May 1st, 2008, 12:33 AM
Replies: 12
Views: 352
Posted By mbd
Re: populate array with random nonrepeating #'s

your use of generics allows you to shuffle any type of array. my class allows for any type and any container to be shuffled. my series class is really not part of the exercise.
Forum: C# Apr 30th, 2008, 5:27 PM
Replies: 12
Views: 352
Posted By mbd
Re: populate array with random nonrepeating #'s

that is a lot of work to do two things. 1) create an enumerable of a series of integers 2) shuffle any enumerable of any type

your code only works for a very specialized case.
Forum: C# Apr 30th, 2008, 1:58 PM
Replies: 12
Views: 352
Posted By mbd
Re: populate array with random nonrepeating #'s

i suck at writing enumerables... i tried to use mine in a different program and found they needed to be modified. here they are:

Series.cs

using System.Collections;
using...
Forum: C# Apr 30th, 2008, 1:18 PM
Replies: 12
Views: 352
Posted By mbd
Re: populate array with random nonrepeating #'s

i was thinking about this today and realized that it would make sense to randomize any enumerable. thus:

RandomEnumerable.cs

using System;
using System.Collections;
using...
Forum: C# Apr 29th, 2008, 6:24 PM
Replies: 12
Views: 352
Posted By mbd
Re: populate array with random nonrepeating #'s

If you add the following classes to your project, you can populate a list like this:

List<int> list = new List<int>();
list.AddRange(new RandomizedSeries(0, 20));


Series.cs

using System;
using...
Forum: C# Apr 29th, 2008, 5:10 PM
Replies: 18
Views: 604
Posted By mbd
Re: need someone to write me a programme

i would write it for only $100 in my paypal account.
Forum: C++ Apr 28th, 2008, 5:50 PM
Replies: 6
Views: 260
Posted By mbd
Re: initilizer incmplete type

zip up the source and attach it
Forum: Java Apr 17th, 2008, 11:49 PM
Replies: 29
Views: 849
Posted By mbd
Re: online game

I want to help you out. I wrote a program in college which might get you started. I need to go through all the source and make sure that none of it is copyrighted. If it is all written by me (none...
Forum: C++ Apr 17th, 2008, 2:27 PM
Replies: 14
Views: 404
Posted By mbd
Re: Vectors

you could also use an algorithm and an iterator to print the vector instead of the for loop. then your code would not depend on an random access container.

#include <iostream>
#include...
Forum: C++ Apr 17th, 2008, 1:17 PM
Replies: 14
Views: 404
Posted By mbd
Re: Vectors

well you dont need to keep track of the size of the vector in your x variable. you can just use names.size().
Forum: C++ Apr 15th, 2008, 11:16 PM
Replies: 4
Views: 202
Posted By mbd
Re: Init array with a non-zero value

#include <algorithm>

...

int variable[10];
std::fill_n(variable, 10, 9);


still just a loop under the hood
Forum: Visual Basic Apr 15th, 2008, 3:33 PM
Replies: 5
Views: 278
Posted By mbd
Re: my game`

this one i am certain is malware. he spammed the forum and posted an exe. cant we just delete this thread? if i must, i will disassemble the thing and tell you all exactly what it does.
Forum: Community Announcements and Feedback Apr 15th, 2008, 3:28 PM
Replies: 19
Views: 544
Posted By mbd
Re: Zero Tolerance Executable Policy

i have never noticed the red triangle that when hovered over says, "report post". it is barely visible, and not visible at all when you are browsing the forums logged out. i spend barely any time...
Forum: Community Announcements and Feedback Apr 15th, 2008, 3:19 PM
Replies: 19
Views: 544
Posted By mbd
Re: Zero Tolerance Executable Policy

the threads i linked in the original post in this thread do not contribute anything to the community other than malware and hacking requests. why are they still visible? this is my concern. are there...
Forum: Community Announcements and Feedback Apr 15th, 2008, 12:58 PM
Replies: 19
Views: 544
Posted By mbd
Re: Zero Tolerance Executable Policy

to clear things up, i think only direct links should be banned. if you link to http://logging.apache.org/log4net/download.html that would be fine, but linking to...
Forum: Community Announcements and Feedback Apr 15th, 2008, 12:38 PM
Replies: 19
Views: 544
Posted By mbd
Zero Tolerance Executable Policy

In light (http://www.programmingforums.org/thread15619.html) of recent (http://www.programmingforums.org/thread15618.html) threads (http://www.programmingforums.org/thread15590.html), I would propose...
Forum: Coder's Corner Lounge Apr 15th, 2008, 12:11 PM
Replies: 8
Views: 192
Posted By mbd
Re: XP Web server

you should see if the cassini web server can do what you need.
Forum: C# Apr 15th, 2008, 9:52 AM
Replies: 9
Views: 411
Posted By mbd
Re: Application to export to an PDF

to use itextsharp, take the .dll file from the release folder and add it to your project through the add existing item menu. then from the add references menu, choose the browse tab and browse to the...
Showing results 1 to 40 of 111

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC