Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Java Sequential IO Performance

Many applications record a series of events to file-based storage for later use.  This can be anything from logging and auditing, through to keeping a transaction redo log in an event sourced design or its close relative CQRS.  Java has a number of means by which a file can be sequentially written to, or read back again.  This article explores some of these mechanisms to understand their performance characteristics.  For the scope of this article I will be using pre-allocated files because I want to focus on performance.  Constantly extending a file imposes a significa...

3,084 0       JAVA IO SEQUENTIAL BLOCKING


  C/C++ Pointer Declaration Syntax – It makes sense!

I never really liked the way pointers are declared in C/C++:int *a, *b, *c; // a, b and c are pointers to intThe reason is that I am used to reading variable declarations as MyType myVar1, myVar2, myVar3; and I always read “int*” as the type “integer pointer”. I therefore wanted the followingint* a, b, c; // a is a pointer to int, b and c are intsto mean that a, b and c all were of type int*, i.e. pointers to int. and I therefore found it slightly annoying to repeat the asterisk for every variable. This also meant that the symbol * had two sligh...

2,802 0       C POINTER DECLARATION ATTEMPT


  How Many C Programs Are There?

If I choose a size S, can you tell me how many valid C programs exist that are no larger than that size? I’m actually interested in the answer — it’ll help me make a point in a paper I’m writing. Shockingly, the Internet (or at least, the part of it that I looked at based on a few searches) does not provide a good answer.Let’s start with a few premises:Since it would be exceedingly difficult to construct the exact answer, we’re looking for a respectably tight lower bound.S is measured in bytes.Since it seems obvious that there’s an exponential n...

2,319 0       NUMBER C PROGRA STATISTIC CALCULATION


  10 Points about Java heap memory

When I started java programming I didn't know what is java heap or what is heap space in Java, I was even not aware of where does object in Java gets created, it’s when I started doing professional programming I came across error java.lang.outofmemoryerror then I realized What is Heap in Java or Java Heap Space. Its happens with most of programmer because learning language is easy but learning basics is difficult since there is no formal process which can teach you every basics of programming its experience and work which reveals the secret of programming. For Java developer knowledge o...

5,571 0       JAVA HEAP MEMORY TIPS


  Preprocessor magic:Default Arguments in C

This post is for programmers who like C or for one reason or another can't use anything else but C in one of their projects. The advantages of having default arguments is not something that needs convincing. It's just very nice and convenient to have them. C++ offers the ability to define them but C under the C99 standard has no way to allow it. In this post I will detail two ways I know of implementing default arguments in C. If a reader happens to know additional ways please share in the commentsSuppose we have a struct that contains some data and we want to initialize it//! The struct we wa...

12,404 0       C PREPROCESSOR DEFAULT ARGUMENTS


  Will Artificial Intelligences Find Humans Enjoyable?

Will AIs find humans interesting, enjoyable, and worthy of companionship? My guess: the smarter and more autonomous they become the more the answer will become NO. There are practical reasons for AIs to want to understand humans: The AIs will want to protect themselves from all threats, including human threads. The AIs will also want to get more resources (e.g. energy, raw materials for fabrication of additional computing power). The extent that humans control access to resources AIs will want to trade with them unless the AIs decide they can take the resources by force.But why should AIs find...

2,596 0       AI PEOPLE COOPERATION ENJOYABLE


  Lisp: It's Not About Macros, It's About Read

Note: the examples here only work with outlet lisp. Refer to your version of lisp/scheme’s documentation for how read works (and possibly other forms)I know it’s an old post by now, but something about the article Why I love Common Lisp and hate Java, part II rubbed me the wrong way. The examples just aren’t that good. The usage of macros is plain baffling, when a function would have been fine. The author admits this, but still does it. There’s a follow-up post which focuses more on macros but it still misses the point.Here’s the thing: it’s not really...

5,659 0       JAVA MACRO LISP READ


  Is Scala Only for Computer Scientists?

I have experience struggling through these kinds of things andI know enough about the subject that I can understand why they did it that way.But my concern is that this should be an example that a beginner could understand, and they can't. There's too much depth exposed.Here's the example, which is written as a script:import scala.io.Source._case class Registrant(line: String) { val data = line.split(",") val first = data(0) val last = data(1) val email = data(2) val payment = data(3).toDouble}val data = """Bob,Dobbs,bob@dobbs.com,25.00Rocket J.,Squirrel,rocky@frostbite.com,0.00Bullwinkle...

3,185 0       SCALA COMPUTER SCIENCE APPLICATION FIELD