Search Results

Search found 22078 results on 884 pages for 'composite primary key'.

Page 17/884 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Passing Key-Value pair to a COM method in C#

    - by Sinnerman
    Hello, I have the following problem: I have a project in C# .Net where I use a third party COM component. So the problem is that the above component has a method, which takes a string and a number of key-value pairs as arguments. I already managed to call that method through JavaScript like that: var srcName srcName = top.cadView.addSource( 'Database', { driver : 'Oracle', host : '10.10.1.123', port : 1234, database : 'someSID', user : 'someuser', password : 'somepass' } ) if ( srcName != '' ) { ... } ... and it worked perfectly well. However I have no idea how to do the same using C#. I tried passing the pairs as Dictionary and Struct/Class but it throws me a "Specified cast is not valid." exception. I also tried using Hashtable like that: Hashtable args = new Hashtable(); args.Add("driver", "Oracle"); args.Add("host", "10.10.1.123"); args.Add("port", 1234); args.Add("database", "someSID"); args.Add("user", "someUser"); args.Add("password", "samePass"); String srcName = axCVCanvas.addSource("Database", args); and although it doesn't throw an exception it still won't do the job, writing me in a log file [ Error] [14:38:33.281] Cad::SourceDB::SourceDB(): missing parameter 'driver' Any help will be appreciated, thanks.

    Read the article

  • Changing order of children of an SWT Composite

    - by Alexey Romanov
    In my case I have two children of a SashForm, but the question applies to all Composites and different layouts. class MainWindow { Sashform sashform; Tree child1 = null; Table child2 = null; MainWindow(Shell shell) { sashform = new SashForm(shell, SWT.NONE); } // Not called from constructor because it needs data not available at that time void CreateFirstChild() { ... Tree child1 = new Tree(sashform, SWT.NONE); } void CreateSecondChild() { ... Table child2 = new Table(sashform, SWT.NONE); } } I don't know in advance in what order these methods will be called. How can I make sure that child1 is placed on the left, and child2 on the right? Alternately, is there a way to change their order as children of sashform after they are created? Currently my best idea is to put in placeholders like this: class MainWindow { Sashform sashform; private Composite placeholder1; private Composite placeholder2; Tree child1 = null; Table child2 = null; MainWindow(Shell shell) { sashform = new SashForm(shell, SWT.NONE); placeholder1 = new Composite(sashform, SWT.NONE); placeholder2 = new Composite(sashform, SWT.NONE); } void CreateFirstChild() { ... Tree child1 = new Tree(placeholder1, SWT.NONE); } void CreateSecondChild() { ... Table child2 = new Table(placeholder2, SWT.NONE); } }

    Read the article

  • How do I upgrade Windows Server 2008 R2 Standard (OEM Key) to Enterprise (MSDN Key) using DISM?

    - by Tom Crane
    (Originally asked as After upgrading to 2008 R2 Enterprise and installing more RAM, Windows can only see 4.00 GB but now I know what the question really is...) My Dell server came preinstalled with 2008 R2 Standard. I upgraded to Enterprise to take advantage of more than 32GB RAM. This server is purely for dev and testing, so I want to use my MSDN product key for the upgrade. I originally tried to uprade using the MSDN Enterprise key, but it wouldn't have it: dism /online /Set-Edition:ServerEnterprise /ProductKey:[MSDN key] => Error DISM DISM Transmog Provider: PID=5728 Product key is keyed to [], but user requested transmog to [ServerEnterprise] - CTransmogManager::ValidateTransmogrify I tried several things, including changing the current product key to the MSDN one. Eventually I used a KMS generic key which can be found in several technet forum posts. dism /online /Set-Edition:ServerEnterprise /ProductKey:[KMS Generic Key] ... and this appeared to work. I then changed the product key again (using the control panel) to the MSDN key, thinking that was the end of the matter. Only later when tried to start up VMs did I realise I only had 4GB of usable RAM. I didn't make the connection with the licensing changes at this point and went off on a wild goose chase of BIOS settings, memory configurations and the like. Only later when I saw this... http://social.technet.microsoft.com/Forums/en/winserverTS/thread/6debc586-0977-4731-b418-ca1edb34fe8b ...did I make the connection and reapply the KMS Generic key - which gave me all the RAM back. But now I have a system that isn't properly licensed, presumably I won't be able to activate it as it is, so I've got 2 days to enjoy it. With the MSDN key applied, only 4GB RAM is usable. Is there a way round this without a) rebuilding the server from scratch with the MSDN key from the start or b) buying a retail Enterprise license

    Read the article

  • How to add on key down and on key up event in java script

    - by Ramesh
    Hello , I am creating an live search for my blog..i got this from w3 schools and i need to add on keyboard up,down mouse up and down event ... <html> <head> <script type="text/javascript"> function showResult(str) { if (str.length==0) { document.getElementById("livesearch").innerHTML=""; document.getElementById("livesearch").style.border="0px"; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("livesearch").innerHTML=xmlhttp.responseText; document.getElementById("livesearch").style.border="1px solid #A5ACB2"; } } xmlhttp.open("GET","livesearch.php?q="+str,true); xmlhttp.send(); } </script> </head> <body> <form> <input type="text" size="30" onkeyup="showResult(this.value)" /> <div id="livesearch"></div> </form> </body> </html>

    Read the article

  • How to pass a action string into a JSF 2 composite component?

    - by Brian Leathem
    I'm creating a simple menuing composite component in JSF 2. However, I am unable to pass a String attribute into the composite component to use in the action attribute of the <h:commandLink>. My component looks like: <composite:interface> <composite:attribute name="title" required="true" type="java.lang.String"/> <composite:attribute name="view" required="true" /> </composite:interface> <!--implementation--> <composite:implementation> <li><h:commandLink action="#{cc.attrs.view}" value="#{cc.attrs.title}" /></li> </composite:implementation> How can I get an action String into the action attribute of the <h:commandLink>?

    Read the article

  • MySQL query against pseudo-key-value pair data in WordPress custom query

    - by andrevr
    I'm writing a custom WordPress query to use some of the data which the Woothemes Diarise theme creates. Diarise is an event planner theme with calendar blah, blah... and uses custom fields to store the event start and end dates in WP custom fields in the *wp_postmeta* table, which implements a key-value store. So for each post in the "event" category, there are 2 records in *wp_postmeta*, named *event_start_date* and *event_end_date* that I'm interested in. The task is to compare a tourist's arrival and departure dates with the start and end dates of events, yielding a what's on list of events available. We thought we'd killed it with a grand flash of logic, that goes like this: Disregard any event that ends before the tourist arrives, and any that begin after the departure date. I wrote this query: SELECT wposts.* FROM wp_posts wposts LEFT JOIN wp_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id LEFT JOIN wp_term_relationships ON (wposts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN(3,4) AND ( wpostmeta.meta_key = 'event_start_date' AND NOT ( concat(subst(wpostmeta.meta_value,7,4),'-',subst(wpostmeta.meta_value,4,2),'-',subst(wpostmeta.meta_value,1,2) > '2010-07-31' ) ) AND ( wpostmeta.meta_key = 'event_end_date' AND NOT ( concat(subst(wpostmeta.meta_value,7,4),'-',subst(wpostmeta.meta_value,4,2),'-',subst(wpostmeta.meta_value,1,2) < '2010-05-01' ) ) ) ORDER BY wpostmeta.meta_value ASC And, of course it returns no records. The problem I believe is in the dual reference to wpostmeta.meta_key, but how to get around that?

    Read the article

  • Updating a composite primary key

    - by VBCSharp
    I am struggling with the philosophical discussions about whether or not to use composite primary keys on my SQL Server database. I have always used the surrogate keys in the past and I am challenging myself by leaving my comfort zone to try something different. I have read many discussion but can't come to any kind of solution yet. The struggle I am having is when I have to update a record with the composite PK. For example, the record in questions is like this: ContactID, RoleID, EffectiveDate, TerminationDT. The PK in this case is the ContactID, RoleID, and EffectiveDate. TerminationDT can be null. If in my UI, the user changes the RoleID and then I need to update the record. Using the surrogate key I can do an Update Table Set RoleID = 1 WHERE surrogateID = Z. However, using the Composite Key way, once one of the fields in the composite key changes I have no way to reference the old record to update it without now maintaining somewhere in the UI a reference to the old values. I do not bind datasources in my UI. I open a connection, get the data and store it in a bucket, then close the connection. What are everyone's opinions? Thanks.

    Read the article

  • Using an unencoded key vs a real Key, benefits?

    - by user246114
    Hi, I am reading the docs for Key generation in app engine. I'm not sure what effect using a simple String key has over a real Key. For example, when my users sign up, they must supply a unique username: class User { /** Key type = unencoded string. */ @PrimaryKey private String name; } now if I understand the docs correctly, I should still be able to generate named keys and entity groups using this, right?: // Find an instance of this entity: User user = pm.findObjectById(User.class, "myusername"); // Create a new obj and put it in same entity group: Key key = new KeyFactory.Builder( User.class.getSimpleName(), "myusername") .addChild(Goat.class.getSimpleName(), "baa").getKey(); Goat goat = new Goat(); goat.setKey(key); pm.makePersistent(goat); the Goat instance should now be in the same entity group as that User, right? I mean there's no problem with leaving the User's primary key as just the raw String? Is there a performance benefit to using a Key though? Should I update to: class User { /** Key type = unencoded string. */ @PrimaryKey private Key key; } // Generate like: Key key = KeyFactory.createKey( User.class.getSimpleName(), "myusername"); user.setKey(key); it's almost the same thing, I'd still just be generating the Key using the unique username anyway, Thanks

    Read the article

  • The Primary Cause of Failed IT Projects

    - by Paul Nielsen
    During my career I’ve been a part of dozens of projects. Some I was on from the start, most I came in to help bail out. Some went smooth and were a pleasure to build and maintain and some projects failed (failed being broadly defined as projects that were not completed, or were completed but were a horrid mess – very complex, impossible to maintain, refactor, and a royal pain to keep running.) While there are a number of factors that can contribute to a failed project, in my career it seems the primary...(read more)

    Read the article

  • The Primary Cause of Failed IT Projects

    - by Paul Nielsen
    During my career I’ve been a part of dozens of projects. Some I was on from the start, most I came in to help bail out. Some went smooth and were a pleasure to build and maintain and some projects failed (failed being broadly defined as projects that were not completed, or were completed but were a horrid mess – very complex, impossible to maintain, refactor, and a royal pain to keep running.) While there are a number of factors that can contribute to a failed project, in my career it seems the primary...(read more)

    Read the article

  • SQL SERVER Create Primary Key with Specific Name when Creating Table

    It is interesting how sometimes the documentation of simple concepts is not available online. I had received email from one of the reader where he has asked how to create Primary key with a specific name when creating the table itself. He said, he knows the method where he can create the table and then [...]...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Android - Key Dispatching Timed Out

    - by Donal Rafferty
    In my Android application I am getting a very strange crash, when I press a button (Image) on my UI the entire application freezes and after a couple of seconds I getthe dreaded force close dialog appearing. Here is what gets printed in the log: WARN/WindowManager(88): Key dispatching timed out sending to package name/Activity WARN/WindowManager(88): Dispatch state: {{KeyEvent{action=1 code=5 repeat=0 meta=0 scancode=231 mFlags=8} to Window{432bafa0 com.android.launcher/com.android.launcher.Launcher paused=false} @ 1281611789339 lw=Window{432bafa0 com.android.launcher/com.android.launcher.Launcher paused=false} lb=android.os.BinderProxy@431ee8e8 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335fc58 package name/Activity paused=false}}} WARN/WindowManager(88): Current state: {{null to Window{4335fc58 package name/Activity paused=false} @ 1281611821193 lw=Window{4335fc58 package name/Activity paused=false} lb=android.os.BinderProxy@434c9bd0 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4335fc58 package name/Activity paused=false}}} INFO/ActivityManager(88): ANR in process: package name (last in package name) INFO/ActivityManager(88): Annotation: keyDispatchingTimedOut INFO/ActivityManager(88): CPU usage: INFO/ActivityManager(88): Load: 5.18 / 5.1 / 4.75 INFO/ActivityManager(88): CPU usage from 7373ms to 1195ms ago: INFO/ActivityManager(88): package name: 6% = 1% user + 5% kernel / faults: 7 minor INFO/ActivityManager(88): system_server: 5% = 4% user + 1% kernel / faults: 27 minor INFO/ActivityManager(88): tiwlan_wifi_wq: 3% = 0% user + 3% kernel INFO/ActivityManager(88): mediaserver: 0% = 0% user + 0% kernel INFO/ActivityManager(88): logcat: 0% = 0% user + 0% kernel INFO/ActivityManager(88): TOTAL: 12% = 5% user + 6% kernel + 0% softirq INFO/ActivityManager(88): Removing old ANR trace file from /data/anr/traces.txt INFO/Process(88): Sending signal. PID: 1812 SIG: 3 INFO/dalvikvm(1812): threadid=7: reacting to signal 3 INFO/dalvikvm(1812): Wrote stack trace to '/data/anr/traces.txt' This is the code for the Button (Image): findViewById(R.id.endcallimage).setOnClickListener(new OnClickListener() { public void onClick(View v) { mNotificationManager.cancel(2); Log.d("Handler", "Endcallimage pressed"); if(callConnected) elapsedTimeBeforePause = SystemClock.elapsedRealtime() - stopWatch.getBase(); try { serviceBinder.endCall(lineId); } catch (RemoteException e) { e.printStackTrace(); } dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.FLAG_SOFT_KEYBOARD)); dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK)); } }); If I comment the following out the pressing of the button (image) doesn't cause the crash: try { serviceBinder.endCall(lineId); } catch (RemoteException e) { e.printStackTrace(); } The above code calls down through several levels of the app and into the native layer (NDK), could the call passing through several objects be leading to the force close? It seems unlikely as several other buttons do the same without issue. How about the native layer? Could some code I've built with the NDK be causing the issue? Any other ideas as to what the cause of the issue might be?

    Read the article

  • OCR an RSA key fob (security token)

    - by user130582
    I put together a quick WinForm/embedded IE browser control which logs into our company's bank website each morning and scrapes/exports the desired deposit information (the bank is a smallish regional bank). Since we have a few dozen "pseudoaccounts" that draw from the same master account, this actually takes 10-15 minutes to retrieve. Anyway, the only problem is that our business bank account reuires an RSA security token (http://www.rsa.com/node.aspx?id=1156)--if you are not familiar, it is a small device which shows a random 6 digit number every 15(?) seconds, so I have to prompt for this value before starting. This is on top of the website's login based security model, so even if you create a read-only account that can't do anything, you still have to put the RSA number in. We have 5 of these tokens for different people in the company. From our perspective this is nusiance security. I was joking about using a web camera to OCR the digits from the key fob so they didn't have to type it in -- mainly so that the scraping/export would be done before anyone arrives in the morning. Well, they asked if I could really do it. So now I ask you, how hard (how many hours) do you think it would take to OCR these digits reliably from a JPEG image produced by the camera? I already know I can get the JPEG easily. I think you get 3 tries to log in, so it really needs to hit a 99% accuracy rate. I could work on this on my off time, but they don't want me to put more than a few hours into it, so I want to leverage as much existing code as possible. This is a 7-segment display (like an alarm clock) so it's not exactly text that an OCR package would be used to seeing. Also--there is a countdown timer on the side of the display; typically when it is down to 1 bar, you wait until the next number appears and it starts over at 5 bars (like signal strength on your cell phone). So this would need to be OCRd as well but it is not text. Anyway the more I think about it as I type this, the less convinced I am that I can truly get this right, so maybe I should just work on it in my spare time?

    Read the article

  • How does key-based caching work?

    - by Dominic Santos
    I recently read an article on the 37Signals blog and I'm left wondering how it is that they get the cache key. It's all well and good having a cache key that includes the object's timestamp (this means that when you update the object the cache will be invalidated); but how do you then use the cache key in a template without causing a DB hit for the very object that you are trying to fetch from the cache. Specifically, how does this affect One to Many relations where you are rendering a Post's Comments for example. Example in Django: {% for comment in post.comments.all %} {% cache comment.pk comment.modified %} <p>{{ post.body }}</p> {% endcache %} {% endfor %} Is caching in Rails different to just requests to memcached for example (I know that they convert your cache key to something different). Do they also cache the cache key?

    Read the article

  • USB key will only be mounted by gparted [?]

    - by user2413
    Hi, When I insert by usb key nothing happens (i.e. the drive is not visible). I can mount the USB drive from gparted though (and then it's suddenly recognized). It's not particular to any USB key. This only happens on my laptop (on the desktop the same key will be mounted upon plugging it in without any problems). Finally, the key is formated as fat32 and dosfstools and mtools are installed (through gparted claims otherwise). what's the catch? EDIT Also, gparted offers me the option to mount the key on "/" : shouldn't that be "/media" (or has this changed ?)

    Read the article

  • Intuitive "Take Screenshot" key mapping used by games?

    - by Hatoru Hansou
    I recently had a problem testing my game on Linux Ubuntu. The Print key is intercepted by the desktop environment and It never reaches the game. Rather than fighting this, I will simply use any other key or key combination to trigger the screen capture functionality. Now, using the PRINT key is very intuitive because people already expect this behavior. What other keys are a good idea to use to take screenshots? And if possible elaborate why, have other apps/games used that key?

    Read the article

  • CakePHP. How can i make a model test in a table with another primary key?

    - by Marcelo
    I have this table CREATE TABLE myexamples.problems ( id INT, name VARCHAR(45) NULL , pk_id INT AUTO_INCREMENT PRIMARY KEY ); But when I try test a model in cakephp, it fails because the table has two autoincrement attributes. The following query CREATE TABLE `test_suite_problems` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(45) DEFAULT NULL, `pk_id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`pk_id`) ) DEFAULT CHARSET=latin1, COLLATE=latin1_swedish_ci, ENGINE=InnoDB; raise this error: "1075: Incorrect table definition; there can be only one auto column and it must be defined as a key" I have in the model class <?php class Problem extends AppModel { var $name = 'Problem'; var $displayField = 'name'; var $primaryKey='problems'; } ?> But I don't know how to make the field ID not having an autoincrement attribute, and I can't change the table structure.

    Read the article

  • How to handle encryption key conflicts when synchronizing data?

    - by Rafael
    Assume that there is data that gets synchronized between several devices. The data is protected with a symmetric encryption algorithm and a key. The key is stored on each device and encrypted with a password. When a user changes the password only the key gets re-encrypted. Under normal circumstances, when there is a good network connection to other peers, the current key gets synchronized and all data on the new device gets encrypted with the same key. But how to handle situations where a new device doesn’t have a network connection and e.g. creates its own new, but incompatible key? How to keep the usability as high as possible under such circumstances? The application could detect that there is no network and hence refuse to start. That’s very bad usability in my opinion, because the application isn’t functional at all in this case. I don’t consider this a solution. The application could ignore the missing network connection and create a new key. But what to do when the application gains a network connection? There will be several incompatible keys and some parts of the underlying data could only be encrypted with one key and other parts with another key. The situation would get worse if there would be more keys than just two and the application would’ve to ask every time for a password when another object that should get decrypted with another key would be needed. It is very messy and time consuming to try to re-encrypt all data that is encrypted with another key with a main key. What should be the main key at all in this case? The oldest key? The key with the most encrypted objects? What if the key got synchronized but not all objects that got encrypted with this particular key? How should the user know for which particular password the application asks and why it takes probably very long to re-encrypt the data? It’s very hard to describe encryption “issues” to users. So far I didn’t find an acceptable solution, nor some kind of generic strategy. Do you have some hints about a concrete strategy or some books / papers that describe synchronization of symmetrically encrypted data with keys that could cause conflicts?

    Read the article

  • Capturing Alt+PrintScreen hot key and clipboard contents

    - by kusanagi
    I setup catching hotkey on alt+printscreen. It catches perfectly but there is nothing in the buffer - no image. How can I get the image from Clipboard.GetImage() after catching hotkey? Here is the the code. using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Magic_Screenshot { public enum ModifierKey : uint { MOD_NULL = 0x0000, MOD_ALT = 0x0001, MOD_CONTROL = 0x0002, MOD_SHIFT = 0x0004, MOD_WIN = 0x0008, } public enum HotKey { PrintScreen, ALT_PrintScreen, CONTROL_PrintScreen } public class HotKeyHelper : IMessageFilter { const string MSG_REGISTERED = "??????? ??????? ??? ????????????????, ???????? UnRegister ??? ?????? ???????????."; const string MSG_UNREGISTERED = "??????? ??????? ?? ????????????????, ???????? Register ??? ???????????."; //?????? ?? ?????? ?????? singleton public HotKeyHelper() { } //public static readonly HotKeyHelper Instance = new HotKeyHelper(); public bool isRegistered; ushort atom; //ushort atom1; ModifierKey modifiers; Keys keyCode; public void Register(ModifierKey modifiers, Keys keyCode) { //??? ???????? ??? ????? ????? ? PreFilterMessage this.modifiers = modifiers; this.keyCode = keyCode; //?? ????????? ?? ??? ???????????? //if (isRegistered) // throw new InvalidOperationException(MSG_REGISTERED); //????????? atom, ??? ??????????? ?????? ??????????? atom = GlobalAddAtom(Guid.NewGuid().ToString()); //atom1 = GlobalAddAtom(Guid.NewGuid().ToString()); if (atom == 0) ThrowWin32Exception(); if (!RegisterHotKey(IntPtr.Zero, atom, modifiers, keyCode)) ThrowWin32Exception(); //if (!RegisterHotKey(IntPtr.Zero, atom1, ModifierKey.MOD_CONTROL, Keys.PrintScreen)) // ThrowWin32Exception(); //????????? ???? ? ??????? ???????? ????????? Application.AddMessageFilter(this); isRegistered = true; } public void UnRegister() { //?? ???????? ?? ??? ???????????? if (!isRegistered) throw new InvalidOperationException(MSG_UNREGISTERED); if (!UnregisterHotKey(IntPtr.Zero, atom)) ThrowWin32Exception(); GlobalDeleteAtom(atom); //??????? ???? ?? ??????? ???????? ????????? Application.RemoveMessageFilter(this); isRegistered = false; } //?????????? Win32Exception ? ????? ?? ????????? ????? ????????????? Win32 ??????? void ThrowWin32Exception() { throw new Win32Exception(Marshal.GetLastWin32Error()); } //???????, ???????????? ??? ??????????? ??????? HotKeys public event HotKeyHelperDelegate HotKeyPressed; public bool PreFilterMessage(ref Message m) { //???????? ?? ????????? WM_HOTKEY if (m.Msg == WM_HOTKEY && //???????? ?? ???? m.HWnd == IntPtr.Zero && //???????? virtual key code m.LParam.ToInt32() >> 16 == (int)keyCode && //???????? ?????? ????????????? (m.LParam.ToInt32() & 0x0000FFFF) == (int)modifiers && //???????? ?? ??????? ??????????? ????????? HotKeyPressed != null) { if ((m.LParam.ToInt32() & 0x0000FFFF) == (int)ModifierKey.MOD_CONTROL && (m.LParam.ToInt32() >> 16 == (int)Keys.PrintScreen)) { HotKeyPressed(this, EventArgs.Empty, HotKey.CONTROL_PrintScreen); } else if ((m.LParam.ToInt32() & 0x0000FFFF) == (int)ModifierKey.MOD_ALT && (m.LParam.ToInt32() >> 16 == (int)Keys.PrintScreen)) { HotKeyPressed(this, EventArgs.Empty, HotKey.ALT_PrintScreen); } else if (m.LParam.ToInt32() >> 16 == (int)Keys.PrintScreen) { HotKeyPressed(this, EventArgs.Empty, HotKey.PrintScreen); } } return false; } //??????????? Win32 ????????? ? ??????? const string USER32_DLL = "User32.dll"; const string KERNEL32_DLL = "Kernel32.dll"; const int WM_HOTKEY = 0x0312; [DllImport(USER32_DLL, SetLastError = true)] static extern bool RegisterHotKey(IntPtr hWnd, int id, ModifierKey fsModifiers, Keys vk); [DllImport(USER32_DLL, SetLastError = true)] static extern bool UnregisterHotKey(IntPtr hWnd, int id); [DllImport(KERNEL32_DLL, SetLastError = true)] static extern ushort GlobalAddAtom(string lpString); [DllImport(KERNEL32_DLL)] static extern ushort GlobalDeleteAtom(ushort nAtom); } } Where is the bug?

    Read the article

  • Why can I create a table with PRIMARY KEY on a nullable column?

    - by AlexKuznetsov
    The following code creates a table without raising any errors: CREATE TABLE test( ID INTEGER NULL, CONSTRAINT PK_test PRIMARY KEY(ID) ) Note that I cannot insert a NULL, as expected: INSERT INTO test VALUES(1),(NULL) ERROR: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null). ********** Error ********** ERROR: null value in column "id" violates not-null constraint SQL state: 23502 Detail: Failing row contains (null). Why can I create a table with a self-contradictory definition? ID column is explicitly declared as NULLable, and it is implicitly not nullable, as a part of the PRIMARY KEY. Does it make sense? Edit: would it not be better if this self-contradictory CREATE TABLE just failed right there?

    Read the article

  • How to change CapsLock key to produce "a"?

    - by Pit
    While typing I often hit the CapsLock key instead of the a key. (QWERTZU keyboard) This is quite annoying because the moment I realise that I hit the wrong key, I will have to delete multiple character/lines of text an rewrite them in the right form. I am searching for a way to prevent this. I have found a possibility to disable the CapsLock key in Keyboard Layout Options. But this would in my case mean that instead of writing an a I would write nothing. Positive - I don't have to rewrite a whole line, but only one character Negative - It's not that obvious that I hit the wrong key, as a missing character is not perceivable as an upper-case line of text. I would therefore prefer a possibility to map CapsLock to a . Thus when hitting CapsLock an a character would be written. Positive - If I hit CapsLock instead of a I get the output I actually wanted to type. Negative - If I hit CapsLock in any other context I will get an a character. As I don't ever intentionally use the CapsLock key this would not really pose a problem. (I think, or does it?) My Question: So how do I change to a ? And is there any case where this could be dangerous/provoke unwanted behaviour?

    Read the article

  • Old Lock Retrofitted for Wireless and Key-free Entry

    - by Jason Fitzpatrick
    What do you do if the old key your landlord gave you is poor fit for your apartment’s lock? If you’re the geeky sort, you build a wireless unlocking module to do the work for you. Instructables user Rybitski writes: The key to my apartment never worked quite right because it is a copy of a copy of a copy. I am fairly certain that the dead bolt is original to the building and the property manager seems to have lost the original key years ago. As a result unlocking the door was always a pain. Changing the lock wasn’t an option, but eliminating the need to use a key was. To that end, he built the device seen in the video above. An Arduino Uno drives a servo which in turn opens the deadbolt. The whole thing is controlled by a simple wireless key fob. Hit up the link below for the full build guide including code. Key Fob Deadbolt [via Hack A Day] How To Delete, Move, or Rename Locked Files in Windows HTG Explains: Why Screen Savers Are No Longer Necessary 6 Ways Windows 8 Is More Secure Than Windows 7

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >