id
stringlengths
5
27
question
stringlengths
19
69.9k
title
stringlengths
1
150
tags
stringlengths
1
118
accepted_answer
stringlengths
4
29.9k
_codereview.20418
I've just created a teeny little script to count the seconds until I get auto-logged off. I already solved my issue with my ssh client settings, but I'd still like any help making the bash script nicer to read, or just tips in general.#!/bin/bashcount=0while ( [ : ] )do count=$(($count+1)) n=${n:-0} for i in `seq 0...
Counting seconds until auto-log-off
bash
count=0while true; do printf \r%d $((++count)) sleep 1doneYour while condition is doing a lot of work just to return true: you launch a subshell, and evaluate a test giving a 1-character string (which will always return true). Make it simpler and more readable by just executing the true program.Note that variable na...
_unix.182743
I've edited /etc/passwd by running usermod -s to change my shell. (chsh doesn't work, because it prompts for a password; we SSH in using keys.)When I disconnect, and reconnect, the change doesn't take effect. I've restarted sshd too, and still nothing.
Why do changes to /etc/passwd not take effect?
ssh;login
I use ControlMaster, and I wasn't actually disconnecting.ControlMaster is an SSH configuration option that keeps connections open for a certain time, and can multiplex SSH sessions over the same connection (which avoids key exchanges, which are slow). However, if you ^D from a shell, and then re-run ssh, you've not kil...
_webmaster.43705
I have a web site in two different languages (English and Spanish). It is indexed by Google but, when searched, sitelinks below my result appear mixed with Spanish and English subtitles.Each language is in a different folder (mydomain.com/en for pages in English and mydomain.com/es for pages in Spanish).Is there a way...
How can I prevent Google from mixing different languages in my sitelinks?
seo;google;search engines;sitelinks
I have a site localized into over forty languages and have no problem with my site links.You don't state what url structure your two sites are in. Google recommends that your internationalized sites be on separate top level domains (example.com vs example.es), different sub-domains (www.example.com vs es.example.com)...
_unix.280897
I want to extract the process having highest utilization on each processor coreand then output its information (PID etc.) to a file. How can I do it by using either top or ps command?Thanks.
Process Scheduling Information Extraction
ps;top
How aboutps -k -pcpu -O pcpu,psr The k flag is your sort key which is percent CPU. Capital O changes the output to add the percent CPU utilisation and the current processor/cpu the process ran on. You get output like: PID %CPU PSR S TTY TIME COMMAND15049 5.8 2 S tty2 00:00:28 chrome14808 4.3 1 S tty...
_unix.345507
I have an java application that runs on windows and needs to be moved to linux. The executable for windows takes a config file as input which does a bunch of things like logging settings, classpaths, settings java path and other dependencies. In the config file, logging properties are set in this way: wrapper.logfile.f...
Log file and properties for shell script
shell script;logs
null
_codereview.111456
I've written a JavaScript dictionary sorting algorithm, which takes a .txt file (the dictionary), and loads it via node's file system. The purpose of this algorithm is to sort every word into its corresponding array based on its letter pattern. For example, the word little would have the letter pattern of ABCCDE, and h...
Sorting dictionary according to letter patterns
javascript;node.js;cryptography
This can be improved and shortened by naming the concepts you are using:A function called encodeWord that takes a single word and returns its encoded valueA function called groupedByCodes which takes an array of words, and returns the object you are seeking: codes as keys, and arrays of words that get encoded to those ...
_unix.128852
My home partition on a Debian wheezy install is an encrypted LVM volume. It is ext3. Earlier today, I had a weird message in a terminal window about an attempt to write to a file in my /home tree failing due to having a read only file system. I rebooted and ended up with an error message saying /dev/sda1 is reported as...
encrypted ext3 damaged; how to proceed?
encryption;data recovery;fsck
null
_webapps.87199
I'm creating a form where organizations can report on a number of different training positions which they provide. These training positions are called 'posts'. On the first page of the form, users enter basic information about their posts, e.g. the 'post number'. I've set this up as a repeating section, as one organi...
Cognito Forms: dynamically displaying content entered into a repeating section on a subsequent page
cognito forms
null
_unix.370421
I have enabled two serial ports in VirtualBox, and then typed the lspci command in Ubuntu, and this is the result:The serial ports are not listed, is it because the serial ports are not part of the PCI bus?
Why the lspci command does not list the serial ports?
linux;serial port;x86;pci
is it because the serial ports are not part of the PCI bus?Yes. Traditional PC serial ports on x86 hardware interface with applications via old-style ISA I/O ports and interrupts. Keep in mind that RS-232 data rates are down in the kHz range in the vast majority of cases. PCI holds no advantage for RS-232.Add-on PCI se...
_webmaster.101400
we're currently rebuilding a client's application and are wondering if there are any benefits of serving specific pages to crawlers?I.E. Semantic html, no stylesheets, additional meta tags?Would love to know what you think
SEO benefits of serving simplified pages to crawlers
seo;html;googlebot
null
_unix.349471
We are using linux logrotate for rotating our log files,Example :/location/tomcat/logs/* /location/jboss/log/* { copytruncate daily rotate 10 compress size 20M olddir rotated create 0644 test test}As per the copy truncate definition given in LINUX,copytruncate Truncate the ...
Logrotate in linux to handle log data loss
logs;logrotate
null
_cs.49111
Since we started talking about relations on languages and so on i keep on struggling with this subject. So now iam faced with two questions where i really dont know how to start. First of all, the natural relation of a language $L \subseteq \Sigma^*$ is the equivalence relation on $\Sigma^*$ with the equivalence classe...
Union of right congruence relations
formal languages
I'll walk you through the first question. You can ask the second question separately (see D.W.'s answer).When faced with a proof or refute question like this, we need to try both directions. First, we can try proving the claim. If we seem to get stuck, we can look for a counterexample.Let's try proving the claim. We ar...
_unix.353784
Probably a stupid question but I want to be sure on this. On an SSH connection, can you do everything that you can do on a console connection?In other words, after launching a system and installing and configuring an SSH server on it, can you do all your further interaction with this system via SSH, and not use the con...
Is there anything that can be done via a console login, but not via an SSH login?
ssh;console
Yes.Here are just some of the things.superuser logonOn systems like FreeBSD and OpenBSD, the init program only permits logging on as user #0, in single user mode, on terminals marked as secure in the /etc/ttys file. And the login program (directly on OpenBSD, through a PAM module in FreeBSD) enforces the secure flag i...
_codereview.62059
BackgroundI'm using Lua with luaglut to do some OpenGL stuff. The luaglut API is almost identical to the gl/glut C APIs. Sometimes, gl functions want a pointer to some data, for example:glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, oh_crap_a_pointer)In these cases, the luaglut ...
Tiny Lua library to get char pointer from string
c;memory management;lua;opengl
null
_webmaster.12129
I've been optimizing my website for search engines, and for some reason I have a crawl error on a page that has not been found at 'www.peach-designs.com/a' which is not a page, is not a link, or is not anything on my site. I've checked my code and I'm only left to assume that this is a link to a page (a href, etc.).Is...
SEO - Crawl Errors
google;seo;web crawlers
null
_unix.51944
Imagine something like this: $ curlsh http://www.example.org> GET /foo/bar/bam...output here...> POST /thing/pool ...... result here.... is there a tool that lets me do that?
Is there a way to use curl interactively? Or is there an interactive curl/wget shell?
wget;curl
Thanks for the answers.After googling around, I found resty, which is a shell script wrapper around the curl tool. This is really what I want. It's 155 lines of shell script, and when I run it, I get functions for GET, PUT, POST, DELETE, and OPTIONS. These functions are just wrappers around the curl program found on ...
_unix.117040
My input file has positions in first column with different number of spaces (or no space)16504 16516 1650811 16520 1651 16524 16516111 16528 165204 16532 I need to get an output file where fist column has no spaces at all, while keeping second column as it is. 16504 16516...
removing spaces from first column
text processing;sed;awk;columns
null
_unix.364096
I have a problem with PulseAudio on my Buildroot based Raspberry Pi. It's playing audio 2% slower than normal. Indeed, after measurement, I get 100 BPM on the Raspberry when I have 102 on my computer, and it scales with the BPM. I always have RPi's BPM = 98% normal BPM .It also works with frequencies, that are 2% small...
Pulse Audio plays 2% slower
audio;raspberry pi;pulseaudio
null
_unix.219564
I downloaded debian-live-8.1.0-i386-standard.isofrom http://cdimage.debian.org/debian-cd/8.1.0-live/i386/iso-hybrid/and booted a system from it , logged in with user and password as live. NOW, When i got bash prompt, now what to type so that the debian standard installation starts to install on my hard disk?background ...
install debian from hybrid standard CD
debian
null
_unix.293327
It's fairly straightforward to determine from within a script that the code being run is not running in an interactive shell, but you already know that as you write the script, so I'm not sure how it's useful except within a function (or if you source the script).Within a script, how do you determine if the script is b...
How to determine if script is called by interactive shell or another script?
shell script;interactive
null
_webapps.20113
We're using Trello to track our hiring process. It would be nice to use the vote feature to quickly gauge opinions without having to read comments. However, there doesn't seem to be a way to clear votes besides having each member unvote. So, votes currently must represent the card over the whole board. It seems rea...
Is there a way I can clear votes in Trello?
trello
null
_softwareengineering.233498
Requirements:My application is latency sensitive. Millisecond level responsiveness matters. Not all the time, but when it acts, it needs to be fast.My application needs to log information about what it's done in those times.The actual writing of the logs does not need to be that fast, just the actions.However, the log ...
Logging in a latency sensitive system
java;design;logging
You have made your design overly complex by creating specific logger signatures for the various latency sensitive parts.A better design would have been to use the Logger interface from logback for all parts of the application. If performance measurements have shown that the logging causes a bottleneck for some low-late...
_datascience.20264
The KDD 1999 dataset had 41 features and the UNB ISCX Intrusion Detection Evaluation DataSet (iscx.ca/dataset)had 49. For an intrusion detection problem, I want to extract these features from a given/generated pcapng file. Is there any feature extraction tool available for this? [All the information may not be present ...
Feature extraction from given pcapng file
feature extraction
null
_opensource.140
How can I keep people involved and motivated to work on a project that doesn't involve direct monetary benefit?What specific strategies do open source projects tend to use to keep core developers involved?Partly this is a general what strategies reliably motivate most open-source developers, but it's also about how can...
How can I keep a project from losing momentum?
project management;human resources
null
_softwareengineering.190876
In class I am learning about value iteration and markov decision problems, we are doing through the UC Berkley pac-man project, so I am trying to write the value iterator for it and as I understand it, value iteration is that for each iteration you are visiting every state, and then tracking to a terminal state to get ...
I don't understand value iteration
python;artificial intelligence
null
_codereview.7725
I am writing a few python functions to parse through an xml schema for reuse later to check and create xml docs in this same pattern. Below are two functions I wrote to parse out data from simpleContent and simpleType objects. After writing this, it looked pretty messy to me and I'm sure there is a much better (more py...
Python xml schema parsing for simpleContent and simpleTypes
python;parsing;xml
Do more with literals:def get_simple_type(element): return { element.get(name): { restriction: element.getchildren()[0].attrib, elements: [ e.get(value) for e in element.getchildren()[0].getchildren() ] } }def get_simple_content(element): return { simpleContent: { ...
_softwareengineering.308749
I am developing an e-commerce product and I have been able to implement all functionality and am left with allowing users to create additional attributes for a product. Right Now I have two options.EAVEAV is largely frowned upon but seems to work for Magento. But after researching all the headaches it causes I am a bit...
Using MySql 5.7 JSON columns for EAV
performance;sql;mysql
null
_codereview.18415
Here's some code that removes the specified character, ch, from the string passed in. Is there a better way to do this? Specifically, one that's more efficient and/or portable?//returns string without any 'ch' characters in it, if any.#include <string>using namespace std;string strip(string str, const char ch){ ...
Stripping specified character
c++
I'm not entirely sure how the performance will compare, but the standard way to accomplish this would be the erase-remove idiom:str.erase(std::remove(str.begin(). str.end(), ch), str.end());Unless the performance proves to be a bottleneck, it's typically better to stick with the C++ style of doing things. I can't imag...
_codereview.167176
I have wrote code for a stopwatch that utilizes the abstract design pattern and would like to get some feedback on the code, so be as harsh as you can.Note: I used ctime instead of chrono because this is not meant for benchmarking. The code will later be used in a console game, and the format of the std::tm struct is e...
Stopwatch that uses the abstract factory design pattern
c++;object oriented;design patterns;datetime;polymorphism
Okay, after I worked my way through the original code, a few things have become clearer. Since I have never done programming with ncurses I was eager to try my hand at a better design.Here it comes. It's a sketch only in the sense that I didn't create separate translation units. That is basically a tedious exercise and...
_webmaster.108096
We have a Wordpress HTTP site which we wish to convert to HTTPS or SSL. Do we have to find all mentions of hard coded HTTP resources or can we simply do a 301 redirect in .htaccess, and how do we do that?We are a not for profit website and I have limited knowledge of Wordpress and webmastering (although I am a power us...
When converting a WordPress site from HTTP to HTTPS, do all hard-coded HTTP references need to be updated?
redirects;wordpress;https;http;conversions
null
_softwareengineering.254016
When facing new programming jargon words, I first try to reason about them from an semantic and etymological standpoint when possible (that is, when they aren't obscure acronyms). For instance, you can get the beginning of a hint of what things like Polymorphism or even Monad are about with the help of a little Greek/L...
How can I make sense of the word Functor from a semantic standpoint?
functional programming;math;theory;semantics
In category theory Functors describe relationships between categories by describing some, or all, mappings from one category to another. There are so many philosophical ideas wrapped up in this (all beautiful) it's difficult to say much that relates this to programming or other real world things that doesn't rob it of ...
_unix.287643
I'm trying to compile GCC 4.8.3. I have read the documentation carefully but I'm still unable to cross compile it for 64bit system. I have also gone through this guide. But my requirement is to build GCC in /tmp/xxx directory. But the --with-sysroot & --with-native-system-header-dir flags are messing up the compilation...
GCC 4.8 compilation error: cannot find the system header directory
compiling;gcc;cross compilation
null
_softwareengineering.267053
I am working on a large C++ project. It consists in a server that exposes a REST API, providing a simple and user-friendly interface for a very broad system comprising many other servers. The codebase is quite large and complex, and evolved through time without a proper design upfront. My task is to implement new featu...
Correctly disposing objects upon server termination
c++;debugging;memory
null
_unix.264021
I was trying to dockerize (into Debian 8.2) an OpenVPN server (yes, I do know, there already are such containers) but something went wrong inside the container and the server failed to start.I decided to inspect logs but /var/log/syslog (OpenVPN logs here on my host machine) was missing inside the container.I thought t...
How to configure logging inside a Docker container?
debian;syslog;docker;rsyslog;containers
null
_webapps.20869
So after gratuitous theme installations and customizations my tumblr site just isn't looking how I want it to. I've decided to just do the theme myself, but now I have one on there with all this extra stuff.How can I go back to default layout so I have a clean slate to work on?
Go Back to Default Tumblr Layout
tumblr;tumblr themes
Go to http://www.tumblr.com/customize (you can get there by clicking the cog wheel in the backend and then Customize your blog). Click Themes in the upper left, then search and click on Optica, which is the default theme. Click on Use to take the theme.
_unix.190999
You already know my question.I don't have su authority.So I want to know su password.I really(x100) don't know how to find it.I tried change direction(/etc/pam.d/su) and tried to delete auth sufficient pam_wheel.so trust.But I could not do it,Because I don't have su authority.:-(so...Could you do me a favor?
How to know su password
security;root
null
_unix.136335
I had two CentOS 6.5 servers that I was running using the Plesk control panel. I have moved and decided not to use them no more but just buy my hosting. My new ISP blocks port 80 and the cost is insane to get it unblocked from them. I took out the server HDD and trying to use a Fedora 12 Live CD to just get the website...
Trying To Get Data From Server HDD
fedora;permissions;data recovery
null
_cs.60987
In the past I have thought a bit about how to register a NIR-image and a thermal image and noticed that this is not trivial - one statement was that if I had the depth information for each pixel, the task would be much easier.Now consider having a 3D-NIR camera (e.g. asus xtion) and a thermal camera and I want to map t...
Registering 3D-NIR image to thermal image and vice versa
computer vision
null
_datascience.11695
My problem has three categorical variables C1,C2, C3 and one continous variable X, predicting a continuous outcome Y. I can visualize the problem with the following reproducible code (apology for the badly written code):library(data.tree)i = expand.grid(c(A,B),c(C,D),c(E,F))i = i[order(i[,1],i[,2],i[,3]),]i[,4] = c(1:8...
Binning of Continous Predictor and Predicted Variables
r;data mining;decision trees
null
_unix.248265
Related to my question about awk being ignored by cron, are there any alternatives to awk? This is the line in question:for dirlist in `ls -l $WEBFOLDER | awk '$1 ~ /d/ {print $10 }' `I don't know awk so I don't understand the $1 ~ /d/ part, but I think what it does is that it prints the 10th column out of the ls -l re...
Alternative to script command getting directory names (using ls & awk)
shell script
Just a simple for loop:for dir in $WEBFOLDER/*/; do basename $dirdoneIf you also want directories starting with a dot:for dir in $WEBFOLDER/.*/ $WEBFOLDER/*/; do basename $dirdone
_softwareengineering.116541
Here's an interesting discussion of Tennent's Correspondence Principle, and a brief description from Neal Gafter:The principle dictates that an expression or statement, when wrapped in a closure and then immediately invoked, ought to have the same meaning as it did before being wrapped in a closure. Any change in seman...
Does Groovy follow Tennent's Correspondence Principle?
language design;groovy;closures
null
_unix.137492
I'm trying to get a C application to load shared objects from a relative directory regardless of where I call it from. So far it only works if I'm in the same directory as the executable when I call it:~/prog$ ./my_programSuccess~/prog$ cd ..~$ ./prog/my_program./prog/my_program: error while loading shared libraries: l...
Load shared objects relative to executable path
compiling;dynamic linking
null
_unix.328882
I have an array containing some element ,but i want to push new items to beginning of array .How to achieve it ?
how to add new value to beginning of array in bash?
bash;shell script;array
null
_codereview.15539
/*Create a random maze*/package mainimport ( fmt math/rand time)const ( mazewidth = 15 mazeheight = 15)type room struct { x, y int}func (r room) String() string { return fmt.Sprintf((%d,%d), r.x, r.y)}func (r room) id() int { return (r.y * mazewidth) + r.x}// whetwher walls are open or not./...
Creating random maze in Go
random;go
null
_codereview.75799
This is my code, for calculating a GPA for 7 subjects. It works, but is there a better way? Any hints on making it more flexible?from __future__ import divisionimport stringprint This program will calculate a Semester GPA for a given set of courses. Enter 0 in all inputs, if you want to skip extra courses.\ncname1 = ra...
Getting a 4.0 GPA
python;python 2.7
null
_webapps.44567
I currently have a free Google Apps for your Domain account, with only one email address in there. I will soon be moving from Google Mail to another hosted email solution (such as a hosted Exchange server).As a result of this, I want to remove the Google Apps part from my domain, but retain all of the other services I ...
How to Migrate Google Apps account to regular Google Account
google apps;google analytics;google account
Unfortunately, I could not find a way to do this. It would seem such a feature has not been built by Google.I ended up moving my mail account, linking my Analytics profiles to a separate GMail address, and then destroying my Google Apps domain. Not a great solution, but thankfully it worked as it turns out I didn't use...
_datascience.16485
I'm trying to build recommender based on user history from e-commerce. There are two(potentially more) types of events: purchase and view.Is it okay to sum up number of purchases and views for a given item(with purchase and view having different weights)? Or I`ll just mix up user intent this way?
Recommender System: how to treat different events
recommender system
I assume you're using an implicit feedback recommender approach like ALS. Otherwise, summing data points generally won't make sense, such as if you're feeding it to a recommender that expects ratings.The input to implicit ALS is, conceptually, weighted user-item pairs. Therefore it makes sense to perhaps use a sum of u...
_unix.154229
I have 2 computers, both with Gigabit controllers, connected with a regular Ethernet cable. I have a host machine, which is connected to the internet, and a client machine, which is only connected to the host machine. I would like to share the host's internet connection with the client machine. I have read online, and ...
How to share internet connection over Ethernet using Network Manager?
networkmanager;internet
null
_softwareengineering.342772
List specific programming concepts that should code adhere to that it will run in parallel. For example, if a block of code does not change shared state, it should be able to be done on another thread. What other such attributes exist? I would imagine there only to be a small number of such concerns by which to evaluat...
What specific attributes make code able to be executed in parallel?
parallel programming
null
_codereview.18862
I have a lot of variables that I need to check for exceptions and output the empty field in case of a null returned value (I am reading a calender list from Sharepoint and my program is supposed to send email notifications if some of the conditions are met).I surrounded my variables with a try-catch with a generic outp...
Handling null exception when having multiple variables
c#;object oriented;exception
Refactor into a method:var name = this.GetVariable(Name); var dueDate= this.GetVariable(Due Date);..//more variables. var Title= this.GetVariable(Title); private string GetVariable(string name){ try { return item[name].ToString(); } catch (Exception ex) { ...
_cs.67429
For example for the sw command in MIPs, the control signal values areALUOp1: 0ALUOp: 0 RegWrite: 0 MemRead: x MemWrite: 1 Branch: 0 ALUsrc: 1 RegDest: x MemToReg: xWhy do memRead, RegDest and MemToReg have the values of x? Why not just 0?
For data-path cycles in MIPS, what determines wheter a control signal gets the don't-care value?
cpu pipelines
null
_unix.331059
I have one bash script for installing wordpress and want to add also mysql installer to easly can install database#!/bin/bashdr=$1db=$2zDir=latest.zipwpInstall=https://wordpress.org/$zDireval mkdir -p $dr && cd $dr && wget $wpInstall && unzip $zDir && cp -r $dr/wordpress/* $dr && sudo chmod -R 0777 $dr && sudo chmod -R...
How to create new MySQL database with encoding via BASH script
shell script;mysql
null
_unix.204501
An excerpt from the man man page:The default action is to search in all of the available sections following a pre-defined order (1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7 by default)What are the n, l and 3pm sections of the manual for?
What are the 'n', 'l', '3pm' sections of the manual for?
perl;man;posix;standard
The 3pm section is not used anymore. It is defined as manual pages concerning modul packages of perl in an old version of the Debian Perl Policy, noteably in version 1.2. Here is a site where you can read that old deprecated policy (see 3.1 and 1.4). In the latest Debian Perl Policy it is defined in 2.4 that module man...
_softwareengineering.194859
What's the most secure method of performing authentication in a single paged apps? I'm not talking about any specific client-side or server-side frameworks, but just general guidelines or best practices. All the communications are transfered primarily through sockJS.Also, OAuth is out of the question.
Security in Authentication in single page apps
javascript;security;authentication
I think here are two starting points.Web services/REST services on the same server as your single web app.It's not uncommon to do so nor it is necessarily bad, and also clearly the easiest way. Whatever authentication you choose (basic, digest, form, etc.) the API and the app are going to share the same user sessions o...
_unix.81614
What I'm trying to do backup?users home dir which include Desktop,Documents,Pictures, thunderbird which i need to backup of every userall users are in /home partition with there respective user namethere are certain user AND files in /home which need to be excludeWhat I've tried so far?$ tar cvf home01 -T include /home...
backup script to exclude some parent dir and include some child dir
backup
null
_unix.163237
I have the following lines in a text file:1 Q0 /home/nikol123/Downloads/Ergasia_1/Ergasia_1/metadata/13/120411.xml 1 1 Q0 /home/nikol123/Downloads/Ergasia_1/Ergasia_1/metadata/11/105016.xml 2 1 Q0 /home/nikol123/Downloads/Ergasia_1/Ergasia_1/metadata/15/149972.xml 3 1 Q0 /home/nikol123/Downloads/Ergasia_1/Ergasia_1/met...
How to delete specific characters in a text file
shell script;text processing
null
_cs.79638
It's fair to summarize classes in OOP as product types with functions. However, couldn't there be something like sum types with functions? How would inheritance work with them?I'm trying to scout if anybody has considered this question before in language design.
What would sum types with functions look like in OOP?
programming languages;type theory;object oriented
null
_unix.88838
How can we preserve or maintain the same history across multiple terminals?The same question, but for bash shell , were discussed in the below linkPreserve bash history in multiple terminal windowslet me know the corresponding settings for tcsh shell ?
Preserve tcsh history in multiple terminal windows
command history;tcsh
null
_softwareengineering.38368
the goal is to have an online documentation system, with these major requirements:will be mainly used as an intermediate stage for the final technical docs of all our application (which will probably never get completed though :]). It would be typically used as so: someone has a problem, I fix it, and write down the fi...
what kind of online technical documentation system would you recommend?
documentation
I was going to suggest a Wiki As Confluence is a wiki I think using it with your JIRA is an excellent idea. You'll have the advantage of being able to directly tie back into JIRA issues, and therefore the actual code/doc/whatever change made etc.The key to any code doc repo like this is the navigation aspect. You don'...
_softwareengineering.216915
I know that in agile requirement changes should not only be planned for but also embraced. But I still don't know agile how to handle these changes.
How to deal with requirement changes in agile development model?
agile
null
_webapps.88917
How can I add second page in Google Plus? I have personal Google+ account and my company page, but I want to create next page about my hobby. How can I do this?
Two pages on Google+
google plus;google plus pages
null
_softwareengineering.60684
You are conversant with the ZF?How would you go about getting familiar with it in one week?What would be your suggested schedule?
Familiarizing with the Zend Framework in one week
learning;php;zend framework
If you have a few years of experience with PHP and are familiar with MVC frameworks, then you shouldn't have a problem to be familiar with ZF in one week. You're not going to be a guru, but you'll be able to get things done. My plan (and what I actually did few years ago), would be to start with ZF QuickStart, build th...
_cs.62824
How do you know that a decision problem $X$ is NP-complete?, if all other NP-problems polynomially transform to $X$ or if all other NP-problems polynomially reduces (there exist a polynomial time oracle for any problem in NP using an oracle for $X$).Definitions seem to differ all over the web.Thanks!
Is NP-complete complexity defined in terms of polynomial reductions or polynomial transformations?
complexity theory;np complete;reductions;np;oracle machines
null
_codereview.139954
This is a follow up to my previous question: Serializing objects to delimited filesI've added some feature enhancements, and based on suggestions from rolfl in chat, I've fixed up a couple inconsistencies with the serializer.First, if you don't mark any properties with DelimitedColumnAttribute, I added a DelimitedIgnor...
Serializing Objects to Delimited Files Part II
c#;.net;serialization;reflection
To me the Serialize method is too big. I'd split it in three parts.The first part would be the reflection stuff where you read and sort the properties - this could be a new class like ElementReflector or maybe an extension.The second part (maybe a method) would be the first foreach that I cannot figure out what it does...
_softwareengineering.71825
The canonical idea is pervasive in software; patterns like Canonical Model, Canonical Schema, Canonical Data Model and so on, seem to come up again and again in development.Like many developers, I've often followed, uncritically, the conventional wisdom that you need a canonical model, otherwise you'll face a combinato...
Does current evidence support the adoption of Contextual over Canonical Data Models?
design patterns;architecture;data;domain model
null
_unix.97940
I'm working in Unix.I'd like to fetch information from a log in a specified time range for the current date. For example I want the data from a log file of today's date from 00:00 to 09:00. Sample log entry:13/10/16 14:45:02 <batchspeedchange> <BELLBD.BD77350A.G6987V00> <> FAILED FILE FORMAT VALIDATION - ERROR:-213:raw...
How do I filter a log to only the lines between two times?
bash
Assuming the dates look like HH:MM as you've show, and assuming the date appears in the 2nd field, you can use awk:awk -v start=00:00 -v stop=09:00 'start <= $2 && $2 < stop' file.log[rant] I'm quite particular about date formatting, and this one is terrible: what date is 09/10/11? [/rant]Anyway, assuming this it YY/MM...
_unix.195728
So the idea is to create an alias that will search my alias's for me. I have quite a few. dude@gnarleybox:~$ grep alg .bash_aliases.shalias alg='alias | grep 'dude@gnarleybox:~$ alias | grep algalias alg='alias | grep 'dude@gnarleybox:~$ alg gdgrep: invalid max countdude@gnarleybox:~$ Huh? Like grep is getting two many...
Why am I getting invalid max count from grep in an alias?
bash;grep;alias
Remove the blank at the end of the alias definition (as suggested by rici) and your issue should be fixed.But; in such cases as yours, where you have not only synonyms or abbreviations in your alias but also functional code with pipes, it's better to define a function instead of an alias.
_cs.14954
After skimming Multiplication by a Constant is Sublinear (PDF), (slides (PDF), slides with notes (PDF)) I was wondering if this could be extended to division by a constant in sublinear time?Additionally, what about division with a constant numerator, ie. division of a constant?
Division by a constant
algorithms;reference request;integers
Division by a constant can always be recast as multiplication by a constant followed by a shift. The relevant papers are:Robert Alverson, Integer Division Using Reciprocals, IEEE Int'l Symp Comp Arithmetic, (ISCA-10):186-190, 1991.Torbjrn Granlund and Peter L. Montgomery, Division by Invariant Integers using Multiplic...
_unix.349347
I execute: sudo apt-get dist-upgrade and I get this:Reading Package Lists ... DoneBuilding the dependency treeReading status information ... DoneCalculation of the update ... Some packages can not be installed. This may meanThat you have asked for the impossible, or if youUnstable distribution, which some packages have...
I can't upgrade Debian 9
debian;upgrade
null
_unix.293284
i would like to learn and work on internet security, because thia is a world that is in continuos change and id like to improve myself on it..anyone can help me linking site or PDF where i can study this fantastic world?
Learn the base of security and defend myself from external attack
linux;networking;security;osx;windows
You could follow and Watch CEH Channel on YoutubeInstall Kali Linux/BackTrack/BlackBuntu and get started with basic tools installed in these operating systemsThis document could be of some use.
_webmaster.38778
I'm renting server space from someone and, upon logging in my control panel after quite sometime, noticed an abnormal spike (~50MB) in the disk usage. Upon investigating, I found a lot of core.* files scattered around my public_html directory. Each one is more than 5MB in size but no more than 6MB. The * part is all nu...
core.* files eating up server space (~50MB)
php;cpanel;mailing list;webmail
Core files contain the image of the process' memory at the time of its termination (i.e. when it crashed). They can be used to inspect the state of the program when it was terminated.If you're seeing lots of them and they are recreated fast, I would invest some time in debugging which specific program crashed and why. ...
_webapps.73196
I am looking for a way to add up cells under a name. For instance, I am trying to tally all of the assists the character Annie got in a few different games of League of Legends. I am looking for a way to search for a name (which shows up multiple times) and then count adjacent cells.
How to add adjacent cells in Google Sheets
google spreadsheets
null
_datascience.1053
I would like to summarize (as in R) the contents of a CSV (possibly after loading it, or storing it somewhere, that's not a problem). The summary should contain the quartiles, mean, median, min and max of the data in a CSV file for each numeric (integer or real numbers) dimension. The standard deviation would be cool a...
Summarize and visualize a CSV in Java/Scala?
tools;visualization;scala;csv
null
_cs.68549
let's say L is a regular language.And there in an NFA automata with epsilon moves A,in which for every accepting state (q,)=.How can I prove that there must be an automata A as defined for L?
NFA automata with moves proof
automata;finite automata;proof techniques
null
_unix.381739
There are two documented differences between start reboot.target and reboot. But start reboot.target is what is triggered by ctrl-alt-del.target.Does it matter that ctrl-alt-del.target will omit --job-mode=replace-irreversibly? In what situations will this cause different behaviour? Why is it included by systemctl ...
What is the practical difference between `systemctl start reboot.target` and `systemctl reboot`?
systemd;reboot
When queuing a new job, this option controls how to deal with already queued jobs. It takes one of fail, replace, replace-irreversibly, isolate, ignore-dependencies, ignore-requirements or flush. Defaults to replace, except when the isolate command is used which implies the isolate job mode.If fail is specified and a r...
_unix.64848
Can someone explain why I get permission denied when running touch -m on this file even though it is group writable and I can write to the file fine.~/test1-> iduid=1000(plyons) gid=1000(plyons) groups=1000(plyons),4(adm),20(dialout),24(cdrom),46(plugdev),109(lpadmin),110(sambashare),111(admin),1002(webadmin)~/test1-> ...
cannot touch -m a writable file
filesystems;permissions
From man utime: The utime() system call changes the access and modification times of the inode specified by filename to the actime and modtime fields of times respectively. If times is NULL, then the access and modification times of the file are set to the current time. Cha...
_codereview.163043
In this question here on S.O, the accepted answer suggests to use both anonymous function and factory pattern for dealing with PDO connection. I believe the anonymous function is used in case a connection to a different database needs to be established, a different function will be defined for that. In that case, will ...
PDO anonymous function inside a Factory
php;object oriented;pdo;factory method
TL;DR: no.The construction that is shown in the original example provided the following functionality:decoupling from MySQL (you dont, need disable emulation of prepared statements, if you are not using mysql, and you usually dont need to provide username and password with SQLite)option to use MySQLi or SOAP or any oth...
_cs.77062
I'm trying to understand the paper Incentive Compatibility ofBitcoin Mining Pool Reward Functions (Schrijvers, Bonneau, Doneh and Roughgarden, in Financial Cryptography and DataSecurity – FC 2016 Workshops, BITCOIN, 2016; PDF).In page 3 Section 2.1, they say pool operator does not know actual $\alpha_i$ mining power of...
Understanding Incentive Compatibility of pooled Bitcoin Mining paper
algorithms;cryptography;game theory;one way functions
null
_unix.147203
I'm very new in bash scripting and unix so I will need some help on this.I have 7-10 hosts which I want to ping from one of the servers via cronjobs. What I want is when host is up to execute command on it. When is down do nothing. I don't want logs or any messages.So far I have this and unfortunately don't have abilit...
Ping multiple hosts and execute command
shell;ping;hosts
I've made some comments in line to explain what different parts of the script are doing. I've then made a concise version of the script below.#!/bin/bashservers=( 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 5.5.5.5 6.6.6.6 7.7.7.7 )# As is, this bit doesn't do anything. It just pings each server one time # but doesn't save the o...
_unix.301962
I'm writing kinda virtual keyboard using uinput and during looking into what all should I put intoioctl(fd, UI_SET_KEYBIT, ???);I found input-event-codes.h. Some constants there are pretty self-explanatory (KEY_1, KEY_D, ...), but some are a bit more cryptic.Is there anywhere documentation where those keycodes are list...
What is BTN_TRIGGER_HAPPY?
input;header file
There is documentation here, quite a lot of it too. Happy is close to joy, and this association is supported by the following search result:I wouldn't expect every event to have a strict definition. But there's a note in input-event-codes.h stating:/* * Keys and buttons * * Most of the keys/buttons are modeled aft...
_codereview.158574
I've written a function to convert an image into characters and colors for the windows console. At the moment the calculation takes about 13 seconds with a 700x700 pixel image but that time is undesirable especially when I plan on making the function more complex in order to account for character shapes.What are some m...
Convert an image into characters and colors for the windows console
c++;time limit exceeded;image;console;windows
null
_unix.192884
What worked for other packages, doesn't work for kernel. Why?First, sync:[git@dioptase SRPMS]$ ssh root@localhost yum-builddep /home/git/rpmbuild/SRPMS/kernel-2.6.32-431.el6.src.rpmGetting requirements for kernel-2.6.32-431.el6.src --> Already installed : module-init-tools-3.9-21.el6_4.x86_64 --> Already installed : pa...
Why doesn't yum-builddep install all dependencies?
rhel;yum;rpm
Because they are arch dependent. Either rebuild the .src.rpm on the arch. you care about (the one in the source repos. is built on a random supported arch), or download and unpuck the .src.rpm and yum-buildep on the kernel.spec.
_softwareengineering.171024
It's an idea I've heard repeated in a handful of places. Some more or less acknowledging that once trying to solve a problem purely in SQL exceeds a certain level of complexity you should indeed be handling it in code.The logic behind the idea is that for the large majority of cases, the database engine will do a bette...
Never do in code what you can get the SQL server to do well for you - Is this a recipe for a bad design?
design patterns;sql
In layman's words:These are things that SQL is made to do and, believe it or not, I've seen done in code:joins - codewise it'd require complex array manipulationfiltering data (where) - codewise it'd require heavy inserting and deleting of items in listsselecting columns - codewise it'd require heavy list or array ma...
_unix.349074
I have this code where the cmd usually works if I sprintf something to it, but when I try to run my Rscript, it does not work. Any hints?I get the error:awk: cmd. line:9: cmd = Rscript ./date-script-r.r $1 3 2 1;awk: cmd. line:9: ^ syntax errorawk: cmd. line:9: cmd = Rscript ./date...
Running R project script with arguments within AWK in a Bash Script (Ubuntu Linux)
bash;awk;r
replacecmd = Rscript ./date-script-r.r $1 3 2 1;bycmd = Rscript ./date-script-r.r $1 3 2 1 ;for complex awk script it might be better to put them in a awk-script, e.g. date-awk.awk$1 { #Expected args for the Rscript: (1, 2, 3, 4) = (dateString, yearPosition, monthPosition, dayPosition) cmd = Rscript ./date-scri...
_codereview.11181
How can I improve this code for counting the number of bits of a positive integer n in Python?def bitcount(n): a = 1 while 1<<a <= n: a <<= 1 s = 0 while a>1: a >>= 1 if n >= 1<<a: n >>= a s += a if n>0: s += 1 return s
Counting the number of bits of a positive integer
python;algorithm;bitwise
null
_softwareengineering.356153
I am refactoring an application that collects and displays measurement data that is stored in a database. Currently I have an interface calleIMeasurementsDataService and an implementation MeasurementsDataServicepublic interface IMeasurementsDataService{ IEnumerable<MeasurementResult> GetResults(DateTime rangeStart, Da...
C# EntityFramework 6 DbContext and data service with dependency injection
c#;unit testing;dependency injection;class design;entity framework
null
_webapps.88129
Is it possible to prevent YouTube's (HTML5) fullscreen player controls from showing whenever it first goes into fullscreen mode?Like, don't show this automatically (at all):I want it to still show if I move the mouse, as it does now.I couldn't find anything in about:config on Firefox about this, only settings to disabl...
Hide player controls while fullscreen in YouTube
youtube
null
_unix.2645
I read uses of the word utilities for commands/programs such as 'ls', 'chmod', 'mv', etc.Is commands is Linux referring to the same things as top, ps, etc., or are those something different? What about programs? Are those the ones that don't come with the standard distribution which need to be installed like irssi, ema...
Difference between references of Linux utilities, commands and programs
command line;utilities;terminology
This question is hard to answer, as there is no formal definitions of those terms and different people will use them differently. I here only give my use of them, others will have different points if view.For me tool and utility are synonyms. I use the words for small programs which just do one small job. I'd call e.g....
_unix.88281
I want to check connectivity between 2 servers (i.e. if ssh will succeed).The main idea is to check the shortest way between server-a and server-b using a list of middle servers (for example if I'm on dev server and I want to connect to prod server - usually a direct ssh will fail).Because this can take a while, I pref...
Method to check connectivity to other server
linux;networking;ssh
For checking server connectivity you have 4 tools at your disposal.pingThis will check to see if any of the servers you're attempting to connect through, but won't be able to see if middle-server-1 can reach server-b, for example.You can gate how long ping will attempt to ping another server through the use of the coun...
_unix.382143
I understand why hard links on directories are dangerous (loops, problems for rmdir because of the parent-directory-link) and have read the other questions on that topic. And so I assumed that hard links on directories apart from . and .. are not used. And yet I see the following on CentOS 5 & 6:# ls -id /etc/init.d/45...
Is /etc/init.d hard-linked on CentOS?
centos;hard link;sysvinit
That's soft-link, not hard link. Symbolic links point to other files. Opening a symbolic link will open the file that the link points to. Removing a symbolic link with rm will remove the symbolic link itself, but not the actual file.This is indicated by the letter l at the beginning of the permissionslrwxrwxrwx. 1 roo...
_unix.14524
The list of uninstalled packages appearing in my aptitude is massive, but is full of packages that I'm very sure I will never ever install. E.g. my laptop is using intel graphics, so it doesn't make sense to install xserver-xorg-video-nouveau. Therefore I want to hide it forever. This is important while listing using !...
How do I hide packages from appearing in apt system?
apt;aptitude
null
_unix.84592
VirtualBox seems to break my SSH ProxyCommand... here are the details:I want to open an SSH connection from my laptop to desktop over an SSH (reverse) tunnel. I want to do that in one step using ProxyCommand (and netcat). It works when run from the installed OS on my laptop. It fails when run from a VirtualBox guest on...
SSH reverse tunnel works except when I use a VirtualBox instance at one end. Why does VB break SSH?
ssh;virtualbox;proxy;ssh tunneling
It appears that this was my problem:Bug #201786 ssh Agent admitted failure to sign using the key on... : Bugs : gnome-keyring package : Ubuntuhttps://bugs.launchpad.net/ubuntu/+source/gnome-keyring/+bug/201786To resolve my problem all I did was run ssh-add on the VirtualBox instance running on my laptop:ssh-add ~/.ssh/...
_codereview.90954
I recently came across the classic algorithm for detecting cycles in a directed graph using recursive DFS. This implementation makes use of a stack to track nodes currently being visited and an extra set of nodes which have already been explored. The second set is not strictly required, but it is an optimization to pre...
Detecting cycles in a directed graph without using mutable sets of nodes
haskell;functional programming;graph;depth first search;memoization
An easy way to detect a cycle is through the implementation of a disjoint set structure, sometimes called a Union-Find structure. You start with a source node and attempt to add a node to that set. If your Find() call for the source node and the other node returns the same root node, then a cycle world result if the...
_unix.272800
I want to replace 0/1 with hetero but whenever I am trying to use the known commands it is showing syntax error because the / is aleady part of the command .. Can anyone suggest a command to solve this issue??
Find and replace in Linux
find;command;replace
null
_codereview.111449
I've attempted a functional solution to Conway's Game of Life in Python.The example code allows you to see the next generation of the universe by calling the step() function, passing the current generation of the universe. The universe is represented as a set of live cells. Live cells are represented as a tuple of x, y...
Game of Life rules in 14 lines of Python
python;python 3.x;functional programming;game of life
For docstrings, if you're following the Sphinx documentation format (which it looks like you are), you can specify an explicit :return: field to document what exactly it is your function is returning. PEP-0257 has various other conventions for docstrings like leaving a blank line between the summary line and the rest o...
_softwareengineering.103375
I have a couple of Python modules that are meant to be run as scripts. How should I write the docstrings at the module and function level to make it clear how to run and use the module?
How should I document a Python script?
python;documentation
null
_webmaster.2938
i see many sites that have their heading as an image. what is the benefit of this? when is a best practice to use text as images as opposed to just having text in my html. is this just for supporting non standard fonts?
When should i consider having text as an image in my website heading
website design;images
Reasons to use an image header with text:The text isn't necessary for SEO.The font can't be reproduced on theweb.The text is integrated too closely with alogo to separate the two.Reasons to use text as your header:The text is necessary for SEO.The text needs to scale according tothe browser window.The text needs to sca...
_webapps.62940
I'd like to align the titles in my swimlanes to the left side, but the collapse/expand buttons are hiding the words. Is there a way I can make that kind of button invisible?I've looked through the code that's editable and haven't found it there either. When I use element inspector it shows the collapse/expand button as...
Is there a way to hide the collapse/expand button in draw.io?
draw.io
Select the swimlane and on the menu invoke Arrange->CollapsibleTo toggle the collapse/expand button.
_datascience.22118
Why do we need for Shortcut Connections to build Residual Networks, and how it help to train neural networks for classification and detection?
Why do we need for Shortcut Connections to build Residual Networks?
machine learning;neural network;deep learning;computer vision;caffe
null
_unix.332347
I have these results from find:$ find subprojects -mindepth 1 -maxdepth 1subprojects/install-globally-firstsubprojects/installation-test-project-custom-configsubprojects/install-via-githubsubprojects/init-from-nothingsubprojects/node-path-testsubprojects/install-globally-with-nvmsubprojects/installation-test-projectsub...
map the results from find
find;pipe;xargs
null