Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

User-friendliness is what really matters

Name: Anonymous 2009-02-27 15:55

on space_check(threshold_percentage)
    tell application "Finder"
        set the percent_free to ¬
            (((the free space of the startup disk) / ¬
                (the capacity of the startup disk)) * 100) div 1
    end tell
    if the percent_free is less than the threshold_percentage then
        tell application (path to frontmost application as text)
            display dialog "The startup disk has only " & the percent_free & ¬
                " percent of its capacity available." & return & return & ¬
                "Should this script continue?" with icon 1
        end tell
    end if
end space_check

Name: Anonymous 2009-02-27 17:52

APPLESCRIPT FTW

Name: Anonymous 2009-02-27 17:55

Notations I'm not used to are hard.

Name: Anonymous 2009-02-27 18:14

what is this retarded language?
guess what, OP; to people who actually know real programming languages, this is less readable than what they normally work with.

i'll take:
if(percent_free < threshold_percent)
over:
if the percent_free is less than the threshold_percentage then
any day, faggot

Name: Anonymous 2009-02-27 18:18

i'll take:

if(percent_free < threshold_percent)

over:

if the percent_free is less than the threshold_percentage then

any day, faggot 


Agreed. It is more concise and doesn't want to make me kill people.

Name: Anonymous 2009-02-27 18:21

Expressive abstractions are what really matters.

loeb :: Functor a => a (a x -> x) -> a x
loeb x = fmap (\a -> a (loeb x)) x

Name: Anonymous 2009-02-27 18:23

>>1
looks like COBOL without the CRUISE CONTROL.

Name: Anonymous 2009-02-27 18:50

What a coincidence, I just saw something about how Applescript sucks.

Name: Anonymous 2009-02-27 19:07

>>6
I've seen this before, and it's still a bit confusing. I know how it works with the list functor instance, but what about others, like IO, State, and such?

It looks almost comonadic. Is it a dual of some monadic function, perhaps?

Name: >>9 2009-02-27 19:55

Never mind, I found out. It's similar to cfix :: w (w a -> a) -> a, which is the dual of mfix :: (a -> m a) -> m a.

<http://blog.sigfpe.com/2007/02/comonads-and-reading-from-future.html>;

Name: Anonymous 2009-02-27 20:08

>>9-10
loeb is a just polyvariadic fixed point operator. A sort of letrec if you will.

See http://okmij.org/ftp/Computation/fixed-point-combinators.html#Poly-variadic and http://haskell.org/pipermail/haskell-cafe/2003-October/005394.html .

P.S. It's funny how Haskell nomads manage to obscure every concept with so many abstract nonsense that they don't even know what it is anymore.

Name: Anonymous 2009-02-27 22:05

>>1
Another example of why natural languages are a bad idea to model a programming language after.

Name: Anonymous 2009-02-27 22:10

>>1
about half of that is just syntactic noise. "the" and so forth can be eliminated without changing anything. after that, it ends up looking a lot like visual basic.

though it's like going from a $2 bottle of really bad wine to a $5 bottle of bad wine.

Name: Anonymous 2009-02-27 22:18

... oh also, applescript does most definitely allow the normal operators such as + / < > <= etc. (even unicode ones like ≤ ≥ ≠)

people diss it because they think it's overly verbose and cobol-esque, but you can actually write "normal" looking code with it, and on top of that you can control a large portion of the os, including doing all sorts of complex interactions between different programs, with it. it's really quite flexible and powerful if used properly.

though it is still a $5 bottle of bad wine. but it'll get you drunk.

Name: Anonymous 2009-02-28 0:05

declare a variable of type integer called x that contains a value of 0 and has a local scope;
repeat the following single line of code until my integer variable called x contains an integer value equal to that of the integer literal value 100:
   increment the value of my integer variable called x by an integer value of 1;
output to the user console a line of text that contains the following literal string value "the value of x is " and the integer variable value of my integer variable x and a line break;


