I would like to know how we are supposed to do integration between different perforce servers/depots.
I'm looking for a solution that would allow us to do both-ways integrations.
Currently I found some information on Using Remote Depots article where they say how to map the remote depot as read only.
Is there the only solution to do mappings on both servers? - this means that I could not use a single branch spec to do both ways integrations.
Here is the situation
I create a instance of a class
$newobj = new classname1;
Then I have another class writtern below and I want to this class to access the object above
class newclass {
public function test() {
echo $newobj->display();
}
}
It is not allowed, is there a way define a variable globally through a class?
I have Ubuntu running in VMware Player. I am able to access an Apache instance on this VM by using the IP address but not by machine name.
How do I make the name of the VM visible to the host?
Edit: How do I add the machine name to my DNS? I am running within a Windows network.
I have a server that is only SSH-accessible to machines within a network and my only access to that network from the outside world is a single publicly-SSH-accessible node. Is there some way that I can mount the nested machine from the outside?
Me - Public SSH-accessible Node - Internal SSH-accessible Machine
Thanks!
Hi,
I'm interested in developing web application and networking application. For that what
is the best script language to learn. Which one is effective for this two. So for, i don't
know even a single syntax of any scripting language. Which is the best script for
understanding, maintainable, effective and simple (may not).
Please don't say what are all you know. Please tell me the best
Currently working on a multi-tenant application that employs Shared DB/Shared Schema approach. IOW, we enforce tenant data segregation by defining a TenantID column on all tables. By convention, all SQL reads/writes must include a Where TenantID = '?' clause. Not an ideal solution, but hindsight is 20/20.
Anyway, since virtually every page/workflow in our app must display tenant specific data, I made the (poor) decision at the project's outset to employ a Singleton to encapsulate the current user credentials (i.e. TenantID and UserID). My thinking at the time was that I didn't want to add a TenantID parameter to each and every method signature in my Data layer.
Here's what the basic pseudo-code looks like:
public class UserIdentity
{
public UserIdentity(int tenantID, int userID)
{
TenantID = tenantID;
UserID = userID;
}
public int TenantID { get; private set; }
public int UserID { get; private set; }
}
public class AuthenticationModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.AuthenticateRequest +=
new EventHandler(context_AuthenticateRequest);
}
private void context_AuthenticateRequest(object sender, EventArgs e)
{
var userIdentity = _authenticationService.AuthenticateUser(sender);
if (userIdentity == null)
{
//authentication failed, so redirect to login page, etc
}
else
{
//put the userIdentity into the HttpContext object so that
//its only valid for the lifetime of a single request
HttpContext.Current.Items["UserIdentity"] = userIdentity;
}
}
}
public static class CurrentUser
{
public static UserIdentity Instance
{
get { return HttpContext.Current.Items["UserIdentity"]; }
}
}
public class WidgetRepository: IWidgetRepository{
public IEnumerable<Widget> ListWidgets(){
var tenantId = CurrentUser.Instance.TenantID;
//call sproc with tenantId parameter
}
}
As you can see, there are several code smells here. This is a singleton, so it's already not unit test friendly. On top of that you have a very tight-coupling between CurrentUser and the HttpContext object. By extension, this also means that I have a reference to System.Web in my Data layer (shudder).
I want to pay down some technical debt this sprint by getting rid of this singleton for the reasons mentioned above. I have a few thoughts on what an better implementation might be, but if anyone has any guidance or lessons learned they could share, I would be much obliged.
If you're working with an Asynchronous server socket in C#, what is the proper backlog to put on the socket? For instance:
server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint iep = new IPEndPoint(IPAddress.Any, port);
server.Bind(iep);
server.Listen(10);
The Java manual says:
The locks held on a particular file by a single Java virtual machine do not overlap. The overlaps method may be used to test whether a candidate lock range overlaps an existing lock.
I guess that if I lock a file in a tomcat web application I can't be sure that every call to this application is done by a different JVM, can I? So how can I lock files within my tomcat application in a reliable way?
Yes, I'm being lazy.
What happens when I call performSelector:onThread:... and pass in a thread that's currently blocked (on synchronous I/O, for instance)? Does the selector just get queued to be executed later?
Does asynchronous call always create a new thread?
Example:
If Javascript is single threaded then how can it do an async postback? Is it actually blocking until it gets a callback? If so, is this really an async call?
I'm getting this error in CodeIgniter when trying to load the email library:
Can't use method return value in write context
It's happening on line 827 of Loader.php in [codeigniter root]/system/libraries/Loader.php
include_once($filepath);
where $filepath equals "/var/www/system/libraries/Email.php"
I called it like this in another php file:
$this->load->library('email');
where $this is the CodeIgniter instance.
According to the CodeIgniter email doc page, I'm doing it right. But it's not working...
When setting up a new ASP.NET MVC Web Application, the default connection string inside Web.Config is something like this:
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
I'm just wanting to play around with logging in and registering, etc but when I run the app it obviously can't find a SQL database. What database with what tables do I need to setup to do this?
I have SQL Server 2005 Standard installed on my system, is that enough?
Thanks.
I'm trying to figure out how to use sprintf to print at least two decimal places and no leading zeros. For instance
input:
23
23.0
23.5
23.55
23.555
23.0000
output:
23.00
23.00
23.50
23.55
23.555
23.00
any formatting help would be appreciated
I have a client who is wanting to create a link which contains product codes so that his customers hit a page with just those products displayed in an attempt to increase conversion rates from affilliate sites.
My question is whats the best way to send these multiple products in a single URL
For example:
http://www.mydomain.co.uk/bespoke-list.php?catNo=234-324-232-343
Obviously then the site would grab the codes from the string and display them...
We're going to be using PHP!
Thanks in advance.
I have a WPF UI Bound to a collection of AwesomeClass
Now, AwesomeClass has a collection of AwesomeParts objects.
How can I make my UI In such a way that (as an example)
for each AwesomeClass instance, there is a Tab on a tab panel
and then for each awesome part in that, there is an object on a listbox, on that tab.
Basically: Awesomes-Tabs
And Then : Awesome.Awesomeparts-Tabs.Listbox
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
I've got a dropdown box with some items in it that are more popular than others, and I'd like those to have a different background colour (say, Color.AliceBlue) when the combobox is expanded. I see BackColor but is there a way to apply background colour to just a single item?
This probably is one of the easiest questions ever in C programming language...
I have the following code:
typedef struct node
{
int data;
struct node * after;
struct node * before;
}node;
struct node head = {10,&head,&head};
Is there a way I can make head to be *head [make it a pointer] and still have the availability to use '{ }' [{10,&head,&head}] to declare an instance of head?
I'd like to have a version control server (preferably SVN) accessible on the internet without having to host my own (linux) server. Setting up a home server ala DynDNS is not really an option.
Can you have non-public (maybe single-user) projects on one of the OSS project hosting sites? Or are there alternatives?
I had a look at Google Code. But that looked very public to me.
Any help would be greatly appreciated :-)
Is it guaranteed that False == 0 and True == 1, in Python? For instance, is it in any way guaranteed that the following code will always produce the same results, whatever the version of Python (existing and in the foreseeable future)?
0 == False # True
1 == True # True
['zero', 'one'][False] # is 'zero'
Any reference to the official documentation would be much appreciated! Other comments would be appreciated too… :)
Stack overflow
I want to make a universal version of my app available, but I am wondering how is data managed between the iPad and the iPhone versions?
-Are they completely independent? or if I have a plist in the iPad app, does it also appear in the iPhone app. If so, is there any syncing etc etc.
I have a few months experience with single iPad or iPhone apps, but never a universal.
Thanks again.
I have two text files, I want to place a text in the middle of another, I did some research and found information about adding single strings:
I have a comment in the second text file called STUFFGOESHERE, so I tried:
sed '/^STUFFGOESHERE/a file1.txt' file2.txt
sed: 1: "/^STUFFGOESHERE/a long.txt": command a expects \ followed by text
So I tried something different, trying to place the contents of the text based on a given line, but no luck.
Any ideas?
Hello,
I am wondering when to use static methods? Say If i have a class with a few getters and setters, a method or two, and i want those methods only to be invokable on an instance object of the class. Does this mean i should use a static method?
e.g
Obj x = new Obj();
x.someMethod
or
Obj.someMethod
(is this the static way?)
I'm rather confused!