Search Results

Search found 3093 results on 124 pages for 'weng lock mok'.

Page 8/124 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Naming Convention for Dedicated Thread Locking objects

    - by Chris Sinclair
    A relatively minor question, but I haven't been able to find official documentation or even blog opinion/discussions on it. Simply put: when I have a private object whose sole purpose is to serve for private lock, what do I name that object? class MyClass { private object LockingObject = new object(); void DoSomething() { lock(LockingObject) { //do something } } } What should we name LockingObject here? Also consider not just the name of the variable but how it looks in-code when locking. I've seen various examples, but seemingly no solid go-to advice: Plenty of usages of SyncRoot (and variations such as _syncRoot). Code Sample: lock(SyncRoot), lock(_syncRoot) This appears to be influenced by VB's equivalent SyncLock statement, the SyncRoot property that exists on some of the ICollection classes and part of some kind of SyncRoot design pattern (which arguably is a bad idea) Being in a C# context, not sure if I'd want to have a VBish naming. Even worse, in VB naming the variable the same as the keyword. Not sure if this would be a source of confusion or not. thisLock and lockThis from the MSDN articles: C# lock Statement, VB SyncLock Statement Code Sample: lock(thisLock), lock(lockThis) Not sure if these were named minimally purely for the example or not Kind of weird if we're using this within a static class/method. Several usages of PadLock (of varying casing) Code Sample: lock(PadLock), lock(padlock) Not bad, but my only beef is it unsurprisingly invokes the image of a physical "padlock" which I tend to not associate with the abstract threading concept. Naming the lock based on what it's intending to lock Code Sample: lock(messagesLock), lock(DictionaryLock), lock(commandQueueLock) In the VB SyncRoot MSDN page example, it has a simpleMessageList example with a private messagesLock object I don't think it's a good idea to name the lock against the type you're locking around ("DictionaryLock") as that's an implementation detail that may change. I prefer naming around the concept/object you're locking ("messagesLock" or "commandQueueLock") Interestingly, I very rarely see this naming convention for locking objects in code samples online or on StackOverflow. Question: What's your opinion generally about naming private locking objects? Recently, I've started naming them ThreadLock (so kinda like option 3), but I'm finding myself questioning that name. I'm frequently using this locking pattern (in the code sample provided above) throughout my applications so I thought it might make sense to get a more professional opinion/discussion about a solid naming convention for them. Thanks!

    Read the article

  • LibreOffice Writer Error due to a lock file

    - by Brad
    Every time I try to open a word document I get this error. LibreOffice 3.5 Either another instance of LibreOffice is accessing your personal settings or your personal settings are locked. Simultaneous access can lead to inconsistencies in your personal settings. Before continuing, you should make sure user "closes LibreOffice on host". Do you want to continue? I've been onto different forums to find out a remedy but nothing yet. I've recently done a fresh install of 12.04 (64bit) and have been having some issues with different programs and have been able to work through most of them but this one, I'm lost.

    Read the article

  • ubuntu cant be installed as it says GPU lock

    - by piyush bhardwaj
    i have win 7 running on my system i just wanna move to ubuntu 12.10 desktop version 36 bit but when i try to install the CD gets loaded start screen comes but suddenly texts line appears and screen goes black the text are - [189.463934] [drm] [noveau] 0000:02:00.0: GPU LOCK- switching to software fbcon [194.248014] [drm] [noveau] 0000:02:00.0: failed to idle channel 1 [199.504009] [drm] [noveau] 0000:02:00.0: failed to idle channel 3 and it goes on.....like this iam new to the linux system so dnt know much abt it ..so if any body can help me to solve my prblm.. my laptop is of HCL and it has 3 gb ram or 350 gb hard disk with nvidia graphic card ..it has 2 ghz pentium dual core it was manufactured in 2009.. so if any body can help i would be greatful and can be able to join ubuntu..

    Read the article

  • How to make xlock use the first key I hit as a part of my password

    - by alesplin
    I just switched from Arch Linux to Ubuntu 10.10. I'm running the Fluxbox window manager, and I use xlockmore to lock my screen with the following key shortcut: 192 :Exec xlock-mode marquee +usefirst -icongeometry 240x240 -message "back in a minute..." The problem I'm having is that xlock is definitely not using my first key as part of my password. Instead, it uses some randomized fade pattern to fade to the password screen. I find this highly annoying, as when I get back to my desk and start entering my password it doesn't register password characters until the fade pattern is complete. I've also tried the following modifications with no difference: 192 :Exec xlock -mode marquee -usefirst -icongeometry 240x240 -message "back in a minute..." 192 :Exec xlock -mode marquee -icongeometry 240x240 -message "back in a minute..." The first example worked flawlessly on Arch. Does Ubuntu have some sort of system default that you can't override on the command-line?

    Read the article

  • How to Lock Down IE 10 by Disabling Flash in Windows 8

    - by Taylor Gibb
    Microsoft now includes Flash along with their Internet Explorer browser in Windows 8. Flash has been known as a big culprit when it comes to security vulnerabilities in the past, so here’s how to disable it. Note: We have outlined two methods for achieving the same goal, there is no need to do both. HTG Explains: What Is RSS and How Can I Benefit From Using It? HTG Explains: Why You Only Have to Wipe a Disk Once to Erase It HTG Explains: Learn How Websites Are Tracking You Online

    Read the article

  • Give permissions for packages downloaded from the internet and lock them in Ubuntu 12.04 sidebar

    - by JuninhoDG
    I downloaded NetBeans IDE and Eclipse IDE from the internet and installed then. Well, the Eclipse IDE works fine, but when I execute NetBeans IDE directly from the link, without sudo permission, it shows me lots of error telling that some files are read only. This does not happens when I'm using the terminal to call the .sh script with sudo permissions. Another thing that bothers me: How can I fix my shortcuts in the Ubuntu's 12.04 sidebar? I want to combine a launcher with enough permissions to do everything it's needing and fix it in my sidebar. Is it possible?

    Read the article

  • Problem trying to lock framerate at 60 FPS

    - by shad0w
    I've written a simple class to limit the framerate of my current project. But it does not work as it should. Here is the code: void FpsCounter::Process() { deltaTime = static_cast<double>(frameTimer.GetMsecs()); waitTime = 1000.0/fpsLimit - deltaTime; frameTimer.Reset(); if(waitTime <= 0) { std::cout << "error, waittime: " << waitTime << std::endl; } else { SDL_Delay(static_cast<Uint32>(waitTime)); } if(deltaTime == 0) { currFps = -1; } else { currFps = 1000/deltaTime; } std::cout << "--Timings--" << std::endl; std::cout << "Delta: \t" << deltaTime << std::endl; std::cout << "Delay: \t" << waitTime << std::endl; std::cout << "FPS: \t" << currFps << std::endl; std::cout << "-- --" << std::endl; } Timer::Timer() { startMsecs = 0; } Timer::~Timer() { // TODO Auto-generated destructor stub } void Timer::Start() { started = true; paused = false; Reset(); } void Timer::Pause() { if(started && !paused) { paused = true; pausedMsecs = SDL_GetTicks() - startMsecs; } } void Timer::Resume() { if(paused) { paused = false; startMsecs = SDL_GetTicks() - pausedMsecs; pausedMsecs = 0; } } int Timer::GetMsecs() { if(started) { if(paused) { return pausedMsecs; } else { return SDL_GetTicks() - startMsecs; } } return 0; } void Timer::Reset() { startMsecs = SDL_GetTicks(); } The "FpsCounter::Process()" Method is called everytime at the end of my gameloop. I've got the problem that the loop is correctly delayed only every second frame, so it runs one frame delayed at 60 FPS and the next without delay at over 1000 fps. I am searching the error quite a while now, but I do not find it. I hope somebody can point me in the right direction.

    Read the article

  • If I use locks, can my algorithm still be lock-free?

    - by Joe Pension
    A common definition of lock-free is that at least one process makes progress. 1 If I have a simple data structure such as a queue, protected by a lock, then one process can always make progress, as one process can acquire the lock, do what it wants, and release it. So does it meet the definition of lock-free? 1 See eg M. Herlihy, V. Luchangco, and M. Moir. Obstruction-free synchronization: Double-ended queues as an example. In Distributed Computing, 2003. "It is lock-free if it ensures only that some thread always makes progress".

    Read the article

  • Lock screen elements frozen on desktop

    - by user286968
    I have finally made the switch from Windows to Ubuntu and now have to ask the first question because search did not help me this time. (Please help me in a newb-friendly way) The problem is easily described: The elements shown in the lockscreen on boot (ubuntu logo in the middle and watermark in bottom left corner) stay there even when I'm entering desktop. How can I remove them again? They haven't been there in the first place, but after updating Ubuntu with Update Center, the problem occured. As I cant post an image here with my reputation, pls see this link: http://s30.postimg.org/age8fraww/Screenshot_from_2014_05_30_23_27_58.jpg Thanks for your help and time. Kind regards

    Read the article

  • Dual Monitor Lock Screen Problem

    - by Justin Carver
    Ubuntu 12.04 Nvidia GTX 550-Ti x-swat Nvidia driver Problem: Using 2 monitors. When screen locks there is a blue box on top of the wallpaper and password dialog box that hides the field for entering your password or switching users. Problem is on 2 systems with similar hardware (Nvidia card, x-swat driver, dual monitors) You can still type your password in blindly and hit enter to login but it's irritating to not be able to see the dialog box.

    Read the article

  • How do I prevent the Sleep button from locking the screen

    - by elmicha
    My keyboard has a Sleep button. I defined a shortcut in System Settings, Keyboard Shortcuts own settings (or similar), so that the Sleep buttons runs a script. That works. But since my upgrade to Oneiric, something also locks the screen (in the same way the screen is locked when I press Ctrl+Alt+L). Can I disable that behaviour? What's the name of that lock screen? I tried hiding gnome-screensaver and /etc/acpi/ and I looked in gconf-editor /apps/gnome-power-manager/buttons. I didn't find anything related in dconf-editor.

    Read the article

  • Nautilus (File) 3.10.1 how to lock drag and drop bookmarks

    - by Davide Marchi
    From the new Nautilus releases exist the ability to create shortcut/bookmarks simply by drag&drop folder onto the nautilus left panel; However, this behavior can unintentionally create additional bookmarks if you are not very accurate when dragging files to bookmarks, especially by people with little experience in the use of computer. How is possible to disable the drag&drop bookmarks creation? Or ideally should be planning to implement the drag & drop mode only if you are running in conjunction with the press of a key on the keyboard ..

    Read the article

  • Is there a way to lock a branch in GIT

    - by Senthil A Kumar
    I have an idea of locking a repository from users pushing files into it by having a lock script in the GIT update hook since the push can only recognize the userid as arguments and not the branches. So i can lock the entire repo which is just locking a directory. Is there a way to lock a specific branch in GIT? Or is there a way an Update Hook can identify from which branch the user is pushing and to which branch the code is pushed?

    Read the article

  • Subversion lock-modify-unlock solution for SSIS .dtsx

    - by EasyDot
    Hello! I wonder how i could set up a developer enviroment for SSIS,.dtsx packages in Subversion? I read about Subversion "svn:needs-lock" property and the ability to set auto-props in a subversion repository by setting "enable-auto-props = yes" in the repository config file. The "svn:needs-lock" property is neccesary when working with SSIS,dtsx to handle the files like binary files wich must be locked to avoid mergingconflicts. How should i configure Subversion config file for this kind of development? An example for setting auto-prop svn:needs-lock to .doc files (I think its working?!): [miscellany] enable-auto-props = yes [auto-props] *.doc = svn:mime-type=application/msword;svn:needs-lock=*

    Read the article

  • Does IsolatedStorageFileStream.Lock work under SIlverlight4?

    - by Noah
    Silverlight uses an IsolatedStorageFileStream to open files. The IsolatedStorageFileStreamunder NET.4 claims to support the Lock Method (Inherited from FileStream) The following code IsolatedStorageFile isf; IsolatedStorageFileStream lockStream = new IsolatedStorageFileStream( "my.lck", FileMode.OpenOrCreate, isf ); lockStream.Lock( 0, 0 ); generates the following error, wrapped for readability, under VS2010 and Silverlight 4 'System.IO.IsolatedStorage.IsolatedStorageFileStream' does not contain a definition for 'Lock' and no extension method 'Lock' accepting a first argument of type 'System.IO.IsolatedStorage.IsolatedStorageFileStream' could be found (are you missing a using directive or an assembly reference?)

    Read the article

  • How to set android lock screen image

    - by robintw
    Hi, I'm just getting started with android programming, and want to see if there is a way to programmatically set the lock screen image. I've found various ways of setting the wallpaper in the API, but I can't seem to find the equivalent ways of setting the lock screen image. I've seen various posts saying that customising the lock screen by adding widgets or bits of applications is not possible, but surely there must be a way to set the image programmatically? Cheers, Robin

    Read the article

  • Keycodes of function keys with F-lock off?

    - by ak
    Many recent keyboard from Microsoft and Logitech have a so-called F-Lock key, which toggles the function keys F1 to F12 between their traditional keycodes and new meanings that are printed onto the keys: F1=Help F2=Undo F3=Redo F4=Open ... . (See also http://en.wikipedia.org/wiki/F-Lock.) This means that long-established shortcuts such as Alt+F4 no longer work if the F-lock is off, and googling shows that quite a few people are unhappy about this. So I'm wondering, what virtual key (VK) codes do the function keys send when F-lock is off? VK_F13 to VK_F24 perhaps? Or do they not trigger standard keyboard events at all? (I haven't got such a keyboard to try and find out myself, and didn't manage to dig up anything on MSDN about this.)

    Read the article

  • Distributed Lock Service over MySql/GigaSpaces/Netapp

    - by ripper234
    Disclaimer: I already asked this question, but without the deployment requirement. I got an answer that got 3 upvotes, and when I edited the question to include the deployment requirement the answer then became irrelevant. The reason I'm resubmitting is because SO considers the original question 'answered', even though I got no meaningful upvoted answer. I opened a uservoice submission about this problem. The reason I reposted is so StackOverflow consider the original question answered, so it doesn't show up on the 'unanswered questions' tab. Which distributed lock service would you use? Requirements are: A mutual exclusion (lock) that can be seen from different processes/machines lock...release semantics Automatic lock release after a certain timeout - if lock holder dies, it will automatically be freed after X seconds Java implementation Easy deployment - must not require complicated deployment beyond either Netapp, MySql or GigaSpaces. Must play well with those products (especially GigaSpaces - this is why TerraCotta was ruled out). Nice to have: .Net implementation If it's free: Deadlock detection / mitigation I'm not interested in answers like "it can be done over a database", or "it can be done over JavaSpaces" - I know. Relevant answers should only contain a ready, out-of-the-box, proven implementation.

    Read the article

  • SQL Server Compact timed out waiting for a lock

    - by jankhana
    Hi all, I'm having an application in that i use Sql Compact 3.5 with VS2008. I'm running multiple threads in my application which contacts the compact database and accesses the row. It selects and deletes those rows in a fashion i.e selecting and giving to the application 5 rows and deleting those rows from the table. It works great with a single thread but if i use multiple threads i.e if 3 or more threads are running I get very often the TimeOut Error!!! I have increased the Time out property in the connection string but it didn't give me expected result. The error log is as follow: SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 5,Thread id = 4204,Process id = 4808,Table name = XXX,Conflict type = x lock (s blocks),Resource = TAB ] The Query that I use to retrieve is as follows: " select Top(5) * from TableName order by id; delete from TableName where id in(select top(5) id from TableName order by id); " Is there any way by which we can avoid this Time Out exception??????? The above query I un as a transaction in VS2008 one using SQLCECommand and the other using SqlCEDataAdapter. Any Idea!!!!!! Reply

    Read the article

  • What might cause ruby to lock up while exiting?

    - by user30997
    I have a ruby script that does a few perforce operations (through the scripting API) then simply ends: def foo() ... end def bar() ... end foo() bar() puts __LINE__ exit 0 #end of file ...and while the LINE will print out, the process never ends, whether the exit(0) is there or not. This is ruby 1.8.6, primarily on the mac, but I'm seeing this on the PC as well. I'm doing the usual google poking around, but hoped there might be a voice of experience here to bank on. Thanks.

    Read the article

  • SVN propset svn:needs-lock on local directory

    - by Oded
    Hi, I want to set the svn:needs-lock property on a local directory, and then to commit it. I want to do it from the command line and it seems to not letting me. my command is: svn propset svn:needs-lock '*' d:\src_svn\Multilizer the answer I get is: svn: Cannot set 'svn:needs-lock' on a directory ('D:\src_svn\Multilizer') what can be the problem? thank you.

    Read the article

  • Obtain Update Table Lock at start of Stored Procedure in SQL Server

    - by Jim Hurne
    I'm writing a SQL Server stored procedure in which I want to lock a table for update before executing the body of the stored procedure. I don't want to prevent other processes from reading the table, but I do want to prevent other processes updating the table. Here is my first attempt: CREATE PROCEDURE someProcedure BEGIN SET TRANSACTION ISOLATION LEVEL READ COMITTED BEGIN TRANSANCTION SELECT COUNT(*) FROM TheTable WITH (UPDLOCK, TABLOCK) -- Pause procedure so that we can view the locks with sp_lock WAITFOR DELAY '00:15' -- Do stuff COMMIT END When I execute the stored procedure, and invoke sp_lock, I see that the table is indeed locked. However, it's locked with an Exclusive lock instead of an update lock: spid | dbid | ObjId | IndId | Type | Resource | Mode | Status ------------------------------------------------------------------ 63 | 10 | 233208031 | 0 | TAB | | X | GRANT How can I get an update (U) lock instead?

    Read the article

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