Moderators: phlip, Moderators General, Prelates
Jplus wrote:(Excuse me for ignoring the hash/salt discussion.)
I've been going through A Tour of Go. I used to be very sceptical about Go ("oh, yet another high level language"), but today I heard it was designed by Rob Pike so I got curious and I went through the tutorial. To my surprise it's really a modern reincarnation of C.
headprogrammingczar wrote:Actually... It's a modern reincarnation of Algol 68.
Thesh wrote:No, it depends only on the quality of the password and the time to run the hash function (which is dependent on the number of iterations).
Windowlicker wrote:2) I'm still not entirely sure how restoring to previous versions works. Is the entire thing undone? For example, say we want to create two functions. I write down the headers and leave the bodies blank, then commit that. Then I fill in function 1, and commit again. Function 2, then commit. Can I go back to the first version of function 1 whilst function 2 keeps its body? The word 'function' doesn't appear to be a word anymore. Function. Fuuunc.Tion.
Windowlicker wrote:1) What is the most effective amount of work to commit? After a function is changed? After a class is changed? At the end of the day? We've been mixing between committing after a line is changed and after the entire file has been rewritten. It doesn't really help that these projects are so simple, we haven't really needed to go back to any previous versions or anything like that at any point.
phlip wrote:If post ids are chronologically ascending, you can store the id of the last-read post, for each thread for each user...
List<BotListener> objects;
...
foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
{
if ( typeof(BotListener).IsAssignableFrom(type) )
{
var Const = type.GetConstructor(new Type[] { });
if (Const != null && Const.GetParameters().Length == 0)
{
object o = Const.Invoke(null);
objects.Add(o as BotListener);
}
}
} objects.Add(o as BotListener);objects.Add( (BotListener) o );if(sender is TextBlock)
{
(sender as TextBlock).Text = "Hello, world!";
}
state = [st for s in state for st in states[(s,letter)]]Ended wrote:
- Code: Select all
state = [st for s in state for st in states[(s,letter)]]
from http://swizec.com/blog/strangest-line-o ... wizec/3012
Makes my brain hurt a bit.
state = []
for s in state:
for st in states[(s,letter)]:
state.append(st) roband wrote:Mav is a cow.
Ended wrote:
- Code: Select all
state = [st for s in state for st in states[(s,letter)]]
from http://swizec.com/blog/strangest-line-o ... wizec/3012
Makes my brain hurt a bit.
[st for s in state]
[state for st in states[(s,letter)]]Ended wrote:
- Code: Select all
state = [st for s in state for st in states[(s,letter)]]
from http://swizec.com/blog/strangest-line-o ... wizec/3012
Makes my brain hurt a bit.
current_states = [new_state for current_state in current_states for new_state in state_transitions[(current_state,input)]]EvanED wrote:Any algorithm book, probably. This is one of the standard suggestions.
For maps, you have to decide whether you're more interested in tree-based or hash-based maps.
mister_m wrote:EvanED wrote:Any algorithm book, probably. This is one of the standard suggestions.
For maps, you have to decide whether you're more interested in tree-based or hash-based maps.
How would you make a data structure generic in C?


mister_m wrote:EvanED wrote:Any algorithm book, probably. This is one of the standard suggestions.
For maps, you have to decide whether you're more interested in tree-based or hash-based maps.
How would you make a data structure generic in C?
#define HEAP_DATA_TYPE double
#include "my_heap.h"sub load {
my ($state, $module) = @_;
my ($fh, $code, $error);
open($fh, "<", "modules/$module.pl") || $error++;
$code = join('', <$fh>);
eval $code;
if ($@) {
warn $@;
return 0;
} else {
return 1;
}
}
sub callback {
my ($state, $name, $func) = @_;
$state->{$name} = sub {
$func->($state, @_);
};
}
$pm = sub {
my ($state, $dest, $line) = @_;
$state->{'write'}->("PRIVMSG $dest :$line");
};
&callback($state, "pm", $pm);
Jplus wrote:Personally, I'd just say that you don't do generic programming in C.




Users browsing this forum: No registered users and 10 guests