notation

Haskell - Redefining (hiding) arithmetic operators

I want to redefine several arithmetic operators in Haskell in order to make them more extensible and generic. E.g. class Mul a b c | a b -> c where (*) :: a -> b -> c This seems to work in combination with import Prelude hiding ((*)) hiding the standard * operator. But of course all usual multiplications have to work as well, ...

How can I convert between scientific and decimal notation in Perl?

I know this is a total newbie question, but the answer may not be obvious to many new programmers. It wasn't initially obvious to me so I scoured the Internet looking for Perl modules to do this simple task. ...

JavaScript/jQuery short hand function definitions

I'm using a jQuery plugin that has its functions defined as such: $('#mydiv').pluginAction({ someproperty: val, format: 'mm hh', labels: ['yes', 'no', 'maybe'], labels1: ['never', 'always'] }); In my HTML page, I have multiple DIVs that have the same properties for format, labels, labels1, but...

What does "options = options || {}" mean in Javascript?

I came over a snippet of code the other day that I got curious about, but I'm not really sure what it actually does; options = options || {}; My thought so far; sets variable options to value options if exists, if not, set to empty object. Yes/no? Edit: changed title- thanks, Atomiton ...

Bang Notation and Dot Notation in VBA and MS-Access

While perusing an application that I'm documenting, I've run across some examples of bang notation in accessing object properties/methods, etc. and in other places they use dot notation for what seems like the same purpose. Is there a difference or preference to using one or the other? Some simple googling only reveals limited informati...

What's a good machine-readable formal way of describing telecom protocols such as SMPP or CIMD2?

I've implemented several telecom protocols from human-readable specs in various languages during my career, and frankly, I'm not enjoying it very much anymore. Instead, I'd like to translate the human-readable protocol specs into machine-readable protocol specs, and automatically generate protocol handlers in various languages. I'm sp...

Is prefixing Windows Forms control names with their type OK?

Possible Duplicates: Why shouldnt I use Hungarian Notation? Best practices for C# GUI naming conventions? I have seen many responses that say that prefixing variables with their type is bad, since C# is statically typed and we have Intellisense, but I find that prefixing the names of the controls is useful because I don't ne...

Is there an existing algorithm for this notation translation/conversion?

A system has a notation that would require writing an expression like (A+B)*C as #MUL(#ADD(A,B),C). Is there already an algorithm to do this kind of notation conversion so users can enter in a more conventional way? In other words an algorithm to convert from infix -> my notation. First issue is I don't know an exact name for my notation...

is there an index to be accessed in the CI foreach with {}-Notation?

Hello Guys, i'm new with Codeigniter,and whish to know if i can access any kind of iterator for the foreach with {}-Notation in my views. The thing is, i'm having a list which should be devided after each x items. example (what i would like to do: <ul> {list} <li>{items}</li> <? if ($iterator % 15 == 0) echo "</ul><ul>"; ?> {...

What is the name of such notation?

JSON web site uses very clear notation to describe JSON's syntax: What is the name of such notation? Is this is just a graphical presentation of BNF or it has it's own name? ...

Looking for resources on notation systems

Hello SO, I think almost everybody know or heard about what I call the yes/no notation system: thumb up or thumb down. Youtube uses it at the moment. Education uses a ABCDEF grade notation. It doesn't really apply to web, I'm looking for methods that can be used for articles tips, or videos. Another notation system relies on stars. Up...

is there a better, more lightweight way to access session data in codeigniter view?

Is there a more lightweight way to access session data in a view with codeigniter than posted here? i think about soemthing like {session.myparameter}. thanks for help ...

Notation as a tool of thought - how far have we come?

Recently I was comparing an old Windows DOS command for deleting all the files in a directory with a scripted equivalent - I noticed the "modernised" version required typing 50 times more keystrokes to achieve the same outcome. Are these additional keystrokes enhancing productivity? Are they serving a purpose that has been quantified,...

javascript ? : notation

This is probably a dumb question, but... I found this snippet of code in my travels in researching JSON: var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; I'm seeing more and more of the ? and : notation. I don't even know what it is called to look it up! Can anyone point me to a good resource for this? (btw...

To prove something is NP-hard, why do you need to reduce to it from an NP-complete problem?

From wikipedia: "A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H (i.e., L ≤ TH)." Why does the problem(call it W) being reduced from need to be NP-complete? Why can't it just also be NP-hard? It seems like what you care about W being "hard" not that its in NP. Though...

Which of the following postfix notations correctly represents infix sum 1+2+3+4?

I am testing an infix-to-postfix-to-infix converter and found some kind of uncertainty. For example, a simple infix sum 1 + 2 + 3 + 4 can be converted to postfix one 1 2 + 3 + 4 + assuming that operators with equal precedence are not accumulated. If they are then I get 1 2 3 4 + + + On the other hand, all the following postfix e...

Scala - Prefix Unary Operators

I've recently given Scala a second chance, and started with the project I always implement (in functional or pseudo-functional languages): an automated reasoner for propositional logic (and later predicate logic). Now, I've tried to get the notation of propositional logic in the language itself as pretty as possible, and I've gotten thi...

Converting academic mathematical notation to C code

Those of you that are even moderately knowledgable of math will likely laugh, but I don't remember what much of the notation rules in math and I need assistance converting this into C code. Your help is greatly appreciated: 214 10,000 {(10,000 × [1+.0599/365] )} +300 answer = ────────...

define double constant as hexadecimal?

Hi, I would like to have the closest number below 1.0 as a floating point. By reading wikipedia's article on IEEE-745 I have managed to find out that the binary representation for 1.0 is 3FF0000000000000, so the closest double value is actually 0x3FEFFFFFFFFFFFFF. The only way I know of to initialize a double with this binary data is th...

Syntax for documenting JSON structure

So I'm trying to document the format of the json returned by an api I am writing against and I'd like to know if there is any popular format for the documentation of json structure. Note I'm not trying to to test or validate anything, I'm just using this for documentation. Also some ways to add comments to non-constants(items always re...