Search Results

Search found 59218 results on 2369 pages for 'time sheep'.

Page 20/2369 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How to expose a control collection to a property grid at design time

    - by Stefano Delendati
    I have a custom control that with a property that is a collection of custom object. This custom object hava a reference to some component/controls. When at design time I tray to add an item to the collection and select the object, VS tells me that the control is not serializable. This is the code (simplified version - but not to much): public class ViewRefObj { public control view { get; set; } public ViewRefObj() { } } private List<ViewRefObj> _controls=new List<ViewRefObj>(); public List<ViewRefObj> Views { get { return _controls; } }

    Read the article

  • Converting a stopwatch time to milliseconds (regex)

    - by Nick
    I'm trying to figure out the best way to convert a string containing a time to an integer number of milliseconds. I'm using a suboptimal way using a bunch of preg_match()'s and some array handling, but I was wondering if there was an elegant way. Here are some example stopwatch times (some wouldn't actually be seen on a stopwatch but need to be converted anyway): 3:34:05.81 34:05 5 (just 5 seconds) 89 (89 seconds) 76:05 (76 minutes, 5 seconds) Millseconds will not extend past 2 decimal places. You can give me an example using either PHP or Javascript regex functions. Thanks!

    Read the article

  • how to convert seconds to time format?

    - by Dewan159
    hi there for some reason i convert a time format like : 03:30 to seconds 3*3600 + 30*60 , now .. i wanna convert it back to it's first ( same ) format upthere ... how could that be ? My attempt : 3*3600 + 30*60 = 12600 12600 / 60 = 210 / 60 = 3.5 , floor(3.5) = 3 = hour now .. what about the minutes ?? considering the value can be like 19:00 or 02:51 ... i think you got the picture and by the way, how to convert 2:0 for example to 02:00 using RegEx ? Thanks in advance

    Read the article

  • changing body class based on user's local time

    - by John
    I'm trying to add a body class of 'day' if it's 6am-5pm and 'night' if "else" based on the user's local time. I tried the following but it didn't work. Any ideas? In the head: <script> function setTimesStyles() { var currentTime = new Date().getHours(); if(currentTime > 5 && currentTime < 17) { document.body.className = 'day'; } else { document.body.className = 'night'; } } </script> In the body: <body onload="setTimeStyles();"> Also, is there a more elegant way to achieve what I need?

    Read the article

  • How to time batch file execution using timethis.exe?

    - by unknown
    While timethis.exe works fine for almost every application, it seems to fail for .bat files: C:\test>timethis test.bat TimeThis : Command Line : test.bat TimeThis : Start Time : Fri Feb 26 19:46:30 2010 'test.bat' is not recognized as an internal or external command, operable program or batch file. TimeThis : Command Line : test.bat TimeThis : Start Time : Fri Feb 26 19:46:30 2010 TimeThis : End Time : Fri Feb 26 19:46:30 2010 TimeThis : Elapsed Time : 00:00:00.070 While executing it on a regular command line is fine, timethis.exe fails for it. How do I fix this problem?

    Read the article

  • Time complexity for Search and Insert operation in sorted and unsorted arrays that includes duplicat

    - by iecut
    1-)For sorted array I have used Binary Search. We know that the worst case complexity for SEARCH operation in sorted array is O(lg N), if we use Binary Search, where N are the number of items in an array. What is the worst case complexity for the search operation in the array that includes duplicate values, using binary search?? Will it be the be the same O(lg N)?? Please correct me if I am wrong!! Also what is the worst case for INSERT operation in sorted array using binary search?? My guess is O(N).... is that right?? 2-) For unsorted array I have used Linear search. Now we have an unsorted array that also accepts duplicate element/values. What are the best worst case complexity for both SEARCH and INSERT operation. I think that we can use linear search that will give us O(N) worst case time for both search and delete operations. Can we do better than this for unsorted array and does the complexity changes if we accepts duplicates in the array.

    Read the article

  • How does real-time collaboration with multiple clients work in a system using operation transformati

    - by Saikat Chakrabarti
    I just finished reading High-Latency, Low-Bandwidth Windowing in the Jupiter Collaboration System and I mostly followed everything until part 6: global consistency. This part describes how the system described in the paper can be extended to accomodate for multiple clients connected to the server. However, the explanation is very short and essentially says the system will work if the central server merely forwards client messages to all the other clients. I don't really understand how this works though. What state vector would be sent in the message that is sent to all the other clients? Does the server maintain separate state vectors for each client? Does it maintain a separate copy of the widgets locally for each client? The simple example I can think of is this setup: imagine client A, server, and client B with client A and client B both connected to the server. To start, all three have the state object "ABCD". Then, client A sends the message "insert character F at position 0" at the same time client B sends the message "insert character G at position 0" to the server. It seems like simply relaying client A's message to client B and vice versa doesn't actually handle this case. So what exactly does the server do?

    Read the article

  • calloc v/s malloc and time efficiency

    - by yCalleecharan
    Hi, I've read with interest the post "c difference between malloc and calloc". I'm using malloc in my code and would like to know what difference I'll have using calloc instead. My present (pseudo)code with malloc: Scenario 1 int main() { allocate large arrays with malloc INITIALIZE ALL ARRAY ELEMENTS TO ZERO for loop //say 1000 times do something and write results to arrays end for loop FREE ARRAYS with free command } //end main If I use calloc instead of malloc, then I'll have: Scenario2 int main() { for loop //say 1000 times ALLOCATION OF ARRAYS WITH CALLOC do something and write results to arrays FREE ARRAYS with free command end for loop } //end main I have three questions: Which of the scenarios is more efficient if the arrays are very large? Which of the scenarios will be more time efficient if the arrays are very large? In both scenarios,I'm just writing to arrays in the sense that for any given iteration in the for loop, I'm writing each array sequentially from the first element to the last element. The important question: If I'm using malloc as in scenario 1, then is it necessary that I initialize the elements to zero? Say with malloc I have array z = [garbage1, garbage2, garbage 3]. For each iteration, I'm writing elements sequentially i.e. in the first iteration I get z =[some_result, garbage2, garbage3], in the second iteration I get in the first iteration I get z =[some_result, another_result, garbage3] and so on, then do I need specifically to initialize my arrays after malloc?

    Read the article

  • How to find Part Time development/IT work?

    - by Jonathan
    I've been working in the IT field now for 10 years. Originally trained as an Engineer, started out with C++ and have been a .Net specialist since beta. Currently seconded to a major city and working in the finance industry as freelance, I really feel like i've hit the glass ceiling. Have been contracting now for 5 years as the company politics and frustration of not being promoted and poor pay rises for excellent work but during the last decade of corporate cost cutting took its toll on my morale. Freelance made all the difference and i've had a very decorated career for good clients. What any Engineering student could ever dream of when starting out. The problem is, it doesn't particularly make me happy. It's good work, and i enjoy the problem solving aspects of it and having something to do each day. However there is always a large overhead of non-technical work and dealing with poor managers etc. I guess the Engineering was always a bit of a mistake i made the best out of, and now having 10 years behind a computer hasn't done wonders for my health or eye sight. In a nutshell i am in the process of retraining as a therapist and would like to open my own clinic. However, never having done this before, the fast pace IT skills outdate and the fact that all my experience and skills are non transferrable, i am a little worried. Any ideas how i can find part time IT work as i build up my business? (it's incredibly hard to find freelancing work that doesn't require long hours and overtime). Or other ideas to make the transition easier, and perhaps backout if it financially doesn't work/or i have enough marketing skills? I'd be interested to hear from people who have made a similar transition, successfully or unsuccessfully. Many thanks

    Read the article

  • Aggregating, restructuring hourly time series data in R

    - by Advait Godbole
    I have a year's worth of hourly data in a data frame in R: > str(df.MHwind_load) # compactly displays structure of data frame 'data.frame': 8760 obs. of 6 variables: $ Date : Factor w/ 365 levels "2010-04-01","2010-04-02",..: 1 1 1 1 1 1 1 1 1 1 ... $ Time..HRs. : int 1 2 3 4 5 6 7 8 9 10 ... $ Hour.of.Year : int 1 2 3 4 5 6 7 8 9 10 ... $ Wind.MW : int 375 492 483 476 486 512 421 396 456 453 ... $ MSEDCL.Demand: int 13293 13140 12806 12891 13113 13802 14186 14104 14117 14462 ... $ Net.Load : int 12918 12648 12323 12415 12627 13290 13765 13708 13661 14009 ... While preserving the hourly structure, I would like to know how to extract a particular month/group of months the first day/first week etc of each month all mondays, all tuesdays etc of the year I have tried using "cut" without result and after looking online think that "lubridate" might be able to do so but haven't found suitable examples. I'd greatly appreciate help on this issue.

    Read the article

  • Perl Parallel::ForkManager wait_all_children() takes excessively long time

    - by zhang18
    I have a script that uses Parallel::ForkManager. However, the wait_all_children() process takes incredibly long time even after all child-processes are completed. The way I know is by printing out some timestamps (see below). Does anyone have any idea what might be causing this (I have 16 CPU cores on my machine)? my $pm = Parallel::ForkManager->new(16) for my $i (1..16) { $pm->start($i) and next; ... do something within the child-process ... print (scalar localtime), " Process $i completed.\n"; $pm->finish(); } print (scalar localtime), " Waiting for some child process to finish.\n"; $pm->wait_all_children(); print (scalar localtime), " All processes finished.\n"; Clearly, I'll get the Waiting for some child process to finish message first, with a timestamp of, say, 7:08:35. Then I'll get a list of Process i completed messages, with the last one at 7:10:30. However, I do not receive the message All Processes finished until 7:16:33(!). Why is that 6-minute delay between 7:10:30 and 7:16:33? Thx!

    Read the article

  • Problem with jQuery slider - time

    - by Dawid
    Hello. I'd like to make a slider to choose time(from 1:00 to 4:00) but it doesn't work. It doesn't communicate with 'select'. Can anyone help me? <script> $(function() { var select = $( "#czastrwania" ); var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({ min: 60, max: 240, step: 30, range: "min", value: select[ 0 ].selectedIndex + 1, slide: function( e, ui ) { var hours = Math.floor(ui.value / 60); var minutes = ui.value - (hours * 60); if(hours.length == 1) hours = '0' + hours; if(minutes.length == 1) minutes = '0' + minutes; select[ 0 ].selectedIndex = ui.value - 1; } }); $( "#czastrwania" ).change(function() { slider.slider( "value", this.selectedIndex + 1 ); }); }); </script> <select id="czastrwania" name="czastrwania"> <option value="1:00">1:00</option> <option value="1:30">1:30</option> <option value="2:00">2:00</option> <option value="2:30">2:30</option> <option value="3:00">3:00</option> <option value="3:30">3:30</option> <option value="4:00">4:00</option> </select>

    Read the article

  • SQLite DB open time really long Problem

    - by sxingfeng
    I am using sqlite in c++ windows, And I have a db size about 60M, When I open the sqlite db, It takes about 13 second. sqlite3* mpDB; nRet = sqlite3_open16(szFile, &mpDB); And if I closed my application and reopen it again. It takse only less then 1 second. First, I thought It is because of disk cache. So I preload the 60M db file before sqlite open, and read the file using CFile, However, after preloading, the first time is still very slow. BOOL CQFilePro::PreLoad(const CString& strPath) { boost::shared_array<BYTE> temp = boost::shared_array<BYTE>(new BYTE[PRE_LOAD_BUFFER_LENGTH]); int nReadLength; try { CFile file; if (file.Open(strPath, CFile::modeRead) == FALSE) { return FALSE; } do { nReadLength = file.Read(temp.get(), PRE_LOAD_BUFFER_LENGTH); } while (nReadLength == PRE_LOAD_BUFFER_LENGTH); file.Close(); } catch(...) { } return TRUE; } My question is what is the difference between first open and second open. How can I accelerate the sqlite open-process.

    Read the article

  • Time complexity of a powerset generating function

    - by Lirik
    I'm trying to figure out the time complexity of a function that I wrote (it generates a power set for a given string): public static HashSet<string> GeneratePowerSet(string input) { HashSet<string> powerSet = new HashSet<string>(); if (string.IsNullOrEmpty(input)) return powerSet; int powSetSize = (int)Math.Pow(2.0, (double)input.Length); // Start at 1 to skip the empty string case for (int i = 1; i < powSetSize; i++) { string str = Convert.ToString(i, 2); string pset = str; for (int k = str.Length; k < input.Length; k++) { pset = "0" + pset; } string set = string.Empty; for (int j = 0; j < pset.Length; j++) { if (pset[j] == '1') { set = string.Concat(set, input[j].ToString()); } } powerSet.Add(set); } return powerSet; } So my attempt is this: let the size of the input string be n in the outer for loop, must iterate 2^n times (because the set size is 2^n). in the inner for loop, we must iterate 2*n times (at worst). 1. So Big-O would be O((2^n)*n) (since we drop the constant 2)... is that correct? And n*(2^n) is worse than n^2. if n = 4 then (4*(2^4)) = 64 (4^2) = 16 if n = 100 then (10*(2^10)) = 10240 (10^2) = 100 2. Is there a faster way to generate a power set, or is this about optimal?

    Read the article

  • Pushing or serving real-time data to an excel spreadsheet

    - by evan_irl
    I am running some test automation on a networked computer resource (remote). The remote computer running the test automation generates some output, which I can customize however I wish - probably a text or excel file. I would like to create an excel spreadsheet which, from my local machine, monitors this output and provides real-time analytics. Later I would make the networked computer visible to more people, and they can use the same spreadsheet to monitor this output. My problem is that this networked computer is located on the other side of the earth, and so using any kind of polling in excel VBA to PULL the data from the networked computer results in a very long wait with the pinwheel spinning, making the sheet clumsy and less useful. The same thing happens when I use excel's built in function for linking to "external resources" Is there any way to PUSH data to the excel spreadsheet from the networked computer? Something that is easy to set up would be ideal, the latency does not have to be low, so long as there is no awkward "busy wait" while the sheet updates. If that is not possible, is there any way of using PULL from the excel sheet that avoids the same busy wait?

    Read the article

  • Date/Time formatting in .NET (Devexpress Gantt charts to show time rather than date)

    - by calico-cat
    I have some data about a day's events that I'm trying to visualise as a Gantt chart using Devexpress XtraCharts. Devexpress's example here shows the chart being populated by date. However, I'd like it to be populated by time to compare the events throughout one day. My X-axis is displaying correctly - done like so: ganttDiagram.AxisY.DateTimeMeasureUnit = DateTimeMeasurementUnit.Minute I have data with the correct time, however, the label on each series is showing the date (which are all the same, because it's all the same day!) Thus, instead of being a bar, all of them are just single points, with the label showing 31/03/2010 - 31/03/2010. Each series is created with the code below: s.Points.Add(New SeriesPoint("Machine", New DateTime() {ev.StartTime, ev.EndTime}))

    Read the article

  • Time diff calculations where date and time are in seperate columns

    - by pedalpete
    I've got a query where I'm trying to get the hours in duration (eg 6.5 hours) between two different times. In my database, time and date are held in different fields so I can efficiently query on just a startDate, or endDate as I never query specifically on time. My query looks like this SELECT COUNT(*), IFNULL(SUM(TIMEDIFF(endTime,startTime)),0) FROM events WHERE user=18 Sometimes an event will go overnight, so the difference between times needs to take into account the differences between the dates as well. I've been trying SELECT COUNT(*), IFNULL(SUM(TIMEDIFF(CONCAT(endDate,' ',endTime),CONCAT(startDate,' ',startTime))),0) FROM events WHERE user=18 Unfortunately I only get errors when I do this, and I can't seem to combine the two fields into a single timestamp.

    Read the article

  • Adding a Design time Panel to a TabPage at run time

    - by BDotA
    Hi, I wish to have a Panel with the controls on it at design time but I want to add this panel to a desired tabPage of my TabControl at run time. I wrote something like this, did not work : the panel does not show up in the tab page. please help me. panel2.Parent = tabGuy.TabPages[0]; tabGuy.SuspendLayout(); tabGuy.TabPages[0].Controls.Add(panel2); tabGuy.ResumeLayout(); panel2.Show();

    Read the article

  • Loop function works first time, not second time

    - by user1483101
    I'm creating a parsing program to look for certain strings in a a text file and count them. However, I'm having some trouble with one spot. def callbrowse(): filename = tkFileDialog.askopenfilename(filetypes = (("Text files", "*.txt"),("HTML files", ".html;*.htm"),("All files", "*.*"))) print filename try: global filex global writefile filex = open(filename, 'r') print "Success!!" print filename except: print "Failed to open file" ######This returns the correct count only the first time it is run. The next time it ######returns 0. If the browse button is clicked again, then this function returns the ######correct count again. def count_errors(error_name): count = 0 for line in filex: if error_name == "CPU > 79%": stringparse = "Utilization is above" elif error_name == "Stuck touchscreen": stringparse = "Stuck touchscreen" if re.match("(.*)" + "Utilization is above" + "(.*)",line): count = count + 1 return count Thanks for any help. I can't seem to get this to work right.

    Read the article

  • Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

    - by Laurent Bugnion
    One of my favorite features in Expression Blend is the ability to attach a Visual Studio debugger to Blend. First let’s start by answering the question: why exactly do you want to do that? Note: If you are familiar with the creation and usage of design time data, feel free to scroll down to the paragraph titled “When design time data fails”. Creating design time data for your app When a designer works on an app, he needs to see something to design. For “static” UI such as buttons, backgrounds, etc, the user interface elements are going to show up in Blend just fine. If however the data is fetched dynamically from a service (web, database, etc) or created dynamically, most probably Blend is going to show just an empty element. The classical way to design at that stage is to run the application, navigate to the screen that is under construction (which can involve delays, need to log in, etc…), to measure what is on the screen (colors, margins, width and height, etc) using various tools, going back to Blend, editing the properties of the elements, running again, etc. Obviously this is not ideal. The solution is to create design time data. For more information about the creation of design time data by mocking services, you can refer to two talks of mine “Deep dive MVVM” and “MVVM Applied From Silverlight to Windows Phone to Windows 8”. The source code for these talks is here and here. Design time data in MVVM Light One of the main reasons why I developed MVVM Light is to facilitate the creation of design time data. To illustrate this, let’s create a new MVVM Light application in Visual Studio. Install MVVM Light from here: http://mvvmlight.codeplex.com (use the MSI in the Download section). After installing, make sure to read the Readme that opens up in your favorite browser, you will need one more step to install the Project Templates. Start Visual Studio 2012. Create a new MvvmLight (Win8) app. Run the application. You will see a string showing “Welcome to MVVM Light”. In the Solution explorer, right click on MainPage.xaml and select Open in Blend. Now you should see “Welcome to MVVM Light [Design]” What happens here is that Expression Blend runs different code at design time than the application runs at runtime. To do this, we use design-time detection (as explained in a previous article) and use that information to initialize a different data service at design time. To understand this better, open the ViewModelLocator.cs file in the ViewModel folder and see how the DesignDataService is used at design time, while the DataService is used at runtime. In a real-life applicationm, DataService would be used to connect to a web service, for instance. When design time data fails Sometimes however, the creation of design time data fails. It can be very difficult to understand exactly what is happening. Expression Blend is not giving a lot of information about what happened. Thankfully, we can use a trick: Attaching a debugger to Expression Blend and debug the design time code. In WPF and Silverlight (including Windows Phone 7), you could simply attach the debugger to Blend.exe (using the “Managed (v4.5, v4.0) code” option even for Silverlight!!) In Windows 8 however, things are just a bit different. This is because the designer that renders the actual representation of the Windows 8 app runs in its own process. Let’s illustrate that: Open the file DesignDataService in the Design folder. Modify the GetData method to look like this: public void GetData(Action<DataItem, Exception> callback) { throw new Exception(); // Use this to create design time data var item = new DataItem("Welcome to MVVM Light [design]"); callback(item, null); } Go to Blend and build the application. The build succeeds, but now the page is empty. The creation of the design time data failed, but we don’t get a warning message. We need to investigate what’s wrong. Close MainPage.xaml Go to Visual Studio and select the menu Debug, Attach to Process. Update: Make sure that you select “Managed (v4.5, v4.0) code” in the “Attach to” field. Find the process named XDesProc.exe. You should have at least two, one for the Visual Studio 2012 designer surface, and one for Expression Blend. Unfortunately in this screen it is not obvious which is which. Let’s find out in the Task Manager. Press Ctrl-Alt-Del and select Task Manager Go to the Details tab and sort the processes by name. Find the one that says “Blend for Microsoft Visual Studio 2012 XAML UI Designer” and write down the process ID. Go back to the Attach to Process dialog in Visual Studio. sort the processes by ID and attach the debugger to the correct instance of XDesProc.exe. Open the MainViewModel (in the ViewModel folder) Place a breakpoint on the first line of the MainViewModel constructor. Go to Blend and open the MainPage.xaml again. At this point, the debugger breaks in Visual Studio and you can execute your code step by step. Simply step inside the dataservice call, and find the exception that you had placed there. Visual Studio gives you additional information which helps you to solve the issue. More info and Conclusion I want to thank the amazing people on the Expression Blend team for being very fast in guiding me in that matter and encouraging me to blog about it. More information about the XDesProc.exe process can be found here. I had to work on a Windows 8 app for a few days without design time data because of an Exception thrown somewhere in the code, and it was really painful. With the debugger, finding the issue was a simple matter of stepping into the code until it threw the exception.   Laurent Bugnion (GalaSoft) Subscribe | Twitter | Facebook | Flickr | LinkedIn

    Read the article

  • Why is Ubuntu's clock getting slower or faster?

    - by ændrük
    Ubuntu's clock is off by about a half hour: Where do I even start troubleshooting this? It's allegedly being set "automatically from the Internet". How can I verify that "the Internet" knows what time it is? Details Ubuntu has had plenty of time to communicate with the Internet: $ date; uptime Fri May 18 05:56:00 PDT 2012 05:56:00 up 12 days, 10:48, 2 users, load average: 0.61, 0.96, 1.15 This time server I found via a web search does appear to know the correct time: $ date; ntpdate -q north-america.pool.ntp.org Fri May 18 05:56:09 PDT 2012 server 208.38.65.37, stratum 2, offset 1752.625337, delay 0.10558 server 46.166.138.172, stratum 2, offset 1752.648597, delay 0.10629 server 205.189.158.228, stratum 3, offset 1752.672466, delay 0.11829 18 May 05:56:18 ntpdate[29752]: step time server 208.38.65.37 offset 1752.625337 sec There aren't any reported errors related to NTP: $ grep -ic ntp /var/log/syslog 0 After rebooting, the time was automatically corrected and the following appeared in /var/log/syslog: May 18 17:58:12 aux ntpdate[1891]: step time server 91.189.94.4 offset 1838.497277 sec A log of the offset reported by ntpdate reveals that the clock is drifting by about 9 seconds every hour: $ while true; do ntpdate-debian -q | tail -n 1 >> 'drift.log'; sleep 16m; done ^C $ r -e ' attach(read.table("drift.log", header=FALSE)) clock <- as.POSIXct(paste(V1, V2, V3), format="%d %b %H:%M:%S") fit <- lm(V10~clock) png("drift.png") plot(clock, V10, xlab="Clock time", ylab="Time server offset (s)") abline(fit) mtext(sprintf("Drift rate: %.2f s/hr", fit$coefficients[[2]]*3600)) '

    Read the article

  • Personal Development : Time, Planning , Repairs & Maintenance

    - by Rajesh Pillai
    Personal Development : Time, Planning, Repairs & Maintenance These are just my thoughts, but some you may find something interesting in it. Please think over it. We may know many things, but still we always keeps procrastinating it. I have written this as I have heard many people coming back and saying they don’t have time to do things they like. These are my thoughts buy may be useful to someone else too. Certain things in life needs periodic repairs and maintenance. To cite some examples , your CAR, your HOUSE, your personal laptop/desktop, your health etc. Likewise there are certain other things in professional life that requires repair/ maintenance /or some kind of polishing, so that you always stay on top of it. But they are not always obvious. Some of them are - Improving your communication skills - Increasing your vocabulary - Upgrading your technical skills - Pursuing your hobby - Increasing your knowledge/awareness etc… etc… And then there are certain things that we are always short of…. one is TIME. We all know TIME is one of the most precious things in life and yet we all are very miserable at managing it. Remember you can only manage it and not control it. You can only control which you own or which you create. In theory time is infinite. So, there should be abundant of it. But remember one thing, you know this, it’s not reversible. Once it has elapsed you cannot live it again. Think over it. So, how do find that golden 25th hour every day. To find the 25th hour you need to reflect back on your current daily activities. Analyze them and see where you are spending most of your time and is it really important. Even the 8 hours that you spent in the office, is it spent fruitfully. At the end of the day is the 8 precious hour that you spent was worth it. Just reflect back on your activities. Did you learn something? If yes did you make a point to NOTE IT. If you didn’t NOTED it then was the time you spent really worth it. Just ponder over it. Some calculations of your daily activities where most of the time is spent. Let’s start (in no particular order though) - Sleep (6.5 hours) [Remember you only require 6 good hours of sleep every day]. Some may thing it is 8, but it’s a myth.   o To achive 6 hours of sleep and be in good health you can practice 15 minutes of daily meditation. So effectively you can    round it to 6.5 hours. - Morning chores(2 hours) : Some may need to prepare breakfast and all other things. - Office commuting (avg. to and fro 3 hours) - Office Work (avg 9.5 hours) Total Hours: 21 hours effective time which is spent irrespective of what you do. There may be some variations here and there. Still you have 3 hours EXTRA. Where do these 3 hours go? If you can find it, then you may get that golden 25th hour out of these 3 hours. Let’s discount 2 hours for contingencies, still you have 1 hour with you. If you can’t find it then you are living a direction less life. As you can see, the 25th Hour lies within the 24 hours of the day. It’s upto each one of us to find and make use of it. Now what can you do with that 25th hour i.e. 1 hour extra of your life. Imagine the possibility. Again some calculations 1 hour daily * 30 days = 30 hours every month 30 hours pm * 12 month = 360 hours every year. 360 hours every year seems very promising. Let’s add some contingencies, say, let’s be optimistic and say 50 % contingency. Still you have 180 hours every year. That leaves with 30 minutes every day of extra time. That’s hell a lot of time, if you could manage it. These may sound like a high talk [yes, it is, unless you apply these simple rules and rationalize your everyday living and stop procrastinating]. NOTE: I haven’t taken weekend, holidays and leaves into account. So, that leaves us with a lot of buffer time. You can meet family friends, relatives, other tasks, and yet have these 180 pure hours of joy every year. Do whatever you want to do with it. So, how important is this 180 hours per year to you? Just think over it. You may use it the way you like - 50 hours [pursue your hobby like drawing, crafting, learn dance, learn juggling, learn swimming, travelling hmm.. anything you like doing and you didn’t had time to do it.] - 30 hours you can learn a new programming language or technology (i.e. you can get comfortable with it) - 50 hours [improve existing skills] - 20 hours [improve you communication skill]. Do some light reading. - 30 hours [YOU DECIDE WHAT TO DO]? So, if you had done this for one year you would have learnt a new programming language, upgraded existing skills, improved you communication etc.. If you had done this for two years.. imagine the level of personal development or growth which you may have attained….. If you had done this for three years….. NOW I think I don’t need to mention this… So, you still have TIME, as they say TIME is infinite. So, make judicious use of this precious thing. And never ever comeback saying “I don’t have time”. So, if you are RICH in TIME, everything else will be automatically taken care of, as those things may just be a byproduct of how you spend your time… So, happy TIMING your TIME everyday.

    Read the article

  • Convert 12-hour date/time to 24-hour date/time

    - by Patrick Cuff
    I have a tab delimited file where each record has a timestamp field in 12-hour format: mm/dd/yyyy hh:mm:ss [AM|PM]. I need to quickly convert these fields to 24-hour time: mm/dd/yyyy HH:mm:ss. What would be the best way to do this? I'm running on a Windows platform, but I have access to sed, awk, perl, python, and tcl in addition to the usual Windows tools.

    Read the article

  • Ubuntu 13.10 Symfony installation date time issue

    - by Sambo
    I'm installing Symfony on my Ubuntu system, everything was going fine until the very last moment when I was met with a screen that said: ContextErrorException: Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/symfony-test/app/cache/dev/classes.php line 5107 in /var/www/symfony-test/app/cache/dev/classes.php line 5107 at ErrorHandler->handle('2', 'date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.', '/var/www/symfony-test/app/cache/dev/classes.php', '5107', array('level' => '100', 'message' => 'Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".', 'context' => array())) at date_default_timezone_get() in /var/www/symfony-test/app/cache/dev/classes.php line 5107 at Logger->addRecord('100', 'Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".', array()) in /var/www/symfony-test/app/cache/dev/classes.php line 5193 at Logger->debug('Notified event "kernel.exception" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException".') in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 246 at TraceableEventDispatcher->preListenerCall('kernel.exception', array(object(ProfilerListener), 'onKernelException')) in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 448 at TraceableEventDispatcher->Symfony\Component\HttpKernel\Debug\{closure}(object(GetResponseForExceptionEvent)) at call_user_func(object(Closure), object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1667 at EventDispatcher->doDispatch(array(object(Closure), object(Closure)), 'kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1600 at EventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/cache/dev/classes.php line 1764 at ContainerAwareEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php line 139 at TraceableEventDispatcher->dispatch('kernel.exception', object(GetResponseForExceptionEvent)) in /var/www/symfony-test/app/bootstrap.php.cache line 2870 at HttpKernel->handleException(object(ContextErrorException), object(Request), '1') in /var/www/symfony-test/app/bootstrap.php.cache line 2823 at HttpKernel->handle(object(Request), '1', true) in /var/www/symfony-test/app/bootstrap.php.cache line 2947 at ContainerAwareHttpKernel->handle(object(Request), '1', true) in /var/www/symfony-test/app/bootstrap.php.cache line 2249 at Kernel->handle(object(Request)) in /var/www/symfony-test/web/app_dev.php line 28 After many hours of trying ideas in other threads, editing php.ini and classes.php to something that might work, I have gotten absolutely nowhere! Has anyone else had this problem

    Read the article

  • How to quickly acquire and process real time screen output

    - by Akusete
    I am trying to write a program to play a full screen PC game for fun (as an experiment in Computer Vision and Artificial Intelligence). For this experiment I am assuming the game has no underlying API for AI players (nor is the source available) so I intend to process the visual information rendered by the game on the screen. The game runs in full screen mode on a win32 system (direct-X I assume). Currently I am using the win32 functions #include <windows.h> #include <cvaux.h> class Screen { public: HWND windowHandle; HDC windowContext; HBITMAP buffer; HDC bufferContext; CvSize size; uchar* bytes; int channels; Screen () { windowHandle = GetDesktopWindow(); windowContext = GetWindowDC (windowHandle); size = cvSize (GetDeviceCaps (windowContext, HORZRES), GetDeviceCaps (windowContext, VERTRES)); buffer = CreateCompatibleBitmap (windowContext, size.width, size.height); bufferContext = CreateCompatibleDC (windowContext); SelectObject (bufferContext, buffer); channels = 4; bytes = new uchar[size.width * size.height * channels]; } ~Screen () { ReleaseDC(windowHandle, windowContext); DeleteDC(bufferContext); DeleteObject(buffer); delete[] bytes; } void CaptureScreen (IplImage* img) { BitBlt(bufferContext, 0, 0, size.width, size.height, windowContext, 0, 0, SRCCOPY); int n = size.width * size.height; int imgChannels = img->nChannels; GetBitmapBits (buffer, n * channels, bytes); uchar* src = bytes; uchar* dest = (uchar*) img->imageData; uchar* end = dest + n * imgChannels; while (dest < end) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; dest += imgChannels; src += channels; } } The rate at which I can process frames using this approach is much to slow. Is there a better way to acquire screen frames?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >