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

FIOC exception classes

Name: Anonymous 2012-05-30 5:35

Which approach do you prefer:

1. Create new exceptions for each class of error in your libs.

2. Just use stuff from the exceptions module most of the time and create new exceptions when using a standard one is really inappropriate.

My colleagues strongly prefer #1, and go around making dozens of FilePermissionsError or ValueErrorBecauseFuckYou.  They are also OOP and Patterns nuts.  I am not a very happy man because I have to import their horde of bullshit exceptions into my modules instead of just using standard classes.

Name: Anonymous 2012-06-22 7:35

ln -s /home "/Documents and Settings"

Name: Anonymous 2012-06-22 8:01

>>40
PS1="C:`echo \"$PWD\" | sed 's/\\//\\\\\\\/g'`> "

Name: Anonymous 2012-06-22 8:10

>>40
PS1="C:${PWD//\//\\\\}>"

Name: Anonymous 2012-06-22 8:22

>>42
That won't work when you change the directory. Use >>43 instead.

Also, be sure to put:
cat <<EOF
$(uname -o) [Version $(uname -r)]
Copyright (c) $(date +%Y) Richard Matthew Stallman.  All freedoms respected.
EOF

at the end of your .bashrc

Result:
GNU/Linux [Version 3.4.2-4.fc17.x86_64]
Copyright (c) 2012 Richard Matthew Stallman.  All freedoms respected.
C:\home\chris>

Name: Anonymous 2012-06-22 8:22

>>43
C:\home\faggot>dir /p
dir: cannot access /p: No such file or directory
C:\home\faggot>


the illusion is so compelling! the only thing we need now is a script that crashes the computer every 30 minutes

Name: Anonymous 2012-06-22 8:23

>>43-44
this is why I love you, \prog\

Name: Anonymous 2012-06-22 8:24

set +H
PROMPT_COMMAND='WINPWD=$(echo "$PWD" | sed -e"s!~!$HOME!" -e"s/\//\\\\/g")'
PS1="C:$WINPWD> "

Name: Anonymous 2012-06-22 8:28

>>44
wrong, >>43 needs single quotes instead of double quotes so the variable doesn't get substituted when you set PS1.

PS1='C:${PWD//\//\\\\}>'

Name: Anonymous 2012-06-22 8:34

>>45
Put this in your .bashrc:
while [[ true ]]; do sleep 1800; echo "su -c reboot"; done &

Name: Anonymous 2012-06-22 8:36

>>49
Oops, replace echo "su -c reboot"  with su -c reboot.

Name: Anonymous 2012-06-22 8:42

>>50
I think you're looking for halt --reboot -f -d -n --no-wall

Name: Anonymous 2012-06-22 8:44

>>49-50
echo -e '#!/bin/sh\ndd if=/dev/zero of=/dev/mem seek=$RANDOM' > /etc/cron.daily/windows-emulation;chmod a+x /etc/cron.daily/windows-emulation

Name: I meant hourly, of course 2012-06-22 8:45

>>49-50
echo -e '#!/bin/sh\ndd if=/dev/zero of=/dev/mem seek=$RANDOM' > /etc/cron.hourly/windows-emulation;chmod a+x /etc/cron.hourly/windows-emulation

Name: Anonymous 2012-06-22 8:51


# This is an incredibly useful function which I wholeheartedly
# recommend for regular use.  I forgot where the idea came from.
# Works on Zsh.  Does not work elsewhere, AFAIK.
function windows() {
    clear
    echo -e "Microsoft Windows 2000 [Version 5.00.2195]\n(c) Microsoft Corporation, 1985-2000.\n"
    function precmd() {
        PWD=$(pwd)
        PWD=${PWD/\/usr/\/Program Files}
        PWD=${PWD/\/home\/$(whoami)/\/Documents and Settings\\Administrator}
        PWD=${PWD/\/home/\/Documents and Settings}
        PWD=${PWD/\/sbin/\/Windows}
        export PS1="C:${PWD//\//\\}> "
    }
}

Name: Anonymous 2012-06-22 9:04

let's see how long it takes before someone ports it to bash

Name: Anonymous 2012-06-22 11:19

>>55
PROMPT_COMMAND='WINPWD=$(echo "$PWD" | sed -e"s/\(.*[^\/]\)$/\1\//" -e"s!$HOME\/!\/Documents and Settings/Administrator\/!" -e"s/\/home\//\/Documents and Settings\//" -e"s/^\/usr\//\/Program Files\//" -e"s/\/s\?bin\//\/Windows\//" -e"s/\(.*\)\/$/\1/" -e"s/\//\\\\/g")'
Substitute this in >>47

Name: Anonymous 2012-06-22 15:41

Ruby user here, #2 is preferred. Because half the shit you need typically can be expressed as TypeError, ArgumentError, etc... anything special can be given an additional Error message to separate it out, so you can just

rescue StandardError => err
    if err.message.include? "Fuck You" then
        # Handle fuck you exception
    else
        # Handle some other exception
    end
end

Name: Anonymous 2012-06-22 16:56

>>57
Matching text in error messages when handling errors?  Even Perl programmers don't do that.

You have transcended my preconceptions of Ruby user unprofessionalism with your code example.

Name: Anonymous 2012-06-23 2:56

>>58
Matching text in error messages when handling errors?

They call it RAD!

Name: Anonymous 2012-06-23 6:25

>>59
RAD
Ruby Autistic Development

Name: Anonymous 2012-06-25 12:21

