If I have the following model;
public List<RecommendedProduct> recommendations
Then
public class RecommendedProduct
public List<Product> Products
Then the Product;
public class Product
public string Code
The recommendations list has, as an example, 10 items in it.
Each recommendations item has two Products in it.
How, with LINQ, can I find the recommendations object that has products with both "A" and "B" product codes?
There Currently is a local debate as to which code is more readability
We have one programmer who comes from a c background and when that programmer codes it looks like
string foo = "bar";
if (foo[foo.Length - 1] == 'r')
{
}
We have another programmer that doesn't like this methodology and would rather use
if (foo.EndsWith("r"))
{
}
which way of doing these types of operations is better?
I'm working w/ a function that expects a string formatted as a utf-8 encoded octet string. Can someone give me an example of what a utf-8 encoded octet string would look like?
Put another way, if I convert 'foo' to bytes, I get 112, 111, 111. What would these char codes look like as a utf-8 encoded octet string? Would it be "0x70 0x6f 0x6f"?
Thanks
I want to make a script that starts a program and then sends it key input.
#!/bin/bash
./program
(PRESS CONTROL-Z)
Is this possible? From what I've found I thought it might require key codes but I could be wrong.
Hi All,
I am a beginer in iphone application development. Is There anybody who can help me with some sort of codes to develop a alarm clock in xcode for the iphone.
Thanks in advance.
Koushik Podder
I have some STI structure like following:
class Box
has_many :part,:class_name = "Part"
end
class Part
def self.dosomething()
end
end
class TypeA
class TypeB
assuming we have some codes like boxtypeA = Box.new. I am wondering if there is a way to make boxtypeA.part.dosomething() to call TypeA's method not Part's or TypeB's. I think basically what we need to do is to convert the part to TypeA, how can we achieve that?
Thx in advance!
I have some STI structure like following:
class Box
has_many :part,:class_name = "Part"
end
class Part
def self.dosomething()
end
end
class TypeA<Part
def self.dosomething()
end
end
class TypeB<Part
def self.dosomething()
end
end
assuming we have some codes like boxtypeA = Box.new. I am wondering if there is a way to make boxtypeA.part.dosomething() to call TypeA's method not Part's or TypeB's. I think basically what we need to do is to convert the part to TypeA, how can we achieve that?
Thx in advance!
As the title said:
Is it possible to send an email (using php mail()) and after sending the email, auto redirect to another page. All the codes will be in single php file?
Code-wise, should be something like this:
if(mail(argument...)){
header("Location: www.google.com");
}
I think I would get a: "Error: header information already sent" or something like. But what if I want to send email and then auto-redirect on that page?? Possible?
Hi, I am facing issues with the special characters like ° and ® which represent the degree Fahrenheit sign and the registered sign,
when i print the string the contains the special characters, it gives output like this:
Preheat oven to 350° F
Welcome to Lorem Ipsum Inc®
Is there a way I can output the exact characters and not their codes? Please let me know.
Is there any plugin that let us record the editing session in ECLIPSE?
Say for example I want to learn from the best programmer how he codes in Eclipse etc, and we can replay how he does stuffs.
Programmers are strange people. We build things out of thin air, a part of our sanity and with weird codes that would make any grown sane man cry.
But sometimes, a programmer builds a program that is too weird even by their insane standards.
What program have you created that is weird and strange?
(One program per answer please)
Is there a gem like 'Term::ANSIColor' which works with 256 color terminals? The perl script 256colors2.pl works great in my terminal, and I'd like to use some of these colors in my ruby scripts without manually inserting the ANSI codes.
what is annotation class. what is the use of it in java/android.
In iphone Annotation is used to drop a pin on the map..
java has java.lang.Annotation package... what is the use of it? can i have a examples, tutorials,sample codes, etc?
Hi all
What is the difference between this two codes?
class SomeClass
{
SomeType val = new SomeType();
}
and
class SomeClass
{
SomeType val;
SomeClass()
{
val = new SomeType();
}
}
Which metod is preferd?
Hi all
What is the difference between this two codes?
class SomeClass
{
SomeType val = new SomeType();
}
and
class SomeClass
{
SomeType val;
SomeClass()
{
val = new SomeType();
}
}
Which method is preferd?
in this page of tutorial : http://java.sun.com/javaee/6/docs/tutorial/doc/bnadu.html discuss about hello2 application on samples folder.
i download samples from this link and installed correctly:
https://glassfish-samples.dev.java.net/servlets/ProjectDocumentList?folderID=5214&expandFolder=5214&folderID=0
but "hello2" folder not on the "web" folder.
where is source codes for sun JavaEE6 Tutorial Volume I ?
thanks alot
I have an addresses table with ZIP code field which has type VARCHAR.
I need to select all addresses form this table using ZIP codes range.
If I used next code:
select * from address where cast(zip as bigint) between 90210 and 90220
I get an error on fields where ZIP code cann't be cast as bigint.
How I can resolve this issue?
8, 10, 12, 981 (few area codes in Sweden). Total phone number can be 10 or 11 (digits only)
If 8 + 9 or 10 digits
if 981 + 7 or 8 digits
Can this be done in regex?
something like that ..hm
(8|10|12)\d{n} = Total Length 10 or 11
I'm trying to put together some career-related resources and I need access to the Holland Codes/RIASEC that classifies interests and skills to occupations. I can find many sites that already do this, but I can't find raw data in a structured format. Is anyone aware of a source for this. It can be commercial with licensing fees, though free would be nice!
Thanks!
I am using XAMPP and was wondering if I can code my site to include RSS feeds. Would the codes work and can I test it if I am working on a local server?
I am practicing using the OReily head First PHP/Mysql book and I'm on the chapter on RSS and getting RSS videos from youtube.
I think octal literals are Very Dangerous Things™, and I'd like them to be glaringly obvious whenever I read source codes.
There must be a way to do this in Eclipse, right?
So it looks like standard Eclipse cannot be configured to do this? A custom syntax highlighter is required?
hey guys
i need to shorten or better to say ., harden my codes
this is my original code :
if ($type = "recent") {
$OrderType = "sid DESC";
}elseif ($type = "pop"){
$OrderType = "counter DESC";
}else {
$OrderType = "RAND()";
}
now how can i use markers like this :
$OrderType = ($type = "recent") ? "sid DESC" : "counter DESC" ;
i tried but i didnt know how to write elseif in operators
what is an api, if a make a db and a social site in asp.net and c#, sql host it.
how can i ask others to make applications for it?
i mean how is that possible, i have the code, so API, is it a software?
i want to make a site like facebook social networking site, but its proving to be very very difficult, Ajax java script and all that
please help by providing examples, codes, readable, guidance,
thank you,
i has asked a similar question but deleted it as it was not clear
thank you