Daily Archives

Articles indexed Monday April 12 2010

Page 6/116 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Why do properties behave this way?

    - by acidzombie24
    from http://csharpindepth.com/Articles/Chapter8/PropertiesMatter.aspx using System; struct MutableStruct { public int Value { get; set; } public void SetValue(int newValue) { Value = newValue; } } class MutableStructHolder { public MutableStruct Field; public MutableStruct Property { get; set; } } class Test { static void Main(string[] args) { MutableStructHolder holder = new MutableStructHolder(); // Affects the value of holder.Field holder.Field.SetValue(10); // Retrieves holder.Property as a copy and changes the copy holder.Property.SetValue(10); Console.WriteLine(holder.Field.Value); Console.WriteLine(holder.Property.Value); } } 1) Why is a copy (of Property?) being made? 2) When changing the code to holder.Field.value and holder.Property.value = 10 i get the error below. That just blew my mind Error 1 Cannot modify the return value of 'MutableStructHolder.Property' because it is not a variable Why would i ever not be allowed to assign a value inside of a property!?! both property are get/set! and finally WHY would you EVER want behavior mentioned in 1 and 2. (It never came up for me, i always used get only properties). Please explain well, i cant imagine ever wanting the 2nd much less then the first. It is just so weird to me.

    Read the article

  • Can't access VirtualBox host-only network from windows host

    - by Markus Orreilly
    I've got two vms running on a windows host, each with a host-only network and ips in the 192.168.56.XXX range. One of them is running apache and serving some content that I want to access from my windows host. However, the windows host can't access the apache server at all. The server is running on 192.168.56.103. ipconfig from windows says it's ip for the Virtual Box interface is 169.254.143.37. I tried route add to route 192.168.56.XX traffic, but everything I tried didn't work and I was probably using it wrong. Any ideas on how to make this work?

    Read the article

  • How can I stop new Command Prompt windows spawned by another program from covering my foreground win

    - by Chris W. Rea
    Under Windows 7 x64, when I'm ripping CDs with Exact Audio Copy, it spawns a Command Prompt window each time it invokes the external MP3 compression program I use, LAME. While that's going on, I usually like to surf the web. However, I find it quite annoying that even when Firefox has the foreground, the Command Prompt windows spawned by EAC are coming up in the foreground, on top of my Firefox window. Is there a way to make those new Command Prompt windows spawn in the background? Alternatively, is there a way to make the current active window stay in the foreground / on top while I'm using it?

    Read the article

  • Atenção: Oracle Embedded - 14/Abr/10 (é já esta semana!)

    - by Paulo Folgado
    Atenção, é já esta semana, na próxima 4ª feira dia 14/Abr, que terá lugar o evento dedicado a soluções para sistemas Embedded. A Oracle oferece hoje a gama mais completa do mercado em tecnologias embedded, tanto para ISVs como para fabricantes de dispositivos e equipamentos, proporcionando-lhe a escolha dos produtos de base de dados e middleware embeddable que melhor se ajustem aos seus requisitos técnicos.Segundo a IDC, a Oracle é hoje o líder mundial no mercado das bases de dados embedded com uma quota de mercado de 28,2% em 2008, estando a crescer a um ritmo muito superior ao seu concorrente mais próximo e à media do mercado.Clique aqui para saber mais sobre este evento.

    Read the article

  • How to make Resig's micro-templates XHTML compliant?

    - by mshelv
    Hello, I have been experimenting with John Resig's micro-template, which works great. However, the mark-up will not pass the XHTML 1.0 Transitional validation test. (Among other things, id attributes yield errors.) Replacing tags identifiers <, with [[,]], passes validation. Thus, I created a js script which at load time (jQuery document ready) converts the square brackets back to regular markers. This works fine in FF, but not in IE, Chrome, etc. Scripts embedded within CDATA tags validate as well. Question: Is there a way to insert micro-template in a script and still pass XHTML validation? My idea was to remove the CDATA tags once the page has been loaded. But there are probably smarter ways. (Note: I'd prefer not to inject HTML via js since the mark-up will be difficult to maintain.) PS: I looked at other js templates, but they are either not XHTML compliant or too bulky. TIA for any hints.

    Read the article

  • Set value in controller using nested resource

    - by vectran
    I have two models, product and order. Product - cost - id Order - cost - product_id Each time someone places an order, it captures the product_id through a radio button value in the "new order" form. In the controller when creating the new order it needs to set order.cost to order.product.cost. Logically I thought the code should be something like this: def create ... @order.cost == @order.product.cost ... end However I can't seem to make it work at all, hence me asking the question here. Any help is answering (or naming) the question would be greatly appreciated.

    Read the article

  • jQuery form wizard - named anchor links

    - by Jackson
    Hi Team, Using: http://home.aland.net/sundman/ to split a complex form in to 4 steps. As well as as the 'next, back and submit' form buttons, I have created a menu above the form: step 1, step 2, step 3, step 4 linking to the hash tags #: #, #1, #2, #3 so the visitor can decide which step they want to view / edit. This works fine in firefox, but in IE and Chrome it does not seem to work. Anyone have experience with hte jQuery history plugin that can tell me the best way to accomplish this? I would like to link to the form but it is in a password protected area and subject to our NDA. If need be I could try and replicate the issue with a form on our server and link here. Thanks, Jack

    Read the article

  • Vista - Profile not Loaded Correctly (Cannot Access Registry)

    - by Geoff
    Every so often, I log on and get the Following Message: User profile was not loaded correctly. You have been logged on with a temporary profile. Changes you make to this profile will be lost when you log off. Please see the event log for details or contact your administrator This almost always happens when somebody else has been on the computer for a while, and then I log on. This never used to happen, but now it happens pretty often. My profile is not permanently corrupted, all I have to do is restart my computer, but this annoys me, and I would like to fix it. I was curios about the reason of this cause, so I looked into the Event Log, and found the root of the problem was the ntuser.dat file in the profile that I was logging on to was locked at logon time. This resulted in the current users registry not being loaded, resulting in failure to load the profile. What could be locking this file? is there any way to get a process list without logging on so that I can identify which process has the file locked? Any other suggestions. Hopefully I can find a solution.

    Read the article

  • What is the kernel module "hid_microsoft"?

    - by Masi
    The lsmod-command shows the odd module. The command "modprobe -a hid_microsoft" does not reveal anything. What is it? $ modinfo hid_microsoft filename: /lib/modules/2.6.28-15-generic/kernel/drivers/hid/hid-microsoft.ko license: GPL srcversion: 3FE2E2F2EE89174E885204A alias: hid:b0005v0000045Ep00000701 alias: hid:b0003v0000045Ep0000009D alias: hid:b0003v0000045Ep00000713 alias: hid:b0003v0000045Ep000000F9 alias: hid:b0003v0000045Ep000000DB alias: hid:b0003v0000045Ep0000003B depends: vermagic: 2.6.28-15-generic SMP mod_unload modversions 586

    Read the article

  • How to change the wallpaper in Windows 7 Starter Edition

    - by V. Schreiber
    Is there a way to change the desktop wallpaper in Windows 7 Starter Edition? I wanted to do that on my new netbook, just to find out that there is no "Customize" option in the control panel. Microsoft obviously wants to keep the netbook users rather rigidly from customizing their machines. It isn't even possible to edit the picture itself in the C:\Windows\Web\Wallpaper\Windows\ directory, due to lack of rights. From what I can tell only the user "Trusted Installer" would have enough rights to do so... Update: With your help I found two programs that are able to bypass Microsoft's limitations: Starter Wallpaper Changer (Thanks to Sopan and javier. I'm using this program now) Wallpaper Changer for Windows 7 (Thanks to Sathya)

    Read the article

  • Tablet as Car Computer

    - by Austin Fitzpatrick
    Okay, so forward this off to the right place if this isn't the right place to ask this question. I want to use a tablet computer as a car-computer. Minimum features would be to run my music (through iPod, Pandora, whatever I want) and GPS Navigation, watch TV or movies while I'm parked waiting for people, and the hard one: it needs to answer my phone calls with a pleasant interface much like in-dash systems do. It needs to detect that my phone is ringing in my pocket and provide an on-screen answer/ignore and then route the audio through the cars speakers. It would be nice to dial out and have address book access, but that is somewhat secondary. I have an iPhone myself and I figured that an iPad with 3G might make a good system for this - but I'm open to other options if an iPad can't do everything I need. I'm willing to write code, and I'm willing to jailbreak one or both devices. I haven't done much work in Obj-C, but I'm not opposed to learning a new language for this project. It's self enrichment for the most part, as I'm sure I can buy an indash entertainment system for less. Does anyone have experience with the iPhone/iPad SDK that can tell me whether or not it would be possible to get it an iPad to answer my calls in the car? What about an Android tablet? (that Adam looks promising, too).

    Read the article

  • What was your most useful/inspiring computer science course?

    - by MPelletier
    I'm currently taking one course per semester, remotely, in a short 5 year program. My aim is to get better at my trade (programming and analysis, not surprisingly). However, I find that I'm not inspired by my choice of classes for next semester. Maybe I'm being too judgmental. I'd like to know what positive experience was gained from a course in particular. Have ou had a course that turned out to be an idea catalyst?

    Read the article

  • How does assembly language interact with something like the Internet?

    - by Maulrus
    So I was thinking about languages the other day, and it struck me that any program written in a compiled language that interacts with the Internet is then translated into assembly that has to interact with the Internet. I've just begun learning a bit of x86 assembly to help me understand C++ a bit better, and I'm baffled by how something so low-level could do something like access the Internet. I'm sure the full answer to this question is much more than would fit in a SO answer, but could somebody give me maybe a basic summary?

    Read the article

  • MS SQL SELECT stored procedure according to combobox.selectedvalue

    - by Jay
    Hello, In order to fill a datagridview according to the selectedvalue of a combobox I've tried creating a stored procedure. However, as I'm not 100% sure what I'm doing it, depending on the WHERE statement at the end of my stored procedure, either returns everything within the table or nothing at all. This is what's in my class: Public Function GetAankoopDetails(ByRef DisplayMember As String, ByRef ValueMember As String) As DataTable DisplayMember = "AankoopDetailsID" ValueMember = "AankoopDetailsID" If DS.Tables.Count > 0 Then DS.Tables.Remove(DT) End If DT = DAC.ExecuteDataTable(My.Resources.S_AankoopDetails, _Result, _ DAC.Parameter(Const_AankoopID, AankoopID), _ DAC.Parameter("@ReturnValue", 0)) DS.Tables.Add(DT) Return DT End Function Public Function GetAankoopDetails() As DataTable If DS.Tables.Count > 0 Then DS.Tables.Remove(DT) End If DT = DAC.ExecuteDataTable(My.Resources.S_AankoopDetails, _Result, _ DAC.Parameter(Const_AankoopID, AankoopID), _ DAC.Parameter("@ReturnValue", 0)) DS.Tables.Add(DT) Return DT End Function This is the function in the code behind the form I've written in order to fill the datagridview: Private Sub GridAankoopDetails_Fill() Try Me.Cursor = Cursors.WaitCursor dgvAankoopDetails.DataSource = Nothing _clsAankoopDetails.AankoopDetailsID = cboKeuze.SelectedValue dgvAankoopDetails.DataSource = _clsAankoopDetails.GetAankoopDetails Catch ex As Exception MessageBox.Show("An error occurred while trying to fill the data grid: " & ex.Message, "Oops!", MessageBoxButtons.OK) Finally Me.Cursor = Cursors.Default End Try End Sub And finally, this is my stored procedure: (do note that I'm not sure what I'm doing here) USE [Budget] GO /****** Object: StoredProcedure [dbo].[S_AankoopDetails] Script Date: 04/12/2010 03:10:52 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[S_AankoopDetails] ( @AankoopID int, @ReturnValue int output ) AS declare @Value int set @Value =@@rowcount if @Value = 0 begin SELECT dbo.tblAankoopDetails.AankoopDetailsID, dbo.tblAankoopDetails.AankoopID, dbo.tblAankoopDetails.ArtikelID, dbo.tblAankoopDetails.Aantal, dbo.tblAankoopDetails.Prijs, dbo.tblAankoopDetails.Korting, dbo.tblAankoopDetails.SoortKorting, dbo.tblAankoopDetails.UitgavenDeelGroepID FROM dbo.tblAankoopDetails INNER JOIN dbo.tblAankoop ON dbo.tblAankoopDetails.AankoopID = dbo.tblAankoop.AankoopID INNER JOIN dbo.tblArtikel ON dbo.tblAankoopDetails.ArtikelID = dbo.tblArtikel.ArtikelID INNER JOIN dbo.tblUitgavenDeelGroep ON dbo.tblAankoopDetails.UitgavenDeelGroepID = dbo.tblUitgavenDeelGroep.UitgavenDeelGroepID WHERE dbo.tblAankoopDetails.Deleted = 0 and dbo.tblAankoopDetails.AankoopID = @AankoopID ORDER BY AankoopID if @@rowcount >0 begin set @ReturnValue=999 end else begin set @ReturnValue=997 end end if @Value >0 begin --Dit wil zeggen dat ik een gebruiker wil ingeven die reeds bestaat. (998) set @ReturnValue=998 end Does anyone know what I'm need to do to resolve this? Kind regards, Jay

    Read the article

  • Zend + Pop Up's balloons on Server Problem

    - by LookUp Webmaster
    Dear Friends from Stackoverflow, Please help me with a problem that i'm having when uploading my project to the server. I'm using pop up's balloons (http://mckay.cshl.edu/balloons.html) for a project using Zend FW and it works fine on my localhost. (I'm using MAMP on MacOSX) but when I upload the webpage to the server, the text inside the balloons is displayed but the images that form the balloon are not, so somehow the js does not recognize the url to the images (the path it's correct, i've checked several times). The server is an Ubuntu 9.04 virtual machine from rackspace.com, running a LAMP server. I'm using the REWRITE function in Apache, so i guess maybe that's the problem. The rewrite configuration is set up using a .htaccess file with the following content: SetEnv APPLICATION_ENV development Options +FollowSymlinks RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !.(js|ico|txt|gif|jpg|png|css|html)$ index.php Does anyone knows what the problem might be? Best Regards,

    Read the article

  • UIAccelerometer Detecting angle Problem

    - by mactalent
    Hello All, How to detect the iPhone angle? I mean that when iPhone is straight (i.e) HomeButton is in bottom part, so how to detect 90 Degree from UIAccelerometer Method. CGFloat RadiansToDegrees(CGFloat radians) {return radians * 180/M_PI;}; i try RadiansToDegrees(atan2(acceleration.y, acceleration.x)) but it gives -90 degree angle any helpwould be appreciated.

    Read the article

  • How can I capture Rake output when invoked from with a Ruby script?

    - by Adrian O'Connor
    I am writing a web-based dev-console for Rails development. In one of my controller actions, I am calling Rake, but I am unable to capture any of the output that Rake generates. For example, here is some sample code, from the controller: require 'rake' require 'rake/rdoctask' require 'rake/testtask' require 'tasks/rails' require 'stringio' ... def show_routes @results = capture_stdout { Rake.tasks['routes'].invoke } # @results is nil -- the capture_stdout doesn't catpure anything that Rake generates end def capture_stdout s = StringIO.new $stdout = s yield s.string ensure $stdout = STDOUT end Does anybody know why I can't capture the Rake output? I've tried going through the Rake source, and I can't see where it fires a new process or anything, so I think I ought to be able to do this. Many thanks! Adrian I have since discovered the correct way to call Rake from inside Ruby that works much better: Rake.application['db:migrate:redo'].reenable Rake.application['db:migrate:redo'].invoke Strangely, some rake tasks work perfectly now (routes), some capture the output the first time the run and after that are always blank (db:migrate:redo) and some don't seem to ever capture output (test). Odd.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >