Search Results

Search found 3987 results on 160 pages for 'captain obvious'.

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

  • Clipping the caret in a C# program

    - by Bob Sammers
    I'm creating a WinForms control in C# (using VS2008, .net 3.5) which allows text input. I've imported the necessary Win32 API functions from User32.dll for displaying the normal Windows caret and these are all working fine, but it's not displaying exactly how I'd like it. Text is displayed on the control with a blank border and I use Graphics.SetClip() to leave this margin clear. I want the caret to be clipped to the same region, but since I don't paint it and there's no obvious API function to set a clipping region, I can't see any way of doing this. Have I missed anything obvious? The caret is clipped inside the control in which it is drawn. I'm therefore aware that one solution could be to place the text in a separate sub-control with no border. However, if there's a simpler way than redesigning this part of the control, I'd like to look for that first. Thanks in advance for any help!

    Read the article

  • Remove .net ContextMenuStrip Padding

    - by Frosty840
    Hi, When creating a ContextMenuStrip, there is a huge amount of padding around the contained controls. For example: Me.myMenu = New ContextMenuStrip 'unset all obvious padding settings' Me.myMenu.ShowCheckMargin = False Me.myMenu.ShowImageMargin = False Me.myMenu.Margin = New System.Windows.Forms.Padding(0) Me.myMenu.Padding = New System.Windows.Forms.Padding(0) Dim addButton As New Button addButton.Size = New Size(60, 60) addButton.Text = "Button" Dim addControlHost As New ToolStripControlHost(addButton) Me.myMenu.Items.Add(addcontrolhost) Me.ContextMenuStrip = Me.myMenu This, ideally, would cause a 60x60 button to pop up at the cursor location. What actually pops up is this: The button is there, as expected, but despite there being no margin, no padding, and having set both Show*Margin settings to False, there is a massive border around the Button. I'm probably missing something blindingly obvious, but how can I get rid of all the white bordering, especially that huge right-hand margin?

    Read the article

  • jquery scrollTo refuses to work

    - by hasan
    hey, ive read all the scrollTo questions and couldnt find the answer. im trying to use the scrollTo plugin for a simple horizontal scroll (the site is horizontally designed). im using the following code $(document).ready(function() { $('#contactlink').click(function(){ $.scrollTo("#conta", {duration: 8000 }); }); }); as is obvious, contactlink is the anchor link while conta is the anchor where the window should scroll to. i know im missing something very obvious, but as im a beginner with jquery, id appreciate all the help i can get. is there any way to debug the functioning of the plugin? thanks

    Read the article

  • Drawbacks with reading and writing a big file to or from disk at once instead of small chunks?

    - by Johann Gerell
    I work mainly on Windows and Windows CE based systems, where CreateFile, ReadFile and WriteFile are the work horses, no matter if I'm in native Win32 land or in managed .Net land. I have so far never had any obvious problem writing or reading big files in one chunk, as opposed to looping until several smaller chunks are processed. I usually delegate the IO work to a background thread that notifies me when it's done. But looking at file IO tutorials or "textbook examples", I often find the "loop with small chunks" used without any explanation of why it's used instead of the more obvious (I dare to say!) "do it all at once". Are there any drawbacks to the way I do that I haven't understood?

    Read the article

  • jQuery UI blind effect - reveal from bottom

    - by ronnie burns
    This could be really obvious and I'm completely missing it. I've searched for hours and can't seem to find a way to, using jQuery, reveal a hidden div from the bottom up. What I am trying to achieve is exactly as in the following link, but in reverse: http://jqueryui.com/demos/show/ I can slide a div from the bottom to the top, but this reveals itself as it moves, rather than being 'masked' in. Like I said, this could (should?) be really obvious and I'm not seeing it, but I've been looking for ages and can't find a solution to this relatively simple problem. Thanks, Ronnie

    Read the article

  • Password reset by email without a database table

    - by jpatokal
    The normal flow for resetting a user's password by mail is this: Generate a random string and store it in a database table Email string to user User clicks on link containing string String is validated against database; if it matches, user's pw is reset However, maintaining a table and expiring old strings etc seems like a bit of an unnecessary hassle. Are there any obvious flaws in this alternative approach? Generate a MD5 hash of the user's existing password Email hash string to user User clicks on link containing string String is validated by hashing existing pw again; if it matches, user's pw is reset Note that the user's password is already stored in a hashed and salted form, and I'm just hashing it once more to get a unique but repeatable string. And yes, there is one obvious "flaw": the reset link thus generated will not expire until the user changes their password (clicks the link). I don't really see why this would be a problem though -- if the mailbox is compromised, the user is screwed anyway.

    Read the article

  • Cost to GC of using weak references in C#?

    - by Scott Bilas
    In another question, Stephen C says: A second concern is that there are runtime overheads with using weak references. The obvious costs are those of creating weak references and calling get on them. A less obvious cost is that significant extra work needs to be done each time the GC runs. So what exactly is the cost to the GC of a weak ref? What extra work does it need to do, and how big of a deal is it? I can make some educated guesses, but am interested in the actual mechanics.

    Read the article

  • How to Programmatically Identify a PI Font (a Dingbat) under OS X

    - by Glenn Howes
    There is a class of fonts called Pi fonts whose glyphs, under OS X, get mapped to the private Unicode space 0xF021-0xF0FF such that if you subtract 0xF000 from each unicode character to retrieve the 8-bit version of the character and be able to draw that character as if it were a standard Roman character. My question is how do I recognize these fonts? It's obvious the system can do so because there is a category on the Special Characters palette called "Pi Fonts" which apparently has the various such fonts installed on my system. In my case they are BookshelSymbolSeven, MSReferenceSpeciality, MT-Extras, Marlett, MonotypeSorts, Webdings, and various Wingdings. If I use the old fashioned QuickDraw routines to ask for the TextEncoding of these fonts, I get a value of 0x20000 which I do not see in the system header file TextCommon.h. Am I supposed to treat any font with a TextEncoding of 0x20000 as a Pi Font? And I'd rather not use any QuickDraw font handling routines for obvious reasons.

    Read the article

  • Using sizeof operator on a typedef-ed struct

    - by sskanitk
    This might be something too obvious. However, I couldn't find the specific answer though many stackoverflow threads talk about different aspects of this. typedef struct _tmp { unsigned int a; unsigned int b; } tmp; int main() { int c=10; if (c <= sizeof tmp) { printf("less\n"); } else { printf("more\n"); } return 0; } I compile this prog as - g++ -lstdc++ a.cpp I get an error - expected primary-expression before ‘)’ token I think I am missing something very obvious and straightforward. But can't seem to pinpoint it :-/ Thanks!

    Read the article

  • customising serialisation of java collections using xstream

    - by Will Goring
    I have an object that needs to be serialised as XML, which contains the following field: List<String> tags = new List<String>(); XStream serialises it just fine (after some aliases) like this: <tags> <string>tagOne</string> <string>tagTwo</string> <string>tagThree</string> <string>tagFour</string> </tags> That's OK as far as it goes, but I'd like to be able to rename the <string> elements to, say, <tag>. I can't see an obvious way to do that from the alias documentation on the XStream site. Am I missing something obvious?

    Read the article

  • Replace repeating character with array elements in PHP

    - by Will Croft
    I hope this is blindingly obvious: I'm looking for the fastest way to replace a repeating element in a string with the elements in a given array, e.g. for SQL queries and parameter replacement. $query = "SELECT * FROM a WHERE b = ? AND c = ?"; $params = array('bee', 'see'); Here I would like to replace the instances of ? with the corresponding ordered array elements, as so: SELECT * FROM a WHERE b = 'bee' and c = 'see' I see that this might be done using preg_replace_callback, but is this the fastest way or am I missing something obvious?

    Read the article

  • Service Broker not working after database restore

    - by roryok
    Have a working Service Broker set up on a server, we're in the process of moving to a new server but I can't seem to get Service Broker set up on the new box. Have done the obvious (to me) things like Enabling Broker on the DB, dropping the route, services, contract, queues and even message type and re adding them, setting ALTER QUEUE with STATUS ON SELECT * FROM sys.service_queues gives me a list of the queues, including my own two, which show as activation_enabled, receive_enabled etc. Needless to say the queues aren't working. When I drop messages into them nothing goes in and nothing comes out. Any ideas? I'm sure there's something really obvious I've missed...

    Read the article

  • respond_to? and protected methods

    - by mlomnicki
    It may not be so obvious how respond_to? works in ruby. Consider that: class A def public_method end protected def protected_method end private def private_method end end obj = A.new obj.respond_to?(:public_method) # true - that's pretty obvious obj.respond_to?(:private_method) # false - as expected obj.respond_to?(:protected_method) # true - WTF? So if 'obj' responds to protected_method we should expect obj.protected_method not to raise an exception, shouldn't we? ...but it raises obviously Documentation points that calling respond_to? with 2nd argument set to true check private method as well obj.respond_to?(:private_method, true) # true And that's far more reasonable So the question is how to check if object responds to public method only? Is there a solution better than that? obj.methods.include?(:public_method) # true obj.methods.include?(:protected_method) # false

    Read the article

  • conditional while loop in php?

    - by julio
    I'm pretty sure there's an obvious answer for this-- hoping someone can help me-- I need to do a PHP while loop, but only if a variable is true. And I can't really put the while loop in an "if" statement, which seems like the obvious thing to do, since the code block is huge and it would be ugly and confusing. Do I need to break out the code in the loop into a function, or is there an easier way to deal with this? Here's the basic idea: if(condition){ while(another_condition){ //huge block of code loops many times } } else { // huge block of code runs once } I want the huge block of code to execute regardless of the state of the condition variable-- but only to execute once if condition is false, and execute for as long as another_condition is true if condition is true. Hope that's clear! The following code doesn't work, but gives an idea of what I want to accomplish: if(condition){ while(another_condition){ } // huge block of code if (condition){ } } // closes the while loop-- obviously throws an error though! thanks in advance.

    Read the article

  • Deeper function profiling/emulation

    - by Syntax_Error
    Hello everyone Merry Christmas I need an advice I have the following code: int main() { int k=5000000; int p; int sum=0; for (p=0;p<k;p++) { sum+=p; } return 0; } When I assemble it I get main: pushl %ebp movl %esp, %ebp subl $16, %esp movl $5000000, -4(%ebp) movl $0, -12(%ebp) movl $0, -8(%ebp) jmp .L2 .L3: movl -8(%ebp), %eax addl %eax, -12(%ebp) addl $1, -8(%ebp) .L2: movl -8(%ebp), %eax cmpl -4(%ebp), %eax jl .L3 movl $0, %eax leave ret If I run it through gprof I get that main executed the most, which is quite obvious! Yet I want to go a step further and be able to know if L2, or L3 executed the most. here it is obvious that L3 executed the most. yet is there some kind of profiler, emulator that can give me that data for an entire code?

    Read the article

  • Controlling new features in Spring/Apache tomcat

    - by HeretoLearn
    Is there a good way to manage roll out of new software in Spring/Tomcat configuration. The problem I am trying to address is being able to rollback newly deployed software provided there are no hard dependencies on other moving pieces. For example changed the guts of an algorithm and now want to deploy the new software with the new change off by default and then turning it on on one of the web servers. An obvious way is to build a session object which has a map of key-value pairs(property,bool) which is populated from a db on a session startup and then the value is persisted for that session. This is so that if the value is reverted back existing sessions which started with the original value retain the original value and giving application consistency. Is there a more obvious inbuilt mechanism to do this?

    Read the article

  • Efficient mapping for a particular finite integer set

    - by R..
    I'm looking for a small, fast (in both directions) bijective mapping between the following list of integers and a subset of the range 0-127: 0x200C, 0x200D, 0x200E, 0x200F, 0x2013, 0x2014, 0x2015, 0x2017, 0x2018, 0x2019, 0x201A, 0x201C, 0x201D, 0x201E, 0x2020, 0x2021, 0x2022, 0x2026, 0x2030, 0x2039, 0x203A, 0x20AA, 0x20AB, 0x20AC, 0x20AF, 0x2116, 0x2122 One obvious solution is: y = x>>2 & 0x40 | x & 0x3f; x = 0x2000 | y<<2 & 0x100 | y & 0x3f; Edit: I was missing some of the values, particularly 0x20Ax, which don't work with the above. Another obvious solution is a lookup table, but without making it unnecessarily large, a lookup table would require some bit rearrangement anyway and I suspect the whole task can be better accomplished with simple bit rearrangement. For the curious, those magic numbers are the only "large" Unicode codepoints that appear in legacy ISO-8859 and Windows codepages.

    Read the article

  • Why does my computer run slowly and freeze sometimes?

    - by Brae
    EDIT I disabled sound in the BIOS, rebooted and it hung. I removed the (previously) faulty HDD, rebooted and it hung. I have managed to get my Realtek audio manager open again after its mysterious disappearance. Subsequently my microphone is now working again, to fix it I had to uninstall audio drivers, disable audio in BIOS, install audio drivers, enable audio in BIOS. Access via network (with faulty HDD in) seems to not be triggering hangs at the moment. I think with the sound problem fixed it might play a little nicer, but I think its still going to hang. If it does, then I'm fairly sure its been narrowed down to the mobo. EDIT Pretty convinced my motherboard is the culprit, because nothing else seems to have any obvious problems (bar the hard drive, which the PC still hangs without it being plugged in) So thank you all for helping, once I get more rep ill up a few of the answers. My PC is doing some weird things... Sometimes when I open up a program, lets say Adobe Photoshop, it will load everything normally, nice and quick no problems and I can use it fine. Other times its a little odd, and it loads the program as if it's only using half of the CPU. It's pretty obvious when it does it, normally the loading screen skims past, but when it does this weird load you see it slowly tick though each thing, and the program itself becomes incredibly slow. Even Google Chrome does it sometimes. Yet when I exit and reopen the program without doing anything else, it typically opens fine without lagging. I think this problem is probably a symptom of something bigger, because of other problems I'm having. Random hangs; no matter what I have open or what I'm doing. My PC will sort of freeze up for a few seconds. If music is playing it will either loop the last second or two, or it will buzz. This only lasts for a few seconds then it returns to normal without having to restart. During this time all programs lock up and freeze, and the mouse and keyboard are useless. I am also having a weird issue with my audio jacks, without touching my PC at all, sometimes I will see a popup saying that I have unplugged something or plugged something in, neither of which has actually happened. Pretty sure this is cause by the motherboard. I recently had a 'Pink Screen of Death' (yes pink) which pointed to my audio drivers. The lockups seem to happen with some consistency when someone is accessing my shared files via my home LAN. Which leads me to believe either one of my hard drives is acting up or more likely the controller. One of my drives had a bit of a crash before, I used Spinrite and managed to recover my stuff and now the drive appears to be working okay. This is possibly adding to the problems. My best guess is something has gone wrong with my motherboard, possibly a power issue or a chip has died, I really don't know. So what I would like to know is: Have I have missed some obvious diagnostic to help figure out what it is, or should I just bite the bullet and assume its my motherboard acting up and buy a new system? dxdiag[64-bit] - http://pastebin.com/G30kb2TL PSOD (minidump) - http://pastebin.com/aZsv0H56 HWiNFO64 (system info / specs) - http://pastebin.com/X6h3K8g6

    Read the article

  • Now Customers Can Actually Locate Your Resources with URL Rewriter 2.0 RTW

    - by The Official Microsoft IIS Site
    Today, Microsoft announced the final release of IIS URL Rewriter 2.0 RTW . Now the first reason might be obvious why you would want to rewrite a URL – when you are at a cocktail party with loud music and tasty appetizers and a potential customer asks you where they can get more info on your snazzy new idea. And you proudly blurt out next to their ear over the roar of the bass, “Just go to h-t-t-p colon slash slash w-w-w dot my new idea dot com slash items dot a-s-p-x question mark cat ID equals new...(read more)

    Read the article

  • Why Doesn’t Partition Elimination Work?

    - by Paul White
    Given a partitioned table and a simple SELECT query that compares the partitioning column to a single literal value, why does SQL Server read all the partitions when it seems obvious that only one partition needs to be examined? Sample Data The following script creates a table, partitioned on the char(3) column ‘Div’, and populates it with 100,000 rows of data: USE Sandpit; GO CREATE PARTITION FUNCTION PF ( char (3)) AS RANGE RIGHT FOR VALUES ( '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9'...(read more)

    Read the article

  • How Social Networking Websites Can Play a Vital Role Websites in SEO

    Social networking websites have now became an important part of the internet platform all across the globe and almost every individual who is using the internet these days has an account or profile registered with at least 1 or 2 social networking websites. The spreading and rapidly growing trend of social sites should be an obvious sign to all online businesses and individual internet marketers that are competing in the search engines that this is a platform which they must consider using in order to give more exposure to their business as well as target to attract different people to their site.

    Read the article

  • Code style Tip: Case insensitive string comparison

    - by Michael Freidgeim
    Goodif (String.Compare(myString, ALL_TEXT, StringComparison.OrdinalIgnoreCase) == 0)                                {                                         return true;                                }OK(not obvious what true means) if (String.Compare(myString, ALL_TEXT, true) == 0)                                {                                         return true;                                }BAD: (non null safe) if (myString.ToLower()==ALL_TEXT.ToLower()                                {                                         return true;                                }

    Read the article

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