w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Execution time and gettimeofday on ubuntu / i7
You can use gettimeofday() at start and end of code to find the difference between starting time and finishing time of program. like //start = gettimeofday //your code here //end = gettimeofday Execution time will be difference between the 2 But it depends on how much load is one the machine is at that point. So not a reliable method. You can also use: time ./a.out assuming your program is a.out

Categories : C

BOINC: Run several tasks in each time, ubuntu/debian
As stated by zero323, each tasks runs in one CPU. The default available CPU number is 1, so you will have to change this in BOINC preferences. Go to BOINC manager > Tools > Computing preferences > Processor usage Find On multiprocessor systems, use at most and replace the value to your desirable percentage of processors (If you want them all, use 100%. If you have a quad-core machine, you will have 4 tasks running at a time) I also recommend you to take a look at Use at most option, since each CPU will have this percentage of usage. Keep an eye on your CPUs core temperature using the command sensors

Categories : Misc

Bitnami GitLab (ubuntu) server can't get time synchronized
I can't be sure for your version but the following works for BitNami LAMPStack 5.3.15-0 (and for every other LAMPStack version I presume). sudo aptitude install ntp However, it is possible the errors you mention are due to the virtual machine inheriting the clock from the hardware it is hosted on. I you keep getting errors, I would take a look on how to solve the problem from the VirtualBox side, something like this might help.

Categories : Ubuntu

Ubuntu: How to upgrade ubuntu 11 to ubuntu 13?
Ubuntu 11.04 is apparently not "supported" anymore... it was not a LTS (Long Term Support) release (http://www.omgubuntu.co.uk/2012/10/ubuntu-11-04-support-ends-today) There seems to be an option of "updating" things on "old-releases" (but they are not actively maintained/updated anymore), by editing your source repositories location: http://askubuntu.com/questions/101479/are-existing-updates-available-after-end-of-support. However, if you want to update to a 2013 version, probably the best you can do is to backup your data and configurations and install a new version from scratch. Pay attention to the fact that non-LTS versions stop being supported after around 2 years.

Categories : Ubuntu

What platform (server installed on ubuntu vs ubuntu server) to prefer for website development?
There seems to be a lot of confusion in your post. Based on your lack of experience with GNU/Linux, I would suggest you use desktop Ubuntu. The difference between Ubuntu server and Ubuntu desktop is that the server edition is targetted to experienced users, so you get a very minimal distribution. No GUI, nothing preinstalled except the bare minimum. As for your comment about Apache/Glassfish, the two aren't comparable. Apache is the name of the open source community which looks after a lot of products. Very often people call Apache's httpd just "apache", which is a web server. Glassfish is a Java EE application server (Oracle's reference implementation) so probably a good place to start with Java EE.

Categories : Apache

Ubuntu/Python- How to call ubuntu commands and 3rd party applications through Python
Take a look at os.path for directory navigation. To execute a shell command use os.system. The example you posted could go something along the lines of: os.chdir(os.path.expanduser('~/Documents/XDF_Thumbnails_Sci')) for file in os.listdir('.'): if os.path.splitext(file)[1] == ".feedme": os.system("~/galfit %s" % file)

Categories : Python

Same android cmake git project compiles well on one Ubuntu machine but does not compile on another Ubuntu machine even the entire project is the same
whoa! Solved! It was really a weird behaviour from cmake: I had three files conf.c that must be merged into a static library. When cmake run the AR program to create the library, it executed a command that was like: ar cr dir1/source1.c dir1/source2.c ... dft/conf.c rdft/conf.c ar r reodft/conf.c dir2/source3.c so, maybe due to the huge number of object files that were to be linked, cmake splitted ar commands in two command, BUT second command overwrited one of the two file conf.c that were added with the first command, so symbols defined with the first ar command were lost! This is clearly a bug in ar because even if the source file is the same, maybe the content may vary, thus symbols are not to be deleted. Thanks to all! Your suggestions brought me to the right solution!

Categories : Android

Difference between ubuntu and ARM Ubuntu
ARM Ubuntu according http://www.ubuntu.com/download/arm is for ARM-based systems only. It supports Calxeda ECX-1000 and Marvell Armadaxp (12.04 LTS only) production boards. Ubuntu update will not happen automatically. It checks if there is new updates automatically but never will update without yours permission. Security updates can be enabled to be updated automatically. For this you need to install unattended-upgrades: sudo apt-get install unattended-upgrades sudo dpkg-reconfigure unattended-upgrades If you want to have home server - install Ubuntu Server 12.04 LTS. It's reliable and the most important free. It will do all your detailed operations like file sharing and more.

Categories : Ubuntu

Cannot access ubuntu server from other machines other than the machine which is hosting the virtual machine which is my ubuntu server
First of all make sure in the setting of the virtual machine that it is in Bridged Adaptor type connectivity. Give a static ip to the virtual machine using sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0 the above is an example. You got what I mean. 3.Third, Try pinging the virtual machine with the base machine running the vbox to make sure they are connected. ping ipaddress-basemachine 4 . Now if everything is working fine from there then connect with this virtual machine with other base machine using Remote Desktop Viewer or any other similar application. Specify, the ip-address of the vbox and username, password. It will be able to connect with it now. 5 . If it still is not able to then try to check the firewall rules on both the virtual box machine and the base machine

Categories : Linux

Translating time stamps (start, end) into time series data. Errors with align.time() and colnames
This is not an answer to your problem. Honestly it is not clear for me the transition between the data you show in the image and the example of your data. It seems like that you can't reproduce this data. So Here a function to generate a reproducible example of your data. I think it can be at least useful, to validate your model. function to sample data library(reshape2) start.min <- as.POSIXct("2013-01-01 00:00:00 PST") hours.min <- format(seq(start.min, length.out=24*60, by = "mins"), '%H:%M') ## function to generate a trip sample ## min.dur : minimal duration of a trip ## max.dur : maximal duration of a trip ## min.trip : minimal number of trips that a user can do gen.Trip <- function(min.dur=3,max.dur=10,min.trip=100){ ## gen

Categories : R

identify the row in my time vector where the time is 5 seconds before the last printed time, times are however in milliseconds
For your sample vector (let's call it t): find(t < t(end) - 5000, 1, 'last') ans = 4 For the full matrix, it's almost the same thing: find(matrix(:,2) < matrix(end,2) - 5000, 1, 'last')

Categories : Matlab

How to compare Starting time and End time of a event with existing events of same time on same day?
You can use 24 hour format to solve this in your logic. you have to save existing event timings in Database. whenever new event timings entered, you need to compare with existing both start & end timings with previous ones. For Example: Event1: x1 to y1 Event2; x2 to y2 if(x2==x1 && y2==y1) if(x2>x1 &&x2<y1) andif(y2<y1) ...so on based on your requirement.

Categories : Asp Net

How to display a time in the user's local time zone if I have that time in UTC?
You can use the method localtime: {% load tz %} {% localtime on %} {{ value }} {% endlocaltime %} {% localtime off %} {{ value }} {% endlocaltime %}

Categories : Django

Python header print one time for every time I run the script not each time
I thoroughly apologize for the previous versions. There was a tiny detail that I was missing but I've fixed it now. Here's the correct code: #--- Open the file + write on it --- f = open('out.csv','a') prev_data = open('out.csv', 'r').read() header = "Datetime,Location,Temperature,current_condition " # Add a header only if the file is empty if prev_data == '': f.write(header) date = str(now.month) + "/" + str(now.day) + "/" + str(now.year) + " " + str(now.hour) + ":" + str(now.minute) + ":" + str(now.second) f.write(','.join([date,locations,str(temp_f),weather])) f.write(' ') f.close() # --- And Close the file ---

Categories : Python

db.Time Property saving time as datetime instead of just time
I'm not sure why you have two inline assignments, but to get time out of a timedelta object: >>> b datetime.datetime(2013, 7, 15, 10, 21, 31, 599402) >>> a datetime.datetime(2013, 7, 15, 10, 18, 11, 251477) >>> str(b-a) '0:03:20.347925' >>> (datetime.datetime.min + (b-a)).time() datetime.time(0, 3, 20, 347925) In order to store only the time, you need to use TimeProperty in your datastore. It will be represented internally as datetime, but will store datetime.time() objects.

Categories : Python

How to calculate the time consumed from start time to end time in php
Try using diff: echo date_create('01:00:00 PM')->diff(date_create('01:25:00 PM'))->format('%H:%i:%s');

Categories : PHP

Why are there differences in Python time.time() and time.clock() on Mac OS X?
From the docs on time.clock: On Unix, return the current processor time as a floating point number expressed in seconds. The precision, and in fact the very definition of the meaning of “processor time”, depends on that of the C function of the same name, but in any case, this is the function to use for benchmarking Python or timing algorithms. From the docs on time.time: Return the time in seconds since the epoch as a floating point number. Note that even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, it can return a lower value than a previous call if the system clock has been set back between the two calls. time.time() measures i

Categories : Python

How to handle time zone issue without storing date time as TIMESTAMP WITH TIME ZONE
If you have the names of the time zones, you can use a query similar to the following to adjust alter timestamps: SELECT e.last_updated_date AS cst_last_updated_date, (FROM_TZ(e.last_updated_date, 'US/Central') AT TIME ZONE 'US/Eastern') AS est_last_updated_date FROM events_tbl e; In my experience this will automatically account for DST based on the locale. If you're working with DATES and not TIMESTAMPS, you can also do the following: select CAST (e.last_updated_date AS TIMESTAMP) AS cst_last_updated_date, (FROM_TZ(CAST (e.last_updated_date AS TIMESTAMP), 'US/Central') AT TIME ZONE 'US/Eastern') AS est_last_updated_date from events_tbl e;

Categories : C#

how can I subtract time from time for time remaining?
var first = (new Date('Jan 01, 2000 12:54:45')).getTime(); var second = (new Date('Jan 01, 2000 11:35:53')).getTime(); var differenceInSeconds = (second - first) / 1000; // 4732 I chose 2000-01-01 as the date, as it does not matter as long it is the same. We only want to calculate the difference.

Categories : Javascript

Qt 4 On Ubuntu 13.04
apt-cache search libqt4 That should give you a list of all the packages needed to get the Qt 4 libs. Should include: libqt4-dev libqt4-core libqt4-gui ...etc

Categories : Ubuntu

ubuntu 13.04 and g++
For Ubuntu, the easiest way to get all the build tools including g++ is to sudo apt-get install build-essential I suggest you check AskUbuntu for more info.

Categories : Linux

How to use SVN 1.8 with Eclipse under Ubuntu?
LET THERE BE LIGHT! Download the CollabNetSubversion-client rpm in the correct architecture (registration required). Install rpm sudo apt-get install rpm Install svn client without deps: sudo rpm -ivh --nodeps CollabNetSubversion-client-1.8.0-2. x86_64.rpm Find collabnet installation `sudo updatedb then locate *collabnet* (or use find or whatever you like), should be /opt/CollabNet_Subversion/bin/collabnetsvn-config Get the lib path, should be /opt/CollabNet_Subversion/lib Open your eclipse.ini Enter the lib path-Djava.library.path=/opt/CollabNet_Subversion/lib under the vmargs line. Install the SVN Plugin Subclipse (this does not seem to work with Subversive) Choose JavHL (JNI) 1.8.0 as your SVN interface CHECK THE #&%$§# PROJECTS OUT AND COMMIT THE $%&#§ OUT OF THEM!

Categories : Eclipse

Maven in Ubuntu 10.4 -
Maven is trying to download a plugin it needs to to do project cleanup from http://repo1.maven.org/. Do you need to use a proxy to connect to the internet? If so, see this guide: http://maven.apache.org/guides/mini/guide-proxies.html If not, it might be that the network somewhere between your workstation and repo1.maven.org was having problems, which might be resolved now.

Categories : Maven

Can't get php 5.4 on Ubuntu 10.04 lts plesk 10
Plesk don't comes with php on Ubuntu. Plesk installs PHP from available repositories registered in apt. So, you should find out how to upgrade PHP on ubuntu and that's all. As I know plesk don't have any restrictions if current PHP version will be upgraded. Just one of guides from Google: http://serverfault.com/questions/420286/how-do-i-upgrade-from-php-5-3-to-php-5-4-6-in-ubuntu

Categories : PHP

How to upgrade PHP-FPM to PHP 5.5 on Ubuntu?
If you're willing to give up packages and build from source, you can have whatever version of PHP you want. Here're my notes for building PHP 5.5.0. https://github.com/triplepoint/web_development_vm_how_to/blob/master/docs/php_nginx_vm.md#install-php Be aware, it's a serious tradeoff of convenience to go this route. In the long run, I can't say I'd recommend building from source for anything other than a testing environment, but if you're just trying to test out the new features of 5.5, or if you're running a small server and don't mind maintaining it by hand, source is an option.

Categories : PHP

How to let vim behave on Mac OS X as on Ubuntu?
Terminal.app does not support the mouse. If you want the mouse you can to install iTerm2 which does support the mouse. In iTerm2: go to Preferences -> Profiles -> (current profile) -> Terminal and Make sure Enable xterm mouse reporting. After you select this you might need to restart iTerm2. To enable mouse support in vim add the following to your vimrc set mouse=a

Categories : Ubuntu

how to use my own library c++ ubuntu
You might copy the library to /usr/local/lib and the linker should pick it up if you add it to the project. In my CMakeLists.txt I have: function(import_library target name) find_library(${target}_import_${name} ${name}) add_library(${${target}_import_${name}} SHARED IMPORTED) target_link_libraries(${target} ${name}) endfunction() function(project_import_library name) import_library(Project ${project}) endfunction( project_import_library(dependency) Replace Project/project and dependency by your names.

Categories : C++

Trying to use LuaFileSystem on Ubuntu 10.04
The io.open call can be easily debugged by adding assert around it. This will print the error message when io.open fails to open the file: local f = assert(io.open('/home/alex/Desktop/SPLAY WORK/splay_client_commands_1.4/test1.txt', "r")) This "trick" is also described at: http://www.lua.org/pil/21.2.html

Categories : Lua

How do I remove Xen from Ubuntu?
You can just try sudo apt-get remove xen-hypervisor-amd64 or dpkg -i xen-hypervisor-amd64 to see which xen files have been installed in your machine

Categories : Linux

How to fix Nokogiri on Ubuntu?
Ran across your question researching an issue of my own. It looks like, for a time, the nokogiri team was overriding the system install of libxml at gem install time as indicated in this comment: https://github.com/sparklemotion/nokogiri/issues/829#issuecomment-16877522. Not sure if that helps you, but it seems relevant. Perhaps a new version of Nokogiri is in order.

Categories : Ruby

Ubuntu libdispatch
It sounds like you are missing the library from your link line. When you compile your program into an executable, add the library to the command. I am guessing it should look something like this: clang x.c y.c z.c -ldispatch

Categories : C

cannot find -lGL on Ubuntu 13.10
I can install any of the mentioned packages Do you mean you can't install any of the mentioned packages? Why not? Anyhow. You need two things here: figuring out what's the file name you're looking for figuring out how to locate the package containing that file name Given that you're looking for a shared library, and you're passing -lGL to the linker, then the file name you're looking for is libGL.so. Now, there are two strategies for figuring out which Ubuntu package contains what: Using apt-file: install it: apt-get install apt-file search for the file apt-file search libGL.so Using the online package search: point your browser to http://packages.ubuntu.com/ scroll to the "Search the contents of packages" section put libGL.so in the search field, and select your version (s

Categories : Linux

Installing Scala 2.10.2 on Ubuntu 12.04
/usr/share/java/scala-library.jar is in package scala-library. You must remove both then install the 2.10.2 package: apt-get remove scala-library scala dpkg -i /home/chris/Downloads/scala-2.10.2.deb In more details, plagiarizing your output log: 1) dpkg is installing a new version of the scala package: Unpacking replacement scala ... 2) While checking if everything will go well, it realised that if unpacking the scala package, it will replace a file from another package named scala-library: trying to overwrite '/usr/share/java/scala-library.jar', which is also in package scala-library 2.9.1.dfsg-3 3) It desided to stop before doing bad things.

Categories : Scala

Can't install rmagick gem on Ubuntu 13.04
Try clearing your apt repository and removing any broken packages first: sudo apt-get update sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove If the system identifies any broken packages, forcefully remove them (replace package_name with your own): sudo dpkg --remove -force --force-remove-reinstreq package_name Then reinstall any missing packages again.

Categories : Ruby On Rails

Is it possible to use systemtap 1.7/2.1 on Ubuntu 12.04 with 3.5.0/3.8.0 kernels?
You may need to update your version of systemtap, as a very old one (e.g. 1.7 is from early 2012) will often not work with a very new kernel (but vice versa is fine). OTOH, the original build-id error is a real version-mismatch problem within the ubuntu -dbgsym repositories. You need to ensure that your running-kernel version exactly matches the dbgsym one. With Ubuntu this can be tricky, because "uname -r" and the dpkg names do not contain a uniquely identify the build. See the difference between: #55-Ubuntu SMP Thu Jun 6 20:18:19 UTC 2013 and #55~precise1-Ubuntu SMP Fri Jun 7 16:25:50 UTC 2013 Why do you need kernel debug symbols for userspace probes though? Please include your stap script and stap-report output. Try also the stap-prep script. Another complicating factor is

Categories : Ubuntu

How to index using elasticsearch on ubuntu
Answers are found in elasticsearch guide http://www.elasticsearch.org/guide/reference/setup/installation/ After downloading the latest release and extracting it, elasticsearch can be started using: $ bin/elasticsearch Under *nix system, the command will start the process in the background. To run it in the foreground, add the -f switch to it: $ bin/elasticsearch -f ElasticSearch is built using Java, and requires at least Java 6 in order to run. The version of Java that will be used can be set by setting the JAVA_HOME environment variable.

Categories : Ruby On Rails

How to install ruby 1.8.7 on ubuntu 12.04 with rvm?
From the documentation: To install a specific tagged version of ruby from the repository we specify -t(tag name). It then goes on to talk about branches... Repository Branches (MRI) To install a specific branch version of ruby from the repository we specify --branch (branch name). Named rubies can help avoid clashes. $ rvm install ruby-head -n zombie --branch ruby_1_8 && rvm ruby-head-zombie $ ruby -v ruby 1.8.8dev (2012-05-21) [i386-darwin10.8.0] $ rvm install ruby-head -n newborn && rvm ruby-head-newborn $ ruby -v ruby 2.0.0dev (2012-06-03 trunk 35876) [x86_64-darwin10.8.0] You'll find a list of all valid branches in the ruby repository: http://svn.ruby-lang.org/repos/ruby/branches/ You have access to much more than what is shown. ruby_1_3/ ruby_1_4/ ruby_

Categories : Ruby

Cannot install qrscanner gem on ubuntu
read the documentation of the gem at https://github.com/andys/qrscanner and install these dependencies before you install the gem. Dependencies ------------ * Python (for ZXing build script) * ImageMagick: libMagick++, libMagickWand, libMagickCore * gcc, g++, libstd++ * Operating system with a PREFIX of "/usr".

Categories : Ruby

trying to install something on an ubuntu ec2 instance
That repository is not responding to your update requests. I believe adding other repositories by modifying /etc/apt/sources.list should solve your problem. Look at this page for more details.

Categories : Linux

Permission of using curlftpfs on Ubuntu
CurlFtpFs is a FUSE mount. To allow a user other than the mounter to access a FUSE mount, there are flags allow_others and allow_root. Your sudo implies that root is the mounter, so nobody other than root can access it. You could use the allow_others flag, but in your case I would add fuse to your list of groups. Then mount the FTP without sudo.

Categories : Matlab



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.