AMuHb Lab

Sorry my Russian (или горите в аду).

  • Useless Buttons

  • RSS Mei Mei

    • test
      test Filed under: Uncategorized
      Axarova
  • RSS jujav4ik

    • Desktop wars: Are you serious?
      They still exist! No, really! KDE vs. Gnome vs. XFCE vs. blah-blah-blah Recent experience of switching among desktop environments proved one little thing to me.  Do you all know how easy is to change your desktop background? – Well, switching … Continue reading →
      andreyv
    • KDE 4.7.x: I’m staying
      It’s been more then few weeks of “KDE experiment” I got myself into. The fact that KDE has become my default desktop environment is a bit shocking for me as well, as I’ve been a big fan of Gnome. Recent upgrade … Continue reading →
      andreyv
  • RSS Heo

Archive for the ‘C, C++ and Java’ Category

Everything about coding

Sigmoid function

Posted by amuhb on December 3, 2009

Googled it out lately:

class Calc {

public static double sigmoid(double x) {

return (1/( 1 + Math.pow(Math.E,(-1*x))))

}

}

For example, let’s say you have 18 and 8. You subtract 8 from 18 and get ten and pass it to the Sigmoid function. You’re returned with 0.9999546021312976. If you had a difference of 0 though, you would get .50 and if you had a negative difference, like -18, get a really tiny number that’s bigger than 0. So in short, the Sigmoid function is easy and quite interesting.

I just passed my E = X1W2 + X2W2 + … + X3W3 + W0 there.

Here is the original source, Thanks to the author.

Disclaimer: I really dont know, will it work or not. I made a class, which – yes, produces something. The question is – will it work in a neural network.

Posted in Genetic Algorithms., My programs, Parts of Code | Tagged: , , , | 2 Comments »

Neural network I

Posted by amuhb on December 2, 2009

Input: X;

Weight: W;

Activation: A;

A = X1W1 + X2W2 + X3W3 + … + XnWn.

If (A >= someThreshold) { //Output 1 }

Else { //Nothing }

someThreshold - simple step, any valid curve function, etc.

Posted in Brainsnack., Self-reminder Goodies | Tagged: | 1 Comment »

И тут многое стало намного понятней

Posted by amuhb on December 2, 2009

Scary way:

Easy way:

double activation = 0;

for (int i=0;  i<n;  i++)

{ activation += x[i] * w[i]; }

Posted in Brainsnack., Parts of Code | Tagged: , , | Leave a Comment »

Sample Class Declaration

Posted by amuhb on November 3, 2009

class MyClass extends MySuperClass implements YourInterface {

//field, constructor, and method declarations

}

Posted in C, C++ and Java | Tagged: , | Leave a Comment »

Break with label, 2-Dim array search.

Posted by amuhb on November 3, 2009

int[][] arrayOfInts = { { 32, 87, 3, 589 },

{ 12, 1076, 2000, 8 },
{ 622, 127, 77, 955 }

};

Read the rest of this entry »

Posted in Parts of Code | Tagged: , , | Leave a Comment »

About Threadpool

Posted by amuhb on November 1, 2009

In computer programming, the thread pool pattern is where a number of threads are created to perform a number of tasks, which are usually organized in a queue. Typically, there are many more tasks than threads. As soon as a thread completes its task, it will request the next task from the queue until all tasks have been completed. The thread can then terminate, or sleep until there are new tasks available.

Read the rest of this entry »

Posted in Self-reminder Goodies | Leave a Comment »

Some terms (related to each other), part I.

Posted by amuhb on November 1, 2009

GUI – Graphical User Interface;

Client-Server – a distributed application architecture that divides tasks or workloads between service providers (servers) and service requesters (clients). Generally, it describes the relationship between two programs, where one makes a service request to another. In a network, multiple server programs can be run on one host, the server machine. Client programs initiate communication sessions with servers, which await (listen to) incoming requests. Opposing to Peer-to-Peer and Client-queue-Client architectures.

API - Application Programming Interface – an interface that a software program implements in order to allow other software to interact with it; much in the same way that a software might implement the GUI in order to allow humans to operate with it.

J2EE - Java Platform, Enterprise Edition;

JMS - Java Message Service API is a messaging standard that allows application components based on the A2EE to create, send, receive, and read messages. It enables distributed communication between components. Java applications that use JMS are called JMS clients; system that handles routing and delivery of messages - JMS Provider; JMS Application – a business system, composer of many JMS clients, and, generally, one JMS Provider.

EJB – Enterprise JavaBeans. A server side component architecture for Java Platform, Enterprise Edition. EJB technology enables rapid and simplified development of distributed, secure and portable applications based on Java technology.  In a typical application, EJBs contain the application’s business logic and business data, and is solving many issues which appear while using the standard Java objects.

 

Posted in Self-reminder Goodies | Tagged: , , , , , | Leave a Comment »

About Macro Substitution

Posted by amuhb on October 31, 2009

#define name replacement text

Read the rest of this entry »

Posted in Self-reminder Goodies | Tagged: , | Leave a Comment »

Simple array sorter source

Posted by amuhb on October 30, 2009

/* Simple array sorter */
/* By AMuHb*/
Read the rest of this entry »

Posted in My programs | Leave a Comment »

Recursive solution (confusiong one)

Posted by amuhb on October 30, 2009

#include <stdio.h>

/*printd: print n in decimal */

void printd(int n) {      //receives an argument, lets say, an int 123;

if (n<0) {                //IF it is less than zero, then

putchar(‘-’);        // print a minus,

n = -n; }             // and get it over with, ok;

if (n / 10) {                        // WHY IS IT HERE?

printd (n / 10); }           // here, its ok – call the function again, but with an ‘n’ divided by ten. I have 123 / 10, it is 12.3 – and ‘.3′ is being dropped.

putchar (n % 10 + ’0′);           // Takes whatever is left from (n / 10), and prints it out. In this case, 123 / 10 = 12.3,  so it takes 3. And so on.

}

Posted in Parts of Code | Tagged: | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.