3,386 Posted Topics

Member Avatar for dls_20022002

#include <stdio.h> #include <stdlib.h> int main() { return(EXIT_SUCCESS) } And zeroliken's pseudo code should be enough help to start.

Member Avatar for zeroliken
0
348
Member Avatar for marleyB

We are flabbercasted by your poetry, but did you have anything specific to ask or your efforts to show?

Member Avatar for TrustyTony
0
71
Member Avatar for hwoarang69

Are you sure that you needed to remove them instead of only not show them or pass them? #include <stdio.h> #include <stdlib.h> int iarr[] = {1, 3, 0, 0, 5, 7, 0, 0, 0, 9, 9, 6, 0, 9}; int len = sizeof(iarr)/sizeof(iarr[0]); int main() { int i; for (i …

Member Avatar for Vish0203
0
6K
Member Avatar for Kathy0410

I do not get why the dice value is doubled for computer, on first post you describe two die.

Member Avatar for NormR1
0
662
Member Avatar for cecsFTL
Member Avatar for GTech4life

You must not define the method twice, and usually it is better practice to return value or set attribute of class, than print in function.

Member Avatar for TrustyTony
0
282
Member Avatar for TrustyTony

This came up, maybe it is usefull to somebody. Later I plan to do a managing context interface to `with`statement for this.

Member Avatar for TrustyTony
0
2K
Member Avatar for kuchi

> Configuring in OpenLDAP 2.1 and later - Since 2.1, the client libraries will verify server certificates. This change requires clients to add the TLS_CACERT (or, alternately, the TLS_CACERTDIR) option to their system-wide ldap.conf(5) file. Without this setting, the LDAP clients will fail to make any TLS/SSL connections to any …

Member Avatar for TrustyTony
0
214
Member Avatar for neilaggarwal

You have return out of function at line 9, and extra ** at line 4 as bold is not allowed in code. Based on http://snippets.dzone.com/posts/show/724: import win32clipboard as w import win32con from time import sleep def get_text(): w.OpenClipboard() d = w.GetClipboardData(win32con.CF_TEXT) w.CloseClipboard() return d def set_text(to_put, the_type=w.CF_TEXT): w.OpenClipboard() w.EmptyClipboard() w.SetClipboardData(the_type,to_put) …

Member Avatar for vegaseat
0
1K
Member Avatar for spawn2004