vs

for(int x=0;x<100;x++){}
printf("%d",x);


it's a tough decision; i know

Name: Anonymous 2009-02-28 0:18

>>15
for(int x=0;x<100;x++){}
printf("%d",x);

error: 'x' undeclared (first use in this function)

also, say "100"

Name: Anonymous 2009-02-28 0:30

>>15
Nice made-up non-example. Next time, use languages you know.

Name: Anonymous 2009-02-28 0:47

>>17
it was an example of how trying to treat programming languages as human languages just leads to incredible amounts of wasted typing.
i'm amazed you didn't understand something so simple and obvious - actually, what am i saying? you're a macfag, ofcourse you were too stupid to realise the point.

Name: Anonymous 2009-02-28 0:50

>>18
no, it was an example of giving fake evidence in support of a correct position, in an attempt to make people who hold the correct position look less credible.
yes, we see what you did there, macfag.

Name: Anonymous 2009-02-28 2:48

>>15

declare a variable of type integer called x that contains a value of 0 and has a local scope;
repeat the following single line of code until my integer variable called x contains an integer value equal to that of the integer literal value 100:
   increment the value of my integer variable called x by an integer value of 1;
output to the user console a line of text that contains the following literal string value "the value of x is " and the integer variable value of my integer variable x and a line break;


vs

public class Loop {
    public static void main(String[] args) {
        Loop myLoop = LoopFactory.getInstance(0,100,Loop.ASCENDING);
        while(myLoop.hasNext()) {
            System.out.println(myLoop.getLoopPosition());
            myLoop.incrementPosition();
        }
    }
    public static final int ASCENDING = 1;
    public static final int DESCENDING = -1;
    private int min;
    private int max;
    private int direction;
    private int current;
    protected Loop() {}
    public static Loop getNewLoop(int min, int max, int direction) {
        Loop self = new Loop();
        self.setLoopMin(min);
        self.setLoopMax(max);
        self.setLoopDirection(direction);
        int startPos = direction==Loop.ASCENDING?min:max;
        self.setLoopPosition(startPos);
    }
    public void setLoopMax(int max) {
        this.max = max;
    }
    public void setLoopMin(int min) {
        this.min = min;
    }
    public void setLoopPosition(int position) {
        this.current = position;
    }
    public void setLoopDirection(int direction) {
        this.direction = direction;
    }
    public int getLoopPosition() {
        return this.current;
    }
    public boolean hasNext() {
        if(direction==Loop.ASCENDING && Loop.current==max) return false;
        if(direction==Loop.DESCENDING && Loop.current==min) return false;
        return true;
    }
    public void incrementPosition() {
        this.current+=this.direction;
    }
    public static class LoopFactory {
        protected LoopFactory() {}
        public Loop getInstance() {
            return getInstance(0,0,1);
        }
        public Loop getInstance(int min, int max, int direction) {
            return Loop().getNewLoop(min,max,direction);
        }
    }
}


it's a tough decision; i know

Name: Anonymous 2009-02-28 3:24

>>20
Why would you do that?
At least the top example is plausible
This is completely illogical

Name: Anonymous 2009-02-28 4:06

>>21
What is wrong with the Java implementation? Industry rules require at least one factory and singleton in any program at minimum; so this barely passes as usable.

Name: Anonymous 2009-02-28 4:08

>>22
i lol'd

Name: Anonymous 2009-02-28 5:42

>>21
Not ENTERPRISE enough.

Name: Anonymous 2009-02-28 6:51

Applescript is only one of the different interfaces to the real core, OSAScript. It is possible to access it through much cooler languages, such as JAVASCRIPT

Name: Anonymous 2009-02-28 8:49

>Loop myLoop = LoopFactory.getInstance(0,100,Loop.ASCENDING);
   public static final int ASCENDING = 1;
   public static final int DESCENDING = -1;
