Git remove directory

Question: I've got a repository on GitHub (http://github.com/hrickards/PHP-Crypto) for a little project me and a couple of others are working on. My development environment is Aptana Studio, and I use the EGit plugin as Aptana is basically Eclipse underneath. Today the designer sent the HTML and CSS for the website with the images in a folder named img. Previously the images were in a folder called images. Thinking nothing of it and being too lazy to update the CSS and HTML, I simply kept the images in the img directory and commited to Git. However, the GitHub web interface shows both the img and images directories, with the images directory being empty. I've tried deleting the images directory with git rm -r images and git rm images, and even mkdir images; git add images; git rm -r images but whatever I try I get the same result:
fatal: pathspec 'images' did not match any files.
Has anyone got any advice on how to remove images, or am I misunderstanding Git or something?
Answer: This is what I use, and I think you'll want to as well.  It's close to the other answers, but instructs git to NOT change the local files.
git rm -r -f --cached DirectoryName

-r        : recursive
-f        : force
--cached  : apply ONLY to index (staging area). Git leaves the local copies alone.
Comment: `git rm -r -f .` deleted all my local copies of files excluding files declared  in `.gitignore`.  After a heady and sweety hour I managed to recover them with `git checkout HEAD .`.  So use this command carefully.  Of course I had forgotten the `--cached` argument part.
Answer: Git does not store any information about the directory, just the files within it. So, you cannot add or remove directories themselves; if you say git add images, Git will add all of the files within that directory (that don't match the ignore list).
Generally, the only way for there to be an empty directory is if it actually contains a file, usually a hidden file like .gitignore.
You said that you see an images directory on GitHub, but I'm not seeing it in the repo that you linked to. Are you sure it's there, and not just an empty directory on your disk? If it's just an empty directory on your disk, you can just remove it using rm images; Git doesn't need to know about it.
Comment: You're right - it's not there now. It definitely wasn't on my disk, so I can only assume my browser, Chrome, had cached the page or something even when I refreshed it. It has a habit of doing that. Thanks for the help anyway!
Comment: @hrickards Just a tip, if you want to force chrome (I think it works in other browsers too but I didn't test it) to reload the page completely, press [CTRL]+F5.
Answer: try this:
git rm -r -f DirectoryName

Comment: `git rm -r -f --cached DirectoryName`   <<< use this to leave the local copy alone!
Comment: it removes physically!
Comment: @Sk606: could you post it as a separate answer? You would get upvotes (at least from me), because this is the real solution :)
Comment: Sure, added one with some bonus explanation
Answer: The linked GitHub repository does not show the images directory.
Git does not store empty directories for technical reasons, so just try rm images and remove the images directory from your local directory hierarchy.
Comment: Hi, as said above I think Chrome must have cached the page even when I F5'ed it or something. Thanks for the help anyway!

Git remove directory


merging particular text files in different directories

Question: I have 6 directories. Each directory includes 8 text files. These text files share the same prefix. I need to combine these text files as follows;
Assume, first text file in directory_1 contains files containing the text abc_1, directory_2 contains files with the text abc_2 and so on. Merged text file for the first text files needs to be in this form:
abc_1
abc_2
abc_3
..
abc_6

The second, third... and eighth text files also need to be combined with the same rule.
Comment: Is the prefix the same *within* directory and different *between* directories? For example, do you have abc_1, abc_2, ..., abc_8 in directory 1 and def_1, def_2, ..., def_8 in directory 2?
Comment: Also do you already know the list of prefixes (if different for each directory)? Do the prefixes have all the same length (e.g. 3 letters) or do they all finish with an underscore?
Comment: prefix is the same within directory and between different directories.  Prefixes have not all the same length.
Comment: If the prefix is the same within directory and between directories then you have the same prefix everywhere. Then how can it not be of the same length if you have only ONE identical prefix everywhere?
Comment: I have not only one identical prefix everywhere
Comment: Ok so it is not the same between directories. Is it always followed by an underscore?
Comment: yes it is always followed by an underscore
Answer: An implicit method (can fail if unrelated files with filename ending with _ and a number are in the same directory) which names each merged file according to the file number:
DIRS_BASE=directory_
for ((FNUM=1; FNUM<9; FNUM++)); do
    cat ${DIRS_BASE}[1-6]/*_${FNUM} > merged_${FNUM}
done

An explicit method (safer) using a list of prefixes, which names each merged file according to the file number:
DIRS_BASE=directory_
PLIST=(abc def ghi jkl mno pqr)
NDIRS=${#PLIST[@]}
for ((FNUM=1; FNUM<9; FNUM++)); do
    PLIST_NUM=(${PLIST[@]/%/_$FNUM})
    cat ${PLIST_NUM[@]/#/$DIRS_BASE[1-$NDIRS]/} > merged_${FNUM}
done

Comment: @Zanna I didn't see that the OP edited his question to make it clearer (question was not intelligible first). I updated the answer.
Comment: thanks! I just removed an unnecessary reference to the number of directory in the second method
Answer: Your files must be sortable, so assuming the names of the files in each directory end with a number from 1 to 8, such as foo1, foo2... in one directory and bar1, bar2... in another and so on, you could use cat and a for loop to concatenate them:
for j in {1..8}; do cat directory_{1..6}/*$j > newfile$j; done

(no need to "quote" a variable we know is a single digit) This will print, in, for example, newfile1, the contents of
directory_1/foo1
directory_2/bar1
directory_3/baz1
...

whatever those contents are, and in newfile2 the contents of directory_1/foo2, diectory_2/bar2 etc


error in disk partitioning during ubuntu server 12 installing

Question: I'm installing ubuntu server-12 on my computer that has a 2 GHz intel processor, 2 GB RAM and 160 GB Sata hard drive. I'm installing from a CD. Everything goes fine; however when I get to partitioning the hard drive, I get this (I'd post the image, but ask ubuntu doesn't let me yet):
[!!] Partition disks
       ??? ???

Comment: post the image to imgur.com and provide the link here.
Answer: Make sure Ubuntu can see your hard-drive('s), are your Hard-drive('s) connected to a raid? if so find out if your raid controller is compatible.
If not try and boot from a live disc and format the hard-drive('s) from within ubuntu.
If that fails try using partition magic (or any other hard-drive checking software) to test your drive as it may just be a dead hard-drive


Why does my first Hello World Java program give an error on Visual Studio when using System.out to print to screen?

Question: I'm using Visual Studio Code on my Mac laptop and I'm after writing my first program in Java but when I run the code I get an error message about System.out.
<code>public class Hello
{
    public static void main(final String[] args)
    {
        System.out.println("Hello, World!");
    }
}
</code>

"Replace this use of System.out or System.err by a logger."
How can I fix this error?
Comment: Disable sonarlint.
Answer: This is a sonarlint error (visual studio code plugin), not a compiler one. This program will run perfectly fine, but apparently the plugin is configured to display this as error in IDE (you usually don't want System.out in production code).
According to https://www.sonarlint.org/vscode/, you should be able to adjust the rules in your IDE:

In the SonarLint Rules view in the explorer, you can activate and
deactivate rules to match your conventions. There is also a code
action on each issue to quickly deactivate the corresponding rule


How to correct error DatabaseException (near ")": syntax error

Question: error DatabaseException(near ")": syntax error (code 1 SQLITE_ERROR): , while compiling: CREATE TABLE my_table (
I/flutter (21754):             _id INTEGER PRIMARY KEY,
I/flutter (21754):             name TEXT NOT NULL,
I/flutter (21754):                 address TEXT NOT NULL,
I/flutter (21754):                     comments TEXT NOT NULL,
I/flutter (21754):                             sigURL TEXT NOT NULL,
I/flutter (21754):                                                         selfpicURL TEXT NOT NULL,
I/flutter (21754):
I/flutter (21754):                             hi INT NOT NULL,
I/flutter (21754):                                                     time TEXT NOT NULL,
import 'dart:io';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:path_provider/path_provider.dart';

class DatabaseHelper {

static final _databaseName = "MyDatabase.db";
static final _databaseVersion = 1;

static final table = 'my_table';

static final columnId = '_id';
static final columnName = 'name';
static final address = 'address';

static final comments = 'comments';
static final sigURL = 'sigURL';

static final columnAge = 'hi';

static final  selfpicURL = 'selfpicURL';

static final  createdTime = 'time';

DatabaseHelper._privateConstructor();
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();

static Database? _database;
Future<Database> get database async {
if (_database != null) return _database!;
// lazily instantiate the db the first time it is accessed
_database = await _initDatabase();
return _database!;
}

_initDatabase() async {
Directory documentsDirectory = await getApplicationDocumentsDirectory();
String path = join(documentsDirectory.path, _databaseName);
return await openDatabase(path,
version: _databaseVersion,
onCreate: _onCreate);
}

Future _onCreate(Database db, int version) async {
await db.execute('''
          CREATE TABLE $table (
            $columnId INTEGER PRIMARY KEY,
            $columnName TEXT NOT NULL,
            $address TEXT NOT NULL,
           $comments TEXT NOT NULL,
            $sigURL TEXT NOT NULL,
           $selfpicURL TEXT NOT NULL,

           $columnAge INT NOT NULL,
            $createdTime TEXT NOT NULL,

          )
          ''');
}

Future<int> insert(Map<String, dynamic> row) async {
Database db = await instance.database;
return await db.insert(table, row);
}

Future<List<Map<String, dynamic>>> queryAllRows() async {
Database db = await instance.database;
return await db.query(table);
}

Future queryRowCount() async {
Database db = await instance.database;
return Sqflite.firstIntValue(await db.rawQuery('SELECT COUNT(*) FROM $table'));
}

Future<int> update(Map<String, dynamic> row) async {
Database db = await instance.database;
int id = row[columnId];
return await db.update(table, row, where: '$columnId = ?', whereArgs: [id]);
}

Future<int> delete(int id) async {
Database db = await instance.database;
return await db.delete(table, where: '$columnId = ?', whereArgs: [id]);
}
}

Answer: SQLite SQL parser does not support trailing comma before the end parenthesis
Instead of (at the end of your statement)
  ...
  $createdTime TEXT NOT NULL,
)

do
  ...
  $createdTime TEXT NOT NULL
)

Answer: create table $tableTodo (
  $columnId integer primary key autoincrement,
  $columnTitle text not null,
  $columnDone integer not null)
''');

if you look carefully in the last line $columnDone integer not null it has no comma like the other 2 top lines, that's the problem in your code.
for more info
Happy coding
Answer: SQLite doesn't support trailing commas. Try removing the comma of your last statement about creating a table. for example
if you are writing like this;
$createdTime TEXT NOT NULL,
try instead;
$createdTime TEXT NOT NULL


Why extra parenthesis is needed to compile "std::thread" functor?

Question: I'm moving from "ancient" c++ to the newer C++ 11 and looking into the std::thread library.
class MyThread
{
public:
    int i = 0;
    void operator()()
    {
        for (;i < 10000; i++)
            cout << "Exectuing " << endl;
    }
};

In main() I have the following lines:
thread threadObj( MyThread() );

for (int i = 0; i < 1; i++)
    cout << "Main thread " << endl;

threadObj.join();

It won't compile the last line : "Expression must have a class type"
Adding extra parenthesis to  thread threadObj( (MyThread()) ); solves the problem.
Why ? The type remains the same : thread.
Am I missing some new c++ 11 feature ? or am I just confused...
Answer: The problem you see is known as most vexing parse: https://en.wikipedia.org/wiki/Most_vexing_parse
For that reason from c++11 you can use the new '{}' for initialization.
With new form you can write:
thread threadObj{ MyThread{} };

This creates MyThread with an empty initializer list and the thread object itself with the object which was created before with the MyThread{} initialization.
What is going on by using the form: thread threadObj( MyThread() ); ?
The compiler interprets it as a function call and not as initialzation of an object. So using the new {} form makes that clear for the compiler.
If you use {} in your program, you should use it stringent. Using it like:
thread threadObj{ MyThread() }; // bad style!

looks a bit mysterious, because you use in one line the old and the new version. That technically works, but makes code unreadable. ( at least for my eyes :-) )
Answer:

Am I missing some new c++ 11 feature ? or just confused.

yes, in c++11, you use universal initializers. change the line of code
thread threadObj( MyThread() );

as
 thread threadObj{ MyThread() };

it will work fine
Comment: Can you elaborate ? why `thread threadObj( (MyThread()) );` does work ? and otherwise doesn't ?


Where to find more information about xxx.d folders?

Question: I see various references to "custom" folders in the /etc folder, with names matching some config file, eg /etc/resolv.conf and appended with .d.  Examples are resolv.conf.d or cron.d.
Where can I find more documentation about this folder structure, the types of files that can be in them, the order of precedence, etc.
Answer:
Where can I find more documentation about this folder structure

This is going to fairly difficult to answer correctly since it is old (and documentation scarce). Unix System V or even earlier than that, so we are talking about 1985 roughly. Plus ... each of the different directories ending with that .d might have a different answer.
In general (I will try to fix on cron.d as an example but it will apply to all the others too, with some expections):

The .d refers to the word directory. In the old days it was used to make a difference between a command and a directory. Inside that directory there will be scripts or text files that this service can handle. In cron.d there is a file anacron that is a text file that is parsed and the results are executed by cron.
Or as explained on the debian mailing list: "Generally when you see that *.d convention, it means "this is a directory holding a bunch of configuration fragments which will be merged together into configuration for some service.".
There is some more information in that link but ... it is simplified for some reason.

How to track down more information:

If you drop the .d from the name there is most likely a man page for it. The same goes for the commands inside the directory itself (there is a man page cron and one for anacron; same goes for apparmor, usb_modeswitch resolve.conf and all of them should have a mentioning of the directory and it usage).

the types of files that can be in them

This will be stated in the man page. Related to cron (a part of it, the link above to the man page has a bit more but this is the most interesting):

Support  for  /etc/cron.d  is included in the cron daemon itself, which handles this location as the system-wide crontab spool.  This directory  can  contain  any  file  defining  tasks  following  the format used in  /etc/crontab, i.e. unlike the user cron spool, these files must provide the username to run the task as in the task definition.
the order of precedence

Unless noted otherwise it will be in alphabetical order.


How to show grub menu after grub update?

Question: I have 11.10 and Windows 7 in dual boot. Today I tried to update grub and I run the following command in terminal:
<code>sudo fdisk -l
sudo mount /dev/sda6 /mnt
sudo grub-install --root-directory=/mnt /dev/sda
sudo grub-install
</code>
After installation and reboot, it does not show the grub menu (from which I can choose which OS to boot) and it directly boots Ubuntu.
Please help.
Comment: Try holding Shift while booting to get to GRUB.
Comment: i try but nothing happen. which way i can add or recover windows7 loader in  boot loader
Comment: Did you install Ubuntu via wubi?
Comment: no live cd...and before update grub its workig well... and it was also show the grubloader also but now it cann't show grubloader and so i cannot load windows7.. if u cann't understand my problem than i can explain in other way.. because i m not good enough in explain. so plz reply and thank u..
Comment: I can understand your problem. I just don't see a way out right now.
Answer: Boot to your live cd.
Then: in a terminal type.........
sudo mount /dev/sdXY
Example:

sudo mount /dev/sda1

Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.
sudo grub-install --root-directory=/mnt /dev/sdX
Example:

sudo grub-install --root-directory=/mnt /dev/sda

Refresh the GRUB 2 menu with

sudo update-grub.

reboot
If this does not work for you - try the link bellow.
https://launchpad.net/boot-repair


Cursor usage in different application elements

Question: I am working on an application that is mostly used by desktop users. So I am trying to perfect the use of the cursor css-rules.
First of all, I have read and tried to follow the practice of having pointer-cursor only for external (href) links but have the default-cursor (arrow) on buttons and internal links (like navigating to another application menu-item).
What I am a bit more uncertain on is the practice for text. This application contains a lot of editable data - like forms or editable content inline (in tables and other elements). I have been considering showing the text- cursor only for editable data, to indicate that the user can click to edit, and have the default-cursor for normal text, even if it is selectable. The default browser rule is usually the text-cursor for all normal text. Anyone knows if there are any unwritten standards or any widely used style guides or other sources related to this?
Answer: I'd go with using the pointer-cursor for both of your first 2 scenarios and text-cursor for your 3rd and 4th scenarios, and use some other visual cue to distinguish between them.
Answer:
but have the default-cursor (arrow) on buttons and internal links (like navigating to another application menu-item)

Arrow doesn't generally go on buttons and links. I don't see what benefit you're getting from making it less obvious that a thing is clickable.

default-cursor for normal text, even if it is selectable

If you do that, you should also disable the text being selectable. There may be reasons to do that (see eg my answer on Why does Google use user-select: none; on the text in their google meets web app?).
If you have a webapp that is useful as a website (ie: Where a user might want to copy text from), you probably want to use the text cursor. If your webapp has no text worth copying, disabling text selection and text cursors may feel better.


Installing from Tar.gz Permission Denied

Question: Total Linux noob. I have worked in the WinTel world as a network/sys admin for going on twenty years. Its time for me to get my feet wet with Ubuntu.
Let me preface this with the following: I have googled this and just can't make any head way. Each question just leads me into another rabbit hole. I have looked and looked and keep getting frustrated. So please forgive my noob question(s).
I am attempting to install OpenFire from tar.gz without success. I saved the archive to my desktop and am attempting to unzip the folder(s) to either /opt or /usr/bin as indicated by the OF documentation. I keep getting permission denied. Is this something you can help with?
Using Desktop version 12.04 LTS inside Oracle VirtualBox most current release.
Thanks for any info.
Comment: Just to be clear, you are talking of this [OpenFire](http://www.igniterealtime.org/projects/openfire/)?
Comment: What error are you getting ? (e.g. like [this](http://i.stack.imgur.com/LaDQE.png)?) Please add a screenshot (use http://imgur.com) or the error output to your question
Answer: Better to go to igniterealtime.org and download the .deb package for Ubuntu - you'll have much less trouble during installation.


Do I need vapor barrier to insulate a cinder block garage?

Question: Similar to How to properly insulate a garage? and https://diy.stackexchange.com/questions/31028/do-i-need-a-vapor-barrier-between-the-insulation-and-finish-wall-in-a-new-garage both of which do not have answers pertitent to my one particular question...
My garage is attached to my home.  It sits next to a long vestibule area and underneath the bedrooms.  All of the walls of the garage are cinder block, including the one which is common to the vestibule.  I am planning to hang furring strips, insulation board, and drywall in the garage.  I live in northeastern PA which has generally mild humidity apart from a few weeks each summer.  As part of this project I will be installing a new windowless insulated garage door.
Do I need to, or should I, install vapor barrier behind the furring strips and insulation?
Comment: In Pennsylvania the critical season is the heating season. During heating season the hot humid side is the interior, and that is the side that the vapor barrier should face. If the garage is heated, the same criteria hold. If the garage is not heated then if it stays warm it is sucking heat from the rest of the house.
Comment: @benrudgers Thanks - so vapor barrier would only need to be installed on that side of the garage against the cinder block?
Comment: If the home is relatively recent, then there is [ought to be] an existing vapor barrier between the interior space and the garage. It is [ought to be] facing the interior heated space. The same logic would apply to a heated garage at the exterior walls.
Comment: @benrudgers The house is early 1970s construction.  The garage has raw cinder block exposed with no vapor barrier.  I'll install it following your advice.  Thanks - you should write it as an answer.
Comment: Don't forget the "non-insulation" reason for a vapor barrier:  the code requirements for blocking any possible flow of carbon monoxide from the garage to the living areas...
Answer: As there will be a temperature differential between the garage and house it is a good idea as you could get some condensation here in winter even with mild humidity.  Where I live is almost desert but vapor barrier is still recommended due to cold climate.  Moisture reduses the effectiveness of insulation so for a small extra investment of time and money you ensure that your work stays effective for years.
Comment: There is already a temperature differential between the garage and the home whenever the interior home space is conditioned for heating or cooling.
Comment: My home has both central air and, obviously, heating. I guess I'm worried that moisture could become trapped between the barrier and the cinder block. Is this a legitimate concern?
Comment: Cinder blocks are vapor permeable, so they will allow outward drying if there isn't a vapor barrier on the other side. You probably don't want a vapor barrier on the house side, since if the house side has one you'll have a two vapor barrier sandwich that doesn't allow drying.


Can Closetmaid wall clips be reinstalled after painting?

Question: I have Closetmaid wire shelving in my laundry room. I want to remove these so I can paint the walls.  Can I re-use the clips to re-install the shelves once I finish painting?
Thanks for any help!
Comment: Closetmaid makes a lot of *clips*. Can you provide a photo or link to the actual clip you are talking about. Also do you mean remove the shelf from the clip or the clip from the wall?
Comment: This should be directed to the manufacturer as it is a product specific question.
Comment: @TheEvilGreebo The fact that it's product-specific does not mean it's off-topic here. We routinely answer product-specific questions (and even ask for model numbers in many cases!) about all kinds of products.
Comment: Ahem: https://diy.stackexchange.com/help/on-topic
Answer: It depends on the clips used for the install. I already am sure the large clips for the forward edge of the shelves have the wall inserts as part of the clip, and when you pull the pin and remove the clip the drywall will never be the same. With care, you can reuse the clip. The clips for the back wall, if they have the inserts as part of the clip, the situation will be the same as the larger clips, the drywall will not take well to having the insert withdrawn. If the back wall clips have separate drywall inserts and can stay in thew wall while removing the support clips, have at it and paint away.


always point to other attribute's function

Question: I´m working on improving my pythonic coding and want to know if there is a way to always point to an attribute's function in the same class (including "updating" its values)
the simplified code looks like this:
class xyz:
    def __init__(self, widht, height):
        self.image = pygame.Surface((width, height))
        self.rect = self.image.get_rect()
obj = xyz(42, 42)
obj.image = pygame.Surface((some_other_width, some_other_height))
# obj.rect would still be of size 42x42 and not the new values

since the image is varying in size, changing very often and my class has to have a attribute named rect with the size of the curent image is there maybe a magic method that could the work of the update_rect() function (tried playing around with self__getattribute()__ a bit but that didn´t work)
def update_rect(self):
    self.rect.width, self.rect.height = self.image.get_width(), self.image.get_height()

Comment: Make `rect` a read-only [`@property`](https://docs.python.org/3/library/functions.html#property) that always returns `self.image.get_rect()`.
Answer: As jonrsharpe suggested in a comment, you can use a property. But make image a property, not rect, like this:
import pygame

class xyz(pygame.sprite.Sprite):
    def __init__(self, width, height):
        super().__init__()
        self._image = pygame.Surface((width, height))
        self.rect = self.image.get_rect()

    @property
    def image(self):
        return self._image

    @image.setter
    def image(self, value):
        self._image = value
        self.rect = self._image.get_rect(topleft=self.rect.topleft)

obj = xyz(42, 42)
obj.rect.topleft = (300, 300)

print(obj.rect.width)   # prints 42
print(obj.rect.x)       # prints 300

obj.image = pygame.Surface((100, 100))

print(obj.rect.width)   # prints 100
print(obj.rect.x)       # prints 300

This way, you can also keep the position that is usually stored in the rect attribute.
Comment: @Robin The code you posted in your answer leads to an overflow because inside the `image` setter you call `self.image = image`, and assigning something to `self.image` will call the setter again, thus calling `self.image = image` again, and so on. The trick is that assign something to a property no longer really assigns something; a method call is made. So if your think about `self.image = image` as `self.image(image)` you'll see that this is an infinite recursion loop.
Comment: perfect, thanks it worked with protected image, just wondering why setters with public attributes throw a recursion error... I´m off reading about oop im python it´s more complex than i thought :)
Comment: would it be better if I changed all attributes to protected and access/change them with getters and setters like it is common in java? Or was it just necessary in this case to avoid an overflow?
Comment: @Robin In Java you would have the same problem if you would call `setFoo(...)` inside `setFoo(...)`. IMHO you should use properties only sparingly in Python.
Comment: Yeah never thought about that, since attributes in Java are/should be private most of the time anyways... never stumbled over that problem....  Well thats good I´ll just use them if neccesary cheers man.


Are there octagonal box extenders that are slimmer than 1 1/2" deep?

Question: Is there an octagonal box extender that's slimmer than 1 1/2" deep? So far I haven't been able to find one.
Here's why: to cover up 30 years of patching on one of my plaster and lath ceilings, I'm considering covering the entire ceiling with 3/8" drywall, but that solution will leave two electrical boxes sunken into the new ceiling. I could re-mount the boxes deeper into the ceiling and use a 1 1/2" box extender, or I could replace my boxes with deeper ones, but it'd be easier if I could just affix a slim box extender and be done with the job.
Does anyone make a skinny box extender?
Comment: Check out the 'big walley' system of lathe and plaster repair...
Answer: This appears to be a 1/2 inch extender that fits octagonal boxes:
Comment: If the metal box is grounded (through whichever means), you can add a plastic extender as long as you ground the fixture to the box.  Most light fixtures nowadays have a ground terminal, so as long as you tie that into the circuits ground (which should be bonded to the metal box anyway) you should be fine.
Comment: very cool. Do you know if it's OK per the NEC to put a non-metallic extender on top of a metal box?
Comment: I don't believe the NEC still allows the metal armor to be used as ground in BX/AC; modern installations require a dedicated ground wire. Maybe someone with a NEC reference handy and confirm?
Comment: Is this a metallic sheathed cable system (sometimes called BX) or is it non-metallic (sometimes called Romex)? If non-metallic, I don't think the composition of the boxes or extenders have any bearing. If it is metallic cable DO NOT USE ANYTHING BUT METAL. BX type systems rely on the box itself for ground and you need actual metal to metal contact. Not certain of exactly what code says and welcome weigh in from the community.
Comment: My concern is an old system that did use the armor as ground. Very common in older cities such as NYC. Still, good to check the code.
Comment: Knew we could count on Tester101 for the rules!
Comment: It's NM cable. The fixture itself has no ground wire because it's one of those all-plastic luminaires that have no exposed metal parts.
Comment: It sounds like you are OK. If you can't find something like this locally, you probably can order from HD or Lowes online.
Comment: To clarify for those who stumble across this in the future: It's NEC-legal to use flexible metallic conduit as ground in some situations (basically a short run, like a three-foot whip between a can light and a junction box). It'd be necessary to consult local codes to get the actual length where it's ok, but it's not very far. Also, MC uses a real same-size ground wire, while BX (sometimes AKA "AC") uses the armor in conjunction with a small bonding strip attached to the jacket. Without the bonding strip, BX is just armored cable. i don't trust BX, and always pull a wire in FMC. ;)


Writing text mode screen to a text file. (MASM)

Question: Basically I have to create a maze and store it in a text file so I can open it up later, I already have the creating the maze part down but I for the life of me can't get it to save everything that's on screen to a text file (even the blank spaces) I know i can use int 21h to write things to a file I just don't know how to write everything to said text file (the whole 80 lines and 25 columns) in the order are displayed on the dosbox screen.
mov     ah,3CH ; File creation
mov     cx,0    ;
mov     dx, OFFSET filename
int     21h
mov     handle, ax

mov ax,0b800h
mov es,ax
ciclo2:
    mov ah, es:[bx]
    mov al, es:[bx+1]
    mov var1, ax
    mov ah,40h
    mov cx,2
    mov dx,var1
    mov bx,handle
    int 21h
    inc bx
    inc bx
    cmp bx, 4000
    jne ciclo2
fim:
    mov     ah,3Eh ; Closing the file
    mov     bx,handle
    int     21h

    mov     ah,4CH ; Closing the program
    INT     21H

I'm using MASM and dosBOX.
Comment: What is the problem or what is the wrong result that you get?
Comment: It's supposed to write what's on the screen to a txt file but it ends up not printing anything at all.
Comment: I found 4 errors in your code, check the answer below (if it's useful don't forget to click on the ✔ checkmark of the answer).
Comment: Your code is writing the character and the attribute to the file. Is that what you have to do? Or do you just need to store the character in the text file?
Answer: Next are 4 errors in your code snippet and the fixes :
mov ax,0b800h
mov es,ax
xor si,si     ;◄■■ INITIALIZE SI = 0.
ciclo2:
    mov aL, es:[si]    ;◄■■ CHARACTER IN AL.
    mov aH, es:[si+1]  ;◄■■ COLOR IN AH.
    mov var1, ax
    mov ah,40h
    mov cx,2
;   mov dx,var1       ;◄■■ WRONG : VARIABLE VALUE.
    lea dx,var1       ;◄■■ RIGHT : VARIABLE ADDRESS.
    mov bx,handle
    int 21h
    inc si
    inc si
    cmp si, 4000
    jne ciclo2
fim:

When you read the file to display the content, remember the screen contains the character first (mov al, es:[si]) and the color later (mov ah, es:[si+1]), display the bytes in that order, or you will see strange characters and colors on screen.
Comment: @GabrielSilva, I replaced `BX` by `SI`, this register will do the job.
Comment: I just realized that this code puts me in an infinite loop since bx keeps getting changed to the value in "handle" in order to use int 21h , is there any other register I can use instead of bx for this part

    mov al, es:[bx]
    mov ah, es:[bx+1]
Comment: `mov ax, es:[si]` would load both AL and AH with a single instruction.  But this still looks really inefficient, @GabrielSilva: why not just point DS at video RAM and make one larger write call, instead of copying 2 bytes at a time to a tiny buffer?  For some reason you're writing both bytes (character + color/attribute), so it's not really just a text file, it's a complete dump of video RAM to a file, 2 bytes at a time.


Handle unpaid order

Question: Hi,
For my e-commerce application I always use PayPal and an ipn.php file for handling the paid transaction with custom variable as orderid.
Because the PayPal system can't handle billing and shipping of the site forms, I pre-insert the order in the database and UPDATE the status when IPN gets the transaction Paid.
Sometimes users click on the PayPal option but can close the browser: voluntarily, accidentally, blackout, etc. The result is an unpaid order memorized forever in the database.
Is there a method to avoid this?
P.S. Sorry for my bad English; I hope all is clear.
Answer: Usually I set a flag in the database on each order.
So when you save it to your database, the order paid variable is set to false. Then inside your callback URL you set the order paid field to true.
You can then either keep these in the database if you want to use them for anything, or write a script to remove them from the database and run it on a cron job.
Comment: thanks for the answer. But my web hosting dont support cron job.
Comment: Well, you can't run the cleanup script periodically then, just filter those results out in your query.

Handle unpaid order


VMware wants /dev/dsp, but it does not exist

Question: Running an MS-DOS virtual machine within VMware Workstation 9.01 requires the "virtual sound card" to be set to SB16.  However, when it is configured as SB16, it wants /dev/dsp.  This device does not exist.  All sound works fine in Ubuntu, and other virtual machines in Workstation 9 have fully functional sound.
Ubuntu 12.04, kernel is 3.2.0-37, platform is x64-SMP, oss-compat is already installed.  Launching vmware with padsp did not work either.  When launching the virtual machine, it still reports that /dev/dsp cannot be found.  Already tried setting the virtual sound card to Auto Detect and Alsa-Compatible Sound Card (these are the only two choices).  Result is the same.
From what I have been able to find so far, no one else is reporting this particular problem.  Suggestions for missing /dev/dsp have always involved pointing to a different device or installing oss-compat and/or alsa-oss.  Neither of these fixes the problem.
Answer: I seem to have had the same problem running a win 3.11 guest on a Gentoo host. Turned out modules for OSS was built and installed, but not loaded at boot. A simple sudo modprobe snd-pcm-oss made /dev/dsp accessible for vmware workstation 9.
Answer: It might be due to a bug/issue with Ubuntu 12.04.
If I read and understand the following post it has to do with missing modules and a workaround that will only work with higher versions of Ubuntu.
The post I refer to is this one: oss-compat package does not create /dev/dsp
This will not solve your problem but give you an explanation why it is not working.
Answer: The device was present, but was only accessible by root or group audio (660). A simple chmod 666 /dev/dsp did the trick for me.
I don't know however, if this is realy a good thing to do.


Fiber vs STP vs UTP for underground conduit run to backyard office?

Question: We're building a standalone structure in the backyard that will be used for a backyard office. There's already a trench with a conduit for electrical and a 3/4" conduit for some sort of networking. The trick is figuring out which type of networking cable to run through that conduit.
I was originally planning on pulling fiber out there due to concerns about the proximity of the electrical conduit (they're right on top of each other). I was also recently reading about various shielded forms of ethernet cable and thinking that might be a better/easier choice? The run from the networking cabinet is about 80-100' in total, with about 30' of that inside and about 50' outside via the conduit.
Is fiber the obvious right choice here? Should I bother pulling it myself? I had one local company come out and quote me for pulling the fiber and the price was way higher than I expected. Another local company told me they could run Cat8 through the conduit, but after reading about how to ground the shielding on STP cables I'm not at all sure that's a good idea.
For code purposes I'm in King County in western Washington State.
Comment: What size is the conduit for the electrical? Nonconductive fiber can be mixed with power wires without issue...
Comment: I think you would be fine with the ethernet cable.  Where would your connections be for the ethernet cable, if that's what you end up by using?  Any connections should be serviceable, so that means outside of the conduit.  And if you can pull the electrical wires through their conduit, you should be able to pull the ethernet cable through it's own conduit.
Answer: Fiber is the obvious choice, for multiple reasons. If you choose not to do fiber, point-to-point wireless is likely the next logical option, given a short distance.
The biggest one is that fiber does not need lightning/surge suppression, since it does not conduct electricity. You also don't have to replace lighting/surge suppressors that don't survive a surge.
Most networking companies do come in rather high on doing fiber, but if you get pre-terminated cable suitable for wet locations (probably "indoor/outdoor" is your best bet) somewhat longer than you need it's not too hard to pull it yourself, especially if you get "reduced bend radius" fiber.
However, getting pre-terminated fiber through a 3/4" conduit may be a bit iffy, even with LC (small) connectors, since the connectors need to be protected for the pull and that adds some bulk. Look for a cable with a pulling eye in place, and verify with the vendor that it will work in 3/4" conduit.
Myself, I learned to do "old school" hand-polish terminations rather than pay a company a great deal more for a project, but that was a bit larger scale than one cable in the back yard. I paid for the equipment and supplies many times over .vs. the quoted price.
There are also "mechanical splice" connectors out there, but the tools to use them would probably have to be rentals to make any sense unless your local company is the only option and very high priced.
If the trench is open, drop in some larger conduit.
"Somewhat longer than you need" - just coil the excess neatly, and enjoy not coming up short, or not worrying about having to cut some off and re-terminate if you have a problem. It's called a "Moves, Adds and Changes" loop, and when you don't have one, you tend to regret it, eventually.
Comment: Unfortunately the trench is already inspected, approved, and filled so we've kinda got what we've got there unless we wanna do some serious shoveling.
Comment: I tend to agree with @Ecnerwal. Not sure what you had to contend with for the trench but a trencher is not an expensive rental. Fiber is the way to go in 2021 if you want a permanent connection. Copper will work but you wont get 10G speeds, and while 1G will work you're not today (near future) proof.


How to convert elements of string to list using a regex?

Question: In a code I'm trying to write, I want to convert a string which contains numbers to a list where each element is a number of that string.
I tried to use sub, a re function, but I don't have the result I want in a particular case.
x = "8 1 2 9 12"
liste= []
final = []

for s in x:
    liste.append(re.sub('\s+',"", s))
for element in liste:
    if element =="":
        liste.remove("")

for b in liste:
    if b != 'X':
        final += [int(b)]
    else:
        final+=["X"]

I expect the output of [8,1,2,9,12], but the actual output is [8,1,2,9,1,2].
Comment: `[int(elem) for elem in x.split()]` - single line
Answer: You can do it very easily using split and conversion.
The necessary condition to use this approach is that the string should only contain digits and whitespaces and no other character should present.
>>> li = "8 1 2 9 12"
>>> result = [int(i) for i in li.split(' ')]
>>> print(result)
[8, 1, 2, 9, 12]

Now, moving on to your implementation, inside the first for loop, for s in x:, it iterates over the string. Hence, s takes following values :
>>> for s in x:
...     print(s)
...
8

1

2

9

1
2

This results in creation of 6 integer values, which are actually 5, when the string is manually inspected. This is the main reason, why you are not getting the expected outcome.
If the string would have been something like x = "12345", it would have returned, [1,2,3,4,5], which is wrong.
Comment: Only digits and whitespace, not only digits. ;)
Answer: you only need to use split method if there are only whitespaces and digits
x = "8 1 2 9 12"
print([int(i) for i in x.split()])

output:
[8, 1, 2, 9, 12]

Answer: The previous answer is the best practice for you, but I also suggest another way for your consider to use: Regular Expression
>>>import re
>>>x = "8 1 2 9 12"
>>>list(map(int, re.findall(r'\d+', x)))
[8, 1, 2, 9, 12]


Upgrade from 10.10 to 13.10 without administrative privileges

Question: I have installed ubuntu 10.10 alongside windows 7. But now I don't have administrator privileges in windows to delete ubuntu 10.10.
So Ultimately I want to overwrite 10.10 installation with 13.10. I also tried installing 13.10 when 10.10 was already installed, but the process freezes. Any help is appreciated.
Answer: It sounds like you installed 10.10 via wubi, which is no longer supported.  To properly remove it from Windows you will simply have to get administrative privileges.  If you want to install 14.04 ( 13.10 is about to reach end of life, so don't bother ), then you can boot from the cd and install it along side windows, which will shrink the windows partition to make room for Ubuntu.
Comment: Thank you for the prompt response. Yes I used wubi to install it. So there is no way I can uninstall/overwrite10.10 without having administrative priviliges in windows? Can/t I do anything from the ubuntu mode itself to uninstall or something like that?
Comment: @user274642, you could delete the root.disk file from the windows partition, but that won't clean up the windows registry entries and such that show Ubuntu as being an installed program.
Comment: sorry, one more question.if I delete the root.disk file from windows, then can I delete the Ubuntu 10.10 partition (proper uninstall) when I have administrative access?
Comment: @user274642, you have no 10.10 partition.  Since you installed via wubi, it exists only in the root.disk file.


How to Install Linux Bootloader to root

Question: I want to install Ubuntu 11.10 but its bootloader should be installed to linux root and not to MBR because i want Windows 7, Mac OSX Lion and Ubuntu 11.10 with Chameleon Bootloader as default Loader.
Comment: In the installation wizard chose advanced mode , in that mode you can see the option for where the grub is to be installed ,chose your linux partion and press next
Comment: http://www.osx86.net/guides-tutorials/10747-guide-chameleon-bootloader-basics.html
Answer: Tachyons answered this in a comment:

In the installation wizard chose advanced mode , in that mode you can
  see the option for where the grub is to be installed ,chose your linux
  partion and press next

How to Install Linux Bootloader to root


SetTag() in a CalendarEvent results in an "Action not allowed" Error

Question: When trying to set a tag for the first CalendarEvent in the "events" array I get an "Action not Allowed" error.  Other attributes of CalendarEvent, including getStartTime(), getTag(), setLocation(), etc. are perfectly functional.
I am the owner of this calendar event too, so I do not understand why I cannot tag the event.  I've tried on different events as well, including both those that I own and those I do not own, but none allow me to set a tag.
 function myFunction() {
   var myCal = CalendarApp.getDefaultCalendar();
   var now = new Date();
   var events = myCal.getEvents(new Date(now.valueOf() - 14*24*3600*1000), new Date(now.valueOf() + 14*24*3600*1000))

  var temp = events[0];
  temp.setTag('key', 'pair')
}

Comment: After further investigation it appears I only get this issue with my main default calendar and not with other user created calendars.  My default calendar is a corporate managed Google account, so my issue may have something to do with this?
Comment: you are missing a ";" at the end of your `events` line. Have you corrected that in your original code?
Comment: Although, I tested your exact function thoroughly and just added the line `Logger.log(temp.getTag('key'));` at the end of the code and everything seems to be working fine for me.
Comment: The semicolon was not the issue.  I attempted to upload a snapshot but was unable to.

The code fails at  'setTag()' and so the tag is never set for me to check if it was set.  My problem seems to only be with my default corporate calendar, so I believe now this may have to do with some security setting.  The exact same code with a different calendar does not throw this error message.
Comment: @nsp13 did you ever find out how to fix that? I'm experiencing the same issue with my corporate calendar (and not a private account).
Answer: I was running in to the same issue.
The root cause seems to be that you can only set a tag on a calendarApp event if you are the creator of the of the event. Right now, the calendar add-on I'm testing is using OAuth scopes that are within the context of my user. Maybe there's a way to user the context of say a workspace admin, but not sure, I'm new to using Google APIs.
To reproduce:

Create your own Google Calendar event.
Have someone else create a Google Calendar event and invite you to it.
Run setTag('foo', 'bar') on your event, it should (?) work
Run setTag('foo', 'bar') on the other person's event, it should (?) fail

I'm using Google Apps Script for a CalendarApp Add-on, and at least with that, I think you'll also need the following OAuth scope: https://www.googleapis.com/auth/calendar"
Here's a quick example:
run_tests();

function run_tests() {
  test_setTag('email@example.com', 'event-id-that-you-created');
  test_setTag('firstname.lastname@example.com', 'event-id-that-other-person-created');
}

function test_setTag(calendarId, eventId) {
  var event = CalendarApp.getCalendarById(calendarId).getEventById(eventId);
  event.setTag('foo', 'bar');
}

Edit - more complete answer:
Updated understanding.
CalendarApp is a high-level abstraction over the low-level Calendar API. While easier to use, CalendarApp does not expose the full functionality of the low-level API.
Events within the Calendar API have extendedProperties, which are just optional metadata that users and apps can use to extend functionality. There are both shared and private properties within extendedProperties, and behave as follows:

shared = a single value is shared between any users invited to the event. Invited users can read these values (with proper OAuth scope) but only the event creator may modify them.

private = each user invited to an event can create and maintain their own, separate private properties. Other users cannot read or write these values.

The problem I experienced (and maybe you, too?) was that CalendarApp "tags" are an abstraction for shared extendedProperties...i.e. you cannot call setTag on an event where you are not the creator or owner.
By using the low-level Calendar API, I was able to successfully set private properties on an event I did not own but (as expected) trying to set a shared property failed (with a much clearer error code than CalendarApp, by the way).
  const calendarId = 'your-calendar-id';
  const eventId = 'an-event-someone-else-made';

  var currentProperties = Calendar.Events.get(calendarId, eventId).extendedProperties || {};
  console.log('Properties before patch: ', JSON.stringify(currentProperties, null, 2));

  var schemaOfPatch = {
    extendedProperties: {
      private: {
        foo: 'bar'
      }
    }
  };
  Calendar.Events.patch(schemaOfPatch, calendarId, eventId);

  var patchedProperties = Calendar.Events.get(calendarId, eventId).extendedProperties || {};
  console.log(`Properties after patch: ${patchedProperties}`);

  // The null will remove the private property 'foo'
  var schemaOfPatch = {
    extendedProperties: {
      private: {
        foo: null
      }
    }
  };
  Calendar.Events.patch(schemaOfPatch, calendarId, eventId);

Results of above:
successful patch of private property to someone else's event
If you change private to shared, you will see this error:
patch fails if made against shared property on event you do not own


Rails 3 - request.request_uri in model

Question: exist any way to have in my own function in model the request.request_uri?
Now I have in model called Func.rb this:
<code>class Func
   def self.url_adr
     request.request_uri
   end
end
</code>
But I am getting an error undefined local variable or method `request' for Func:Class
Comment: you are trying to violate MVC: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
Comment: Please let me know what really want to do, and maybe we find a solution without harming the MCV model of Rails.
Answer: The request object is available from controllers.  I suppose you could pass it in as an argument to a model if you must, e.g.
<code>##### in controller
Func.url_addr(request)

##### in model
def self.url_adr(controller_request)
  controller_request.request_uri
end
</code>
However, Ian has a good point, request data is not usually associated with models.

Rails 3 - request.request_uri in model


Transmission torrent client very inconsistent speeds

Question: I have inconsistent download speed using the transmission bit torrent client.
The speed will vary greatly between 400kb and 1kb per second (My internet is crap 400kb is a acceptable maximum). I also noticed that even though hundreds of peers are available Transmission will only connect to about 20 at any time (I have set the connection limit to 200 per torrent and 500 max).
I hope someone know a fix.
Comment: I don't think that this is error of Transmission. Torrents will always be downloaded at various speeds if there isn't thousands of peers or you don't have your own public IP with ports open. I gues you have a DSL or ADSL connection, and this are very unstable in speeds.
Comment: I would try to reduce the upload speed, 50k if upload max is 128k. Then set it to max when seeding.
Answer: It probably does not apply to your case, but a typical problem with torrent (and other p2p protocols) are routers, that cannot handle many simultaneous connections or that have issues if many connections are initiated in a short period of time. People often realize that they are affected by this issue, when they switch from Windows to some other operating system. The reason is that Windows has limits for simultaneous connections and new connections per second, and at least in earlier versions of Windows those were set to ridiculously low values per default, so people never realized that their router doesn't handle many simultaneous connections well.
A symptom of this is, that not only the p2p downloads are slow, but also other internet connections like web-browsing are affected and show very low speeds while p2p software is running.
In such a case, it actually increases the p2p-download speed, if one limits the number of connections in the p2p software. Some p2p programs even offer a limit on the number of new connections per second (actually I only know one: mldonkey). I'd suggest to start with low values for these settings and then to increase them until issues arise (and then go back a little bit - in order to have stable conditions).


Repairing water damage to ceiling drywall where ceiling meets wall

Question: I have a question for how best to repair interior water damage to ceiling drywall along a wide, thin section where the ceiling meets the wall.
We recently experienced slight water damage to our ceiling drywall due to water that entered through gaps that in the exterior roof flashing. Now that the roof flashing has been re-sealed by a professional, I would like to address the drywall water damage in my condo.
The water damage is limited to a 10 ft. x 4 in. section of the ceiling where the ceiling meets a wall in the bedroom - very long and skinny. I am thinking about two options:
1) Scrape off damaged sections and then spackle, sand, prime, and paint
OR
2) Cut out the damaged section (perhaps 10 ft by 6 in) and then look to replace with new drywall. Given the section is a) long and skinny and b) adjoining a wall, I am curious if there are any other considerations that I should be thinking about.
As you can (barely) see in the photo, a small crack has developed due to the water damage, so I'm not sure whether option 1 is realistic.
Thank you for the help
Comment: I would remove the section completely and install new drywall. Reason being is to be safe from potential mold. You may not see the areas internally that have moisture.
Answer: You'll want to remove a section for repair and inspection. Keep in mind, the hard part of wall finishing is the plastering. Also the worst part of the water damage is going to be in the least visible area, in behind the wall. Cut out a section of the damaged wall large enough to inspect behind. Mold is a concern but once it's dry it tends to die. Anti mold spray is available for exactly this purpose.
Mold spraywww.homedepot.com
Comment: You can also get spray can texture to do small patch texture repairs. Do this after you replace the section, joint compound and feather the new patch. Then texture and paint.
Answer: The crack you see is the drywall tape delaminating from the corner. You can peel this off and put a new piece on. If the drywall is not deformed you can re texture when it is dried out. As long as there is no more water intrusion there will be no mold growth issues. Use mold spray and prime with stain blocking or sealing primer or spray shellac based primer and paint.
Comment: I looked closer and is appears it is stained further than the bead strip goes.


Using Turtle in python, how could one make an amount of shapes be drawn based off of user input?

Question: In Python using Turtle, how could i have a specific amount of shapes print based off of user input? So if i wanted 8 circles to be drawn from input how could i get the code to do that?
Comment: Do you know how to draw a single shape?  What exactly is the problem you are having?
Comment: Wecome to StackExchange. Your question is not quite clear. Do you mean you want to input a positive integer from the user then show that many circles? Or do you mean you want the user to choose the kind of shape? Or something else?
Comment: Yeah i can draw single shapes, the problem i am having is a program that draws a certain amount of shapes using user input to determine the size of the shapes and the amount of shapes being outputted.
Comment: https://stackoverflow.com/help/how-to-ask
Answer: How about something like this?  It will draw a line of circles based on a user entered radius and count.
<code>import turtle

# get the user input
size = float(input('Enter a size for your shape: ')) # radius of circle
number = int(input('Enter a number:')) # number of shapes to draw

for i in range(number):
    # draw a circle
    turtle.circle(size)

    # move over so they dont overlap
    turtle.penup()
    turtle.fd(size*2)
    turtle.pendown()
</code>


How to completely uninstall gnome-shell and all extensions?

Question: I'm having a bit of trouble getting gnome-shell to work ever since I installed an extension (I don't know which) on 11.10. So what I would like to know is: How can I completely uninstall EVERYTHING gnome-shell related (all the extensions, gnome-tweak-tool, etc.), everything - so I can start fresh and re-install 'em all one by one?
Thanks in advance.
EDIT: After a long and hard search (for me anyway) I found it:
sudo apt-get remove gnome-shell-extensions-*

Answer: This command will perform the uninstallation:
sudo apt-get purge gnome-shell-*

Answer: Run this command in a terminal window:
sudo apt-get remove `apt-cache depends gnome-core|cut -f 2 -d :|xargs`

Answer: This command will remove the gnome-shell package and any other dependent packages which are no longer needed:
sudo apt-get remove --auto-remove gnome-shell

This command will remove just the gnome-shell package:
sudo apt-get remove gnome-shell


Laying used laminate floating floor

Question: We had a water leak in our basement. We removed the laminate floating planks. We have let them dry out for weeks while we redid the walls. We are now beginning to relay the flooring. It isn't going as well as the videos show laying a new floor. We are having to cut the lip on the ends a little so the planks will fit back together. Is there something we are doing wrong? Is there a video anywhere to watch? Will cutting the lip a little hurt in the long run? We are laying the floor on the concrete and only use the room for storage at the moment but still want it to look nice. Thanks you
Comment: Can you add a picture of the planks and the lip you are referring to?
Answer: The fact that the laminate was soaked with water caused it to swell. Drying it won't allow it to contract completely. Add to that the flooring was laid on concrete. Was there a vapor barrier between the concrete and the laminate? If not then the flooring had been drawing moisture from the concrete for a long time before the water leak. You are lucky you were able to disassemble the flooring without destroying it. As for trimming the lip. This will help reassembly. However, it probably won't hold together as well. My suggestion would be to scrap replacing the laminate and go purchase some LVT (Luxury Vinyl Tile, also known as LVF, Luxury Vinyl Flooring). It's more durable over time and also water proof. Hope this helps.

Laying used laminate floating floor


"Install this third-party software" - safe for my system or questionable?

Question: I am installing Ubuntu atm and it asks me if I want to "Install this third-party software."
I assume it is safe to check this box and allow it to do this, but before I blindly do so I thought I'd ask. I searched google, and surprisingly nothing came up.
Answer: That is up to you and whether you trust the developers of the third-party software. It simply letting you know that it is third-party software. It is not saying it is safe to install it, nor that it is unsafe to install it.
I would be surprised if there were any issues with it at all, but I'm certainly not going to guarantee that.
Answer: The third party software checkbox during the Ubuntu installation proceedure is used to add in some proprietary drivers and software, all files included in valid ubuntu installation discs are safe, just make sure you download Ubuntu from trusted sources. It's good that you asked though, that's a great way to approach any software installation.
Answer: When you add a PPA repository you have to do it with add-ppa-repository "ppa name" command, example:
sudo add-apt-repository ppa:pidgin-developers/ppa

If you already added it and see a message indicating a missing key number you can run:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com "key"

Comment: the enquirer is asking what the effect of selecting the "Install this third-party software" is (the checkbox you can select at the start of a Ubuntu installation). This has nothing to do with adding repositories.


Shortest paths in the Hypercube

Question: We'll ask for lengths of shortest paths in the hypercube which obey dimensional constraints.
Given $n\in\mathbb N$, the hypercube or n-cube is the $n$-fold product of the unit interval (so it's not the Hilbert cube!). It is thus the set
$$F_{n,n}\:=\:\left\{\sum\nolimits^n_{i=1}\beta_ie_i\:\Big\vert\:
\beta_i\in \big[0\,,1\big]\right\}$$
where $\,(e_i)_{1\le i\le n}\,$ denotes the standard ONB of $\mathbb R^n$, equipped with the Euclidean distance. For $1\leqslant d\leqslant n\,$ the union of $\,d$-dimensional faces of the $n$-cube is defined as
$$F_{n,d}:=\left\{\sum\nolimits^n_{i=1}\beta_ie_i\:\Big\vert
\text{ where $d$ coefficients }\beta_i\in \big[0\,,1\big],\text{ the remaining ones live in }\{0,1\}\right\},\\[2.5ex]
\text{then } F_{n,1}\:\subsetneq\:F_{n,2}\:\subsetneq\:\ldots\:\subsetneq\: \,F_{n,n}\,.$$

What is the length $\,s(n,d)\,$ of a shortest path between the corner at the origin and the opposite corner at $\,(1,1,\ldots,1)\,$ when the path is constrained to lie in $F_{n,d}\,$?

For $\,F_{n,1}$, thus edges only, and $\,F_{n,n}$, allowing for the straight line, the question is quickly answered by $\,s(n,1)=n\,$ and $\,s(n,n)=\sqrt n\,$:
\begin{matrix}{\begin{matrix}&d\\n&\end{matrix}}&1&2&3&4&\ldots\\
1&1\\
2&2&\sqrt 2\\
3&3&\sqrt 5&\sqrt 3\\
4&4&?&??&2\\
\vdots&&&&&\ddots\end{matrix}
The less obvious entry $\,s(3,2)=\sqrt 5\,$ is furnished by
this eye-catching answer
to the post "What is the geodesic between two opposite corners of a cube on its surface? [closed]". But what about all the rest?
How can the decreasing (certainly!) sequence
$$\,s(n,1),\;s(n,2),\;\ldots,\;s(n,n-1),\;s(n,n)$$
be determined? I didn't find references, neither @SE  nor in the residual internet. Furthermore I'm not sure about the appropriate tagging of the post, but omitting graph-theory was intended.
Answer: The following is a generalization of the "visual proof" referred to in the question.
If $p_i\geq0$ $(1\leq i\leq d)$ and $\sum_{i=1}^d p_i=n$ then $$\ell({\bf p}):=\sqrt{\sum_{i=1}^d p_i^2}$$ is minimal when all $p_i$ are equal. When the $p_i$ are forced to be integers then we should make them as equal as possible. To this end assume
$$n= q d+r, \qquad q\geq1,\quad 0\leq r<d$$
and put
$$p_i:=\left\{\eqalign{&q+1\qquad(1\leq i\leq r)\cr &q\quad\qquad(r+1\leq i\leq d)\ .\cr}\right.$$
I claim that
$$s_{n,d}=\ell({\bf p})=\sqrt{dq^2+r(2q+1)}\ .$$
I shall only prove that $s_{n,d}\leq\ell({\bf p})$. Nevertheless I can't see how one could do better.
In the ${\bf y}$-space ${\mathbb R}^d$ we consider a virtual box $$V:=[0,p_1]\times[0,p_2]\times\cdots\times[0,p_d]\subset{\mathbb R}^d\ .$$ This box is built up from  $d$-dimensional unit cubes, called chambers. The main diagonal $\sigma$ of this box connects ${\bf 0}$ with ${\bf p}=(p_1,\ldots ,p_d)$ and has length $\ell({\bf p})$. This diagonal passes a certain number of chambers in turn. We now interpret these chambers as $d$-dimensional faces of the original cube $C:=[0,1]^n\subset{\mathbb R}^n$, so that $\sigma$ can be viewed as an unfolding of an admissible path from ${\bf 0}$ to ${\bf 1}$ in $C$.
The intended "backfolding" of $\sigma$ is accomplished as follows: Assign each interval $[k-1,k]$ $(1\leq k\leq p_1)$ on the $y_1$-axis the number $k$, then assign each such interval on the $y_2$-axis one of the  next $p_2$ numbers, and so on along the other $y_i$-axes, until all numbers from $1$ to $n$ have so been distributed. We now identify each interval $0\leq x_k\leq 1$ on one of the axes of ${\mathbb R}^n$ with the corresponding $y_i$-interval on the proper axis of ${\mathbb R}^d$.
By projection onto the $y_i$-axes each piece $\Delta \sigma\subset \sigma$ lying in some chamber gets therewith  assigned $d$ different numbers from $[n]$, and these numbers indicate which coordinates $x_k$ shall be "active" along $\Delta \sigma$, in other words: on which $d$-dimensional face of $C$ the "backfolded" piece  $\Delta \sigma$ shall lie. It follows that $\sigma$ "backfolds" isometrically to an admissible path of length $\ell({\bf p})$ in $[0,1]^n$.
Comment: This approach is best possible, because your "backfolding" process can be inverted into an "unfolding" process. When a coordinate of the witnessing path of $s_{n,d}$ becomes 1, it changes the active face. This coordinate is exchanged for another coordinate that starts with 0. So it is wandering from chamber to chamber, which are the cubes in the lattice $\mathbb{Z}^d$. As exactly $n$ coordinates become 1 in total, we get a path from $(0,...,0)$ to some $(p_1,...,p_d)$ with $\sum p_i=n$ of same length. The shortest such path is the one you describe.

Shortest paths in the Hypercube


How to group the delivery slots in the checkout?

Question: I'm working on the online grocery shop, flexible delivery option is one of its key strengths. This interaction happens as the step of the checkout process.
I'm thinking of 2 options.
A. The buttons are aligned similar to the calendar view in Outlook, the size of the button represent the length of the timeslot. Each button has the time and the delivery price.
B. The price and short description are placed as subheaders on top of the buttons. The buttons show only the timeslot and have the similar size.

Which would you choose and why?
Comment: Interesting question. I'll see if I have more time later for a full answer, but one or two thoughts so far. On first glance, A looks worse on the eye and B seems better structured. But when you actually read it, A is better in terms of visualization and quick understanding, rather than having to read all entries. Maybe a solution C in-between is possible, which takes organization from B but visual differentiation from A?
Comment: Considering Monday on option A: is it a valid example case that the 11:00-13:00 2-hour timeslot would be N/A while the 2 smaller timeslots for the same time are available? If not, there might be avenues to collapse all the options into a single column, and display the price/slot size relationship in an other way.
Answer: First of all, the two options you suggest don't offer the exact same information: with option A it is not clear that the prices are controlled exclusively by the length of the delivery slot. For example, one could reasonably assume that the pricing is based on the demand for the particular slot, which would also explain why each slot has its own price displayed on it. Even if that conclusion were obvious (which is debatable), having to look at each individual time slot to figure this out is tedious.
However, otherwise I much prefer option A, because it uses a consistent vertical axis for the passage of time - a paradigm already familiar to users from most calendar applications. Timeslots starting at the same time of day start at the same height visually, and 2-hour timeslots are twice as tall as 1-hour timeslots (and you can tell at a glance which 2 smaller timeslots it corresponds to).
Option B, on the other hand, has basically no information encoded in the layout, except for the separation of the days. You cannot compare the timeslots between days by looking at their vertical position, nor is it easy to tell at a glance how long the timeslots are (you have to read and interpret the numbers, ew).
To summarize, I would go with a modified version of option A, where you move the delivery slot pricing to the column headers.
Comment: BTW, the irony of posting a text-only answer in which I complain about forcing users to *read and interpret* things is not lost on me - if someone were to edit in some illustrations (which I can't do now), I think it would greatly benefit this answer.
Comment: That's a good point regarding the availability of the slots. The price fluctuations based on the availability can happen.
Comment: @AntonT, in that case, how does your option B allow for displaying such fluctuations? It states quite clearly that every 1 hour delivery slot is 6,95 €.
Comment: You are absolutely right, my intention was to make this example less complex.
Answer: A blend between option A and B works.
The pricings can  just act as the subheaders for the time column. The visual representation using the different rectangles to give the calender is very nice and A can be tweaked further.
Answer: On comparing A and B, I would choose option 'B' because of the better arrangement, good structure and concrete details.
As much as I want the interface to be interactive, I also want it to be simple, detailed, and easy/quick to grasp.
Comment: I agree, the first one lacks column or row headings so it almost seems random until you figure out the column/price grouping yourself. Though to be honest now that I think about the "1-hour" vs "2-hour" delivery slots header makes me think of the time it will take to get to me like "2-day shipping" phrasing.


Separating Service Logic from Data

Question: I have been looking over a couple of classes I have in an android project, and I realized that I have been mixing logic with data. Having realized how bad this can be to the readability and the test-ability of my project, I decided to do some refactoring in order to abstract away all services logic to separate services modules. However, since I have been relying on Java's polymorphism, I got lost and need some guidance.
Suppose I have this "to-be-changed" layout for a super data class, and two sub-classes:
public class DataItem {
    /* some variables */

    public saveToDB(/* Some Arguments */) {
        /* do some stuff */
    }

    public render() {
        /* render the class */
    }
}

public class ChildDataItemA extends DataItem {
    @Override
    public saveToDB(/* Some Arguments */) {
        super.saveToDB();
        /* more specific logic to ChildDataItemA */
    }

    @Override
    public render() {
        /* render logic for ChildDataItemA */
    }
}

public class ChildDataItemB extends DataItem {
    @Override
    public saveToDB(/* Some Arguments */) {
        super.saveToDB();
        /* more specific logic to ChildDataItemB */
    }

    @Override
    public render() {
        /* render logic for ChildDataItemB */
    }
}

Now, I thought about moving the saveToDB() and render() methods to a service class. However, sometimes I need to be able to call these method into instance of compiled type DataItem without knowing its runtime type. For instance, I might want to make the following call:
List<DataItem> dataList;
for (DataItem item: dataList) {
    item.saveToDB();
    item.render();
}

Additionally, I thought of doing the following:
public class ChildDataItemB extends DataItem {
    @Override
    public saveToDB(/* Some Arguments */) {
        super.saveToDB();
        /* more specific logic to ChildDataItemB */
         Service.saveToDBB();
    }

    @Override
    public render() {
        /* render logic for ChildDataItemB */
        Service.renderB();
    }
}

Where I still keep 'dummy' methods in each subclass that would call an appropriate service method. However, I do not think that this really achieves the separation I want since data classes will still know about services (bad!).
Any ideas on how to solve this?
Edit: Note that render() and saveToDB() are just generic examples of what these methods can be, so the problem is not really about choosing an ORM or SQL related techniques.
Comment: Looks like a case for the [Repository pattern](http://martinfowler.com/eaaCatalog/repository.html). As others have said, I'd remove the saveToDB method from the DataItem.
Comment: I don't know, to me it seems like you simultaneously want the logic to save items to the DB to be available at the model layer, except you also don't want it available there. These are contradictions, you have to pick one, or separate your concerns further: find an acceptable subset of what the service does when saving items that you'll expose to them using some sort of interface.
Answer: Visitor pattern to the rescue. Create a visitor interface and have each service implement this interface:
public interface DataItemVisitor {
  // one method for each subtype you want to handle
  void process(ChildDataItemA item);
  void process(ChildDataItemB item);
}

public class PersistenceService implements DataItemVisitor { ... }
public class RenderService implements DataItemVisitor { ... }

Then have each DataItem implement an accept method:
public abstract class DataItem {
  public abstract void accept(DataItemVisitor visitor);
}

public class ChildDataItemA extends DataItem {
  @Override
  public void accept(DataItemVisitor visitor) {
    visitor.process(this);
  }
}

public class ChildDataItemB extends DataItem {
  @Override
  public void accept(DataItemVisitor visitor) {
    visitor.process(this);
  }
}

Note that all accept implementations look the same but this refers to the correct type in each subclass. Now you can add new services without having to change the DataItem classes.
Comment: -1: The original question was: "Separating Service Logic from Data".

In your solution, both the PersistenceService and the RenderService Logic are tightly coupled to the Data classes. Even so far that when you add a new Data class, you need to add new methods to the services to handle with them.
Comment: @greyfairer: It is up to the OP to decide which solution suits him best. Please reserve downvotes for incorrect/misleading answers, and not because you don't like an answer.
Comment: @greyfairer: As for your argument on coupling, it isn't necessarily bad for services to be coupled to entities, as long as the entities themselves aren't aware of the services.
Comment: I was avoiding the visitor pattern, but I am going to mark this as the answer.
Answer: So you want to do:
List<DataItem> dataList;
for (DataItem item: dataList) {
    service.saveToDB(item);
    service.render(item);
}

For this you need to setup a system for your service to know more details from your DataItem subclass.
ORM's and serializers usually solve this via a metadata system, e.g. by finding an xml file with name matching the subclass, containing the properties to save or serialize.
ChildDataItemA.xml
<metaData>
   <column name="..." property="..."/>
</metaData>

You could get the same result via reflection and annotations.
In your case, an application of the Bridge pattern could also work:
class DataItem {
    public describeTo(MetaData metaData){
       ...
    }
}

class Service {
   public void saveToDB(DataItem item) {
      MetaData metaData = new MetaData();
      item.describeTo(metaData);
      ...
   }
}

Your metadata could be decoupled from saving or rendering, so you can the same for both.
Answer: I would clean the "data" classes of render and saveToDB methods.
Instead, I would create a hierarchy of wrappers for DataItem (it does not have to mimic exactly the DataItem hierarchy). These wrappers will be the ones implementing those methods.
Additionally, I suggest that (if you can), you move to some ORM (Object-Relational Mapping) like Hibernate or JPA to get rid of the saveToDB method.
Comment: The `saveToDB()` is just an example, it is not what I have (I have different other method that do other things). Additionally, this is an android project, so all the db saving is done via ContentProvidors (no direct SQL).
Answer: First of all the DataItem class should be clean, only with getters and setter and no logic at all, just like a POJO. moreover- your DataItem maybe should be abstract.
Now- for the logic, like others suggested I would use some ORM framework for the saveToDB part, but you said that it's not helping you cause it's android project and you have other methods like this as well.
So what I would do is to create an interface- IDataItemDAO, with the following logic:
public interface IDataItemDAO<T extends DataItem > {
    public void saveToDB(T data, /* Some Arguments */);
    ... other methods that you need ...
}

I would create an abstract DAO for the DataItem and put it all the similar code of all DataItems:
public abstract class ChildDataItemADAO impelemets IDataItemDAO<DataItem> {
    @Override
    public void saveToDB(DataItem data, /* Some Arguments */); {
        ...
    }
}

than I would create a DAO for each DataItem class that you have:
public class ChildDataItemADAO extends DataItemDAO impelemets IDataItemDAO<ChildDataItemA> {
    @Override
    public void saveToDB(ChildDataItemA data, /* Some Arguments */); {
        super(data, ...);
        //other specific saving
    }
}

the other part is how to use the correct DAO for the correct instance, for this I would create a class that will bring me the correct DAO for the given instance, it is a very simple method if an if-else statements (or you can do it dynamically with a map of class and the DAO)
public DataItemDAO getDao(DataItem item) {
    if (item instanceof ChildDataItemA) {
        //save the instance ofcourse
        return new ChildDataItemADAO();
    }
}

so you should use it like this:
List<DataItem> dataList;
for (DataItem item: dataList) {
    factory.getDao(item).saveToDB(item);
}

Comment: I guess I wanted to a clean idea to seperate the services from data, while keeping polymorphism, in order to avoid using instanceof in the first place. I have talked to many engineers, and they suggest that anyplace where instanceof is being used represents a weakness in the design, ans should not be there at all.
Comment: There is something about what they saying. like I said- you can also get this mapping with a map of class and the DAO instance, and get the right instance by item.class
Answer: If you want separate logic from data you may try the following approach
Create your data class DataItem,ChildDataItemA, ChildDataItemB without the method operating on the data
Create an interface for some operations on you data class something like
public interface OperationGroup1OnDataItem {
        public void saveToDB(DataItem dataItem/*plus other params*/) {

        }
        public void render(DataItem dataItem/*plus other params*/) {

        }
        ......
}

Create a factory for implementing an OperationGroup provider
public class OperationFactoryProvider {
    public static OperationGroup1OnDataItem getOperationGroup1For(Class class) {
    ....
    }
}

Use it in you code:
List<DataItem> dataList;
for (DataItem item: dataList) {
    OperationGroup1OnDataItem  provider OperationFactoryProvider.getOperationGroup1For(item.class);
    provider.saveToDB(item);
    provider.render(item);
}

You can choose to implement the factory with a simple static map where you put the class (or the class fullName) as the key and an Object implementing the interface as the value; something like
 Map<String,OperationGroup1OnDataItem> factoryMap= new HashMap<String,OperationGroup1OnDataItem>();
 factoryMap.put(DataItem.class.getName(),new SomeClassThatImplementsOperationGroup1OnDataItemForDataItem());
 factoryMap.put(ChildDataItemA.class.getName(),new SomeClassThatImplementsOperationGroup1OnDataItemForChildDataItemA());

The implementation of the getOperationGroup1For is:
return factoryMap.get(item.getClass().getName());

This is one example of separating logic from data, if you want separate logic from data your logic methods must be extracted from your data class; otherwise there is no separation. So I think every solution must start from removing logic methods.

Separating Service Logic from Data


create ajax contact form.

Question: i created an ajax contact form, it has a problem with responseText. when i click the submit button to send data. instead to show the response text, it show like this.
<!DOCTYPE html>   <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width"> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="http://localhost/pomtech/jami/xmlrpc.php">   <title>Page not found – jami university</title> <link rel='dns-prefetch' href='//fonts.googleapis.com' /> ...
Ajax codes.
here is some jQuery code that i used to get form data.
   jQuery(document).ready(function(){
   var form =jQuery('#ajax-contact');
  var formMessages= jQuery('#form_messages');
  jQuery(form).submit(function(event){
  event.preventDefault();

 var formData=jQuery(form).serialize();
 jQuery.ajax({
   type: 'POST',
   ulr: jQuery(form).attr('action'),
   data: formData
 }).done(function(response){

    // make sure message is success
    jQuery(formMessages).removeClass('error');
    jQuery(formMessages).addClass('success');

    //set message text
    jQuery(formMessages).text(response);

    // clear form fields
    jQuery('#name').val('');
    jQuery('#email').val('');
    jQuery('#message').val('');
 }).fail(function(data){
       // make sure message is error
    jQuery(formMessages).removeClass('success');
    jQuery(formMessages).addClass('error');

    // set message text
    if(data.responseText !== ''){
        jQuery(formMessages).text(data.responseText);
    }
    else{
        jQuery(formMessages).text('an error has been occured');
    }
 });  });  });

HTML codes

<form id="ajax-contact" method="post" action="mailer.php">

    Name:
    <input type="text" name="name" id="name" required="required">

   Email:
   <input type="email" name="email" id="email" required="required">

  Message:
  <textarea id="message" name="message" required="required">

  </textarea>

<input type="hidden" name="recipient" value="'.$recipient.'">
<input type="hidden" name="subject" value="'.$subject.'">

  <input type="submit" name="contact_submit" value="Send" >

</form>

mailer.php
<?php echo "Hello world"; ?>

there is no need for more details but stackoverflow did not premit me to post my question with less information. so these context are belong to my question
Answer: Change 'ulr' to 'url' in AJAX Call.
jQuery.ajax({
   type: 'POST',
   url: jQuery(form).attr('action'),
   data: formData
})

Comment: but still i have such problem.
Comment: Then you might not have `mailer.php` file or it's location is different.

create ajax contact form.


Deja Backup to Amazon S3 text-only possible?

Question: I have an old laptop which a defect graphics card so that I can run only ubuntu text only. Is it possible to run deja backup from command line to backup to Amazons S3?
Thanks a lot
Answer: Deja Dup is a slick front end to the Duplicity tool, so you can just use duplicity on a console system in this manner.
You can find the information for the flags to use S3 in the man page.
ECII found a blog explaining the whole procedure and setup in order to do S3 backups on text-only Ubuntu

http://blog.damontimm.com/bash-script-incremental-encrypted-backups-duplicity-amazon-s3/
http://blog.damontimm.com/how-to-automated-secure-encrypted-incremental-backups-amazon-s3-duplicity-os-x-or-ubuntu/


What's wrong with the polyurethane on this hardwood floor refinishing job?

Question: This is basically what I've done so far:

I sanded the floor down to 120 grit with a drum sander (did a pretty good, time consuming job)
Put 1 coat of polyurethane down - these problem-spots soaked it up completely
Put a second coat of poly down and this is the result

these problems start/stop at the edges of the boards - it seems specific to the wood

Elsewhere the floor looks really good.  I can certainly sand & put a third coat down, but the fact that the finish looks like it is either cracking or not adhering to the floor has me concerned.
What could the trouble be, and what options do I have?
Update: A friend who does contracting work suspects the wood for this floor is odd-pieces and left overs; definitely possible from what I know of previous owners.  The current thought is that some pieces were pre-finished with something that didn't accept my poly.
Comment: Is the polyurethane water based, or oil based?
Comment: It's oil based.
Comment: How long ago was the wood flooring installed?
Comment: The answer posted by @TDHofstetter is probably correct then (I wasn't aware water-based polyurethane would do the same thing as oil-based if you didn't let it fully dry). Temperature, humidity, and the depth that it soaks in can drastically change the curing time.  Solution is still the same though - remove the crazed polyurethane, let it cure a couple more days, then sand and put another coat down.
Comment: Before putting down the first coat of poly how did you "prep" the floor?  Vacuum? Water? Solvent?
Comment: @treeNinja - We didn't do much to the hardwood, just sanded, vacuumed and wiped down with a microfiber mop moistened with.. mineral spirits.  In large amounts the mineral spirits could do that, right?  I don't think we used more than 2-4 tablespoons of spirits on the mop, but perhaps these boards sucked up enough of it.  We refinished a section of old pine flooring at the same time, with the same treatment, and that came out fine.
Comment: hmmm, in that case it sounds like James answer below is the route to take.
Answer: There is something...in those pieces of wood.  (Detailed enough for you?)
Ok, so I would have initially said temperature until you mentioned it was only specific pieces, which leads me to think moisture, but even that would cross pieces...
My best suggestion is sand those spots down, clean them with a solvent dampened rag, lacquer thinner maybe (don't pour it on) and then apply a wood treatment to the spots.  Then re-coat.
Edit:  To answer your question in the comments
Yes, should have mentioned that, you will need to sand before completing the steps I outlined.  If it isn't real wide spread I would just use scraper to get the big chunks off and then a fairly fine grit sandpaper and do it by hand.  If there is a lot I would go with a palm sander or belt sander.  You don't want anything that spins it will leave marks that will be visible in the final finish.
Comment: We have to sand back down to the wood, right?  What's the easiest way to do that?  Can I just scrape the poly off the trouble spots and sand down with a handheld orbital sander?
Comment: see my edit to the answer
Answer: That looks to my eye like a water-based polyurethane, and it looks like the first coat may not have fully dried before you shot on the second coat, then the floor temperature changed fairly radically (probably warming up) before the second coat was fully cured. The uncured first coat would have expanded with the warmth and tried to ooze out under the second coat. This would be more likely to happen in the most-porous areas than the less-porous areas, and indeed it doesn't seem to have happened on the quartersawn (with "flake" figure) areas but more in the plain-sawn (with "cathedral" figure) areas.
I'd try resanding just the affected areas, letting them stand untouched for about 24-36 hours, then reshooting them with a third coat.
Comment: We used oil based for both coats.  The temperature changed maybe 10 degrees between coats. The floor dried for three days between coats.
Comment: Wow, I'm surprised - I'd have SWORN... but no matter. You used the same poly for both coats? They were thinned the same? Did you by chance use a fast-evaporating thinner to get the second coat to shooting consistency? Stirred really well before thinning? I don't think I've ever seen oil-based poly blister like that on red oak. You're sure no contaminants (especially silicone!) got onto the surface between coats? Silicone's famous for that, I keep silicone out of my shop - maybe why I've never seen blistering.
Comment: Curiously, I've never seen water-based polyurethane do that, only oil based.  Granted, I rarely use water-based.
Comment: I shot some kitchen cabinets a couple years ago with WB poly - had one that did that when I got too impatient. I was VERY skeptical about WB when I started, but I'm really starting to like it now. Still gotta' wear the mask, though. Goes on a little more water-clear than OB poly does, no yellowing at all.
Answer: Looks like the raised grain on wood that has been wet. If it's water based poly, maybe related? I wouldn't know because I used water-based once and hated the appearance so much I never used it again.
I'll also offer that mixing and matching new and old wood is not forgiving as far as staining and top-coating. I would never undertake that myself since I have only done a couple floors, it takes a lot of experience to anticipate how difference species of different age and moisture content will respond to different products.
Dumb question but are you sure it's solid wood and not an engineered product with a veneer?


How to get tamed wolves to not attack other players?

Question: I am playing Minecraft with my friend. I like having tamed wolves, but it's so easy to accidentally have them go into murder-mode on my teammate. Is there any way to get them to never become hostile towards other players? Maybe some kind of server command?
Answer: Wolves will not attack other players if the player and the wolf owner are on the same team.
To create a team:
<code>/scoreboard teams add Friendly
</code>
To add players to it:
<code>/scoreboard teams join Friendly @a
</code>
Comment: 1.13 syntax: `/team add Friendly` and `/team join Friendly @a`
Comment: In 1.13.1 when I attempt to use the `/scoreboard` command only `players` and `objectives` are available there is no `teams` option.
Answer: Tamed wolves will never attack fellow players, unless your fellow players attack them first.
In short, tell your teammate to stop punching your dogs, and you'll be fine.
Comment: In a local lan game, one of the players (call him Fred) accidentally hit another player (call her Sally) with a pickaxe while mining. A while later, back at the house, Sally's dog starts attacking Fred. They didn't know what to do, so Sally ended up having to kill her own dog. Very sad :-(
Answer: This problem is common among players in multiplayer. To stop your wolf from killing your friend you have to kill your friend yourself ;) just kidding.
Your friend should sprint and run 50 blocks away from the wolf, or jump into lava/water (don't ever choose lava).
Note - never punch or hurt the wolf in reply during the activity.
Answer: I have had this problem before, and I even went onto the wiki. As far as I'm aware as long as your friend doesn't hit you around your tamed wolves they will be friendly around them. If they are in the sitting position as most people are aware they will stay where you left them and will not engage in combat against anything that attacks you as long as you are far enough away from the tamed wolf. Hope this helps.


How to do to the nth power in Javascript

Question: I have a function that I need to handle in Javascript:
equipment * ((rate/12) / ((1-(1+(rate/12))^-term)))

How do I convert it (^) into Javascript?
This is what it looks like so far:
const calculation = equipment * ((rate / 12) / ((1 - (1 + (rate / 12)) - term)));

Answer: JavaScript has an operator for it:

console.log(3 ** 5);
Comment: I guess I just don't understand how to do this within this function equipment * ((rate/12) / ((1-(1+(rate/12))^-term)))
Comment: @MaxT Do you mean `equipment * ((rate/12) / ((1-(1+(rate/12))**-term)))`?
Answer: Try using this:
let result = Math.pow(3, 5)
//or
let result = 3 ** 5

This is equivalent to 3^5


Unique ID for mysql

Question: I'm making a sign in/out program using mysql and visual basic and need a little help.
I have two tables event_in and event_out and under each table I have event_id, which automatically generates a number(starting from 1) for each row. I was wondering if it's possible to generate the numbers based on the users.
So let's say User A comes and signin, 1 is generated into the event_id. Then User B comes and signs in. I want 1 generated for him too...so all User A's event_id will be 1,2,3... and each user's event_id for both the in and out table will also be the same.
With this I will be able to subtract each user's timestamp in event_out from that of event_in to get how long they were in.
I believe that if I don't generate the numbers separately for each user, then let's say User A signs in (1 is generated for event_id in the event_in table) but does not sign out yet and then User B comes and signs in (he get 2 for the in) but then he signs out before User A does and he gets 1 for the out and user A gets 2 for the out. So now user and with my current query I will not be able to calculate the timestamp.
   SQL = "SELECT CONCAT(u.lastname, ', ', u.firstname) AS Name, g.group_name AS Class, " _
       & "DATE_FORMAT(i.timestamp_in,'%b %d %Y - %r') AS TimeIn, DATE_FORMAT           (o.timestamp_out,'%b %d %Y - %r') AS TimeOut " _
       & "FROM event_in i, event_out o, user u, groups g " _
       & "WHERE(i.user_bannerid = u.user_bannerid) " _
       & "AND o.user_bannerid = u.user_bannerid " _
       & "AND i.user_bannerid = o.user_bannerid " _
       & "AND i.event_id = o.event_id " _
       & "AND o.event_id = i.event_id " _
       & "AND i.group_id = o.group_id " _
       & "AND i.group_id = g.group_id " _
       & "AND o.group_id = g.group_id "

If you have any suggetion on how I can make it simple let me know, I just want to be able to calculate how long they were signed in.
Also is there a VB code that would prevent users from signing in, in, in...like if they sign in in they must sign out before they can sign in again.
Answer: Isn't that kind of a situation, where you need to map user to event?
I would suggest tables for events and users something like this
tblEvents:

tblUsers_UserId INT
EventId INT

then table for user would be like
tblUsers:

UserId INT PK AI
UserDesc VARCHAR()

Then you can actually map user to event and assign events for every user.
Comment: where all my computer scientists and geniuses at? anybody wanna help me out? :/

Unique ID for mysql