Daily Archives

Articles indexed Sunday April 4 2010

Page 1/76 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Access denied when starting SQL Server Express from command line

    - by Brettski
    Windows 7 computer running SQL Server Express 2008 (sp1). When I try to run net start mssql$sqlexpress I receive an error: System error 5 has occurred. Access is denied The SQL service is running under "Network Service" account The service starts fine if I use the services window. Could somebody help me figure out why I am receiving this error?

    Read the article

  • What is the best way to route a static controller in Rails?

    - by yuval
    I have a static_controller that is in charge of all the static pages in the site and works as follows in routes.rb: map.connect ':id', :controller => 'static', :action => 'show' I have a static page called about that among other information, has a contact form. I currently have a contacts_controller that is in charge of inserting the contact information to the database. Inside my routes.rb file, I have: map.resources :contacts My contact form (simplified) looks like this: <% form_for @contact do |f| %> <p class="errors"><%= f.error_messages %></p> <p> <%= f.label :first_name %> <%= f.text_field :first_name %> </p> <p class="buttons"><%= f.submit %></p> <% end %> Which in turn submits to the create action of my contacts_controller. My create action looks like this: def create @contact = Contact.new(params[:contact]) if @contact.save flash[:notice] = "Email delivered successfully." end redirect_to "about" end The problem is, is the that when I redirect back to my about page the error_messages for the form get lost (since the error_messages for the form only exist for one request, and that request ends upon redirect). How would I go about preserving the error_messages and still linking the users back to the about static url? Would a session/flash be sufficient (if so, what code would I use to pass error messages) or am I going about this whole thing wrong? Thanks!

    Read the article

  • How to automatically add SVN commit messages and revision numbering to java file?

    - by John
    I'm working on an Apache Wicket project in Eclipse with Maven2 -- my SCM is Subversion. I've got Subclipse set up which I use to commit changes to the repository. I've seen several projects with nice headers containing the current revision number and at the bottom of the java source file there's a list of all the changes that have been committed to the file including the comments that were passed. Is there any way of achieving this sort of behaviour automatically? At work I'm using MKS which does this automatically but I am yet to figure out how to achieve this with SVN and Eclipse.

    Read the article

  • getting an embedded resource in a single dll made up of multiple class libraries

    - by Rahul Gupta
    my solution has multiple projects and in one of them I have the code to get the embedded resource (an xml file) from another project. All this works fine when all the projects are seperate. However when all the class libraries are embedded into a single dll, the code to get the resource file does not work i.e. it cannot get the emebedded resource. I was wondering if the references to the emebedded resource get mixed up when they are combined together in a single dll?? I use the method Assembly.GetCallingAssembly().GetManifestResourceStream("namespace..filename");

    Read the article

  • Why does text from Assembly.GetManifestResourceStream() start with three junk characters?

    - by flipdoubt
    I have a SQL file added to my VS.NET 2008 project as an embedded resource. Whenever I use the following code to read the file's content, the string returned always starts with three junk characters and then the text I expect. I assume this has something to do with the Encoding.Default I am using, but that is just a guess. Why does this text keep showing up? Should I just trim off the first three characters or is there a more informed approach? public string GetUpdateRestoreSchemaScript() { var type = GetType(); var a = Assembly.GetAssembly(type); var script = "UpdateRestoreSchema.sql"; var resourceName = String.Concat(type.Namespace, ".", script); using(Stream stream = a.GetManifestResourceStream(resourceName)) { byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); // UPDATE: Should be Encoding.UTF8 return Encoding.Default.GetString(buffer); } } Update: I now know that my code works as expected if I simply change the last line to return a UTF-8 encoded string. It will always be true for this embedded file, but will it always be true? Is there a way to test any buffer to determine its encoding?

    Read the article

  • Best way to cache resized images using PHP and MySQL

    - by Chris Hawes
    What would be the best practice way to handle the caching of images using PHP. The filename is currently stored in a MySQL database which is renamed to a GUID on upload, along with the original filename and alt tag. When the image is put into the HTML pages it is done so using a url such as '/images/get/200x200/{guid}.jpg which is rewritten to a php script. This allows my designers to specify (roughly - the source image maybe smaller) the file size. The php script then creates a hash of the size (200x200 in the url) and the GUID filename and if the file has been generated before (file with the name of the hash exists in TMP directory) sends the file from the application TMP directory. If the hashed filename does not exist, then it is created, written to disk and served up in the same manner, Is this efficient as it could be? (It also supports watermarking the images and the watermarking settings are stored in the hash as well, but thats out of scope for this.)

    Read the article

  • Webcam streaming - WPF/C#

    - by Nebo
    I noticed few similar questions already, but didn't find exatly what I want. I'm trying to do the following. Have a client and server Webcam application. Server application is on a PC with a webcam connected to it and it streams the webcam output. Client application connects to a Server and shows the webcam video. What's the best and easiest way to to this? Are there any libraries or finished projects doing this? Thanks!

    Read the article

  • cascading combo box causing empty fields in next record

    - by glinch
    Hi there, I'm having problems with a cascading combo box. Everything works fine with the combo boxes and the values get populated correctly. Private Sub cmbAdjComp_AfterUpdate() Me.cboAdjOff.RowSource = "SELECT AdjusterCompanyOffice.ID, AdjusterCompanyOffice.Address1, AdjusterCompanyOffice.Address2, AdjusterCompanyOffice.Address3, AdjusterCompanyOffice.Address4, AdjusterCompanyOffice.Address5 FROM" & _ " AdjusterCompanyOffice WHERE AdjusterCompanyOffice.AdjCompID = " & Me.cmbAdjComp.Column(1) & _ " ORDER BY AdjusterCompanyOffice.Address1" Me.cboAdjOff = Me.cboAdjOff.ItemData(0) End Sub The secondary combo box has a row source query: SELECT AdjusterCompanyOffice.ID, AdjusterCompanyOffice.Address1, AdjusterCompanyOffice.Address2, AdjusterCompanyOffice.Address3, AdjusterCompanyOffice.Address4, AdjusterCompanyOffice.Address5 FROM AdjusterCompanyOffice ORDER BY AdjusterCompanyOffice.Address1; Both comboboxes have the same controlsource. Everything works fine and dandy moving between records and the boxes show the correct fields for each record. When i use the first combo box, and then select the appropriate option in the second combo box, everything works great on the specific record. However when I move to the next record, the values in the second combo box are all empty. If i close the form and reopen it, and avoid using the cascading combo boxes all the values are all correct when i move between records. Somehow using the cascading combo boxes creates a conflict with the row source of the secondary combo box. Hope that is clear! Have been rummaging around for an answer but cant find anything. any help would be greatly appreciated. Thanks Noel

    Read the article

  • How do i make a system call to tar files(along with exclude tag) in Perl

    - by superstar
    This is the system call, i am making right now in perl to tar the files system("${tarexe} -pcvf $tarname $includepath") which works fine. $tarexe -> location of my tar.exe file $tarname -> myMock.tar $includepath -> ./input/myMockPacketName ./input/myPacket/my2/*.wav ./input/myPacket/my3 ./input/myPacket/in.html Now i want to exclude some files using exclude tag, which doesnot exclude the files system("${tarexe} -pcvf $tarname $includepath --exclude $excludepath") $excludepath -> ./input/myMockPacketName/my3 The same stament ${tarexe} -pcvf $tarname $includepath --exclude $excludepath works fine when i run it in the command line.

    Read the article

  • WPF: Asynchronous progress bar

    - by SumGuy
    I'm trying to create a progress bar that will work asynchronously to the main process. I'm created a new event and invoked it however everytime I then try to perform operations on the progress bar I recieve the following error: "The calling thread cannot access this object because a different thread owns it" The following code is an attempt to send an instance of the progress bar to the event as an object, it obviously failed but it gives you an idea of what the code looks like. private event EventHandler importing; void MdbDataImport_importing(object sender, EventArgs e) { ProgressBar pb = (ProgressBar)sender; while (true) { if (pb.Value >= 200) pb.Value = 0; pb.Value += 10; } } private void btnImport_Click(object sender, RoutedEventArgs e) { importing += new EventHandler(MdbDataImport_importing); IAsyncResult aResult = null; aResult = importing.BeginInvoke(pbDataImport, null, null, null); importing.EndInvoke(aResult); } Does anyone have ideas of how to do this. Thanks in advance SumGuy.

    Read the article

  • Reasons to fail a build

    - by Brian Laframboise
    As a build engineer, I'm constantly looking for new and interesting ways to improve our build process - and that includes looking for new and interesting ways to fail our builds! I have yet to find a canonical list of reasons to fail a build ... so I figure it's time to get one created. With that in mind: What build-time checks - both obvious and creative - have you seen fail builds?

    Read the article

  • Python progression path - From apprentice to guru

    - by Morlock
    Hi all, I've been learning, working, and playing with Python for a year and a half now. As a biologist slowly making the turn to bio-informatics, this language has been a the very core of all the major contributions I have made in the lab. (bash and R scripts have helped some too. My C++ capabilities are very not functional yet). I more or less fell in love with the way Python permits me to express beautiful solutions and also with the semantics of the language that allows such a natural flow from thoughts to workable code. What I would like to know from you is your answer to a kind of question I have seldom seen in this or other forums. Let me sum up what I do NOT want to ask first ;) I don't want to know how to QUICKLY learn Python Nor do I want to find out the best way to get acquainted with the language Finally, I don't want to know a 'one trick that does it all' approach. What I do want to know your opinion about, is: What are the steps YOU would recommend to a Python journeyman, from apprenticeship to guru status (feel free to stop wherever your expertise dictates it), in order that one IMPROVES CONSTANTLY, becoming a better and better Python coder, one step at a time. The kind of answers I would enjoy (but feel free to surprise the readership :P ), is formatted more or less like this: Read this (eg: python tutorial), pay attention to that kind of details Code for so manytime/problems/lines of code Then, read this (eg: this or that book), but this time, pay attention to this Tackle a few real-life problems Then, proceed to reading Y. Be sure to grasp these concepts Code for X time Come back to such and such basics or move further to... (you get the point :) This process depicts an iterative Learn/Code cycle, and I really care about knowing your opinion on what exactly one should pay attention to, at various stages, in order to progress CONSTANTLY (with due efforts, of course). If you come from a specific field of expertise, discuss the path you see as appropriate in this field. Thanks a lot for sharing your opinions and good Python coding!

    Read the article

  • Why won't my progress bar work?

    - by user113164
    I can't get my progress bar to work. Any help is much appreciated! Here's the code: <Window x:Class="BulkSAConfigureControl.BulkSaProgressBar" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Please Wait.." Height="60" Width="300" WindowStyle="ToolWindow" ResizeMode="NoResize" WindowStartupLocation="CenterScreen"> <ProgressBar Name="progressBar" IsIndeterminate="True"> <ProgressBar.Resources> <ResourceDictionary Source="/PresentationFramework.Aero;v3.0.0.0;31bf3856ad364e35;component/themes/aero.normalcolor.xaml" /> </ProgressBar.Resources> </ProgressBar> . public class ProgressBarClass : Window { public ProgressBarClass() { InitializeComponent(); } public void StartProgressBar() { Duration d = new Duration(TimeSpan.FromSeconds(5)); DoubleAnimation anim = new DoubleAnimation(100.0, d); progressBar.BeginAnimation(ProgressBar.ValueProperty, anim); this.Show(); } public void StopProgressBar() { this.Close(); } } . public class DoSomething : UserControl { public void DoSomeStuff() { ProgressBarClass pBar = new ProgressBarClass(); pBar.StartProgressBar(); // Do some stuff here pBar.StopProgressBar(); } }

    Read the article

  • Handling redirected URL within Flex app?

    - by fortpointuiguy
    We have a Flex client and a server that is using the Spring/Blazeds project. After the user logs in and is authenticated, the spring security layer sends a redirect to a new URL which is where our main application is located. However, within the flex client, I'm currently using HTTPService for the initial request and I get the redirected page sent back to me in its entirety. How can I just get the URL so that I can use navigatetourl to get where the app to go where it needs to? Any help would greatly be appreciated. Thanks!

    Read the article

  • Ruby on rails generates tests for you. Do those give a false sense of a safety net?

    - by Hamish Grubijan
    Disclaimer: I have not used RoR, and I have not generated tests. But, I will still dare to post this question. Quality Assurance is theoretically impossible to get 100% right in general (Undecidable problem ;), and it is hard in practice. So many developers do not understand that writing good automated tests is an art, and it is hard. When I hear that RoR generates the tests for you, I get very skeptical. It cannot be that easy. Testing is a general concept; it applies across languages. So does the concept of code contracts, it is similar for languages that support it. Code contracts do not generate themselves. The programmer must add the requirements and the promises manually, after doing some thinking about the algorithm / function. If a human gets it wrong, then the tools will propagate the error. Similarly with testing - it takes human judgement about what should happen. Tests do not write themselves, and we are far from the day when a business analyst can just have a conversation with a computer and tell it informally what the requirements are and have the computer do all the work. There is no magic ... how can RoR generate good tests for you? Please shed some light on this. Opinions are ok, for this is a community wiki. Thanks!

    Read the article

  • How do i make a "system call to tar files(along with exclude tag)" to work in Perl

    - by superstar
    This is the system call, i am making right now in perl to tar the files system("${tarexe} -pcvf $tarname $includepath") which works fine. $tarexe -> location of my tar.exe file $tarname -> myMock.tar $includepath -> ./input/myMockPacketName ./input/myPacket/my2/*.wav ./input/myPacket/my3 ./input/myPacket/in.html Now i want to exclude some files using exclude tag, which doesnot exclude the files system("${tarexe} -pcvf $tarname $includepath --exclude $excludepath") $excludepath -> ./input/myMockPacketName/my3 The same stament ${tarexe} -pcvf $tarname $includepath --exclude $excludepath works fine when i run it in the command line.

    Read the article

  • Floating point inaccuracy examples

    - by David Rutten
    How do you explain floating point inaccuracy to fresh programmers and laymen who still think computers are infinitely wise and accurate? Do you have a favourite example or anecdote which seems to get the idea across much better than an precise, but dry, explanation? How is this taught in Computer Science classes?

    Read the article

  • Webcam streaming in a WPF application

    - by Nebo
    I noticed few similar questions already, but didn't find exatly what I want. I'm trying to do the following. Have a client and server Webcam application. Server application is on a PC with a webcam connected to it and it streams the webcam output. Client application connects to a Server and shows the webcam video. What's the best and easiest way to to this? Are there any libraries or finished projects doing this?

    Read the article

  • Mac font rendering on Windows

    - by Swap
    Hi, I love the way Mac OS beautifully renders fonts (not just browsers). I was wondering if we could somehow get the same rendering in browsers running on Windows? Someone recommended sIFR but I guess that's useful when I need to use non-standard fonts? -- Swap

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >