If I have an anonymous type created by LINQ
var ans = from r in someList where someCondition(r) select new { r.a, r.b };
What is the best way to create an empty matching collection so I can move elements to the new collection:
var newans = ?
foreach (r in ans) { if (complicated(r) newans.Add(r); }
Is there some way to use Enumerable.Empty<()?
Hi all!!
I have a source code for a project with their make files. I want to create a Visual Studio (2005) solution from it. Is there any direct way to do this? can anyone help me please. I spent hours for searching, but couldn't find a way to do this.
Thanks.
I would like to customize my layout definition (declared in my_layout.xml file) from code.
Unfortunately I can use findViewById() function to find the specific views (defined in my_layout.xml file) and customize them from code only after I called setContentView(R.layout.my_layout).
But what if I want to customize my layout first, before calling setContentView()? How can I access the specific views before calling setContentView()?
I want to write a function that accepts any container holding strings. Something like this:
template <typename Container> void foo(Container<string>& stuff);
But this isn't the right syntax. What's the right syntax?
Hello, i have a AS2 script who get information from a MySQL database. This information is a text from 0 to 300 chars. I want to display that text in this layout:
I want to resize the black box you see on the picture in function of the amount of text imported. Any idea of how to do that on AS2?
The instance name of the box is: cargador.fondo (only want to resize height)
The instance name of the text is: cargador.texto
Thanks.
How to create such (see image below) effect using pure HTML JS and CSS?
For a site backgrownd (And I hoe that because of JS CSS and HTML it'll be able to change colors)
Hi guys,
Can I use TSQL to operate on normal operating system files? Such as create a .bat file at c:\test and write some query result into that batch file?
Thanks.
When I try to create an extension method for the File class, I get an error telling me that I cannot do this because the class is static. However, I don't see why this stops the creation of an extension method, what implication is there?
Thanks
I've created a class that calls an object in the "__construct" how can i make this object available through out the class.
class SocialMedia { function __construct() { $object = "whatever"; } }
how can I access $object in the other funtions (which are static) from with in the class.
I've tried to use "$this-object" but I get an error "$this when not in object context" when I try to call it from my other static functions.
function(char* name)
{
char sql[50];
sprintf(sql, "select %s;", name);
}
What's the best way to make sure only 50 chars of name are copied to sql in the case name is larger than what sql can hold? (sprintf with a N parameter?)
Thank You.
For example concept of Templates in C++ are for comfort as compiler generates some additional code, for your class or for your function, isn't it? So we could live without template by doing some additional (manual work).
What about virtual functions???
Are there any situations where both of them are irreplaceable?
All methods in my php class must connect to the database, so I think it is a good idea to connect to the database in the constructor function (in the first place, to speak so). Is it normal to do so? And how to create a constructor in PHP?
In a method that gets called frequently, like a painting event, is it more efficient to reuse Point and Rectangle Objects (for specifying locations and bounds), or should I create new ones.
I have an app, say MyApp Free. I want to create MyApp Pro which I can charge for that has some additional functionality. The obvious way is to have a library that contains almost all my app code, then two Android app projects for the Free and Pro versions which reference that library.
Suggestions?
How can i hide the scrollbar of using css/jQuery? i notice that the slideDown() function makes the scrollbar to be hidden but i can't understand why(the precise reason/behaviour).
What does the last function argument mean in C language?
Please, point to documentation where I can read about it.
void parse_options( int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(const char*) )
Thanks.
Hi!
How to create combobox control with non-selectable items? For example, such groupnames or categorynames which visually divide items in dropdownlist into some groups or categories.
WinForms
Anyone can give me an example on how to create local data caching? Like for example I query 10 millions records from my DB and I want to store it in my local so that I would not encounter performance problem next time when I want to reload the data. Thank you so much.
I have a game and i use function gotoAndStop in actionscript to play frame "moving" in my character game.And in this frame have movieclip. How can i detect when movieclip inside frame "moving" end ?
It says that if there is a virtual function, it is a good practice to have a virtual destructor. However, if the object is created on the stack but not on heap, do we still need to do that?
Regards,