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 could do an endless timer checking IsInetOffline(), but I would prefer a hook callback that tells me when I plug/unplug the ethernet network cable or connect to wireless internet. Is there such a thing in the Windows API?
hi all actually when i use link syntax like
<?php echo $html->link('Home', '/notes/index');?>
but when i used
<a href="/cake/cake_startab/notes/index/" alt="Home">Home </a>
its woking why????
I am looking for any tool or good solution for handling spell check in the RichTextBox for Silverlight 4. Does anyone know of an existing solution or a good way to implement spell checking support for this control?
Guys,
I was hoping that someone can shed some light on why I am getting this error:
Parse error: syntax error, unexpected '{' in /homepages/22/d223624283/htdocs/drupal_new/includes/install.core.inc on line 74
Could it be something that I missed as far as D& configurations?
Thanks,
Matt
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.
$ bc
BC> ibase=2
BC> 110&101 // wanna get 100
(standar_in) 8: syntax error
Wikipedia informs that the ops are "|, & and ^". It may be that they work only in certain BC-types or I misread something.
What am I doing wrong here?
$array = array('sky'=>'blue', 'grass'=>'green', 'sun'=>'yellow');
$key = array_search('green', $array);
echo $key;
error: Parse error: syntax error, unexpected T_DOUBLE_ARROW in /Applications/XAMPP/xamppfiles/htdocs/search-array.php on line 2
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?
I am looking for the syntax to add node fields to the body of an email. Examples I looked at indicate the the format is:
[content_type:content_type_title]
However my email arrives with just the string :
[content_type:content_type_title]
Even better would be a PHP snippet that loads the node and dumps filed title and filed value into the body of the message.
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?
Im trying to think of the best way to handle real time search for a website. The only solution I can come up with is to keep checking the server every few seconds for something new in the database, but that does not seem very practical to me.
I hear a lot of Emacs users have their init file under git version control and sync the git repository over Dropbox, when they run Emacs on multiple systems.
Why would you use git in this situation exactly?
Usually checking which system you're on and which things to load and set depending on that can happen in one and the same init file for all systems, right?
So, isn't it simply enough to put your init file in a Dropbox directory and load that one directly from Emacs then?
I have the following dictionary:
sites = {
'stackoverflow': 1,
'superuser': 2,
'meta': 3,
'serverfault': 4,
'mathoverflow': 5
}
To check if there are more than one key available in the above dictionary, I will do something like:
'stackoverflow' in sites and 'serverfault' in sites
The above is maintainable with only 2 key lookups. Is there a better way to handle checking a large number of keys in a very big dictionary?
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 :(
I have a python script that'll be checking a queue and performing an action on each item:
# checkqueue.py
while True:
check_queue()
do_something()
How do I write a bash script that will check if it's running, and if not, start it. Roughly the following pseudo code (or maybe it should do something like ps | grep?):
# keepalivescript.sh
if processidfile exists:
if processid is running:
exit, all ok
run checkqueue.py
write processid to processidfile
I'll call that from a crontab:
# crontab
*/5 * * * * /path/to/keepalivescript.sh
Thanks in advance.
i have one image background of table with following syntax
style="background-image(URL)"
the problem is when i print it on printer it did't print.
can you please tell me how to get this
image background also get it printed on paper as watermark.
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 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?
is there a dictionary i can download for java?
i want to have a program that takes a few random letters and sees if they can be rearanged into a real word by checking them against the dictionary
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>
"""
A solution created with VS2010 with solution folder. When checking into this solution to TFS, the solution folders are missed on TFS.
How to sync TFS and VS2010 with solution folder?