Daily Archives

Articles indexed Monday March 15 2010

Page 12/125 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Can a CLSID be different for the same program installed on two different machines?

    - by uberjumper
    I am using comtypes to generate wrappers for a certain com library. I am having certain issues with a few things, that are not being generated properly. I can get around this by doing the missing work, manually. However can i depend on the fact that CLSID's will not change? Lets say: I install a program with the com library Foo 1.0, now i install the exact same version of that program on another PC, will the CLSID's of the interfaces change? This might be a terribly dumb question.

    Read the article

  • Binding Generic List Array to GridView

    - by OliverS
    Hi I have a List which returns an array of "Question". My question is how can I bind this to a grid view? When I try to call Question.Ordinal I get that it does not exist in the data source. I am using the following code: GridView1.DataSource = myList.GetQ(); GrdiView1.DataBind(); myList.GetQ() returns a List which is an array of "Question". When I set the column DataField to "!" I get the object Question. My question is how can I get the objects property? I tried "!.Ordinal" does not work. I was reading this post for reference, here, any help is greatly appreciated, thanks.

    Read the article

  • Development process for an embedded project with significant hardware changes

    - by pierr
    I have a good idea about Agile development process but it seems it does not fit well with a embedded project with significant hardware changes. I will describe below what we are currently doing (Ad-hoc way, no defined process yet). The changes are divided into three categories and different processes are used for each of them: complete hardware change example : use a different video codec IP a) Study the new IP b) RTL/FPGA simulation c) Implement the legacy interface - go to b) d) Wait until hardware (tape out) is ready f) Test on the real hardware hardware improvement example : enhance the image display quality by improving the underlying algorithm a) RTL/FPGA simulation b) Wait until hardware and test on the hardware Minor change example : only change hardware register mapping a) Wait until hardware and test on the hardware The worry is it seems we don't have too much control and confidence about software maturity for the hardware changes as the bring-up schedule is always very tight and the customer desired a seamless change when updating to a new version of hardware. How did you manage this kind of hardware change? Did you solve that by a Hardware Abstraction Layer (HAL)? Did you have a automatic test for the HAL layer? How did you test when the hardware platform is not even ready? Do you have well-documented processes for this kind of change?

    Read the article

  • Use the Django ORM in a standalone script (again)

    - by Rishabh Manocha
    I'm trying to use the Django ORM in some standalone screen scraping scripts. I know this question has been asked before, but I'm unable to figure out a good solution for my particular problem. I have a Django project with defined models. What I would like to do is use these models and the ORM in my scraping script. My directory structure is something like this: project scrape #scraping scripts ... test.py web django_project settings.py ... #Django files I tried doing the following in project/scrape/test.py: print os.path.join(os.path.abspath('..'), 'web', 'django_project') sys.path.append(os.path.join(os.path.abspath('..'), 'web', 'django_project')) print sys.path print "-------" os.environ['DJANGO_SETTINGS_MODULE'] = 'django_project.settings' #print os.environ from django_project.myapp.models import MyModel print MyModel.objects.count() However, I get an ImportError when I try to run test.py: Traceback (most recent call last): File "test.py", line 12, in <module> from django_project.myapp.models import MyModel ImportError: No module named django_project.myapp.models One solution I found around this problem is to create a symbolic link to ../web/govcheck in the scrape folder: :scrape rmanocha$ ln -s ../web/govcheck ./govcheck With this, I can then run test.py just fine. However, this seems like a hack, and more importantly, is not very portable (I will have to create this symbolic link everywhere I run this code). So, I was wondering if anyone has any better solutions for my problem?

    Read the article

  • Webclient using download file to grab file from server - handling exceptions

    - by baron
    Hello everyone, I have a web service in which I am manipulating POST and GET methods to facilitate upload / download functionality for some files in a client/server style architecture. Basically the user is able to click a button to download a specific file, make some changes in the app, then click upload button to send it back. Problem I am having is with the download. Say the user expects 3 files 1.txt, 2.txt and 3.txt. Except 2.txt does not exist on the server. So I have code like (on server side): public class HttpHandler : IHttpHandler { public void ProcessRequest { if (context.Request.HttpMethod == "GET") { GoGetIt(context) } } private static void GoGetIt(HttpContext context) { var fileInfoOfWhereTheFileShouldBe = new FileInfo(......); if (!fileInfoOfWhereTheFileShouldBe.RefreshExists()) { throw new Exception("Oh dear the file doesn't exist"); } ... So the problem I have is that when I run the application, and I use a WebClient on client side to use DownloadFile method which then uses the code I have above, I get: WebException was unhandled: The remote server returned an error: (500) Internal Server Error. (While debugging) If I attach to the browser and use http://localhost:xxx/1.txt I can step through server side code and throw the exception as intended. So I guess I'm wondering how I can handle the internal server error on the client side properly so I can return something meaningful like "File doesn't exist". One thought was to use a try catch around the WebClient.DownloadFile(address, filename) method but i'm not sure thats the only error that will occur i.e. the file doesn't exist.

    Read the article

  • Pair of blocks in each?

    - by Aleksandr Koss
    As in the standart cycle: - @goods.each do |good| ??? ...to organize this (HAML): .columns-wrapper .column First good .column Second good .column Third good .columns-wrapper .column Fourth good .column Fifth good .column Sixth good

    Read the article

  • insert,update, delete derived entity in entity framework 4.0

    - by user282807
    Hi! How do i insert an entity that is derived from another entity. here is my code but it's not working:(applicationreplacement derived from application Blockquote ObjectContect _ctx public void AddReplacementApp(Application entity,ApplicationReplacement rentity) { _ctx.CreateObjectSet<Application>(rentity); _ctx.SaveChanges(); } Blockquote

    Read the article

  • Keeping an application on top and in focus - always

    - by James Newton-King
    I am creating a kiosk application and I want to ensure it is always, no matter what, on top of other Windows applications and the Windows task bar. I am already blocking Windows keyboard commands (alt-tab, etc) but there are still situations that could cause an application to launch and steal the screen. Is it possible to hook into Windows from .NET and continually test whether the application has focus and is on top, and if not then give it focus and make it on top?

    Read the article

  • When programatically creating a new IIS web site, how can I add it to an existing application pool?

    - by Ian Robinson
    I have successfully automated the process of creating a new IIS website, however the code I've written doesn't care about application pools, it just gets added to DefaultAppPool. However I'd like to add this newly created site to an existing application pool. Here is the code I'm using to create the new website. var w3Svc = new DirectoryEntry(string.Format("IIS://{0}/w3svc", webserver)); var newsite = new object[] { serverComment, new object[] { serverBindings }, homeDirectory }; var websiteId = w3Svc.Invoke("CreateNewSite", newsite); site.Invoke("Start", null); site.CommitChanges(); <update Although this is not directly related to the question, here are some sample values being used above. This might help someone understand exactly what the code above is doing more easily. webServer: "localhost" serverComment: "testing.dev" serverBindings: ":80:testing.dev" homeDirectory: "c:\inetpub\wwwroot\testing\" </update If I know the name of the application pool that I'd like this web site to be in, how can I find it and add this site to it? <update 2 I've added the following based on Mark's answer below. var appPool = new DirectoryEntry(string.Format("IIS://{0}/w3svc/AppPools/{1}", webServer, appPoolName)); site.Properties["AppPoolId"].Value = appPool; I seem to have moved passed the "RPC" error message I was initially receiving. Now this is the error message I'm receiving: Error: System.Runtime.InteropServices.COMException (0x8000500C): Exception from HRESULT: 0x8000500C at System.DirectoryServices.Interop.UnsafeNativeMethods.IAds.PutEx(Int32 lnControlCode, String bstrName, Object vProp) at System.DirectoryServices.PropertyValueCollection.set_Value(Object value) at ProvisionIISWebsite.Query.CreateWebsite(String webServer, String serverComment, String serverBindings, String homeDirectory, String appPoolName) in C:\Users\irobinson\My Projects\ProvisionIISWebsite\Query.cs:line 104 at ProvisionIISWebsite.Query.Handle_GetData(EngineBase& caller, Boolean isSubQuery, String query, String filterField, String filterText, Debugger& debugWriter, Boolean isRendered, Int32 timeout, String customConnection) in C:\Users\irobinson\My Projects\ProvisionIISWebsite\Query.cs:line 36 </update 2

    Read the article

  • Silverlight 4.0: How to increase quota in Isolated File Storage

    - by xscape
    Got this line of code here but its not working. using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { long newSpace = isf.Quota + spaceRequest; try { if(true == isf.IncreaseQuotaTo(newSpace)) { Debug.WriteLine("success"); } else { Debug.WriteLine("unsuccessful"); } } catch (Exception e) { throw; } }

    Read the article

  • Getting CoreMIDI to work in snow leopard with SimpleSynth

    - by suman-gurung
    I have been trying to follow the steps in the book Ruby Practical Project - making music with ruby and was trying to get CoreMIDI and output some notes using SimpleSynth. I can connect to the destination but when i do something like midi = LiveMIDI.new midi.note_on(0, 60, 100) I get no output from the sound system. Has anyone tried the code and faced similar situation?? And also What are the better libraries for music programming in Ruby?

    Read the article

  • getLine1Number return null but not always....

    - by bob
    i use telephony manager for to ger the phone number, in sdk all work perfectly, on some device like my hero with 1.5 it return null, on the tattoo with 1.6 it work but on some other tattoo it return null.....I start to be crazy....why happen this? There is another way for to get the phone number? Thanks

    Read the article

  • code to edit the text in an EditText widgit

    - by user293663
    Hello, I am a newbi programmer and am having trouble with a measurement conversion program I am working on. What I would like to do is have several EditText boxes. When one is filled in and a calculate button is hit then the rest will be populated with a converted number. The part I am getting stuck on is outputting the answers to EditText widgets. ex: There are three EditText Widgets. a user inputs the number 6 into the first one (labeled inches) and presses calculate. I would like the next box to display .5 (labeled feet) and the last to display .1666 (this would be yards) .setText() apparently does not work to modify the text in an EditText any help would be greatly appreciated.

    Read the article

  • Help with redirection for .com, .net and .org domains: redirecting all of them to .com.

    - by user198553
    Hi all! I need help with some rules in ISAPI_Rewrite in my installation. (If you only know mod_rewrite could be a good help to, so I would adapt the configuration). I'm going to be very honest about my needs. I need to do this configuration in the next few hours, and don't have time right now understand everything about rewrites, regular expressions and such. I really think you can help me, if I had more reputation I would even set up a bounty... :( In fact, I believe that what I need is simple: I have a .com domain. The main url of my website is going to be http:// www.mainurl.com/. I have two other domains: mainurl.net and mainurl.org. What I need (in isapi-rewrite 2, the config made with httpd.ini file in root file) is: everytime someone writes mainurl.net in browser it becomes http:// www.mainurl.com/ 301 redirect. If it's written without www becomes http:// www.mainurl.com/. If someone writes mainurl.net/about it becomes http:// www.mainurl.com/about/. Redirect always the .com, the www part and the final slash /. Thanks in advance you all!

    Read the article

  • C# WPF DataBind boolean

    - by jtdangelo
    I have been using this website to learn a lot about C# for a while, but this is my first time posting a question. I look forward to hearing back from some of the seasoned C# veterans! I have been working on a C# 4.0 WPF project and need to figure out how to databind a boolean value. I have a reference to my Application.Current object in a window. My "App" object contains a boolean field called "Downloaded" that is true if the user has downloaded information from a web service. I need to databind a textbox's IsEnabled field to this Downloaded value. Any tips? Here is what I have come up with so far. (Any useful links to better learn WPF XAML are greatly appreciated!) C# Code: class MainWindow : Window { ... private App MyApp = App.Current as App; ... } XAML: <TextBox ... IsEnabled="{Binding Source=MyApp, Path=Downloaded}" /> James

    Read the article

  • Is it possible to replace groovy method for existing object?

    - by Jean Barmash
    The following code tried to replace an existing method in a Groovy class: class A { void abc() { println "original" } } x= new A() x.abc() A.metaClass.abc={-> println "new" } x.abc() A.metaClass.methods.findAll{it.name=="abc"}.each { println "Method $it"} new A().abc() And it results in the following output: original original Method org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod@103074e[name: abc params: [] returns: class java.lang.Object owner: class A] Method public void A.abc() new Does this mean that when modify the metaclass by setting it to closure, it doesn't really replace it but just adds another method it can call, thus resulting in metaclass having two methods? Is it possible to truly replace the method so the second line of output prints "new"? When trying to figure it out, I found that DelegatingMetaClass might help - is that the most Groovy way to do this?

    Read the article

  • Examples of when to use PageAsyncTask (Asynchronous asp.net pages)

    - by Tony_Henrich
    From my understanding from reading about ASP.NET asynchronous pages, the method which executes when the asynchronous task begins ALWAYS EXECUTES between the prerender and the pre-render Complete events. So because the page's controls' events run between the page's load and prerender events, is it true that whatever the begin task handler (handler for BeginAsync below) produces, it can't be used in the controls' events? So for example, if the handler gets data from a database, the data can't be used in any of the controls' postback events? Would you bind data to a data control after prerender? PageAsyncTask pat = new PageAsyncTask(BeginAsync, EndAsync, null, null, true); this.RegisterAsyncTask(pat);

    Read the article

  • Get two Jpanel expand in a JFrame asymmetrically.

    - by Gabriel A. Zorrilla
    Hi there. I have a JFrame with two JPanels inside. One is set on west, other on east with BorderLayout. The thing is, it just shows two 10 pixel width, 100% JFrame height strips: What i want to do is to setsize each panel having as end result that the jpanel on the west be 80% of the jframe width, the remaining 20% to the one on the east. Is it possible? Should I use another layout? Thanks a lot.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >