Search Results

Search found 261 results on 11 pages for 'timothy miller'.

Page 6/11 | < Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Are web-safe colors still relevant?

    - by Gavin Miller
    Since the vast majority of monitors are 16-bit color or more, including mobile devices, does it make sense to even consider web-safe colors when choosing color schemes? Or is it something that ought to be relegated to history as a piece of trivia? For those of you that don't know what web-safe colors are: Another set of 216 color values is commonly considered to be the "web-safe" color palette, developed at a time when many computer displays were only capable of displaying 256 colors. A set of colors was needed that could be shown without dithering on 256-color displays; the number 216 was chosen partly because computer operating systems customarily reserved sixteen to twenty colors for their own use; it was also selected because it allows exactly six shades each of red, green, and blue (6 × 6 × 6 = 216). The list of colors is often presented as if it has special properties that render them immune to dithering. In fact, on 256-color displays applications can set a palette of any selection of colors that they choose, dithering the rest. These colors were chosen specifically because they matched the palettes selected by the then leading browser applications. [Wikipedia]

    Read the article

  • RegistryKey ValueCount/SubKeyCount wrong

    - by Mark J Miller
    I am trying to query the following registry key values: HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\SharedMemoryOn HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib\ProtocolOrder But depending on which machine I'm running the program the query returns null. When I debug on my local machine and I inspect the value for ValueCount for: HKLM\SOFTWARE\Microsoft\MSSQLServer\Client HKLM\SOFTWARE\Microsoft\MSSQLServer\Client\SuperSocketNetLib The count is 0 and OpenSubKey returns null. I am a domain admin, in the local administrators group and have added the following to my app.manifest: <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> Any idea why? private static void ValidateSqlClientSettings() { Console.WriteLine("\r\n/////////////// LOCAL SQL CLIENT PROTOCOLS ////////////////"); RegistryKey keyHKLM = Registry.LocalMachine; ///TODO: nullreferenceexception - connect to remote machine and find out why RegistryKey sqlClientKey = keyHKLM.OpenSubKey(@"SOFTWARE\Microsoft\MSSQLServer\Client"); if (sqlClientKey == null) { WriteLine2Console(@"WARNING: unable to read registry key '{0}\SOFTWARE\Microsoft\MSSQLServer\Client'", ConsoleColor.Yellow); } var cliKeyNames = from k in sqlClientKey.GetSubKeyNames() where k == "SuperSocketNetLib" select k; ///TODO: find out why these values are always missing (even if I can see them in regedit) Console.Write("Shared Memory Disabled (cliconfg): "); if (Convert.ToBoolean(sqlClientKey.GetValue("SharedMemoryOn"))) WriteLine2Console("FAILED", ConsoleColor.Red); else if(sqlClientKey.GetValue("SharedMemoryOn") == null) WriteLine2Console(String.Format("WARNING - unable to read '{0}\\SharedMemoryOn'", sqlClientKey.Name), ConsoleColor.Yellow); else WriteLine2Console("PASS", ConsoleColor.Green); Console.Write("Client Protocol Order (cliconfg - tcp first): "); foreach (string cliKey in cliKeyNames) { RegistryKey subKey = sqlClientKey.OpenSubKey(cliKey); object order = subKey.GetValue("ProtocolOrder"); if (order != null && order.ToString().StartsWith("tcp") == false) { WriteLine2Console("FAILED", ConsoleColor.Red); } else if (order == null) { WriteLine2Console(String.Format("WARNING - unable to read '{0}\\ProtocolOrder'", subKey.Name), ConsoleColor.Yellow); } else { WriteLine2Console("PASS", ConsoleColor.Green); } subKey.Close(); } sqlClientKey.Close(); keyHKLM.Close(); }

    Read the article

  • Rails fields_for :child_index option explanation

    - by Timothy
    I have been trying to create a complex form with many nested models, and make it dynamic. Now I found that making a nested model isn't difficult with accepts_nested_attributes_for, but making it nested and dynamic was seemingly impossible if there were multiple nested models. I came across http://github.com/ryanb/complex-form-examples/blob/master/app/helpers/application_helper.rb which does it very elegantly. Could anyone shed some light on lines 13 and 16? 13 form_builder.object.class.reflect_on_association(method).klass.new and 16 form_builder.fields_for(method, options[:object], :child_index => "new_#{method}") do |f| From intuition, line 13 instantiates a new object, but why must it do so many method calls? I couldn't find any documentation for the :child_index option on line 16. When the form is created, a very large number is used as an index for new models, whereas existing models are indexed by their id. How does this work?

    Read the article

  • In TSQL (SQL Server), How do I insert multiple rows WITHOUT repeating the "INSERT INTO dbo.Blah" par

    - by Timothy Khouri
    I know I've done this before years ago, but I can't remember the syntax, and I can't find it anywhere due to pulling up tons of help docs and articles about "bulk imports". Here's what I want to do, but the syntax is not exactly right... please, someone who has done this before, help me out :) INSERT INTO dbo.MyTable (ID, Name) VALUES (123, 'Timmy'), (124, 'Jonny'), (125, 'Sally') I know that this is close to the right syntax. I might need the word "BULK" in there, or something, I can't remember. Any idea?

    Read the article

  • SMO ManagedComputer.ServiceInstances is empty

    - by Mark J Miller
    I am trying to use SMO (VS 2010, SQL Server 2008) to connect to SQL Server and view the server protocol configuration. I can connect and list the Services and ClientProtocols as well as the account MSSQLSERVER service is running under. However, the ServerInstances collection is empty. The only instance on the target server is the default (MSSQLSERVER), shouldn't that be in the collection? How can I get an instance of it so I can inspect the ServerProtocols collection? Here's the code I'm using: class Program { static void Main(string[] args) { //machine hosting installed sql server instance ManagedComputer host = new ManagedComputer("dev-it-db01.dev.interbankfx.lcl"); //ManagedComputer host = new ManagedComputer("MRW-IT-DTP69"); if (host.ServerInstances.Count != 0) { //why is this 0? Is it because only the DEFAULT instance exists? Console.WriteLine("/////////////// INSTANCES ////////////////"); foreach (ServerInstance inst in host.ServerInstances) { Console.WriteLine(inst.Name); } } Console.WriteLine("/////////////// SERVICES ////////////////"); // enumerate sql services (looking for MSSSQLSERVER) foreach (Service svc in host.Services) { Console.WriteLine(svc.Name); } Console.WriteLine("/////////////// DETAILS ////////////////"); // get name of MSSQLSERVER instance from user (pick from list above) Service mssqlserver = host.Services["MSSQLSERVER"]; // print service account: .\{account} == "local account", "LocalSystem", "NetworkService", {domain}\{account} == "domain account" Console.WriteLine("Service Account: {0}", mssqlserver.ServiceAccount); // get client protocols foreach (ClientProtocol cp in host.ClientProtocols) { Console.WriteLine("{0} {1} ({2})", cp.Order, cp.DisplayName, cp.IsEnabled ? "Enabled" : "Disabled"); } } } I've also tried: Urn u = new Urn("ManagedComputer[@Name=dev-it-db01.dev.interbankfx.lcl]/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']"); ServerProtocol tcp = host.GetSmoObject(u) as ServerProtocol; if (tcp != null) { Console.WriteLine("{0}", tcp.DisplayName); } But I get an error message stating: "child expressions are not supported." Any ideas what's wrong?

    Read the article

  • WPF: Once I set a property in code, it ignores XAML binding forever more... how do I prevent that?

    - by Timothy Khouri
    I have a button that has a datatrigger that is used to disable the button if a certain property is not set to true: <Button Name="ExtendButton" Click="ExtendButton_Click" Margin="0,0,0,8"> <Button.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding IsConnected}" Value="False"> <Setter Property="Button.IsEnabled" Value="False" /> </DataTrigger> </Style.Triggers> </Style> </Button.Style> That's some very simple binding, and it works perfectly. I can set "IsConnected" true and false and true and false and true and false, and I love to see my button just auto-magically become disabled, then enabled, etc. etc. However, in my Button_Click event... I want to: Disable the button (by using ExtendButton.IsEnabled = false;) Run some asynchronous code (that hits a server... takes about 1 second). Re-enable the button (by using ExtendButton.IsEnabled = true;) The problem is, the very instant that I manually set IsEnabled to either true or false... my XAML binding will never fire again. This makes me very sad :( I wish that IsEnabled was tri-state... and that true meant true, false meant false and null meant inherit. But that is not the case, so what do I do?

    Read the article

  • C# NullReferenceException when passing DataTable

    - by Timothy
    I've been struggling with a NullReferenceException and hope someone here will be able to point me in the right direction. I'm trying to create and populate a DataTable and then show the results in a DataGridView control. The basic code follows, and Execution stops with a NullReferenceException at the point where I invoke the new UpdateResults_Delegate. Oddly enough, I can trace entries.Rows.Count successfully before I return it from QueryEventEntries, so I can at least show 1) entries is not a null reference, and 2) the DataTable contains rows of data. I know I have to be doing something wrong, but I just don't know what. private delegate void UpdateResults_Delegate(DataTable entries); private void UpdateResults(DataTable entries) { dataGridView.DataSource = entries; } private void button_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(PerformQuery)); t.Start(); } private void PerformQuery() { DateTime start = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, 0, 0, 0); DateTime stop = new DateTime(dateTimePicker2.Value.Year, dateTimePicker2.Value.Month, dateTimePicker2.Value.Day, 0, 0, 0); DataTable entries = QueryEventEntries(start, stop); Invoke(new UpdateResults_Delegate(UpdateResults), entries); } private DataTable QueryEventEntries(DateTime start, DateTime stop) { DataTable entries = new DataTable(); entries.Columns.Add("colEventType", typeof(Int32)); entries.Columns.Add("colTimestamp", typeof(Int32)); entries.Columns.Add("colDetails", typeof(String)); ... conn.Open(); using (SqlDataReader r = cmd.ExecuteReader()) { while (r.Read()) { entries.Rows.Add(result.GetInt32(0), result.GetInt32(1), result.GetString(2)); } } return entries; }

    Read the article

  • jQuery Tools alert works once (but only once)

    - by Jim Miller
    I'm trying to build a simple alert mechanism with jQuery Tools -- in response to a bit of Javascript code, pop up an overlay with a message and an OK button that, when clicked, makes the overlay go away. Trivial, or it should be. I've been slavishly following http://flowplayer.org/tools/demos/overlay/trigger.html, and have something that works fine the first time it's invoked, but only that time. If I repeat the JS action that should expose the overlay, it doesn't. My content/DIV: <div class='modal' id='the_alert'> <div id='modal_content' class='modal_content'> <h2>hi there</h2> this is the body <p> <button class='close'>OK</button> </p> </div> <div id='modal_background' class='modal_background'><img src='/images/overlay/f9f9f9-180.png' class='stretch' alt='' /></div> </div> and the Javascript: function showOverlayDialog() { $('#the_alert').overlay({ mask: {color: '#cccccc', loadSpeed: 200, opacity: 0.9}, closeOnClick: false, load: true }); } As I said: When showOverlayDialog() is invoked the first time, the overlay appears just like it should, and goes away when the "OK" button is clicked. But if I cause showOverlayDialog() to run again, without reloading the page, nothing happens. If I reload the page, then the pattern repeats -- the first invocation brings up the overlay, but the second one doesn't. I'm obviously missing something -- any advice out there? Thanks!

    Read the article

  • Why This Maintainability Index Increase?

    - by Timothy
    I would be appreciative if someone could explain to me the difference between the following two pieces of code in terms of Visual Studio's Code Metrics rules. Why does the Maintainability Index increase slightly if I don't encapsulate everything within using ( )? Sample 1 (MI score of 71) public static String Sha1(String plainText) { using (SHA1Managed sha1 = new SHA1Managed()) { Byte[] text = Encoding.Unicode.GetBytes(plainText); Byte[] hashBytes = sha1.ComputeHash(text); return Convert.ToBase64String(hashBytes); } } Sample 2 (MI score of 73) public static String Sha1(String plainText) { Byte[] text, hashBytes; using (SHA1Managed sha1 = new SHA1Managed()) { text = Encoding.Unicode.GetBytes(plainText); hashBytes = sha1.ComputeHash(text); } return Convert.ToBase64String(hashBytes); } I understand metrics are meaningless outside of a broader context and understanding, and programmers should exercise discretion. While I could boost the score up to 76 with return Convert.ToBase64String(sha1.ComputeHash(Encoding.Unicode.GetBytes(plainText))), I shouldn't. I would clearly be just playing with numbers and it isn't truly any more readable or maintainable at that point. I am curious though as to what the logic might be behind the increase in this case. It's obviously not line-count.

    Read the article

  • How to drill down with jQuery?

    - by Timothy Reed
    I'm new to jQuery so sorry if this sounds stupid but I'm having truble drilling down to other elemnts. Paticularly I want to fade in the .menu li a:hover class with jquery. .menu { padding:0; margin:0; list-style:none; } .menu li { float:left; margin-left:1px; } .menu li a { display:block; height:44px; line-height:40px; padding:0 5px; float:right; color:#fff; text-decoration:none; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:12px; font-weight:bold; } .menu li a b { text-transform:uppercase; } .menu li a:hover { color:#E4FFC5; background: url(../images/arrow.png) no-repeat center bottom; } .current { background: url(../images/arrow.png) no-repeat center bottom; font-size:16px; font-weight:bold; } .spacer p { display:block; height:44px; line-height:40px; padding:0 5px; float:right; color:#fff; text-decoration:none; font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif; font-size:12px; font-weight:bold; } <ul class="menu"> <li class="current"><a href="index.html">Home</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Mission &amp; Values </a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Caregivers</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Special Programs </a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Enployment</a></li> <li class="spacer"> <p>|</p> </li> <li><a href="#">Contact</a></li> </ul> <script type="text/javascript"> $(function() { $('a').mouseover(function() { $('.logo').animate ({opacity:'0.6'}, 'normal'); }); $('a').mouseout (function() { $('.logo').animate ({opacity:'1'}, 'normal'); $('.menu li a:hover').fadeIn ('slow'); }); </script>

    Read the article

  • Using Unix Process Controll Methods in Ruby

    - by John F. Miller
    Ryan Tomayko touched off quite a fire storm with this post about using Unix process control commands. We should be doing more of this. A lot more of this. I'm talking about fork(2), execve(2), pipe(2), socketpair(2), select(2), kill(2), sigaction(2), and so on and so forth. These are our friends. They want so badly just to help us. I have a bit of code (a delayed_job clone for DataMapper that I think would fit right in with this, but I'm not clear on how to take advantage of the listed commands. Any Ideas on how to improve this code? def start say "*** Starting job worker #{@name}" t = Thread.new do loop do delay = Update.work_off(self) break if $exit sleep delay break if $exit end clear_locks end trap('TERM') { terminate_with t } trap('INT') { terminate_with t } trap('USR1') do say "Wakeup Signal Caught" t.run end end

    Read the article

  • What is a good motivating example for dataflow concurrency?

    - by Alex Miller
    I understand the basics of dataflow programming and have encountered it a bit in Clojure APIs, talks from Jonas Boner, GPars in Groovy, etc. I know it's prevalent in languages like Io (although I have not studied Io). What I am missing is a compelling reason to care about dataflow as a paradigm when building a concurrent program. Why would I use a dataflow model instead of a mutable state+threads+locks model (common in Java, C++, etc) or an actor model (common in Erlang or Scala) or something else? In particular, while I know of library support in the languages above (and Scala and Ruby), I don't know of a single program or library that is a poster child user of this model. Who is using it? Why do they find it better than the other models I mentioned?

    Read the article

  • Alternatives to CAT.NET for website security analysis

    - by Gavin Miller
    I'm looking for an alternative tool to CAT.NET for performing static security scans on .NET code. Currently the CAT.NET tooling/development is at a somewhat fragile stage and doesn't offer the reliability that I'm looking for. Are there any alternative static code analyzers that you use for detecting security issues?

    Read the article

  • Clojure lots of threads

    - by Timothy Baldridge
    I just got done watching Rick Hickey's "Clojure Concurrency" talk, and I have a few questions about threads. Let's say I have a situation with lots of Agents, let's say 10,000 of them running one machine. I'd rather not have 10,000 CPU threads running at once, but I don't want threads to be blocked by the actions of other threads. In this example I won't really be waiting for replies, instead each Agent will be sending a message or two, and then waiting until it gets a message. How would I structure a program like this without getting 10k OS threads which would probably end up slowing the system down.

    Read the article

  • Numerical Pattern Matching

    - by Timothy Strimple
    A project I'm researching requires some numerical pattern matching. My searches haven't turned up many relevant hits since most results tend to be around text pattern matching. The idea is we'll have certain wave patterns we'll need to be watching for and trying to match incoming data vs the wave database we will be building. Here is and example of one of the wave patterns we'll need to be matching against. There is clearly a pattern there, but the peaks will not have the exact same values, but the overall shape of the wave iterations will be very similar. Does anyone have any advice on how to go about storing and later matching these patterns, and / or other search terms I can use to find more information on the subject of pattern matching? Thanks, Tim.

    Read the article

  • How to generate a Program template by generating an abstract class

    - by Byron-Lim Timothy Steffan
    i have the following problem. The 1st step is to implement a program, which follows a specific protocol on startup. Therefore, functions as onInit, onConfigRequest, etc. will be necessary. (These are triggered e.g. by incoming message on a TCP Port) My goal is to generate a class for example abstract one, which has abstract functions as onInit(), etc. A programmer should just inherit from this base class and should merely override these abstract functions of the base class. The rest as of the protocol e.g. should be simply handled in the background (using the code of the base class) and should not need to appear in the programmers code. What is the correct design strategy for such tasks? and how do I deal with, that the static main method is not inheritable? What are the key-tags for this problem? (I have problem searching for a solution since I lack clear statements on this problem) Goal is to create some sort of library/class, which - included in ones code - results in executables following the protocol. EDIT (new explanation): Okay let me try to explain more detailled: In this case programs should be clients within a client server architecture. We have a client server connection via TCP/IP. Each program needs to follow a specific protocol upon program start: As soon as my program starts and gets connected to the server it will receive an Init Message (TcpClient), when this happens it should trigger the function onInit(). (Should this be implemented by an event system?) After onInit() a acknowledgement message should be sent to the server. Afterwards there are some other steps as e.g. a config message from the server which triggers an onConfig and so on. Let's concentrate on the onInit function. The idea is, that onInit (and onConfig and so on) should be the only functions the programmer should edit while the overall protocol messaging is hidden for him. Therefore, I thought using an abstract class with the abstract methods onInit(), onConfig() in it should be the right thing. The static Main class I would like to hide, since within it e.g. there will be some part which connects to the tcp port, which reacts on the Init Message and which will call the onInit function. 2 problems here: 1. the static main class cant be inherited, isn it? 2. I cannot call abstract functions from the main class in the abstract master class. Let me give an Pseudo-example for my ideas: public abstract class MasterClass { static void Main(string[] args){ 1. open TCP connection 2. waiting for Init Message from server 3. onInit(); 4. Send Acknowledgement, that Init Routine has ended successfully 5. waiting for Config message from server 6..... } public abstract void onInit(); public abstract void onConfig(); } I hope you get the idea now! The programmer should afterwards inherit from this masterclass and merely need to edit the functions onInit and so on. Is this way possible? How? What else do you recommend for solving this? EDIT: The strategy ideo provided below is a good one! Check out my comment on that.

    Read the article

  • ClickOnce: How do I pass a querystring value to my app *through the installer*?

    - by Timothy Khouri
    My company currently builds separate MSI's for all of our clients, even though the app is 100% the same across the board (with a single exception, an ID in the app.config). I would like to show them that we can publish in once place with ClickOnce, and simply add a query string parameter for each client's installer. Example: http://mysite.com/setup.exe?ID=1234-56-7890 The issue that I'm having is that the above ("ID=1234...") is not being passed along to the "myapplication.application". What is happening instead is, the app is being installed successfully, and it is running the first time with an activation context, but the "ActivationUri" does not contain any query string values. Is there a way to pass query string values FROM THE INSTALLER URL to the application's launch URL? If so, how?

    Read the article

  • Converting kernel image from ELF to PE

    - by Frank Miller
    I am using Msys to build a home brew kernel that I wrote under Linux. Linux used ELF for its binary format and Msys uses PE. I have the source setup to allow it to be booted by Grub using the Multiboot spec. At the end of the build, I get some undefined symbols: init.o:init.S:(.text+0x14): undefined reference to `edata' main.o:main.c:(.text+0x121): undefined reference to `_alloca' main.o:main.c:(.text+0x126): undefined reference to `__main' ../../lib\libkern.a(mem.o):mem.c:(.text+0x242): undefined reference to `_end' ../../lib\libkern.a(mem.o):mem.c:(.text+0x323): undefined reference to `_end' These appear to be ELF oriented symbols. If anyone can advise me on how these should be dealt with in the PE world, e.g. if there are equivalents, it would help me out a lot!

    Read the article

  • Why Does This Maintainability Index Increase?

    - by Timothy
    I would be appreciative if someone could explain to me the difference between the following two pieces of code in terms of Visual Studio's Code Metrics rules. Why does the Maintainability Index increase slightly if I don't encapsulate everything within using ( )? Sample 1 (MI score of 71) public static String Sha1(String plainText) { using (SHA1Managed sha1 = new SHA1Managed()) { Byte[] text = Encoding.Unicode.GetBytes(plainText); Byte[] hashBytes = sha1.ComputeHash(text); return Convert.ToBase64String(hashBytes); } } Sample 2 (MI score of 73) public static String Sha1(String plainText) { Byte[] text, hashBytes; using (SHA1Managed sha1 = new SHA1Managed()) { text = Encoding.Unicode.GetBytes(plainText); hashBytes = sha1.ComputeHash(text); } return Convert.ToBase64String(hashBytes); } I understand metrics are meaningless outside of a broader context and understanding, and programmers should exercise discretion. While I could boost the score up to 76 with return Convert.ToBase64String(sha1.ComputeHash(Encoding.Unicode.GetBytes(plainText))), I shouldn't. I would clearly be just playing with numbers and it isn't truly any more readable or maintainable at that point. I am curious though as to what the logic might be behind the increase in this case. It's obviously not line-count.

    Read the article

  • Why does the BigFraction class in the Apache-Commons-Math library return incorrect division results?

    - by Timothy Lee Russell
    In the spirit of using existing, tested and stable libraries of code, I started using the Apache-Commons-Math library and its BigFraction class to perform some rational calculations for an Android app I'm writing called RationalCalc. It works great for every task that I have thrown at it, except for one nagging problem. When dividing certain BigFraction values, I am getting incorrect results. If I create a BigFraction with the inverse of the divisor and multiply instead, I get the same incorrect answer but perhaps that is what the library is doing internally anyway. Does anyone know what I am doing wrong? The division works correctly with a BigFraction of 2.5 but not 2.51, 2.49, etc... // *** incorrect! *** BigFraction one = new BigFraction(1.524); //one: 1715871458028159 / 1125899906842624 BigFraction two = new BigFraction(2.51); //two: 1413004383087493 / 562949953421312 BigFraction three = one.divide(two); //three: 0 Log.i("solve", three.toString()); //should be 0.607171315 ?? //returns 0 // *** correct! **** BigFraction four = new BigFraction(1.524); //four: 1715871458028159 / 1125899906842624 BigFraction five = new BigFraction(2.5); //five: 5 / 2 BigFraction six = four.divide(five); //six: 1715871458028159 / 2814749767106560 Log.i("solve", six.toString()); //should be 0.6096 ?? //returns 0.6096

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >