id stringlengths 5 27 | question stringlengths 19 69.9k | title stringlengths 1 150 | tags stringlengths 1 118 | accepted_answer stringlengths 4 29.9k ⌀ |
|---|---|---|---|---|
_cs.61038 | I am trying to classify the data in a database columns. DB has about 90 million entries.The main goal is to find different patterns in columns to leverage it for create look alike data. The data columns has entries which can easily look like patterns as : CUST1212,CUST1213,CUST1214..., number sequential after CUST COD... | Find string patterns preferably in regex for string streams | regular expressions;data mining;classification;pattern recognition | null |
_webmaster.15113 | I'm redesigning a website. For certain content areas the layout is fine at my text size but screws up if I set the text any bigger. I often resize pages with Firefox, but the whole page resizes so the layout still works. So, should I worry about users having larger text but the same CSS otherwise? I don't know how to t... | Do users resize text? | usability | it really depends on the target audience i'd say. if its a frontfacing website i think you should cover your bets and try and make it look good (or atleast usable) with increased text size, if its an internal website perhaps it doesnt matter so much..sorry for the vague awnser, but its really something the customer (in... |
_webapps.1318 | Is there a web service that can receive faxes and store them in a PDF format? I would like to be able to keep my current fax number. | Is there a web service that can receive faxes and store them in a PDF format? | webapp rec;storage;pdf;fax | The answer given to this question can help you here.efax.com offers a service to keep your existing number. You have to ring to discuss it. The number I see is a UK one - I'm guessing because the site detects your locale and offers a local service - so I won't post it here as it won't apply to everyone. |
_codereview.27144 | I'm having trouble structuring the logic of OAuth integration into my web app. In the app, a user creates a Report that consists of data from their Google Analytics account.User steps:User clicks 'New Report'Google presents the 'Allow Access' page for OAuth accessUser is presented with a list of their GA web properties... | Rails service + OAuth | ruby;ruby on rails;oauth | null |
_webmaster.58597 | I have read that Google Analytics supports click conversions (Tracking click conversions with Google Analytics).But I think I rather have conversions tracked within AdWords so I have a single source where I can monitor performance of specific campaigns.So, is there a way for me to setup click conversions within AdWords... | Use Google Adwords to track click conversions | google adwords;tracking;conversions | null |
_codereview.154933 | I solved this programming challenge:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where adjacent cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.For example, Given b... | Word Search in LeetCode | c++;performance;programming challenge;c++11 | null |
_unix.42357 | At work, I would like to use KDE's dolphin as a file manager. However, our home directories reside on an AFS share [1]. When starting dolphin, it becomes unresponsive for dozens of minutes. stracing it reveals that it tries to open all the nodes in our AFS tree:openat(AT_FDCWD, /afs/somewhereElse.tld, O_RDONLY|O_NONBLO... | How can I stop dolphin from reading my entire home directory tree in order to make it usable on AFS? | kde;afs;dolphin | While this doesn't completely solve the problem raised here, there is an option called -dynroot-sparse in the OpenAFS client these days, which tries to reduce the number of directories that are visible under /afs. That can help avoid processes from trying to traverse all AFS cells in the world just by reading the direc... |
_cstheory.20401 | Regex Equivalence is a hard problem which in general takes exponential space and exponential time. Are there any approximation/sub-optimal algorithms with some theoretical guarantees over equivalence available? | Sub optimal regex equivalence | approximation algorithms;automata theory;regular expressions | null |
_codereview.63995 | This is a sort of follow up to my previous question:Counting the number of character occurrencesThis time I have written code that still counts the number of different characters in a string, but with the added ability to find categories of characters. For example, finding how many numbers are in the string, how many p... | Counting occurrences of different categories of characters | c#;beginner;object oriented;design patterns | The good:Good naming, both in following conventions and in picking expressive namesYour approach is good procedurally- e.g. good use of the dictionary and in-build char methods.Putting the results in their own class and making it immutable through the use of private setters and the ReadOnlyDictionary is smart.In terms ... |
_softwareengineering.348367 | I'm fiddling around with OOP in building simple CRUD systems.I've decided to focus on using the Repository Pattern for separating Object business logic and Object data persistence (actually saving the object in a persistent data store, i.e a database).Saving a simple object is straightforwardclass Customer { setData(d... | Handling composite objects in the Repository Pattern | object oriented | This is clear example of Aggregate as seen in Domain Driven Design.In this case, the AuditTrail is part of Customer's aggregate. And according to DDD, repositories are per-aggregate, not per-entity. So in your case, there would be only CustomerRepository, which would write an audit every time Customer is updated. |
_unix.379087 | I have a linux mint Cinnamon desktop running in HiDPI.When I try to connect to it with a VNC client from my macbook (retina/hidpi display), the desktop shows up about 4x too big.I tried with mac's built in VNC viewer and also the real VNC client.I tried different settings in Real VNC's expert mode preferences - Scaling... | VNC to a linux desktop in HiDPI mode won't scale properly | linux;osx;vnc;display | null |
_codereview.164194 | I've made the following backwards transformation from a transformed source x,y point, to the resulting index of the actual image that I have, so I can avoid black spots appearing in my barrel eye lens image. I've used the formula focal_length * arctan(radius, focal_length) for image undistortion. Here is the code I've... | Backward transformation implementation for a barrel eye lens aberration in c++ 14 (using opencv) | c++;matrix;c++14 | It might make no difference to performance, but it may be a little better to use std::hypot() rather than create a temporary cv::Vec2d.You can avoid working with the angle theta, simply by using the ratio new_r/r to scale the distance from centre. Something like:const double r = std::hypot(x_affined, y_affined);const ... |
_softwareengineering.342592 | I read this in a book:Most of the time, calls to third-party products are entangled throughout the code. But if you really abstracted the idea of a database outto the point where it simply provides persistence as aservicethen you have the flexibility to change horses in midstream.Could you please explain to me in pla... | persistence as a service: what does that mean? | scalability | <Something> as a service usually means that an application programmer can forget about an aspect of component of the system they are programming entirely. For instance, platform as a service means that you pay a cloud provider money, and they provide you with a ready-to-use running machine with no questions asked - you... |
_scicomp.14470 | I was 7 years old when I learnt BASIC. Then I learnt C and Visual Basic till the age of 13. I stopped programming for 4 years continuously, and don't remember much about it now. I have lost the skill, and need to do learn it all over again.How can I learn basics and the terminology of programming all over again using ... | Beginning Computer Programming | c | null |
_unix.219258 | I'm trying to install monit on an Ubuntu 12.04 server. I have it set up, and configured (i think), but i'm not sure what user it's supposed to run as.My user on the server is called deploy, and my monitrc file looks like this:$ ls -l /etc/monit/monitrc-rwx------ 1 deploy deploy 10229 2015-07-30 12:38 /etc/monit/monitr... | User settings for monit? Should it run as root, or it's own user? | ubuntu;sudo;nginx;monit | Yes, monit either needs to run sudo, or to be running as the root user. Configuring monit as its own user with the correct permissions is also viable however it is probably the most involved of the potential solutions.Generally running sudo from scripts is not viable as it will prompt for a password. It is possible to ... |
_unix.255226 | I've spent a few hours trying to understand the differences between KVM and Xen without much succes. So both are Type 1 Hypervisors with comparable performances (source) and I don't understand what differenciates them.The only specific needs I have are that the guest OS isn't able to interract with the hosts's files (w... | Should I use KVM or Xen ? What are the main differences? | kvm;graphics;xen;gpu | KVM is normally supported already via libvirt and the kernels in modern distros without much hassle. You just need a CPU that has VT-d extensions (or AMD-V for AMD processors), and your BIOS has to have it enabled. After that, it's all about installing the necessary packages to get it going. XEN, yes, does support it. ... |
_codereview.74775 | I'm actually creating an AI for the online contest Vindinium. The fact is that's also an exam for my school because I'm going to have a note with that work.I created an AI based on ants pheromones with a recursive function. The bot is working but only on small maps. I need to send my answer turn after turn (which movem... | AI for an online contest | php;optimization;performance;recursion | null |
_unix.162900 | What is this folder: /run/user/1000 on my Fedora system and what does it do?~ $ df -hFilesystem Size Used Avail Use% Mounted ontmpfs 1.2G 20K 1.2G 1% /run/user/1000 | What is this folder /run/user/1000? | directory structure | /run/user/$uid is created by pam_systemd and used for storing files used by running processes for that user. These might be things such as your keyring daemon, pulseaudio, etc.Prior to systemd, these applications typically stored their files in /tmp. They couldn't use a location in /home/$user as home directories are o... |
_unix.105759 | In my previous question I have learned how to implement trash functionality in mutt. unset confirmappendfolder-hook . set trash==trashfolder-hook trash$ unset trashThat works well, except that I have to confirm every deletion. I would like it to work without the delete confirmation. So that I only need to press d and t... | mutt: trash macro | mutt | null |
_scicomp.27441 | I need to integrate the following function on the line segment from $P_{1} = \begin{bmatrix}-2\\-1\end{bmatrix}$ to$P_{2} = \begin{bmatrix}1\\2\end{bmatrix}$:$$\int_{P_{1}}^{P_{2}} 4x + y \ ds$$This question take part into the implementation of a 2D finite element solver. How I plan to do itSuppose that the following t... | Line integral along the edge of an isoparametrically mapped triangle | finite element;boundary conditions;quadrature | Interestingly enough, you are using quadrature rule for a master triangle in order to integrate over a segment. You should use quadrature rule for a master segment (e.g. $[-1, 1]$) instead. You should also provide proper transformations $\mathbf r_i : [-1, 1] \rightarrow \partial K_i$, $i = 1, 2, 3$ for each edge of a ... |
_unix.4325 | I have a folder that has a number of files all of a similar form as:Dropkick Murphys - 01 - Walk Away.mp3Dropkick Murphys - 02 - Workers Song.mp3And so forth...I want to convert them all so that they appear as:01 - Walk Away.mp302 - Workers Song.mp3How can I do this? | truncating file names | command line;bash | Under Ubuntu or Debian, it is simply:rename 's/Dropkick Murphys - //' *mp3 |
_webapps.102442 | I'm working on a demo for a business user to see if Google Forms can provide a quick solution to gathering some data. One of the requirements is a Combobox for one of the fields, where the user can either type into the text field or a dropdown will suggest options. I know there is a drop down option, but is there some... | Combobox in Google Forms | google forms | null |
_webapps.42771 | Four days ago emails sent to our Gmail accounts via our ISP's mail servies started being rejected due to not being RFC 2822 complainant.The following message to was undeliverable. The reason for the problem: 5.3.0 - Other mail system problem 550-'5.7.1 [2001:44b8:8060:ff02:300:1:6:6 11] Our system has detected that\n... | Emails sent to Gmail domain suddenly not RFC 2822 compliant, Possible to bypass with Google Apps? | gmail;google apps;spam prevention | null |
_webmaster.100031 | I'm stuck on the last stage(going live) of Firebase hosting. I have a Godaddy domain:As u can see i put down all the CNAME and A records.I'm adding my firebase.json in case it's conneted in some manner.So,what I'm doing wrong?How can I make it work?Notice that the site works..But i believe something is wrong, otherwise... | Firebase hosting not going live - stuck on Continue setup to direct traffic to your domain | web hosting;dns;godaddy;cname | null |
_codereview.169740 | I have the following code, and I'd like to refactor it to a more functional way:public void processPersons(List<Person> personList) { for (Person person : personList) { Integer addressId = createAddress(person); if (addressId != null) { updateDbStatus(addressId, person); } }}How do... | Updating persons in database with newly created addresses | java;functional programming | null |
_unix.351615 | Given a file wrong_name.txt, how can I add it to a zip archives archive.zip with an other name right_name.txt without modifying the file itself. | How to add a file to a zip with another filename? | rename;zip | One way to cheat, since zip adds referenced files and not the symlink itself (barring the -y option):ln -s wrong_name.txt right_name.txtzip myzip.zip right_name.txtrm right_name.txt wrong_name.txtunzip myzip.zip--> right_name.txt |
_unix.33529 | I was thinking it would be cool to be able to look things up in the man pages the same way one looks up words with the Dictionary app. Is there a way to add the man pages that OSX supplies into the Dictionary app so when you right click on a word (or in this case, a unix function/keyword/etc.), and click Look Up in Di... | Is there a way to integrate the unix man pages into OSX's Dictionary app? | osx | No. The Dictionary's support for Wikipedia is hard-coded; it's not pluggable. (There is a class internal to Dictionary.app called WikipediaDictionaryObj.) |
_unix.255423 | I want to change shell from ksh to bash and source the .kshrc file. I want to execute following lines of command sequentially:bash. ~/.kshrcclear Can anybody help me? | How to change shell from script | bash;scripting;ksh | null |
_unix.279974 | I have a Ruby 1.8.7 app which runs under Phusion Passenger and Nginx, for one of my clients, on an Ubuntu VPS. It's been ticking away happily for years, but yesterday ran out of log space (sending me an error via monit which i use to monitor it).I cleared out the bloated log file by doing the following:sudo cat /dev/n... | Sudden problem with a rack/passenger ruby app: Connection closed | nginx;ruby | null |
_unix.89089 | In my first question, I asked how to get the Date created field in NTFS-3G. Now, that I know I can get the Date created, I have started adding files onto my NTFS-3G partition and would like to set the Date created of each file to its Date modified value.Since this needs to be done on a whole repository of files, I woul... | How do I recursively set the date created attribute to the date modified attribute on NTFS-3G? | files;date;file copy;ntfs;ntfs 3g | null |
_webmaster.5474 | I see that most domain names that contain some nice words like: www.pixelmania.com , www.musicbox.com and so on... are registered but look just auto-populated with some random data. Why they do this ? Is it for me to pay extra to get that domain? Is it for advertising purposes (all of them have insane amounts of ads on... | What is the idea behind occupying domains? | domains | They're probably expired domains that were snapped up by companies that build huge networks of domains with the sole purpose of showing advertising. They make countless millions of dollars a year doing it. |
_reverseengineering.11811 | I am using IDA Pro to disassemble a C++ behemoth with 1600+ classes, many of them having pure virtual methods.Some classes also are made up of multiple base classes, in hierarchies 5+ levels deep.Ida PRO supports making structures of pointers, to handle vtables, but some of the final classes can have multiple different... | How to organize vtables in IDA Pro? | ida;c++;hexrays | null |
_webmaster.51011 | What are SEO risks and what are the best courses of action via Google, when an industry competitor duplicates 95% of your home page content and passes it as their own. Especially when your own website has ranked for years etc and held this unique copy for years. Further to this - what are the implications when another ... | Home Page plagiarism risks from a competitors | seo | null |
_scicomp.21768 | I was wondering if anyone could help with understanding the geometric conservation law for moving domains. I came across Link1, and have tried to understood the paper by Farhat et al Link2. So far my understanding is that the two things to consider are 1) the time step to which the cell areas using for integration of f... | a few questions on understanding geometric conservation law | finite element;fluid dynamics;finite volume;discretization | null |
_cs.20249 | Language:$ L = a^{n+m}b^{n}c^{m} $As per a recent test I gave, this language is not context free.However, I think it is.Corresponding Grammar:$ X \rightarrow aXY \space |\space \epsilon $$ Y \rightarrow b \space | \space c $Pushdown Automata:Keeping pushing all $a$ to the stack, until a $b$ is scanned. Keeping popping ... | Is $a^{n+m}b^{n}c^{m}$ context free? | formal languages;context free;formal grammars | the corresponding grammar you gave would accept aaaabcbc. A better grammar for this problem would be$X \rightarrow aXc$$X \rightarrow aYb$$X \rightarrow \lambda$$Y \rightarrow aYb$$Y \rightarrow \lambda$where $\lambda$ is empty string. |
_cs.60114 | I have several algorithms that map read-only input into write-only output utilizing only logarithmic space with pointer arithmetic. While the algorithms have a very small $O(\log^c{}n)$ critical path time complexity, fully parallelizing is too impractical with today's computers due to high degree polynomial growth in r... | Space-time tradeoffs for deterministic logarithmic space algorithms | time complexity;space complexity;program optimization | null |
_hardwarecs.4054 | I want to build a low power relatively cheep NAS that can hold at least two drives. I want to go the DIY route since I'm blind and would rather do everything from the command-line instead of relying on a third party GUI that may or may not be accessible. What would good hardware be for this? All the single board comput... | Low power computer with at least two SATA ports? | linux;nas | null |
_unix.175127 | I installed xmonbar and try to launch it.xmonbar &I got Stopped. I don't know what's wrong. Here is my .xmobarrcConfig { font = -misc-fixed-*-*-*-*-13-*-*-*-*-*-*-* , borderColor = black , border = TopB , allDesktops = True , overrideRedirect = True , persistent = False , hideOnStart = False , bgColor = b... | xmobar doesn't appear | xmonad | null |
_softwareengineering.315295 | Is an API always returning 200 OK, an issue? | Code structure of third party framework | c#;mvc;rest;api;solid | null |
_codereview.10611 | I have a method which loads data from a remote app (send TCP request and parse response). Now, I have a simple class for sending a TCP request:public class PremieraTcpClient { public PremieraTcpClient() { QueryItems = new NameValueCollection(); int port; int.TryParse(Co... | Loading data from a remote app | c#;asp.net mvc 3;tcp | I have some suggestions about PremieraTcpClient. The way it is written may lead to unreleased resources. If you have an error then you will remain with a stream and client opened.The correct way to do it is by using try...catch...finally or by using using.Below you can find the code using try catch finally private ... |
_webmaster.6485 | I'm currently looking to register the Taiwanese version of my company's domain. Dynadot, doesn't register domains with that extension. I found a few places on the web: Godaddy has them, and a fewer smaller, shadier places claim to have them, but they start at $39.99/year which seems a bit outrageous. Has anyone found a... | Where can I register .tw domain extensions? | domains;domain registration | null |
_unix.357926 | When I start Spacemacs I get a box created out of \u2502 sequences which I assume is the a box of particular character or colour not rendering properly. Below is the output from the locale command. What settings to I have to apply globally, or in my .bashrc etc to fix this?LANG=en_GBLANGUAGE=:en_GB.utf8LC_CTYPE=en_GBL... | How can I configure my locale correctly for Spacemacs? | locale | I don't know anything specific to spacemaps, but this looks like an encoding issue.Your character is a pretty good test already.$ echo -e \u2502 To set up UTF-8 encoding (which is great for ASCII data), make sure all your language variables have UTF-8 in them.It should be enough to do:export LC_ALL=en_GB.UTF-8export LA... |
_cs.33999 | I am having trouble getting my head wrapped around epsilon transitions while creating an LALR(1) parse table.Here's a grammar that recognizes any number of 'a' followed by a 'b'. 'S' is an artificial start state. '$' is an artificial 'EOS' token.0. S -> A $1. A -> B b2. B -> B a3. B -> epsilonItemsets:i0: S... | LALR(1) parsers and the epsilon transition | formal grammars;parsers | Your states and itemsets are not quite correct. The epsilon production must appear in relevant itemsets, and you have combined two states into one, which would produce a shift-reduce conflict if the epsilon production were added to the itemset (which should be done).The following was generated with bison (using the --r... |
_codereview.1099 | This is a simple linked list program which creates a list by appending an object at the tail. It compiles and runs perfectly.Is the coding style, logic etc are fine? How can I improve this program? Is there anything redundant or did I miss out some important things?#include<iostream>#include<string>using namespace std... | Linked List program | c++;linked list | null |
_codereview.70457 | Currently I try to create some unit tests for a project, which provides access to some webservice methods.It's interface is rather simple. I have a class WebService which offers methods like CreatePDF.Here's a little example:The Model:The model contains a number of properties, which each represent a URL parameter of th... | Prefer simplicity over testability? | c#;unit testing | The WebService interface with a CreatePDF method is good like that.The private GetQuery method is an implementation detail that should not be exposed.But there's something else you can do to test GetQuery.You can move that logic outside to a different class,whose main responsibility will be to build query strings.Then ... |
_cstheory.1574 | There is an increasing number of scientific articles which I look through and somehow I feel a lack of a tool to keep track of the already read ones and my summary notes on it. Or another usage scenario would be to search by an author and see which articles of the given author I have already read.The question is: Do yo... | Do you use any article organizers? | soft question | I used to store them in a SVN repository, and then I found out about Mendeley, quite satisfying so far except for a few bugs. Different features are available depending on whether or not you want to pay some fee, but the free version is enough for many people -- it seems it would be for you. |
_unix.178903 | I run the top command on my linux machine and I see that vim command take like 99.5% CPU PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 23320 gsachde 25 0 10720 3500 2860 R 99.5 0.2 30895:11 vi... | linux + top command | linux;command;cpu;process management | If you press c while in top then the command will be expanded to show the full command used to start the process.You can also take the PID and run: ps -ef | grep $PIDOr: cat /proc/$PID/cmdline |
_softwareengineering.122436 | We're writing a requirements document for our client and need to include the use cases of the system. We're following this template:IDDescriptionActorsPreconditionBasic StepsAlternate StepsExceptionsBusiness validations/RulesPostconditionsIn the Basic Steps section, should we include steps that the system performs in t... | Should back end processes be included in use cases in requirements document? | requirements | null |
_cs.71962 | In the proof of TQBF-complete, it says if the input size is i, then the TM for the input has at most 2^i numbers of configuration. Can someone explain why?The proof is from: http://zoo.cs.yale.edu/classes/cs468/fall12/TQBF-complete.pdf | Why are there only 2^i configurations? | turing machines | Let $s(n)$ be the space used by Turing machine, $\Sigma $ is a input alphabet, $$ is tape alphabet ( $ $ ) and $Q$ is a finite set of states. Then maximum number of different configuration bounded by $|Q| \times| |^{s(n)}\times s(n)$. You have $s(n)$ many places and in each place you have choices and then you can de... |
_codereview.71713 | I want to know if this is a good idea. It is definitely only a proof of concept at this point, but if it's a good idea I would pursue the development into a more mature product. There are three main parts of this concept (maybe they should be separate questions, but I am asking about the concept as a whole and whether... | Super simple way of generating dynamic interfaces in Python both CLI and Web GUI | python;console;user interface;bottle;cherrypy | Now I don't take answering my own question lightly, and perhaps someone isout there writing up the perfect answer right now, but I doubt it becausemy question my question is very broad and as I've discovered there is a lotof research to be done on the subject. I hope I can do the subject somejustice as there are a lot ... |
_codereview.71114 | I have written a function which takes the year in question and words as a data which is a dictionary that maps words to the list of year/count. Now I am wondering how I can improve the code that I have or how to make it more simpler or make it better performance-wise.def avgWordLen(year, words): totLen = 0 totwor... | Finding average word length in a given year | python;performance;python 3.x;hash table | totword and totLen are not so good names.And in any case PEP8 suggests to use snake_case for both variable and function names. So I recommend the following renames:total_word_length instead of totLenword_count instead of totwordaverage_word_length instead of avgWordLenWhen you iterate over keys in a dictionary and then... |
_unix.120679 | EDIT: I have since found that by using a folder in the root directory, things get a bit further - I can list the subfiles. So it really looks like permissions on the folder are the issue. I'm not sure what else to do besides chmod 777.I'm trying to configure an anonymous rsync daemon on CentOS 5.9.If I allow chroot t... | Configuring anonymous rsync daemon | rsync;daemon | Generally this would indicate some sort of permission problem. If you've already checked the permissions on /home/fuzz and /home/fuzz/builds, my next suspicion would be selinux. You can check if selinux is enabled with getenforce. To temporarily disable it to determine if that's the issue, run setenforce 0 |
_codereview.164045 | I have some data in data frame and would like to return a value based on specific conditions. It is highly time consuming.I tried three methods:Method 1:Without dataframe, this is the simple logic I have and it is super fast.@numba.vectorize(['float64(float64, float64)'])def Method1(a,b): x=0.0 y=0.0 z=0.0 ... | Select value based on condition on dataframe | python;performance;python 2.7;lambda;numba | There is some overhead to numpy, and even more overhead to pandas. You won't be able to attain the performance of Method1 using pandas.I'll comment on the methods one at a time:Method1There is no need to initialize x, y, and z.You don't deal with the case where a is negativeFor me, Method1 is twice as fast when I leave... |
_unix.90819 | I'm using CentOS 6.4 and I was following this tutorial in order to upgrade PHP from v 5.3.3 to v 5.4.19 but I got the following error:Error: php54w-common conflicts with php-common-5.3.3-23.el6_4.i686. How do I resolve this problem?[my_profile@localhost gplus-quickstart-php]$ sudo rpm -Uvh http://mirror.webtatic.com/yu... | PHP Upgrade Error (PHP 5.3.3 to PHP 5.4.19 on CentOS 6.4) | centos;php;upgrade | The tutorial you cited does recommend using this Webtatic repo on a fresh system, where you can avoid conflicts with installed packages, but suggests that you can upgrade a currently-installed php using (as root or with sudo):yum install yum-plugin-replaceyum replace php-common --replace-with=php54w-commonThen try sudo... |
_unix.25822 | Is there a security risk in running a web server like Unicorn as root?The Nginx master process runs as root, the Nginx worker runs as the limited www-data user, but I can't set another user like www-data to run the Unicorn master/workers without messing around with www-data's PATH. | Debian + Nginx/Unicorn permissions | security;nginx | Is there a security risk in running a web server like Unicorn as root?As Thomas said in sec.se chat, running anything as root carries an implicit security risk. The thing to understand about root is that the kernel essentially trusts all its actions without complaint.The issue occurs if there are any vulnerabilities in... |
_unix.339832 | We have machines with both local and LDAP accounts. Every computer has a HDD mounted where the local group users has reading and writing permissions. How can I add all the LDAP users to that group users? | How to assign LDAP user to local group users? | linux;ubuntu;ldap | null |
_codereview.116075 | I use this template to lookup clients registered for data. The data is associated by name(key) and clients are shared pointers (value) to a class which will consume the data.//////////////////////////////////////////////////////////////////////// Registrar Template to help manage Key to Value Registrations//// T1 - K... | C++ Template for one to many Registration (pre Gang of Four) | c++;design patterns;template | null |
_codereview.26449 | I am teaching myself Ruby and Ruby-on-rails, as part of this regimen I thought it would be a good idea to do some Ruby quiz exercises and so I started with the solitaire cipher. The basic functionality of decoding a properly formatted message is there but only just so. I've come to the realization that I've written t... | Is my solitaire cipher too imperative for an Object Oriented language like Ruby? | ruby | Some notes on your code:alphaHash = Hash.new, each, delete, +=, ...: This shows that you think in imperative terms (init, update, remove, insert, destroy, change, ...), in Ruby is more idiomatic a functional style (see this) with immutable data structures.or/and are used for flow control, for logic you should use &&/||... |
_unix.214392 | I have a strange issue on mikrotik rb951-2hnd router. I built image a few years ago using revision 39392 and patch firmwared it and everything worked fine. Just a few months ago I decided to update firmware. So I did it and discovered that physical network is completely broken. I have over 90% packet loss via ethernet ... | Huge packet loss on openwrt | networking;openwrt;tcpdump | Ok I finally found the reason. Initramfs wasn't the key of success. It turns out that routerboard works if it was booted with pressed reset button. But it seems like flashed driver can't last for long. Router reboots with kernel panic after a few hours of using depending on loading rate. |
_cs.13181 | I've developed the following backtrack algorithm, and I'm trying to find out it time complexity.A set of $K$ integers defines a set of modular distances between all pairs of them. In thisalgorithm, I considered the inverse problem of reconstructing all integer sets which realize a given distance multiset. i.e. :Inputs:... | Time complexity of a backtrack algorithm | algorithms;algorithm analysis;combinatorics;search algorithms;greedy algorithms | null |
_softwareengineering.133506 | I'm self-learning iOS development through the iTunes U CS193p course, and I often find myself stuck. I've been trying to get unstuck myself, but it might take me hours and hours to figure out what I'm doing wrong, be it missing a method or not really getting a whole concept like delegation. I'm worried that I might be ... | When stuck, how quickly should one resort to Stack Overflow? | productivity;education | When I am working with new developers, I encourage them to come ask questions after five or ten minutes where they are not making progress.That has two benefits: the first is that they can get help without too much time spent staring at a problem, but they only ask when they are not getting somewhere. If they are lear... |
_unix.268666 | In the below script the cases aserver and bserver work fine. But in case cserver above, after su - gsxuserp, I need to perform the following three options with the same user.cd ..cd random_directorytail -f file_in_random_directoryI am not able to do this using -c option, since the connection just closes without executi... | How to use cd command in su command? | shell script;command line;su;cd command | null |
_codereview.16426 | I have created a simple array-based Stack class with some methods like the actual Stack in Java.I am testing this for mistakes, but since I am learning Java, my tests may not be as comprehensive as they should.import java.util.*;public class SJUStack<E> { // Data Fields private E[] theData; private int topOfSt... | Simple array-based Stack class in Java | java;array;homework;stack | I don't see any obvious logic mistakes, points for that. On the other hand some redundant and non-standard ways of coding in java.Drop either size or topOfStack members, (topOfStack == size - 1)Drop capacity capacity is same as theData.lengthMethod name: isEmpty (more concise with java standard collections)Use data ins... |
_unix.244557 | The following is the text I want to parse with sed (Mac OS X 10.11.1 bash)100:25:43,959 --> 00:25:46,502Here you are, sir.Main level, please.I can delete the first line with sed -e 's/[0-9]//'.But with sed -e 's/^[0-9]//', the first line, i.e. 1 remains there.Since 1 is at the beginning of the first line, shouldn't it... | sed -e 's/^[0-9]//' does not work for the first line | text processing;sed;regular expression | Your file starts with a UTF-8 byte order mark. It is unicode symbol U+FEFF which is encoded as three bytes in UTF-8. Those three bytes show up as 357 273 277 when you print them in base 8.To the sed command those bytes at the start of the line means that 1 is in fact not the first character on that line. Many other too... |
_cs.62464 | Given a binary $n$-times-$n$ matrix $A$, we'd like to cover the regions comprised of $1$'s with non-intersecting rectangles. A collection of disjoint rectangles that covers all $1$'s (and only $1$'s, i.e., it mustn't cover any $0$'s) is called a cover. (Notice that a problem instance may have many different covers.)A c... | Counting the number of minimal covers of a binary matrix | algorithms;complexity theory | null |
_unix.151012 | I have:One Raspberry Pi with Raspbian (distribution based on Debian), with one enthernet interfaceOne laptop with windows, with one ethernet interfaceOne USB modemEthernet cable between Pi and laptopI want to:Share internet on Raspberry Pi when modem is connected to PiUse internet which is shared on laptop when modem i... | Two way internet sharing configuration (swiching modem from one machine to another) | networking | null |
_webapps.10375 | I have an Excel spreadsheet I made to track my own scores for an Xbox game I play (TrialsHD, if you are curious). I've made it available to other players so they can track their own scores, but it occurred to me that more people could use it if I figured out how to make it available to people online. I know I can impor... | How exactly does sharing work in Google Drive? | google spreadsheets;google drive | null |
_unix.216020 | Can someone please help me here. My cron job is not sending an email with output. While I run the shell script manually it generates an email with output.Here is the script looks like #!/bin/bashMAILLIST=<email>LogDirectory='/app/oracle/admin/monitor/'DBUSER='rman'DBUSERPASSWORD='rman01'DB='pdcatdb'SUBJECT=RMAN Backup ... | My cron job is not sending an email with any output, I see only a blank email | cron;email | null |
_unix.334428 | I have PHP 7.1 and apache 2.4 running in a docker vm. I have mod rewrite enabled. I have code that needs $_SERVER['SCRIPT_URL'] and $_SERVER['SCRIPT_URI']. These are not set. I created a minimal example that proves it. Do the following in bash:git clone https://github.com/zippy1981/php7-mod_rewrite.gitcd php7-mod_rewri... | $_SERVER['SCRIPT_URL'] and $_SERVER['SCRIPT_URI'] not appearing when mod_rewrite enabled | apache httpd;docker;mod rewrite;php7 | null |
_unix.20510 | I recently formatted an entire drive so I could install Linux on it. The partitions:15 GB, Primary, sda1, mount point: /232.9 GB Logical, sda5, mount point: /home3 GB Logical, sda6, swapHowever, upon install completion (with the GRUB bootloader) and reboot, the BIOS reports that it cannot find a bootable device.I am th... | Newly installed Debian install is not recognized | debian;boot | null |
_unix.270907 | I usually play SWTOR on Windows (10), but being able to play on linux would be so much better for too many reasons to list (and beyond the scope of this question). So I've set it up via playonlinux (using wine version 1.8-staging as recommended by a friend).Some of my keybinds have changed, however. On windows, I have ... | wine - Can I get SWTOR to use backslash and AltGr in keybinds? | keyboard shortcuts;wine;playonlinux | null |
_unix.119132 | My motherboard is a Gigabyte 990XA-UD3 (CPU 1), it's a UEFI -Dual boot, and when I try installing Linux Mint 16 Cinnamon or Ubuntu 13.10 it always bring this error(initramfs) Unable to find a medium containing a live file system.I put all my BIOS config in legacy options, disabled UEFI, but still the same error. Right ... | How can I install Linux on a UEFI system with Secure boot? | linux;security;boot;uefi;initramfs | null |
_webapps.82892 | I want to check if an email has been sent from my email account and then deleted from the sent folder.I had a draft with some personal information on it and it disappeared. I wasn't sure if I had deleted it (I couldn't find it in the Delete folder, or any other folder) or if someone secretly sent it.I'm using Hotmail b... | Can I check if an email has been secretly sent from my account? | outlook.com | null |
_codereview.800 | Is there a way to do this using parameters so the value is automatically converted to whatever datatype the keyfield has in the datatable?This code should be reusable for future bulk update applications hence the constant and the check on multiple datatypes.private const string DBKEYFIELDNAME = CustomerNr;... for (i... | Strongly-typed reading values from CSV DataTable | c#;csv | A few comments:This method does way too much. It is difficult to understand and will be difficult to debug and maintain. Break it down into smaller methods that each have a single responsibility.Use curly braces after your if and else statements. This improves readability of the code and makes it less likely for oth... |
_softwareengineering.283294 | There are two ways to do the same thing (pseudo code)Define databaseHandle in the parent function, and use it as a global in this scope: function API() { function openDatabase() { return databaseHandle; } databaseHandle = openDatabase() function getItem(i) { databaseHandle.get(i) } function addItem(nam... | Should all functions be fully self-contained (is it bad practice to share a variable between functions)? | design patterns;object oriented;programming practices;functional programming | I'd go with the second approach, with a change which releases the handle when done. If each method takes care of getting, operating and releasing its own handle, then your application should be better suited to scale up (assuming you have some sort of pooling underneath).With the first approach, it is hard to say what ... |
_unix.381236 | I use LightDM with awesome-wm.To lock screen I use command dm-tool lock. Most of the time it works fine but if after issuing the session lock command I switch to another tty and then go back, session unlocks by itself. /etc/lightdm/lightdm.conf is set to all defaults. How can I fix this behavior?Linux 4.9.0-3-amd64 #1 ... | LightDM screen lock in awesome-wm unlocks by itself | awesome;screen lock;lightdm | null |
_webapps.13708 | I have two email addresses that I use with GMail, let's call them personal@gmail.com and me@mycompany.com, the latter is integrated with SMTP and POP. When I want to send an email I can choose which email address I want to send from. Now let's say I receive an email to me@mycompany.com when I reply I want that reply to... | How can I get GMail to make the default address I'm sending an email from be the same as the To address in a reply? | gmail;email;email management | You can do that from Settings > Accounts and Imports and select Reply from the same address the message was sent to: |
_softwareengineering.158118 | I am a developer in PHP technology, I am aware of almost all the basics of OOPS, but still cannot find out the way to apply these concepts over a procedural programming.I do it in very orthodox way, but I don't know why I am coding it in that way. I never have reasoning to justify my OOPS applications, which has inferr... | I cannot understand the application of oops How can I develop the understanding of application of oops? | object oriented;programming practices;functional programming | Firstly, it's pretty difficult to summarise something as complicated as OO in a few sentences. I would recommend that you find yourself some good books on the topic, and read them, while practicing what they preach. That said, a short explanation would be: object orientation is simply one particular way to structure c... |
_codereview.121740 | I am writing a parser to parse out the fields of an email message in the following format (note that I expect that the To: field could contain multiple lines, same with the Subject: field.From: joebloggs@mail.netTo: jane@othermail.com, john@somemail.net, otherperson@hello.com, onemore@whatever.orgSubject: A subject ... | Email text parser | java;parsing;email | null |
_cs.24652 | I was given this function:$F(n)$ returns the smallest TM (measured in number of states) such that on input $\epsilon$, the TM makes at least $n$ steps before eventually halting ($n$ is a natural number). I was asked to prove that this function is uncomputable using a reduction from the Busy Beaver. I'm still new to red... | Proving a language is not decideable using a reduction from Busy Beaver? | formal languages;turing machines;reductions | Hint: Why is the busy beaver function difficult (rather, impossible) to compute? Consider the following algorithm: given $n$, run all $n$-state Turing machines, and whenever one of them halts, update your estimate on the maximum number of steps. Eventually you will have found $BB(n)$, but you wouldn't know, since some ... |
_unix.220438 | I installed cinnamon on Arch. Everything works fine, but a little annoyance I am having is that there are still org.gnome.dekstop settings present. I removed gnome-desktop, which was installed as a dependency by evince (also removed). Are these settings normally present under cinnamon or is there some way to get rid of... | GNOME Desktop Dconf Settings Are Present Even Though Using Cinnnamon | linux;arch linux;gnome;cinnamon;dconf | null |
_codereview.113823 | Currently I'm engaged with implementing a Drag and Drop GUI. I've discovered that there a not many resources (tutorials, etc.) available. So I wrote this:function Cursor(cssSelector, rightLimit, bottomLimit) { var element = document.querySelector('#square'); var styles = window.getComputedStyle(square); var x ... | Drag and drop GUI with native JavaScript | javascript;html;css | null |
_cstheory.4161 | Does it have anything to do with the heap data structure, for example the Buddy blocks implementation, or does it only take the literal English meaning of the word (a big pile)?I know heap memory is more practical than theoretical, but there's no Stack Exchange for Practical Computer Science yet. | Why is the free store memory called the heap? | ds.data structures;ho.history overview | I don't think it has anything to do with the data structure.It's just the opposite of the stack, which carefully orders its elements and doesn't allow them to be read or written except at the top. |
_unix.287626 | I have txt file whose inside there are 8 times ATOMIC_POSITIONS string and when I'm trying to write each one of them with ;AtomicPos=$(grep -n ATOMIC_POSITIONS hw1_out_si_wire.txt)echo $AtomicPost gives me just the last one 4779:ATOMIC_POSITIONS (bohr)4779 is the line number , where is the last one.In fact , after that... | Why doesn't grep give me the all found strings? | bash | In order to read grep output into an array you have to change AtomicPos=$(grep -n ATOMIC_POSITIONS hw1_out_si_wire.txt)to AtomicPos=( $(grep -n ATOMIC_POSITIONS hw1_out_si_wire.txt) )This way you will have all the matched patterns in AtomicPos then loop over the array and print each element. |
_cs.41523 | so I have this code:for (int i=1; i < n; i=i*5) for (j=i; j < n; j++) sum = i+j;And I'm wondering, what's the time complexity of this for loop?To start off, I know the first line is logn base 5, with an additional check to exit out of the for loop.Then, for the second line, I have the following:i = 1 j =... | Algorithm analysis of nested loop | algorithms;time complexity;runtime analysis;loops | null |
_unix.16620 | Which directories should I expect to have in an install prefix when I'm writing makefiles? I've noticed that in the common prefix /usr, there is no /etc, yet there is an /include dir, which isn't in the root directory. Which paths are hard-coded such as /etc and /var maybe and which directories lie in a prefix? As far ... | What do I install into a given install prefix | filesystems;software installation;directory structure;make;gnu make | See the FHS (Filesystem Heirarchy Standard) for details: http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard and http://www.pathname.com/fhs/ |
_cs.22030 | Can anyone explain me what is a trampolined interpreter? I am versed with relevant concepts viz. procedural languages, continuations etc but am finding difficulty understanding the definition/need for trampolining. Please help. | What is a trampolined interpreter? | programming languages;interpreters | null |
_webapps.74457 | Is it possible in Google spreadsheets to have one list which is somehow divided into 2 parts and both of those parts consist of different lists? Something like iframes in HTML. | Is there any option to operate with 2 lists in one list in Google Sheets? | google spreadsheets | null |
_codereview.36743 | I'm creating a simple syslog server in Delphi XE2 using Indy's TIdSyslogServer. I've decided to make it dump into a TClientDataSet and display in a TDBGrid, but I'm skeptical about how well it would handle if the log got quite big, and what I should expect when it grows to millions of records. This application is for i... | Is it feasible to create a syslog server which writes to a client dataset? | performance;logging;delphi;server | null |
_softwareengineering.195040 | I saw a video about random numbers and how the programmer in that video was talking about computers generating pseudo random numbers and that they are not really random. I knew about this.Then he showed the decay of a radioactive material to generate random numbers where he claimed to be truly random. Is there really s... | Is there such a thing as truly random? | computer science;math;random | null |
_unix.295207 | So at my job I SSH from my CentOS machine to other local CentOS machines. We use an application that runs in both X11 and terminal. Some features are available exclusively in terminal and other features are exclusively in X11. The program auto detects if there is a X display to connect to and will use it if available. ... | Enable/Disable X on an established SSH connection | ssh;x11 | If you run with -X or -Y then this will set $DISPLAY on the remote end to point to the X-tunnel. Unsetting $DISPLAY will prevent X applications from talking to the X server.e.g.$ echo $DISPLAY localhost:10.0$ xdpyinfo | head -2name of display: localhost:10.0version number: 11.0$ DISPLAY= xdpyinfo | head -2xdpyin... |
_unix.289326 | I have a personall machine running Ubuntu 14.04.4 LTS. I use it to host a Teamspeak and a Minecraft server and also a website.I am trying to make sub-domains to only point to the right services. So for exampleusing panel.domain.com would point only to https://localhost:8000 (CP Panel)Managed to get the CP Panel sorted ... | How would I limit connections to certain services, to be only accesed via a connection coming from a sub-domains? | networking;firewall;apache httpd | null |
_codereview.27813 | Could it be written better?package mainimport ( code.google.com/p/go-tour/wc fmt)func WordCount(s string) map[string]int { dict := make(map[string]int) splited := Split(s) for _, string := range splited { _, present := dict[string] if present { dict[string]++ } else { ... | Split and word count in go | strings;go | null |
_webmaster.34252 | I have a question about redirecting a subdomain of a blog hosted on wordpress.com to an external URL.Given the following:1) I own a domain name foobar.com purchased from another registrar (not from wordpress.com).2) I have purchased the custom domain option on wordpress.com, and have completed the configuration to make... | Redirecting a subdomain from wordpress.com to an external web address | wordpress;redirects;url;subdomain | null |
_webmaster.74288 | I have been getting crawl errors on Google Adsense on a number of pages, all ending in a peculiar suffix mozekcdn-a.akamaihd.net. For examplehttp://my-website.com/mozekcdn-a.akamaihd.nethttp://my-website.com/mozekcdn-a.akamaihd.net/gsd.htmlNow the strange thing is that such pages do not exist at all on my website. And ... | Website pages being generated with mozekcdn-a.akamaihd.net; adware / malware? | google;malware | This does not look like a problem for you to solve. It appears that you do not have malware, adware, or a virus on your system. You may not like these entries in your log of course. You can likely filter them in what ever software you use to analyze your web traffic.This appears to be coming from your users as they acc... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 12