Search Results

Search found 6524 results on 261 pages for 'the ever kid'.

Page 146/261 | < Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >

  • How can I limit access to a particular class to one caller at a time in a web service?

    - by MusiGenesis
    I have a web service method in which I create a particular type of object, use it for a few seconds, and then dispose it. Because of problems arising from multiple threads creating and using instances of this class at the same time, I need to restrict the method so that only one caller at a time ever has one of these objects. To do this, I am creating a private static object: private static object _lock = new object(); ... and then inside the web service method I do this around the critical code: lock (_lock) { using (DangerousObject do = new DangerousObject()) { do.MakeABigMess(); do.CleanItUp(); } } I'm not sure this is working, though. Do I have this right? Will this code ensure that only one instance of DangerousObject is instantiated and in use at a time?

    Read the article

  • C#: Windows Forms: Getting keystrokes in a panel/picturebox?

    - by Rosarch
    I'm making a level editor for a game using windows forms. The form has several drop down menus, text boxes, etc, where the user can type information. I want to make commands like CTRL + V or CTRL + A available for working within the game world itself, not text manipulation. The game world is represented by a PictureBox contained in a Panel. This event handler isn't ever firing: private System.Windows.Forms.Panel canvas; // ... this.canvas = new System.Windows.Forms.Panel(); // ... this.canvas.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.canvas_PreviewKeyDown); What is the preferred way of doing this? Can a panel even receive keyboard input? I would like to allow the user to use copy/paste/select-all commands when working with the text input, but not when placing objects in the game world.

    Read the article

  • Very Intermittent Orientation on Device & Simulator

    - by Michael Waterfall
    I've noticed that I'm getting very intermittent orientation on my device & the simulator. I have a modal view controller that I present, and that is the only thing in my app which supports rotation. If I launch the app in portrait without moving the device, open the modal VC and then rotate the device, it usually works. However sometimes if I open the app holding the device in landscape, then rotate to portrait, launch the VC and then rotate the device, no rotation occurs. It seems very intermittent. Sometimes if I launch the app in portrait mode and then open the VC and rotate the device, nothing happens, and until I quit and relaunch it no orientation occurs in the app. It's strange because 50% of the time it works! Whenever I launch it through Xcode and set breakpoints in shouldAutorotateToInterfaceOrientation it always works! Anyone ever had this or know what's going on?

    Read the article

  • How do I code a MVC3 Helper

    - by Mike Clarke
    I’ve just build my first Helper in MVC, it’s very basic and just displays a string where ever I use it. So it’s a .cshtml file in my App_Code folder, I think that is how it's supposed to be set up, with the following code in it, @helper DisplaySelect() { @:This text is coming from an helper class. } Now I am a wiz with helpers how do I make it do things. E.g.. say I want it to query the database and display something, I would normally do that work in my controller. How do I do that with helpers, do I create a helper controller and then treat the helper like a partial view??? Any help would be greatly appreciated. Cheers, Mike.

    Read the article

  • Jasper exported to Excel ignoring background color?

    - by discgolfer
    Have you ever had alternating background colors in a Jasper report and then exported it to Excel? The Excel export seems to ignore the alternating color. I've got a Jasper report where the rows alternating background color using the procedure referenced HERE. When I preview it using the viewer or export to PDF it works -- but not when I export to Excel. I've tried using JRXlsExporter and JExcelApiExporter both to no avail. I think it might be a side-effect of how you have to make alternating row colors in Jasper, which I despise to begin with, but have found no other way. Thanks in advance!

    Read the article

  • [change] Vlookup onto another workbook

    - by Arcadian
    Hello, here is my dilemma. I have two worksheets one that has the name of clients and one that i want to copy the names to depending on the city. For instance: associated to each column is last name, first name and city. i have hundreds of names associated to different cities and what i would like is from worksheet1.xls to copy all the New York clients to worksheet2.xls either when i open worksheet2 or via macro what ever is easier and because last name is in one cell and the first name is in the other i would have to copy both. I saw that its possible to link cells from one worksheet to another and then do a vlookup depending on the criteria. Is that the best easiest way or is there another? thanks in advance and cheers oleg

    Read the article

  • Difference between an LL and Recursive Descent parser?

    - by Noldorin
    I've recently being trying to teach myself how parsers (for languages/context-free grammars) work, and most of it seems to be making sense, except for one thing. I'm focusing my attention in particular on LL(k) grammars, for which the two main algorithms seem to be the LL parser (using stack/parse table) and the Recursive Descent parser (simply using recursion). As far as I can see, the recursive descent algorithm works on all LL(k) grammars and possibly more, whereas an LL parser works on all LL(k) grammars. A recursive descent parser is clearly much simpler than an LL parser to implement, however (just as an LL one is simply than an LR one). So my question is, what are the advantages/problems one might encounter when using either of the algorithms? Why might one ever pick LL over recursive descent, given that it works on the same set of grammars and is trickier to implement? Hopefully this question makes some amount of sense. Sorry if it doesn't - I blame my the fact that this entire subject is almost entirely new to me.

    Read the article

  • WCF - WebReferences not working

    - by JMSA
    At the client end, I have generated a Proxy using SvcUtil.exe and it is working fine. Then I have added a WebReference to the client assembly and calling the same method. But it is not working. My program is running in console mode and the method is suppose to return a string. It is not returning the string. I just see a blank console window. No exception is thrown. And after setting a debug point on the method call I see that, program is halted on the method call for ever. What should I look for to solve the problem? I am using VS2005. And adding the webReference by right-clicking the client project and then clicking "Add Web Reference" pop-up menu.

    Read the article

  • populating a list from another worksheet with 1 criteria

    - by Arcadian
    Hello, here is my dilemma. I have two worksheets one that has the name of clients and one that i want to copy the names to depending on the city. For instance: associated to each column is last name, first name and city. i have hundreds of names associated to different cities and what i would like is from worksheet1.xls to copy all the New York clients to worksheet2.xls either when i open worksheet2 or via macro what ever is easier and because last name is in one cell and the first name is in the other i would have to copy both. I saw that its possible to link cells from one worksheet to another and then do a vlookup depending on the criteria. Is that the best easiest way or is there another? thanks in advance and cheers oleg

    Read the article

  • CheckboxList not setting Selected with Viewstate

    - by Earlz
    I have a CheckboxList that seems to load and do everything right, except for when I do a postback, it will not have the Item.Selected property set. I have viewstate disabled for the entire page. I load it like so(inside Page_Load on every load): foreach (DataRow service in d.Tables[0].Rows) { cblServices.Items.Add(new ListItem((string)service["description"], service["id"].ToString())); } My markup is simple: <asp:CheckBoxList runat="server" ID="cblServices" Width="300px"></asp:CheckBoxList> and then, I use basically something like this(in a _Click serverside event for a button) foreach(ListItem item in cblServices.Items){ if(item.Selected){ MyLabel.Text+="selected: "+item.Value+item.Text; } } and MyLabel never has any text added to it. I can verify with the debugger that it does reach the _Click's foreach loop, but no item is ever selected. What could be the cause of this?

    Read the article

  • "org.json.JSONArray implements Serializable": What's the best option to achieve this?

    - by Daxon
    I am using Grails Webflow, what ever object I pass to a view, it must be Serialized. My domain models "implement Serializable", so they work. The problem is when I get a response from a WebService. It is of the org.json.JSONArray class. I just want to pass the whole Array over to the view yet it doesn't implement Serializable, so it fails, Any thoughts on how I can pass this, or my best option? Can I just edit the source of the org.json library and make every class "imp Serializable"? Or process the result into Domain objects that do "imp Serializable"

    Read the article

  • Vim syntax highlighting: make region only match on one line

    - by sixtyfootersdude
    Hello I have defined a custom file type with these lines: syn region SubSubtitle start=+=+ end=+=+ highlight SubSubtitle ctermbg=black ctermfg=DarkGrey syn region Subtitle start=+==+ end=+==+ highlight Subtitle ctermbg=black ctermfg=DarkMagenta syn region Title start=+===+ end=+===+ highlight Title ctermbg=black ctermfg=yellow syn region MasterTitle start=+====+ end=+====+ highlight MasterTitle cterm=bold term=bold ctermbg=black ctermfg=LightBlue I enclose all of my headings in this kind of document like this: ==== Biggest Heading ==== // this will be bold and light blue ===Sub heading === // this will be yellow bla bla bla // this will be normally formatted However right now when ever I use an equals sign in my code it thinks that it is a title. Is there anyway that I can force a match to be only on one line?

    Read the article

  • Access 2003 - Embedded ppt slide or Excel Spreadsheet in a form, how do I communicate?

    - by Justin
    So if I was to take a an access form, and embed either an excel spreadsheet into it, or a powerpoint slide/pres, how would I reference it in VBA code? So I know I have to set the libraries, name the frame of the OLE object, and use applicable syntax to whatever I want to do, with whatever I stick in the form, however the only things I have ever done with excel and/or powerpoint is automate the opening of a seperate window/application from access, not within the access form....so I am not sure?? if I said its a new Excel.Application, then set xls = to (the ss in the file, and not some file path of another excel file somewhere)? does that make sense?

    Read the article

  • RadioButtonList.SelectedIndex vs RadioButtonList.SelectedValue

    - by Pinpin
    Out of curiosity, anyone knows the particulars of the internal implementation of ListControl.SelectedIndex = (int) <new valueIndex> VS ListControl.SelectedValue = <new value>.ToString() I'm having difficulties with a custom validation object we've built here to process all validation in one sweep. I suspect using <SelectedValue = > will raise a SelectedIndexChanged event, even though both the value and index remain the same, both before and after the operation. (The ListControl's values are populated declaratively....) As ever, thank you for your time!

    Read the article

  • VB.net, disable proxy for entire program

    - by Brent
    Ever since upgrading to Visual Studio 2010, I'm running into an issue where the first web request of any type (WebRequest, WebClient, etc.) hangs for about 20 seconds before completing. Subsequent calls work quickly. I've narrowed down the problem to a proxy issue. If I manually disable proxy settings, I don't experience this delay: Dim wrq As WebRequest = WebRequest.Create(Url) wrq.Proxy = Nothing What's strange is that there are no proxy settings enabled on this machine in Internet Options. What I'm wondering is if there is a way to disable proxy settings for my entire project in one shot without explicitly disabling as above for every web object. The main reason I want to be able to do this is that I'm trying to use an API (http://code.google.com/p/google-api-for-dotnet/) which uses web requests, but does not provide any way to manually disable proxy settings. Can anyone point me in the right direction? Thanks!

    Read the article

  • How to get real Integer Overflows in Matlab/Octave

    - by marvin2k
    Hi there. I'm working on a verification-tool for some VHDL-Code in Matlab/Octave. Therefore I need datatypes which generate "real" overflows: intmax('int32') + 1 ans = -2147483648 Lateron, it would be helpfull if i can define the bitwidth of a variable... But that is not so important... When I build a C-like example, where a variable gets increased until it's smaller than zero, it spins forever and ever... test = int32(2^30); while (test > 0) test = test + int32(1); end Another approach i tried was a custom "overflow"-routine which was called everytime after a number is changed. This approach was painfully slow, not practicable and not working in all cases at all...

    Read the article

  • Call up last exception on an ASP.NET error page.

    - by Aren B
    I've got an error page here SiteError.aspx and it's configured correctly in the web.config to go there when unhandled exceptions are encountered. I want to use this page to log the exception that triggered it as well because I only want to LOG the errors that the users encounter (i.e. if SiteError.aspx is ever hit.) This is the code I Have: In the OnLoad(...) in SiteError.aspx Exception lastEx = Context.Server.GetLastError(); if (lastEx != null) log.Error("A site error was encountered", lastEx); However, my log is never showing up in my Output, and If i breakpoint on line 2 (in this example) code execution is never interupted (after letting the exception clear to ASP.NET handling in the debugger.

    Read the article

  • Windows Command Line

    - by Markus O'Reilly
    Does anyone know how to break out of a for loop when it's typed directly into the windows command-line? I know you can use gotos and labels to break out of it when it's in a batch file, but I can't find anything about breaking out of one on the command line. Here's a simple example: C:> for /l %i in (1,0,1) do @ping -n 1 google.com || (echo ^G & msg user "Google is down!" & QUIT) This should infinitely ping google.com. If it ever fails, it beeps (echo ^G), displays a message box to the user "user" that says "Google is down!", and QUITs. I don't know how to do the quit part though. I guess I could do something like taskkill /f /im cmd.exe, but I was looking for something more elegant. Any tips?

    Read the article

  • A very weird problem with texbox control in .net

    - by Kazoom
    Well i know textbox is a very simple user control, perhaps the first input control ever made. I have been facing a very frustrating problem with this simple control. I programatically add a textbox in my user control. From ui i am able to edit it like a normal textbox. however, i am not able to read the user inputed value in the program. my program all the time sees the old value with which my text box was initialized. i textchange event getting triggered but the value never gets updated. This seemingly looks to be some innocuous bug in the code, but the program is very simple and it does not seem to be having any bug. Any guidelines on this issue?

    Read the article

  • Jquery datePicker

    - by Shane
    I have slight issue with the jquery datepicker in that it displays ABOVE the target box. This is due to the way my page is set up. I found the issue with CSS in my page via firebug, unfortunately it conflicts with about 20 elements. Next I tried hooking into the "beforeShow event" which works but then after the event fires it just recalculates and puts it where ever it wants. beforeShow: function() { $('#ui-datepicker-div').show(); var offset = $('#ui-datepicker-div').offset(); $('#ui-datepicker-div').css({ top: (offset.top + 222) + 'px' }) } Does anyone else have any ideas how how I can reposition this? I just need to move it down by about 200 odd pixels.

    Read the article

  • CheckboxList not setting Selected with Viewstate disabled

    - by Earlz
    I have a CheckboxList that seems to load and do everything right, except for when I do a postback, it will not have the Item.Selected property set. I have viewstate disabled for the entire page. I load it like so(inside Page_Load on every load): foreach (DataRow service in d.Tables[0].Rows) { cblServices.Items.Add(new ListItem((string)service["description"], service["id"].ToString())); } My markup is simple: <asp:CheckBoxList runat="server" ID="cblServices" Width="300px"></asp:CheckBoxList> and then, I use basically something like this(in a _Click serverside event for a button) foreach(ListItem item in cblServices.Items){ if(item.Selected){ MyLabel.Text+="selected: "+item.Value+item.Text; } } and MyLabel never has any text added to it. I can verify with the debugger that it does reach the _Click's foreach loop, but no item is ever selected. What could be the cause of this?

    Read the article

  • Java Backgroundworker: Scope of Widget to be updated unclear

    - by erlord
    Hi all, I am trying to understand the mechanism of org.jdesktop.swingx.BackgroundWorker. Their javadoc presents following example: final JLabel label; class MeaningOfLifeFinder implements BackgroundListener { public void doInBackground(BackgroundEvent evt) { String meaningOfLife = findTheMeaningOfLife(); evt.getWorker().publish(meaningOfLife); } public void process(BackgroundEvent evt) { label.setText("" + evt.getData()); } public void done(BackgroundEvent evt) {} public void started(BackgroundEvent evt) {} } (new MeaningOfLifeFinder()).execute(); Apart from the fact that I doubt the result will ever get published, I wonder how label is passed to the process method, where it is being updated. I thought it's scope is limited to the outside of the BackgroudListener implementation. Quite confused I am ... any answers for me? Thanks in advance

    Read the article

  • Why does UIImageView "darken"/saturate PNG images, and can I stop it?

    - by Ben
    I have a PNG file in a UIImageView, and next to that I have an EAGLView which displays the continuation of that same image (long story) as a texture, carved from the same original PNG. The point is, that these images, which should match up flawlessly, actually have somewhat differing color saturation. Normally I'd blame my handling of the PNG texture load in GL, but when I hold Preview (with the PNG) up to the iPhone simulator, it's GL that's spot on, and the UIImageView that's wrong! It's taken the image and made it ever-so-slightly more saturated. The image view is opaque with 100% alpha. I verified this on a clean UIImageView with another PNG file when put next to Preview. Anyone know what's up?

    Read the article

  • How do I add the Disqus comment system to a Rails application in a similar fashion to Wordpress?

    - by Eric Lubow
    In Wordpress, the Disqus plugin allows you to choose to subscribe to a post via RSS or via email. Is there a pluign similar to the Wordpress plugin for Rails. Norman's Disqus plugin just uses the Disqus site to make it work. I was hoping to have things more stored locally. For an example of what I mean, take a look at this blog entry. I already know that since Rails (this application in particular) is using Authlogic (plus Facebook Connect), that Disqus cannot be too tightly coupled with the Authentication system. Has anyone ever done this or figured out a way to do this?

    Read the article

  • Getting consecutive version numbers from Hibernate's @Version usage once per transaction

    - by Cheradenine
    We use Hibernate with the following version definition for optimistic locking et. al: <version name="version" access="field" column="VERSION" type="long" unsaved-value="negative"/> This is fine and dandy; however, there is one small problem, which is that the first version for some entities is '0', and for others, it is '1'. Why this is happening, is that for some object graphs, an entity will be subject to both onSave and flushDirty - this is reasonable, such as if two object are circular dependencies. However, the version number gets incremented on both occasions, leading to the above '0' / '1' discrepancy. I'd really like the version number only to ever increment once per transaction. However, I can't see a simple way to do this in the hibernate versioning implementation, without hacking about with an Interceptor (which was how I generated a column value for version before, but I wanted hibernate to do it itself)..

    Read the article

< Previous Page | 142 143 144 145 146 147 148 149 150 151 152 153  | Next Page >