Daily Archives

Articles indexed Tuesday November 27 2012

Page 14/16 | < Previous Page | 10 11 12 13 14 15 16  | Next Page >

  • Application Performance Episode 2: Announcing the Judges!

    - by Michaela Murray
    The story so far… We’re writing a new book for ASP.NET developers, and we want you to be a part of it! If you work with ASP.NET applications, and have top tips, hard-won lessons, or sage advice for avoiding, finding, and fixing performance problems, we want to hear from you! And if your app uses SQL Server, even better – interaction with the database is critical to application performance, so we’re looking for database top tips too. There’s a Microsoft Surface apiece for the person who comes up with the best tip for SQL Server and the best tip for .NET. Of course, if your suggestion is selected for the book, you’ll get full credit, by name, Twitter handle, GitHub repository, or whatever you like. To get involved, just email your nuggets of performance wisdom to [email protected] – there are examples of what we’re looking for and full competition details at Application Performance: The Best of the Web. Enter the judges… As mentioned in my last blogpost, we have a mystery panel of celebrity judges lined up to select the prize-winning performance pointers. We’re now ready to reveal their secret identities! Judging your ASP.NET  tips will be: Jean-Phillippe Gouigoux, MCTS/MCPD Enterprise Architect and MVP Connected System Developer. He’s a board member at French software company MGDIS, and teaches algorithms, security, software tests, and ALM at the Université de Bretagne Sud. Jean-Philippe also lectures at IT conferences and writes articles for programming magazines. His book Practical Performance Profiling is published by Simple-Talk. Nik Molnar,  a New Yorker, ASP Insider, and co-founder of Glimpse, an open source ASP.NET diagnostics and debugging tool. Originally from Florida, Nik specializes in web development, building scalable, client-centric solutions. In his spare time, Nik can be found cooking up a storm in the kitchen, hanging with his wife, speaking at conferences, and working on other open source projects. Mitchel Sellers, Microsoft C# and DotNetNuke MVP. Mitchel is an experienced software architect, business leader, public speaker, and educator. He works with companies across the globe, as CEO of IowaComputerGurus Inc. Mitchel writes technical articles for online and print publications and is the author of Professional DotNetNuke Module Programming. He frequently answers questions on StackOverflow and MSDN and is an active participant in the .NET and DotNetNuke communities. Clive Tong, Software Engineer at Red Gate. In previous roles, Clive spent a lot of time working with Common LISP and enthusing about functional languages, and he’s worked with managed languages since before his first real job (which was a long time ago). Long convinced of the productivity benefits of managed languages, Clive is very interested in getting good runtime performance to keep managed languages practical for real-world development. And our trio of SQL Server specialists, ready to select your top suggestion, are (drumroll): Rodney Landrum, a SQL Server MVP who writes regularly about Integration Services, Analysis Services, and Reporting Services. He’s authored SQL Server Tacklebox, three Reporting Services books, and contributes regularly to SQLServerCentral, SQL Server Magazine, and Simple–Talk. His day job involves overseeing a large SQL Server infrastructure in Orlando. Grant Fritchey, Product Evangelist at Red Gate and SQL Server MVP. In an IT career spanning more than 20 years, Grant has written VB, VB.NET, C#, and Java. He’s been working with SQL Server since version 6.0. Grant volunteers with the Editorial Committee at PASS and has written books for Apress and Simple-Talk. Jonathan Allen, leader and founder of the PASS SQL South West user group. He’s been working with SQL Server since 1999 and enjoys performance tuning, development, and using SQL Server for business solutions. He’s spoken at SQLBits and SQL in the City, as well as local user groups across the UK. He’s also a moderator at ask.sqlservercentral.com.

    Read the article

  • Can HTML injection be a security issue?

    - by tkbx
    I recently came across a website that generates a random adjective, surrounded by a prefix and suffix entered by the user. For example, if the user enters "123" for prefix, and "789" for suffix, it might generate "123Productive789". I've been screwing around with it, and I thought I might try something out: I entered this into the prefix field: <a href="javascript:window.close();">Click</a><hr /> And, sure enough, I was given the link, then an <hr>, then a random adjective. What I'm wondering is, could this be dangerous? There must be many more websites out there that have this issue, are all of them vulnerable to some sort of php injection?

    Read the article

  • Allowing client to select data to return via REST interface

    - by CMP
    I have a rest service that is essentially a proxy to a variety of other services. So if I call GET /users/{id} It will get their user profile, as well as order history, and contact info, etc... all from various services, and aggregates them into one nice object. My problem is that each call to a different service has the potential to add time to the original request, so we would rather not get ALL the data ALL of the time if a particular client does not care about all of the pieces. A solution I have arrived at is to do something like this: GET /users/{id}?includeOrders=true&includeX=true&includeY=true... That works, and it allow me to do only what I need to, but it is cumbersome. We have added enough different data sources that there are too many parameters for that style to be useful. I could do something similar with a single integer and a bitmask or something, but that only makes it harder to read, and it does not feel very Restful. I could break it down into multiple calls so they would need to call /users/{id}/orders and /users/{id}/profile separately, but that sort of defeats the purpose of an aggregating proxy, who's purpose is to make clients jobs easier. Are there any good patterns that can help me return just enough data for each client, without making it too difficult for them to filter and select what they want?

    Read the article

  • Can you use programming for a greater good? [closed]

    - by jdoig
    What are the paths one could take to use their programming skills to benefit mankind (good causes, scientific or medical advancement, etc)? Problem: I dropped out of school, learnt programming, on my own, from text books and the internet. I have 7+ years of commercial experience from web applications to big data to mobile apps. But all I seem to do is make rich people richer with the vain hope that one day I'll be the guy with the good idea using other people to make myself richer. I googled for simular posts on the subject and saw a lot of people saying... "Just do your 9-5 job and donate a lot to charity"... I'm sorry to sound selfish but thats not what makes me tick; I need to be invested in and excited about the project at hand; it's not only got to be for a greater good but it's got to kick arse and feel good doing it too... Does that kind of job exist? Does it involve programming? What other skills do I need? (Apologies if this question is too 'fluffy' or 'wishy-washy', but if it is a pointer to where else I could ask it would be appreciated)

    Read the article

  • Programming a trading strategy

    - by Rob
    Excuse me if I'm not descriptive enough, as I do not have much of a background when it comes to these things: How would I go about coding a primitive trading strategy and link it to some sort of artificial trading environment? Where do I start, and what are some other essential questions I should be asking? I am interested more in doing this because it interests me than making returns. Ideally it utilizes random/historical market data and doesn't actually execute any real trades. My background: I'm almost done my undergrad degree in computer science, and have had intro finance and economic courses. Familiar mostly with C and Java.

    Read the article

  • Is this an acceptable approach to undo/redo in Python?

    - by Codemonkey
    I'm making an application (wxPython) to process some data from Excel documents. I want the user to be able to undo and redo actions, even gigantic actions like processing the contents of 10 000 cells simultaneously. I Googled the topic, and all the solutions I could find involves a lot of black magic or is overly complicated. Here is how I imagine my simple undo/redo scheme. I write two classes - one called ActionStack and an abstract one called Action. Every "undoable" operation must be a subclass of Action and define the methods do and undo. The Action subclass is passed the instance of the "document", or data model, and is responsible for committing the operation and remembering how to undo the change. Now, every document is associated with an instance of the ActionStack. The ActionStack maintains a stack of actions (surprise!). Every time actions are undone and new actions are performed, all undone actions are removed for ever. The ActionStack will also automatically remove the oldest Action when the stack reaches the configurable maximum amount. I imagine the workflow would produce code looking something like this: class TableDocument(object): def __init__(self, table): self.table = table self.action_stack = ActionStack(history_limit=50) # ... def delete_cells(self, cells): self.action_stack.push( DeleteAction(self, cells) ) def add_column(self, index, name=''): self.action_stack.push( AddColumnAction(self, index, name) ) # ... def undo(self, count=1): self.action_stack.undo(count) def redo(self, count=1): self.action_stack.redo(count) Given that none of the methods I've found are this simple, I thought I'd get the experts' opinion before I go ahead with this plan. More specifically, what I'm wondering about is - are there any glaring holes in this plan that I'm not seeing?

    Read the article

  • Using machine learning to aim mirrors in a solar array?

    - by Buttons840
    I've been thinking about solar collectors where several independent mirrors to focus the light on a solar collector, similar to the following design from Energy Innovations. Because there will be flaws in the assembly of this solar array, I am proceeding with the following assumptions (or lack thereof): The software knows the "position" of each mirror, but doesn't know how this position relates to the real world or to other mirrors. This will account for poor mirror calibration or other environmental factors which may effect one mirror but not the others. If a mirror moves 10 units in one direction, and then 10 units in the opposite direction, it will end up where it originally started. I would like to use machine learning to position the mirrors correctly and focus the light on the collector. I expect I would approach this as an optimization problem, optimizing the mirror positions to maximize the heat inside the collector and the power output. The problem is finding a small target in a noisy high-dimensional space (considering each mirror has 2 axis of rotation). Some of the problems I anticipate are: cloudy days, even if you stumble upon the perfect mirror alignment, it might be cloudy at the time noisy sensor data the sun is a moving target, it moves along a path, and follows a different path every day - although you could calculate the exact position of the sun at any time, you wouldn't know how that position relates to your mirrors My question isn't about the solar array, but possible machine learning techniques that would help in this "small target in a noisy high dimensional-space" problem. I mentioned the solar array because it was the catalyst for this question and a good example. What machine learning techniques can find such a small target in a noisy high-dimensional space? EDIT: A few additional thoughts: Yes, you can calculate the suns position in the real world, but you don't know how the mirrors position is related to the real world (unless you've learned it somehow). You might know the suns azimuth is 220 degrees, and the suns elevation is 60 degrees, and you might know a mirror is at position (-20, 42); now tell me, is that mirror correctly aligned with the sun? You don't know. Lets assume you have some very sophisticated heat measurements, and you know "with this heat level, there must be 2 mirrors correctly aligned". Now the question is, which two mirrors (out of 25 or more) are correctly aligned? One solution I considered was to approximate the correct "alignment function" using a neural network which would take the suns azimuth and elevation as input and output a large array with 2 values for each mirror which correspond to the 2 axis of each mirror. I'm not sure what the best training method is though.

    Read the article

  • Tension between the dependency inversion principle and avoiding "new" in C++?

    - by Kazark
    I have seen a lot of advice that it is better to do Type object; than Type* object = new Type(); in C++ whenever possible. I understand the rational behind this and appreciate it. But according to my understanding, to practice dependency inversion requires pointers, e.g.: Type* object = new Implementation();. (Or am I wrong about that?) Is there an inherent tension between the DIP and avoiding new when using C++? If so, what patterns/principles/practices can be used to mitigate this tension?

    Read the article

  • Render Ruby object to interactive html

    - by AvImd
    I am developing a tool that discovers network services enabled on host and writes short summary on them like this: init,1 +-- login,1560 -- +-- bash,1629 +-- nc,12137 -lup 50505 { :net = [ [0] "*:50505 IPv4 UDP " ], :fds = [ [0] "/root (cwd)", [1] "/", [2] "/bin/nc.traditional", [3] "/xochikit/ld_poison.so (stat: No such file or directory)", [4] "/dev/tty2", [5] "*:50505" ] } It proved to be very nice formatted and useful for quick discovery thanks to colors provided by the awesome_print gem. However, its output is just a text. One issue is that if I want to share it, I lose colors. I'd also like to fold and unfold parts of objects, quickly jump to specific processes and what not? Adding comments, for example. Thus I want something web-based. What is the best approach to implement features like these? I haven't worked with web interfaces before and I don't have much experience with Ruby.

    Read the article

  • Relationship between "Task Parallel Library" and "Task-based Asynchronous Pattern"?

    - by Sid
    In the context of C#, .NET 4/4.5 used for an application running on a web-server, what is the relationship between "Task Parallel Library" and "Task-based Asynchronous Pattern"? I understand one is a library and the other is a pattern. But to dig deeper, is it like "The library is used by the pattern to enforce good practices". I'm also not clear if both are supported in .NET 4.0 (with awake and async keywords) Edit: Seems that awake and async are only in .NET 4.5 ...

    Read the article

  • Help me understand a part of Java Language Specification

    - by Software Engeneering Learner
    I'm reading part 17.2.1 of Java language specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2.1 I won't copy a text, it's too long, but I would like to know, why for third step of sequence they're saying that If thread t was removed from m's wait set in step 2 due to an interrupt Thread couldn't get to step 2 it wasn't removed from wait set, because it written for the step 1: Thread t does not execute any further instructions until it has been removed from m's wait set Thus thread can't be removed from wait set in step 2 whatever it's due to, because it was already removed. Please help me understand this.

    Read the article

  • Docking CDialogBar Horizontally with CToolbar [migrated]

    - by PSU
    I need to display a CToolbar (m_wndToolBar) and a CDialogBar (m_wndDlgBarSid1) horizontally (i.e. next to each other, not above one another). The parent frame is derived from CMDIFrameWnd. I've tried all sorts of variations to get this to work. While I can properly position the CDialogBar to the right of the CToolbar, I cannot persist the positioning, although the WINDOWPLACEMENT mechanism is working correctly (the registry is written on program exit); whenever the program is run, the CToolbar shows up docked left, and the CDialogBar shows up below it, also docked left. I'm using (perforce) MFC and Visual C++ 6.0. Here's the code, slightly redacted to remove debug printouts and the like: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) { return -1; } if (!m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBar(IDR_MAINFRAME) ) { return -1; // fail to create } if (!m_wndDlgBarSid1.Create(this, IDD_DIALOGBAR_SID1, CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR)) { return -1; // fail to create } WINDOWPLACEMENT wp ; CString sSection = "DialogBarSettings"; CString sEntry = "Sid1"; if ( ReadWindowPlacement( &wp, sSection, sEntry )) { BOOL bSWP = m_wndDlgBarSid1.SetWindowPlacement( &wp ); RecalcLayout(); } m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC); m_wndToolBar.GetToolBarCtrl().ModifyStyle( 0, TBSTYLE_FLAT, 0 ) ; m_wndDlgBarSid1.SetBarStyle(m_wndToolBar.GetBarStyle() | CBRS_SIZE_DYNAMIC | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY ) ; m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBar); m_wndDlgBarSid1.EnableDocking(CBRS_ALIGN_TOP | CBRS_ALIGN_BOTTOM); DockControlBar(&m_wndDlgBarSid1,AFX_IDW_DOCKBAR_TOP); return 0; } Any thoughts?

    Read the article

  • Counting product releases if you work on the backend/online services?

    - by stackoverflowuser2010
    I am trying to update my resume, and I would like to count the number of "product releases" that I was directly involved in with a company. It would seem to serve as a performance metric. The problem is that I was working on the backend of a very large distributed system, like along the lines of Hadoop or other huge database. We had regular 6-month major releases and other minor releases. My manager kept saying that "shipped" these releases, but "shipping" a product to me sounds like releasing single pieces of software, like Microsoft would ship Office 11 or something. Any ideas on "product releases" for backend service engineers, or any other type of performance metric?

    Read the article

  • Where does the "mm" come from in GTKmm, glibmm, etc

    - by Cole Johnson
    I understand that the "mm" suffix [in various GTK-associated C++ binding libraries] means "minus minus," but where exactly does it come from? I understand that there is a programming language called "C--," but if there were bindings (and I'm pretty sure I've seen some), they would be suffixed "--". TL;DR: Is there some page on gnu.org that explains the "mm" suffix in various C++ bindings or is it just a de facto standard adopted by the open source community with no reasoning behind it?

    Read the article

  • Should I expect my peers to read or practice on a regular basis? [closed]

    - by Joshua Smith
    I've been debating asking this question for some time. Based several of the comments I read in this question I decided I had to ask. This feels like I'm stating the obvious, but I believe that regular reading (of books, blogs, StackOverflow, whatever) and/or practice are required just to stay current (let alone excel) in whichever stack you use to pay the bills, not to mention playing with things outside your comfort zone to learn new ways of doing things. Yet, I virtually never see this from many of my peers. Even when I go out of my way to point out useful (and almost always free) learning material, I quite often get a sense of total apathy from those I'm speaking to. I'd even go so far as to say that if someone doesn't try to improve (or at least stay current), they'll atrophy as technology advances and actually become less useful to the company. I don't expect people to spend hours a day studying or practicing. I have two young kids and hours of practice simply aren't feasible. Still, I find some time; perhaps on the train, at lunch, in bed for a few minutes, whatever. I'm willing to believe this is arrogance or naivete on my part, but I'd like to hear what the community has to say. So here's my question: Should I expect (and encourage) the same from my peers, or just keep my mouth shut and do my own thing?

    Read the article

  • Are session aware Models a bad thing?

    - by kevtufc
    I'm thinking specifically in Rails here, but I suspect this is a wider question. In a Rails web application I'm using data from the session in models in order that the models know who is logged in. I use this in a method which filters out some data from the database depending on a very simple permissions system. The thing is: using sessions in models in Rails requires a bit of a workaround. It works, but I've a feeling that it's something that I shouldn't be doing and I'm worried there's a big gotcha I'm missing. I suppose the Right Thing To Do would be to return all the data and filter out the not-wanted bits in the controller before passing that to the view, but doing it in the model seems to avoid quite a bit of code duplication and so feels "cleaner." Can anyone tell me why or shouldn't do this? Or that it's not a problem?

    Read the article

  • Regulation of the software industry

    - by Flexo
    Every few years someone proposes tighter regulation for the software industry. This IEEE article has been getting some attention lately on the subject. If software engineers who write programs for systems that expose the public to physical or financial risk knew they would be tested on their competence, the thinking goes, it would reduce the flaws and failures in code—and maybe save a few lives in the bargain. I'm skeptical about the value and merit of this. To my mind it looks like a land grab by those that proposed it. The quote that clinches that for me is: The exam will test for basic knowledge, not mastery of subject matter because the big failures (e.g. THERAC-25) seem to be complex, subtle issues that "basic knowledge" would never be sufficient to prevent. Ignoring any local issues (such as existing protections of the title Engineer in some jurisdictions): The aims are noble - avoid the quacks/charlatans1 and make that distinction more obvious to those that buy their software. Can tighter regulation of the software industry ever achieve it's original goal? 1 Exactly as regulation of the medical profession was intended to do.

    Read the article

  • grubx64.efi cannot find grub config or grub files, boots to grub console

    - by endor43
    Sony VAIO with Insyde H2O EFI bios will not boot into GRUB EFI The answer to this question was immensely helpful to me and my new Vaio Z3. The issue that I am having now is that after replacing bootmgfw.efi with grubx64.efi and renaming, it boots directly to grub console. I dont even get a menu where i can chose ubuntu. I tried putting a grub.cfg file next to the new bootmgfw.efi(grubx64.efi), no go? Any ideas how i can get the renamed grubx64.efi to find all the rest of the grub stuff outside of the ESP in my linux parition? Or do i have to move all grub files to /EFI/Microsoft/Boot on ESP? Thank you!

    Read the article

  • OpenSuSe look for Ubuntu

    - by DOOM
    Dont get me wrong, I have been using ubuntu and opensuse for about 2 years but, somehow I like using ubuntu. But it always bothers me about why OpenSuse "only looks" good?. And this is it. I have searched for it, but couldn't find a theme anywhere close to OpenSuse theme http://en.opensuse.org/images/0/04/Kde4-coverswitch.png Can someone help me to get a OpneSuse theme for UBUNTU 12.04 (GNOME_SHELL)

    Read the article

  • Jack Audio ubuntu 12.10

    - by Shaneo1
    I used to have Jack Server working with 10.10, 11.04, 11.10 but not 12.04 and now 12.10. I have installed jackd jackd2 qjackctl surfed many forums and even given advice of how to get jack working, but now I am stuck. Tue Nov 27 22:30:46 2012: Saving settings to "/home/shane/.config/jack/conf.xml" ... 22:31:19.960 D-BUS: JACK server could not be started. Sorry Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started Tue Nov 27 22:31:19 2012: Starting jack server... Tue Nov 27 22:31:19 2012: JACK server starting in realtime mode with priority 10 Tue Nov 27 22:31:19 2012: [1m[31mERROR: cannot register object path "/org/freedesktop/ReserveDevice1/Audio0": A handler is already registered for /org/freedesktop/ReserveDevice1/Audio0[0m Tue Nov 27 22:31:19 2012: [1m[31mERROR: Failed to acquire device name : Audio0 error : A handler is already registered for /org/freedesktop/ReserveDevice1/Audio0[0m Tue Nov 27 22:31:19 2012: [1m[31mERROR: Audio device hw:0,0 cannot be acquired...[0m Tue Nov 27 22:31:19 2012: [1m[31mERROR: Cannot initialize driver[0m Tue Nov 27 22:31:19 2012: [1m[31mERROR: JackServer::Open failed with -1[0m Tue Nov 27 22:31:19 2012: [1m[31mERROR: Failed to open server[0m Tue Nov 27 22:31:21 2012: Saving settings to "/home/shane/.config/jack/conf.xml" ... 22:31:22.047 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info. Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started Can anyone assist?

    Read the article

  • Ubuntu 12.10 Skype cannot use Web Cam Microphone

    - by f.cipriani
    This is making me crazy. After upgrading to Ubuntu 12.10, Skype 4.1.0.20 cannot use my Logitech Web Cam microphone anymore, it keeps using the front panel microphone. I can record correctly from the web cam microphone using the sound recorder the web cam microphone is selected in the sound settings I have tried using pavucontrol I have even shut down pulseaudio and set the web cam microphone device in the skype options manually No matter what, Skype will keep recording using the front panel microphone. Everything was working fine with Ubuntu 12.04 before I upgraded to 12.10. Update: the webcam icon is grayed during calls, even tough everything looks ok in the video options . This makes me think skype has some problems in fully recognizing my web cam.

    Read the article

  • sudo apt-get update error ubuntu 12.04

    - by user111172
    Hi I'm new in Linux and I need your help :) Every time when i type sudo apt-get update it shows: alphaog@alphaog-HP-Pavilion-DV7:~$ sudo apt-get update E: Type 'ain' is not known on line 3 in source list /etc/apt/sources.list.d/ricotz-testing-precise.list E: The list of sources could not be read. I tried gksu gedit /etc/apt/sources.list and put # in front third line but it still doesn't work. Please Help! :)

    Read the article

  • How can I copy a file from one partition to another?

    - by user111095
    I started with linux a year ago. Few weeks ago it was my idea to install the efi stubloader. I used an LiveCd to freshly install ubuntu 12.10, and studied the articles of www.rodsbooks.com inside out. The problem I am facing is that few files need to be copied from sda2 (Ext) to sda1 (fat32). Silly, that should not be difficullt, but I can not find a way to do it...(in a way I understand it)? Anyboddy? If you have installed a EFI stubloader with reFind or efibootmgr,...please help me.

    Read the article

  • Which logfile(s) log(s) errors reading a cd?

    - by Robert Vila
    I introduce a CD-RW, maybe blank (I really don't know), and after a little movement inside the reader, the CD is ejected without any message at all. I would like to know what is going on and the reason why it is ejected. How can I know that in Natty. The CD reader is working OK because I can read other CD's. It only gave me problems writing from Natty, a few days ago, but with MacOS there was no problem. Thank you Edit: Maybe there is no error, but then, how can I know what is in the Cd if there is anything?

    Read the article

  • How to inhibit suspend temporarily?

    - by Zorn
    I have searched around a bit for this and can't seem to find anything helpful. I have my PC running Ubuntu 12.10 set up to suspend after 30 minutes of inactivity. I don't want to change that, it works great most of the time. What I do want to do is disable the automatic suspend if a particular application is running. How can I do this? The closest thing I've found so far is to add a shell script in /usr/lib/pm-utils/sleep.d which checks if the application is running and returns 1 to indicate that suspend should be prevented. But it looks like the system then gives up on suspending automatically, instead of trying again after another 30 minutes. (As far as I can tell, if I move the mouse, that restarts the timer again.) It's quite likely the application will finish after a couple of hours, and I'd rather my PC then suspended automatically if I'm not using it at that point. (So I don't want to add a call to pm-suspend when the application finishes.) Is this possible? Any advice would be appreciated. Cheers. EDIT: As I noted in one of the comments below, what I actually wanted was to inhibit suspend when my PC was serving files over NFS; I just wanted to focus on the "suspend" part of the question because I already had an idea how to solve the NFS part. Using the 'xdotool' idea given in one of the answers, I have come up with the following script which I run from cron every few minutes. It's not ideal because it stops the screensaver kicking in as well, but it does work. I need to have a look at why 'caffeine' doesn't correctly re-enable suspend later on, then I could probably do better. Anyway, this does seem to work, so I'm including it here in case anyone else is interested. #!/bin/bash # If the output of this function changes between two successive runs of this # script, we inhibit auto-suspend. function check_activity() { /usr/sbin/nfsstat --server --list } # Prevent the automatic suspend from kicking in. function inhibit_suspend() { # Slightly jiggle the mouse pointer about; we do a small step and # reverse step to try to stop this being annoying to anyone using the # PC. TODO: This isn't ideal, apart from being a bit hacky it stops # the screensaver kicking in as well, when all we want is to stop # the PC suspending. Can 'caffeine' help? export DISPLAY=:0.0 xdotool mousemove_relative --sync -- 1 1 xdotool mousemove_relative --sync -- -1 -1 } LOG="$HOME/log/nfs-suspend-blocker.log" ACTIVITYFILE1="$HOME/tmp/nfs-suspend-blocker.current" ACTIVITYFILE2="$HOME/tmp/nfs-suspend-blocker.previous" echo "Started run at $(date)" >> "$LOG" if [ ! -f "$ACTIVITYFILE1" ]; then check_activity > "$ACTIVITYFILE1" exit 0; fi /bin/mv "$ACTIVITYFILE1" "$ACTIVITYFILE2" check_activity > "$ACTIVITYFILE1" if cmp --quiet "$ACTIVITYFILE1" "$ACTIVITYFILE2"; then echo "No activity detected since last run" >> "$LOG" else echo "Activity detected since last run; inhibiting suspend" >> "$LOG" inhibit_suspend fi

    Read the article

< Previous Page | 10 11 12 13 14 15 16  | Next Page >