Daily Archives

Articles indexed Friday June 13 2014

Page 11/13 | < Previous Page | 7 8 9 10 11 12 13  | Next Page >

  • How do I find the JavaScript that is invoked when I click on a button or a link in a web-page (part of a data mining project)?

    - by aste123
    I tried to use the 'inspect element' of the firebug addon for Firefox but it doesn't give me any link to the javascript. For example I got this from the firebug addon: < a href="javascript:" text of the link < /a But there is no link to the actual javascript or anything that I can use to directly go to the said link. How do I accomplish this? I need this as part of a personal data mining project that I am doing.

    Read the article

  • Public versus private inheritance when some of the parent's methods need to be exposed?

    - by Vorac
    Public inheritance means that all fields from the base class retain their declared visibility, while private means that they are forced to 'private' within the derived class's scope. What should be done if some of the parent's members (say, methods) need to be publicly exposed? I can think of two solution. Public inheritance somewhat breaks encapsulation. Furthermore, when you need to find out where is the method foo() defined, one needs to look at a chain of base classes. Private inheritance solves these problems, but introduces burden to write wrappers (more text). Which might be a good thing in the line of verbosity, but makes changes of interfaces incredibly cumbersome. What considerations am I missing? What constraints on the type of project are important? How to choose between the two (I am not even mentioning 'protected')? Note that I am targeting non-virtual methods. There isn't such a discussion for virtual methods (or is there).

    Read the article

  • Memory read/write access efficiency

    - by wolfPack88
    I've heard conflicting information from different sources, and I'm not really sure which one to believe. As such, I'll post what I understand and ask for corrections. Let's say I want to use a 2D matrix. There are three ways that I can do this (at least that I know of). 1: int i; char **matrix; matrix = malloc(50 * sizeof(char *)); for(i = 0; i < 50; i++) matrix[i] = malloc(50); 2: int i; int rowSize = 50; int pointerSize = 50 * sizeof(char *); int dataSize = 50 * 50; char **matrix; matrix = malloc(dataSize + pointerSize); char *pData = matrix + pointerSize - rowSize; for(i = 0; i < 50; i++) { pData += rowSize; matrix[i] = pData; } 3: //instead of accessing matrix[i][j] here, we would access matrix[i * 50 + j] char *matrix = malloc(50 * 50); In terms of memory usage, my understanding is that 3 is the most efficient, 2 is next, and 1 is least efficient, for the reasons below: 3: There is only one pointer and one allocation, and therefore, minimal overhead. 2: Once again, there is only one allocation, but there are now 51 pointers. This means there is 50 * sizeof(char *) more overhead. 1: There are 51 allocations and 51 pointers, causing the most overhead of all options. In terms of performance, once again my understanding is that 3 is the most efficient, 2 is next, and 1 is least efficient. Reasons being: 3: Only one memory access is needed. We will have to do a multiplication and an addition as opposed to two additions (as in the case of a pointer to a pointer), but memory access is slow enough that this doesn't matter. 2: We need two memory accesses; once to get a char *, and then to the appropriate char. Only two additions are performed here (once to get to the correct char * pointer from the original memory location, and once to get to the correct char variable from wherever the char * points to), so multiplication (which is slower than addition) is not required. However, on modern CPUs, multiplication is faster than memory access, so this point is moot. 1: Same issues as 2, but now the memory isn't contiguous. This causes cache misses and extra page table lookups, making it the least efficient of the lot. First and foremost: Is this correct? Second: Is there an option 4 that I am missing that would be even more efficient?

    Read the article

  • MVC data binding

    - by user441521
    I'm using MVC but I've read that MVVM is sort of about data binding and having pure markup in your views that data bind back to the backend via the data-* attributes. I've looked at knockout but it looks pretty low level and I feel like I can make a library that does this and is much easier to use where basically you only need to call 1 javascript function that will data bind your entire page because of the data-* attributes you assign to html elements. The benefits of this (that I see) is that your view is 100% decoupled from your back-end so that a given view never has to be changed if your back-end changes (ie for asp.net people no more razor in your view that makes your view specific to MS). My question would be, I know there is knockout out there but are there any others that provide this data binding functionality for MVC type applications? I don't want to recreate something that may already exist but I want to make something "better" and easier to use than knockout. To give an example of what I mean here is all the code one would need to get data binding in my library. This isn't final but just showing the idea that all you have to do is call 1 javascript function and set some data-* attribute values and everything ties together. Is this worth seeing through? <script> $(function () { // this is all you have to call to make databinding for POST or GET to work DataBind(); }); </script> <form id="addCustomer" data-bind="Customer" data-controller="Home" data-action="CreateCustomer"> Name: <input type="text" data-bind="Name" data-bind-type="text" /> Birthday: <input type="text" data-bind="Birthday" data-bind-type="text" /> Address: <input type="text" data-bind="Address" data-bind-type="text" /> <input type="submit" value="Save" id="btnSave" /> </form> ================================================= // controller action [HttpPost] public string CreateCustomer(Customer customer) { if(customer.Name == "Rick") return "success"; return "failure"; } // model public class Customer { public string Name { get; set; } public DateTime Birthday { get; set; } public string Address { get; set; } }

    Read the article

  • Flaws in my PHP development setup - sharing sources causing lags

    - by Wiktor
    I have following development setup for my PHP projects: Working station running on Windows 7 with PhpStorm IDE. GIT for version controlling. CentOS on virtual machine (VirtualBox) with Apache and MySQL (copy of production server). So far, I've been sharing project's source folders between host and guest systems and it was working quite well only really slow. The reason behind this is that Apache was reading files from remote folder (mounted locally). After doing some research, I found out that this set up can be improved by using disk mapping (Samba) instead of folder sharing. So I did that change. I configured my PhpStorm to automatically deploy files to mapped drive. Everything works like a charm now, except for one problem - when I change branches I need to synchronize project's local folder with the one on mapped drive and that takes time, a lot of time (like branching in SVN). Is there another way to handle this than just working on files directly on mapped drive?

    Read the article

  • I am trying to create an windows application watcher? [migrated]

    - by Broken_Code
    I recently started coding in c #(in may this year) and well I find it best to learn by working with code. this application http://www.c-sharpcorner.com/UploadFile/satisharveti/ActiveApplicationWatcher01252007024921AM/ActiveApplicationWatcher.aspx. I am trying to recreate it however mine will be saving the information into an sql database(new at this as well). I am having some coding problems though as it does not do what I expect it to do. THis is the main code I am using. private void GetTotalTimer() { DateTime now = DateTime.Now; IntPtr hwnd = APIFunc.getforegroundWindow(); Int32 pid = APIFunc.GetWindowProcessID(hwnd); Process p = Process.GetProcessById(pid); appName = p.ProcessName; const int nChars = 256; int handle = 0; StringBuilder Buff = new StringBuilder(nChars); handle = GetForegroundWindow(); appltitle = APIFunc.ActiveApplTitle().Trim().Replace("\0", ""); //if (GetWindowText(handle, Buff, nChars) > 0) //{ // string strbuff = Buff.ToString(); // StrWindow = strbuff; #region insert statement try { if (Conn.State == ConnectionState.Closed) { Conn.Open(); } if (Conn.State == ConnectionState.Open) { SqlCommand com = new SqlCommand("Select top 1 [Window Title] From TimerLogs ORDER BY [Time of Event] DESC", Conn); SqlDataReader reader = com.ExecuteReader(); startTime = DateTime.Now; string time = now.ToString(); if (!reader.HasRows) { reader.Close(); cmd = new SqlCommand("insert into [TimerLogs] values(@time,@appName,@appltitle,@Elapsed_Time,@userName)", Conn); cmd.Parameters.AddWithValue("@time", time); cmd.Parameters.AddWithValue("@appName", appName); cmd.Parameters.AddWithValue("@appltitle", appltitle); cmd.Parameters.AddWithValue("@Elapsed_Time", blank.ToString()); cmd.Parameters.AddWithValue("@userName", userName); cmd.ExecuteNonQuery(); Conn.Close(); } else if(reader.HasRows) { reader.Read(); if (appltitle != reader.ToString()) { reader.Close(); endTime = DateTime.Now; appduration = endTime.Subtract(startTime); cmd = new SqlCommand("insert into [TimerLogs] values (@time,@appName,@appltitle,@Elapsed_Time,@userName)", Conn); cmd.Parameters.AddWithValue("@time", time); cmd.Parameters.AddWithValue("@appName", appName); cmd.Parameters.AddWithValue("@appltitle", appltitle); cmd.Parameters.AddWithValue("@Elapsed_Time", appduration.ToString()); cmd.Parameters.AddWithValue("@userName", userName); cmd.ExecuteNonQuery(); reader.Close(); Conn.Close(); } } } } catch (Exception) { } //} #endregion ActivityTimer.Start(); Processing = "Working"; } Unfortunately this is the result. it is not saving the data as I expect it to. What am i doing wrong I had thought that with the sql reader it would first check for a value and only save if they do not match however it is saving whether there is a match or not.

    Read the article

  • DAL Exception handling in a MVP application

    - by Chathuranga
    In a MVP win forms application I'm handling exceptions as follows in DAL. Since the user messaging is not a responsibility of DAL, I want to move it in to my Presentation class. Could you show me a standard way to do that? public bool InsertAccount(IBankAccount ba) { string selectStatement = @"IF NOT EXISTS (SELECT ac_no FROM BankAccount WHERE ac_no=@ac_no) BEGIN INSERT INTO BankAccount ..."; using (SqlConnection sqlConnection = new SqlConnection(db.ConnectionString)) { using (SqlCommand sqlCommand = new SqlCommand(selectStatement, sqlConnection)) { try { sqlConnection.Open(); sqlCommand.Parameters.Add("@ac_no", SqlDbType.Char).Value = ba.AccountNumber; // // sqlCommand.ExecuteNonQuery(); return true; } catch (Exception e) { MessageBox.Show(("Error: " + e.Message)); } if (sqlConnection.State == System.Data.ConnectionState.Open) sqlConnection.Close(); return false; } } }

    Read the article

  • Unable to create dynamic web application in IIS7 and above

    - by Dhwani
    Not able to view application in IIS after successfully calling below method: ServerManager serverMgr = new ServerManager(); Configuration config = serverMgr.GetApplicationHostConfiguration(); ConfigurationSection isapiCgiRestrictionSection = config.GetSection("system.webServer/security/isapiCgiRestriction"); ConfigurationElementCollection isapiCgiRestrictionCollection = isapiCgiRestrictionSection.GetCollection(); //ConfigurationElement addElement = isapiCgiRestrictionCollection.CreateElement("add"); //addElement["path"] = @"C:\Inetpub\wwwroot\"; //addElement["allowed"] = true; //addElement["groupId"] = @"ContosoGroup"; //addElement["description"] = @"Contoso Extension"; //isapiCgiRestrictionCollection.Add(addElement); //serverMgr.CommitChanges(); Site defaultSite = serverMgr.Sites["PharmaConnect"]; defaultSite.Applications.Add("/blogs3", @"C:\inetpub\wwwroot\blogs1"); serverMgr.CommitChanges(); I don't know how to create dynamically sub domain though c# code. We just tried to implement above. But unable to view application/virtual directory in iis. I have tried this, but didn't get success.

    Read the article

  • Medical Devices which supports Direct access through Bluetooth Low Energy [on hold]

    - by Suganthan
    I have went through this link and came to know that we can directly interact with BLE devices to read and write data, so I just want to know some medical device which supports direct access to third-party application (we can directly access the data from the medical device data). Is their any devices which supports direct access to the data Note: I already went through medical devices like Withings and Fitbit

    Read the article

  • What if(event) statement means in JavaScript?

    - by j flo
    I'm rather new to JavaScript and programming in general so I am pretty much only used to seeing if statements that have some kind of comparison operator like, if (x < 10) or if(myBool). I have seen an if statement checking against an event, but I don't understand what or why the event is being checked like that. What's the semantic meaning behind that check or comparison? Here is the code in question: if(event){ event.preventDefault(); }

    Read the article

  • Best practices when creating/modeling databases?

    - by Oscar Mederos
    I learned at the University some steps to model a database: Model the problem using the Extended Entity-Relationship Model. Extract the functional dependencies Apply some algorithms to normalize the database (3NF or Boyce-Codd) Create the database I'm studying Computer Science and since I received that course I'm wondering if I always need to do those steps when creating a complex database for an specified problem. For example, do PHP / .NET / .. programmers always do that? or there are some tools to simplify that process, maybe using another way of represent the problem instead of the EERM?

    Read the article

  • Ubutu 14.04 triple screen, third screen black and X cursor

    - by Horse
    I am having some issues getting my third screen working properly. I had triple screens working fine on 12.04, using 2 nvidia cards. Did a fresh install of 14.04 and having no end of problems getting it working. It either will just be disabled, or the screen is black with the cursor as an X. I can only enable it from the nvidia server settings tool. The Ubuntu native display settings won't even show the 3rd screen. I tried copying the xorg.conf from my old install, which upon restarting X worked fine on the login screen, but then it just sat there after I logged in and didn’t do anything (mouse was still working). I am using gnome-session-fallback instead of unity if that makes any difference. Still having these issues if I try unity though. How do I get my 3rd screen working and displaying a desktop? Here is my current xorg.conf # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 331.20 (buildd@roseapple) Mon Feb 3 15:07:22 UTC 2014 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 76.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: unknown, VertRefresh source: unknown Identifier "Monitor1" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 0.0 - 0.0 VertRefresh 0.0 Option "DPMS" EndSection Section "Monitor" Identifier "Monitor2" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 76.0 EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 580" BusID "PCI:1:0:0" EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 520" BusID "PCI:3:0:0" EndSection Section "Device" Identifier "Device2" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 520" BusID "PCI:3:0:0" EndSection Section "Screen" # Removed Option "metamodes" "DVI-I-2: nvidia-auto-select +0+0, DVI-I-3: nvidia-auto-select +1280+0" # Removed Option "metamodes" "DVI-I-2: nvidia-auto-select +0+0" # Removed Option "SLI" "Off" # Removed Option "BaseMosaic" "off" # Removed Option "metamodes" "GPU-109d4eb8-b40b-87d7-3fd6-95830d1d5215.DVI-I-2: nvidia-auto-select +0+0, GPU-109d4eb8-b40b-87d7-3fd6-95830d1d5215.DVI-I-3: nvidia-auto-select +1280+0, GPU-82e96214-175e-5e6a-218c-5bdbc948daf2.DVI-I-1: nvidia-auto-select +3200+0" # Removed Option "SLI" "off" # Removed Option "BaseMosaic" "on" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-0" Option "metamodes" "DVI-I-2: nvidia-auto-select +0+0, DVI-I-3: nvidia-auto-select +1280+0" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" # Removed Option "metamodes" "nvidia-auto-select +0+0" # Removed Option "metamodes" "DVI-I-3: nvidia-auto-select +0+0" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "nvidia-auto-select +0+0" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen2" Device "Device2" Monitor "Monitor2" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "nvidia-auto-select +0+0" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection Here is my old 'working in 12.04' xorg.conf # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 310.19 ([email protected]) Thu Nov 8 02:08:55 PST 2012 Section "ServerLayout" # Removed Option "Xinerama" "0" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen2" Screen 2 "Screen2" RightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "1" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 76.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: unknown, VertRefresh source: unknown Identifier "Monitor1" VendorName "Unknown" ModelName "DELL 1907FP" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 76.0 Option "DPMS" EndSection Section "Monitor" Identifier "Monitor2" VendorName "Unknown" ModelName "Apple Cinema HD" HorizSync 74.0 - 74.6 VertRefresh 59.9 - 60.0 EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 580" BusID "PCI:1:0:0" Screen 0 EndSection Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GT 520" BusID "PCI:3:0:0" EndSection Section "Device" Identifier "Device2" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 580" BusID "PCI:1:0:0" Screen 1 EndSection Section "Screen" # Removed Option "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +1280+0" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: nvidia-auto-select +0+0 {viewportout=1280x720+0+152}" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen2" Device "Device2" Monitor "Monitor2" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DFP-2: nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Extensions" Option "Composite" "Disable" EndSection

    Read the article

  • Copying kernel and initrd problem while setting up a server

    - by user3452627
    I'm trying to set up a server using PXE and following this (clickable) instruction. But I have a problem in part Creating your NFS installation Right here: Copy kernel and initrd to tftp root. Run these commands ON THE SERVER sudo cp ~/vmlinuz-`uname -r` /tftpboot/ sudo cp ~/initrd.img-`uname -r` /tftpboot/ Actually, I don't know which kernel (server's or client's) should be copied. There isn't any files like those in my home folder on server. Can anybody tell me how to fix it?

    Read the article

  • Mail reaches only after closing connection

    - by user293250
    I have setup a postfix mail server with saslauthd. I telnet from a windows machine to send a mail. All works fine, I even get the msg 250 Mail queued for delivery. On the mailserver I see connect msgs on /var/log/mail.log for connection but not for the mail queuing or delivery. Only after I close the telnet connection I get all the valid msgs in mail.log. The mail also doesnt arrive in my Maildir/new directory until I close the connection. I am very new to Ubuntu, any pointers will be much appreciated. Many thanks.

    Read the article

  • Ubuntu 12.04LTS loads straight to terminal!! startx doesn't work!

    - by user293256
    I have been using ubuntu 12.04LTS for last few months, and now suddenly something has happened to it. As a result, terminal opens on every start up when I login . Although, if i login as a guest, it works fine. I have already used startx command, and tried reinstalling the desktop as well but it doesn't work! If I use ctrl+alt+f9, terminal screen vanishes and a black screen appears, and then nothing happens after that. ctrl+alt+f1 takes me to the command prompt. I know similar questions have been asked here, but i could not find a solution for my laptop. Please help!!

    Read the article

  • xkb for simple remap

    - by Den Rimus
    I've faced some issues after remapping keyboard with xmodmap: settings get reset randomly after 2-20 minutes after applying. Googled it but no help: something resets them, but all mentions apply to xfce, while I'm under usual 14.04 Ubuntu with unity. I saw phrases like 'use xkb, forget xmodmap', but still have no idea how to do that. It's either classified or very complicated, because amount of info on that is significantly smaller than for xmodmap way. Here's my list of customisations: xmodmap -e "keycode 84 = Down" xmodmap -e "keycode 79 = Home" xmodmap -e "keycode 80 = Up" xmodmap -e "keycode 83 = Left" xmodmap -e "keycode 85 = Right" xmodmap -e "keycode 87 = End" xmodmap -e "keycode 90 = Insert" xmodmap -e "keycode 91 = Delete" xmodmap -e "keycode 89 = Next" xmodmap -e "keycode 81 = Prior" where keycodes are corresponding keys on numpad, with numlock = off (basically, I'm replacing KP_Del with Delete, KP_Home with Home etc - don't ask why)) Can someone help to find a way to do that using xkb - at least one of the lines? And where to find the "names" of keys for other so I could do the rest by example?

    Read the article

  • "merging" multiple hardrives for Ubuntu 14.04 install

    - by Thijser
    I have 3 hardrives inside my laptop 2 of which currently house other opperating systems but have a empty partitions of 8 and 9 gigabye and the third is just 12 gB (currently not partitioned at all). Now each of these 3 is to small to be useful to me, however combined they are 29gigs which can easily hold a ubuntu installation, and associated programs. Is there a way set up my installation in such a way that it threads these 3 disks as one? Or is there a way by which I can make it default storage of many things into one drive (downloads and sudo apt-get install for example) to one drive while keeping ubuntu onto another?

    Read the article

  • How do I resolve not fully installed package (python3-setuptools)?

    - by user3737693
    I was trying to install python3-setuptools, and when i run $ sudo apt-get install python3-setuptools I get this error: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up python3-setuptools (0.6.34-0ubuntu1) ... Traceback (most recent call last): File "/usr/bin/py3compile", line 36, in <module> from debpython import files as dpf File "/usr/share/python3/debpython/files.py", line 25, in <module> from debpython.pydist import PUBLIC_DIR_RE File "/usr/share/python3/debpython/pydist.py", line 28, in <module> from debpython.tools import memoize File "/usr/share/python3/debpython/tools.py", line 25, in <module> from datetime import datetime ImportError: /usr/bin/datetime.so: undefined symbol: _Py_ZeroStruct dpkg: error processing python3-setuptools (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: python3-setuptools E: Sub-process /usr/bin/dpkg returned an error code (1) I tried apt-get clean, apt-get autoclean, apt-get remove python3-setuptools, dpkg --remove python3-setuptools, apt-get install -f, dpkg -P --force-remove-reinstreq, dpkg -P --force-all --force-remove-reinstreq and dpkg --purge, but none of them worked. Output of sudo dpkg -P --force-all --force-remove-reinstreq python3-setuptools (Reading database ... 225309 files and directories currently installed.) Removing python3-setuptools ... Traceback (most recent call last): File "/usr/bin/py3clean", line 32, in <module> from debpython import files as dpf File "/usr/share/python3/debpython/files.py", line 25, in <module> from debpython.pydist import PUBLIC_DIR_RE File "/usr/share/python3/debpython/pydist.py", line 28, in <module> from debpython.tools import memoize File "/usr/share/python3/debpython/tools.py", line 25, in <module> from datetime import datetime ImportError: /usr/bin/datetime.so: undefined symbol: _Py_ZeroStruct dpkg: error processing python3-setuptools (--purge): subprocess installed pre-removal script returned error exit status 1 Traceback (most recent call last): File "/usr/bin/py3compile", line 36, in <module> from debpython import files as dpf File "/usr/share/python3/debpython/files.py", line 25, in <module> from debpython.pydist import PUBLIC_DIR_RE File "/usr/share/python3/debpython/pydist.py", line 28, in <module> from debpython.tools import memoize File "/usr/share/python3/debpython/tools.py", line 25, in <module> from datetime import datetime ImportError: /usr/bin/datetime.so: undefined symbol: _Py_ZeroStruct dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: python3-setuptools

    Read the article

  • chrome memory and cpu footprint

    - by nmizar
    I've searched the forums for an answer but I couldn't find quite the answer I was looking for [1] , so I thought I it could as well be of interest to more people around here. I carry out a big part of my job on the browser (or for the browser, if you want to put it that way). I tend to use Chrome, because it's got natively many of the newest features that I need (DevTools stuff, mainly but not only). BTW, I'm usually running the last available Chrome version/build on a desktop Vaio with 4GB RAM and dual core CPU and Ubuntu 12.04 as distro and Gnome as window manager. So, I was curious about a) why does Chrome spawn so many threads even opening only three of four tabs and b) is there any way to allocate more memory to Chrome to prevent its performance from degrading? Thanks in advance, Nacho PS [1] I found threads about Chrome freezing or running out of memory but not about the reasons for this being so or for avoiding it to happen. PPS Of course, I could always buy a newer and more capable machine and that is exactly what I'm trying to evaluate: is this a question of outdated hardware or the problem will keep appearing on any (decently but not hugely sized) machine?

    Read the article

  • execute script with sudo after login

    - by Kalamalka Kid
    i need to execute the following commands AFTER login. sudo hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945 sudo hdparm -y /dev/disk/by-uuid/7ABB49654B799D40 (trying to edit rc.local does not work nor does using hdparm.conf because as soon as I log in the disks start up again). I have tried numerous things like bash files and autossh entries in the startup applications with no luck because sudo is involved.

    Read the article

  • where does the discrepancy between \# in PS1 and n in !n come from?

    - by Cbhihe
    Something has been gnawing at me for a while now and I can't seem to find a relevant answer either in man pages or using your 'Don't be evil' search engine. My .bashrc has the following: shopt -s histappend HISTSIZE=100 HISTFILESIZE=0 # 200 previous value Putting HISTFILESIZE to 0 allows me to start with a clean history slate with each new term window. I find it practical in conjunction with using a prompt that contains \#, because when visualizing a previous command before recalling it with !n or !-p, one can just do: $ history | more to see its relevant "n" value In my case, usually the result of: $ \history | tail -1 | awk '{print $1}' # (I know this is an overkill, don't flame me) equals the expanded value of # in PS1 minus 1, which is how I like it to be at all times. But then, sometimes not. At times the expanded value of # sort of "runs away". It's incremented in such a a manner that it becomes than $(( $(\history | tail -1 | awk '{print $1}')+1 )) Any pointers, anyone?

    Read the article

  • How to prevent creation of monitors.xml?

    - by user222723
    I'm using Ubuntu on a tablet and have a problem with the screen rotation, which I can fix by removing ~/.config/monitors.xml, but sadly every time I rotate the screen a new monitors.xml is created. Is there any way to prevent this? I already tried to create an empty file with the same name as root but it was still overwritten after rotating the screen. Edit: I think I finally found the reason for the problem. Everytime the orientation is changed the new orientation is saved in monitors.xml while the original monitors.xml is saved as monitors.xml.backup. By playing around with chattr I found out that this causes Ubuntu to try to restore monitors.xml out of monitors.xml.backup after every login. So if I turn the screen to the left and then back to normal monitors.xml says "orientation=normal" and monitors.xml.backup says "orientation=left". After the login Ubuntu overwrites monitors.xml with the backup and uses its configuration and turns the screen to the left.

    Read the article

  • Save all music files in a VLC xspf playlist to another folder

    - by Parto
    I have a VLC playlist (.xspf) of over a 100 songs all scattered all over my computer. I'm looking for a way to save this playlist and all it's songs to another folder - flash drive, external drive or just a different location in my computer. How can I do this? EDIT The xspf playlist is in XML and is such a format: <?xml version="1.0" encoding="UTF-8"?> <playlist xmlns="http://xspf.org/ns/0/" xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/" version="1"> <title>Playlist</title> <trackList> <track> <location>file:///home/subroot/Music/3%20Days%20Grace%20-%20Wake%20Up.mp3</location> <title>Wake Up</title> <creator>3 Days Grace</creator> <album>Three Days Grace</album> <trackNum>10</trackNum> <annotation> </annotation> <duration>206036</duration> <extension application="http://www.videolan.org/vlc/playlist/0"> <vlc:id>0</vlc:id> </extension> </track> . . [Many more tracks here] . </trackList> <extension application="http://www.videolan.org/vlc/playlist/0"> <vlc:item tid="0"/> . . [Other id's here] . </extension> </playlist>

    Read the article

  • LibPCL issues on Ubuntu 13.10

    - by user254885
    i wanted to install the Point Cloud Library but it does not work i use an ODROID board(ARM processor) Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libpcl-all : Depends: libpcl-1.7-all but it is not going to be installed E: Unable to correct problems, you have held broken packages. by compiling v1.7 , i get these errors : /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libpthread.a(ptw-fcntl.o): In function `__fcntl_nocancel': /build/buildd/eglibc-2.17/nptl/../sysdeps/unix/sysv/linux/i386/fcntl.c:37: undefined reference to `__libc_do_syscall' /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libpthread.a(ptw-fcntl.o): In function `__libc_fcntl': /build/buildd/eglibc-2.17/nptl/../sysdeps/unix/sysv/linux/i386/fcntl.c:53: undefined reference to `__libc_do_syscall' /build/buildd/eglibc-2.17/nptl/../sysdeps/unix/sysv/linux/i386/fcntl.c:57: undefined reference to `__libc_do_syscall' /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libpthread.a(ptw-open64.o): In function `__libc_open64': /build/buildd/eglibc-2.17/nptl/../sysdeps/unix/sysv/linux/open64.c:41: undefined reference to `__libc_do_syscall' /build/buildd/eglibc-2.17/nptl/../sysdeps/unix/sysv/linux/open64.c:45: undefined reference to `__libc_do_syscall' /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/libpthread.a(cancellation.o):/build/buildd/eglibc-2.17/nptl/cancellation.c:96: more undefined references to `__libc_do_syscall' follow collect2: error: ld returned 1 exit status make[2]: *** [bin/pcl_convert_pcd_ascii_binary] Error 1 make[1]: *** [io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/all] Error 2 make: *** [all] Error 2 i could not find anything in google to solve these errors i believe some packages were not ported for ARM processors any help would be appreciated $ dpkg --list | grep headers ii linux-headers-3.0.63-odroidx2 20130215 ii linux-headers-3.0.71-odroidx2 20130415 ii linux-headers-3.0.74-odroidx2 20130417 ii linux-headers-3.0.75-odroidx2 20130426 ii linux-headers-3.1.10-6 3.1.10-6.10 ii linux-headers-3.1.10-6-ac100 3.1.10-6.10 ii linux-headers-ac100 3.1.10.6.2 installing packages did'nt do well sudo apt-get install linux-generic [sudo] password for odroid: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: debugedit libasound2-dev libestools2.1-dev librpmbuild3 librpmsign1 thunderbird-locale-en thunderbird-locale-en-gb thunderbird-locale-en-us thunderbird-locale-ko Use 'apt-get autoremove' to remove them. The following extra packages will be installed: linux-headers-3.11.0-17 linux-headers-3.11.0-17-generic linux-headers-generic linux-image-3.11.0-17-generic linux-image-generic Suggested packages: fdutils linux-doc-3.11.0 linux-source-3.11.0 linux-tools The following NEW packages will be installed: linux-generic linux-headers-3.11.0-17 linux-headers-3.11.0-17-generic linux-headers-generic linux-image-3.11.0-17-generic linux-image-generic 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. Need to get 58.2 MB of archives. After this operation, 203 MB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-image-3.11.0-17-generic armhf 3.11.0-17.31 [44.5 MB] Get:2 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-image-generic armhf 3.11.0.17.18 [2,356 B] Get:3 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-headers-3.11.0-17 all 3.11.0-17.31 [12.6 MB] Get:4 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-headers-3.11.0-17-generic armhf 3.11.0-17.31 [1,128 kB] Get:5 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-headers-generic armhf 3.11.0.17.18 [2,350 B] Get:6 http://ports.ubuntu.com/ubuntu-ports/ saucy-updates/main linux-generic armhf 3.11.0.17.18 [1,726 B] Fetched 58.2 MB in 13s (4,379 kB/s) Selecting previously unselected package linux-image-3.11.0-17-generic. (Reading database ... 258618 files and directories currently installed.) Unpacking linux-image-3.11.0-17-generic (from .../linux-image-3.11.0-17-generic_3.11.0-17.31_armhf.deb) ... Examining /etc/kernel/preinst.d/ Done. Selecting previously unselected package linux-image-generic. Unpacking linux-image-generic (from .../linux-image-generic_3.11.0.17.18_armhf.deb) ... Selecting previously unselected package linux-headers-3.11.0-17. Unpacking linux-headers-3.11.0-17 (from .../linux-headers-3.11.0-17_3.11.0-17.31_all.deb) ... Selecting previously unselected package linux-headers-3.11.0-17-generic. Unpacking linux-headers-3.11.0-17-generic (from .../linux-headers-3.11.0-17-generic_3.11.0-17.31_armhf.deb) ... Selecting previously unselected package linux-headers-generic. Unpacking linux-headers-generic (from .../linux-headers-generic_3.11.0.17.18_armhf.deb) ... Selecting previously unselected package linux-generic. Unpacking linux-generic (from .../linux-generic_3.11.0.17.18_armhf.deb) ... Setting up linux-image-3.11.0-17-generic (3.11.0-17.31) ... Running depmod. update-initramfs: deferring update (hook will be called later) cp: cannot stat ‘/boot/initrd.img-3.11.0-17-generic’: No such file or directory Failed to copy /boot/initrd.img-3.11.0-17-generic to /boot/initrd.img at /var/lib/dpkg/info/linux-image-3.11.0-17-generic.postinst line 730. dpkg: error processing linux-image-3.11.0-17-generic (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-3.11.0-17-generic; however: Package linux-image-3.11.0-17-generic is not configured yet. dpkg: error processing linux-image-generic (--configure): dependency problems - leaving unconfigured Setting up linux-headers-3.11.0-17 (3.11.0-17.31) ... No apport report written because MaxReports is reached already No apport report written because MaxReports is reached already Setting up linux-headers-3.11.0-17-generic (3.11.0-17.31) ... Examining /etc/kernel/header_postinst.d. Setting up linux-headers-generic (3.11.0.17.18) ... dpkg: dependency problems prevent configuration of linux-generic: linux-generic depends on linux-image-generic (= 3.11.0.17.18); however: Package linux-image-generic is not configured yet. dpkg: error processing linux-generic (--configure): dependency problems - leaving unconfigured No apport report written because MaxReports is reached already Errors were encountered while processing: linux-image-3.11.0-17-generic linux-image-generic linux-generic E: Sub-process /usr/bin/dpkg returned an error code (1) i had to uninstall these cos they were messing up other packages installation(buildessentials were already installed)

    Read the article

  • set default java version

    - by Dónal
    I have been using Java 6 on Ubuntu 11.10, but now I want to update to version 7. I've installed version 7 via PPA as described here. If I run sudo update-alternatives --config java I get the following output: There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-7-oracle/jre/bin/java 64 auto mode 1 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode * 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 64 manual mode Similarly, if I run: sudo update-alternatives --config javac I get the output: Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-7-oracle/bin/javac 64 auto mode 1 /usr/lib/jvm/java-6-sun/bin/javac 63 manual mode * 2 /usr/lib/jvm/java-7-oracle/bin/javac 64 manual mode So it looks like version 7 is already the default. But if I run either java -version or javac -version The output indicates that version 6 is still the default. How can I set the default to version 7?

    Read the article

< Previous Page | 7 8 9 10 11 12 13  | Next Page >