Daily Archives

Articles indexed Wednesday April 7 2010

Page 14/131 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • boost::program_options bug or feature?

    - by Dmitriy
    Very simple example: #include <string> #include <boost/program_options.hpp> namespace po = boost::program_options; int main(int argc, char* argv[]) { po::options_description recipients("Recipient(s)"); recipients.add_options() ("csv", po::value<std::string>(), "" ) ("csv_name", po::value<unsigned>(), "" ) ; po::options_description cmdline_options; cmdline_options.add(recipients); po::variables_map vm; po::store(po::command_line_parser(argc, argv).options(cmdline_options).run(), vm); po::notify(vm); return 0; } And some tests: >Test --csv test in option 'csv_name': invalid option value >Test --csv_name test in option 'csv_name': invalid option value >Test --csv_name 0 >Test --csv text in option 'csv_name': invalid option value >Test --csv 0 >Test --csv_name 0 >Test --csv_name 0 --csv text multiple occurrences Looks like that boost::program_option threats parameter "csv" as "csv_name". Is it a feature or bug?

    Read the article

  • Using nullable types in C#

    - by Martin Brown
    I'm just interested in people's opinions. When using nullable types in C# what is the best practice way to test for null: bool isNull = (i == null); or bool isNull = !i.HasValue; Also when assigning to a non-null type is this: long? i = 1; long j = (long)i; better than: long? i = 1; long j = i.Value;

    Read the article

  • Relative Path To Absolute Path in VB .NET

    - by Mehdi Anis
    Hi, I am writing a VB .NET console app where it spits takes relative path and spits out all file name, or error for invalid input. I am havinf trouble getting PhysicalPath from RelativePath Example: ` 1. I am in folder: C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin\Debug My App SP.exe is also in the same folder I run: "SP.exe ..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin" I run: "SP.exe ..\..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj" I run: "SP.exe ..\..\..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol" ` Currently I am Handling 1 relative path, but not more than one: If Source.IndexOf("..\") = 0 Then Dim Sibling As String = Directory.GetParent(Directory.GetCurrentDirectory()).ToString()()) Source = Source.Replace("..\", Sibling) End If How can I easily handle multiple ..\ easily ? Thanks.

    Read the article

  • Speed Difference between native OLE DB and ADO.NET

    - by weijiajun
    I'm looking for suggestions as well as any benchmarks or observations people have. We are looking to rewrite our data access layer and are trying to decide between native C++ OLEDB or ADO.NET for connecting with databases. Currently we are specifically targeting Oracle which would mean we would use the Oracle OLE DB provider and the ODP.NET. Requirements: 1. All applications will be in managed code so using native C++ OLEDB would require C++/CLI to work (no PInvoke way to slow). 2. Application must work with multiple databases in the future, currently just targeting Oracle specifically. Question: 1. Would it be more performant to use ADO.NET to accomplish this or use native C++ OLE DB wrapped in a Managed C++ interface for managed code to access? Any ideas, or help or places to look on the web would be greatly appreciated.

    Read the article

  • Sharepoint Workflow doesn't trigger after created/edited tickets

    - by Brad Johnson
    I have a workflow created in Sharepoint designer that works fine when manually triggered. I want it to trigger when a new ticket is created and when an existing ticket is edited. I have tried everything, but it makes no sense that it works when manually triggered, but does not appear to trigger when tickets are created/modified. Any help would be appreciated.

    Read the article

  • Ajax & session ids

    - by JavaRocky
    How would you go about knowing that ajax requests are related? Normally with HTTP-HTML requests, cookies would store a md5 hash representing a session id. Is there a similar pattern with AJAX?

    Read the article

  • sending email with gmail smtp with codeigniter email library

    - by bohemian
    class Email extends Controller { function Email() { parent::Controller(); $this->load->library('email'); } function index() { $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_port'] = '465'; $config['smtp_timeout'] = '7'; $config['smtp_user'] = '[email protected]'; $config['smtp_pass'] = '*******'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['mailtype'] = 'text'; // or html $config['validation'] = TRUE; // bool whether to validate email or not $this->email->initialize($config); $this->email->from('[email protected]', 'myname'); $this->email->to('[email protected]'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); $this->email->send(); echo $this->email->print_debugger(); $this->load->view('email_view'); } } I am getting this error A PHP Error was encountered Severity: Warning Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) Filename: libraries/Email.php Line Number: 1641 Using PORT 25/587 I got this error """A PHP Error was encountered Severity: Warning Message: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:func(119):reason(252) Filename: libraries/Email.php Line Number: 1641"""" I dont want to use phpmailer now. (Actually i have tried to use phpmailer,but i falied ) How to solve this problems,guys?

    Read the article

  • SQLAuthority News Milestone of 1300th Post and A Few Updates

    Today is my 1300th blog post and I realize that my blog has been quite running such a long journey. I have been writing for a lengthy time on this tech blog. Today I would like to go back and briefly recall the posts that were part of my blogs history. Read all list of [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Visual Studio Palette Window Background

    - by tsilb
    So Visual Studio has tons of options for fonts and colors; but I can't seem to find the background/foreground colors for certain windows, such as: Solution Explorer Error List Test Results Pending Changes Properties I find it strange I can change Output and Immediate but not these ones. Is there a place to change these settings?

    Read the article

  • Creating Modules for VB Program (Similar to firefox add on)

    - by Assimilater
    Hi all. I have a contact manager program that I'd like to design for multiple network marketing companies. My desired structure would include a core program which covers basic contact management functions. After that one could purchase a module for their specific network marketing company. This module would contain a variety of controls that the original program would need to be able to manipulate. Here is an example of what it would have to have: A group box containing buttons that link to a genealogy view, and the option to import one's donwnline from the back office provided by a company. A panel which is displayed on the contact page allowing the user to input business information or which will be filled by importing a downline from the back office: ie business ID, qualification level, sponsor information etc. a panel displayed when one searches for contacts on the contact list page which allows the user to sort based on information such as when they joined, what their business id is and so forth. a panel which is displayed in a personal business overview page which presents to an individual how many people in their downline are at each qualification level and develop a mailing list for individuals of a certain qualification level. I have the code developed to perform all these functions, I just wanted to give you an example of what needed to be done. I'm thinking that what I'm trying to create is a library that one can download and the program will recognize, but I'm not really sure where to go. What I'm really trying to do is figure out what kind of file I can make that will contain all this code and the GUI information that the program will recognize. Any ideas? With thanks, John

    Read the article

  • Get DLL's directory

    - by user296359
    Hi, I have a question about getting DLL's directory on Windows system. The situation is like this : I have a DLL and an EXE file. The exe file must load the DLL to run. These 2 modules are in different directories. Moreover, the directory of the DLL is changeable. Now I have to get the directory of the DLL in "run time". How could I do this? Thanks in advance.

    Read the article

  • Using Active Objects and BLOBs

    - by Andrew L.
    I am in a group of people who are creating a Defect Tracking program as a project. We have been using Active Objects and have run into some issues. Currently maximum file size for the blob is approx. 2Mb but we want to be able to increase it up to 2Gb. We currently have been looking at many sites and have not been able to find out how to increase the size. We are currently storing the blob as an array of bytes. Our current error says, Packet for Query is too large? We don't know how to set the variable, and we don't know how to set it using AO. We are programming this in Java, too. We are wondering if anyone has a solution to this problem. Thanks for the Help.

    Read the article

  • adding model validation errors in rescue

    - by ash34
    I have the following model with a virtual attribute class Mytimeperiod < ActiveRecord::Base validates presence of :from_dt validates_format_of :from_dt, :with => /\A\d{2}\/\d{2}\/\d{4}\Z/, :message => "format is mm/dd/yyyy" def from_dt self.from_date.strftime("%m/%d/%Y") if !self.from_date.blank? end def from_dt=(from_dt) self.from_date = Date.parse(from_dt) rescue self.errors.add_to_base("invalid from dt") end end I am using <%= f.error_messages %> to display the error messages on the form. I am using from_dt as a virtual attribute (string). The 'presence of' and 'format of' validation errors show up on the form, but when the user enters an invalid date format on the form and Date.Parse raises an exception I have a 'errors.add_to_base' statement in the rescue clause. Can anyone tell me why this error does not show up in the form error messages when I disable the 'format of' validation. thanks.

    Read the article

  • Is There Something Wrong With My Computer Or The Website Server?

    - by thewarspk
    Recently I've been playing one new game which is called THE WARS, it's so fucking interesting that has become the routine work of my life. Yesterday i carelessly downloaded some files with virus, now my computer can't work properly, i just found i couldn't open the game page! Im so mad now, im wondering is there something wrong with my computer or website server, if it's mine, i will find someone to fix my PC, please check out for me...thank you very much, here is the address http://wars.swagblack.com/webgamethewars.aspx

    Read the article

  • subversion problem - commit access

    - by Calvin
    Hi everyone, I'm new to setting up subversion but originally when I made a repository, all my team members could update and commit without problem. There was a problem with it so we decided to recreate it, but now only I can commit changes to it. And my username/password doesn't work on their computers, so I'm sure it's something obvious and silly, but I just don't know enough to know what's causing it. The passwd and svnserve.conf files are the same as the original repository that worked for everyone. Any ideas? Thanks in advance.

    Read the article

  • Creating a method that is simultaneously an instance and class method

    - by Mike Axiak
    In Python, I'd like to be able to create a function that behaves both as a class function and an instance method, but with the ability to change behaviors. The use case for this is for a set of serializable objects and types. As an example: >>> class Thing(object): #... >>> Thing.to_json() 'A' >>> Thing().to_json() 'B' I know that given the definition of classmethod() in funcobject.c in the Python source, this looks like it'd be simple with a C module. Is there a way to do this from within python? Thanks!

    Read the article

  • in C# sharp, how you pronounce 'T?'

    - by plinth
    How do you pronounce 'bool?', 'int?' and their ilk? I've been mulling over options like "nullable of T", "T hook", "T huh", "T what" and "T" with a rising inflection. I'm not particularly satisfied with these as they seem either cumbersome or affected or both.

    Read the article

  • Having an issue with Nullable MySQL columns in SubSonic 3.0 templates

    - by omegawkd
    Looking at this line in the Settings.ttinclude string CheckNullable(Column col){ string result=""; if(col.IsNullable && col.SysType !="byte[]" && col.SysType !="string") result="?"; return result; } It describes how it determines if the column is nullable based on requirements and returns either "" or "?" to the generated code. Now I'm not too familiar with the ? nullable type operator but from what I can see a cast is required. For instance, if I have a nullable integer MySQL column and I generate the code using the default template files it returns a line similar to this: int? _User_ID; When trying to compile the project I get the error: Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?) I checked teh Settings files for the other database types and they all seems to have the same routine. So my question is, is this behaviour expected or is this a bug? I need to solve it one way or the other before I can procede. Thanks for your help.

    Read the article

  • How can I resolve ASP.NET "~" app paths to the website root without a Control being present?

    - by jdk
    I want to Resolve "~/whatever" from inside non-Page contexts such as Global.asax (HttpApplication), HttpModule, HttpHandler, etc. but can only find such Resolution methods specific to Controls (and Page). I think the app should have enough knowledge to be able to map this outside the Page context. No? Or at least it makes sense to me it should be resolvable in other circumstances, wherever the app root is known. Update: The reason being I'm sticking "~" paths in the web.configuration files, and want to resolve them from the aforementioned non-Control scenarios. Update 2: I'm trying to resolve them to the website root such as Control.Resolve(..) URL behaviour, not to a file system path.

    Read the article

  • Designing a class in such a way that it doesn't become a "God object"

    - by devoured elysium
    I'm designing an application that will allow me to draw some functions on a graphic. Each function will be drawn from a set of points that I will pass to this graphic class. There are different kinds of points, all inheriting from a MyPoint class. For some kind of points it will be just printing them on the screen as they are, others can be ignored, others added, so there is some kind of logic associated to them that can get complex. How to actually draw the graphic is not the main issue here. What bothers me is how to make the code logic such that this GraphicMaker class doesn't become the so called God-Object. It would be easy to make something like this: class GraphicMaker { ArrayList<Point> points = new ArrayList<Point>(); public void AddPoint(Point point) { points.add(point); } public void DoDrawing() { foreach (Point point in points) { if (point is PointA) { //some logic here else if (point is PointXYZ) { //...etc } } } } How would you do something like this? I have a feeling the correct way would be to put the drawing logic on each Point object (so each child class from Point would know how to draw itself) but two problems arise: There will be kinds of points that need to know all the other points that exist in the GraphicObject class to know how to draw themselves. I can make a lot of the methods/properties from the Graphic class public, so that all the points have a reference to the Graphic class and can make all their logic as they want, but isn't that a big price to pay for not wanting to have a God class?

    Read the article

  • Get total size of all Shared Folders (Except Admin Shares) from a list of Servers?

    - by bEUY
    Hi there, I'm looking to calculate the total size of all shared folders (except admin shares) on a number of different servers (consolidating all accessed files to a NAS box for easier backup / restore) but am having a bit of trouble finding a solution. I'm certain this could be done in powershell but I just can't find the right information to get me going, I can currently spit out a list of all shares on the servers but am not sure where to go from here: $servers =@( "server1", "server2") foreach($server in $servers) { get-WmiObject Win32_Share -computerName $server -filter "Type = 0" }

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >