104 Posted Topics

Member Avatar for optikali

You could do something like this. pseudocode... num = random double from 0 to 1 if (num < 0.7) num = random int from 0 to 75/2 else num = random int from 75/2-75 70% of the time it will generate a uniformly distributed random number from 0 to 75/2, …

Member Avatar for JamesCherrill
0
1K
Member Avatar for SasseMan

Hi! I am using a vpn connection to connect to my work network, which I use for remote desktop, which is working fine. I now want to be able to access the same stuff at home that I can access at work. I can for instance write "wiki" in the …

Member Avatar for lasitha2005d
0
275
Member Avatar for SasseMan

Hi! A small SVN problem? I have an online svn server that I have had for some time that I used for a software project. I want to close that account so I don't have to pay the monthly fee. But before I do that I want to download the …

Member Avatar for sknake
0
308
Member Avatar for SasseMan

Hi! I want to make a python program that runs different simple command line scripts. Right now I use os.system which works fine for running the scripts, but the problem is that the scripts sometimes halt and wait for input from the user. So my question is, how do i …

Member Avatar for Gribouillis
0
152
Member Avatar for jamesl22

OpengGL gives you the means to create any visual effect that you want. HL2 use OpenGL as well as DirectX since it is avaliable for Mac. How your graphics look depends on mainly three things. Geometry, textures, and lighting. But the really main thing is lighting. I would recommend not …

Member Avatar for SasseMan
0
140
Member Avatar for SasseMan

Hello all! I'm having problems with running c++ on iOS. I have a iOS openGL project in Xcode 4 and an external library written in c++ that has to be a dependency to the iOS target so it can run on an Ipad. right now I'm testing with the iPad …

Member Avatar for SasseMan
0
105
Member Avatar for yznk

Try to find out on exactly which line the segfault occurs. Then check if the variables on that line have been initialized properly before the function is called.

Member Avatar for geojia
0
333
Member Avatar for mani_1991

You could just store the url of the image in the DB, which would just be a string and would not create so much overhead. I don't have much info on if its good or bad to store images or other large files in DBs, probably has its ups and …

Member Avatar for SasseMan
0
244
Member Avatar for Pappu-Linux

You don't really need to push the elements onto another stack. I'm assuming that you use a linked list to implement the stack. In that case you can just loop through the stack until you find the element you want to remove, delete it, and then point the previous element …

Member Avatar for SasseMan
0
129
Member Avatar for Sohelp

That is the taylor series for sin(x) i.e. sin(x) is approximately x- (x3/3!)+ (x5/5!)- (x7/7!)+....... What do you want to solve?

Member Avatar for Sohelp
0
138
Member Avatar for massivefermion

You should probably not use built in types like doubles, ints and longs for these kind of calculations that require high precision and big numbers. Use GMP or something similar. [url]http://gmplib.org/[/url]

Member Avatar for SasseMan
0
363
Member Avatar for virendra_sharma

googling "facebook api" gives you the answer. [url]http://developers.facebook.com/docs/api[/url]

Member Avatar for SasseMan
0
87
Member Avatar for zoefschildpad

Segfaults are memory access violations. Try to find on exactly which row the segfault occurs by printing stuff before and after a row that you suspect may be causing the segfault, that would narrow the search down quite a bit.

Member Avatar for SasseMan
0
2K
Member Avatar for Pushpasheela
Member Avatar for kramerd
0
136
Member Avatar for eppoair2

This can be solved analytically, why pseudocode? The pseudocode in this case is almost like the mathematical expressions needed to solve it. s2*t = s1*t + s1*h <=> t(s2-s1) = s1*h <=> t = s1*h/(s2-s1) which is the pseudocode and the real code for that matter.

Member Avatar for apines
0
101
Member Avatar for Bri426

Why are you using getch() there? So the console doesn't close? Your compiler must support it. Use std::cin.get() instead. Would be good if you gave and example of how the file is formatted exactly so it will be easier to help. What is wrong with length()? length() is an alias …

