I'd like to do the equivalent of the following in LINQ, but I can't figure out how:
IEnumerable<Item> items = GetItems();
items.ForEach(i => i.DoStuff());
What is the real syntax?
I often find the following type of incremental definition useful:
(define (foo) (display "bar"))
(foo)
;prints bar
(define foo (let ((bar foo))
(lambda ()
(display "foo")
(bar))))
(foo)
;prints foobar
How do I preform this type of incremental definition with macros?
I could not get let-syntax to provide the same functionality.
Currently I use plt scheme, but would like to see answers in different lisp implementations as well.
I'm planing to start learning JQuery (among other things), so I'm looking for a good Javascript editor that can preferably provide some of the following features:
Syntax coloring
Contextual help for standard JS functions, JQuery functions and possibly custom ones.
Some code completion.
(optional) JS debugging
Is there such and editor out here? or any that come close to this?
So I rewrote my paths to something like: URL/really/nice/paths/ using mod_rewrite rules like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
The question is how could I rewrite the paths for js/css/image files too, so when they are requested with a relative path from URL/really/nice/path/ to be served from URL/scripts/, URL/styles/ and URL/images/ folders instead? Can this be done without using RewriteBase?
Hi,
I have a list of records that all need their individual TTLs modified. I can't seem to find a way with this odd syntax to do so, however. Any recommendations? Would I have to delete them all and then re-add after with the correct settings?
I can't seem to find a "modifyrecord" option unfortunately :(
Trying to save files in python:
g = open('~/ccna_pages/'+filename, 'w')
g.write(page)
g.close()
Get this error:
Traceback (most recent call last): File "dl-pages.py", line 50, in
g = open('~/ccna_pages/'+filename, 'w') IOError: [Errno 2] No such file or directory: '~/ccna_pages/1.0.1.1.html'
However, the directory does exist at that location.
This syntax seems to be the what the python docs recommend.. http://docs.python.org/release/1.5/tut/node46.html
What am I missing? Thanks..
my current url is something like:
http://something.somedomain.com/about_us/profile.php?tab1=about_us
a more complicated on is:
http://something.somedomain.com/exchange_hosting/feature/outlook_web_access.php?tab1=exchange_hosting&tab2=feature&tab3=outlook_web_access
i want to make them shorter:
http://something.somedomain.com/about_us/profile
http://something.somedomain.com/exchange_hosting/feature/outlook_web_access
my .htaccess
#################################
# Directory Indexes #
#################################
DirectoryIndex index.php
#########################################
# REWRITE RULES #
#########################################
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
<IfModule mod_rewrite.c>
#not a file
RewriteCond %{REQUEST_FILENAME} !-f
#not a dir
RewriteCond %{REQUEST_FILENAME} !-d
#this dosen't work
#RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ /$1.php?tab1=$0&tab2=$1
</IfModule>
# END #
Among the C-syntax family of languages (C, C++, Java, C#, ObjC, JS, AS, ...), which have a preprocessor compatible (to whatever extent) with the C preprocessor?
What's your first reaction when SQA shoots a bug/issue to you with short description?
Do you have any rules for SQA's report at your company?
Got any test case document or testing procedure ?
A popular editor uses highlighting to help programmers avoid using C++ keywords in Java. The following words are displayed using the same colors as a syntax error:
auto delete extern friend inline redeclared register signed sizeof
struct template typedef union unsigned operator
Why would this be considered important?
I am trying to create a multi line string in Groovy. I have a list of strings that I'd like to loop through within the multi line string. I am not sure what the syntax is for this. Something like below...
def html = """\
<ul>
<li>$awaiting.each { it.toPermalink()}</li>
</ul>
"""
I was looking through the "Domain Oriented N-Layered .NET 4.0 Sample App" project and ran across some code that I do not understand. In this project they often use syntax like the following to check arguments for null:
public GenericRepository(IQueryableContext context,ITraceManager traceManager)
{
if (context == (IQueryableContext)null)
throw new ArgumentNullException("context", Resources.Messages.exception_ContainerCannotBeNull);
Why would you cast null to the type of the object you are checking for null?
Every LINQ blog I found there seemed around 2 years old, I understand the syntax but need more direction on creating the SQL mapping and context classes.
I just need to use LINQ for 2 SQL tables I have, nothing complicated. Do folks write the SQL mapping classes by hand for such cases or is there a decent tool for this?
Can someone point me in the right direction?
I am wondering how to write this query.
I know this actual syntax is bogus, but it will help you understand what I am wanting.
I need it in this format, because it is part of a much bigger query.
SELECT distributor_id,
COUNT(*) AS TOTAL,
COUNT(*) WHERE level = 'exec',
COUNT(*) WHERE level = 'personal'
I need this all returned in one query.
Also, it need to be in one row, so the following won't work:
'SELECT distributor_id, COUNT(*)
GROUP BY distributor_id'
I've checked out the man pages and did some searching but can't find info on ways to have rsync skip files greater than a certain size. We're doing rsync to an offline location and when someone puts a hug video file, the rsync jobs run into work hours.
I've looked at the 'exclude' syntax and didn't see anything for excluding based on file size.
Can I do it with rsync or should I look for other offline synching alternatives?
I need to get counts to populate charts in Silverlight 4 and I am having a bit of trouble getting data back from my Domain Service mostly because I am not sure how to use aggregate query syntax. Has anyone had any luck populating charts in Silverlight 4 using aggregate (SUM, COUNT, etc) linq queries?
What is this syntax for in C++? Can someone point me to the technical term so I can see if I find anything in my text?
At first I thought it was a prototype but then the = and (*fn) threw me off...
Here is my example:
void (*fn) (int&,int&) = x;
I need to limit number of entities returned by a query to some certain value inside a JPA query (through JPQL). Particularly:
select m from Manual m //constraint
e.g. in sql (mysql syntax) I would do it like:
select * from Manual limit 1
The only solution that comes up is simply to get all entities and then choose first one, which is out of the issue. Any ideas?
Hello:
How can I break long lines when writing c++ code in vim? For example, if I have something like
56 fprintf(stderr, "Syntax error reading recursion value on
57 line %d in file %s\n", line_count, filename);
I get the following compile errors:
:56:25: warning: missing terminating " character
:56: error: missing terminating " character
:57: error: stray ‘\’ in program
:57:37: warning: missing terminating " character
:57: error: missing terminating " character
I'm a vim newbie.
Thanks!
I want to check my database for records that I already have recorded before making a webservice call.
Here is what I imagine the query to look like, I just can't seem to figure out the syntax.
SELECT FROM (1,2,3,4) WHERE id NOT IN table.id
Is there a way to do this? What is a query like this called?
I've been trying to figure out the syntax for an if / else if statement in jquery, but googling gives me mixed messages... There are some sites that say I need a plugin, and others that suggest that it's already possible. Trying those suggestions give me jquery errors in the jquery.js file, so I'm wondering, do I need a plugin or not? Does someone have an example of an
if () {
//do something
}
else if () {
//do something else
}
else {
//do something
}
in jquery?
I'm looking to restore one field from a backup and can't find the syntax for an update statement that can look at 2 different catalogs.
Seems like it should be something fairly close to:
update users set idUserCompany =
(select idUserCompany from .myBackup.dbo.users uT)
where uT.idUser = idUser