Daily Archives

Articles indexed Thursday May 6 2010

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

  • C#: standard Windows menu bars in Windows Forms

    - by BoltClock
    I noticed that adding a MenuStrip (from the VS Toolbox) to my form design doesn't yield a menu bar like many native Windows applications. Instead I get a menu bar like VS's own. None of the style settings for MenuStrip appear to mimic the much more common native menu bar. Is there a way to add a menu bar to my Windows Forms application that looks the same as the one you see in Notepad, Task Manager, Windows Explorer and others? (Preferably with the designer, but I wouldn't mind adding it programmatically either.)

    Read the article

  • Redirecting users after destroy

    - by mathee
    I have 3 models: Questions, Answers, and Profiles (I know, it should be called "Users"). When you view a question Q, I query the database for the answers to Q. (They are linked by id.) In the view, the current user has the option to delete his answer by clicking on the destroy link displayed next to his answer: %table %tr %td Answers: - @answers.each do |a| %tr %td - @provider = Profile.find(a.provider) %i #{h @provider.username} said: %br #{h a.description} %td = link_to 'View full answer', a %td - if a.provider == @profile.id #{link_to 'Delete my answer', a, :confirm => 'Are you sure?', :method => :delete} The problem is that when the user clicks on the destroy link, it redirects to the /answers/index. I want it to redirect to /questions/Q. What's the best way to do this? I know that there's a redirect_to method, but I don't know how to implement it when I want to redirect to an action for a different controller. It also needs to remember the question from which the answer is being deleted. I tried passing something like :question_id in link_to as: #{link_to 'Delete my answer', a, :confirm => 'Are you sure?', :question_id => @question.id, :method => :delete} In AnswersController#destroy: def destroy @answer = Answer.find(params[:id]) @answer.destroy respond_to do |format| format.html { redirect_to(answers_url) } format.xml { head :ok } end @question = Question.find(params[:question_id]) redirect_to question_path(@question) end The :question_id information is not passed to the destroy method, so I get this error: Couldn't find Question without an ID To confirm, I added a puts call before Question.find, and it returned nil.

    Read the article

  • Using TCP Acks to measure latency to a server?

    - by Ted Graham
    I am trying to measure latency to a server that I don't control. This is in a colocated environment, so the latency is on the order of 500 us (.5 ms). I understand that Cisco gear frequently deprioritizes ICMP traffic, making ping times unreliable. Is there a way for me to tell if this is the case on the gear I am traversing? Can I use TCP acknowledgements to determine the minimum latency to the remote server? To do this, I would somehow need to force the remote server to send a TCP ack immediately on receiving my data.

    Read the article

  • segmentation fault for the simplest program??

    - by capex
    Hi, I am just starting out, but this piece of code is giving me a 'segmentation fault' and I can't find out what's wrong with it: #include<stdio.h> int main (void) { int number = 0; int lastDigit = 0; printf("Enter an integer: "); scanf("%d", number); number = number*10; printf("Number times ten is %d.\n", number); return 0; }

    Read the article

  • Finding File WIth Fixed File Size (>0) in Unix/Linux

    - by neversaint
    I have a list of file that looks like this 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:37 SRX016372-SRR037477.est_count 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:34 SRX016372-SRR037478.est_count 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:41 SRX016372-SRR037479.est_count 0 -rw-r--r-- 1 neversaint hgc0746 0 Apr 27 11:16 SRX003838-SRR015096.est_count 0 -rw-r--r-- 1 neversaint hgc0746 0 Apr 27 11:32 SRX004765-SRR016565.est_count What I want to do is to find files that has exactly size 53. But why this command failed? $ find . -name "*.est_count" -size 53 -print It works well though if I just want to find file of size 0 with this command: $ find . -name "*.est_count" -size 0 -print

    Read the article

  • Makefile : assigning function variable in target command line

    - by Michael
    I need the xpi_hash variable to be assigned only when update target's command is decided to execute. Then I'm using this variable as environment, exporting, etc.. If I put it outside of rule, it will be expanded firstly, before $(xpi) target is called, hence will not find that file. update: $(xpi) $(target_update_rdf) xpi_hash := $(shell sha1sum $(xpi) | grep -Eow '^[^ ]+') @echo "Updating..." and above of course is not correct, because for command part the shell is represented. So maybe another way to put this question is - how to bring variable as command output?

    Read the article

  • How to extract nested tar.gz files easily?

    - by StarCub
    Hi, I need to extract tar.gz a file. It's about 950mb. It has another 23 tar.gz files in it. Each of those 23 tar.gz files has one tar file in them. My questions is how I can easily extract all of them? Is there a commandline tool that I can use? The structure is like the following: foo.tar.gz +---bar1.tar.gz ¦ +---foobar1.tar +---bar2.tar.gz ¦ +---foobar2.tar +---bar3.tar.gz ¦ +---foobar3.tar +---bar4.tar.gz ¦ +---foobar4.tar +---bar5.tar.gz ¦ +---foobar5.tar +---bar6.tar.gz ¦ +---foobar6.tar | .......... | .......... | .......... | 23 of them Thanks in advance.

    Read the article

  • Tortoise Check-in error Checksum mismatch

    - by coffeeaddict
    I cannot figure out why I get this error during check-in. I checked in successful only a few hours ago so not sure why now it's complaining Error: Commit failed (details follow): Error: Checksum mismatch for Error: 'C:\sss\sss\trunk\xxxx\.svn\text-base\Header.ascx.svn-base'; expected: Error: '3cee96f580409a1711a47541a07860dd', actual: 'a5fc0f8819b88bf32ab38d4c9a6b0654' Error: Try a 'Cleanup'. If that doesn't work you need to do a fresh checkout. I got latest and also performed a clean-up which said successful so not sure what else to do.

    Read the article

  • PushbackReader without EOF?!

    - by Frank
    Hello SOers, I'm currently using PushbackReader and while waiting for where it 'supposed' to be an EOF, I get the character 65535 and I'm wondering if that's normal. Where is my EOF?! Thank you.

    Read the article

  • Selecting only the first item of an xpath result set in PHP

    - by IkimashoZ
    I am currently achieving the desired outcome with two PHP statements: $thisBlarg = $xmlResource->xpath('//blarg[@ID='.$someBlargID.']'); echo $thisBlarg[0]->name; But, not wanting to settle for second best, I'd really prefer this to be one statement, but PHP doesn't like this: echo $xmlResource->xpath('//blarg[@ID='.$someBlargID.']')[0]->name; And for good reason. But I can't find a way to force an xpath query to return the result directly. Any suggestions?

    Read the article

  • Masking Domain URL with Sub domain URL

    - by Vijay Kumar
    Hai i'm having a subdomain (abc.example.in) but this is referred to mydomain/folder . the thing is i want the mask URL links and the masked url should be displayed following with sub domain can any one help me out . mydomain/folder/path to abc.example.in/path

    Read the article

  • Proper design a Model-Controller in Cocoa?

    - by legege
    Hi, I'm trying to design a simple Cocoa application and I would like to have a clear and easy to understand software architecture. Of course, I'm using a basic MVC design and my question concerns the Model layer. For my application, the Model represents data fetched on the Internet with a XML-RPC API. I'm planning to use Core Data to represent a locally fetched version. How should the data be loaded initially? I'm reading the Cocoa Design Pattern book, and they talk about a Model-Controller that is centric to the Model. How would that be done? Thanks!

    Read the article

  • How to model parent to child pair in MySQL (SQL)

    - by mikeschuld
    I have a data model that includes element types Stage, Actor, and Form. Logically, Stages can be assigned pairs of ( Form <--- Actor ) which can be duplicated many times (i.e. same person and same form added to the same stage at a later date/time). Right now I am modeling this with these tables: Stage Form Actor Form_Actor _______________ |Id | |FormId | --> Id in Form |ActorId | --> Id in Actor Stage_FormActor __________________ |Id | |StageId | --> Id in Stage |FormActorId | --> Id in Form_Actor I am using CodeSmith to generate the data layer for this setup and none of the templates really know how to handle this type of relationship correctly when generating classes. Ideally, the ORM would have Stage.FormActors where FormActor would be the pair Form, Actor. Is this the correct way to model these relationships. I have tried using all three Ids in one table as well Stage_Form_Actor ______________ |Id | |StageId | --> Id in Stage |FormId | --> Id in Form |ActorId | --> Id in Actor This doesn't really get generated very well either. Ideas?

    Read the article

  • Java: constructing a file from a URI?

    - by AP257
    I need to obtain a File object from a URI, working in Java, but keep getting a length of zero - though I know the file size is not zero. I need the File object to pass to another constructor. I'm not sure if it's because I'm constructing it in the wrong way? Here's my code: File videoFile = new File(videoURI.getPath()); if (videoFile == null) { Log.d(LOG_TAG, "File not found!"); return false; } Log.d(LOG_TAG, "about to upload, filepath: " + videoFile.getPath()); Log.d(LOG_TAG, "File length: " + String.valueOf(videoFile.length())); The log output doesn't spit out 'File not found!', and prints a non-null path, but shows a length of 0.

    Read the article

  • Plotting in Matlab

    - by papaduke
    How do you plot two figures at the same time in Matlab? Every time I use surf() it plots over the old one. Also, how do you save the images so you can export them to MS word or powerpoint or something?

    Read the article

  • UIScrollView: Is 806k Image too much too handle? (Crash, out of memory)?

    - by Jordan
    I'm loading a 2400x1845 png image into a scroll view. The program crashes out of memory, is there a better way to handle this? mapScrollView is an UIScrollView in IB, along with a couple of UIButtons. -(void)loadMapWithName:(NSString *)mapName { NSString* bundlePath = [[NSBundle mainBundle] bundlePath]; UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/path/%@", bundlePath, [maps objectForKey:mapName]]]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; CGSize imgSize = image.size; mapScrollView.contentSize = imgSize; [mapScrollView addSubview:imageView]; [imageView release]; [self.view addSubview:mapScrollView]; }

    Read the article

  • How to calculate time spent for Linux system administration?

    - by Jaakko
    I would love figuring out how much time I actually have spent in shell performing administrative duties. For billing of course, this information is not sufficient, but it would be helpful to figure out how much time I have actually spent in shell. My question is: How anyone got tips on how to calculate time spent in shell (in hours + minutes), let's say per user account? Could anyone recommend a software that could be used to analyze this time? Optionally I would like to know about ways how to categorise time spent (e.g. 1 hour for Apache, 2 hours for Samba, etc.) Also, your takes on how you monitor your admin time, are also much appreciated! To narrow down the problem, I am specifically interested in ways of tracking time spent in shell for Linux system administration

    Read the article

  • OpenSolaris livecd, NForce NIC driver, and NTFS USB mounting. Oh My!

    - by Jake Wharton
    I'm attempting to install OpenSolaris 2009.06 on my server. Before I do I would like to test that everything works and am running in to problems. It has an Abit AN-M2 motherboard with an NForce chipset. The driver config utility says that I need a third-party driver and links me to http://homepage2.nifty.com/mrym3/taiyodo/eng/. Scrolling to the bottom, I have downloaded both tgzs just in case. Now the fun part: The only way to get this on to the computer is via a USB drive since I can't access the network. Also, install CD in the drive otherwise I'd just burn them to DVD. Since my USB key is NTFS formatted I cannot mount it since the install CD seems to be lacking NTFS drivers which require more downloaded packages. What should I do? The server will simply be a dumb NAS and I know that there exists other OpenSolaris-based flavors such as Nexenta but from what I read the stock install is likely the best. If this is not the case and pursuing a different flavor is required or better I will also accept that as an answer (but please don't jump straight to it).

    Read the article

  • Le Cigref et l'Inhesj ouvrent une formation en sécurité informatique, des études sont-elles nécessai

    Le Cigref et l'Inhesj ouvrent une formation en sécurité informatique, des études sont-elles nécessaires dans cette spécialité ? L'Institut national des hautes études de la sécurité et de la justice (Inhesj), en association avec le Cigref (Club informatique des grandes entreprises françaises) à mis au point et ouvert un cycle de spécialisation en sécurité informatique. Une première, qui a pour but de "délivrer les savoir-faire visant l'identification, l'évaluation et la maîtrise de l'ensemble des risques et des malveillances informatiques au sein des entreprises". Le cycle de spécialisation « Sécurité numérique » sera destiné aux cadres d'entreprise et abordera l'ensemble des aspects stratégiques, juridiques...

    Read the article

  • SQLAuthority News – Wireless Router Security and Attached Devices – Complex Password

    - by pinaldave
    In the last four days (April 21-24), I have received calls from friends who told me that they have got strange emails from me. To my surprise, I did not send them any emails. I was not worried until my wife complained that she was not able to find one of the very important folders containing our daughter’s photo that is located in our shared drive. This was alarming in my par, so I started a search around my computer’s folders. Again, please note that I am by no means a security expert. I checked my entire computer with virus and spyware, and strangely, there I found nothing. I tried to think what can cause this happening. I suddenly realized that there was a power outage in my area for about two hours during the days I have mentioned. Back then, my wireless router needed to be reset, and so I did. I had set up my WPA-PSK [TKIP] + WPA2-PSK [AES] very well. My key was very simple ( ‘SQLAuthority1′), and I never thought of changing it. (It is now replaced with a very complex one). While checking the Attached Devices, I found out that there was another very strange computer name and IP attached to my network. And so as soon as I found out that there is strange device attached to my computer, I shutdown my local network. Afterwards, I reconfigured my wireless router with a more complex security key. Since I created the complex password, I noticed that the user is no more connecting to my machine. Subsequently, I figured out that I can also set up Access Control List. I added my networked computer to that list as well. When I tried to connect from an external laptop which was not in the list but with a valid security key, I was not able to access the network, neither able to connect to it. I wasn’t also able to connect using a remote desktop, so I think it was good. If you have received any nasty emails from me (from my gmail account) during the afore-mentioned days, I want to apologize. I am already paying for my negligence of not putting a complex password; by way of losing the important photos of my daughter. I have already checked with my client, whose password I saved in SSMS, so there was no issue at all. In fact, I have decided to never leave any saved password of production server in my SSMS. Here is the tip SQL SERVER – Clear Drop Down List of Recent Connection From SQL Server Management Studio to clean them. I think after doing all this, I am feeling safe right now. However, I believe that safety is an illusion of many times. I need your help and advice if there is anymore I can do to stop unauthorized access. I am seeking advice and help through your comments. Reference : Pinal Dave (http://www.SQLAuthority.com) Filed under: SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology

    Read the article

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