×

Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

Comments

top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Its all about THE CLOUD (395 comments)

You can spin up Windows servers and sql server instances in AWS. And other commercial products, like HANA. So cloud providers certainly do track licenses. It's baked into the price you pay for those instances.

10 hours ago
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: MS has been late to every recent tech movement (395 comments)

Why are you locked in? If you have web services calling web services it doesn't really matter what a web service is written in. There are some nice .net platforms that don't come from MS, like ServiceStack or Nancy. Even the MS Mvc.Net platform is mono compatible (and was already open source) so you can run Linux with docker running 6 instances of your service.

12 hours ago
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

I didn't realize you didn't have to declare runtime errors, sorry.

12 hours ago
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: MS has been late to every recent tech movement (395 comments)

Depends on what you mean. We don't use linq to sql because you're not sure of the sql you'll generate. Linq to objects is quite nice. Joining two lists of objects in memory automatically rather than writing your own low level code to copy things over is awesome.

yesterday
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

Because you know ahead of time all the possible things that can go wrong in your method?

yesterday
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

C# can compile to android apps and ios apps now too. It's not just a server world any more.

yesterday
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

Visual studio, xamarin studio, and some of the java IDEs are in the latest jolt ide awards. They're all generally recognized as good.

yesterday
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

This is why it bums me out that my company is spending so much developer time trying to move off of ms languages.

yesterday
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot Re: Why bother? (395 comments)

You don't actually. That's the point of open sourcing .net core, to really beef up mono. MS has a strong commitment to supporting mono, especially in vNext. You can write C# to target mono, ios, and android and ignore Windows deployment entirely

yesterday
top

At 40, a person is ...

MemeRot Me (208 comments)

I turn 40 in eleven days. Definitely starting to feel crusty. I've been in tech long enough now to see ideas come, go, and chime back again.

2 days ago
top

Ask Slashdot: Is an Open Source .NET Up To the Job?

MemeRot C# and Xamarin allow cross platform mobile (395 comments)

Which is probably more important than anything else. The benefit of open sourcing .net core is that mono will get better. So if you have a lot of existing .net code and want to get away from ms licensing, at least ms will keep the dev tool revenue.

2 days ago
top

BitTorrent Launches Project Maelstrom, the First Torrent-Based Browser

MemeRot Re:Private? (67 comments)

Why? CDN companies like Akamai spend huge amounts on their server networks, and they are already local to you.

about two weeks ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Spoiled by Visual Studio (543 comments)

Intellisense *almost* works flawlessly. The times when it doesn't show properties that I know exist drive me bananas.

The unit testing changes from VS 2010 to VS 2012 were quite confusing and a big step down in usability. Wasn't even at an ok level until update 2.

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Getters and setters (543 comments)

Depends on your context a bit. When dealing with automatically binding form fields to a view model like with an MVC .net project the convenience and speed pay off handsomely, even at the cost of having to have your form fields and properties identically named.

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Getters and setters (543 comments)

The syntactic overhead in C# is at least lighter than Java/C++. It's just Foo.Bar == 'something' or Foo.Bar = 'thing', you just have to declare Bar with a {get; set; }

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:TLDR: It's a flaw of the language (543 comments)

No good reason I shouldn't be able to shoot laser beams out of my eyes either. But I can neither change how an attribute is accessed in Java/.Net nor shoot laser beams out of my eyes.

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Getters and setters (543 comments)

About the only thing a getter and setter offers is an advantage of doing something before / after accessing the variable for a read / write operation... which breaks the objected oriented mentality.

How does it do that? A form might pass over [date] [time] [timezone] and my object might have [utc_datetime]. The setters for date, time, and timezone set private variables that i don't care about individually. And my getter for utc_datetime will stick date and time together, then look at the timezone and the date and figure out what amount of hours to add or subtract, and return the utc_datetime. But only in cases where the calling code actually ends up requesting it. Otherwise that calculation can be skipped.

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Biggest Visual Studio defect: Runs on Windows (543 comments)

There is a product by a company called Xamarin that lets you write C# and compile it for many platforms - iOS, Android, Mac, and Windows. You can either develop in their IDE, or treat their product as a plugin to Studio.

There's also Mono. The ServiceStack web services framework is completely portable between windows and mono on linux.

