i am using Visual C# 2010 express and i need the most reliable way (on button click) and in .NET 2.0 framework to detect if windows is currently x86 or x64 in a message box.. up till now i have been using this code but i need to know if there is a more accurate way?
string target = @"C:\Windows\SysWow64";
{
if (Directory.Exists(target))
{
MessageBox.Show("x64");
}
else
{
MessageBox.Show("x86");
}
Is it possible in my RegisterRoutes method in global.asax, to map some routes to an asmx?
Ideally I would like to do something like:
routes.MapPageRoute("ServiceSearchCats", "services/search/cats", "~/Services/Search.asmx/Cats");
(and therefore my endpoint for the service becomes "http://mydomain.com/services/search/cats", instead of the ugly "http://mydomain.com/Services/Search.asmx/Cats" url)
Hello all,
I have a few onclick and on mouseover events in my html generated by PHP, something like this:
<div onmouseover="fave('heart_<?php echo $row['id']; ?>';" class="heart"><a href=""></a></div>
I wish to make use of unbind on the mouseover but it hasn't worked when I tried this:
$('#'+ id).unbind('mouseover');
So I am guessing unbind will only work with events created by JQuery? Is there something else I can try?
Btw, I can't move my events to a separate js file as each id is unique and.
Thanks all
I'm running on an OS X environment and would like to create a flexible web development environment locally... including the option to run on an Nginx server for my PHP-based application.
At the end of the day (or, development cycle), I'd like to be able to hit a switch and have it all sync over to Amazon AWS hosting (EC2, S3) - instances, databases, files, configurations, and all.
Are there any simple ways to do this?
Hi,
I'm working on a symfony 1.4 project which contains a frontend and a backend. I want to know if it's possible to configure a different login action for each module.
I've tried to add a settings.yml file in the config folder of each module but it doesn't work.
Thanks,
Hi! I have an ASP.NET 4.0 website that has an Entity Data Model hooked up to WCF Data Service. When the Service and Model are in the same assembly everything works. Unfortunately, when I move the Model to another "shared" assembly (and change the namespace) the service compiles but throws a 500 error when launched in a browser. The reason I want to have the Model in a common assembly (lets call it RiaTest.Shared) is that I want share common validation code between the client and service (by checking "Reuse types in referenced assemblies" in the Advanced tab of the Add Service Reference dialog).
Anyway, I've spent a couple of hours on this to no avail so any help in the regard would be appreciated...
Hey guys,
The website that I'm building includes a section where two users can interact. I think I know how to do most of it, except the actual session sharing part. I'm using Ruby on Rails & Javascript (jquery), and I've got user login and session management all working okay. Would the best way to create a shared session be to have a SharedSession model, with accompanying database table, with participant1ID, participant2ID etc? Is there a better way? Thanks so much for reading!
Hi,
I'm using WiX to create a windows installer. Unfortunately my installer overwrites a config file on every update.
What I really want is, that the installer only creates the file if it is not found.
Thanks and regards,
forki
We are developing in vb.net using VisualStudio 2008 and a SQL 2005 back end database and are looking for a Report Designer that can be used to build reports and give the User the ability to modify and create reports once the software is sold and in use.
I have two simple models:
class User < ActiveRecord::Base
has_many :tokens
# has_one doesn't work, because Token already stores
# foreign id to user...
# has_one :active_token, :class_name => "Token"
# belongs_to doesn't work because Token belongs to
# User already, and they both can't belong to each other
# belongs_to :active_token, :class_name => "Token"
end
class Token < ActiveRecord::Base
belongs_to :user
end
I want to say "User has_one :active_token, :class_name => 'Token'", but I can't because Token already belongs_to User. What I did instead was just manually add similar functionality to the user like so:
class User < ActiveRecord::Base
has_many :tokens
attr_accessor :active_token
after_create :save_active_token
before_destroy :destroy_active_token
# it belongs_to, but you can't have both belongs_to each other...
def active_token
return nil unless self.active_token_id
@active_token ||= Token.find(self.active_token_id)
end
def active_token=(value)
self.active_token_id = value.id
@active_token = value
end
def save_active_token
self.active_token.user = self
self.active_token.save
end
def destroy_active_token
self.active_token.destroy if self.active_token
end
end
Is there a better way?
In a c++ project I am working on, I have a simple c++ file that needs to run some code at the beginning of the progam execution. This file is linked into a static library, which is then linked into the main program.
I have similar code in other files running fine, that looks something like:
bool ____nonexistant_value = executeAction();
However, it does not work inside this file unless I make use of a function implemented in this file. It does work if the library is compilied as a shared library. I'd prefer to link this statically as the library is only a convience as the file is in a different directory.
So I'm writing a Django based website that allows users select a color scheme through an administration interface.
I already have middleware/context processors that links the current request (based on domain) to the account.
My question is how to dynamically serve the CSS with the account's custom color scheme.
I see two options:
Add a CSS block to the base template that overrides the styles w/variables passed in through a context processors.
Use a custom URL (e.g. "/static/dynamic/css//styles.css") that gets routed to a view that grabs all the necessary values and creates the css file.
I'm content with either option, but was wondering if anyone else out there has dealt with similar problems and could give some insight as to "Best Practices".
I need to support a legacy vb6 application, and would like to add a tab control. Is there an equivalent to visualstudio 2008's tab control? The built-in "TabStrip" control is a pain to use.
What is currently the best way to code a (semi complicated) website that uses html, css, javascript and some server stuff (php?)? Would you code most of it by hand, use a visual editor for certains parts, are there standard quality editors nowadays? How do web developers go about doing this?
How do I get the ASP.NET Controls for Crystal Reports in VisualStudio 2008? I've downloaded and installed a lot of things, but the guidance on the SAP website isn't very helpful to me.
What do I need to download and install on my machine to create an ASP.NET application which surfaces Crystal Reports?
In a c++ project I am working on, I have a simple c++ file that needs to run some code at the beginning of the program execution. This file is linked into a static library, which is then linked into the main program.
I have similar code in other files running fine, that looks something like:
bool ____nonexistent_value = executeAction();
However, it does not work inside this file unless I make use of a function implemented in this file. It does work if the library is compiled as a shared library. I'd prefer to link this statically as the library is only a convenience as the file is in a different directory.
I am working in PHP and I have mamp on my machine. I would like to send emails from my PHP code, like this:
<?php
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
How can I configure a mail server for free on my machine?
hello.
I've already built windows ce 6.0 and run it in windows ce emulator.
but I want to run this without visualstudio 2005.
I found emulator for windows ce 5.0, but I couldn't find emulator for windows ce 6.0.
somebody help me, thanks.
In the monit documentation I can see there is a check directory command but I can't see any examples of how to use it to see if the directory exists and if it doesn't to create the directory using the mkdir command.
I'm thinking to something really similar on what you can do with mod_php: drop an application in some way inside Apache and making it run with Passenger, without adding anything inside httpd.conf (no vhost, nothing except the basic Passenger configuration).
It's something very similar to Wordpress or many other frameworks: just unzip/svn checkout it inside a folder and run it.
I know that it's possible with CGI and FCGI, but I'm wondering if it's also possible to tap in the speed of Passenger.
I've tried fiddling with the Rack instructions on the official website trying to find a specific .htaccess and config.ru configuration, but nothing so far.
I know it's not common, but... is it even possible?
Can anyone tell me how to install the Silverlight 4 beta runtime on a test machine without Visual Studio? I keep getting an error message about the beta version being expired....
Thanks.
$('<a />').attr({
'href': '#'
})
.append(
$('<img />').attr({
'id' : 'img',
'src' : 'edit.png'
}))
.appendTo('body');
Is the the "right way" to go about adding <a href="#"><img src="edit.png" id="img" /></a> to the body?
Also how would I add some css onto the img?