How do i get access to an element in a set ?
vector<int> myvec (4,100);
int first = myvec.at(0);
set<int> myset;
myset.insert(100);
int setint = ????
Can anybody help ?
What would be appropriate scenario when stored procedures should be used?
I stumbled upon implementation where almost whole data manipulation was handled by store procedures, even simplest form of INSERT/DELETE statements were wrapped and used via SP's.
So, what's the rationale for using stored procedures in general?
Sorry for such a beginners…
I have a two-column primary key on a table. I have attempted to alter it to set the ignore_dup_key to on with this command:
ALTER INDEX PK_mypk on MyTable
SET (IGNORE_DUP_KEY = ON);
But I get this error:
Cannot use index option ignore_dup_key to alter index 'PK_mypk' as it enforces a primary or unique constraint.
How else should I set…
This same problem keeps cropping up. I have a viewModel that doesn't have any persistent backing. It is just a ViewModel to generate a search input form.
I want to build a large where clause from the values the user entered. If the Action Accepts as a parameter SearchViewModel How do I do this without passing my viewModel to my service…
I want to uninstall my application on button click. For this I am using following code.
Uri packageURI = Uri.parse("package:"+packageName);
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
It gives me result, but I want to delete directly without click on "Ok" button of dialog with…
Hi there ,
i am writing my bachelor thesis and there is some C++ code attached to it.
I want to have a nice clean Project.
So what should be in it ?
I think :
Documentation in html ( generated with Doxygen)
README File
Makefile ( which make ? CMake ? )
Unit-Tests ( which unit test framework? )
Copyright Text ?
...
Did i miss…
Edit: Changed question title from "Does C# allow method overloading, PHP style (__call)?" - figured out it doesn't have much to do with actual question. Also edited question text.
What I want to accomplish is to proxy calls to a an instance of an object methods, so I could log calls to any of its methods.
Right now, I have code…
Is there an exact/correct term to describe this difference between the syntax/constructs of programming langauges e.g VB6 with its (if ... else ... endif) and C# with its curly braces for conditional statements.
I'm using VB6 syntax and C# as examples since I'm more familiar with their syntax.
For example, Visual Basic 6's…
I've a PdfPTable created in my Java program,
Is there any way to actually set the width of specific column for the PdfPTable?????
For instance,
First column to be 5% width, second column to be 20% and etc.
Urgent help please if anyone knows the way. Thanks in advance.
I want to preload images but ensure they are loaded before continuing. How can I do this?
The following does not work as it sends off the load request only, but doesn't wait till the image is loaded. So it is possible that the image isn't loaded when requested soon after.
jQuery.preloadImages = function () {
for…
I have two databases on one SQL 2008 server. Database 1 seems to be causing a lock on a table on database 2. There no queries are running on database 1 that should affect database 2.
Is this normal behaviour?
When I view the running queries with this command
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,…
Say that I have a system service, and I want to offer a low-level maintenance access to it.
For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just…
My objective is to write a program which will call another executable on a separate computer(all with win xp) with parameters determined at run-time, then repeat for several more computers, and then collect the results. In short, I'm working on a grid-computing project. The algorithm itself being used is already…
I am planning to make a online-multiplayer game with my friends.
The game is a browser card game (so, players act in turns) and players could host rooms in a lobby.
Flex + actionscript will be used to write for the client side.
We are discussing what should be used for the server side.
I suggested C#/Java and my…
in this example you can see a generated HTML-list. On every refresh the script requests the data-file (ajax/test.json) and builds the list again.
The generated file "ajax/test.json" is cached statically. But how can I avoid requesting this file on every refresh?
// source: jquery.com…
I wanted to do something along the lines of:
public class MyClass<T implements Comparable> {
....
}
But I can't, since, apparently, generics only accept restrictions with subclasses, and not interfaces.
It's important that I'm able to compare the types inside the class, so…
I'm opening multiple files and processing them, one line at a time. The files contain tokens separating the data, such that sometimes the processing of one file may have to wait for others to catch up to that same token.
I was doing this initially with only one thread and an array…
I am trying to figure out a good way to handle recurring events in .NET, specifically for an ASP.NET MVC application. The idea is that a user can create an event and specify that the event can occur repeatedly after a specific interval (e.g. "every two weeks", "once a month" and…
A week ago Mr. Honan from Wired.com penned an article on security he titled “Kill the Password: Why a String of Characters Can’t Protect Us Anymore.” He asserts that the password is not effective and a new solution is needed. Unfortunately, Mr. Honan was a victim of hacking. As a…
Hello I have a game where you drag bits of food around the screen. I want to be able to click on an ingredient and drag it to another part of the screen where I release the mouse.
I am new to java so I do not really know how to do this please help me Here is me code.
This is the…
Hi i have a function that should return me a string but what is is doing is bringing me back the sql expression that i am using on the database
what have i done wrong
public static IQueryable XMLtoProcess(string strConnection)
{
Datalayer.HameserveDataContext db =…
I am able to successfully pre-populate my questions using the following code: First Name: <input type="text" name="first_name" size="30" maxlength="20" value="' . $row[2] . '" /><br />
However, when I try to do the same for a drop down box and a textarea box,…
I have a LEFT OUTER OUTER join in LINQ that is combining with the outer join condition and not providing the desired results. It is basically limiting my LEFT side result with this combination. Here is the LINQ and resulting SQL. What I'd like is for "AND…