Search Results

Search found 9 results on 1 pages for 'liranuna'.

Page 1/1 | 1 

  • Screen a running process

    - by LiraNuna
    Sometimes I forget to run a program under a screen session and can't stop it in the middle, and I know it's going to take long. Is there a way to screen an already running process without restarting it?

    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

  • 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

  • Code Golf: Morse code

    - by LiraNuna
    The challenge The shortest code by character count, that will input a string using only alphabetical characters (upper and lower case), numbers, commas, periods and question mark, and returns a representation of the string in Morse code. The Morse code output should consist of a dash (-, ascii 0x2D) for a long beep (aka 'dah') and a dot (., ascii 0x2E) for short beep (aka 'dit'). Each letter should be separated by a space (' ', ascii 0x20), and each word should be separated by a forward slash (/, ascii 0x2F). Morse code table: Test cases: Input: Hello world Output: .... . .-.. .-.. --- / .-- --- .-. .-.. -.. Input: Hello, Stackoverflow. Output: .... . .-.. .-.. --- --..-- / ... - .- -.-. -.- --- ...- . .-. ..-. .-.. --- .-- .-.-.- Code count includes input/output (i.e full program).

    Read the article

  • Code Golf: Spider webs

    - by LiraNuna
    The challenge The shortest code by character count to output a spider web with rings equal to user's input. A spider web is started by reconstructing the center ring: \_|_/ _/ \_ \___/ / | \ Then adding rings equal to the amount entered by the user. A ring is another level of a "spider circles" made from \ / | and _, and wraps the center circle. Input is always guaranteed to be a single positive integer. Test cases Input 1 Output \__|__/ /\_|_/\ _/_/ \_\_ \ \___/ / \/_|_\/ / | \ Input 4 Output \_____|_____/ /\____|____/\ / /\___|___/\ \ / / /\__|__/\ \ \ / / / /\_|_/\ \ \ \ _/_/_/_/_/ \_\_\_\_\_ \ \ \ \ \___/ / / / / \ \ \ \/_|_\/ / / / \ \ \/__|__\/ / / \ \/___|___\/ / \/____|____\/ / | \ Input: 7 Output: \________|________/ /\_______|_______/\ / /\______|______/\ \ / / /\_____|_____/\ \ \ / / / /\____|____/\ \ \ \ / / / / /\___|___/\ \ \ \ \ / / / / / /\__|__/\ \ \ \ \ \ / / / / / / /\_|_/\ \ \ \ \ \ \ _/_/_/_/_/_/_/_/ \_\_\_\_\_\_\_\_ \ \ \ \ \ \ \ \___/ / / / / / / / \ \ \ \ \ \ \/_|_\/ / / / / / / \ \ \ \ \ \/__|__\/ / / / / / \ \ \ \ \/___|___\/ / / / / \ \ \ \/____|____\/ / / / \ \ \/_____|_____\/ / / \ \/______|______\/ / \/_______|_______\/ / | \ Code count includes input/output (i.e full program).

    Read the article

  • AS3: Adding get/set methods to a class via prototype

    - by LiraNuna
    I'm looking for a way to extend a class via prototype by adding a get and set functions. The following code will add a function to the class' prototype: MyClass.prototype.newMethod = function(... args) { }; However I want to add both a get and set functions. I tried: MyClass.prototype.fakeProperty = get function(... args) { }; MyClass.prototype.fakeProperty = set function(... args) { }; But that seem to throw compile errors. Is this even possible? Is there some 'internal' naming convention for get/set functions? I am not looking for answers such as 'create a new class and new get/set functions there'.

    Read the article

  • Flash: Closest point to MovieClip

    - by LiraNuna
    I need to constrain a point inside a DisplayObject given to me by the artist. I got it working but only for the occations where the cursor is still inside bounds. The limited object is called limited. function onSqMouseMove(event:MouseEvent) { if(bounds.hitTestPoint(event.stageX, event.stageY, true)) { limited.x = event.stageX; limited.y = event.stageY; } else { /* Find closest point in the Sprite */ } } limited.addEventListener(MouseEvent.MOUSE_DOWN, function(event:MouseEvent) { stage.addEventListener(MouseEvent.MOUSE_MOVE, onSqMouseMove); }); limited.addEventListener(MouseEvent.MOUSE_UP, function(event:MouseEvent) { stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSqMouseMove); }); How do I go about implementing the other half of the function? I am aware Sprite's startDrag accepts arguments, where the second one is the constraint rectangle, but in my case, bounds are an arbitrary shape. When the object is dragged outside the bounds, I want to calculate the closest point from the cursor to bounds' polygon. Just to note that bounds can have 'holes'.

    Read the article

  • PHP/CGI: Portable and safe way to get PATH_INFO

    - by LiraNuna
    I'm seeking a portable way to receive the (handy) $_SERVER['PATH_INFO'] variable. After reading a while, it turns out PATH_INFO is originated from CGI/1.1, and my not always be present in all configuration. What is the best (mostly security-wise) way to get that variable - apart from extracting it manually (security concern).

    Read the article

1