I'm writing some Erlang code and I'm very unsure whether I should let everything fail fast. One problem I find with fail fast is that for the developer/user the exception generated is pretty meaningless. Any idea what I should return which would not give esoteric and hard to read stack traces?
I'm trying to setup log rotation in rails. I have put this in my environment/development.rb:
config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 1, 5*1048576)
2 files are created :-) but it looks like rails is writing to them randomly and at the same time as well. This creates messy log files :-( what am I missing?
I want to load a pdf file on the click of a button.
In the OnClickButton() implementation I am writing the function which open the PDF file
ShellExecute(0,
"Open",
"%s\\HELP\\RiverCADPro_User_Manual.pdf",
NULL,
NULL,
SW_MAXIMIZE);
The above code is not working.What else is to be needed so as to run the above code
I've got a situation where an ini file is in memory (in a string variable) and I'd like to read values out of it without writing the ini file data to disk.
Is there any way to do that in VB6? Maybe with a Win API call?
I want some default values in my combo boxes but can't seem to figure out how to do this without writing a module that populates the combo boxes. How can I manually fill in the combo boxes so I don't have to use code to do something so simple.
Thanks
I'm writing an VS 2008 add-in to synchronize Setup project Version with startup project assembly version. It works fine.
But I was wondering if it was possible to call add-in from the Prebuild Event of my setup project.
It works fine by command line window, but I didn't find any syntax to make it work in prebuildEvent. Is Someone has an idea ?
Thanks
I'm writing a program and I have the following problem:
char *tmp;
sprintf (tmp,"%ld",(long)time_stamp_for_file_name);
Could someone explain how much memory allocate for the string tmp.
How many chars are a long variable?
Thank you,
I would appreciate also a link to an exahustive resource on this kind of information.
Thank you
Hey.
I was coding here the other day, writing a couple of if statements with ints that are always either zero or one (~bools), and I asked myself:
Should I use if (int == 1) or if (int != 0) ?
Is there any difference at all?
Please, don't answer with stuff regarding the int may being more/less than 1/0, that's not what I want to know.
I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionary object when the program is run again.
How would I convert a dictionary object into a string that can be written to a file and loaded back into a dictionary object? This will hopefully support dictionaries containing dictionaries.
I am writing a program that can have either a list or a string as an argument. How can I tell the difference between a string and a list programmatically in Erlang. Something like:
print(List) -> list;
print(String) -> string.
During a recent interview I was asked why one would want to create mock objects. My answer went something like, "Take a database--if you're writing test code, you may not want that test hooked up live to the production database where actual operations will be performed."
Judging by response, my answer clearly was not what the interviewer was looking for. What's a better answer?
I've been writing a program in C++ and noticed there is a library in C# that someone else wrote that I would like to link in to my code.... but I'm not sure how to do that. Can someone suggest something? Doubt this matters, but I'm using Windows 7 with MSVC2010.
Thanks in advance!
What are the limits of writing a C# app when you want a truly impressive GUI? At what point does one have to leave Visual C# behind and go into WPF?
Also, if I choose to go with WPF, do I have to ditch the Visual Studio IDE and go with Expression Studio?
I am writing an iPhone App that uses a HTTPS/SOAP service which needs user credentials. After I change the password used for these credentials from a valid to an invalid one I still get a valid response from the service, as if the password was never changed. When I restart the app (with the invalid password) the app immediately receives the expected '401' message.
Any hints what I might left out to code?
Thx :)
Hey, I'm writing a canvas app for facebook. I use the command:
$user_id = $facebook-require_login();
To get the userid, but at the first few pages of my app I don't want to require login, but if the user's logged in, I'd like to know what the userid is. Basically I need a "get_login()" command that perhaps returns 0 or null if the user is not logged in. Is there anything like that?
How does one construct and access a set of key-value pairs in C? To use a silly simple example, let's say I want to create a table which translates between an integer and its square root.
If I were writing javascript, I could just do this:
var squareRoots = {
4: 2,
9: 3,
16: 4,
25: 5
}
and then access them like:
var squareRootOf25 = squareRoots[5]
What's the prettiest way to do this in C? What if I want to use one type of enum as the key and another type of enum as the value?
I have to support Sharepoint on a daily basis but do not have the equivalent of domain access so I'm constantly having to ask the guy in charge of Sharepoint to add me to a new security group to complete my task.
Rather than having to bug him all the time (he is only somewhat technical) it would be easier to simply have the equivalent of domain admin access for Sharepoint (I'm a sys admin and have domain admin access already but this doesn't seem to carry over to FOSS).
What is the equivalent of domain admin access on Sharepoint 2010?
Thanks in advance.
Hey all,
I'm writing a C++ app that will communicate with another process via boost::interprocess, however I need to check if the other process is actually running first - as the other process is responsible for creating the inter-process shared memory. How do I check if the other process is running ?
folks, I'm specifically required to check other processes
This code is compiling clean. But when I run this, it gives exception "Access violation writing location" at line 9.
void reverse(char *word)
{
int len = strlen(word);
len = len-1;
char * temp= word;
int i =0;
while (len >=0)
{
word[i] = temp[len-1]; //line9
++i;--len;
}
word[i] = '\0';
}
I want to write a program to implement an array-based stack, which accept integer numbers entered by the user.the program will then identify any occurrences of a given value from user and remove the repeated values from the stack,(using Java programming language).
I just need your help of writing (removing values method)
e.g.
input:6 2 3 4 3 8
output:6 2 4 8