[backquotes](http://www.codecoffee.com/tipsforlinux/articles/26-2.html) with `cat`?

Member Avatar for spawn2004
0
120
Member Avatar for iwanna mix-mix

I do not understand, you are doing string compare with uninitialized allwords array, before you read word inside the while, shouldn't you use for or do..while and check after reading?.

Member Avatar for TrustyTony
0
194
Member Avatar for JorgeM

The hover part is little tough (ie impossible) in my mobile, so no rep then from me, sorry!

Member Avatar for JorgeM
0
499
Member Avatar for debasishgang7
Member Avatar for lostlibearlarts

As I can not run your code without the icons, I can not answer your questions, I for now only offer this clean up of your functions (untested), even I think their action should be reconsidered. #-----function definitions----- def font(): basicFont = pygame.font.SysFont(None, 50) questionFont = pygame.font.SysFont(None, 30) startcolor = …

Member Avatar for TrustyTony
0
177
Member Avatar for KickAssElmo

If you solved it yourself, it is nice of you, if you can post the solution for your thread, so other's can get help from it in future.

Member Avatar for TrustyTony
0
101
Member Avatar for ashboi

> Student::Student(int ID, string Name) > { > ID = newid; > Name = newname; > } Shouldn't this maybe be (looks so but I am more C than C++ guy, never did OO with C++): Student::Student(int newid, string newname) { ID = newid; Name = newname; }

Member Avatar for ashboi
0
162
Member Avatar for decade
Member Avatar for blocblue
0
1K
Member Avatar for athulram

I have not used one, but this looks promissing and comes with example directory: https://github.com/sciyoshi/pyfacebook/

Member Avatar for TrustyTony
0
127
Member Avatar for jpunkins

Major hindrance is for me only which is running faster, column or row number. Different programming languages have different practices. It is easy to name row for column and exchange the roles. Good thing is that it really does not matter so much as mostly this transposing does not matter, …

Member Avatar for MandrewP
0
149
Member Avatar for Razrak
Member Avatar for minimee120
Member Avatar for pawel1

Usual way to guess optimally is to guess average of low guess (initially 0) and high guess (initially 101).

Member Avatar for TrustyTony
0
262
Member Avatar for weblover

Take care that you have strings, not integer values, so '9' would be maximum at column 1 and '10000' would be minimum at column 2.

Member Avatar for Gribouillis
0
441
Member Avatar for minimee120
Member Avatar for yamigx

It would be kind of you to post corrected code, so it can help others in future. Your sum example is not correct as I get 1+7+13+4 = 25. You must consider though that this is considered even sum, but the values are 1,3,5,7 by human counting even they are …

Member Avatar for TrustyTony
0
278
Member Avatar for bettybarnes

I would use count down style without fixed number to be able to do any given number of repeats, and do Hello(1000) to do thousand of them, probably something like (I have not VB installed in my computer): Public Sub Hello(ByVal howmany As Integer) If howmany > 0 Then ListBox1.Items.Add("HelloWorld") …

Member Avatar for Reverend Jim
0
86
Member Avatar for TrustyTony

Here slightly edited code from one of my earliest posts to DaniWeb. Limitted by recursion limit of Python as it uses recursion, but interesting for me.

Member Avatar for TrustyTony
0
1K
Member Avatar for Valiantangel

For me this is better and simpler: #include <stdio.h> #include <stdlib.h> #define fact 5 int main(void) { int i,result=1; for (i=1;i<=fact;i++) { result*=i; printf("factorial of (%d) = %d\n", i, result); } return(EXIT_SUCCESS); }

Member Avatar for TrustyTony
0
92
Member Avatar for NeoSyn

You should have import seaWorld, not global seaWorld. I think it is not quite so clever to have 3 identifiers only differing by cases, use `my_seaworld` or something like it.

Member Avatar for NeoSyn
0
737
Member Avatar for khuzdaar
Member Avatar for TrustyTony

Here is my take on [balanced ternary](http://en.wikipedia.org/wiki/Balanced_ternary) conversion (the base considered by [Donald Knuth](http://en.wikipedia.org/wiki/Donald_Knuth) "Maybe the prettiest")

1
949
Member Avatar for TrustyTony

I would like to take string argument for class BalancedTrinary intializer, but the string type of argument is processed before it enters the init function. I guess I must override any class method which deals with those for int/long? def val(number_sequence, base): """ produce integer value of number_sequence as base …

Member Avatar for Gribouillis
0
277
Member Avatar for NickPatton
Member Avatar for NickPatton
0
1K
Member Avatar for drichird

You should always take small steps and add functionality only after fully tested last one to know that it is reasonably sure that the bug in code is in the last code added. General philosophy of testing is geared toward [defining test cases](http://blenderartists.org/forum/showthread.php?211957-Test-Development-Design-%28TDD%29-in-Blender-python "Test Driven Development") for the functions and …

Member Avatar for drichird
0
8K
Member Avatar for huphane

I would fix your code tags but it has no value as your code formatting indention does not make any kind of sense. See Formatting help from link in right top corner of the editor box. Basically you should highlight your code and push TAB to indent it. But first …

Member Avatar for NormR1
0
283
Member Avatar for Brenda_Bawa

You can not undo membership, but you can stop receiving emails from DaniWeb if you so desire from **EDIT PROFILE**

Member Avatar for deceptikon
0
277
Member Avatar for Ancient Dragon

You should maybe check updating of your bug list, you got anchor ampersands reported before.

Member Avatar for Ancient Dragon
0
256
Member Avatar for stinkypete
Member Avatar for AndradaK

Unfortunately we do not do homeworks, but we do help if you get stuck and post your code and debugging efforts.

Member Avatar for TrustyTony
0
510
Member Avatar for Zorrro

> generic template Yes we have one, it is called membership rules, and is clearly available from top bar. I see more problem on abandoned threads, where OP does not come back to read the answers and response to suggestions. For unanswered messages there is Unanswered and even more relevantly …

Member Avatar for Zorrro
0
188
Member Avatar for TrustyTony

Here is base conversion function written to deal also with [negative bases](http://en.wikipedia.org/wiki/Negative_base). Not yet balanced ternary, where numbers themselves can be negative, maybe later I add it.. Based on the code in the wikipedia article, which has bug for converting 0.[**Edit: I fixed the bug in wikipedia**]

Member Avatar for TrustyTony
0
249
Member Avatar for heinlein_

>>> test = "cat ate the catfood and went to cat's bed to see cat dreams on catepillars." >>> test = ' '.join('dog' if word == 'cat' else word for word in test.split()) >>> test "dog ate the catfood and went to cat's bed to see dog dreams on catepillars." …

Member Avatar for heinlein_
0
8K
Member Avatar for qaman88
Member Avatar for asif49
Member Avatar for denny61302
Member Avatar for aprilcrash

Something like: def main(): badfoods = [] keys = ['Food','Chemical','Imminent death'] for food in [['alcohol', 'alcohol poisoning', 0], ['anti-freeze', 'ethylene glycol', 1], ['apple seeds', 'cyanogenic glycosides', 0], ['apricot seeds', 'cyanogenic glycosides', 0], ['avocado', 'persin', 0], ['baby food', 'onion powder', 0]]: badfoods.append(dict(zip(keys, food))) print badfoods main() ?

Member Avatar for TrustyTony
0
295
Member Avatar for sofia85

First of all, looks like you have doubled values at col 2 and col3, so you can keep only one of them, you could produce upto 100 sorted files by the two first digits of col1. But important thing is how big this second file is? If it is not …

Member Avatar for macanohost
0
189
Member Avatar for dctb13
Member Avatar for jdm3

The b is not in string, but it is sign of binary bytes string without set encoding. Why you produce copy of grp for printing, wouldn't it be more clear to print the grp? Or actually do for loop over items in grp. # you had first ) missing from …

Member Avatar for TrustyTony
0
260
Member Avatar for razamughal67

Ensure us on legality of this stuff you are asking. We are not cracking forum. See [Member Rules](http://www.daniweb.com/community/rules)

Member Avatar for jackbauer24
0
240

The End.