I'm using an implementation of lazy lists where the type can be either Nil or Cons (value, thunk), where thunk is a function from unit to the rest of the list.
I'm trying to write a function cross, which would function as List.combine does. Unfortunately, I'm having syntax errors.
open Sequence;;
let rec (cross : 'a Sequence.t -> '...
I want to ability to select code from my program such as dreamweaver or visual studio and then paste the code into a word file or my favourite work processor and have the syntax highlighted as well.
Is there a website that can provide this service with the ability to highlight syntax from various languages?
...
How can we set element to some default date in mysql ?
In oracle we would do something like
start_date DATE DEFAULT to__date('01011900','DDMMYYYY')
mutation_date_time DATE DEFAULT SYSDATE
CONSTRAINT entity_specification UNIQUE(external_name, start_date_time, end_date_time))
Also do we have any site or resource where we can get ...
PHP allows me to:
Hello, my name is <?php echo $name ?>, and stuff.
Is that okay to do instead of
Hello, my name is <?php echo $name; ?>, and stuff.
I know the <?= ?> is being taken away, is this another one of those shortcuts to be killed?
...
Forgive me, I'm a beginner. The following code returns a parse error:
$query = "INSERT INTO scenario_needgames VALUES ("$id", "Battle of the Bulge")";
the query builder in phpMyAdmin gave me this slightly modified string that works:
$query = "INSERT INTO scenario_needgames VALUES (\"$id\" , \"Battle of the Bulge\");";
but I'm confu...
Can someone explain me the syntax below line 1?
I am OK with js and function references, but this code looks a bit confusing.
E.g. is it function declaration and execution?
jQuery.noConflict();
(function($) {
$(function() {
// more code using $ as alias to jQuery
});
})(jQuery);
// other code using $ as an alias to the other li...
I am very new to C++ and still trying to learn syntax and best practices.
I've defined a method with a single parameter:
void foo(const std::string& name)
1) Is this a proper parameter declaration for a function that will be taking in a string defined by the user in, for example, a main method?
2) If this is proper/recommended synt...
Is there a way to refer to a Javascript variable with a string that contains its name?
example:
var myText = 'hello world!';
var someString = 'myText';
//how to output myText value using someString?
...
See also SO 1664677
I get this error
2: Syntax error: "(" unexpected
when I run this script -- all help is very appreciated
#!/usr/bin/perl
use Digest::MD5 qw(md5_hex);
printf "Usage : keygen.pl e-mail key-id\ne-mail : the one you provided\nkey-id : provided by hcf/hsfconfig\n";
$pad = pack("H2048", "00000000963007772c610eeeba510...
protected override Boolean IsValid(String propertyValue)
{
return !String.IsNullOrEmpty(propertyValue) && propertyValue.Trim().Length > 0;
}
This C# validation method does exactly what I want, but I wasn't aware that you could use expression short-circuiting like this.
When propertyValue is null, doesn't execution still need to ev...
So I'm really interested in Erlang. I can't find an excuse to use it for anything big, but I try to use it for toy problems from time to time.
Right now, I'm implementing a Roman Numeral translator. I'm just doing the "to" part for now, and I'm finding the code is awfully repetitive. It works like a charm, but, well, just look at it:...
What does this mean in python:
sock.recvfrom(2**16)
I know what sock is and I get the jest of recvfrom function, but what the hell is 2**16?
...
i = 1, 2, 3, 4, 5;
this actually assigns 1 to i.
I wonder if this type of assignment is actually useful somewhere?
Do you know some application of this syntax?
...
type IFooable =
abstract Foo : int -> int
type IFooable2 =
abstract Foo : a : int -> int
type MyClass() =
interface IFooable2 with
member this.Foo(b) = 7
What is the difference between IFooable and IFooable2 ? Are they equivalent ?
What is the purpose of it in the case of my example ? When to use it ?
...
In PHP5, what is the difference between using const and static? When is each appropriate? And what role does public, protected and private play - if any.
...
In some classes I see a call to a function is like:
$this->ClearError();
When the function is residing in that class itself. How is the above approach different from a direct function call like:
return ClearError();
...
Is there a way to write this C/C++ code in Python?
a = (b == true ? "123" : "456" )
Thanks so much!
...
I actually happily design and develop JEE Applications for quite 9 years, but I realized recently that as time goes by, I feel more and more fed up of dragging all these ugly bean classes with their bunch of getters and setters.
Considering a basic bean like this :
public class MyBean {
// needs getter AND setter
private int m...
Hi,
How do you deal with broken data in XML files? For example, if I had
<text>Some &improper; text here.</text>
I'm trying to do:
$doc = new DOMDocument();
$doc->validateOnParse = false;
$doc->formatOutput = false;
$doc->load(...xml');
and it fails miserably, because there's an unknown entity. Note, I can't use CDATA due to t...
Post an example to execute a "C" statement without semicolon( ; )
...