Member Avatar for SasseMan
0
391
Member Avatar for pandaEater

table is a pointer to a ListNode so you can't write table[hash(val)], you need to dereference the pointer first like this, (*table)[hash(val)]. I think that might be the issue.

Member Avatar for pandaEater
0
279
Member Avatar for homeryansta

What kind of data do you have in the array now? RGB values maybe? What language do you use?

Member Avatar for Taywin
0
148
Member Avatar for purijatin

Yes netbeans can be a pain in situations like this. Save yourself some headache and create a new project.

Member Avatar for purijatin
0
101
Member Avatar for triumphost

Do you want to move the mouse programatically to fix the sound issue? It sound more like a hardware problem to me. Does the same thing happen with a regular mouse connected? Mouse events in C++ are a lot more complicated that in java. I'm no expert on that but …

Member Avatar for triumphost
0
181
Member Avatar for timb89

An avl tree is a self balancing tree which means that there is a mathematical relationship between the number of elements in the tree and the height. Since a lookup in a AVL tree takes O(log(n)) time, the height should also be O(log(n)) i.e. ceiling(log2(n)). Read about avl trees here... …

Member Avatar for SasseMan
0
3K
Member Avatar for Bladtman242

Its because of the numerical errors you get when you repeatedly divide i by 10. You should multiply i by 10 and use 1/i instead. You will still get numerical errors and there will be 16 decimals because you are working with doubles and it will prob. not end with …

Member Avatar for Bladtman242
0
269
Member Avatar for Hey11
Member Avatar for SasseMan
0
99
Member Avatar for joshianurag18

Could you give some more details? What code are you calling and how are you selecting?

Member Avatar for SasseMan
0
135
Member Avatar for famida11
Member Avatar for bkafroboy69
Member Avatar for bkafroboy69
0
119
Member Avatar for Newskin01

Since you either should use a 2D array or 3 "parallel" arrays that must mean that you use 3 1D arrays to store each column of seats. One array would then contain [ [C.Lindbergh 1A], [H.Quimby 2A], ..., [] ] etc. I would go with a 2D array since that …

Member Avatar for Taywin
0
803
Member Avatar for NeoKyrgyz

I assume you are talking about classical AI. I took a classical AI course a long time ago which was mostly about logical and statistical reasoning. We had a project in that course where we in groups of four made a minesweeper playing bot, which is a good example of …

Member Avatar for denverprojects
0
758
Member Avatar for hari jagadish

I think your question is a little poorly stated. You should give some more background on what you are doing. Like how are you connection to the DB, what DB are you using etc. but heres a link which should be helpful. [url]http://en.wikipedia.org/wiki/Java_Database_Connectivity[/url]

Member Avatar for SasseMan
0
58
Member Avatar for sariberri

I wrote something that works fairly. Linear time Does not handle if the last character is a dupe. That is left for you to fix. [code] public static void main(String [] args) { System.out.println( dupe("assdeegfddaa") ); } public static String dupe(String str) { return dupeHelper( str, "", "" ); } …

Member Avatar for SasseMan
0
731
Member Avatar for iraqi4life

Are you trying to return all three values in that method? If that is the case, it is not possible. And why are you setting the values to 1 that your are returning? Please explain a little more what you are doing or give some more code. If you want …

Member Avatar for Zhoot
0
82
Member Avatar for Twonk

I think imshow displays grayscale images. You have to call imshow(RGB) first or something like that. Read up on imshow here... [url]http://www.mathworks.com/help/toolbox/images/ref/imshow.html[/url] And I believe that method you are using to pixelate the image just resizes the image down to some scale and then up again. Read about resize here... …

Member Avatar for SasseMan
0
146
Member Avatar for SasseMan

Hi, Im kind of new to prolog and would like som help. I want to write a rule that only takes integers as input like the following example. rule( X, [] ). rule( X "is integer", [Heat|Tail] ) :- rule(X, Tail). rule( X "is anything else", [Heat|Tail] ) :- rule(X, …

0
56
Member Avatar for heiro

You can override the paint method of your canvas, which you have already done and then call g.drawLine(x1,y1,x2,y2). where x1 y1 etc. are the points which the line is drawn between. Look at the Graphics and Graphics2D api for more info. [url]http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html[/url]

Member Avatar for sfrider0
0
3K
Member Avatar for tizon

Well i don't think it looks so bad, but if you would like the buttons to be closer to each other, i.e. no gap between them you could try to set the vgap and hgap for the your layout. I suppose you are using gridlayout for the calendar, just class …

Member Avatar for tizon
0
100
Member Avatar for Bladtman242

Since the try statement might fail your variables will not be initialized, just as the compiler states. either you can place the code that uses firstArg and secondArg in the try statement or you can initialize the variables to something. You could also set firstArg and secondArg to some default …

Member Avatar for Bladtman242
0
508
Member Avatar for StorLiten

just iterate through the list and print the value when you have reached the index that is to be printed. i = 0 n = 0 for each value in list if i == index[n] print list[i] n = n+1 end i = i+1 end this should work since the …

Member Avatar for SasseMan
0
124
Member Avatar for kesh1000

hmm I dont se why this shouldn't work, try changing the "=" to "is" in the query and see if it helps.

Member Avatar for SasseMan
0
95
Member Avatar for PSU92
Member Avatar for kesh1000

What I know there is no super easy way to write your hashtable to a database, since you want to store a java object. The most common tool/framework to do stuff like this is hibernate which lets you define java objects to database mapping and then you can simply retrieve …

Member Avatar for kesh1000
0
942
Member Avatar for Mattpd

Parsing the text with space and dot delimiters isn't enought, java is more complex than that. You should maybe check out recursive descent. There might be easier ways to do it but I would define the java grammar and write a recursive descent parser for it. Check out the link …

Member Avatar for SasseMan
0
151
Member Avatar for SasseMan

Hi! I'm having some problems with gridbaglayout trying to get functionality that maybe isn't even there. The problem is the following I have 3 Jpanels with differend contents. I want panel 1 to be displayed to the left of the screen filling the y-axis, panel 2 in the middle filling …

Member Avatar for SasseMan
0
7K
Member Avatar for SacredFootball
Member Avatar for goofy_chick

I aswell as a professional pro can verify that the answer you are looking for is made very avaliable in the first post that was posted by "BestJewSinceJC". And I did not find his or anyones comments patronizing in any way. You would normaly hear infinitely more patronizing stuff coming …

Member Avatar for SasseMan
0
191
Member Avatar for becdudek

use code tags so your code is more readable [*code*][*/code*] without the stars And could you tell a little more about the problem, i'm not sure if I get what youre trying to do.

Member Avatar for SasseMan
0
142
Member Avatar for SasseMan

Hi, I have really weird layout problem. I have a class VerticalGridPanel, which uses GridBagLayout to place components top to bottom, left to right, nothing special. Then I have a List of components, which i want to add a part of to a VerticalGridPanel. I then want to add another …

Member Avatar for SasseMan
0
290
Member Avatar for SasseMan

Hi, Im writing a java app that uses hibernate for DB stuff. The thing is that it takes some time to start hibernate, and I would like to have a progress bar to show the loading procedure, and maybe print what hibernate is outputting [code] public class HibernateUtil { private …

0
80
Member Avatar for cwarn23

GMP has a c++ wrapper, you could use that if you really want to code in c++ style.

Member Avatar for cwarn23
0
143
Member Avatar for SasseMan

Hi! I'm writing a java app with a swing gui. The problem is the following. I am developing on a mac, where it runs fine. but when I run it on Windows Posready09 (Windows XP), which is the platform the app is intended for, or Windows7, half of the window …

Member Avatar for SasseMan
0
216
Member Avatar for atticusr5

there are a few things that are pretty wrong here. From line 270-298 you write TempStudent::something. TempStudent is an array so you should use [] to access some element. I seems like you would want to write TempStudent[N]::something And Im not sure if :: will work either. You have setters …

Member Avatar for SasseMan
0
142

The End.