Search Results

Search found 2672 results on 107 pages for 'michael cereda'.

Page 70/107 | < Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >

  • C#: Replicating keyboard shortcuts in textbox, how do I prevent the beep sound caused by alt key pre

    - by Michael Johnson
    I'm creating a routine that allows the user to replicate keyboard shortcuts into a textbox for 'custom keyboard shortcuts' customization, but everytime the alt key is pressed with another letter, it produces another sound. I'm capturing the keys in the textbox_keydown event to parse the modifiers + other keys into a readable Shift + A or Ctrl + Shift + B manner into that very same textbox. Should I be doing this in a different event like textbox_previewkey instead of textbox_keydown? How can I prevent the alt modifier key + a letter or number causing the Beep sound? the textbox is just a normal .net 3.5 textbox with the only edited properties of it being the ReadOnly property to false. Is there a better way I could re-do this? I'm currently just checking that if any modifiers keys are pressed and then + a-z or 0-9, then to go ahead and input the appropriately pressed keys into that same textbox like Shift + A or Ctrl + Shift + Y.

    Read the article

  • Including a NSUserDefault password test in 1st Tab.m to load a loginView gives eror?

    - by Michael Robinson
    I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; usernameLabel.text = [defaults objectForKey:kUsernameKey]; passwordLabel.text = [defaults objectForKey:kPasswordKey]; { Here is the Test: - (void)viewDidAppear:(BOOL)animated { [self refreshFields]; [super viewDidAppear:animated]; if ([usernameLabel.text length] == 0 || [passwordLabel.text length] == 0) { LoginViewController * vc = [[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil] autorelease]; [self presentModalViewController:vc animated: false]; } else { [[self tableView ]reloadData]; } } Thanks in advance, I'm getting this error in the console: * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key usernameLabel.'

    Read the article

  • Anything wrong with this function for comparing floats?

    - by Michael Borgwardt
    When my Floating-Point Guide was yesterday published on slashdot, I got a lot of flak for my suggested comparison function, which was indeed inadequate. So I finally did the sensible thing and wrote a test suite to see whether I could get them all to pass. Here is my result so far. And I wonder if this is really as good as one can get with a generic (i.e. not application specific) float comparison function, or whether I still missed some edge cases. import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; public class NearlyEqualsTest { public static boolean nearlyEqual(float a, float b) { final float epsilon = 0.000001f; final float absA = Math.abs(a); final float absB = Math.abs(b); final float diff = Math.abs(a-b); if (a*b==0) { // a or b or both are zero // relative error is not meaningful here return diff < Float.MIN_VALUE / epsilon; } else { // use relative error return diff / (absA+absB) < epsilon; } } /** Regular large numbers - generally not problematic */ @Test public void big() { assertTrue(nearlyEqual(1000000f, 1000001f)); assertTrue(nearlyEqual(1000001f, 1000000f)); assertFalse(nearlyEqual(10000f, 10001f)); assertFalse(nearlyEqual(10001f, 10000f)); } /** Negative large numbers */ @Test public void bigNeg() { assertTrue(nearlyEqual(-1000000f, -1000001f)); assertTrue(nearlyEqual(-1000001f, -1000000f)); assertFalse(nearlyEqual(-10000f, -10001f)); assertFalse(nearlyEqual(-10001f, -10000f)); } /** Numbers around 1 */ @Test public void mid() { assertTrue(nearlyEqual(1.0000001f, 1.0000002f)); assertTrue(nearlyEqual(1.0000002f, 1.0000001f)); assertFalse(nearlyEqual(1.0002f, 1.0001f)); assertFalse(nearlyEqual(1.0001f, 1.0002f)); } /** Numbers around -1 */ @Test public void midNeg() { assertTrue(nearlyEqual(-1.000001f, -1.000002f)); assertTrue(nearlyEqual(-1.000002f, -1.000001f)); assertFalse(nearlyEqual(-1.0001f, -1.0002f)); assertFalse(nearlyEqual(-1.0002f, -1.0001f)); } /** Numbers between 1 and 0 */ @Test public void small() { assertTrue(nearlyEqual(0.000000001000001f, 0.000000001000002f)); assertTrue(nearlyEqual(0.000000001000002f, 0.000000001000001f)); assertFalse(nearlyEqual(0.000000000001002f, 0.000000000001001f)); assertFalse(nearlyEqual(0.000000000001001f, 0.000000000001002f)); } /** Numbers between -1 and 0 */ @Test public void smallNeg() { assertTrue(nearlyEqual(-0.000000001000001f, -0.000000001000002f)); assertTrue(nearlyEqual(-0.000000001000002f, -0.000000001000001f)); assertFalse(nearlyEqual(-0.000000000001002f, -0.000000000001001f)); assertFalse(nearlyEqual(-0.000000000001001f, -0.000000000001002f)); } /** Comparisons involving zero */ @Test public void zero() { assertTrue(nearlyEqual(0.0f, 0.0f)); assertFalse(nearlyEqual(0.00000001f, 0.0f)); assertFalse(nearlyEqual(0.0f, 0.00000001f)); } /** Comparisons of numbers on opposite sides of 0 */ @Test public void opposite() { assertFalse(nearlyEqual(1.000000001f, -1.0f)); assertFalse(nearlyEqual(-1.0f, 1.000000001f)); assertFalse(nearlyEqual(-1.000000001f, 1.0f)); assertFalse(nearlyEqual(1.0f, -1.000000001f)); assertTrue(nearlyEqual(10000f*Float.MIN_VALUE, -10000f*Float.MIN_VALUE)); } /** * The really tricky part - comparisons of numbers * very close to zero. */ @Test public void ulp() { assertTrue(nearlyEqual(Float.MIN_VALUE, -Float.MIN_VALUE)); assertTrue(nearlyEqual(-Float.MIN_VALUE, Float.MIN_VALUE)); assertTrue(nearlyEqual(Float.MIN_VALUE, 0)); assertTrue(nearlyEqual(0, Float.MIN_VALUE)); assertTrue(nearlyEqual(-Float.MIN_VALUE, 0)); assertTrue(nearlyEqual(0, -Float.MIN_VALUE)); assertFalse(nearlyEqual(0.000000001f, -Float.MIN_VALUE)); assertFalse(nearlyEqual(0.000000001f, Float.MIN_VALUE)); assertFalse(nearlyEqual(Float.MIN_VALUE, 0.000000001f)); assertFalse(nearlyEqual(-Float.MIN_VALUE, 0.000000001f)); assertFalse(nearlyEqual(1e20f*Float.MIN_VALUE, 0.0f)); assertFalse(nearlyEqual(0.0f, 1e20f*Float.MIN_VALUE)); assertFalse(nearlyEqual(1e20f*Float.MIN_VALUE, -1e20f*Float.MIN_VALUE)); } }

    Read the article

  • Storing data in HTML, javascript book, articles recommendations.

    - by michael
    I'm looking for articles or books that discuss schemes and techniques adopted by pro javascript developers to store and organize data with html tags. In other words, how to emulate xml data storage with html as semantically as possible. Some various solutions that I've seen mentioned in passing are custom DTD, custom attributes with xhtml, early adoption of html5 and its data- attribute. Now, I'm looking for some tangible material that goes in depth with these concepts.

    Read the article

  • Saving NSString to file

    - by Michael Amici
    I am having trouble saving simple website data to file. I believe the sintax is correct, could someone help me? When I run it, it shows that it gets the data, but when i quit and open up the file that it is supposed to save to, nothing is in it. - (BOOL)textFieldShouldReturn:(UITextField *)nextField { [timer invalidate]; startButton.hidden = NO; startButton.enabled = YES; stopButton.enabled = NO; stopButton.hidden = YES; stopLabel.hidden = YES; label.hidden = NO; label.text = @"Press to Activate"; [nextField resignFirstResponder]; NSString *urlString = textField.text; NSData *dataNew = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]; NSUInteger len = [dataNew length]; NSString *stringCompare = [NSString stringWithFormat:@"%i", len]; NSLog(@"%@", stringCompare); NSString *filePath = [[NSBundle mainBundle] pathForResource:@"websiteone" ofType:@"txt"]; if (filePath) { [stringCompare writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:NULL]; NSString *myText = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL]; NSLog(@"Saving... %@", myText); } else { NSLog(@"cant find the file"); } return YES; }

    Read the article

  • Can you set a gradient brush for a listboxitem background in silverlight?

    - by Michael
    I am looking for a way to set a gradientbrush as the background for a listbox item. I have a DataTemplate defined and have specified a gradient brush but it always appears as the listbox background (i.e. it never shows as a gradient brush). I have been able to set the background of the listbox itself, and I can set the listboxitem's background to a standard color using the "setter" object....but none of these are what I am after. I really want the background on each list item to be a gradient brush. Below is the datatemplate that I have constructed. <ListBox Name="MyListBox" Margin="12,67,12,169"> <ListBox.ItemTemplate> <DataTemplate> <Grid Height="51" VerticalAlignment="Bottom"> <Grid.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFC9F4D0"/> <GradientStop Color="#FF2AC12A" Offset="0.333"/> <GradientStop Color="#FF35DE35" Offset="1"/> </LinearGradientBrush> </Grid.Background> <Canvas > <dataInput:Label Width="227" Foreground="Yellow" Canvas.Left="158" Canvas.Top="8" Content="{Binding Place}"/> <dataInput:Label Width="146" Foreground="Yellow" Canvas.Left="8" Canvas.Top="8" Content="{Binding Date}"/> <dataInput:Label Content="{Binding People}" Width="346" FontSize="9.333" Foreground="Black" Canvas.Left="166" Canvas.Top="28"/> <!-- <dataInput:Label Width="45" Content="Accept" Foreground="White" Canvas.Left="8" Canvas.Top="28"/> <dataInput:Label Width="45" Content="Decline" Foreground="White" Canvas.Left="57" Canvas.Top="28"/> --> <dataInput:Label Content="SomeText" Width="101" FontSize="9.333" Foreground="White" Canvas.Left="389" Canvas.Top="10"/> <Image Height="21" Width="21" Canvas.Left="500" Canvas.Top="8" Source="Green Button.png"/> </Canvas> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Any Thoughts?

    Read the article

  • In Log4Net XML configuration is Priority the same thing as Level?

    - by Michael Levy
    I inherited some code that uses the priority element under the root in its xml configuraiton. This is just like the example at http://iserialized.com/log4net-for-noobs/ which shows: <root> <priority value="ALL" /> <appender-ref ref="LogFileAppender" /> <appender-ref ref="ConsoleAppender"/> </root> However, the log4net configuration examples at http://logging.apache.org/log4net/release/manual/configuration.html always show it using the level element: <root> <level value="DEBUG" /> <appender-ref ref="A1" /> </root> In this type of configuration is <priority> the same as <level> ? Can someone point me to somewhere in the docs where this is explained?

    Read the article

  • Getting a borderless window to receive mouseMoved events (Cocoa OSX)

    - by Michael Minerva
    I have a little popup window used for selecting images sorted by groups, and I would like to add a selection box around whatever image is being hovered over. I am trying to this by overriding the mouseMoved event for the window but it seems that a window that has a border-less style mask receives no mouseMoved events even if you have set setAcceptsMouseMoved events to YES. Is there anyway to make a borderless window receive this events?

    Read the article

  • Need help accessing PHP DOM elements

    - by Michael Pasqualone
    Hey guys, I have the following HTML structure that I am trying to pull information from: // Product 1 <div class="productName"> <span id="product-name-1">Product Name 1</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse 1, ACT</span> <span class="quantityInStock">25</span> </div> // Product 2 <div class="productName"> <span id="product-name-2">Product Name 2</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse 2, ACT</span> <span class="quantityInStock">25</span> </div> … // Product X <div class="productName"> <span id="product-name-X">Product Name X</span> </div> <div class="productDetail"> <span class="warehouse">Warehouse X, ACT</span> <span class="quantityInStock">25</span> </div> I don't have control of the source html and as you'll see productName and it's accompanying productDetail are not contained within a common element. Now, I am using the following php code to try and parse the page. $html = new DOMDocument(); $html->loadHtmlFile('product_test.html'); $xPath = new DOMXPath($html); $domQuery = '//div[@class="productName"]|//div[@class="productDetail"]'; $entries = $xPath->query($domQuery); foreach ($entries as $entry) { echo "Detail: " . $entry->nodeValue) . "<br />\n"; } Which prints the following: Detail: Product Name 1 Detail: Warehouse 1, ACT Detail: 25 Detail: Product Name 2 Detail: Warehouse 2, ACT Detail: 25 Detail: Product Name X Detail: Warehouse X, ACT Detail: 25 Now, this is close to what I want. But I need to do some processing on each Product, Warehouse and Quantity stock and can't figure out how to parse it out into separate product groups. The final output I am after is something like: Product 1: Name: Product Name 1 Warehouse: Warehouse 1, ACT Stock: 25 Product 2: Name: Product Name 2 Warehouse: Warehouse 2, ACT Stock: 25 I can't just figure it out, and I can't wrap my head around this DOM stuff as the elements don't quite work the same as a standard array. If anyone can assist, or point me in the right direction I will be ever appreciative.

    Read the article

  • Check my anagram code from a job interview in the past.

    - by Michael Dorgan
    Had the following as an interview question a while ago and choked so bad on basic syntax that I failed to advance (once the adrenalin kicks in, coding goes out the window.) Given a list of string, return a list of sets of strings that are anagrams of the input set. i.e. "dog","god", "foo" should return {"dog","god"}. Afterward, I created the code on my own as a sanity check and it's been around now for a bit. I'd welcome input on it to see if I missed anything or if I could have done it much more efficiently. Take it as a chance to improve myself and learn other techniques: void Anagram::doWork(list input, list &output) { typedef list SortType; SortType sortedInput; // sort each string and pair it with the original for(list<string>::iterator i = input.begin(); i != input.end(); ++i) { string tempString(*i); std::sort(tempString.begin(), tempString.end()); sortedInput.push_back(make_pair(*i, tempString)); } // Now step through the new sorted list for(SortType::iterator i = sortedInput.begin(); i != sortedInput.end();) { set<string> newSet; // Assume (hope) we have a match and pre-add the first. newSet.insert(i->first); // Set the secondary iterator one past the outside to prevent // matching the original SortType::iterator j = i; ++j; while(j != sortedInput.end()) { if(i->second == j->second) { // If the string matches, add it to the set and remove it // so that future searches need not worry about it newSet.insert(j->first); j = sortedInput.erase(j); } else { // else, next element ++j; } } // If size is bigger than our original push, we have a match - save it to the output if(newSet.size() > 1) { output.push_back(newSet); } // erase this element and update the iterator i = sortedInput.erase(i); } }

    Read the article

  • perl ENV value avoid escape

    - by Michael
    In my makefile I have command in variable like this substitute := perl -p -e 's/@([^@]+)@/"$(update_url)"/ge' > output.txt update_url := em:updateURL=\"http:\/\/bla\/update.rdf\"\n this works fine when I run command in target and I have newline, quotes however I need to replace $(update_url)" with environment variable, using expression like this #substitute := perl -p -e 's/@([^@]+)@/defined $$ENV{$$1} ? $$ENV{$$1} : $$1/ge' I am exporting those variables from makefile. This gives me literally em:updateURL=\"http:\/\/bla\/update.rdf\"\n on output file... so how to make the second version to give output like first version?

    Read the article

  • Git: How to find all commits in branch A that originated in derived branch B merged back into A?

    - by Michael Ludwig
    In Git, given (1) a branch A and (2) a branch B derived from A at some point in the past and then merged back into A, how can I find all the commits now in A that originated in B? The intent is to identify the changeset of work performed in B now in A to more quickly track down issues. A squash commit would obviously and conveniently pack the entire changeset in one commit for easy reference, but the drawbacks (such as loss of information and individual attributability) make this option undesirable for us. Hence my question.

    Read the article

  • what makes a Tomcat5.5 cannot be "aware" of new Java Web Applications?

    - by Michael Mao
    This is for uni homework, but I reckon it is more a generic problem to the Tomcat Server(version 5.5.27) on my uni. The problem is, I first did a skeleton Java Web Application (Just a simple Servlet and a welcome-file, nothing complicated, no lib included) using NetBeans 6.8 with the bundled Tomcat 6.0.20 (localhost:8084/WSD) Then, to test and prove it is "portable" and "auto-deploy-able", I cleaned and built a WSD.war file and dropped it onto my Xampp Tomcat (localhost:8080/WSD). The war extracted everything accordingly and I can see identical output from this Tomcat. So far, so good. However, after I tried to drop to war onto uni server, funny thing happens: uni server Even though I've changed the war permission to 755, it is simply not "responding". I then copied the extracted files to uni server, the MainServlet cannot be recognized from within its Context Path "/WSD", basically nothing works, expect the static index.jsp. I tried several times to stop and restart uni Tomcat, it doesn't help? I wonder what makes this happen? Is there anything I did wrong with my approach? To be frank I paid no attention to a server not under my control, and I am unfortunately not a real active day-to-day Java Programmer now. I understand the fundamentals of MVC, Servelets, JSPs, JavaBeans, but I really feel frustrated by this, as I cannot see why... Or, should I ask, a Java Web Application, after cleaned and built by NetBeans6.8, is self-contained and self-configured so ready to be deployed to any Java Web Container? I know, I can certainly program everything in plain old JSP, but this is soooo... unacceptable to myself... Update : I am now wondering if there is any free Tomcat Hosting so that I would like to see if my war file and/or my web app can go with them without any configuration at all?

    Read the article

  • Visual studio feature - commenting code Ctrl K - Ctrl C

    - by Michael
    I commented on this answer some time ago regarding how visual studio comments out code with // or /* */. I was thinking to revise the answer (to include my findings) but I had to test it first, which kind of confused me. My finding is that depending on where your marker is when you press Ctrl - K, Ctrl - C you will get either // or /* */. So I tried it out on the following code: [1] [2]FD_ZERO(&mFSet); FD_SET(user->mSender, &mFSet); timeval zeroTime = { 0, 0 }; int sel = select(0, NULL, &mFSet, NULL, &zeroTime); [3] if (sel == SOCKET_ERROR){ [5]return false; [4] } if (sel == 0){ [6] return false; [7] } The [x] is markerpositions. All [1] positions give // for all marked lines. However Start position End Position: gives: [2] [3] : /* */ [2] [4] : // [2] [5] : /* */ [2] [more than 5] : // [5] [6] : /* */ [5] [7] : // I guess it has to do with forward indentation (not backwards), that whenever code is indented more than the starting line you get // except when you haven't selected any text on the indented line ([2] [5]). But why the distinction? Why not use /* */ for when you start at [2] and // when you start at [1]?

    Read the article

  • popup panel that docks to the bottom of the screen

    - by Michael Wiles
    How do I create a pop panel that docks to the bottom of the screen... The way that I'm doing this is by setting the styling as such: bottom: 10px; position: absolute; This will always set the panel to 10 px from the bottom of the browser window. The problem is that gwt (or gwtp for that matter) is insisting on setting the right and the top of the panel and thus overriding my styling. If I use chrome's element explorer and disable the right and top style rules I get the correct behaviour so one way of doing it is somehow disabling gwt setting of the location of the panel on the screen...?

    Read the article

  • PHP While Loops from Arrays

    - by Michael
    I have a table that contains members names and a field with multiple ID numbers. I want to create a query that returns results where any values in the ID fields overlap with any values in the array. For example: lastname: Smith firstname: John id: 101, 103 I have Array #1 with the values 101, 102, 103 I want the query to output all members who have the values 101 or 102 or 103 listed in their id field with multiple ids listed. Array ( [0] => 101 [1] => 102 [2] => 103 ) $sql="SELECT firstname, lastname, id FROM members WHERE id LIKE '%".$array_num_1."%'"; $result=mysql_query($sql); while ($rows=mysql_fetch_array($result)) { echo $rows['lastname'].', '.$rows['firstname'].'-'.$rows['id']; }

    Read the article

  • Cakephp Auth Flash Messages losing style

    - by Michael
    My Auth flash messages were working earlier -- a bright green background with text in it, such as "You have successfully logged out". However, I have made quite a few changes to the site since then, and this green background has disappeared. What are the possible causes of this? (I've run my CSS through a validator -- so that doesn't seem to be the issue). Any other ideas? Thanks!

    Read the article

  • Passing values from UIButton to an UIActionSheet

    - by Michael
    I'm trying to send an ActionSheet a variable from a button. I can't use the tag property because its being used for something else. I've declared myIndexRow as an instance variable and have: NSInteger myIndexRow = indexPath.row; [deleteButton addTarget:self action:@selector(showDeleteSheet:) forControlEvents:UIControlEventTouchUpInside]; deleteButton.myIndexRow = myIndexRow; but I'm getting the 'Request for member 'myRow' is something not a structure or union' There is something obvious I am missing here.

    Read the article

  • UITableView Reusable cells

    - by Michael
    Can someone explain me the way reusable cells works for single table view? How many reusable cells a datasource should create? So far in all samples I've seen only one. Would one even need more?

    Read the article

  • "_FILE_AND_LINE_ is not defined in this scope" (compiling RakNet NAT examples in OS X)

    - by Michael F
    Hello! I'm working on a RakNet-based project (using 3.8 on OS X 10.6), and I'm trying to work through the various examples that demonstrate the parts of RakNet I want to use. For the "NatCompleteClient" example, I've imported the source into a command-line project in XCode, along with the UPNP dependency. At compile time I've had a few errors in the UPNP section, though, and I can't find any guidance on this. In UPNPPortForwarder.mm, there are 7 lines that use _FILE_AND_LINE_, and the compiler is not happy; for example on line 232: foundInterfaces.Deallocate(r1,_FILE_AND_LINE_); causes: UPNPPortForwarder.mm:232: error: '_FILE_AND_LINE_' was not declared in this scope Can anyone tell me what this is all about? That variable doesn't seem to get talked about very often... or Google doesn't like to find it.

    Read the article

  • Error Downloading Metadata from ASMX Service

    - by michael.lukatchik
    It should be possible (and it looks like it is), but assume I have the following functions in my ASMX web service: [WebMethod(MessageName = "CreateExternalRpt1")] public bool CreateExternalRpt(int iProductId, int iOrderProductId, DateTime dtReportTime, string strReportTitle, string strReportCategory, string strReportPrintType, out string strSnapshot, string strApplicantFirst, string strApplicantLast, string strApplicantMiddle, string strOwnerLast, string strOwnerMiddle, string strOwnerFirst, bool blnCurrentReport, int iOrderId, bool blnFlag, string strCustomerId, string strUserId) { … } [WebMethod(MessageName = "CreateExternalRpt2")] public bool CreateExternalRpt(int iProductId, int iOrderProductId, DateTime dtReportTime, string strReportTitle, string strReportCategory, string strReportPrintType, string strReportSnapshot, string strApplicantFirst, string strApplicantLast, string strApplicantMiddle, string strOwnerLast, string strOwnerMiddle, string strOwnerFirst, bool blnCurrentReport, int iOrderId, bool blnFlag) { … } With both of these functions defined in my web service, my .NET client app can’t download the metadata and instead throws a generic error message “There was an error downloading…”. With one of the above methods removed, the .NET client app can successfully download the metadata. I’ve read that by decorating the WebMethod with a unique name, both functions should be exposed in the service metadata. This isn’t working. What am I missing?

    Read the article

< Previous Page | 66 67 68 69 70 71 72 73 74 75 76 77  | Next Page >