|
qntm posted:So what's the best programming language? mIRC script.
|
# ? Sep 2, 2011 15:49 |
|
|
# ? Jun 8, 2024 09:32 |
|
rolleyes posted:mIRC script. Truth. You will learn good things in that.
|
# ? Sep 2, 2011 16:02 |
|
Golbez posted:Truth. You will learn good things in that. Guilty confession: I wrote a (very basic, insecure) webserver in mIRC script a long time ago. With that said, I'm now off to commit seppuku.
|
# ? Sep 2, 2011 16:29 |
|
rolleyes posted:Guilty confession: I wrote a (very basic, insecure) webserver in mIRC script a long time ago. I once made a lyrics script that would go out to lyrics.ch and get songs, but ...
|
# ? Sep 2, 2011 16:47 |
|
Golbez posted:I once made a lyrics script that would go out to lyrics.ch and get songs, but ... It was coupled with the MP3 player I also made* and served dynamic pages which displayed the playlist and allowed you to control playback. That probably makes it worse. In my defence this was about 10 years ago when I was a teenager. *For those unfamiliar with mIRC, it provides a function to play MP3s so no I did not implement the actual algorithm in mIRC script - that would be a step beyond insanity. You had to do everything else yourself though - build the UI, event handlers, etc.
|
# ? Sep 2, 2011 17:02 |
|
rolleyes posted:It was coupled with the MP3 player I also made* and served dynamic pages which displayed the playlist and allowed you to control playback. That probably makes it worse. In my defence this was about 10 years ago when I was a teenager. I made a drat sweet MP3 player. I had all these grandiose plans to support Winamp skins in it too... and then I found some insane person had actually done that. I was impressed.
|
# ? Sep 2, 2011 17:08 |
|
Golbez posted:I made a drat sweet MP3 player. I had all these grandiose plans to support Winamp skins in it too... and then I found some insane person had actually done that. I was impressed. Nice. I've always chased functionality over looks so mine was plain old winforms style but with ridiculous over-the-top features (see also: webserver). I still have that script somewhere.
|
# ? Sep 2, 2011 17:16 |
|
rolleyes posted:Nice. I've always chased functionality over looks so mine was plain old winforms style but with ridiculous over-the-top features (see also: webserver). Well I never actually made a GUI for it. But I considered it! The best part about mine was the customization. %name% for the song name, %artist, %genre%, etc... everything! And colors! poo poo, I remember when Khaled added colors to mIRC. That was a hell of a day, I tell you. It was exciting. Then again, I also remember when Khaled added if. Looking around Google, there's almost no trace of mIRCIf; not a surprise, since it ceased to be used years before Google came around. It was an external program to add if-then-else handling to mIRCScript.
|
# ? Sep 2, 2011 17:25 |
|
I know that in languages with strict typing, you typically have to declare the types of all the parameters to a function, as well as the type of the return value. Like in C you might have int myfunction (int a, float b); (I may have made a syntax error somewhere, it's not crucial to the post.) Aside from maybe being necessary for low-level languages to work properly, this has the nice property that you've made a declaration to some extent of what properties you want your function's arguments to satisfy, which makes your job easier. In some dynamic languages (PHP I'm looking at you) you cannot declare that you want an argument to be an integer, so you either have to do some kind of check in the function, or throw your hands up and say gently caress it, I'm just going to assume whenever this function gets called it is by somebody who isn't retarded. Maybe that isn't so bad but it is kind of unsatisfying. But it seems like the capability of saying what type you want the argument to be is not going far enough. I should be able to say that I want the argument to be not just an integer, but an odd integer greater than 10, or that I want the return value not just to be a string, but that I want it to be a string precisely 8 characters in length. Seems to me the easiest way to achieve that is by saying: when you define your function, for each argument you should supply not a type, but a predicate that you want to return true or else the function has been called incorrectly and an error should occur. For convenience, names of types should also be usable as predicates that take a single argument and return true or false according as the argument is of the appropriate type. So something like the following should be doable (syntax is made up; assume that nonnegativeInteger is a predicate that already exists and behaves in the obvious way): code:
Tell me languages that behave in a similar way to what I just described.
|
# ? Sep 2, 2011 22:39 |
|
What you're describing is typically called 'contracts'. For example, I recently came across contracts.coffee, a dialect of CoffeeScript that implements contracts. (Only runs in Firefox, so it's not really useful to play with, but it's an example to look at.)
|
# ? Sep 2, 2011 22:45 |
|
Hammerite posted:Tell me languages that behave in a similar way to what I just described. The general property of "I want types which are arbitrary predicates" in a language is called dependent types, which are typically only seen in proof languages such as Coq, Isabelle, and Agda. Generally, dependent type systems are seen as somewhat undesirable in real-world languages, as they tend to make the language overly verbose and have turing-complete (hence potentially non-terminating) compilation phases. That said, there are less-complete type systems which can do an excellent job of letting you make very precise types, while not allowing arbitrary predicates; Haskell is probably the best example, as it has a very extensive type system and is reasonably well-known. If you are fine with your predicates only being checked at runtime (potentially throwing an exception or some such) then obviously this becomes significantly easier and less interesting; any arbitrary functional programming language would make the task trivial and boring. Usually runtime predicates are called contracts or assertions, depending on how they're implemented.
|
# ? Sep 2, 2011 22:55 |
|
pokeyman posted:The question was: Apology accepted. To clarify where I was coming from he asked: Sulk posted:I feel like it comes down to whether I want to work on more traditional software versus having the ability to design iOS applications, but does anyone have more insight? To me, this was the part that I was responding to. After all, if you understand Java, you can understand C# up to .NET 2.0 easily. You can probably also grok the syntax of Objective-C (I have no idea about the cocoa framework etc. having never used them) Part of his question came across as "Should I do 'traditional development' or mobile development." This was the bit I was responding to. By giving my opinion (and just that) on mobile development, it was to guide Sulk towards picking either Java or C#. Cos picking Objective-C for mainstream desktop development is a bit restrictive.
|
# ? Sep 3, 2011 00:12 |
|
pokeyman posted:What you're describing is typically called 'contracts'. For example, I recently came across contracts.coffee, a dialect of CoffeeScript that implements contracts. (Only runs in Firefox, so it's not really useful to play with, but it's an example to look at.) Oh that's what contracts are. Everything I'd heard about them up until now just sounded like strict typing.
|
# ? Sep 3, 2011 00:24 |
|
You can create this behavior in Python using a combination of decorators and parameter annotations.
|
# ? Sep 3, 2011 02:51 |
|
You mean static typing not strict typing, and the language sage is the closest thing I can suggest
|
# ? Sep 3, 2011 05:47 |
|
D has contracts built in.
|
# ? Sep 3, 2011 19:36 |
|
tef posted:You mean static typing not strict typing, and the language sage is the closest thing I can suggest to elaborate: static typing vs dynamic typing - this is where the types are checked, at compile or runtime strong typing vs weak typing - this is how far the language will go to interpret one data type as another, this can encompass implicit casts as well as things like duck typing 'strict' is often used to mean 'static' or 'strong' or a mixture of both what you are talking about is typing basically, but types defined by a function rather than a class hierarchy. as some have pointed out, some languages provide a facility for runtime checks, (notably eiffel), but these are normally implemented as a series of pre/post conditions and invariants around functions, rather than only defining a function which signifies a type. of the languages where you can freely mix functions and types, I can only think of two off hand: magpie: a toy language experimenting with some ideas http://journal.stuffwithstuff.com/2010/10/29/bootstrapping-a-type-system/ and more realistically, sage: http://sage.soe.ucsc.edu/ is a more thought out version with type checking this is more along the dependent typing area, but will try to type check your program as much as possible, but falling back to dynamic checks
|
# ? Sep 4, 2011 06:25 |
|
Most of the time I've heard "strict" typing it's used as an alternative to "dynamic" typing. Basically people who like languages with strong typing use "strong" vs. "weak", which makes weak typing sound bad. People who like languages with weak typing use "strict" vs. "dynamic", which makes weak typing sound good.
|
# ? Sep 4, 2011 14:38 |
|
although alan kay likes to say things like "strong typing is for weak minds"
|
# ? Sep 4, 2011 14:52 |
|
So I'm using ruby to parse an RSS feed and display the HTML:code:
Artist – Title How the hell do I make that stupid Unicode thing go away and replace it with a dash? If I try to do latest_tracks.gsub it pukes on having unicode in the source file.
|
# ? Sep 5, 2011 00:11 |
Achmed Jones posted:Artist – Title You've got some UTF-8 there. Mark your output as UTF-8 too, either through the Content-Type HTTP header (best) or through one of the several HTML ways.
|
|
# ? Sep 5, 2011 00:48 |
|
How would I match the following using regular expressions (I'm using flex): A string surrounded by < > which contains one or more non-printable characters? I thought it would be: \<.*[^[:print:]]+.*\> but that also picks up things like <hello>. Any ideas?
|
# ? Sep 5, 2011 02:17 |
Super Dude posted:How would I match the following using regular expressions (I'm using flex): A string surrounded by < > which contains one or more non-printable characters? code:
Assuming grep works the same as flex.
|
|
# ? Sep 5, 2011 02:44 |
|
nielsm posted:You've got some UTF-8 there. Mark your output as UTF-8 too, either through the Content-Type HTTP header (best) or through one of the several HTML ways. Awesome, that fixed it! Thanks!
|
# ? Sep 5, 2011 03:06 |
|
Stupid newbie question: I'm calling CMD from a powershell script and I need to do two things: 1.) Open the command prompt at a defined location, so when it opens the path is already set to, say d:\custompath\ 2.) Paste the contents of a PS variable into the command prompt I want the CMD window to open, paste the command, run it, and stay open so I can view its progress. It seems like it would be so easy and yet Ive spent hours trying to figure this out. What I've ended up with is something like this: $file = get-content D:\path\file.txt $clip = get-clipboard $both = $file += $clip $both | cmd.exe I'm a sys admin and I've never been able to learn anything except basic SQL because my brain doesn't seem to understand how computers want me to input information Any help is appreciated.
|
# ? Sep 5, 2011 03:14 |
|
nielsm posted:
edit: Actually I narrowed down the problem. Say I had the following input file. code:
code:
Super Dude fucked around with this message at 04:37 on Sep 5, 2011 |
# ? Sep 5, 2011 03:32 |
|
What is EPOLLPRI? Looking at the epoll_ctl documentation, we see... quote:The events member is a bit set composed of the following available event types: What constitutes "urgent data"? Edit: Oh my god, TCP supports the notion of "urgent data" and reserves 2 bytes in its header for this purpose. Nice going, TCP. shrughes fucked around with this message at 06:34 on Sep 5, 2011 |
# ? Sep 5, 2011 06:31 |
|
telnet uses it! It's mostly just feature bloat, though.
|
# ? Sep 5, 2011 06:41 |
|
Yeah, just keep pretending urgent data doesn't exist. Unless you're implementing Telnet. e:fb
|
# ? Sep 5, 2011 06:42 |
|
I for one like having my keystrokes buffered.
|
# ? Sep 5, 2011 23:26 |
|
Zombywuf posted:I for one like having my keystrokes buffered. You turn off Nagling to stop that, not set priority bits that basically everything ignores
|
# ? Sep 6, 2011 16:05 |
|
This is probably really obvious but, is there some sort of pattern for a client/service application (it's not online, though it might be extended in the future) to easily call methods across the service? Right now we're using strings to basically map out "Hey I want to call this function", and I'm converting everything to a system using enums so you can't fat-finger it but both seem like there really should be an easier/better way to go about it. Mr. Crow fucked around with this message at 17:18 on Sep 6, 2011 |
# ? Sep 6, 2011 17:12 |
|
http://en.wikipedia.org/wiki/Remote_procedure_call you're slowly writing your own RPC mechanism. most languages platforms have existing solutions and there are a few cross platform ones too. nothing really stands out but if you get to control both ends it is best to go with something native to the platform you're using edit: fwiw there are lots of different styles of connecting up software - rest, rpc, messaging. and pros/cons of each tef fucked around with this message at 18:08 on Sep 6, 2011 |
# ? Sep 6, 2011 18:05 |
|
tef posted:http://en.wikipedia.org/wiki/Remote_procedure_call That's what I was looking for, was reading up on it a day or two ago and I couldn't remember what it was called. I take it I would basically have to completely re-work their system to implement anything though correct? Think that's why I shot the idea down when I read about it. It's a huge legacy system so the whole hardwired string stuff is in there in the finest detail, and I'm basically only re-working one application within the entire system. Would there be some kind of basic solution I could use to "wrap in" to what is already there (.NET Remoting?) or is that kind of defeating the purpose? Mr. Crow fucked around with this message at 18:51 on Sep 6, 2011 |
# ? Sep 6, 2011 18:41 |
|
Mr. Crow posted:That's what I was looking for, was reading up on it a day or two ago and I couldn't remember what it was called. You probably could (if it's already .NET based you're already halfway there) but I'm guessing the people who architected/maintained the original system will freak out about it. These systems generally evolve because: a)The system is so old RPC wasn't usable b)The initial implementer was completely insane c)A legacy app that doesn't support a global RPC protocol had to be supported So unless one of those conditions has gone away I doubt you could get away with it; this is speaking 'politically' mind you. If you've got the juice go for it!
|
# ? Sep 6, 2011 20:34 |
|
Mr. Crow posted:That's what I was looking for, was reading up on it a day or two ago and I couldn't remember what it was called. Just go whole hog and enterprise the poo poo out of it
|
# ? Sep 6, 2011 20:41 |
|
Sulk posted:I definitely wasn't looking for anything at an enterprise level or even a full time job right now, but for general knowledge and functionality, I suppose. I do wonder if Perl would be a better choice than Python, but as far as my creative side goes, I feel like Objective C might be useful. Just not sure which is why I thought to ask.
|
# ? Sep 6, 2011 20:49 |
|
I have a dumb language theory/implementation question. Why can't I do this in any language I know of? pre:void do_something(void) { //do something } void init_then_do_something(void) { //do some init return do_something(); }
|
# ? Sep 6, 2011 23:21 |
Misogynist posted:Learn all of them. Each of them will help your understanding of the others. What's a very good, recent Python book or online tutorial? I'm not a huge fan of Learning Python the Hard Way because of how the author makes you learn something. The thread for Python didn't ever seem to have much.
|
|
# ? Sep 6, 2011 23:35 |
|
|
# ? Jun 8, 2024 09:32 |
|
ColdPie posted:That is, have a void function "return" another void function. I can't think of any reason not to allow it, and it makes refactoring easier should I want to add a return value to these functions, as I won't have to modify the body of init_then_do_something() at all. So, why can't I do this? This is valid in C++, and GCC and Clang allow it in C as an extension, only warning if you turn on -pedantic.
|
# ? Sep 7, 2011 00:06 |