ᑤ敐夡ᤁဖ犒᎗ࡂ傐圩晖枀戒煸灙ȱ၆剡陲䌂∙肅Ŗ嚇硧銔၈㘴䎁ė础蕲䑥ध蝳慸䅐葵䠂㑉䕖ᕖ蝗Ȩا聉ၳ戕╙㈠㔹墀蔩䘉墈䙤碈楘ж荐葑逓䄑ႀѥ靆爘艵ᘆ䔆ፀ┢㤰蕨芄Ģ䉩ᘗ㤕啃腳䌔聗᥆቉猄嘱蝉祧蕩䉨鐳频虦蘀芅蕄⠙褑舒蘶べ㡶㜘╒顸㠲扖䠡቙蒘㔥ᙇܢ⥢琗恩䀉╘ቇ茖萆呠̃ᔢᝣ荃畇吶ဆ煐芅聆ᐢ悅ቢ蜦፲ↁ᥂瑡ħ愙ᚓゆ蜓包▓牙व扱⡥䡂᐀㞗䤗䢉ᒈ睳᠁⚀㔹䢄蠈ԡ備睕㑆㞈椹眤靑煈隘㥢ᑇ萁傈蕵靔ኖ݄杶疂䎃ᠧ砒癥✳攗䊅䙖炁璉靣唒㝑ও葧區♨攥捷䎖၈ㄱ癤頹退刹ࠆ朢蝃鄑摠桃摑䍤㐘撑䙕㐃㙓爗╠搁㌘陳蚅堅Е㤓攧䦑͑㈥ㅲ劄䉸㙰ᑔ⒈遗㔁饐ቄ࠷䔂悒逳艦⠂╖奃∰萖摣憈要祓电♑肒匠░⥲⌉倦杓蔤䡲䜂ȑ蜹兇捵夂⡡熖㥘鍔✐蠕⚑儶䔆慢䚇㦂琇艵䍓舥ࢅ⑹遅鍨芈ᢀȹ

Name: Anonymous 2012-06-25 12:37

蔥ኖ፠ɵ斅瑦ቸ㝒䍔鉳餙ㅸ䄶遉恗砖兂遈᠖刲錂₂砀炔⒔ᙆ坠爄邑頁ᘳ聴劙㠢獥妓瘀墑梂㤗ᕤ附d㘲嚘莙蘠芅㡰ᅑ㞆䆅疅ܕ⠵␹ᐆ朩兒Ƈ·敷鉢牕唗蜹獈ᘑ䁣銅列╱甸栙┷教⌲夨顣䕒ᅆ光㐘⠳镉ቔ呑鞁挔Ř蕙楤脔恸卥镑ᜧ蜘ᑦ楇ᦁ䜘㈖㑕整ႃ⎈䈰⌡ࡁ牁ҀĈℰ蝰鄕⠅ᖑ阡垙匉癱ؖ㎒陗ܸ東摧榈甹䠕奦愄獈⥵㑵ᦙٷ愙傖啩靁页瘖ॐ᝙᝷垂ၓㅵ䆔ᕱ剱荢夂⊈䂔␷ጁ㝉癳ܱㅶ㔨䔂⌔怈い衹䅁㡰奃ɀ搀攑琲炅襔攡嘆鉹⅘ ⁥堀葒ⅲ塲ԕ爕脦褁㆖鄕饰㝈ᑲ栩䍶ቡ鐰␐衂㘈ᎉ遈蜅䈡圐ȧ䢂萈阐ሣ␆蔵⡕蜉桵⡷Й❡Ȩԇ癁䈹瑣捅摡Γၱ甓᠘䐸ㅷ晳腒剤㔳剥襑锸儈抙ဉᘣ䥐撓ゅ䔹敷蜨慤嘰ܴ؈㕆㕃➒䖇吁銀們瑒倔銄扃抉禆瞄㑅ݥ䍹匘嚓䜢恈䄃錆∄蝗醔ᢕ砶ᡢ愸䁕ម琱㙔牗℣咗⥲聦䡇硧̨覄⌦

Name: Anonymous 2012-06-25 12:55

ᦄ褸托क杗႑蒁➑▇䝈攑攵厁榅艧傈㖙䒂愅倨Х䅂ʘ蜘螉㈒莐㥘ၒ✨睈ш䑈劒錅蝲捂䚂ބ熕傈〓䑢ؓ䕑厒䁴ₘ☠㥄獗ႃ琵䥀舖舑嘴䡄⦈3䊘梙䉀䙒@蒁㘑䁲ʐ䂓畃㍢冔瑸ⅴ餄㠨呁堆⡠脙あᤥ㙰鍄㝔健灢঒晓昧畓䅃耖䔱悙℆扰ፈ腲㤃葀鞅㔁杙䑐䀕−⠧䞂搹艄茰’ᔷē唴錙牀㑩䠆顤唦℁≀甅Ɩ攥ѳ圐靣⅓茴卖ᡉ⍹Ȑㆄ၆锇限蚒֒瘣瑠儕虆醃杁ԷՓक़㐷♔文و震褵耹⌧⁑搢坅獉祴∦⥩灦ᚂʀ蜇㢆刁⦃摕㈂虘ͥݥበ搓䅙阧㠶願ԧ腡獷陈ᡈ∐㆕ᄙ䄂⒉阈ᔡ噰朱цᙙ耓猰䙑⎈㑧ɀ⌠餆䖆楳䘠恳ㅗ銑Ԩ֘聡蘳厒㐲葔ㄴ枂陵遇䑖ę锶㥳ሱ⠉䒇ڑ眦⍀䉆㝨椠堥饨䔱阀᠑焈͸㉀蜰瞐树朓猩鞆睆Ѧв蚃颙遹瘧颓㘠醂猉㤡㖂钗᝸䁴儱䄁̀ᔱ鄉奁ⅶ熈镣搹⥶焔噔቉㦂ጳ镁扵✒㕣攉镇刀蚑Ȇ眨ᐴᚕ恄⢗ᘃ

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