I cring'd
>User-friendliness is what really matters
That's why AppleScript is totally useless - it's too hard for a retard and too unreadable for a programmer.

Name: Anonymous 2009-02-28 9:03

What the fuck is ¬?

Name: Anonymous 2009-02-28 9:04

>>27
Are you retarded?

Name: Anonymous 2009-02-28 9:21

>>28
Are you not a logician?

Name: Anonymous 2009-02-28 9:23

Name: Anonymous 2009-02-28 9:59

>>29
Are you unaware of contextual meaning of characters?

Name: Anonymous 2009-02-28 10:46

>>31
Are you fond of italics, or just pleased to see me?

Name: Anonymous 2009-02-28 10:49

Hi, this post is all about ¬, REAL ¬.  This post is awesome.    My name is Robert and I can't stop thinking about ¬.  These are cool; and by cool, I mean totally sweet.

Fact:

1. ¬ is an operation.
2. ¬'s negate all the time.
3. The purpose of ¬ is to flip out and 'not' things.

Name: Anonymous 2009-02-28 11:03

>>33
¬'s negate all the time
¬'s negate all the time what?

Name: Anonymous 2009-02-28 11:05

>>34
HAY DUDE PERHAPS U SHOULD FAMILUARIZE URSELF WITH INTERNET CULTURE SO THAT YOU CAN UNDERSTAND AND APPRECIATE SUPER-WITTY PARODIES LIKE >>33

Name: Anonymous 2009-02-28 11:10

>>35
Sir, perhaps you should familiarize yourself with grammar.

Name: Anonymous 2009-02-28 11:10

Name: Anonymous 2009-02-28 11:15

Name: Anonymous 2009-02-28 11:38

Name: Anonymous 2009-02-28 11:53

>>33
I laughed so fucking hard.

Name: Anonymous 2009-02-28 11:59

>>39
retroactive trolling is not allowed on this forum

Name: Anonymous 2009-02-28 14:11

Name: Anonymous 2009-02-28 14:41

>>42
I am aware where did >>33 come from.
I was just pointing out the misuse of '.
Oh, wait. IHBT

Name: Anonymous 2009-02-28 14:43

>>43
IHBT - The Universal Excuse.

Name: Anonymous 2009-02-28 14:54

ITTWHABT Anyway

Name: Anonymous 2009-02-28 15:02

>>44
What do you mean? I admit I've been trolled by responding to >>43. And to you too.
oh god I'm turning intoFrozenVoid

Name: FrozenVoid 2009-02-28 15:05

Maybe you would like to use IHBD,IHBC and IHBW?
(which is;I Have Been [Disproved,Corrected,Wrong])

Name: Anonymous 2009-02-28 15:06

>>46
oh god I'm turning intoFrozenVoid

You should see a doctor and get some medication before it spreads to the rest of /prog/

Name: Anonymous 2009-02-28 15:09

/prog/ delenda est

Name: Anonymous 2009-02-28 15:29

>>48
Nah, I'll control this. I'll just take a little break from /prog/.
I'm not responding after this post.

Name: Anonymous 2009-02-28 16:07

>>1
Actually, true user-friendliness would be Automator.app.
Unfortunately it doesn't seem to be as powerful as Applescript. I struggle to find a way to reproduce your script in it, maybe it's just my unfamiliarity with the IDE: http://img19.imageshack.us/img19/8319/picture1nhu.png

Name: Anonymous 2009-02-28 16:21

>>51
no, true user-friendliness would be to tell the user to get a real operating system.

Name: 2009-02-28 17:02

>>52
Such as VxWorks.

Name: Anonymous 2009-02-28 17:27

>>52
Such as emacs

Name: 2009-02-28 17:30

Name: Anonymous 2010-11-02 9:58

Name: Anonymous 2010-12-27 9:59

Don't change these.
Name: Email:
Entire Thread Thread List