Search Results

Search found 1533 results on 62 pages for 'rdbms agnostic'.

Page 18/62 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Encode complex number as RGB pixel

    - by Vi
    How is it better to encode a complex number into RGB pixel and vice versa? Probably (logarithm of) an absolute value goes to brightness and an argument goes to hue. Desaturated pixes should receive randomized argument in reverse transformation. Something like: 0 - (0,0,0) 1 - (255,0,0) -1 - (0,255,255) 0.5 - (128,0,0) i - (255,255,0) -i - (255,0,255) (0,0,0) - 0 (255,255,255) - e^(i * random) (128,128,128) - 0.5 * e^(i *random) (0,128,128) - -0.5 Are there ready-made formulas for that?

    Read the article

  • How would you go about tackling this problem?

    - by incrediman
    I have a programming contest coming up in about half a week, and I've been prepping :) I found a bunch of questions from this canadian competition, they're great practice: http://cemc.math.uwaterloo.ca/contests/computing/2009/stage2/day1.pdf I'm looking at problem B ("Dinner"). Any idea where to start? I can't really think of anything besides the naive approach (ie. trying all permutations) which would take too long to be a valid answer. Btw, the language there says c++ and pascal I think, but i don't care what language you use - I mean really all I want is a brief description of how to tackle the problem. Like "use X technique treating each programmer as a Y" or something :)

    Read the article

  • What every web developer should know?

    - by arikfr
    Let's say you got a new intern, who's a third-year CS student. He has firm knowledge of the basics, has some experience with C/Java from the courses he took and a lot of desire to learn more. What would you teach him in order to become a good web developer? What I had in mind is: HTML/CSS and the importance of writing semantic markup Javascript, some JS framework (jQuery), JSON Basics of Git/Subversion (whatever you use) The language we use (Ruby, Python, PHP, C#, whatever) Introduction the web framework we use (Rails, Django, ASP.NET MVC...) MVC - what/why/who RESTful web services - how to consume them and how to create one What's on your list?

    Read the article

  • Manipulating multi-track ogg files programatically

    - by Chad Birch
    I'm planning to create a program for manipulating multi-track OGG files, but I don't have any experience with the relevant libraries, so I'm looking for recommendations about which language/library to use for this. I don't really have any preference for the language, I'll happily code it in C, C#, Python, whatever makes things the easiest (or even possible). Perhaps it's even a possibility to automate Audacity somehow? In terms of requirements, I'm not looking for anything particularly fancy. It will probably be a command-line program, I don't need to be able to play the audio, draw image representations of the waveforms, etc. The program will basically be used as a converter, but I need to do some processing before outputting. That is, I need the ability to programatically remove some tracks, set panning per-track, change track volumes, etc. Nothing too complex, just some basic processing, and then output the result in either MP3 or a format easily converted to MP3, such as WAV. Any suggestions or general information would be appreciated, thanks.

    Read the article

  • Design to distribute work when generating task oriented input for legacy dos application?

    - by TheDeeno
    I'm attempting to automate a really old dos application. I've decided the best way to do this is via input redirection. The legacy app (menu driven) has many tasks within tasks with branching logic. In order to easily understand and reuse the input for these tasks, I'd like to break them into bit size pieces. Since I'll need to start a fresh app on each run, repeating a context to consume a bit might be messy. I'd like to create an object model that: allows me to concentrate on the task at hand allows me to reuse common tasks from different start points prevents me from calling a task from the wrong start point To be more explicit, given I have the following task hierarchy: START A A1 A1a A1b A2 A2a B B1 B1a I'd like an object model that lets me generate an input file for task "A1b" buy using building blocks like: START -> do_A, do_A1, do_A1b but prevents me from: START -> do_A1 // because I'm assuming a different call chain from above This will help me write "do_A1b" because I can always assume the same starting context and will simplify writing "do_A1a" because it has THE SAME starting context. What patterns will help me out here? I'm using ruby at the moment so if dynamic language features can help, I'm game.

    Read the article

  • Code Golf: Seven Segments

    - by LiraNuna
    The challenge The shortest code by character count to generate seven segment display representation of a given hex number. Input Input is made out of digits [0-9] and hex characters in both lower and upper case [a-fA-F] only. There is no need to handle special cases. Output Output will be the seven segment representation of the input, using those ASCII faces: _ _ _ _ _ _ _ _ _ _ _ _ | | | _| _| |_| |_ |_ | |_| |_| |_| |_ | _| |_ |_ |_| | |_ _| | _| |_| | |_| _| | | |_| |_ |_| |_ | Restrictions The use of the following is forbidden: eval, exec, system, figlet, toilet and external libraries. Test cases: Input: deadbeef Output: _ _ _ _ _ _||_ |_| _||_ |_ |_ |_ |_||_ | ||_||_||_ |_ | Input: 4F790D59 Output: _ _ _ _ _ _ |_||_ ||_|| | _||_ |_| || | _||_||_| _| _| Code count includes input/output (i.e full program).

    Read the article

  • File Fix-it codegolf (GCJ 2010 1B-A)

    - by KirarinSnow
    Last year (2009), the Google Code Jam featured an interesting problem as the first problem in Round 1B: Decision Tree As the problem seemed tailored for Lisp-like languages, we spontaneously had an exciting codegolf here on SO, in which a few languages managed to solve the problem in fewer characters than any Lisp variety, using quite a number of different techniques. This year's Round 1B Problem A (File Fix-it) also seems tailored for a particular family of languages, Unix shell scripts. So continuing the "1B-A tradition" would be appropriate. :p But which language will end up with the shortest code? Let us codegolf and see! Problem description (adapted from official page): You are given T test cases. Each test case contains N lines that list the full path of all directories currently existing on your computer. For example: /home/awesome /home/awesome/wheeeeeee /home/awesome/wheeeeeee/codegolfrocks /home/thecakeisalie Next, you are given M lines that list the full path of directories you would like to create. They are in the same format as the previous examples. You can create a directory using the mkdir command, but you can only do so if the parent directory already exists. For example, to create the directories /pyonpyon/fumufumu/yeahyeah and /pyonpyon/fumufumu/yeahyeahyeah, you would need to use mkdir four times: mkdir /pyonpyon mkdir /pyonpyon/fumufumu mkdir /pyonpyon/fumufumu/yeahyeah mkdir /pyonpyon/fumufumu/yeahyeahyeah For each test case, return the number of times you have to call mkdir to create all the directories you would like to create. Input Input consists of a text file whose first line contains the integer T, the number of test cases. The rest of the file contains the test cases. Each test case begins with a line containing the integers N and M, separated by a space. The next N lines contain the path of each directory currently existing on your computer (not including the root directory /). This is a concatenation of one or more non-empty lowercase alphanumeric strings, each preceded by a single /. The following M lines contain the path of each directory you would like to create. Output For each case, print one line containing Case #X: Y, where X is the case number and Y is the solution. Limits 1 = T = 100. 0 = N = 100. 1 = M = 100. Each path contains at most 100 characters. Every path appears only once in the list of directories already on your computer, or in the list of desired directories. However, a path may appear on both lists, as in example case #3 below. If a directory is in the list of directories already on your computer, its parent directory will also be listed, with the exception of the root directory /. The input file is at most 100,000 bytes long. Example Larger sample test cases may be downloaded here. Input: 3 0 2 /home/sparkle/pyon /home/sparkle/cakes 1 3 /z /z/y /z/x /y/y 2 1 /moo /moo/wheeeee /moo Output: Case #1: 4 Case #2: 4 Case #3: 0 Code Golf Please post your shortest code in any language that solves this problem. Input and output may be handled via stdin and stdout or by other files of your choice. Please include a disclaimer if your code has the potential to modify or delete existing files when executed. Winner will be the shortest solution (by byte count) in a language with an implementation existing prior to the start of Round 1B 2010.

    Read the article

  • Algorithm to fill slots

    - by Peter Lang
    I am searching for an algorithm to fill several slots, which are already filled to some level. The current levels and the available quantity to fill are known Resulting levels should be as equal as possible, but existing level cannot be reduced Slots are filled from left to right, so left slots get higher level if equal level is impossible       The image above shows six examples, each column represents a slot. The grey area is already filled, the blue are is the expected position of the new elements. I could iterate through my slots and increase the quantity on the lowest slot by 1 until the available quantity is consumed, but I wonder about how to actually calculate the new filling levels. I am going to implement this with SQL/PL/SQL, other code is just as welcome though :)

    Read the article

  • Programming Technique: How to create a simple card game

    - by Shyam
    Hi, As I am learning the Ruby language, I am getting closer to actual programming. So I was thinking of creating a simple card game. My question isn't Ruby orientated, but I do know want to learn how to solve this problem with a genuine OOP approach. In my card game I want to have four players. Using a standard deck with 52 cards, no jokers/wildcards. In the game I won't use the Ace as a dual card, it is always the highest card. So, the programming problems I wonder about are the following: How can I sort/randomize the deck of cards? There are four types, each having 13 values. Eventually there can be only unique values, so picking random values could generate duplicates. How can I implement a simple AI? As there are tons of card games, someone would have figured this part out already, so references would be great. I am a truly Ruby nuby, and my goal here is to learn to solve problems, so pseudo code would be great, just to understand how to solve the problem programmatically. I apologize for my grammar and writing style if it's unclear, for it is not my native language. Also pointers to sites where such challenges are explained, would be a great resource! Thank you for your comments, answers and feedback!

    Read the article

  • Finite State Machine : Bad design?

    - by f4
    Are Finite State Machines generally considered as bad design in OOP ? I hear that a lot. And, after I had to work on a really old, undocumented piece of C++ making use of it, I tend to agree. It was a pain to debug. what about readability/maintainability concerns?

    Read the article

  • What are five things you hate about your favorite language?

    - by brian d foy
    There's been a cluster of Perl-hate on Stackoverflow lately, so I thought I'd bring my "Five things you hate about your favorite language" question to StackOverflow. Take your favorite language and tell me five things you hate about it. Those might be things that just annoy you, admitted design flaws, recognized performance problems, or any other category. You just have to hate it, and it has to be your favorite language. Don't compare it to another language, and don't talk about languages that you already hate. Don't talk about the things you like in your favorite language. I just want to hear the things that you hate but tolerate so you can use all of the other stuff, and I want to hear it about the language you wished other people would use. I ask this whenever someone tries to push their favorite language on me, and sometimes as an interview question. If someone can't find five things to hate about his favorite tool, he don't know it well enough to either advocate it or pull in the big dollars using it. He hasn't used it in enough different situations to fully explore it. He's advocating it as a culture or religion, which means that if I don't choose his favorite technology, I'm wrong. I don't care that much which language you use. Don't want to use a particular language? Then don't. You go through due diligence to make an informed choice and still don't use it? Fine. Sometimes the right answer is "You have a strong programming team with good practices and a lot of experience in Bar. Changing to Foo would be stupid." This is a good question for code reviews too. People who really know a codebase will have all sorts of suggestions for it, and those who don't know it so well have non-specific complaints. I ask things like "If you could start over on this project, what would you do differently?" In this fantasy land, users and programmers get to complain about anything and everything they don't like. "I want a better interface", "I want to separate the model from the view", "I'd use this module instead of this other one", "I'd rename this set of methods", or whatever they really don't like about the current situation. That's how I get a handle on how much a particular developer knows about the codebase. It's also a clue about how much of the programmer's ego is tied up in what he's telling me. Hate isn't the only dimension of figuring out how much people know, but I've found it to be a pretty good one. The things that they hate also give me a clue how well they are thinking about the subject.

    Read the article

  • Code Golf Christmas Edition: How to print out a Christmas tree of height N

    - by TheSoftwareJedi
    Given a number N, how can I print out a Christmas tree of height N using the least number of code characters? N is assumed constrained to a min val of 3, and a max val of 30 (bounds and error checking are not necessary). N is given as the one and only command line argument to your program or script. All languages appreciated, if you see a language already implemented and you can make it shorter, edit if possible - comment otherwise and hope someone cleans up the mess. Include newlines and whitespace for clarity, but don't include them in the character count. A Christmas tree is generated as such, with its "trunk" consisting of only a centered "*" N = 3: * *** ***** * N = 4: * *** ***** ******* * N = 5: * *** ***** ******* ********* * N defines the height of the branches not including the one line trunk. Merry Christmas SO!

    Read the article

  • New design patterns/design strategies

    - by steven
    I've studied and implemented design patterns for a few years now, and I'm wondering. What are some of the newer design patterns (since the GOF)? Also, what should one, similar to myself, study [in the way of software design] next? Note: I've been using TDD, and UML for some time now. I'm curious about the newer paradigm shifts, and or newer design patterns.

    Read the article

  • What is instrumentation?

    - by Jon Seigel
    I've heard this term used a lot in the same context as logging, but I can't seem to find a clear definition of what it actually is. Is it simply a more general class of logging/monitoring tools and activities? Please provide sample code/scenarios when/how instrumentation should be used.

    Read the article

  • What is the exact problem with multiple inheritance?

    - by Totophil
    I can see people asking all the time whether multiple inheritance should be included into the next version of C# or Java and C++ folks, who are fortunate enough to have this ability, say that this is like giving someone a rope to eventually hang themselves. What’s the matter with the multiple inheritance? Are there any concrete samples?

    Read the article

  • Stack overflow code golf

    - by Chris Jester-Young
    To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome. ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call "recursion" is really iteration, and any solution which can be converted to an iterative solution relatively trivially by a decent compiler won't be counted. :-P ETA2: I've now selected a “best answer”; see this post for rationale. Thanks to everyone who contributed! :-)

    Read the article

  • Differences between Perl and PHP

    - by lok
    I'm planning to lern Perl 5 and as I have only used PHP until now, I wanted to know a bit about how the languages differ from each other. As PHP started out as a set of "Perl hacks" it has obviously cloned some of Perls features. What are the main differences in the syntax? Is it true that with Perl you have more options and ways to express something? Why is Perl not used for dynamic websites very often anymore? What made PHP gain more popularity than it?

    Read the article

  • Need an algorithm to group several parameters of a person under the persons name

    - by QuickMist
    Hi. I have a bunch of names in alphabetical order with multiple instances of the same name all in alphabetical order so that the names are all grouped together. Beside each name, after a coma, I have a role that has been assigned to them, one name-role pair per line, something like whats shown below name1,role1 name1,role2 name1,role3 name1,role8 name2,role8 name2,role2 name2,role4 name3,role1 name4,role5 name4,role1 ... .. . I am looking for an algorithm to take the above .csv file as input create an output .csv file in the following format name1,role1,role2,role3,role8 name2,role8,role2,role4 name3,role1 name4,role5,role1 ... .. . So basically I want each name to appear only once and then the roles to be printed in csv format next to the names for all names and roles in the input file. The algorithm should be language independent. I would appreciate it if it does NOT use OOP principles :-) I am a newbie.

    Read the article

  • Best graphical source code diff viewer/editor for code comparison and merging?

    - by Assaf Lavie
    The options for source code diff viewing/editing/merging seem to be: Free: Tortoise Merge Meld * WinDiff WinMerge * DiffMerge * KDiff AJC Diff Commercial: Total Commander's Diff viewer * Beyond Compare * Delta Walker * Araxis Merge * Are there any other options? (Wikipedia suggests a few) What's your favorite tools for source code diff? And how does it differ from the ones in the list? * Supports directory diffs

    Read the article

  • Code Golf: Beehive

    - by LiraNuna
    The challenge The shortest code by character count that will generate a beehive from user input. A beehive is defined a a grid of hexagons in a size inputted by the user as two positive numbers greater than zero (no need to validate input). The first number (W) represents the width of the beehive - or - how many hexagons are on each row. The second number (H) represents the height of the beehive - or - how many hexagons are on each column. A Single hexagon is made from three ASCII characters: _, / and \, and three lines: __ / \ \__/ Hexagons complete each other: the first column of the beehive will be 'low', and the second will be high - alternating and repeating in the same pattern forming W hexagons. This will be repeated H times to form a total of WxH hexagons. Test cases: Input: 1 1 Output: __ / \ \__/ Input: 4 2 Output: __ __ __/ \__/ \ / \__/ \__/ \__/ \__/ \ / \__/ \__/ \__/ \__/ Input: 2 5 Output: __ __/ \ / \__/ \__/ \ / \__/ \__/ \ / \__/ \__/ \ / \__/ \__/ \ / \__/ \__/ Input: 11 3 Output: __ __ __ __ __ __/ \__/ \__/ \__/ \__/ \__ / \__/ \__/ \__/ \__/ \__/ \ \__/ \__/ \__/ \__/ \__/ \__/ / \__/ \__/ \__/ \__/ \__/ \ \__/ \__/ \__/ \__/ \__/ \__/ / \__/ \__/ \__/ \__/ \__/ \ \__/ \__/ \__/ \__/ \__/ \__/ Code count includes input/output (i.e full program).

    Read the article

  • Code Golf: Diamond Pattern

    - by LiraNuna
    The challenge The shortest code by character count to output a a pattern of diamonds according to the input. The input is composed of 3 positive numbers representing the size of the diamond and the size of the grid. A diamond is made from the ASCII characters / and \ with spaces. A diamond of size 1 is: /\ \/ The size of the grid consists from width and height of number of diamonds. Test cases Input: 1 6 2 Output: /\/\/\/\/\/\ \/\/\/\/\/\/ /\/\/\/\/\/\ \/\/\/\/\/\/ Input: 2 2 2 Output: /\ /\ / \/ \ \ /\ / \/ \/ /\ /\ / \/ \ \ /\ / \/ \/ Input 4 1 3 Output: /\ /\ /\ / \ / \ / \ / \ / \ / \ / \/ \/ \ \ /\ /\ / \ / \ / \ / \ / \ / \ / \/ \/ \/ Code count includes input/output (i.e full program).

    Read the article

  • Shut down windows service based on load

    - by JP
    Hello, I was wondering if there are any free / open source solutions that will start and stop a windows service based on load? I have some pubsub subscriber services that do background work which is not critical. Ideally i would like tot be able to automate things so that these services could start if memory/cpu/disk i/o was under a certain threshold and stop gracefully if that threshold was met. Do you know of any solutions? Thanks JP

    Read the article

  • What is your solution to the FizzBuzz problem?

    - by saniul
    See here Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". Disclaimer: I do realize this is easy, and I understand the content of the Coding Horror post I just linked to

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >