Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 95/604 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • Why isn't the reference counter in boost::shared_ptr volatile?

    - by Johann Gerell
    In the boost::shared_ptr destructor, this is done: if(--*pn == 0) { boost::checked_delete(px); delete pn; } where pn is a pointer to the reference counter, which is typedefed as shared_ptr::count_type -> detail::atomic_count -> long I would have expected the long to be volatile long, given threaded usage and the non-atomic 0-check-and-deletion in the shared_ptr destructor above. Why isn't it volatile?

    Read the article

  • How to resolve 'cannot pass parameter by reference' error in PHP?

    - by kush.impetus
    Here's my code: UploadTime) VALUES (?,?,?,?)'); $stmt->bind_param('isss', $caseno, $index.'.'.$extension, date('Y-m-d H:i:s'), date('Y-m-d H:i:s')); I have tried this also: $stmt = $conn->mysqli->prepare('INSERT INTO photos (CaseNo, ImageName, CaptureTime, UploadTime) VALUES (?,?,?,?)'); $captureTime = date('Y-m-d H:i:s'); $uploadTime = date('Y-m-d H:i:s'); $stmt->bind_param('isss', $caseno, $index.'.'.$extension, $captureTime, $uploadTime); I am getting the error: Fatal error:** Cannot pass parameter 3 by reference in **...file path...line # Please note that CaptureTime and UploadeTime have datatype date. And ignore the fact that I am passing the value of 3rd and 4th parameter same. What's wrong with the code?

    Read the article

  • implicit argument passing of super from method defined by define_method() is not supported. Specify

    - by jaycode
    Most of you should already know Pragmatic book's "Agile web dev with rails" (third edition). On page 537 - 541 it has "Custom Form Builders" code as follows: class TaggedBuilder < ActionView::Helpers::FormBuilder # <p> # <label for="product_description">Description</label><br/> # <%= form.text_area 'description' %> #</p> def self.create_tagged_field(method_name) define_method(method_name) do |label, *args| @template.content_tag("p" , @template.content_tag("label" , label.to_s.humanize, :for => "#{@object_name}_#{label}") + "<br/>" + super) end end field_helpers.each do |name| create_tagged_field(name) end end This code doesn't work with Ruby 1.9.1. It returns error as follows: implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly. (ActionView::TemplateError) My question is: What should I change in the code to fix this? Thank you

    Read the article

  • How can the DataView object reference not be set?

    - by dboarman-FissureStudios
    I have the following sample where the SourceData class would represent a DataView resulting from an Sql query: class MainClass { private static SourceData Source; private static DataView View; private static DataView Destination; public static void Main (string[] args) { Source = new SourceData(); View = new DataView(Source.Table); Destination = new DataView(); Source.AddRowData("Table1", 100); Source.AddRowData("Table2", 1500); Source.AddRowData("Table3", 1300324); Source.AddRowData("Table4", 1122494); Source.AddRowData("Table5", 132545); Console.WriteLine(String.Format("Data View Records: {0}", View.Count)); foreach(DataRowView drvRow in View) { Console.WriteLine(String.Format("Source {0} has {1} records.", drvRow["table"], drvRow["records"])); DataRowView newRow = Destination.AddNew(); newRow["table"] = drvRow["table"]; newRow["records"] = drvRow["records"]; } Console.WriteLine(); Console.WriteLine(String.Format("Destination View Records: {0}", Destination.Count)); foreach(DataRowView drvRow in Destination) { Console.WriteLine(String.Format("Destination {0} has {1} records.", drvRow["table"], drvRow["records"])); } } } class SourceData { public DataTable Table { get{return dataTable;} } private DataTable dataTable; public SourceData() { dataTable = new DataTable("TestTable"); dataTable.Columns.Add("table", typeof(string)); dataTable.Columns.Add("records", typeof(int)); } public void AddRowData(string tableName, int tableRows) { dataTable.Rows.Add(tableName, tableRows); } } My output is: Data View Records: 5 Source Table1 has 100 records. Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object at System.Data.DataView.AddNew () [0x0003e] in /usr/src/packages/BUILD/mono-2.4.2.3 /mcs/class/System.Data/System.Data/DataView.cs:344 at DataViewTest.MainClass.Main (System.String[] args) [0x000e8] in /home/david/Projects/DataViewTest/SourceData.cs:29 I did some reading here: DataView:AddNew Method... ...and it would appear that I am doing this the right way. How come I am getting the Object reference not set?

    Read the article

  • object reference is not set to an instance of an object in sharepoint while deploying the webpart us

    - by girish
    Hello, i m new to sharepoint and i m trying to create one webpart (hello word) in visual studio 2008 using sharepoint extension... solution is successfully build but it gives me error as soon as i start deploy it.... I have specified the Sharepoint site url in the Project solution property.... Can u please give me suggession for this why i m getting the error...Object Reference not set to an instance of an object.

    Read the article

  • ASP.NET - Add Reference of GAC is not possible ?

    - by csharpbaby
    I am new to ASP.NET having some basic doubts. 1) The public assemblies are deployed in GAC.Even when i go for "Add Reference ", I can not point to c:\windows\assembly ( i hope it is not possible) .Still i need to refer the assembly from ..\Bin folder of the source project ( custom assembly).Is there any consideration behind it? 2 ) Why exe is not allowed in GAC ?

    Read the article

  • ASP.NET Web Service - Passing a base object with list/collection?

    - by schooner
    We need to create a simple web service in ASP.NET that can be called from PHP or other languages. This in turn will be used to update records in a database for an item submission. The core part is fairly simple, we have a base set of fields for the object - first name, last name, birth date, city, etc. In addition however we need to accept a list of items associated with that object that can range from 0-n. Jan 1 2009, ABC May 1 2010, 123 Jun 30 2010, XXXXX What would be the best way to structure this so it can be easily passed to the ASP.NET web service and processed as a single call for the entire object? Would passing the list of items as a single delimted string be a wise approach? Ex: Jan 1 2009, ABC|May 1 2010, 123|Jun 30 2010, XXXXX

    Read the article

  • autocomplete attribute is not passing XHTML 1.0 Transitional validation, why?

    - by rsturim
    I'm trying to cleanup my xhtml validation -- I'm running my pages through the W3C validator. For some puzzling reason it's not passing on input fields with the autocomplete="off" attribute: <input name="kwsearch" id="sli_search_1" type="text" autocomplete="off" onfocus="if(this.defaultValue==this.value) this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" class="searchbox" value="Search" /> I'm using this doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> And this is the validation error: Line 410, Column 81: there is no attribute "autocomplete" …li_search_1" type="text" autocomplete="off" onfocus="if(this.defaultValue==thi… I thought this was okay with the W3C -- but, maybe it's still in "submission" phase? http://www.w3.org/Submission/web-forms2/#autocomplete Thoughts?

    Read the article

  • Adding a reference to a css file in an ascx file in vs2008 only to get intellisense

    - by Nick Allen - Tungle139
    Normally visual studio brings up intellisense for available css classes, which it draws from css files linked to the current aspx/master document. Is there a way to get this to work in an ascx file in a similar way to referencing external JavaScript files in js files for the purpose of intellisense /// <reference path="jquery-1.4.1.js" /> I only want this for the purpose of intellisense and not getting squiggly lines under un-recognised classes. My css files will be actually linked from the aspx/master page.

    Read the article

  • is there difference between debug and release reference path while compiling?

    - by Nair
    I am building a SL3 + RIA application in VS2008. When compiled the application in debug mode it compiles fine with out any error, but when I compile the same application with out any code change in release mode I get an error 'The type of namespace name 'BusyIndicator' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference). All the errors are coming from the generated code name.g.cs Just curious anyone run into this problem.

    Read the article

  • Django: Setting up database code tables (aka reference tables, domain tables)?

    - by User
    Often times applications will need some database code tables (aka reference tables or domain tables or lookup tables). Suppose I have a model class called Status with a field called name that could hold values like: Canceled Pending InProgress Complete Where and at what point would I setup these values in Django? Its like a one time operation to setup these values in the database. Infrequently, these values could be added to.

    Read the article

  • How to get a reference to a control in the view?

    - by Kevin
    If I have a UIScrollView set up in the view via the Interface Builder, how do I get a reference to it in the ViewController implementation? I want to programmatically add labels to the scroll view. For example, in C# if you have a textbox declared in the UI/form, you can access it by simply using the ID declared for that textbox. It doesn't seem this simple in objective c. Thanks Kevin

    Read the article

  • c# ref keyword... Am i passing my value correctly?

    - by Pandiya Chendur
    Is this a valid value for this c# class default constructor, public class SMSCOMMS { public SMSCOMMS(ref string COMMPORT) { SMSPort = new SerialPort(); SMSPort.PortName = COMMPORT; SMSPort.BaudRate = 9600; SMSPort.Parity = Parity.None; SMSPort.DataBits = 8; SMSPort.StopBits = StopBits.One; SMSPort.Handshake = Handshake.RequestToSend; SMSPort.DtrEnable = true; SMSPort.RtsEnable = true; SMSPort.NewLine = System.Environment.NewLine; ReadThread = new Thread( new System.Threading.ThreadStart(ReadPort)); } and i am passing this value, SMSCOMMS SMSEngine = new SMSCOMMS("COM6"); but it doesn't seem to take "COM6" as a valid ref string... Any suggestion..

    Read the article

  • Is it safe to put reference to current user in User model in Rails?

    - by Art Shayderov
    You know, I think I have to check current user in the model callbacks (like before_update). Rather than rely solely on adding where ('something.user_id = ?', 'current_user.id') in the controllers. I need something like Thread.CurrentPrincipal in .NET Is it safe to put reference to current user in User model? I'm sorry I don't really understand how it works under the hood yet. Or how you do it The Rails way? Sorry if this a silly question.

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >