Say, i have a function which returns a reference and i want to make sure that the caller only gets it as a reference and should not receive it as a copy.
Is this possible in C++?
Thanks,
Gokul.
Using the local dev server, I can use ';' in urls, but as soon as I try the live version hosted by Google, it looks like the ';' and everything afterward is stripped (at least according to request.path_qs).
(I would prefer not to encode them if possible, it's much less user friendly if the url cannot be constructed by copy-pasting, especially since other characters works fine, e.g. ':').
I am finding myself doing a lot more messing around with scripts than I used to and my lack of knowledge in this area (and linux sysadmin/security in general), is becoming a hindrance.
Can anyone recommend a good online resource for bash scripting/linux admin. Preferably, it will be in pdf format, so I can copy it (single file) onto my PDA.
Suppose you have 2 files in the same directory:
New File Name.txt and
NewFil~1.txt
If you use CopyFileEx to copy both files to the same destination, maintaining the same names, you will end up having only ONE file (the second one replaces the first one) which can be sometimes not a good thing. Any workaround for this behavior?
I have a XSLT sample copied straight from http://www.w3schools.com/xsl/xsl_transformation.asp, which I can't seem to view in Google Chrome. However, it seems to work fine in IE.
Does anyone know why this would be?
EDIT:
The online version works fine, but the local copy does not.
I'm using a Windows Service to do some directory cleaning (implementing a FileSystemWatcher).
The problem I'm having is that sometimes, when several files in a directory are deleted, one of the files still shows in the Explorer window. If you refresh the window the file disappears. Similarly, if you right-click on it or try to copy it, a pop-up informs that it no longer exists.
So what I'd like to know is: is there any way I can programmatically refresh the view of the Explorer window?
Say I've made changes to some files but I don't want to check them in. I want to save the changes in a batch file or some archive and then email them to another dev/myself/etc.. so that they can take a look at my changes and apply them to their working copy. Is it possible to do this?
Simpler scenario
Can you backup uncommited svn changes?
I have Windows Server 2008 R2 Enterprise(Licensed Copy) installed in my Laptop. I have installed this to evaluate Latest 64 bit Products of Microsoft like Share point 2010 etc.
Now i want to install Windows 7 Ultimate(Original) without removing the Server OS.
Basically, i want to make my laptop Dual Boot. I tried To install Windows 7, but it not showing any options for making dual boot.
Can anybody,please suggest the solution. I need to install immediately.
All of the NHibernate examples I've see that use hbm files have the hbm.xml file set as an embedded resource with "do not copy" chosen in the file properties. This means that if a database column name were to change in production, the app would have to be recompiled with the changes in the hbm.xml file during build time.
Is there any way to make NHibernate load the hbm.xml files from the file system at application startup instead of using an embedded version?
I'm building an entire application out of immutable objects so that multi-threading and undo become easier to implement. I'm using the Google Collections Library which provides immutable versions of Map, List, and Set.
My application model looks like a tree:
Scene is a top-level object that contains a reference to a root Node.
Each Node can contain child Nodes and Ports.
An object graph might look like this:
Scene
|
+-- Node
|
+-- Node
|
+- Port
+-- Node
|
+- Port
+- Port
If all of these objects are immutable, controlled by a top-level SceneController object:
What is the best way to construct this hierarchy?
How would I replace an object that is arbitrarily deep in the object tree?
Is there a way to support back-links, e.g. a Node having a "parent" attribute?
I haven't had a chance to test this script, I'm just using it as a suitable pseudocode. It's just supposed to copy all files in the current directory into a timestamped subdirectory.
ID="$(date +%Y%b%d%H%M%S)"
COMMITABLE="$(ls | egrep --invert-match ^(STATES|PARENT)\$)"
STATE_PATH="$(pwd)/STATES/$ID"
mkdir --parents "$STATE_PATH"
cp $COMMITABLE "$STATE_PATH"
ln -s "$STATE_PATH" PARENT
What happens, step by step, when a variable is returned. I know that if it's a built-in and fits, it's thrown into rax/eax/ax. What happens when it doesn't fit, and/or isn't built-in? More importantly, is there a guaranteed copy constructor call?
edit: What about the destructor? Is that called "sometimes", "always", or "never"?
Today I had something weird happen in my copy of Resharper 5. I have a class that looks like this:
public class Foo
{
public string Username { get; private set; }
public Foo (string userName) { Username = userName; }
public void Bar()
{
DoWork(Username);
}
public DoWork(string userName) { }
}
When I start to type DoWork(us I get the following from intellisense:
Notice that it's pulling up the constructor argument, and it ends with a colon: userName:
What's going on here?
This is the IF -Else ladder which I have created to focus first visible control on my form.According to the requirement any control can be hidden on the form.So i had to find first visible control and focus it.
if (ddlTranscriptionMethod.Visible)
{
ddlTranscriptionMethod.Focus();
}
else if (ddlSpeechRecognition.Visible)
{
ddlSpeechRecognition.Focus();
}
else if (!SliderControl1.SliderDisable)
{
SliderControl1.Focus();
}
else if (ddlESignature.Visible)
{
ddlESignature.Focus();
}
else
{
if (tblDistributionMethods.Visible)
{
if (chkViaFax.Visible)
{
chkViaFax.Focus();
}
else if (chkViaInterface.Visible)
{
chkViaInterface.Focus();
}
else if (chkViaPrint.Visible)
{
chkViaPrint.Focus();
}
else
{
chkViaSelfService.Focus();
}
}
}
Is there any other way of doing this. I thought using LINQ will hog the performance as i have to tranverse the whole page collection. I am deep on page which has masterpages.Please suggest.
Hi,
i have in my program few swf files and using mxmlc i compile the application into one swf file.
when i open the swf from the output directory(just dbl click) everything works fine.
But, when i copy the directory to another location in the hardisk the application stops responding
(i can see my swf main picture and its buttons in it.
But, when i click a button which just popup a message, it doesn't work!)
any help?
Hi,
i have the following code in a .h
@property (nonatomic, copy) NSString *username;
Then, username is assigned in this way when the user enter text in a TextField:
self.username = textField.text;
And then, in dealloc method i call release:
NSLog(@"%d",[username retainCount]);
[username release];
NSLog(@"%d",[username retainCount]);
But in the console it prints:
2011-01-11 23:09:52.468 IApp[2527:307] 1
2011-01-11 23:09:52.480 IApp[2527:307] 1
What is the problem?
Thanks
Does executing EntityManagerFactory.creatEntityManager() reutrn new instance each time? or it returns the cached copy of the same EntityManager each time?
Hello my problem is this:
I have an account at my hosting providers server and I can't install my own copy of vim.
So the only personalization I can make is editing .vimrc in my account, but it won't suffice
What I'd Like to do is:
on startup I'd like to unload all the plugins and loaded stuff, and tell vim to use other folder as its' runtime.
Any idea how to aproach it?
I'm used to handle graphics with old-school libraries (allegro, GD, pygame), where if I want to copy a part of a bitmap into another... I just use blit.
I'm trying to figure out how to do that in android, and I got very confused.
So... we have these Canvas that are write-only, and Bitmaps that are read-only? It seems too stupid to be real, there must be something I'm missing, but I really can't figure it out.
How can I use jQuery for messing with a particular div, but not in the current document - in a variable, that contains HTML?
The point is that I want to show a preview of a page (a piece of it's content) in a modal window, when the link to this page is clicked. Well, onClick I load this whole HTML into a variable via JSON and then... how would I find a particular div I need in it? It's gonna be almost impossible to parse it with PHP before converting it into JSON and giving back to jQuery processor because of a deep hierarchy.
Basically, is it even possible to do smth like $( 'div#some-id' ).blabla(); not for the current document, but for the document, stored in a variable?
Thx everyone in advance.
Hi all,
From organizer window i can copy document directory data. But in some apps i noticed that
it is locked and cant access documents directory.How can i lock the application from accessing
documents directory via organizer.
Currently I am developing a memo application for a company that each director needs to sign the word document as approved or disapprove. I have scan copy of each director as image in my DB.
The signatures and date will be appended at the bottom of the doc page
I created a base form that has a specific size and an icon as a base for all forms created in my project (to be consistent in looks). The problem is, for some reason if I add a Text box to the Child form, I can no longer execute shortcuts like Copy (CTRL+C) etc into the Textbox.
What should I do to handle this OTHER THAN writing code to capture those on the KeyUp control?
This is also the case for RichTextBox control as well.
Thanks
Hi i working a fairly large spreadsheet which is broken down into months. I want to put the yearly subtotals at the begining of the spreadsheet. So in cell A1 i want to add AA2-AL2, B1 i want to add AM2-AX2 and so on so forth. How can i do this whithout manually going to each set of values.
Is there anyway i can put a formula in A1 which i can copy to B1,C1,D1,E1, which will pick up a set of 12 cells each (with no overlap)