Daily Archives

Articles indexed Wednesday April 7 2010

Page 15/131 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Smart way to find the corresponding nullable type?

    - by Marc Wittke
    How could I avoid this dictionary (or create it dynamically)? Dictionary<Type,Type> CorrespondingNullableType = new Dictionary<Type, Type> { {typeof(bool), typeof(bool?)}, {typeof(byte), typeof(byte?)}, {typeof(sbyte), typeof(sbyte?)}, {typeof(char), typeof(char?)}, {typeof(decimal), typeof(decimal?)}, {typeof(double), typeof(double?)}, {typeof(float), typeof(float?)}, {typeof(int), typeof(int?)}, {typeof(uint), typeof(uint?)}, {typeof(long), typeof(long?)}, {typeof(ulong), typeof(ulong?)}, {typeof(short), typeof(short?)}, {typeof(ushort), typeof(ushort?)}, {typeof(Guid), typeof(Guid?)}, };

    Read the article

  • Windows service that will run every hour.

    - by user177883
    I m able to build a windows service and install it. I m curious how can i run this service every hour ? I want it to run every hour periodically. I also need to know the hour range that it s running so that I can store it somewhere. How can i do that? Edit : This service will be installed on many machines, therefore, I dont want to create a scheduled task say on 100 servers.

    Read the article

  • Parsing boolean from configuration section in web.config

    - by Bloopy
    I have a custom configuration section in my web.config. One of my classes is grabbing from this: <myConfigSection LabelVisible="" TitleVisible="true"/> I have things working for parsing if I have true or false, however if the attribute is blank I am getting errors. When the config section tries to map the class to the configuration section I get an error of "not a valid value for bool" on the 'LabelVisible' part. How can I parse "" as false in my myConfigSection class? I have tried this: [ConfigurationProperty("labelsVisible", DefaultValue = true, IsRequired = false)] public bool? LabelsVisible { get { return (bool?)this["labelsVisible"]; } But when I try and use what is returned like so: graph.Label.Visible = myConfigSection.LabelsVisible; I get an error of: 'Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?) Thanks for any suggestions!

    Read the article

  • Graphics/Bitmap Limits?

    - by Dean
    Im having some weird problems with Graphics and Bitmap. I have a Graphics Object that is displayed on a PictureBox and im capturing the MouseMove and MouseClick Events that give X and Y Position of the Mouse on the Image but if the Y Position goes Bigger then 32775 it then goes into Negatives which means everything breaks. And if the Image is Bigger then 65535 it then stops displaying the Image. Any Ideas how these problems can be fixed? Thanks Example Code: http://pastebin.com/YEX0XD1q Just Click Make 10,000 Bigger about 4 times then scroll down and on the right it will show the mouse X and Y position and as you move down through the image and hover over the Red Area if you go down enough it will go into Negative Y.

    Read the article

  • How do I get windows 7 to go full screen in boot camp?

    - by Ryan Michela
    I'm running Windows 7 on an iMac using Bootcamp. At the native resolution of 1290x1200, the desktop fills the entire screen, but when I run games at a lower resolution or reduce the suze of the desktop the visible area is reduced and a large black border surrounds the display. I want to run 1024x768 full screen, not letterboxed. Is there a way to do this? I suspect a problem with the drivers.

    Read the article

  • Flex Catch Keydown

    - by Antilogic
    I want to handle the keydown event globally in my application and as such have added the event handler to the top most DisplayObject in the display list. However, the event doesn't seem to fire unless the cursor focus is on a Textbox or Datagrid or the like. How can I have key presses handled globaly by the application?

    Read the article

  • Hibernate GenericDAO for parent/child relationships and DAO/DTO patterns

    - by Marco
    Hi, I'm looking for a Generic DAO implementation in Hibernate that includes parent/child relationship management (adding, removing, getting childs, setting parents, etc). Actually the most used generic DAO on the web is the one i found on http://community.jboss.org/wiki/GenericDataAccessObjects. And also, i was looking for some DAO/DTO sample implementations and design patterns. Do you know some good resources out there?

    Read the article

  • Rendering to a single Bitmap object from multiple threads

    - by Lee Treveil
    What im doing is rendering a number of bitmaps to a single bitmap. There could be hundreds of images and the bitmap being rendered to could be over 1000x1000 pixels. Im hoping to speed up this process by using multiple threads but since the Bitmap object is not thread-safe it cant be rendered to directly concurrently. What im thinking is to split the large bitmap into sections per cpu, render them separately then join them back together at the end. I haven't done this yet incase you guys/girls have any better suggestions. Any ideas? Thanks

    Read the article

  • Passing Objects between different files

    - by user309779
    Typically, if I want to pass an object to an instance of something I would do it like so... Listing 1 File 1: public class SomeClass { // Some Properties public SomeClass() { public int ID { get { return mID; } set { mID = value; } } public string Name { set { mName = value; } get { return mName; } } } } public class SomeOtherClass { // Method 1 private void Method1(int one, int two) { SomeClass USER; // Create an instance Squid RsP = new Squid(); RsP.sqdReadUserConf(USER); // Able to pass 'USER' to class method in different file. } } In this example, I was not able to use the above approach. Probably because the above example passes an object between classes. Whereas, below, things are defined in a single class. I had to use some extra steps (trial & error) to get things to work. I am not sure what I did here or what its called. Is it good programming practice? Or is there is an easier way to do this (like above). Listing 2 File 1: private void SomeClass1 { [snip] TCOpt_fM.AutoUpdate = optAutoUpdate.Checked; TCOpt_fM.WhiteList = optWhiteList.Checked; TCOpt_fM.BlackList = optBlackList.Checked; [snip] private TCOpt TCOpt_fM; TCOpt_fM.SaveOptions(TCOpt_fM); } File 2: public class TCOpt: { public TCOpt OPTIONS; [snip] private bool mAutoUpdate = true; private bool mWhiteList = true; private bool mBlackList = true; [snip] public bool AutoUpdate { get { return mAutoUpdate; } set { mAutoUpdate = value; } } public bool WhiteList { get { return mWhiteList; } set { mWhiteList = value; } } public bool BlackList { get { return mBlackList; } set { mBlackList = value; } } [snip] public bool SaveOptions(TCOpt OPTIONS) { [snip] Some things being written out to a file here [snip] Squid soSwGP = new Squid(); soSgP.sqdWriteGlobalConf(OPTIONS); } } File 3: public class SomeClass2 { public bool sqdWriteGlobalConf(TCOpt OPTIONS) { Console.WriteLine(OPTIONS.WhiteSites); // Nothing prints here Console.WriteLine(OPTIONS.BlackSites); // Or here } } Thanks in advance, XO

    Read the article

  • GPL/LGPL-licensed images + iPhone development

    - by cubic1271
    Since the majority of legal links / READMEs I've found when browsing icon sets refer me to the general GPL / LGPL (as opposed to a specialized version of some kind) when I'm looking at license restrictions, I'm having a terrible time trying to figure out what would constitute source code, linking, etc. when it comes to images and / or icons. One specific example: under section 5 of the GPL, modifications must carry notices in the source code. . . how do I do that with an image? I guess I could try to find a few unused bits and encode my modifications in there (steganography, anyone?), but somehow that doesn't seem like what the license is shooting for. There are also other sections in there where I have no idea how to begin to comply with. Thus, I'm really confused. What exactly are the implications of using GPL and / or LGPL licensed images in something that isn't itself GPL'd? Specifically, I'd like to know what using GPL icons in an iPhone application might mean from a legal point of view. It feels like I'm missing something obvious here; any enlightenment / references would be appreciated!

    Read the article

  • Backgroundworker abort

    - by MazarD
    Hi, I recently tried to use backgroundworker instead of "classic" threads and I'm realizing that it's causing, at least for me, more problems than solutions. I have a backgroundworker running a synchronous read (in this case from serialPort) and getting blocked around 30 seconds in 1 code line, then cancellationpending isn't the solution. I'm seeing that if the application gets closed at this point (either with the cross button and Application.Exit()) the process keeps zombie forever. I need a way to force abort or to kill the backgroundworker thread.

    Read the article

  • How to effectively copy an array in java ?

    - by Tony
    The toArray method in ArrayList , Bloch uses both System.arraycopy and Arrays.copyOf to copy an array . public <T> T[] toArray(T[] a) { if (a.length < size) // Make a new array of a's runtime type, but my contents: return (T[]) Arrays.copyOf(elementData, size, a.getClass()); System.arraycopy(elementData, 0, a, 0, size); if (a.length > size) a[size] = null; return a; } How to compare these two copy method , when to use which ? Thanks.

    Read the article

  • What are your recommended tools and frameworks for network development on Linux?

    - by Vivek Sharma
    What are your favourite network-tools, which you use to troubleshoot or design (as in conceptualize) your network-application code. Ethereal/Wireshark Nmap any particular simulators (e.g. ns) any special purpose sniffer any particular frameworks, (e.g. iptables) I am looking at must have, and good/advantage to have tools/framework in ones profile/skill set. I think Wireshark and Nmap are must haves.

    Read the article

  • Single Sign On-- SSO

    - by James
    Please I would like someone to tell me if dotNetOpenAuth single-sign-on. All I want to achieve is to be able to seamlessly logging to all domains without redirect to third party system for authorisation or Authentication within a mixture programming platforms e.g (PHP or .Net)

    Read the article

  • DataSet.GetXml not returning null results

    - by pistacchio
    Hi, whenever I convert a DatSet into an XML with DataSet.GetXml, any null value is ignored, so, where i expect this: <value1>a</value1> <value2></value2> <value3>c</value3> I get this instead: <value1>a</value1> <value3>c</value3> Any quick and dirty way to handle this? Thanks EDIT: I think a solution would be using WriteXml. Could anyone provide me with a sample of using it WITHOUT writing to a file but getting a string just like GetXml does? Thanks

    Read the article

  • Dijit.Dialog 1.4, setting size is limited to 600x400 no matter what size I set it.

    - by John Evans
    I'm trying to set the size of a dijit.Dialog, but it seems limited to 600x400, no matter what size I set it. I've copied the code from dojocampus and the dialog appear, but when i set the size larger, it only shows 600x400. Using firebug and selecting items inside the dialog, I see that they are larger than the dialog, but don't show correctly. I set it up to scroll, but the bottom of the scrollbar is out of view. In firebug, I've check the maxSize from _Widget and it is set to infinity. Here is my code to set the dialog. <div id="sized" dojoType="dijit.Dialog" title="My scrolling dialog"> <div style="width: 580px; height: 600px; overflow: scroll;"> Any suggestions for sizing the dialog box larger?

    Read the article

  • How to Use Images as Navigation with innerfade Slideshow?

    - by Katie
    I am very new to JavaScript and only have the most basic understanding of how it works, so please bear with me. :) I'm using the jquery.innerfade.js script to create a slideshow with fade transitions for a website I'm developing, and I have added navigation buttons (which are set as background-images) that navigate between the “slides”. The navigation buttons have three states: default/off, hover, and on (each state is a separate image). I created a separate JavaScript document to set the buttons to “on” when they are clicked. The “hover” state is achieved through the CSS. Both the slideshow and the navigation buttons work well. There is just one thing I want to add: I would like the appropriate navigation button to display as “on” while the related “slide” is “playing”. Here's the HTML: <div id="mainFeature"> <ul id="theFeature"> <li id="the1feature"><a href="#" name="#promo1"><img src="_images/carousel/promo1.jpg" /></a></li> <li id="the2feature"><a href="#" name="#promo2"><img src="_images/carousel/promo2.jpg" /></a></li> <li id="the3feature"><a href="#" name="#promo3"><img src="_images/carousel/promo3.jpg" /></a></li> </ul> <div id="promonav-con"> <div id="primarypromonav"> <ul class="links"> <li id="the1title" class="promotop"><a rel="1" href="#promo1" class="promo1" id="promo1" onMouseDown="promo1on()"><strong>Botox Cosmetic</strong></a></li> <li id="the2title" class="promotop"><a rel="2" href="#promo2" class="promo2" id="promo2" onMouseDown="promo2on()"><strong>Promo 2</strong></a></li> <li id="the3title" class="promotop"><a rel="3" href="#promo3" class="promo3" id="promo3" onMouseDown="promo3on()"><strong>Promo 3</strong></a></li> </ul> </div> </div> And here is the jquery.innerfade.js, with my changes: (function($) { $.fn.innerfade = function(options) { return this.each(function() { $.innerfade(this, options); }); }; $.innerfade = function(container, options) { var settings = { 'speed': 'normal', 'timeout': 2000, 'containerheight': 'auto', 'runningclass': 'innerfade', 'children': null }; if (options) $.extend(settings, options); if (settings.children === null) var elements = $(container).children(); else var elements = $(container).children(settings.children); if (elements.length > 1) { $(container).css('position', 'relative').css('height', settings.containerheight).addClass(settings.runningclass); for (var i = 0; i < elements.length; i++) { $(elements[i]).css('z-index', String(elements.length-i)).css('position', 'absolute').hide(); }; this.ifchanger = setTimeout(function() { $.innerfade.next(elements, settings, 1, 0); }, settings.timeout); $(elements[0]).show(); } }; $.innerfade.next = function(elements, settings, current, last) { $(elements[last]).fadeOut(settings.speed); $(elements[current]).fadeIn(settings.speed, function() { removeFilter($(this)[0]); }); if ((current + 1) < elements.length) { current = current + 1; last = current - 1; } else { current = 0; last = elements.length - 1; } this.ifchanger = setTimeout((function() { $.innerfade.next(elements, settings, current, last); }), settings.timeout); }; })(jQuery); // **** remove Opacity-Filter in ie **** function removeFilter(element) { if(element.style.removeAttribute){ element.style.removeAttribute('filter'); } } jQuery(document).ready(function() { jQuery('ul#theFeature').innerfade({ speed: 1000, timeout: 7000, containerheight: '291px' }); // jQuery('#mainFeature .links').children('li').children('a').attr('href', 'javascript:void(0);'); jQuery('#mainFeature .links').children('li').children('a').click(function() { clearTimeout(jQuery.innerfade.ifchanger); for(i=1;i<5;i++) { jQuery('#the'+i+'feature').css("display", "none"); //jQuery('#the'+i+'title').children('a').css("background-color","#226478"); } // if(the_widths[(jQuery(this).attr('rel')-1)]==960) { // jQuery("#vic").hide(); // } else { // jQuery("#vic").show(); // } // jQuery('#the'+(jQuery(this).attr('rel'))+'title').css("background-color", "#286a7f"); jQuery('#the'+(jQuery(this).attr('rel'))+'feature').css("display", "block"); clearTimeout(jQuery.innerfade.ifchanger); }); }); And the separate JavaScript that I created: function promo1on() {document.getElementById("promo1").className="promo1on"; document.getElementById("promo2").className="promo2"; document.getElementById("promo2").className="promo2"; } function promo2on() {document.getElementById("promo2").className="promo2on"; document.getElementById("promo1").className="promo1"; document.getElementById("promo3").className="promo3"; } function promo3on() {document.getElementById("promo3").className="promo3on"; document.getElementById("promo1").className="promo1"; document.getElementById("promo2").className="promo2"; } And, finally, the CSS: #mainFeature {float: left; width: 672px; height: 290px; margin: 0 0 9px 0; list-style: none;} #mainFeature li {list-style: none;} #mainFeature #theFeature {margin: 0; padding: 0; position: relative;} #mainFeature #theFeature li {position: absolute; top: 0; left: 0;} #promonav-con {width: 463px; height: 26px; padding: 0; margin: 0; position: absolute; z-index: 900; top: 407px; left: 283px;} #primarypromonav {padding: 0; margin: 0;} #mainFeature .links {padding: 0; margin: 0; list-style: none; position: relative; font-family: arial, verdana, sans-serif; width: 463px; height: 26px;} #mainFeature .links li.promotop {list-style: none; display: block; float: left; display: inline; margin: 0; padding: 0;} #mainFeature .links li a {display: block; float: left; display: inline; height: 26px; text-decoration: none; margin: 0; padding: 0; cursor: pointer;} #mainFeature .links li a strong {margin-left: -9999px;} #mainFeature .links li a.promo1 {background: url(../_images/carouselnav/promo1.gif); width: 155px;} #mainFeature .links li:hover a.promo1 {background: url(../_images/carouselnav/promo1_hover.gif); width: 155px;} #mainFeature .links li a.promo1:hover {background: url(../_images/carouselnav/promo1_hover.gif); width: 155px;} .promo1on {background: url(../_images/carouselnav/promo1_on.gif); width: 155px;} #mainFeature .links li a.promo2 {background: url(../_images/carouselnav/promo2.gif); width: 153px;} #mainFeature .links li:hover a.promo2 {background: url(../_images/carouselnav/promo2_hover.gif); width: 153px;} #mainFeature .links li a.promo2:hover {background: url(../_images/carouselnav/promo2_hover.gif); width: 153px;} .promo2on {background: url(../_images/carouselnav/promo2_on.gif); width: 153px;} #mainFeature .links li a.promo3 {background: url(../_images/carouselnav/promo3.gif); width: 155px;} #mainFeature .links li:hover a.promo3 {background: url(../_images/carouselnav/promo3_hover.gif); width: 155px;} #mainFeature .links li a.promo3:hover {background: url(../_images/carouselnav/promo3_hover.gif); width: 155px;} .promo3on {background: url(../_images/carouselnav/promo3_on.gif); width: 155px;} Hopefully this makes sense! Again, I'm very new to JavaScript/JQuery, so I apologize if this is a mess. I'm very grateful for any suggestions. Thanks!

    Read the article

  • How to generate Perlin Noise on an iPhone

    - by Andre
    Hi, I want to create an animated perlin noise on the iPhone, so I can ultimately do something like this: http://dl.dropbox.com/u/1977230/example.png I've looked and looked, but can't find anything similar or a way to actually display a Perlin Noise. I've been told to look at OpenGL ES, but even searching for an example of Perlin noise or a lava/plasma effect doesn't result in anything. I'd really appreciate some help on this one. Thanks guys, Andre

    Read the article

  • Pass potentially infinite number of arguments to array except a single numeric variable in a PHP com

    - by tehalive
    I'm trying to make a PHP script that will take a potentially infinite number of URLs from the command line as arguments. I also need to pass an argument that only has a single numeric value possible (to specify timeout), e.g.: ./urltest.php 60 url1.com url2.com url3.com I'm not exactly sure how to specify argv[1] to be a single numeric variable while at the same time the rest of the arguments (i.e. the list of urls) go into an array. Maybe something like: $timeout = $argv[1]; $args = func_get_args(); function numfilter($num) { return !is_numeric($num); } $urls = array_filters($args, 'numfilter'); ? Thanks in advance!

    Read the article

  • Advice for Storing and Displaying Dates and Times Across Different Time Zones

    A common question I receive from clients, colleagues, and 4Guys readers is for recommendations on how best to store and display dates and times in a data-driven web application. One of the challenges in storing and displaying dates in a web application is that it is quite likely that the visitors arriving at your site are not in the same time zone as your web server; moreover, it's very likely that your site attracts visitors from many different time zones from around the world. Consider an online messageboard site, like ASPMessageboard.com, where each of 1,000,000+ posts includes the date and time it was made. Imagine a user from New York leaves a post on April 7th at 4:30 PM and that the web server hosting the site is located in Dallas, Texas, which is one hour earlier than New York. When storing that post to the database do you record the post's date and time relative to the visitor (4:30 PM), the relative to the web server (3:30 PM), or some other value? And when displaying this post how do you show that date and time to a reader in San Francisco, which is three hours earlier than New York? Do you show the time relative to the person who made the post (4:30 PM), relative to the web server (3:30 PM), or relative to the user (1:30 PM)? And if you decide to store or display the date based on the poster's or visitor's time zone then how do you know their time zone and its offset? How do you account for daylight savings, and so on? This article provides guidance on how to store and display dates and times for visitors across different time zones and includes a demo that gives a working example of some of these techniques. Read on to learn more! Read More >

    Read the article

  • Enterprise user management

    - by Eduardo
    I am looking for an enterprise user management system that meets these requirements: Delegated user administration: The group manager should be able to grant access to his supervised employees (without having to contact any administrator either to grant access or maybe create users). A group manager should be able to create other groups and restrict any permission he already has where he can add supervised employees. If a manager removes access to a supervised group, then all the subgroups will also lose access. Web based User Interface. LDAP interface to query users and groups (or may not exist at all if it is integrated in a single application). Do you know if there are any system that meet these requirements?

    Read the article

  • Best motherboard power supply combo for backblaze server

    - by jin14
    Building a backblaze server as described in this article. http://blog.backblaze.com/ So 45 hard drives in one box. I'm making it a MSDPM 2010 server so I actually don't even need raid cards in there as MSDPM will figure out how to use all of the hard drives on it's own. So need to know what motherboard, CPU, power supply I should get. Primary hard drive : SSD 128GB Storage : 45 1.5GB sata drives OS : windows 2008 Backup software : Microsoft System center Data protection server 2010 Need to know Which mother board to buy which will support 45 SATA hard drives. Don't need a raid card. Which power supply can power all 45 hard drives, 1 ssd drive, motherboard. Best set of equipment that meets my needs wins

    Read the article

  • Is there a way to create a copy-on-write copy of a directory?

    - by BCS
    I'm thinking of a situation where I would have something that creates a copy of a directory, tweaks a few files, and then does some processing on the result. This wold be done fairly often, maybe a few dozen times a day. (The exact use case is testing patch submissions; dupe the code, patch it, build/test/report/etc.) What I'm looking for could be done by creating a new directory structure and populating it with hard links from the origonal. However this only works if all the tools you use delete and recreate files rather than edit them in place. Is there a way to have the file system do copy-on-write for a file? Note: I'm aware that many FSs use COW at a block level (all updates are done via writes to new blocks) but this is not what I want.

    Read the article

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