I'm using some code (available here on MSDN) to dynamically build LINQ expressions containing multiple OR 'clauses'.
The relevant code is
var equals = values.Select(value => (Expression)Expression.Equal(valueSelector.Body, Expression.Constant(value, typeof(TValue))));
var body = equals.Aggregate<Expression>((accumulate, equal) =>…
When i use this code
<!--[if IE 6]>
<link rel="stylesheet" href="ie6.css" type="text/css" />
<![endif]-->
<!--[if !IE]>
<link rel="stylesheet" href="not_ie.css" type="text/css" />
<![endif]-->
IE 6 does correctly use the specified stylesheet but all other browsers ignore both when they should be using the…
Imagine I've defined the following name in J:
m =: >: i. 2 4 5
This looks like the following:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
26 27 28 29 30
31 32 33 34 35
36 37 38 39 40
I want to create a monadic verb of rank 1 that applies to each list in this list of lists. It will double (+:) or add 1…
I'd like to make a click event fire on an <input type="file"> tag programmatically.
Just calling click() doesn't seem to do anything or at least it doesn't pop up a file selection dialog.
I've been experimenting with capturing events using listeners and redirecting the event, but I haven't been able to get that to actually perform…
I'm trying to solve one of the Project Euler problems. As a consequence, I need an algorithm that will help me find all possible partitions of a set, in any order.
For instance, given the set 2 3 3 5:
2 | 3 3 5
2 | 3 | 3 5
2 | 3 3 | 5
2 | 3 | 3 | 5
2 5 | 3 3
and so on. Pretty much every possible combination of the members of the set.…
When i use this code
<!--[if IE 6]>
<link rel="stylesheet" href="ie6.css" type="text/css" />
<![endif]-->
<!--[if !IE]>
<link rel="stylesheet" href="not_ie.css" type="text/css" />
<![endif]-->
IE 6 does correctly use the specified stylesheet but all other browsers ignore both when they should be…
I currently echo certain variables in hidden input fields and read them out with Javascript whenever I need them.
Me and a colleague are now thinking of generating an extra Javascript file with PHP which only contains all variables for Javascript. This way the variables already exist and there is no extra code in the HTML.
What are…
I'm currently learning the fascinating J programming language, but one thing I have not been able to figure out is how to filter a list.
Suppose I have the arbitrary list 3 2 2 7 7 2 9 and I want to remove the 2s but leave everything else unchanged, i.e., my result would be 3 7 7 9. How on earth do I do this?
Being stuck in a MS stack architecture/development position for the last year and a half has prevented me from staying on top of the world of open source stack based web servers recent evolution more than I would have liked to. However I am now building an open source stack based application/system architecture and sadly I do not…
Has anyone successfully accessed AWS (Amazon E-Commerce Services) through Cocoa Touch? I've been digging around, and haven't seen the issue addressed directly. I've created an AWS account, and have seen some sample code for accessing web services through Cocoa, but I'm not quite sure how to tie it all together.
If anyone has…
I have a strings like \uXXXX (representation) and I need to convert it into unicode.
I recieve it from 3rd party service so python interpreter don't convert it and I need convertion in my code.
How do I do it in Python?
>>> s
u'\\u0e4f\\u032f\\u0361\\u0e4f'
Here's a function to calculate the digital sum of a number in J:
digitalSum =: +/@:("."0)@":
If I use b. to query the rank of this verb, I get _ 1 _, i.e., infinite. (We can ignore the dyadic case since digitalSum is not dyadic.)
I would like the monadic rank of this verb to be 0, as reported by b.. The only way I know of to…
In another question, I saw the following syntax:
#[unset!]
What is that? If I say type? #[unset!] in R3, it tells me unset!, but it doesn't solve the mystery of what #[] is.
So curious.
This is the inverse of the "What programming language do you wish would catch on?" question.
I was a Delphi programmer for many years, and I still appreciate its power, but I dislike verbose programming languages. So I would love to see Pascal put out to pasture.
The same goes for BASIC in any form, despite the fact that it's…
Let's say I have the following J expression:
# 3 ((|=0:)#]) 1+i.1000
This counts the number of numbers between 1 and 1000 that are evenly divisible by 3. (Now, before anyone points out that there's an easier way to do this, this question is about the syntax of J, and not mathematics.)
Let's say I define a monadic function…
I have a custom Tab Control that I have created, but I am having an issue. I have an Editable TextBox as part of the custom TabControl View.
<Controls:EditableTextControl x:Name="PageTypeName"
Style="{StaticResource ResourceKey={x:Type Controls:EditableTextControl}}" Grid.Row="0"…
Google libère le système de build utilisé pour Chrome
« Ninja » serait dix fois plus rapide que GNU Make
Evan Martin, l'un des développeurs de Google Chrome, vient de passer sous licence open-source son système de Build baptisé « Ninja », actuellement utilisé pour porter le navigateur de Google sur plusieurs…
Mac OS X 10.9 aurait pour nom « Lynx »
et pourrait intégrer l'assistant vocal Siri et l'application de cartographie Plans
OS X 10.9, la prochaine mise à jour majeure du système d'exploitation d'Apple pour PC de bureau et portable Mac devrait avoir pour nom « Lynx ».
Selon le site spécialisé AppleScopp des…
I'm using 3DS Max 2010 with the KW x-porter plugin, which outputs a .X file (just downloaded the very latest version).
Been getting some odd results:
http://www.picvalley.net/u/2930/2265240220441812321333990933PAStFeSONWQslOrMQC5q.PNG
Looks like the culling is screwed up. Note, that models I make in…
Better programmers than me can write in essays about walking around with a coffee mug and call it programming. And it's perfectly accepted at a place that knows the business. Or see what Gregory House (TV show "House M.D.") does when he is thinking.
But what about the other places where you are the…
Google accuse Bing de copier ses résultats de recherche, suite aux résultats de tests qu'il a effectué
Google vient de porter de graves accusations concernant son rival Bing.
Mountain View a en effet effectué dans le plus grand secret divers tests. Ainsi, cent termes qui ne génèrent habituellement…
JavaScript : Microsoft porte les 15 000 lignes de code « Cut The Rope »
Depuis Objective-C et rend disponibles les outils qui l'ont aidé
Si Cut the Rope ne vous dit rien, vous pouvez dès à présent aller voir à quoi ressemble ce « best seller » des jeux mobiles. Ses premiers niveaux sont à présent…
La beta du SDK de Kinect pour Windows est disponible gratuitement
Pour un usage non commercial
Mise à jour du 17/06/11, par Hinault Romaric
Comme l'avait annoncé Microsoft lors de la conférence MiX 11 de la Las Vegas en avril (lire ci-avant), le SDK de Kinect pour Windows est disponible…
Guerre des brevets : et maintenant les émoticônes
Varia porte plainte contre Samsung qui porte plainte contre Apple
En décembre dernier, Samsung avaient attaqué Apple en vertu de leur brevet US n° 7,835,729, qui décrit la méthode de saisie des émoticônes dans les smartphones.
Dans le…