Or you can use PyTools (http://pytools.codeplex.com/) to write python.

It's still predominantly used for Windows. But the other opportunities are much more than they used to be.

about a year and a half ago
top

Visual Studio vs. Eclipse: a Programmer's Comparison

MemeRot Re:Getters and setters (543 comments)

Not mentioned in the other responses is the opportunity to use the "resource acquisition is initialization" or "lazy loading" pattern. You may have a field that gets populated by a relatively expensive operation like a database query. So your options are to fill it in during the object initialization. Or to have a get method that will check whether the private variable it exposes has a value yet. If not it goes and fills it in and then returns it. If you access that field in ~50% of your uses of the object you've saved a ton of database queries. The the calling code just uses CompanyConfig.AllowSomeOption freely.

That requires you to actually code that of course. The automatic get/set is just giving you the opportunity to do stuff like that. Once your class has exposed a public int MyField; you really can't come back later and change that. But exposing a public int MyField {get; set;} lets you come back and fill in the get/set logic when needed

about a year and a half ago

Submissions

MemeRot hasn't submitted any stories.

Journals

top

RC4 encryption in tcl 7.6, StoryServer 4

MemeRot MemeRot writes  |  more than 12 years ago [
##
##    INPUTS:        plainText
##
##    RETURNS:    cipherText
##
##    NOTES:        Conversion to Hex values may not
##      have been necessary, but was much easier to debug
##    See references at www.ncat.edu/~grogans and
##    http://www.tillerman.st/ietf/rodney_drafts/draft-kaukonen-cipher-arcfour-01.txt
##
##      This has been tested and found to match RC4, using
##      the perl module, also the public examples.
##      This was written for StoryServer 4.2, which is
##      based on tcl 7.6 (i.e. no binary stream, namespaces)
##
##      Tcl'ers, some of the syntax is slightly different,
##      not very though.
##
##      cypherText is created as a variable with the
##      encrypted string, not returned as the return value
##      from this function.

proc RC4_encrypt {plainText} {
    ## Must set these globally - but its global
    ## TO THIS PROCEDURE only
    global buffer S i enewsKey hexKeyList keyList enewsHex K f c HexVal plainList ccList l resultSet cipherText counter cardLen base64String

    for {set loop 0} {$loop <= 255} {incr loop} {
       append buffer " $loop "
    }

    ## Create a State array consisting of the numbers
    ## 0 through 255
    FOREACH num IN $buffer {
        [array set S [list $num $num]
        NULL]
    }

    ## The cipher key. Guard it.
    ## Put your own key in here, this will resolve to
    ## slashtroll

    set cipherKey [DECODE64 "c2xhc2h0cm9sbA=="]

    ## Its much easier to deal with the algorithm in
    ## hex and decimal than strings, so do that. This
    ## creates a list of the hex values.

        for {set l 0} {$l < [string length [SHOW cipherKey]]} {incr l} {
        scan [string index [SHOW cipherKey] [SHOW l]] %c keyInts
        lappend hexKeyList [format %X $keyInts]
    }

    ## destroy the key so that if there is a stack dump
    ## it is not compromised.
    unset cipherKey

    ## Make the key decimal, expand it to fill 256
    ## places in an array
    FOREACH HexVal IN [SHOW hexKeyList] {
        [scan $HexVal %x KeyStr]
        [lappend keyList $KeyStr]
    }
    set i 0
    for {set loop 1} {$loop <= 32} {incr loop} {
        for {set doubleloop 0} {$doubleloop <= 7} {incr doubleloop} {
            array set cypherHex [list $i [lindex $keyList $doubleloop]]
            incr i
        }
    }
    FOREACH num IN $buffer {
        [array set K [list $num $cypherHex($num)]
        NULL]
    }

    ## Delete more key variables in case of stack dump.
    unset hexKeyList keyList cypherHex

    ## Use the key array to mix the state array into an
    ## encrypting variable array
    set i 0
    set f 0
    FOREACH i IN $buffer {
        [SET f [expr ($f + $S($i) + $K($i)) % 256]]
        [SET tempVal $S($i)]
        [array set S [list $i $S($f)]
        NULL]
        [array set S [list $f $tempVal]
        NULL]
    }

    ## Get rid of the Key array. Now it should not be
    ## feasable for a user to crash the system with
    ## invalid plaintext and derive the key from any
    ## existing variables.
    unset K

    ## Create a hex, then decimal list of the plaintext
    set i 0
    set f 0
    set c 0
    for {set l 0} {$l < [string length $plainText]} {incr l} {
        lappend ccList [string index $plainText $l]
    }
    FOREACH HexVal IN [SHOW ccList] {
        [scan $HexVal %c plainStr]
        [lappend plainList $plainStr]
    }

    ## Encrypt the plaintext by deriving a number from
    ## the encrypting variable array to use and
    ## XOR'ing  it with the value of the plaintext
    FOREACH num IN $plainList {
        [SET i [expr ($i + 1) % 256]]
        [SET f [expr ($f + $S($i)) % 256]]
        [SET tempVal $S($i)]
        [array set S [list $i $S($f)]
        NULL]
        [array set S [list $f $tempVal]
        NULL]
        [SET t [expr ($S($i) + $S($f)) % 256]]
        [SET encrByte $S($t)]
            [array set resultSet [list $c [expr $num ^ $encrByte]]
        incr c
        NULL]
    }
    SET base64String "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
    set counter 0
    set cardLen [array size resultSet]
    FOREACH num IN {1 2 3 4 5 6} {
        [IF {[SHOW counter] != [SHOW cardLen]} {
            [append cipherText [string index $base64String [expr [SHOW resultSet([SHOW counter])] / 4]]]
            [incr counter; NULL]
            [IF {[SHOW counter] != [SHOW cardLen]} {
                [append cipherText [string index $base64String [expr ([SHOW resultSet([expr [SHOW counter] - 1])] % 4) * 16 + ([SHOW resultSet([SHOW counter])] / 16)]]]
                [incr counter; NULL]
                [IF {[SHOW counter] != [SHOW cardLen]} {
                    [append cipherText [string index $base64String [expr ([SHOW resultSet([expr [SHOW counter] - 1])] % 16) * 4 + ([SHOW resultSet([SHOW counter])] / 64)]]]
                    [append cipherText [string index $base64String [expr [SHOW resultSet([SHOW counter])] % 64]]]
                    [incr counter; NULL]
                } ELSE {
                    [append cipherText [string index $base64String [expr ([SHOW resultSet([expr [SHOW counter] - 1])] % 16) * 4]]]
                    [append cipherText "="]
                }]
            } ELSE {
                [append cipherText [string index $base64String [expr ([SHOW resultSet([expr [SHOW counter] - 1])] % 4) * 16]]]
                [append cipherText "=="]
            }]
        }]
    }

    unset buffer S i f c HexVal plainList ccList l resultSet counter cardLen base64String
    return
}]

Slashdot Login

Need an Account?

Forgot your password?