Search Results

Search found 33 results on 2 pages for 'psihodelia'.

Page 1/2 | 1 2  | Next Page >

  • How to redistribute binary programs built on modern Ubuntu so that they can be executed on any older Linux system ?

    - by psihodelia
    I found that if I build any binary on Ubuntu 10.10, then it doesn't execute on some older Linuxes. It is because Ubuntu uses a very new C library, called EGLIBC. Most of the desktop Linux systems use GLIBC. I would like to know whether there is any standard method how to redistribute binary programs built on a modern Ubuntu so that they can be executed on any older Linux system ? How to find all required dependencies (glibc version, dynamic libraries) ?

    Read the article

  • Is there any remote desktop with sound and video capabilities allowing 2 different users work simultaniousely (a local and a remote one)?

    - by psihodelia
    I have a very powerful PC with Intel processor and a small Mac laptop with PowerPC processor. Both computers are with Ubuntu Linux. Mac laptop cannot play flash videos and I cannot install any Intel-CPU program on it (like Skype). So, it means I can install only open source applications on the laptop from Ubuntu repositories. I have two different Ubuntu system users on PC, say ME and SHE (and root as well :) ). If I work as user ME on PC, then user SHE should also be able to access my PC remotely from her laptop and she should see a desktop of user SHE, not my desktop. She also must be able watch videos, flash, and listen sounds. Is it possible with Ubuntu?

    Read the article

  • When Intel/AMD plan to use new CPU sockets? [closed]

    - by psihodelia
    It is very expensive always to use most modern hardware especially buying new mainboard if only a new CPU is desired. It would be much better if one knows whether and when major CPU producers plan to change CPU sockets. Do you know when it is planed to change sockets the next time? I am particularly interested in not buying Intel i7 CPU if a new CPU will be released soon with not compatible pins.

    Read the article

  • VIM - how to substitute a word in-place?

    - by psihodelia
    I would like to substitute a word in-place. For example, after yanking some word by pressing yw and then I set a cursor on some other word, then I would like to press something so that substitution will happen. (e.g. SOME_KEYw where w is really w and SOME_KEY is some key). I would not like to switch into Insert Mode. I am not interested in :%s/oldword/newword/gc solution. I need interactive in-place substitution!

    Read the article

  • How to make a quiet laptop?

    - by psihodelia
    Most modern laptops have very noisy fans. I am looking for a quiet laptop or a small stationary computer which has all its hardware built in a display. Most tasks will be PDF/docs processing, real-time audio processing, web-surfing and Skype video chats. Certainly, there is no any fan-less model today; but maybe some of the existed laptops do not switch on their fans so often or implement different solutions? For example, an iPad has no fan at all and it is fast enough for my needs, but it has no normal operating system, so I can't use it for anything but audio chats and web-surfing. Or maybe I can buy a laptop and tweak it to make it absolutely noiseless? Can you recommend any solution please?

    Read the article

  • How to make a quiet laptop ? [closed]

    - by psihodelia
    Most modern laptops have very noisy fans. I am looking for a quiet laptop or a small stationary computer which has all its hardware built in a display. Most tasks will be pdf/docs processing, real-time audio processing, web-surfing and skype video chats. Certainly, there is no any fan-less model today; but maybe some of the existed laptops do not switch on their fans so often or implement different solutions? For example, an iPad has no fan at all and it is fast enough for my needs, but it has no normal operating system, so I can't use it for anything but audio chats and web-surfing. Or maybe I can buy a laptop and tweak it to make it absolutely noiseless? Can you recommend me any solution please? Thanks in advance!

    Read the article

  • How to find a binary logarithm very fast? (O(1) at best)

    - by psihodelia
    Is there any very fast method to find a binary logarithm of an integer number? For example, given a number x=52656145834278593348959013841835216159447547700274555627155488768 such algorithm must find y=log(x,2) which is 215. x is always a power of 2. The problem seems to be really simple. All what is required is to find the position of the most significant 1 bit. There is a well-known method FloorLog, but it is not very fast especially for the very long multi-words integers. What is the fastest method?

    Read the article

  • C/GCC - Is it possible to sort arrays using preprocessor?

    - by psihodelia
    I have a number of very long arrays. No run-time sort is possible. It is also time consuming to sort them manually. Moreover, new elements can be added in any order later, so I would like to sort them by value using C preprocessor or maybe there is any compilers flag (GCC)? For example: sometype S[] = { {somevals, "BOB", someothervals}, {somevals, "ALICE", someothervals}, {somevals, "TIM", someothervals}, } must be sorted so: sometype S[] = { {somevals, "ALICE", someothervals}, {somevals, "BOB", someothervals}, {somevals, "TIM", someothervals}, }

    Read the article

  • GCC - How to realign stack?

    - by psihodelia
    I try to build an application which uses pthreads and __m128 SSE type. According to GCC manual, default stack alignment is 16 bytes. In order to use __m128, the requirement is the 16-byte alignment. My target CPU supports SSE. I use a GCC compiler which doesn't support runtime stack realignment (e.g. -mstackrealign). I cannot use any other GCC compiler version. My test application looks like: #include <xmmintrin.h> #include <pthread.h> void *f(void *x){ __m128 y; ... } int main(void){ pthread_t p; pthread_create(&p, NULL, f, NULL); } The application generates an exception and exits. After a simple debugging (printf "%p", &y), I found that the variable y is not 16-byte aligned. My question is: how can I realign the stack properly (16-byte) without using any GCC flags and attributes (they don't help)? Should I use GCC inline Assembler within this thread function f()?

    Read the article

  • Speedup writing C programs using a subset of the Python syntax

    - by psihodelia
    I am constantly trying to optimize my time. Writing a C code takes a lot of time and requires much more keyboard touches than say writing a Python program. However, in order to speed up the time required to create a C program, one can automatize many things. I'd like to write my programs using smth. like Python but with C semantics. It means, all keywords are C keywords, but syntax is optimized. For example, this C code: #include "dsplib.h" #include "coeffs.h" #define MODULENAME "dsplib" #define NUM_SAMPLES 320 typedef float t_Vec; typedef struct s_Inter { char *pc_Name; struct s_Inter *px_Next; }t_Inter; typedef struct s_DspLibControl { t_Vec f_Y; }t_DspLibControl; void v_DspLibName(void) { printf("Module: %s", MODULENAME); printf("\n"); } int v_DspLibInitInterControl(t_DspLibControl *px_Con) { int y; px_Con->f_Y = 0.0; for(int i=0;i<10;i++) { y += i * i; } return y; } in optimized pythonized version can look like: include dsplib, coeffs define MODULENAME="dsplib", NUM_SAMPLES=320 typedef float t_Vec typedef struct s_Inter: char *pc_Name struct s_Inter *px_Next t_Inter typedef struct s_DspLibControl: t_Vec f_Y t_DspLibControl v_DspLibName(): printf("Module: %s", MODULENAME); printf("\n") int v_DspLibInitInterControl(t_DspLibControl *px_Con): int y px_Con->f_Y = 0.0 for int i=0;i<10;i++: y += i * i return y My question is: Do you know any VIM script, which allows to translate an original pythonized C code into a standard C code? For example, one is writing a C code but uses pythonized syntax, once she decides to translate pythonized blocks into standard C, she selects such blocks and press some key. And she doesn't save such pythonized code of course, VIM translates it into standard C.

    Read the article

  • Python - How to find a correlation between two vectors ?

    - by psihodelia
    Given two vectors X and Y I have to find their correlation, i.e. their linear dependence/independence. Both vectors have equal dimension. A resulted answer should be a floating point number from [-1.0 .. 1.0]. Example: X=[-1, 2, 0] Y=[ 4, 2, -0.3] Find y=cor(X,Y) such that y belongs to [-1.0 .. 1.0]. It should be a simple construction involving a list-comprehension. No external library is allowed. UPDATE: ok, if dot product is enough, then here is my solution: nX = 1/(sum([x*x for x in X]) ** 0.5) nY = 1/(sum([y*y for y in Y]) ** 0.5) cor = sum([(x*nX)*(y*nY) for x,y in zip(X,Y) ]) right?

    Read the article

  • How to generate a number in arbitrary range using random()={0..1} preserving uniformness and density?

    - by psihodelia
    Generate a random number in range [x..y] where x and y are any arbitrary floating point numbers. Use function random(), which returns a random floating point number in range [0..1] from P uniformly distributed numbers (call it "density"). Uniform distribution must be preserved and P must be scaled as well. I think, there is no easy solution for such problem. To simplify it a bit, I ask you how to generate a number in interval [-0.5 .. 0.5], then in [0 .. 2], then in [-2 .. 0], preserving uniformness and density? Thus, for [0 .. 2] it must generate a random number from P*2 uniformly distributed numbers. The obvious simple solution random() * (x - y) + y will generate not all possible numbers because of the lower density for all abs(x-y)>1.0 cases. Many possible values will be missed. Remember, that random() returns only a number from P possible numbers. Then, if you multiply such number by Q, it will give you only one of P possible values, scaled by Q, but you have to scale density P by Q as well.

    Read the article

  • Fast dot product for a very special case

    - by psihodelia
    Given a vector X of size L, where every scalar element of X is from a binary set {0,1}, it is to find a dot product z=dot(X,Y) if vector Y of size L consists of the integer-valued elements. I suggest, there must exist a very fast way to do it. Let's say we have L=4; X[L]={1, 0, 0, 1}; Y[L]={-4, 2, 1, 0} and we have to find z=X[0]*Y[0] + X[1]*Y[1] + X[2]*Y[2] + X[3]*Y[3] (which in this case will give us -4). It is obvious that X can be represented using binary digits, e.g. an integer type int32 for L=32. Then, all what we have to do is to find a dot product of this integer with an array of 32 integers. Do you have any idea or suggestions how to do it very fast?

    Read the article

  • One-way flight trip problem.

    - by psihodelia
    You are going on a one-way indirect flight trip that includes billions transfers. You are not stopping twice in the same airport. You have 1 ticket for each part of your trip. Each ticket contains src and dst airport. All the tickets you have are randomly sorted. You forgot the original departure airport (very first src) and your destination (last dst). Design an algorithm to reconstruct your trip with minimum big-O complexity.

    Read the article

  • The limits of parallelism

    - by psihodelia
    Is it possible to solve a problem of O(n!) complexity within a reasonable time given infinite number of processing units and infinite space? The typical example of O(n!) problem is brute-force search: trying all permutations (ordered combinations).

    Read the article

  • Interesting task using random numbers only

    - by psihodelia
    Given any number of the random real numbers from the interval [0,1] is there exist any method to construct a floating point number with zero decimal part? Your algorithm can use only random() function calls and no variables or constants. No constants and variables are allowed, no type casting is allowed. You can use for/while, if/else or any other programming language operands.

    Read the article

  • C - How to implement Set data structure?

    - by psihodelia
    Is there any tricky way to implement a set data structure (a collection of unique values) in C? All elements in a set will be of the same type and there is a huge RAM memory. As I know, for integers it can be done really fast'N'easy using value-indexed arrays. But I'd like to have a very general Set data type. And it would be nice if a set could include itself.

    Read the article

  • Appropriate data structure for a buffer of the packets

    - by psihodelia
    How to implement a buffer of the packets where each packet is of the form: typedef struct{ int32 IP; //4-byte IP-address int16 ID; //unique sequence id }t_Packet; What should be the most appropriate data structure which: (1) allows to collect at least 8000 such packets (fast Insert and Delete operations) (2) allows very fast filtering using IP address, so that only packets with given IP will be selected (3) allows very fast find operation using ID as a key (4) allows very fast (2), then (3) within filtered results ? RAM size does matter, e.g. no huge lookup table is possible to use.

    Read the article

  • Linear Interpolation. How to implement this algorithm in C ? (Python version is given)

    - by psihodelia
    There exists one very good linear interpolation method. It performs linear interpolation requiring at most one multiply per output sample. I found its description in a third edition of Understanding DSP by Lyons. This method involves a special hold buffer. Given a number of samples to be inserted between any two input samples, it produces output points using linear interpolation. Here, I have rewritten this algorithm using Python: temp1, temp2 = 0, 0 iL = 1.0 / L for i in x: hold = [i-temp1] * L temp1 = i for j in hold: temp2 += j y.append(temp2 *iL) where x contains input samples, L is a number of points to be inserted, y will contain output samples. My question is how to implement such algorithm in ANSI C in a most effective way, e.g. is it possible to avoid the second loop? NOTE: presented Python code is just to understand how this algorithm works. UPDATE: here is an example how it works in Python: x=[] y=[] hold=[] num_points=20 points_inbetween = 2 temp1,temp2=0,0 for i in range(num_points): x.append( sin(i*2.0*pi * 0.1) ) L = points_inbetween iL = 1.0/L for i in x: hold = [i-temp1] * L temp1 = i for j in hold: temp2 += j y.append(temp2 * iL) Let's say x=[.... 10, 20, 30 ....]. Then, if L=1, it will produce [... 10, 15, 20, 25, 30 ...]

    Read the article

  • Purpose of IF, ELSE, FOR macros ?

    - by psihodelia
    I have a source code of a library which has a lot of strange IF, ELSE, FOR, etc. macros for all common C-keywords instead of using just usual if,else,for,while keywords. These macros are defined like this: #define IF( a) if( increment_if(), a) where increment_if() function is defined so: static __inline void increment_if( void) { // If the "IF" operator comes just after an "ELSE", its counter // must not be incremented. ... //implementation } I don't really understand, what is the purpose of such macros? This library is for a real-time application and I suppose that using such macros must slow-down an application.

    Read the article

1 2  | Next Page >