Daily Archives

Articles indexed Wednesday December 12 2012

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

  • VBA Variable from msgbox to report

    - by user1789785
    I have a macro which runs several Sql queries. One of these queries is run based off a date which in input in a msgbox within the macro (only companies after the date entered are generated). Is it possible to put the value entered in the msgbox at the time the macro is run in a table by itself? (my ultimate goal is to put the value on a report to indicate that values displayed are after the following date: variable) Thanks

    Read the article

  • CSS: Horizontal UL: Getting it centered

    - by Steve
    I'm trying to make a horizontal menu/list. It has a mix of independent buttons and buttons that are wrapped in their own individual forms. With much hacking I got all of the buttons, in forms and not in forms to align horizontally. I haven't been able to get the whole thing to center on the page though. Could someone point out to me what I am not seeing? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <link rel="shortcut icon" href="http://localhost:7001/nsd/images/favicon.ico"> <link rel="StyleSheet" href="veci_files/nsd.css" type="text/css"> <style type = "text/css"> #horizontal_li_menu_container ul { margin-left: auto; margin-right:auto; text-align:center; border: 1px solid green; width:1000px; } #horizontal_li_menu_container_ul { list-style-type: none; text-decoration: none; border: 1px solid red; } #horizontal_li_menu_container li { display: inline;float:left; } </style> </head> <body> <div id = "horizontal_li_menu_container"> <ul id = "horizontal_li_menu_container_ul"> <li> <input value="Update" onclick="location.href='#'" name="button" type="button"/> </li> <li> <form name="formExportVECI" method="post" action="exportveci"> <input name="person_id" value="661774" type="hidden"> <input name="submitExport" value="Export To Microsoft Excel" type="submit"> </form> </li> <li> <form id="ufdh" name="formImportVECI" action="importveci" method="post" enctype="multipart/form-data"> <input name="person_id" value="661774" type="hidden"> <input value="Import From Microsoft Excel" path="Upload" type="submit"> <input id="fileData" name="fileData" value="" type="file"> </form> </li> <li> <input value="Search/Home" onclick="location.href='search'" name="buttonHome" type="button"/> </li> </ul> </div> </body></html>

    Read the article

  • jQuery doesn't fire some events while I'm not logged in (Joomla)

    - by Andrew Sekaev
    So basically, .resize function fails until I log in. What does that mean? And how that can be fixed? Almost all other functions work fine. The site is still in developement, so no live version sadly. UPDATE: jQuery(window).resize(function() { var windowSize = jQuery(window).width() var windowWidth = (jQuery(window).width()-60)/6; var windowHeight = windowWidth/1.6; /*grid resize*/ jQuery('.xc-block').css({'width':windowWidth, 'height':windowHeight}); }); This is very simple script, cant really tell what can be wrong... Any thoughts guys? P.S:also no errors in FireBug...

    Read the article

  • Make my Billing and Shipping Fields Match

    - by user1899209
    I want to make my Billing fields automatically match my Shipping fields. I can make it work with text values, but I can't automatically populate a RADIO BUTTON. I'm using this code: http://jsfiddle.net/aDNH7/ I would like to keep this in Javascript. <script> function FillBilling(f) { if(f.billingtoo.checked == true) { f.billingname.value = f.shippingname.value; f.billingcity.value = f.shippingcity.value; } if(f.billingtoo.checked == false) { f.billingname.value = ''; f.billingcity.value = ''; } } </script> <td bgcolor="eeeeee"> <b>Mailing Address</b> <br><br> <form> Name: <input type="text" name="shippingname"> <br> City: <input type="text" name="shippingcity"> / Checking / Savings <br> <input type="checkbox" onclick="FillBilling(this.form)" name="billingtoo"> <em>Check this box if Billing Address and Mailing Address are the same.</em> <p> <b>Billing Address</b> <br><br> Name: <input type="text" name="billingname"> <br> City: <input type="text" name="billingcity"> / Checking / Savings ? BUT, I want to add this to the form: <!-- <td colspan="2"><p> <label> <input type="radio" name="acct" value="checking" id="acct_0" <?php if ($user_info['acct'] == "checking"){ echo "checked='checked'"; }?>/> Checking</label> <br /> <label> <input type="radio" name="acct" value="savings" id="acct_1" <?php if ($user_info['acct'] == "savings"){ echo "checked='checked'"; }?>/> Savings</label> <br /> </p> </td>-->

    Read the article

  • Determining Excel spreadsheet format before Data Flow Task

    - by Josh Larsen
    I'm working on an SSIS package which uses a for each loop to iterate through excel files in a directory and a data flow task to import them. The issue I'm having is that the project manager I'm working with doesn't think the users will always follow the structure. So if a file is in the folder and the package tries to import it but the spreadsheet is missing columns or has extra columns it generates and error of course. Even though I have the task set to not fail the package; the package does indeed fail and then the other files aren't imported. So, I'm wondering what is the easiest way to either determine the spreadsheet is incorrectly formatted, or stop the error from failing the package execution? After taking said step I would just use a file copy task to move the file to a "Failure" folder. Then continue on processing the spreadsheets.

    Read the article

  • Project Euler #119 Make Faster

    - by gangqinlaohu
    Trying to solve Project Euler problem 119: The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 8^3 = 512. Another example of a number with this property is 614656 = 28^4. We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum. You are given that a2 = 512 and a10 = 614656. Find a30. Question: Is there a more efficient way to find the answer than just checking every number until a30 is found? My Code int currentNum = 0; long value = 0; for (long a = 11; currentNum != 30; a++){ //maybe a++ is inefficient int test = Util.sumDigits(a); if (isPower(a, test)) { currentNum++; value = a; System.out.println(value + ":" + currentNum); } } System.out.println(value); isPower checks if a is a power of test. Util.sumDigits: public static int sumDigits(long n){ int sum = 0; String s = "" + n; while (!s.equals("")){ sum += Integer.parseInt("" + s.charAt(0)); s = s.substring(1); } return sum; } program has been running for about 30 minutes (might be overflow on the long). Output (so far): 81:1 512:2 2401:3 4913:4 5832:5 17576:6 19683:7 234256:8 390625:9 614656:10 1679616:11 17210368:12 34012224:13 52521875:14 60466176:15 205962976:16 612220032:17

    Read the article

  • Rails 3.2.3 mysql error "max_prepared_stmt_count"

    - by Rob Momary
    I am running a Rails 3.2.3 app deployed with apache2/passenger on a virtual host with a mysql database server. I got this error after a lot of traffic was hitting the site: ActiveRecord::StatementInvalid (Mysql::Error: Can't create more than max_prepared_stmt_count statements (current value: 16382) I'm thinking it has something to do with the amount of traffic, but if so I have to find a way around this. Anyone had this error before? I can't figure out how to stop it. Here's what i see in mysql: mysql show global status like 'com_stmt%'; | Com_stmt_close | 1720319 | Com_stmt_execute | 2094137 | | Com_stmt_fetch | 0 | | Com_stmt_prepare | 1768924 | | Com_stmt_reprepare | 0 | | Com_stmt_reset | 0 | | Com_stmt_send_long_data | 0 | +-------------------------+---------+ I am running resque gem.

    Read the article

  • Heroku: bash: bundle: command not found

    - by Space Monkey
    My heroku deployment is crashing with following errors. 2012-12-12T17:16:18+00:00 app[web.1]: bash: bundle: command not found 2012-12-12T17:16:19+00:00 heroku[web.1]: Process exited with status 127 2012-12-12T17:16:19+00:00 heroku[web.1]: State changed from starting to crashed The Heroku documentation for this error is to set PATH and GEM variables as described in https://devcenter.heroku.com/articles/changing-ruby-version-breaks-path I tried that, however that too is not helping. ? heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin ? heroku config:add GEM_PATH=vendor/bundle/ruby/1.9.1 ? heroku run rake db:migrate Running rake db:migrate attached to terminal... up, run.7130 bash: bundle: command not found Next, I tried setting Ruby version in my Heroku app. This increased the slugsize. But app was still not up. Gemfile ruby "1.9.2" Pushed to Heroku -----> Using Ruby version: ruby-1.9.2 -----> Installing dependencies using Bundler version 1.2.2 heroku run "ruby -v" Running `ruby -v` attached to terminal... up, run.4483 ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux] Can someone please advice

    Read the article

  • grailsApplication access in Grails unit Test

    - by Reza
    I am trying to write unit tests for a service which use grailsApplication.config to do some settings. It seems that in my unit tests that service instance could not access the config file (null pointer) for its setting while it could access that setting when I run "run-app". How could I configure the service to access grailsApplication service in my unit tests. class MapCloudMediaServerControllerTests { def grailsApplication @Before public void setUp(){ grailsApplication.config= ''' video{ location="C:\\tmp\\" // or shared filesystem drive for a cluster yamdi{ path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\yamdi" } ffmpeg { fileExtension = "flv" // use flv or mp4 conversionArgs = "-b 600k -r 24 -ar 22050 -ab 96k" path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\ffmpeg" makethumb = "-an -ss 00:00:03 -an -r 2 -vframes 1 -y -f mjpeg" } ffprobe { path="C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\ffprobe" params="" } flowplayer { version = "3.1.2" } swfobject { version = "" qtfaststart { path= "C:\\FFmpeg\\ffmpeg-20121125-git-26c531c-win64-static\\bin\\qtfaststart" } } ''' } @Test void testMpegtoFlvConvertor() { log.info "In test Mpg to Flv Convertor function!" def controller=new MapCloudMediaServerController() assert controller!=null controller.videoService=new VideoService() assert controller.videoService!=null log.info "Is the video service null? ${controller.videoService==null}" controller.videoService.grailsApplication=grailsApplication log.info "Is grailsApplication null? ${controller.videoService.grailsApplication==null}" //Very important part for simulating the HTTP request controller.metaClass.request = new MockMultipartHttpServletRequest() controller.request.contentType="video/mpg" controller.request.content= new File("..\\MapCloudMediaServer\\web-app\\videoclips\\sample3.mpg").getBytes() controller.mpegtoFlvConvertor() byte[] videoOut=IOUtils.toByteArray(controller.response.getOutputStream()) def outputFile=new File("..\\MapCloudMediaServer\\web-app\\videoclips\\testsample3.flv") outputFile.append(videoOut) } }

    Read the article

  • rails solr search limit total search results / get fixed number of results

    - by kLeos
    I'm trying to perform a search, order the results randomly, and only return a number of results, not all matches. Something like limit(2) I've tried using the Solr param 'rows' but that doesn't seem to do anything: @featured_articles = Article.search do with(:is_featured, true) order_by :random adjust_solr_params do |params| params[:rows] = 2 end end @featured_articles.total should be 2, but it returns more than 2 How can I get a randomized fixed number of results?

    Read the article

  • Print number series in java

    - by user1898282
    I have to print the series shown below in java: ***1*** **2*2** *3*3*3* 4*4*4*4 My current implementation is: public static void printSeries(int number,int numberOfCharsinEachLine){ String s="*"; for(int i=1;i<=number;i++){ int countOfs=(numberOfCharsinEachLine-(i)-(i-1))/2; if(countOfs<0){ System.out.println("Can't be done"); break; } for(int j=0;j<countOfs;j++){ System.out.print(s); } System.out.print(i); for(int k=1;k<i;k++){ System.out.print(s); System.out.print(i); } for(int j=0;j<countOfs;j++){ System.out.print(s); } System.out.println(); } } But there are lot of for loops, so I'm wondering whether this can be done in a better way or not?

    Read the article

  • 3-Way sorting in ultragrid

    - by M_Mogharrabi
    how can i have a ultragrid with 3-way sorting on every columns? I mean : a. Ascendiing -Indicated by default ascending SortIndicator. b. Descending- Indicated by default descending SortIndicator. c. No Sort- UnSort the column. Note: I have tried BeforeSortChanged Event but i had 2 problems: I could not get the previous column sort indicator to find out when should i disable sorting. I have got an Exception where it is saying that we can't change SortIndicator in BeforeSortChange Event

    Read the article

  • How can I clear the Android app cache?

    - by Srao
    I am writing a app which can programatically clear application cache of all the third party apps installed on the device. Following is the code snippet for Android 2.2 public static void trimCache(Context myAppctx) { Context context = myAppctx.createPackageContext("com.thirdparty.game", Context.CONTEXT_INCLUDE_CO|Context.CONTEXT_IGNORE_SECURITY); File cachDir = context.getCacheDir(); Log.v("Trim", "dir " + cachDir.getPath()); if (cachDir!= null && cachDir.isDirectory()) { Log.v("Trim", "can read " + cachDir.canRead()); String[] fileNames = cachDir.list(); //Iterate for the fileName and delete } } My manifest has following permissions: android.permission.CLEAR_APP_CACHE android.permission.DELETE_CACHE_FILES Now the problem is that the name of the cache directory is printed but the list of files cachDir.list() always returns null. I am not able to delete the cache directory since the file list is always null. Is there any other way to clear the application cache?

    Read the article

  • "Invalid form control" only in Google Chrome

    - by MFB
    The code below works well in Safari but in Chrome and Firefox the form will not submit. Chrome console logs the error An invalid form control with name='' is not focusable. Any ideas? Note that whilst the controls below do not have names, they should have names at the time of submission, populated by the Javascript below. The form DOES work in Safari. <form method="POST" action="/add/bundle"> <p> <input type="text" name="singular" placeholder="Singular Name" required> <input type="text" name="plural" placeholder="Plural Name" required> </p> <h4>Asset Fields</h4> <div class="template-view" id="template_row" style="display:none"> <input type="text" data-keyname="name" placeholder="Field Name" required> <input type="text" data-keyname="hint" placeholder="Hint"> <select data-keyname="fieldtype" required> <option value="">Field Type...</option> <option value="Email">Email</option> <option value="Password">Password</option> <option value="Text">Text</option> </select> <input type="checkbox" data-keyname="required" value="true"> Required <input type="checkbox" data-keyname="search" value="true"> Searchable <input type="checkbox" data-keyname="readonly" value="true"> ReadOnly <input type="checkbox" data-keyname="autocomplete" value="true"> AutoComplete <input type="radio" data-keyname="label" value="label" name="label"> Label <input type="radio" data-keyname="unique" value="unique" name="unique"> Unique <button class="add" type="button">+</button> <button class="remove" type="button">-</button> </div> <div id="target_list"></div> <p><input type="submit" name="form.submitted" value="Submit" autofocus></p> </form> <script> function addDiv() { var pCount = $('.template-view', '#target_list').length; var pClone = $('#template_row').clone(); $('select, input, textarea', pClone).each(function(idx, el){ $el = $(this); if ((el).type == 'radio'){ $el.attr('value', pCount + '_' + $el.data('keyname')); } else { $el.attr('name', pCount + '_' + $el.data('keyname')); }; }); $('#target_list').append(pClone); pClone.show(); } function removeDiv(elem){ var pCount = $('.template-view', '#target_list').length; if (pCount != 1) { $(elem).closest('.template-view').remove(); } }; $('.add').live('click', function(){ addDiv(); }); $('.remove').live('click', function(){ removeDiv(this); }); $(document).ready(addDiv); </script>

    Read the article

  • Using Apps Script with Twilio

    Using Apps Script with Twilio In this episode we talk about integrating SMS and phone calls with Google Apps via Twilio, a voice and SMS provider. We show you the basics of the API as well as how to bring voice calls and SMS into spreadsheets and docs. You can download the source code for the demos here: github.com From: GoogleDevelopers Views: 1247 34 ratings Time: 27:57 More in Science & Technology

    Read the article

  • The Art of Productivity

    - by dwahlin
    Getting things done has always been a challenge regardless of gender, age, race, skill, or job position. No matter how hard some people try, they end up procrastinating tasks until the last minute. Some people simply focus better when they know they’re out of time and can’t procrastinate any longer. How many times have you put off working on a term paper in school until the very last minute? With only a few hours left your mental energy and focus seem to kick in to high gear especially as you realize that you either get the paper done now or risk failing. It’s amazing how a little pressure can turn into a motivator and allow our minds to focus on a given task. Some people seem to specialize in procrastinating just about everything they do while others tend to be the “doers” who get a lot done and ultimately rise up the ladder at work. What’s the difference between these types of people? Is it pure laziness or are other factors at play? I think that some people are certainly more motivated than others, but I also think a lot of it is based on the process that “doers” tend to follow - whether knowingly or unknowingly. While I’ve certainly fought battles with procrastination, I’ve always had a knack for being able to get a lot done in a relatively short amount of time. I think a lot of my “get it done” attitude goes back to the the strong work ethic my parents instilled in me at a young age. I remember my dad saying, “You need to learn to work hard!” when I was around 5 years old. I remember that moment specifically because I was on a tractor with him the first time I heard it while he was trying to move some large rocks into a pile. The tractor was big but so were the rocks and my dad had to balance the tractor perfectly so that it didn’t tip forward too far. It was challenging work and somewhat tedious but my dad finished the task and taught me a few important lessons along the way including persistence, the importance of having a skill, and getting the job done right without skimping along the way. In this post I’m going to list a few of the techniques and processes I follow that I hope may be beneficial to others. I blogged about the general concept back in 2009 but thought I’d share some updated information and lessons learned since then. Most of the ideas that follow came from learning and refining my daily work process over the years. However, since most of the ideas are common sense (at least in my opinion), I suspect they can be found in other productivity processes that are out there. Let’s start off with one of the most important yet simple tips: Start Each Day with a List. Start Each Day with a List What are you planning to get done today? Do you keep track of everything in your head or rely on your calendar? While most of us think that we’re pretty good at managing “to do” lists strictly in our head you might be surprised at how affective writing out lists can be. By writing out tasks you’re forced to focus on the most important tasks to accomplish that day, commit yourself to those tasks, and have an easy way to track what was supposed to get done and what actually got done. Start every morning by making a list of specific tasks that you want to accomplish throughout the day. I’ll even go so far as to fill in times when I’d like to work on tasks if I have a lot of meetings or other events tying up my calendar on a given day. I’m not a big fan of using paper since I type a lot faster than I write (plus I write like a 3rd grader according to my wife), so I use the Sticky Notes feature available in Windows. Here’s an example of yesterday’s sticky note: What do you add to your list? That’s the subject of the next tip. Focus on Small Tasks It’s no secret that focusing on small, manageable tasks is more effective than trying to focus on large and more vague tasks. When you make your list each morning only add tasks that you can accomplish within a given time period. For example, if I only have 30 minutes blocked out to work on an article I don’t list “Write Article”. If I do that I’ll end up wasting 30 minutes stressing about how I’m going to get the article done in 30 minutes and ultimately get nothing done. Instead, I’ll list something like “Write Introductory Paragraphs for Article”. The next day I may add, “Write first section of article” or something that’s small and manageable – something I’m confident that I can get done. You’ll find that once you’ve knocked out several smaller tasks it’s easy to continue completing others since you want to keep the momentum going. In addition to keeping my tasks focused and small, I also make a conscious effort to limit my list to 4 or 5 tasks initially. I’ve found that if I list more than 5 tasks I feel a bit overwhelmed which hurts my productivity. It’s easy to add additional tasks as you complete others and you get the added benefit of that confidence boost of knowing that you’re being productive and getting things done as you remove tasks and add others. Getting Started is the Hardest (Yet Easiest) Part I’ve always found that getting started is the hardest part and one of the biggest contributors to procrastination. Getting started working on tasks is a lot like getting a large rock pushed to the bottom of a hill. It’s difficult to get the rock rolling at first, but once you manage to get it rocking some it’s really easy to get it rolling on its way to the bottom. As an example, I’ve written 100s of articles for technical magazines over the years and have really struggled with the initial introductory paragraphs. Keep in mind that these are the paragraphs that don’t really add that much value (in my opinion anyway). They introduce the reader to the subject matter and nothing more. What a waste of time for me to sit there stressing about how to start the article. On more than one occasion I’ve spent more than an hour trying to come up with 2-3 paragraphs of text.  Talk about a productivity killer! Whether you’re struggling with a writing task, some code for a project, an email, or other tasks, jumping in without thinking too much is the best way to get started I’ve found. I’m not saying that you shouldn’t have an overall plan when jumping into a task, but on some occasions you’ll find that if you simply jump into the task and stop worrying about doing everything perfectly that things will flow more smoothly. For my introductory paragraph problem I give myself 5 minutes to write out some general concepts about what I know the article will cover and then spend another 10-15 minutes going back and refining that information. That way I actually have some ideas to work with rather than a blank sheet of paper. If I still find myself struggling I’ll write the rest of the article first and then circle back to the introductory paragraphs once I’m done. To sum this tip up: Jump into a task without thinking too hard about it. It’s better to to get the rock at the top of the hill rocking some than doing nothing at all. You can always go back and refine your work.   Learn a Productivity Technique and Stick to It There are a lot of different productivity programs and seminars out there being sold by companies. I’ve always laughed at how much money people spend on some of these motivational programs/seminars because I think that being productive isn’t that hard if you create a re-useable set of steps and processes to follow. That’s not to say that some of these programs/seminars aren’t worth the money of course because I know they’ve definitely benefited some people that have a hard time getting things done and staying focused. One of the best productivity techniques I’ve ever learned is called the “Pomodoro Technique” and it’s completely free. This technique is an extremely simple way to manage your time without having to remember a bunch of steps, color coding mechanisms, or other processes. The technique was originally developed by Francesco Cirillo in the 80s and can be implemented with a simple timer. In a nutshell here’s how the technique works: Pick a task to work on Set the timer to 25 minutes and work on the task Once the timer rings record your time Take a 5 minute break Repeat the process Here’s why the technique works well for me: It forces me to focus on a single task for 25 minutes. In the past I had no time goal in mind and just worked aimlessly on a task until I got interrupted or bored. 25 minutes is a small enough chunk of time for me to stay focused. Any distractions that may come up have to wait until after the timer goes off. If the distraction is really important then I stop the timer and record my time up to that point. When the timer is running I act as if I only have 25 minutes total for the task (like you’re down to the last 25 minutes before turning in your term paper….frantically working to get it done) which helps me stay focused and turns into a “beat the clock” type of game. It’s actually kind of fun if you treat it that way and really helps me focus on a the task at hand. I automatically know how much time I’m spending on a given task (more on this later) by using this technique. I know that I have 5 minutes after each pomodoro (the 25 minute sprint) to waste on anything I’d like including visiting a website, stepping away from the computer, etc. which also helps me stay focused when the 25 minute timer is counting down. I use this technique so much that I decided to build a program for Windows 8 called Pomodoro Focus (I plan to blog about how it was built in a later post). It’s a Windows Store application that allows people to track tasks, productive time spent on tasks, interruption time experienced while working on a given task, and the number of pomodoros completed. If a time estimate is given when the task is initially created, Pomodoro Focus will also show the task completion percentage. I like it because it allows me to track my tasks, time spent on tasks (very useful in the consulting world), and even how much time I wasted on tasks (pressing the pause button while working on a task starts the interruption timer). I recently added a new feature that charts productive and interruption time for tasks since I wanted to see how productive I was from week to week and month to month. A few screenshots from the Pomodoro Focus app are shown next, I had a lot of fun building it and use it myself to as I work on tasks.   There are certainly many other productivity techniques and processes out there (and a slew of books describing them), but the Pomodoro Technique has been the simplest and most effective technique I’ve ever come across for staying focused and getting things done.   Persistence is Key Getting things done is great but one of the biggest lessons I’ve learned in life is that persistence is key especially when you’re trying to get something done that at times seems insurmountable. Small tasks ultimately lead to larger tasks getting accomplished, however, it’s not all roses along the way as some of the smaller tasks may come with their own share of bumps and bruises that lead to discouragement about the end goal and whether or not it is worth achieving at all. I’ve been on several long-term projects over my career as a software developer (I have one personal project going right now that fits well here) and found that repeating, “Persistence is the key!” over and over to myself really helps. Not every project turns out to be successful, but if you don’t show persistence through the hard times you’ll never know if you succeeded or not. Likewise, if you don’t persistently stick to the process of creating a daily list, follow a productivity process, etc. then the odds of consistently staying productive aren’t good.   Track Your Time How much time do you actually spend working on various tasks? If you don’t currently track time spent answering emails, on phone calls, and working on various tasks then you might be surprised to find out that a task that you thought was going to take you 30 minutes ultimately ended up taking 2 hours. If you don’t track the time you spend working on tasks how can you expect to learn from your mistakes, optimize your time better, and become more productive? That’s another reason why I like the Pomodoro Technique – it makes it easy to stay focused on tasks while also tracking how much time I’m working on a given task.   Eliminate Distractions I blogged about this final tip several years ago but wanted to bring it up again. If you want to be productive (and ultimately successful at whatever you’re doing) then you can’t waste a lot of time playing games or on Twitter, Facebook, or other time sucking websites. If you see an article you’re interested in that has no relation at all to the tasks you’re trying to accomplish then bookmark it and read it when you have some spare time (such as during a pomodoro break). Fighting the temptation to check your friends’ status updates on Facebook? Resist the urge and realize how much those types of activities are hurting your productivity and taking away from your focus. I’ll admit that eliminating distractions is still tough for me personally and something I have to constantly battle. But, I’ve made a conscious decision to cut back on my visits and updates to Facebook, Twitter, Google+ and other sites. Sure, my Klout score has suffered as a result lately, but does anyone actually care about those types of scores aside from your online “friends” (few of whom you’ve actually met in person)? :-) Ultimately it comes down to self-discipline and how badly you want to be productive and successful in your career, life goals, hobbies, or whatever you’re working on. Rather than having your homepage take you to a time wasting news site, game site, social site, picture site, or others, how about adding something like the following as your homepage? Every time your browser opens you’ll see a personal message which helps keep you on the right track. You can download my ubber-sophisticated homepage here if interested. Summary Is there a single set of steps that if followed can ultimately lead to productivity? I don’t think so since one size has never fit all. Every person is different, works in their own unique way, and has their own set of motivators, distractions, and more. While I certainly don’t consider myself to be an expert on the subject of productivity, I do think that if you learn what steps work best for you and gradually refine them over time that you can come up with a personal productivity process that can serve you well. Productivity is definitely an “art” that anyone can learn with a little practice and persistence. You’ve seen some of the steps that I personally like to follow and I hope you find some of them useful in boosting your productivity. If you have others you use please leave a comment. I’m always looking for ways to improve.

    Read the article

  • Asynchronous Streaming in ASP.NET WebApi

    - by andresv
     Hi everyone, if you use the cool MVC4 WebApi you might encounter yourself in a common situation where you need to return a rather large amount of data (most probably from a database) and you want to accomplish two things: Use streaming so the client fetch the data as needed, and that directly correlates to more fetching in the server side (from our database, for example) without consuming large amounts of memory. Leverage the new MVC4 WebApi and .NET 4.5 async/await asynchronous execution model to free ASP.NET Threadpool threads (if possible).  So, #1 and #2 are not directly related to each other and we could implement our code fulfilling one or the other, or both. The main point about #1 is that we want our method to immediately return to the caller a stream, and that client side stream be represented by a server side stream that gets written (and its related database fetch) only when needed. In this case we would need some form of "state machine" that keeps running in the server and "knows" what is the next thing to fetch into the output stream when the client ask for more content. This technique is generally called a "continuation" and is nothing new in .NET, in fact using an IEnumerable<> interface and the "yield return" keyword does exactly that, so our first impulse might be to write our WebApi method more or less like this:           public IEnumerable<Metadata> Get([FromUri] int accountId)         {             // Execute the command and get a reader             using (var reader = GetMetadataListReader(accountId))             {                 // Read rows asynchronously, put data into buffer and write asynchronously                 while (reader.Read())                 {                     yield return MapRecord(reader);                 }             }         }   While the above method works, unfortunately it doesn't accomplish our objective of returning immediately to the caller, and that's because the MVC WebApi infrastructure doesn't yet recognize our intentions and when it finds an IEnumerable return value, enumerates it before returning to the client its values. To prove my point, I can code a test method that calls this method, for example:        [TestMethod]         public void StreamedDownload()         {             var baseUrl = @"http://localhost:57771/api/metadata/1";             var client = new HttpClient();             var sw = Stopwatch.StartNew();             var stream = client.GetStreamAsync(baseUrl).Result;             sw.Stop();             Debug.WriteLine("Elapsed time Call: {0}ms", sw.ElapsedMilliseconds); } So, I would expect the line "var stream = client.GetStreamAsync(baseUrl).Result" returns immediately without server-side fetching of all data in the database reader, and this didn't happened. To make the behavior more evident, you could insert a wait time (like Thread.Sleep(1000);) inside the "while" loop, and you will see that the client call (GetStreamAsync) is not going to return control after n seconds (being n == number of reader records being fetched).Ok, we know this doesn't work, and the question would be: is there a way to do it?Fortunately, YES!  and is not very difficult although a little more convoluted than our simple IEnumerable return value. Maybe in the future this scenario will be automatically detected and supported in MVC/WebApi.The solution to our needs is to use a very handy class named PushStreamContent and then our method signature needs to change to accommodate this, returning an HttpResponseMessage instead of our previously used IEnumerable<>. The final code will be something like this: public HttpResponseMessage Get([FromUri] int accountId)         {             HttpResponseMessage response = Request.CreateResponse();             // Create push content with a delegate that will get called when it is time to write out              // the response.             response.Content = new PushStreamContent(                 async (outputStream, httpContent, transportContext) =>                 {                     try                     {                         // Execute the command and get a reader                         using (var reader = GetMetadataListReader(accountId))                         {                             // Read rows asynchronously, put data into buffer and write asynchronously                             while (await reader.ReadAsync())                             {                                 var rec = MapRecord(reader);                                 var str = await JsonConvert.SerializeObjectAsync(rec);                                 var buffer = UTF8Encoding.UTF8.GetBytes(str);                                 // Write out data to output stream                                 await outputStream.WriteAsync(buffer, 0, buffer.Length);                             }                         }                     }                     catch(HttpException ex)                     {                         if (ex.ErrorCode == -2147023667) // The remote host closed the connection.                          {                             return;                         }                     }                     finally                     {                         // Close output stream as we are done                         outputStream.Close();                     }                 });             return response;         } As an extra bonus, all involved classes used already support async/await asynchronous execution model, so taking advantage of that was very easy. Please note that the PushStreamContent class receives in its constructor a lambda (specifically an Action) and we decorated our anonymous method with the async keyword (not a very well known technique but quite handy) so we can await over the I/O intensive calls we execute like reading from the database reader, serializing our entity and finally writing to the output stream.  Well, if we execute the test again we will immediately notice that the a line returns immediately and then the rest of the server code is executed only when the client reads through the obtained stream, therefore we get low memory usage and far greater scalability for our beloved application serving big chunks of data.Enjoy!Andrés.        

    Read the article

  • Plesk 9 - unable to modify atmail vhost template

    - by Ben
    Running into a small issue recently that causes my server's atmail to fail authenticating users. I gathered from a web search that it's because i recently enabled apc on the server. I've found some reference mentioning I need to modify the atmail vhost template, but that reference is for Plesk 10 (i'm on 9). The atmail config isn't in the same spot. I've found this unrelated topic that explains how to modify the vhost settings for atmail on plesk 9, which I have done (adding php_admin_flag apc.enabled off to it). I then recompiled the server config using /usr/local/psa/admin/bin/websrvmng -a but it doesn't seem to pick up the changes. If I look at /etc/httpd/conf.d/zzz_atmail_vhost.conf after recompiling it still doesn't show the apc settings. Summary of steps taken: Modified /etc/psa-webmail/atmail/atmail_vhost.conf and added php_admin_flag register_globals off to the config Recompiled with /usr/local/psa/admin/bin/websrvmng -a Checked /etc/httpd/conf.d/zzz_atmail_vhost.conf But no changes. What am I missing?

    Read the article

  • Email bounce back 550 5.1.1 recipient rejected

    - by Stan
    A client recently switched to Exchange Server / Outlook for their email. Since then emails from my company to any email address at their company bounce back from the System Administrator with this error: Your message did not reach some or all of the intended recipients. Subject: Email Solution Sent: 12/12/2012 11:08 AM The following recipient(s) cannot be reached: '[email protected]' on 12/12/2012 11:08 AM 550 5.1.1 <[email protected]> recipient rejected Looking in the Message Options of the bounce back email shows no data in the Internet Header field. My client's IT guy says we're not being blocked, but I cant think of any other reason the bounce would occur. Any suggestions on what questions to ask or how to fix this would be helpful. I'm using a desktop version of Outlook 2007 and connecting through my ISP. Thanks.

    Read the article

  • Nginx php-fpm high cpu usage

    - by Piotr Kaluza
    I have a problem with a high traffic wordpress, super high CPU load under nginx php-fpm, I am caching with apc, and memcached, spent 2-3 days tweaking configs and looking for answers it seems to me that php-fpm takes up all the cpu available no matter how many max_children i set if i set 5 then the load is 20% each, if i set 20 then the load adds up till 90% i tried static and dynamic server is 2x3.0Ghz 6GB Ram SSD in raid 10 on ubuntu 12.04 x64 utpime: 17:27:51 up 2:19, 1 user, load average: 29.79, 28.08, 26.29 what can be the issue?

    Read the article

  • Which scripting language to use to asynchronously ssh into equipment, run several commands, parse the output, and save to a file on my computer?

    - by Fujin
    There are several points I'd like to stress in my question. I'd like to login by asynchronously ssh'ing into our infrastructure equipment. Meaning, I do not want to connect to only one device, do all the tasks I need, disconnect, then connect to the next device. I want to connect to several devices at once in order to make the process as fast as possible. By equipment I mean 'infrastructure equipment' and not servers. I say this because I will not have the luxury of saving files to the device then transferring them to myself with scp or another method. The output of the scripts that are run will have to be saved directly to my computer. The output of the commands that are run will need to be cleaned up and parsed. Also I want the outputs of each device to be combined into one nice and neat file, not a separate file for each device. This will all be done from a linux box, using ssh, into devices that all use linux'ish proprietary OSes. My guess is the answer to my question will either be a Bash, Perl, or Python script but I figured it wouldn't hurt to ask and to hear the reasons why one way is better than another. Thanks everyone. EXTRA CREDIT: With you answer, include links to resources that will help create the script I described in the language that you suggested.

    Read the article

  • Any way to release focus on a KVM guest in virt-manager without having to click Ctrl_L + Alt_L?

    - by slm
    Is there a way to move my mouse in and out of a KVM guest in virt-manager without having to click to gain focus of the window and release focus by pressing Ctrl_L + Alt_L? EDIT #1 The guest VM is Win2008R2. I've tried this on a CentOS 5, 6, and Fedora 14 box running various versions of virt-manager and KVM and they all exhibit this behavior. EDIT #2 I just tried the solution recommended by @tpow and that appears to be the issue. Manually adding a tablet input device resolves the problem and I can now move the mouse in and out of the KVM guest without having to gain focus first.

    Read the article

  • Why would changing httpd.conf work for me, but .htaccess would not? [closed]

    - by Carl Rempel
    I have html files which contain PHP. When I use filename.php they work great. When I use filename.html the entire file renders as plain text. If I add the following line to my .htaccess, the file still appears as plain text. AddType application/x-httpd-php .php .html But ... if I add the the exact same line to my httpd.conf, then PHP renders my page correctly. What are some possible explanations as to why the .htaccess would not work for me? I'm using apache OS X, Snow Leopard.

    Read the article

  • SSH port forwarding. Connection refused [closed]

    - by Kein
    I want to make a port forward from my public server to my home pc, to connect through ssh. What have I done wrong? From home pc I run command: ssh -R 8022:127.0.0.1:22 remote.host Now when I try to connect with: ssh remote.host -p 8022 I get error "Connection refused" But when I connect to remote.host through ssh, and try to run: ssh localhost -p 8022 It connects to my home PC. How I can connect to home with one simple command? ssh remote.host -p 8022

    Read the article

  • Permissions problems with Apache / SVN

    - by Fred Wuerges
    I am installed a SVN server (v1.6) on a VPS contracted with CentOS 5, Apache 2.2 with WHM panel. I installed and configured all necessary modules and am able to create and access repositories via my web browser normally. The problem: I can not commit or import anything, always return permission errors: First error: Can not open file '/var/www/svn/test/db/txn-current-lock': Permission denied After fix the previous error: Can't open '/var/www/svn/test/db/tempfile.tmp': Permission denied And other... (and happends many others) Can't open file '/var/www/svn/test/db/txn-protorevs/0-1m.rev': Permission denied I've read and executed permissions on numerous tutorials regarding this errors, all without success. I've defined the owner as apache or nobody and different permissions for folders and files. I'm using TortoiseSVN to connect to the server. Some information that may find useful: I'm trying to perform commit through an external HTTP connection, like: svn commit http://example.com/svn/test SELinux is disabled. sestatus returns SELinux status: disabled Running the command to see the active processes of Apache, some processes are left with user/group "nobody". I tried changing the settings of Apache to not run with that user/group, but all my websites stopped working, returning this error: Forbidden You don't have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. Apache process list: root@vps [/var/www]# ps aux | egrep '(apache|httpd)' root 19904 0.0 4.4 133972 35056 ? Ss 16:58 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20401 0.0 3.5 133972 27772 ? S 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL root 20409 0.0 3.4 133972 27112 ? S 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20410 0.0 3.8 190040 30412 ? Sl 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20412 0.0 3.9 190344 30944 ? Sl 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20414 0.0 4.4 190160 35364 ? Sl 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20416 0.0 4.0 190980 32108 ? Sl 17:01 0:00 /usr/local/apache/bin/httpd -k start -DSSL nobody 20418 0.3 5.3 263028 42328 ? Sl 17:01 0:12 /usr/local/apache/bin/httpd -k start -DSSL root 32409 0.0 0.1 7212 816 pts/0 R+ 17:54 0:00 egrep (apache|httpd) SVN folder permission var/www/: drwxrwxr-x 3 apache apache 4096 Dec 11 16:41 svn/ Repository permission var/www/svn/: drwxrwxr-x 6 apache apache 4096 Dec 11 16:41 test/ Internal folders of repository var/www/svn/test: drwxrwxr-x 2 apache apache 4096 Dec 11 16:41 conf/ drwxrwxr-x 6 apache apache 4096 Dec 11 16:41 db/ -rwxrwxr-x 1 apache apache 2 Dec 11 16:41 format* drwxrwxr-x 2 apache apache 4096 Dec 11 16:41 hooks/ drwxrwxr-x 2 apache apache 4096 Dec 11 16:41 locks/ -rwxrwxr-x 1 apache apache 229 Dec 11 16:41 README.txt*

    Read the article

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