simple parse example:
ab: charset "ab"
parse "aaa" [some ab]
; == true
if i wanted one-liner (define ab in place), how do i do it?
parse "aaa" [some [charset "ab"]]
; ** Script Error: Invalid argument: ?function?
parse "aaa" [some (charset "ab")]
; (INTERPRETER HANGS UP)
i use REBOL 2.7.7.4.2
UPDATE
in rebol 3:
parse "aaa" [s...
A recent question used a sigil invariant syntax %hash->{key} = 1; for hash access, which seems to work fine, but I would have thought it would be a syntax error.
It seems to work for arrays as well:
my @array;
@array->[3] = 6;
Is this behavior documented somewhere? I don't remember reading it, but may have overlooked it.
It seems ...
Hi,
I am interested in the idea of using Tweets/SMS/Identica or other short text status update systems to track Observations of Daily Living (or ODLs). The basic notion is that you send status updates to Twitter or Identi.ca or perhaps just an SMS message or whatever in a format that can be later mined to show patterns.
You could us...
I was just reading an SO question on Python, and noticed the lack of parentheses in a for-loop. Looked nice to me, then I wondered: why does C# require them?
For example, I currently need to write:
if (thing == stuff) {
}
and
foreach (var beyonce in allthesingleladies) {
}
So I am wondering why I can't write:
if thing == stuff {...
I ran into this statement in a piece of code:
Int32 medianIndex = colorList.Count >> 1;
colorList is a list of class System.Drawing.Color.
Now the statement is supposed to retrieve the median index of the list .. like the half point of it .. but I can't understand how that >> symbol works and how the "1" is supposed to give the media...
It seems like all programming languages use commas (,) to separate function parameters.
Why don't they use just spaces instead?
...
I'm an experienced programmer, but still a little green at python. I just got caught by an error in indentation, which cost me a significant amount of debugging time. I was wondering what experienced python programmers do to avoid creating such problems in the first place.
Here's the code (Part of a much larger program) :
class Wizvar(...
I am getting a syntax error on line 13...
line 13:
"c001": {type:"tool", id: "webconference", name:"Web Conference Tool"}, // web conference
Can you help me fix this? :) Thanks.
//assuming jquery exists
/* notes:
a lot of the functions need to either return jQuery or jQuery.ib, and if jQuery.ib then I need a .stop() function th...
I have a question in different Oracle versions. In their download page, there is Standard/Enterprise, and there is Express. Other than performance and other infrastructure tools, do the two different versions support the same set of SQL script keywords? For example, if I generate DDL tables from standard, is there a chance it may not wor...
I have two MySQL tables:
Group(gr_id, gr_name, gr_description, parent_id)
Group_has_User(User_id, Group_id)
I'm trying to execute the query:
SELECT group.gr_id, group.gr_name, group.gr_description, group.parent_id
FROM group, Group_has_User AS gu
WHERE (group.gr_id = gu.Group_id) AND gu.User_id = 1
It gives an error:
You have an err...
Hello!
Using the Openframeworks library in C++, I have the radius of a glow (max_distance) that is determined by the stretch of the mouse dragging across the screen (mouseDragX). It works fine.
But rather than every time I resize it (by dragging the mouse), I want it not to start at 0 and follow the mouse drag directly.
max_distance =...
Possible Duplicates:
C++ weird constructor syntax
Variables After the Colon in a Constructor
What does a colon ( : ) following a C++ constructor name do?
For the C++ function below:
cross(vector<int> &L_, vector<bool> &backref_, vector< vector<int> > &res_) :
L(L_), c(L.size(), 0), res(res_), backref(backref_) {
...
Example html:
<div class="red"></div>
<div class="green"></div>
<div class="blue"></div>
<div class="apple"></div>
I want to loop through the divs and filter them out if they don't have a class of either 'red', 'green', or 'blue.'
var onlyColorDivs = $('div').hasClass( ____ );
Is there a way to fillin the blank in the previous line...
I am making an image morphing function, however I am encountering problems. I have an unexpected T_STRING at the commented line, which I'm sure is an embarrassingly simple error...
What's wrong? How can I avoid this in the future? Thanks.
function morph($img) {
$tempImg = $img;
$size = getimagesize($tempImg);
$width = $size[0...
I'm wondering is there any method (that doesn't use loop or recursion) to create and fill with values an array.
To be precise I want to have an effect of
$t = array();
for($i = 0; $i < $n; $i){
$t[] = "val";
}
But simpler.
...
I'm writing stored procedures for the first time, and it's not working. The trouble is I can't see a reason for it not to work.
I'm running it through phpmyadmin 2.8.2.4. My MySQL version is 5.1. Here is the first part of the query:
create procedure under_user_type (in original_post int, out user_type int, out user_id longtext)
begin
...
I'm trying to alter the results of a Transact-SQL (MS SQL Server) report that is currently showing:
CompanyA DVCE3
CompanyB DVCE2
CompanyC DVCE3
CompanyD NULL
CompanyE DVCE3
and I would like it instead to show:
CompanyA 36
CompanyB 24
CompanyC 36
CompanyD
CompanyE 36
I'm sure the answer to...
Hi, people. I study Obj-C and Cocoa now, and I was wondering: why everybody writes method definitions/implementations like this:
- (void)translateOriginToPoint:(NSPoint)newOrigin{
- all together, no spaces.
For me, it's way more clean to write everything with spaced like this:
- (void) translateOriginToPoint: (NSPoint) newOrigin {
...
CUnknown* (*)( LPUNKNOWN pUnk, HRESULT* phr );
Seems I've always been in trouble reading such complicated pointers..
How do you read it? what if the expression even longer?
...
Is it possible to use PHP alternate syntax (as described in the CodeIgniter user guide), on WAMP?
...