Daily Archives

Articles indexed Tuesday June 15 2010

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

  • How do I turn off a custom IValueConverter at design time?

    - by Jonathan Allen
    How do I turn off a custom IValueConverter at design time? Basically I want to write this: Public Class MethodBinder Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert If [DESIGN_TIME] Then Return Nothing If value IsNot Nothing Then Return CallByName(value, CStr(parameter), CallType.Method) Return Nothing End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack Throw New NotSupportedException End Function End Class

    Read the article

  • serialport or USB port?

    - by I__
    i am using this code:: http://stackoverflow.com/questions/3033324/c-serialport-question/3033402#3033402 to check what port my USB phone is connected to. supposedly USB would be a virtual com, but this seems to be incorrect i used the above code to detect where my phone is and the output is just garbage. is there a way for me to get c# to speak to my usb port so that i can speak to the gsm phone connected to it?

    Read the article

  • How can I get my setup.py to use a relative path to my files?

    - by Chris B.
    I'm trying to build a Python distribution with distutils. Unfortunately, my directory structure looks like this: /code /mypackage __init__.py file1.py file2.py /subpackage __init__.py /build setup.py Here's my setup.py file: from distutils.core import setup setup( name = 'MyPackage', description = 'This is my package', packages = ['mypackage', 'mypackage.subpackage'], package_dir = { 'mypackage' : '../mypackage' }, version = '1', url = 'http://www.mypackage.org/', author = 'Me', author_email = '[email protected]', ) When I run python setup.py sdist it correctly generates the manifest file, but doesn't include my source files in the distribution. Apparently, it creates a directory to contain the source files (i.e. mypackage1) then copies each of the source files to mypackage1/../mypackage which puts them outside of the distribution. How can I correct this, without forcing my directory structure to conform to what distutils expects?

    Read the article

  • Using Outlook 2007 as PoP client with Gmail account

    - by goldenmean
    Hello, I recently started using outlook-2007 with my gmail account. I am using PoP settings in Outlook-2007 to access my gmail. In my gmail settings i have set the option as : Enable POP for mail that arrives from now on 1] How can download some messages from past already received in my gmail inbox to my outlook inbox ? 2] How can i selectively download messages from gmail to my outlook. thank you. -AD

    Read the article

  • Activity monitor doesnt display process name

    - by Mohsin Khawas
    Hi, I have an application, when I see that application in "Activity Monitor" the applications Process Name is displayed nothing. Only the application icon is displayed. I tried debugging this by getting processInfo of the app, I got the application name correct. Even tried with the "top" command, I got the application name correct. The target name and settings also shows the same, only the activity monitor got wrong. Is it something I missed so that activity monitor is displaying nothing. M

    Read the article

  • Implementing prototypes OR instantiating class objects

    - by intuited
    I'm wondering how to implement prototypal inheritance in Python. It seems like the way to do this would be to either use a metaclass to cause instantiations to actually be classes, rather than objects, or use some magical powers to transform an existing object into a class. The second method would seem to be more flexible, in that it could be applied to existing objects of varied types, while the first would likely be more convenient for typical use cases. Insights on the practicality of these two approaches, as well as alternative suggestions, are hereby requested.

    Read the article

  • Rails log management

    - by ambertch
    I'm starting to get overwhelmed using VI to search through my logs to chase down login errors and would like a better solution. I know Newrelic is highly recommended, though was wondering if there was something free I could try for the short term. Thanks!

    Read the article

  • How do I defer execution of some Ruby code until later and run it on demand in this scenario?

    - by Kyle Kaitan
    I've got some code that looks like the following. First, there's a simple Parser class for parsing command-line arguments with options. class Parser def initialize(&b); ...; end # Create new parser. def parse(args = ARGV); ...; end # Consume command-line args. def opt(...); ...; end # Declare supported option. def die(...); ...; end # Validation handler. end Then I have my own Parsers module which holds some metadata about parsers that I want to track. module Parsers ParserMap = {} def self.make_parser(kind, desc, &b) b ||= lambda {} module_eval { ParserMap[kind] = {:desc => "", :validation => lambda {} } ParserMap[kind][:desc] = desc # Create new parser identified by `<Kind>Parser`. Making a Parser is very # expensive, so we defer its creation until it's actually needed later # by wrapping it in a lambda and calling it when we actually need it. const_set(name_for_parser(kind), lambda { Parser.new(&b) }) } end # ... end Now when you want to add a new parser, you can call make_parser like so: make_parser :db, "login to database" do # Options that this parser knows how to parse. opt :verbose, "be verbose with output messages" opt :uid, "user id" opt :pwd, "password" end Cool. But there's a problem. We want to optionally associate validation with each parser, so that we can write something like: validation = lambda { |parser, opts| parser.die unless opts[:uid] && opts[:pwd] # Must provide login. } The interface contract with Parser says that we can't do any validation until after Parser#parse has been called. So, we want to do the following: Associate an optional block with every Parser we make with make_parser. We also want to be able to run this block, ideally as a new method called Parser#validate. But any on-demand method is equally suitable. How do we do that?

    Read the article

  • retain drop down value page posting back to itself asp.net

    - by d3020
    I have an aspx page that has... if (!IsPostBack) { PopulateBrand(); in the Page_Load. This PopulateBrand() simply populates my drop down. That works great and on post back it retains the value. The problem I'm having is that there is also a link on the page that is posting back some parameters to this page. What is happening is that when this is clicked it's falling through this !IsPostBack section and wiping out my drop down values that I had selected and repopulating it. How can I prevent this and just retain what I selected when this page is posting back to itself when the link is clicked? Thanks.

    Read the article

  • Composition vs Inheritance and GUI toolkits

    - by Anin Teger
    It's said that composition is preferred over inheritance. Every single open source GUI toolkit however uses inheritance for the drawn widgets (windows, labels, frames, buttons, etc). I checked Qt, wxWidgets, and GTK+. Is there an example of a GUI toolkit (written in any language) that uses composition instead of inheritance to separate the various widgets?

    Read the article

  • Converting a company from SVN to Hg?

    - by Michael
    We're a heavy user of SVN here. While the advantages of GIT over SVN made us want to change, the advantages of Hg over SVN mean it's now time to change and we need to start doing so very soon. I'm not so worried on the client side, but here are my questions. There are some excellent books on setting file metaproperties, properly organizing projects, etc on SVN. What is that book(s) for Hg? Is there a way to convert an SVN repository (that you've used) and can report how well it went? We don't want to lose years of commit logs if possible. When you DO convert, how did you split up the old code? Did you commit trunk as one project, and tags/forks as another? If you used SVN for legacy work, did you check in updates to SVN or something else?

    Read the article

  • ANT propertyfile entry is not resolving to its value

    - by Brian
    I have a value in a properties file that I want to increment while the build is running. The goal is to copy a set of files and append a number to the front of each in order to maintain the order in which they were copied into the directory. I am using the <propertyfile> task as follows: <propertyfile file="jsfiles.properties"> <entry key="file.number" type="int" operation="=" value="10" /> <entry key="file.number" type="int" default="010" operation="+" value="10" pattern="000" /> </propertyfile> Then I do the copy: <copy todir="${js-in.dir}"> <resources> ... </resources> <chainedmapper> <flattenmapper /> <globmapper from="*.js" to="${file.number}-*.js"/> </chainedmapper> </copy> This does exactly what I need it to EXCEPT that instead of the following output: 010-file1.js 020-file2.js 030-file3.js ... I get: ${file.number}-file1.js ${file.number}-file2.js ${file.number}-file3.js ... What am I doing wrong?

    Read the article

  • Why is my content database so large?

    - by PeterBrunone
    If your SharePoint site collection hasn't grown, but your content database has, the most likely culprit is versioning.  If a list -- or worse, a library -- has versioning enabled, the default is to keep every single one.  That means that every time someone edits and checks in a document, its storage footprint increases by the size of the document (and probably a little more).The solution?  It could be a bit painful, but you'll need to go back into each library and restrict the number of versions to keep (three is sufficient for most uses, but your needs may vary).  I suggest keeping only major versions as well, since minor versions are really just stopping points on the way to a published document.Of course if you have a real business need to keep all those versions around, then you'll want to look into an archiving solution that will take the old versions out of the content database but still make them available if necessary.

    Read the article

  • Session state has been disabled for ASP.NET.The Report Viewer control requires that session state be

    - by Patrick Olurotimi Ige
    While i was trying to setup some reports on a SPF 2010 site. After trying to add a Sql Reporting Webpart i get the error: Session state has been disabled for ASP.NET. The Report Viewer control requires that session state be enabled in local mode I never came across that error before when using RSWebaprts in Sharepoint 2007:) But i think is related to ASP.NET sessions state:( Any to fix it you would have to start to make sure the SharePoint Server ASP.NET Session State Service is enabled. Unfortunately in Sharepiint SPF2010 and SP 2010 you would have to do it using PowerShell By doing :  Enable-SPSessionStateService -Defaultprovision PS C:\> PSSnapin - Shows you all the PS Snapins PS C:\> Add-PSSnapin "Microsoft.SharePoint.PowerShell" -- Adds the Sharepoint PS Snapin PS C:\> get-command -Noun SP* -- Show all SP cmdlets PS C:\> Add-SPShellAdmin -- (If you get error regarding the access to the farm you use this command to add an acct to able to run the Shell admin) PS C:\> Get-Help Enable-SPSessionStateService - Shows helpp for  Enable-SPSessionStateService PS C:\> Enable-SPSessionStateService -Defaultprovision - (enables/activates SPSessionStateService) you have more oprions available when you run the Get-Help Enable-SPSessionStateService   After running the cmd you should see the SharePoint Server ASP.NET Session State Service started in your service applications in the Central Admin Site. And of course be able to add your RS webparts Enjoy

    Read the article

  • Issues with ILMerge, Lambda Expressions and VS2010 merging?

    - by John Blumenauer
    A little Background For quite some time now, it’s been possible to merge multiple .NET assemblies into a single assembly using ILMerge in Visual Studio 2008.  This is especially helpful when writing wrapper assemblies for 3rd-party libraries where it’s desirable to minimize the number of assemblies for distribution.  During the merge process, ILMerge will take a set of assemblies and merge them into a single assembly.  The resulting assembly can be either an executable or a DLL and is identified as the primary assembly. Issue During a recent project, I discovered using ILMerge to merge assemblies containing lambda expressions in Visual Studio 2010 is resulting in invalid primary assemblies.  The code below is not where the initial issue was identified, I will merely use it to illustrate the problem at hand. In order to describe the issue, I created a console application and a class library for calculating a few math functions utilizing lambda expressions.  The code is available for download at the bottom of this blog entry. MathLib.cs using System; namespace MathLib { public static class MathHelpers { public static Func<double, double, double> Hypotenuse = (x, y) => Math.Sqrt(x * x + y * y); static readonly Func<int, int, bool> divisibleBy = (int a, int b) => a % b == 0; public static bool IsPrimeNumber(int x) { { for (int i = 2; i <= x / 2; i++) if (divisibleBy(x, i)) return false; return true; }; } } } Program.cs using System; using MathLib; namespace ILMergeLambdasConsole { class Program { static void Main(string[] args) { int n = 19; if (MathHelpers.IsPrimeNumber(n)) { Console.WriteLine(n + " is prime"); } else { Console.WriteLine(n + " is not prime"); } Console.ReadLine(); } } } Not surprisingly, the preceding code compiles, builds and executes without error prior to running the ILMerge tool.   ILMerge Setup In order to utilize ILMerge, the following changes were made to the project. The MathLib.dll assembly was built in release configuration and copied to the MathLib folder.  The following folder hierarchy was used for this example:   The project file for ILMergeLambdasConsole project file was edited to add the ILMerge post-build configuration.  The following lines were added near the bottom of the project file:  <Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'"> <Exec Command="&quot;..\..\lib\ILMerge\Ilmerge.exe&quot; /ndebug /out:@(MainAssembly) &quot;@(IntermediateAssembly)&quot; @(ReferenceCopyLocalPaths->'&quot;%(FullPath)&quot;', ' ')" /> <Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" /> </Target> The ILMergeLambdasConsole project was modified to reference the MathLib.dll located in the MathLib folder above. ILMerge and ILMerge.exe.config was copied into the ILMerge folder shown above.  The contents of ILMerge.exe.config are: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/> </startup> </configuration> Post-ILMerge After compiling and building, the MathLib.dll assembly will be merged into the ILMergeLambdasConsole executable.  Unfortunately, executing ILMergeLambdasConsole.exe now results in a crash.  The ILMerge documentation recommends using PEVerify.exe to validate assemblies after merging.  Executing PEVerify.exe against the ILMergeLambdasConsole.exe assembly results in the following error:    Further investigation by using Reflector reveals the divisibleBy method in the MathHelpers class looks a bit questionable after the merge.     Prior to using ILMerge, the same divisibleBy method appeared as the following in Reflector: It’s pretty obvious something has gone awry during the merge process.  However, this is only occurring when building within the Visual Studio 2010 environment.  The same code and configuration built within Visual Studio 2008 executes fine.  I’m still investigating the issue.  If anyone has already experienced this situation and solved it, I would love to hear from you.  However, as of right now, it looks like something has gone terribly wrong when executing ILMerge against assemblies containing Lambdas in Visual Studio 2010. Solution Files ILMergeLambdaExpression

    Read the article

  • How to convert image into unicode

    - by Zahida Raeesi
    Hello there: I have created a Baluchi keyboard via ARABIC keyboard. But there are few keys not available in Arabic too. I tried different combination of keys to fulfill my requirement but now issue is that for a specific key there is no unicode combination available in UNICODE chart. plz help me out to covert this image in proper UNICODE text so that I can update my Baluchi keyboard Looking forward for your prompt and positive response with best regards, Raji Baloch

    Read the article

  • Pressing 'Enter' doesn't really work in Firefox

    - by inkedmn
    When I'm typing just about anywhere in Firefox on OSX and press enter, it simply doesn't do anything. This includes typing in a textarea element (which should take the cursor to the next line), in a search form (which should submit the form). I'm typing this very question in Firefox right now and I'm unable to advance the cursor to the beginning of the next line. I have no clue what I did to make this happen, but it's kinda driving me insane. This is Firefox 3.6.3 under Mac OS X 10.6. Thanks!

    Read the article

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