?

Log in

No account? Create an account

Computer algorithms' Journal

Recent Entries

You are viewing the most recent 25 entries.

16th April 2016

georgecomer11:00am: 15 though early morning of 16 April
I began a reading of "Artemis Fowl". RS said it reminds her of the strangely non-sexual, intense relationship between Lucky and Nrsc. I read to "Ciao, fulletta" in Chapter 3 ("Holly") and by the end of page 61 (The Hummingbird Full Moon Rirual) was too much for me. The time was 1922hrs, I dressed, secured S15 and caught the OL for lemon Grove. I spent the evening and early morning (16 April) in the garage of the Blue Bird Street house mostly doing some non-LEPrecon inter net surfing. The most recent meeting of The Honey Bee Writing Club is scheduled for 1500hrs in The MVL. I thought yesterday it was an ACC meeting. Wrong, it is to be The HBW Club. I cannot even begin to gues what the meeting shall accomplish. RS and I are not in the Club. Beth G is taking care of her little girl plus Dsrvl`s three children. We do not expect her to come, unless Charlene agrees to help. Aldous for unknown reasons is with CFS and Speadtle somewhere near Palomar Mountain.

As NR would say...
Now you know what I know
WS Campbell, Inspector
Duty Officer
OPD
TDY/ NYD OIG FR
Current Mood: busy

11th May 2011

da_forever5:25pm: Divide a circle
Hi!
I've been member of this community for quite time, and now I need some advise.

Question is how do I devide given circle with radius R into N vertical segments with same area?
And by vertical I mean that devising lines should be parralell to the diametr line of that circle. One more thing - N is always even. Simple example is N = 2 : and we have circle divided vertically into two parts of equal area with deametr line.

I need this to speedup my litlle research on mathematical statistics with parallel GPU eval.

Any help In form of formula, or ref to the known algorithm (if it does exists) or some code on almost any programming language would be g8.

UPD
Illustration added. Case: R=1 N=6, areas of all segments are equal.
I need to know OX points marked with question marks.
Photobucket

6th August 2010

shamebear4:39pm: Contributing without even knowing
Flash animations on webpages consume a surprisingly large amount of CPU time, especially if you keep many pages open at once. When you think about it, this is a very fast and efficient way to distribute some software onto a lot of computers. Put up a banner on a major news site and you have your code ticking along on thousands of computers within minutes, and with no user interaction.

It's strange that distributed computing has not leapt onto this. Granted, it's a narrow nieche, with the program running only for a few minutes and with a limited size, but there are still plenty of cases where it could work. I've only found This proof of concept of distributed flash computing. This example require some user interaction and fills a whole screen, but there seems to be no reason why it couldn't run as a banner ad.

Why isn't this more widespread?

4th May 2010

ginaspider10:02am: keystream
Dear lazy web,

Do you know if there exists any keystream algorithms where in which, given an input key, you can request from the algorithm something like "give me slot 433"?

Let me clarify,
so a typical keystream you seed with some key and then are able to request sequential bytes. In my particular application I want to encrypt 8Kbytes xored against a keystream but have it so it can be randomly read and written to. So I guess it would be like a key-block cipher or something like that. I don't fancy re-implementing crypto so I'm wondering if such a technique exists out there.

13th March 2010

main_framer12:35pm: Looking for a job. java team lead / system architect
Hi!

At the moment I am looking for a job of java team lead / system architect.
CV
http://www.chantingwolf.narod.ru/cv8en.doc
LinkedIN profile
http://www.linkedin.com/in/mykbova

-Mykola

9th January 2010

dangiankit1:30pm: 1st Call for Papers: SIGAI Workshop on Emerging Research Trends in AI (ERTAI-2010)
The Special Interest Group on AI (SIGAI) of Computer Society of India (CSI) announces a *workshop* on "Emerging Research Trends in AI". The workshop will be organised and hosted by CDAC Navi Mumbai, India and is meant to encourage quality research in various aspects of AI, among the Indian academia/industry. For details, refer the first call for papers below (in the LJ Cut), and visit http://sigai.cdacmumbai.in and http://sigai.cdacmumbai.in/index.php/ertai-2010

[Cross-posted at mumbai , ai_research and _scientists_ ]

Collapse )

5th December 2009

cr4k2:19pm: Finding the nearest in a sorted set of int to a given int
Hi guys,

I'm in the middle of writing a connector to some accounting software and I've been implementing a lazy loading list of proxies because I'm dealing with huge lists of items which load slowly (even the item id s load slowly).

That's not important to the question I am asking though, basically, I want an algorithm which finds either the given search int in my sorted set (of indexes) or the nearest int contained in the list (it doesn't matter, but we can say that the algorithm has a preference for lower numbers if 2 values are equally near)

The essence of the problem is outlined here:


import java.util.TreeSet;

public class Search {
static TreeSet sorted = new TreeSet();

public static void main(String...args){

sorted.add(1);
sorted.add(3);
sorted.add(5);
sorted.add(7);
sorted.add(10);

findNearest(2); // return 1
findNearest(8); // return 7
findNearest(10); // return 10
}

private static Integer findNearest(Integer search) {
return null; //TODO halp pls!
}
}


Thanks for any advice in advance!

21st May 2009

notthebuddha5:48am: Big-O for other parameters?
Is Big-O (and Omega and Theta) ever used for other algorithm cost parameters besides time? Like, could I usefully describe different presentation methodologies in terms of bandwidth consumption per n bytes of content as O (n log n) for example? Or is there a separate notation?

20th May 2009

triprc3:48pm: I'm sorry allow me to rephrase this. If I'm graphing e^x is there a point when y will have a zero value?
triprc3:33pm: What exponent must e be raised to in order to equal zero?

4th March 2009

jtootf8:32pm: n-th order statistics of the immutable data
what's the best asymptotic time complexity for a n-th order statistics algorithm on the immutable array of size N with memory consumption less then or equal to O(log N)? median of medians algorithm gives O(N) time complexity in the worst case, but I'm not sure about it's memory boundaries for the r/o array

UPD: anyway, it would be much interesting too for the case of the memory consumption less then or equal to O(sqrt N); or even O(K * N) where 0 < K << 1

7th February 2009

emptywarrior377:13pm: Partially sorted array
Let's say you have an array, which is sorted, and then some small number of the elements become corrupt, so the array is not sorted anymore. Is there some efficient way to sort it again that doesn't involve resorting the whole array? (You may not necessarily know which elements are corrupt)

29th January 2009

coises8:57pm: Pseudo-random dice

I’m hoping someone here might know why this is not working as expected. I’m attempting to generate pseudo-random throws of dice in Java. In each round I generate 15 values from 1 to 6. From the player’s perspective, 5 dice are rolled, and any or all of them may be re-rolled one or twice. I implement this by taking the first roll from the first 5 values, whichever dice are not held on the first re-roll from the corresponding 6th to 10th values, and whichever are not held on the second re-roll from the 11th to 15th values.

I became suspicious that something was not right, and I believe I have shown that to be so. I’ve tried two sources of random numbers: one is the Random class built into Java (which is a linear congruential generator); the other is an implementation of the Mersenne twister. Both exhibit the same anomalies, so I presume the fault must lie in the routine that reduces the range to six integers, which is common to both.

Collapse ) I previously tested the frequencies of each number — they are as expected; but there seems to be correlation between values in certain positions in the 15-number groups I’m generating, and I don’t know why, nor how to go about eliminating it.

Any insight and/or advice would be greatly appreciated.

13th January 2009

hearthand1:22pm: Computer Graphics - Java
Some backstory for those willing to kindly help me interpret the below java code.

The class is Computer Graphics. What we did in the class was to basically reinvent the wheel; well, the java Graphics2D and Graphics3D API (except... badly) In our projects we managed to master (dun dun DUN!) 3D cubes and viewpoints, hidden surfaces, shaded surfaces and hidden line removal (ta da!) and an insane amount of inheritance. For this question we have to discuss how we might represent a class to represent a cylinder using flat surfaces (where Surface3D inherits from many simple classes: Drawing3D, Line3D to Point3D) to approximate to the figure. 

So far I have established that the paramaters used to specify the cylinder will be: center point, diameter, length and position. An ArrayList data structure will be appropriate for the cylinder and how I will do the class in English. I had a look at the sample answer and I found some java code which I've since been puzzling over because I'm not 100% sure what on earth it's doing.

Collapse )

4th July 2008

antilamer3:20pm: Convergence of graph colouring
I am coloring a graph's nodes, based on a set of initial conditions and rules of the form "if colors of a node's neighbours are like this, then color of the node is that": so, a cellular automaton on the graph.
For simplicity, let us consider the graph to be acyclic and restrict the rules so that a node's color depends only on the colors of its child nodes.

What are the methods of exploring convergence and soundness of such a system of rules?

To put it easier, how to know, for a given system of rules, whether there exists a unique coloring satisfying them, and whether it is reachable by the following algorithm: "take any node, apply rules to it, repeat until convergence"?

23rd May 2008

antilamer9:20am: Category theory and query optimization
Almost ever since I got acquainted with category theory it seemed to me like a perfect tool for formalizing database queries and their properties, and, consequently, for building optimization frameworks.
I am considering this for my thesis, but I can't find any work about applying category theory to query optimization, and this frightens me a bit: looks like someone has long ago proved that this is impossible (why would it be?), and now noone even tries.

Could you give me pointers to some works on the topic? I've googled the hell out of the internet, I found some works on formalizing data models with CT but nothing on exactly optimization.

29th April 2008

ginaspider8:02am: I'm not terrible keen on understanding Gaussian coefficients at the moment. I just want to generate them. Does anyone know of an algorithm that does this or know the pattern they have? EG:

1,1
1,2
1,3
1,4,6
1,5,10
1,6,15,20
1,7,21,35
1,8,28,56,70
.. etc

24th April 2008

ginaspider10:48am: raytracer
So, I'm once again writing a ray-tracer. So far the only objects it supports are planes and spheres. My intent to support only polygons. So, I'm curious. A low-polygon polygonal object is going to look, pretty.. well- polygony (if you know what I mean). My plan was to take the ray-polygon intersections and blur the collision normal, depth (somehow) and other information between adjacent polygons. I was planing on doing this using the dot-product between the collision-to-adjacent-polygons-far-edge vector and the collision-to-adjacent-polygons-near-edge vector as a bias for bluring. Is this how smoothing polygon-meshes is normally done? It seems like there'd be a better solution. What do you people think?

1st April 2008

ginaspider5:09am: j



So this is kinda a simple technique that I think is pretty cool. For ever vertex find the vectors to it's neighbors and subtract the distance that should be between them, multiply by some small constant. Sum all them up and add it to the vertex. Rinse and repeat. I've stored it as an animated gif, it's about 3Mbytes so give it a second to download. I have two vertices that are going crazy with randomness. I think it looks creepy myself.

30th March 2008

hearthand7:12pm: Debugged
Edit: Error was located and corrected. I love how programming can turn programmers temporarily blind :) I'll leave it here in the hope that perhaps others with the same problem can find it and think "OOOOooooOooh" before publically admitting to a community that they can't keep track of their pointers. :)

Thank you all for your help to my previous post! I've started to pick up C syntax really quickly since, and I've been integrating my two programs; the one with the functions to push, pop and create arrays, with the program lightning_rose suggested that I should write. So far my array seems to work and I'm sure that my push function is working, but when I ask it to print the contents of the stack, it prints 0. My aim isn't to iterate down the entire array, but to print that they've been pushed once they've been pushed.

Here is the buggy bit - where I expect the error is:


/* else, it will be an integer.*/ else { int temp = atoi(argv[i]); push (temp); //int i = 0; printf("Stack: %d", stack[top]); //printf("Integer: %d\n",atoi(argv[i])); }


Collapse )
Current Mood: busy

28th March 2008

hearthand3:14pm: C
I'm finding C difficult to understand. I'm working using two books: C in a Nutshell and I'm referencing with Comprehensive C (which is old but it was free.) The problem I'm trying to solve is to create a Reverse Polish Notation calculator. I'm using an array as a stack and the basic principle is:
for input (from command prompt) 2 1 +
Push 2 on the stack. Push 1 onto the stack. Meet operator, pop two and then push answer onto the stack.

But I'm having problems with my main method, particularly with the C syntax. This is my main method so far:

Collapse )

This is what I'm planning to do, in English:

If ( x is a character) {
    either return 0 as value
   or set next item to memory location [x]
}
if (x is an operator) {
   POP two from the stack
   use operator on two operands
   Push answer onto the stack again
      //error checking for condition that only one value has been pushed onto stack
}
//otherwise, fall through assuming that x is an integer
convert x into an integer using atoi()
Push (x)

TADA!

I'm planning on using if for error checking and converting everything else to case statements instead. I'm use to programming in java, though, so I'm scared that I'm java-ing too much :/

Advice? Kicks? Clarifications?
Current Mood: aggravated

27th March 2008

lightning_rose2:13pm: DON'T CLICK ON THE LINK
The link in the previous post is a Trojan website that will attempt to install a virus on your computer.

I repeat, DON'T CLICK ON THE LINK

26th March 2008

ginaspider4:27pm: Anyone know of a good algorithm to find the border around a 2d polygon mesh?

1st February 2008

hearthand4:53pm: C
Can anyone recommend a good beginners book on C?

In a few weeks time I will be using C for low level programming to solve problems. (Low level programming being the class.) C will be my second language, I already understand the basics of java objects and ADT's so preferably a book that defines clearly why C isn't object oriented... 

Edit: I ended up buying "C in a Nutshell" because it is the course textbook and came highly recommended. It doesn't provide enough baby-step explanations for me, though, so I'm still finding C a damned difficult language to learn. Thank you all for your suggestions, I'm planning on buying the recommended book anyway in the hope that the developers of C will be better at explaining things.
Current Mood: accomplished
Powered by LiveJournal.com