Widgets not visible or not filling all intended space

Question: I want to display 2 frames and one canvas such that:

The red frame must be on top of the window and spans over the canvas and the blue frame.
The blue frame and the canvas are on the bottom of the window. The canvas is on the right.

I am not getting the expected results. Here is my code:
from Tkinter import *
class Mine(Frame):
   def __init__(self,master):
       Frame.__init__(self,master)
       self.frameh()
       self.framev()
       self.thecanvas()
   # horizontal frame on top spanning over 2 columns
   def frameh(self):
       self.fh=Frame(root,width=400,height=40,bg="red")
       self.fh.grid(sticky=N,row=0,columnspan=2)
   # vertical frame on bottom
   def framev(self):
       self.fv=Frame(root,height=200,bg="blue")
       self.fv.grid(sticky=S+W,row=1,column=0)
   def thecanvas(self):
       self.c=Canvas(root,width=500,height=200,bg="black")
       self.c.grid(sticky=S+E,row=1,column=1)

if __name__=="__main__":
   root=Tk()
   root.wm_title("mine")
   m=Mine(root)
   root.mainloop()

Comment: @Nakkini I have edited your title (more precise) and your tags (removing the ones that have no the meaning you intended) (cf. my others comments)
Comment: What are the expected results, and what do you get instead? We can't run this without an appropriate image - is that necessary to replicate the issue?
Comment: the expected results are those highlighted using the black small balls. The image is just an icon, i will remove it from my question
Answer: I think you want to set columnspan=2 for frameh, so that it spans both the framev and thecanvas columns (plus extra sticky to make it fill the full width), and define a non-zero minimum width for framev:
...
def frameh(self):
    self.fh=Frame(root, width=400, height=40, bg="red")
    self.fh.grid(sticky=N+E+W, row=0, columnspan=2)

def framev(self):
    self.fv=Frame(root, height=200, width=100, bg="blue")
    self.fv.grid(sticky=S+W, row=1, column=0)
...

This gives me:
Comment: thank you, I did what you asked me to do, but i see only the red frame and the canvas
Comment: Have you set a non-zero width for `framev`? I have added what I see.
Comment: Sorry, you are right, I forgot the width on the bottomw frame. it works just fine. Thank you very much
Comment: You should also edit your question's title to be more informative and remove the tags except python and tkinter (tags are not keywords, each tag has a precise meaning which you can see by hovering your mouse on it)
Comment: @EricLevieil that would be better as a comment on the *question* than on an *answer*. Alternatively, propose an edit yourself!
Comment: @jonrsharpe you are right. The first version of my comment also mentions accepting the answer. I can edit the question, but isn't it better to explain to new members how to improve rather than editing their posts?
Comment: @EricLevieil you can do both! Suggest an edit, then add a comment explaining why (with a link to the Help Center, where relevant). If SE didn't want users to make edits, they wouldn't bribe us with +2 rep.
Comment: @jonrsharpe edit done, I am waiting for peer-reviewing before commenting.


Where is Tarrey Town?

Question: Was listening to the OST of BotW, and found the theme of Tarrey Town.

Dont think I've ever seen that town? Where is it?
Answer: Apparently, Tarrey Town is a town you build as part of a chain of side quests. This article explains how to go about building Tarrey Town:

To start the Tarrey Town quest you first have to save a house in Hateno Village from demolition at the hands of the Bolson Construction Company. You can find the house right next to the Myahm Agana Shrine, across a small bridge just behind some new homes that have been erected by the construction company.
Head to the rear of the property and you'll encounter the flamboyant Bolson himself, boss of the construction firm which carries his name. He explains that the house in question is being pulled down at the behest of the village people, but that he can let you have it for 30 bundles of wood and 3000 Rupees.

Once you've paid Bolson, you can start the quest to build Tarrey Town by doing the following:

To trigger the "From the Ground Up" quest which eventually leads to the construction of Tarrey Town, talk to Bolson's co-worker, Hudson, who should be found right outside your home. He informs you that he's off to make a start on Bolson's next big project, and promptly leaves for the Akkala region.

Once you've complete this quest, you will be able to take on numerous side quests to improve Tarrey Town.
For reference, Tarrey Town can be found here on the map:

(image source)
Comment: Although your link mentions it, you should also answer the question *Where is Tarrey Town?* in your answer.
Comment: @ian_itor done.
Comment: Now your answer deserves a +1 :)
Answer: You build up Tarrey Town in the quest "From the Ground Up." The quest:

begins during the Hylian Homeowner quest, starting when Hudson leaves for Lake Akkala.

It's location is here on the Map:

Where is Tarrey Town?


How to encode the same vectors in a 2D list to the same value?

Question: For example, if I have a 2D list like this:
a = [[0,0], [0,0], [0,0], [0,2], [0,2], [1,0]]

For the list a above:
a[0]=a[1]=a[2]=[0,0]
a[3]=a[4]=[0,2]

I hope to convert a as [0,0,0,1,1,2]
That is to say, the same element will be marked with the same value(the element here is a 1D list)
Is there any way to in pytorch or numpy?
Comment: Please provide more explanation. What does "for list `a`: `a[0]=a[1]=a[2] ...`" mean?
Comment: Sorry, I have edited my question to make it more clear
Comment: That's exactly what I want!  Thank you for your answer sincerely!
Comment: If you mean to say that the first 3 elements of `a` are the same, then why are they *not*. the same in the definition you provide for `a`? Or are they _supposed_ to be considered the same? If so, why?
Comment: @zihao are the identical elements successive or in any order? what would an example of input/output for a different order?
Comment: The above 2D list "a" has five 1D lists, including [0,0], [0,0], [0,0], [0,2], [0,2], [1,0]; Each 1D list is made up of 2 values (the value can be ranged from 0 to 500). The identical elements means list1==list2. The aim is to find all identical elements in the 2D list and labeled them as different values.
Comment: Then you want `import numpy as np ; np.unique(a, axis=0, return_inverse=True)[1]`
Answer: NumPy isn't really my forte but I think this will give you the results you're looking for:
import numpy as np

keys, index = np.unique(a, axis = 0, return_inverse = True)
index

This works by calling numpy.unique on your input list across its first axis, which will compare each of the sub-lists. I used the return_inverse argument to instruct the function to return the indices of the unique array to which each sublist corresponds. This code preserves the order in index and the unique keys in keys. By doing keys[index], you can actually reconstruct the original array.

How to encode the same vectors in a 2D list to the same value？


Rename all .htaccess files on server

Question: On my localhost I have enabled htaccess evaluation in apache2.conf and now I keep getting 500 (Internal Server Error).
I think I have some faulty .htaccess files that not being evaluated caused no issues before, but now are causing the error. I used find /var/www/ -name ".htaccess" -print to find the files, but they are too many.
For now, I would like to rename ALL .htaccess files to old.htaccess wherever they are. Using: rename  .htaccess old.htaccess results in this error in terminal:
syntax error at (eval 1) line 1, near ".".
Wrapping the filenames like rename ".htaccess" "old.htaccess" produces the same error.
What is the correct command to use.
Answer: rename doesn't work that way; you need to specify a PCRE (Perl Compatible Regular Expression) pattern and replacement to work with it.
For this purpose, mv is enough; a fast way to rename all the .htaccess files in /var/www would be to use find itself:
find /var/www -type f -name '.htaccess' -execdir mv {} old.htaccess \;

Sample output on a test hierarchy:
user@debian ~/tmp % tree -a
.
├── 1
│   └── .htaccess
├── 2
│   └── .htaccess
└── 3
    └── .htaccess

3 directories, 3 files
user@debian ~/tmp % find . -type f -name '.htaccess' -execdir mv {} old.htaccess \;
user@debian ~/tmp % tree -a
.
├── 1
│   └── old.htaccess
├── 2
│   └── old.htaccess
└── 3
    └── old.htaccess

3 directories, 3 files

Rename all .htaccess files on server


OLAP Error while Processing

Question: I am new to OLAP, and figured out how to make a cube and process it. However, when i play with it too much, i eventually come up against this error:

Errors in the OLAP storage engine: The
  attribute key cannot be found: Table:
  dbo_v_MYEntities, Column: uniqueId,
  Value: 2548. Errors in the OLAP
  storage engine: The record was skipped
  because the attribute key was not
  found. Attribute: Unique Id of
  Dimension: v MY Entities from
  Database: Test Cube New, Cube: MYdm
  MyApp - Views, Measure Group: v MY
  Entities, Partition: v MY Entities,
  Record: 2526.

It seems that some values get stuck, and the cube expect the value to be there, I know i can edit error properties and stop it from throwing exceptions, but i would like to be able to fix it.
I wouldn't mind clearing the cube, so that it re-generates itself from scratch, but i can't seem to be able to do that.
Once i get this error, even if i delete the cube, and create it again from scratch, the error is still there.
The only solution so far (in my test environment) was to change database name in project deployment target properties. Obviously this will not do the trick in production.
Answer: Basically,

Table: dbo_v_MYEntities, Column:
  uniqueId, Value: 2548

Means that your table/view "dbo.v_MYEntities" has a column "uniqueid", which contains a value "2548" which is not in a table which is related to dbo.v_MYEntities in the dimension usage tab in BIDS. This usually happens when dbo.v_MYEntities is a fact table, and the related dimension table does not contain a key. I would check the referential integrity of the schema trying to determine why this is happening and correct it in the ETL or in the view definition.

OLAP Error while Processing


Large hero banner in ux

Question: I know that many website nowadays use large hero banner to bait people scrolling. And I read this one article:

"A big striking hero area at the top of a page, grabs people's attention and gives them an initial point of focus — a place to start. It's a tried and tested way to engage people with a site's core offering."

But I'm just curious do you really think people will scroll and knew that there is still part of the page below that huge banner?
Answer: Yes. Users do scroll below the fold - all you need is a balanced approach.
Hero banners are used to trick users, take a pause, read some content, and then scroll down.

How to Ensure that You Use Images Appropriately

Identify and prioritize all the goals of the page — both the user goals, and the business goals (including brand goals.) Is the page
  primarily a marketing vehicle to build your brand? Or are most
  visitors already familiar with your organization (or at least your
  industry vertical), and now need specific content or functionality?
Define how each design element relates to the page goals. Images are usually decorative, and support branding goals. Navigation and
  structured search relate to specific user tasks.
Assign visual weight based on goal importance. If a design element supports a high priority goal, it should have more visual emphasis;
  conversely, design elements related to secondary goals should have
  less emphasis. (This guideline sounds obvious, but is often completely
  disregarded, or gets lost along the way to creating a 'modern' looking
  website.)
Select images that have a strong relationship with brand goals. Remember, the purpose of your site is not just to showcase images
  (unless you're Flickr). Instead, the images you select should showcase
  the purpose of your site.
Choose striking visuals that capture attention. Once you've identified the goals of your images and their relative importance
  among other design elements, and you've determined what types of
  images relate to these goals — only then should you focus on selecting
  the most compelling images you can find.
Be selective about which trends you embrace when 'updating' your site. For many redesign projects, creating a site that looks
  'modern' is an important goal. But there are many ways to accomplish
  this goal. Typography, layout, and brand colors — just to name a
  few—can all be effectively used to create a modern look and feel,
  while still providing appropriate emphasis on critical site functions.

Some more factors that make users scroll down are:
1. Navigation Placement

2. The Animating Arrow

3. The Attractive CTA
Answer: My position is hero banners are very difficult to do right.
TL; DR
It's hard to get/create a good image as a hero background. Using stock usually doesn't work.
There are performance concerns.
Informativity

Not sure if the word exists in English but it means information amount in the content / design.
E.g. "we make sites" is less informative than "we design sites"
because "make" is more general word than "design"
But "we make beautiful sites" is also less informative than "we make sites"
because beautiful is vague / subjective and doesn't add to the meaning of the phrase. It's an extra word though and I considered it as a noise

So.
99% of the time it's won't be informative enough. It's used just because of the "trend" or to add some visual sauce or designer doesn't know or want to think about better way of presenting the information.
The background should convey some meaning: but unless you have a budget for a custom photoshoot / illustration most likely your banner won't be informative and tells nothing about you/company/product. You just take almost a random stock photo and just throw it under the text because it looks cool. But actually it's a visual noise because text on non-plain background is harder to read.
Performance
Big image (or even video) must be transferred via the network, adding to overall loading time of the page (because not everyone uses lazy loading). If you don't use responsive images you make life of mobile users a pain since they get the full version of your background.
There are some techniques to help with performance though (via Smashing Mag):

multiple background images
use tiny image and blur it to hide the artifacts lazy load it; then switch the images (Facebook loads >1kb image first for example)
use dominant color until image is loaded

How to make it even worse
Use a hero autoplaying slider.

Large hero banner in ux


php Installing in apache compilation error

Question: Using solaris 10 Sparc platform and  solarisstudio12.3 c compiler.  Downloaded and compiled apache 2.4.6 successfully.  Downloaded php-5.5.5 and compiling but getting the below error When running make command.  How to resolve this error.
Using the below commands
./configure --with-apxs2=/tsm/home/tsmtst01/apache/bin/apxs --with-mysql
./make
<code>"ext/opcache/Optimizer/pass3.c", line 27: syntax error before or at: if
"ext/opcache/Optimizer/pass3.c", line 27: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 27: syntax error before or at: )
"ext/opcache/Optimizer/pass3.c", line 84: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 85: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 87: syntax error before or at: }
"ext/opcache/Optimizer/pass3.c", line 126: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 131: syntax error before or at: }
"ext/opcache/Optimizer/pass3.c", line 212: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 214: syntax error before or at: else
"ext/opcache/Optimizer/pass3.c", line 226: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 228: syntax error before or at: else
"ext/opcache/Optimizer/pass3.c", line 266: invalid source character: '\'
"ext/opcache/Optimizer/pass3.c", line 268: syntax error before or at: for
"/tsm/home/tsmtst01/php-5.5.5/ext/opcache/Optimizer/zend_optimizer.c", line 281: warning: invalid white space character in directive
"ext/opcache/Optimizer/pass5.c", line 1: invalid source character: '\'
"ext/opcache/Optimizer/pass5.c", line 1: syntax error before or at: )
"/tsm/home/tsmtst01/php-5.5.5/ext/opcache/Optimizer/zend_optimizer.c", line 286: warning: invalid white space character in directive
"ext/opcache/Optimizer/pass9.c", line 6: invalid source character: '\'
"ext/opcache/Optimizer/pass9.c", line 6: syntax error before or at: )
"/tsm/home/tsmtst01/php-5.5.5/ext/opcache/Optimizer/zend_optimizer.c", line 291: warning: invalid white space character in directive
"ext/opcache/Optimizer/pass10.c", line 1: invalid source character: '\'
"ext/opcache/Optimizer/pass10.c", line 1: syntax error before or at: )
"/tsm/home/tsmtst01/php-5.5.5/ext/opcache/Optimizer/zend_optimizer.c", line 292: syntax error before or at: <EOF>
"ext/opcache/Optimizer/block_pass.c", line 1224: warning: static function called but not defined: assemble_code_blocks()
"ext/opcache/Optimizer/block_pass.c", line 1903: warning: static function called but not defined: zend_t_usage()
"ext/opcache/Optimizer/block_pass.c", line 1355: warning: static function called but not defined: zend_jmp_optimization()

cc: acomp failed for /tsm/home/tsmtst01/php-5.5.5/ext/opcache/Optimizer/zend_optimizer.c
*** Error code 1 make: Fatal error: Command failed for target `ext/opcache/Optimizer /zend_optimizer.lo'
</code>
Comment: is it fine if i skip the zend_optimizer. If so how can i do it?
Answer: It is because of PHP bug #65207, to disable opcache use <code>--enable-opcache=no</code> configuration flag - it is safe to disable, but decreases performance.
Good luck!
Comment: Thanks a lot for the info.  Will try it and let you know.  Thanks a lot for your time and help.
Comment: Thanks a lot it's working now.   Did the below way and make , make install  ran successfully export D_LIBRARY_PATH_64=/lib/64:/usr/lib/64
export LD_LIBRARY_PATH=/lib:/usr/lib   ./configure --prefix=/tsm/home/tsmtst01/phpinstall --enable-opcache=no -with-mysql
Comment: I am unable to find the lib_php5.so  and  php ini file in the phpinstall directory after make install is completed successfully.  Do I need to add additional option while running configure script?
Comment: To build `lib_php5.so` or `lib_php5ts.so` you need to specify `--enable-embed=shared` configuration flag. `--with-config-file-path=PATH` will put `php.ini` into that folder.
Comment: I tried the below way the lib_php5.so got created in the apache/modules directory but php.ini file is missing. Some websites say -with-config-file-path specifies that PHP should look for php.ini file in the specified directory. Cant understand this setting.  ./configure  --prefix=/tsm/home/tsmtst01/phpinstall --with-apxs2=/tsm/home/tsmtst01/apache/bin/apxs   --with-config-file-path=/tsm/home/tsmtst01/phpinstall   --enable-opcache=no   --enable-
Comment: In httpd.conf configuration only enable the module LoadModule php5_module modules/libphp5.so is mentioned in apache sites to make the php webpages work. why there is no configuration required in httpd.conf for php.ini file location path or phpinstall directory path. How does the apache knows the location of php.ini file and php install directory mentioned in the --prefix.
Comment: Able to find two ini files in the php source directory Do I need to renamte it to php.ini and copy it to a particular location after make install? tsm/home/tsmtst01/php-5.5.5> ls *ini*
php.ini-production
php.ini-development
Comment: My earlier posting of the command got truncated. ./configure --prefix=/tsm/home/tsmtst01/phpinstall --with-apxs2=/tsm/home/tsmtst01/apache/bin/apxs --with-config-file-path=/tsm/home/tsmtst01/phpinstall --enable-opcache=no --enable-so


Is $\{V_1, V_2, V_3\}$ in $\mathbb R^4$?

Question: So given this:

I believe since there are only 3 vectors aka columns that this would be a no. I am not sure of the reasoning as there is no way for every row to have a pivot column, eliminating A.
I also can't seem to find a linear combination between these matrices. So I think that eliminates B and D, leaving C.
So would the answer be C?
I am sure I can work this out by hand to solve for RREF, but I am not sure if that is necessary to answer this question efficiently.
Comment: This exercise makes me sad. The set doesn't span $\mathbb R^4$ for the fundamental reason that any spanning set must have at least as many vectors as the dimension of the space—$4$. The given answer is incidental. There shouldn't be any need to go mucking about with row-reduction.
Comment: "I can't seem to find" is no good as a reason ... Maybe you are supposed to carry out row reduction and see what you get?
Answer: The objective is to determine whether the vectors $\{V_1,V_2,V_3\}$ spans $\mathbb{R}^4$ or not.
Note that let $A$ be a $m\times n$ matrix. Then, the column of $A$ span $\mathbb{R}^m$ if and only if $A$ has a pivot position in every row.
Let $A=[V_1\ \ V_2\ \ V_3]$ be the matrix. Then, reduce the matrix $A$ into the reduced echelon form.
If the matrix $A=[V_1\ \ V_2\ \ V_3]$ does not have a pivot position in each row, then the columns of the matrix $A$ does not span $\mathbb{R}^4$
Comment: Yes, and this only has 3 independent vectors?
Comment: @Riz-waan See the edited answer
Comment: But would I need to row reduce since I know each of the vectors have 4 entries meaning it is impossible for each row to have a pivot column since there are more rows than columns?


Can I test an unwired light fixture with multimeter?

Question: I'm looking at a light fixture on Craigslist, but I'd like to see if it works first.
I have a multimeter that I needed for another project. Can I use the multimeter to test the light fixture before buying it? How would I use the multimeter to test the light fixture?
Comment: Does it have a power supply that you want to test, or is it just a fixture with regular bulbs in it?
Comment: @JPhi1618 It isn't hooked up to anything. The owner found it in their attic, and wants to sell. It's a chandelier that uses regular bulbs.
Answer: You don't need a bulb at all to test the fixture.  There should be one main "neutral", and one main "hot" wire coming out of the fixture. If there's more than one of each, you can tie each set all together, or test each one individually.  The following procedure assumes a single "hot", and single "neutral".
First, set the multimeter to test continuity , or the lowest resistance setting.
Test the "neutral" wire

Put one probe on the "neutral" wire.
Touch the other probe to the threads inside each socket.

Next, test the "hot" wire.

Put one probe to the "hot" wire.
Touch the other probe to the contact at the bottom of each socket.

The threaded portion of each socket should show continuity (or low resistance), with the "neutral" wire. While the contact at the bottom of the socket, should show continuity (or low resistance) with the "hot" wire.
If one or more of the sockets doesn't test out, you may be able to repair the fixture. It's up to you if you're willing to put in the work.
If you know what size socket it is, you might want to fit a bulb in the sockets to make sure they're not physically damaged (deformed, etc.).

As @MichaelKaras points out, you'll also want to check to make sure there's not continuity between "hot" and "neutral", or either of those and the body of the fixture.

With the multimeter set to test continuity (or low resistance). Place one probe on the "hot" wire, and the other on the "neutral" wire.
With one probe still on the "hot" wire, touch the other probe to various metal parts on the fixture.
Place one probe on the "neutral", then touch the other probe to various metal parts on the fixture.

If any of these tests show continuity, then the internal wiring is likely damaged.
Comment: For a very old fixture where the wire insulation may have degraded it would also be a good idea to test for no continuity between the "neutral" wire and the "hot" wire going in when all the bulb sockets are empty. A connection in this case would indicate a direct short in the fixture and as such the unit would need wires to be replaced.
Comment: @MichaelKaras We're looking at a 1960's fixture.
Comment: A 60's fixture stored away in a baking hot attic for even a few years could very well have plastic insulation on the wires that has turned hard and cracking or waiting to crack at the moment of wire flexing.
Answer: If it is for incandescent lamps there is little that can go wrong with it but if you screw a good lamp into each socket and use your multimeter in continuity or ohms you should be able to test each socket individually.
The resistance of a 40 watt 120 volt lamp is about 360 ohms. Without any lamps screwed in you should get ~infinite resistance or no continuity. With a good lamp plugged in you should get continuity.
Good luck!
Answer: Multimeter probably isn't going to tell you much
For a light fixture that takes incandescent bulbs, about the only thing that you can do is put known-good bulbs in the fixture and measure the resistance between the two wires.  If there is infinite resistance, the wiring connections are bad somewhere, and if the resistance is lower than the resistance of a single bulb, the wires are shorted together.
However, in something like a chandelier that has multiple bulbs, the wires will have a junction point somewhere in the fixture where they fan out to each bulb.  Each of those connections would have to be individually tested.  Even then it will only tell you if a connection is completely broken.  A bad connection might not be noticed until you actually try to plug it in.
Instead...
Take a cheap extension cord with the female end cut off, and wire it up to the fixture in question.  Put good bulbs in it, hook up the two wires from the extension cord, set it on the ground and plug it in (without touching it).  Either it all lights up and or it doesn't.  You'll want to have a wire cutter/stripper and a few wire nuts with you to make a clean, safe connection.
That said...
There's not a lot that can go wrong with a chandelier that can't be fixed with a trip to the hardware store and redoing a few connections.
Comment: If I'm testing a lamp, it's with a cord and some bulbs. Shake it, slap it a few times, call it good.
Comment: Not sure why this got down voted.
Comment: I'm sure someone thought it was too much work compared to your solution.  I guess mine is ok if you don't have a multimeter but you proved it can be done with _only_ a multimeter.
Answer: Yes and no, some testing is possible but it won't reveal all possible faults.
What you can do with a multimeter

You can measure the resistance of insulation but the test voltage will be low so certain types of fault will be missed.
You can measure the resistance of conductive pathways (both those intended to carry current and those intended to be protective earths) but the test current will be low and the accuracy at low resistances will be essentially nonexistent. So you will have no way of knowing if a connection is just "hanging on by a thread".
You can test the resistance with a bulb in place to ensure that the lampholder actually makes contact with the bulb.

What you can't do (or can't easilly do) with a typical multimeter.

Test things are reliable, probing with a multimeter is unreliable enough that you are likely to blame intermittent breaks on poor probing.
Test conductive pathways at a high current that will burn away any connectoins that are hanging on by a thread and with an accurate measurement of resistance.
Test insulation at a high voltage.

Overall testing with a multimeter is better than nothing but not really a substitute for proper test gear.


What is the difference between floor and subfloor? Is subfloor a part of floor?

Question: Consider the following image (img_1)

I guess the whole thing is called a floor framing system and subfloor is a part of the system. So subfloor is a part of floor. is my understanding right?
Answer: Subfloor is a part of the floor but has a different purpose. Without a solid sheet that spans the joints and the ends are supported, how can you install tile or wood flooring? In the oldest residential constructions I've seen, they used either two layers of thick wood planks (bottom acting as a subfloor) or boards run diagonally as the subfloor. Today, we almost exclusively see OSB, but the purpose is the same. It provides even support for the floor.
Comment: @abdnChap crawl space is the term used where I live
Comment: @abdnChap The unfinished space under the joists and inside the perimeter of the foundation walls is considered or called the crawlspace.If it is tall enough to include a living space, then it is called a basement
Comment: Do you know what the correct term for the space between the joists the foundations is? I've been calling it a subfloor or crawl space.
Comment: solid timber flooring can be applied directly to joists, and usually is.
Answer: The subfloor is the support used so the final floor covering (the "pretty one - tiles or polished wood etc) is properly supported.


ipod not mounting

Question: Tried to connect my iPod, but got this message:
Error mounting: mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
Have seen links to this here, but beeing rather green, I don't understand much.
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/734883
 What do I do now?
The     dmesg|tail says
<code>[ 2819.709437] sd 6:0:0:0: [sdb] 3901376 4096-byte logical blocks: (15.9 GB/14.8 GiB)
[ 2819.710161] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 2819.735294]  sdb: [mac] sdb1 sdb2
[ 2819.738060] sd 6:0:0:0: [sdb] 3901376 4096-byte logical blocks: (15.9 GB/14.8 GiB)
[ 2819.738671] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 2819.738688] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[ 2820.420130] sd 6:0:0:0: [sdb] Bad block number requested
[ 2820.420167] hfs: unable to find HFS+ superblock
[ 2820.612140] sd 6:0:0:0: [sdb] Bad block number requested
[ 2820.612191] hfs: unable to find HFS+ superblock
</code>
Comment: The error message suggest you to read error in dmesg, have you tried to watch the output of `dmesg|tail` in a terminal immediatly after you see the error message?
Comment: @fain182 I've added the output. Does that help?
Comment: doesnt look nice to me; can one re-format hd on the ipod?
Comment: I could reformat it on a windows PC, but I ain't got one, and I want to use the ipod with both mac and ubuntu.
Answer: To get the iPod to mount correctly, you first need to format it using iTunes, on a Mac or PC. After that, it should mount correctly on Ubuntu.
Answer: I think you encountered this bug: http://www.gossamer-threads.com/lists/linux/kernel/1428824
Kernel developers are solving it in this days, IMHO you can just wait for a kernel update or try an older version of the kernel.

ipod not mounting


No Launcher at all, just blank desktop (with bg image)

Question: So, okay, I've been using Ubuntu 12.04 and this just came out yesterday when the launcher disappeared. I cant right click on screen 'cause nothing happens, I can open TTY with ctrl+alt F1, F2 and so on...I've been able to run a terminal with
DISPLAY=:0 gnome-terminal
And switch to it with Ctrl+alt+F7. I do this in case something goes wrong with TTY.
I also can run nautilus with
sudo nautilus
I can access to my desktop and files but everything looks bad and basic, I can't access to media e.g. a usb wich I want to backup my files in. Here are the things that I already tried:
DISPLAY=:0 ccsm
Which seems.to be okay, first time I went there Unity was unchecked and I checked it and clicked okay to the additional dialogs that checked another options also like OpenGL...After this, nothing happened. I rebooted like 6 times and same.
Weird thing.is that when I reset to defaults the  Unity option unchecks itself.
unity --reset
WARNING: no DISPLAY variable set, setting it to :0
ERROR: the reset option is now deprecated
Then I run the display =0 and it just goes.with the last error.
Updating nvidia Drivers
Removing nvidia Drivers
Installing nvidia Drivers
ReInstalling nvidia drivers
Same with Compiz, Unity, Unity Desktop, and Xorg.
Reseting lightdm
Changing to GDM
Unity Tweak Tool
Reseting compiz with dfcon-tool
Installing Xubuntu to have the kind of back up desktop manager...but same ..nothing.
I need to say this that I think is where the problem is... whenever I open Unity from the terminal and/or TTY, it crashes;  it loads the compiz (core) plugins but it stucks in:
....
compiz (core) - Info: Loading plugin: unityshell
compiz (core) - Info: Starting plugin: unityshell
Segmentation fault (core dumped)

There's a very limited info about this one and posts offer what I already my previous tries to solve the issue. Im sorry I cant put the complete  tty info as Im posting this from my phone ...thanks in.advance!! I really need some.files and pretty much tried everything out there!  :(
Answer: You are missing the kernel-headers package which is a dependency for the nvidia Unified Driver module to be built.
Install the kernel-headers package for your kernel version and reinstall the nvidia binary driver.
dpkg-reconfigure should sort you out with the nvidia package after installing kernel headers.
Comment: I tried but at some point terminal.says: Depends: linux headers 2.6.32-34:i386 but is not installable... when I try to reload my Unity says; Unity is not supported by your hardware
Answer: In this case, please install the latest available kernel and install its headers too.
That kernel you're running is TOO old ( 2010?)


Custom Google and Apple Signup/in buttons

Question: I want to modify the default sign up and sign in buttons of Google and Apple for an iOS project keeping the changes as per their guidelines.
By default, these are like this:

And I want to use it like this(G's border-radius updated to 6px, shadow removed, border-color updated and Apple's font size changed to 14px just to match it with Google's) :

Now the confusion is due to the guidelines' do's and don'ts in Apple's guidelines, at one place it says:

To coordinate with your app design, you can change:

Title font. You can also adjust the font's weight and size.

And just below that, it says:

Prefer the system font for the title — that is, Sign in with Apple, Sign up with Apple, or Continue with Apple. Regardless of the font you choose, the title and button height of your custom button should use the same proportions that the system uses. Using the system font for example, the title's font size should be 43% of the button's height — in other words, the button's height should be 233% of the title's font size, rounded to the nearest integer.

And in Google's Guidelines, it says you have to stick with white or blue colour which is okay but in the custom button design page of google, it says anyone can change anything without hampering the aspect ratio and basic requirements.
SO how can I attain this so that the product will not be getting a revision from iOS's App store?
TLDR:
How much customisation is okay for Apple and Google Signup/in buttons so that the app's design doesn't go into the revision from the App Store's side?
Comment: @musefan Yes, quite possibly someone here could have relevant firsthand knowledge, be able to clearly explain the lengthy guidelines, or link to another authoritative source.
Comment: @musefan I am myself doing some more research and talking out to the support of apple google. In case there'll be a solution in my hand, I'll post the answer here.
Comment: It feels like this is something you should be asking Google/Apply support, instead of us. I mean, what would you consider a valid answer here? If I just typed an answer that said "you are free to make any change"... how would you validate if I was correct?
Comment: @musefan It's conceivable that someone else might have relevant knowledge or experience with this.
Comment: @maxathousand: They may have knowledge or experience, but can they be the "authority" that gives the OP the legal permission they are looking for? I feel the best someone could do is link to another source material (other than what is in the question) that would then be open to (mis)interpretation just the same.
Comment: @musefan Well, this is a community that has thousands of designers and there is a high probability that at least(if not most) a few of them have worked with such products that have this login/signup via apple/google feature and have encountered similar problem. So this question might not interest you but once there will be a solution posted, I believe this will be helpful for all those who are designing incorrectly or disturbing the experiences.
Answer: This no longer seems to be an issue (at least not for Apple). You are free to adjust the buttons size or text size to fit your design. This is described in Apple's Human Interface Guidelines (updated September 14, 2022). There is also an editor to customize the buttons.
Answer: There are always going to be some degree of 'conflict' between design guidelines, since I don't think the designers from different organisations talk to each other to make sure that there are no clashes.
In fact, this is why cross-platform applications tend to have an independent look & feel so that there are no clashes and the appearance is consistent, or they follow the native implementation and deal with the consequences of the inconsistencies (just think about Microsoft's evolving UI design). This is now even more problematic because of the different devices and their hardware differences too (e.g. soft vs. hard buttons, iPhone's notch on the screen caused by hardware placement).
It would be preferable to conform as much as you can to the platform you are submitting the work to, but it is not their problem how bad it makes the other aspects of your design look. So while you might get a response from Apple about the use of their logo, it is still up to you to find a solution of how to fit the other design so that it is consistent. Another way to look at this problem is to consider what adjustments you would make to the Playstore and work out the best trade-off.
My guess is that Google will care less and therefore give you the greater flexibility to make adjustments from that end.


.NET register services for interface, base class and sub class dependency injection

Question: My interface and classes
public interface INoteService {
 SomeMethod();
}

public class NoteService : INoteService {
private readonly IAuthenticationService _authenticationService;

public NoteService(IAuthenticationService authenticationService){
    _authenticationService = authenticationService;
}
//some code ...
}

public class CompanyNoteService : NoteService {

private readonly IAuthenticationService _authenticationService;

public CompanyNoteService (IAuthenticationService authenticationService) : base (authenticationService) { }
//some code...
//overriding methods
}

The controller
public class NoteController : Controller
    {

        private readonly INoteService _noteService;

        public NoteController (INoteService noteService)
        {
            _noteService= noteService;
        }
}

I want to call the methods of CompanyNoteService in the controller, using dependency injection.
I registered my services like this:
services.AddScoped<IAuthenticationService, AuthenticationService>();
services.AddScoped<INoteService, CompanyNoteService>();

But I keep receiving a null value for _authenticationService.
The following example works, but I want to use my overridden methods.
services.AddScoped<IAuthenticationService, AuthenticationService>();
services.AddScoped<INoteService, NoteService>();

How do I register my services in order to get things work?
Comment: The behavior you are describing, does not match the code you posted; the problem, therefore, isn't reproducible. Please change your code examples into a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) (MRE). Without an MRE, we will not be able to help you. Most likely, your actual `CompanyNoteService` looks different from the example you posted.
Comment: I guess `_authenticationService` should be `protected readonly`, not private, and only be defined once in the base class
Answer: I guess your problem comes from the duplicate declaration of _authenticationService.
Difficult to tell without a whole code, but I think you are setting the base class _authenticationService while you try to read the subclass _authenticationService (which remains null).
You should try something like this.
public interface INoteService {
 SomeMethod();
}

public class NoteService : INoteService {
  protected readonly IAuthenticationService _authenticationService;

  public NoteService(IAuthenticationService authenticationService){
    _authenticationService = authenticationService;
  }
//some code ...
}

public class CompanyNoteService : NoteService {

  public CompanyNoteService (IAuthenticationService authenticationService) : base (authenticationService) { }
  //some code...
  //overriding methods
}

Comment: Yes that was it


Refinishing particle board with vinyl veneer

Question: I have an old cabinet that is made from engineered wood with a laminate finish that resembles wood, but is definitely not hardwood. I am not sure what the finish is called but it is paper thin and not made of any real wood. See attached photo. From what I can tell this kind of fake finish is extremely common in modern cabinetry and furniture.
The laminate finish has become damaged and worn out over time. Is it possible to redo this laminate finish myself so that it matches the existing fake wood tone as closely as possible? If so, what is the product I am looking for called?
(Contact paper is a last ditch solution, but I would like to actually redo the finish if possible.)
Edit: The linked question is about water damage, and seems to have nothing to do with the question I am asking here (note also that there is no water damage in my case). I am asking specifically about redo-ing the finish, and how to identify and use the product that would be needed to re-finish this. I don't see this answered in the linked question. Prior to my question being closed, I was close to getting an answer to my question.
Comment: Isn't this a bottom panel? Any chance that its opposite side is finished the same way and can be used by simply turning it upside down (redoing any fasteners as necessary, of course)? Or, if the finish is not exactly the same, but maybe a better surface that can be used instead of this compromised one as a foundation for a new finish?
Comment: @Gábor With this kind of faux-wood cabinetry build, I'd say the chances of the underside having the same finish — or _any_ finish — are virtually nil. Like any hidden surface (even the back and side edges of the shelves, usually!), it's most likely the completely-unfinished bare particleboard.
Answer: You are giving it to much fancy words. That is not engineered wood, just plain particle board (cheap). It is not covered by wood veneer. –
To do it looking great, you would buy some wood veneer and glue it on to. Guaranteed it will not partially peel off ever. –
Also, forget matching, just do the whole surface. –
If you are just locking for quick repair, be aware that the paint will not cover the existing defects. You will still see them afterward. The only way to avoid that the whole surface has to be sanded smooth.
Now go to a paint store and ask.
Comment: Sorry for any confusion: I would like to use the same finish, which is not made of wood, so I don't think a wood veneer is the right thing. And I plan to refinish the entire surface, but it still has to match since there are other finished surfaces not pictured. (Sorry if I mixed up the terminology, I have always considered particle board a type of engineered wood.)
Comment: @user522  What you have as a finish now looks almost like contact paper.  Particle board is a very cheap version of engineered wood, but don't tell the engineer wood makers that.  Maybe do the other surfaces also if they are the same, to match.
Comment: Particle board _is_ engineered wood, a prime example of it. Even Wikipedia says so. :-)
Answer: Wood-grain laminate sheets are widely available. They are commonly used for countertops. Formica® and Wilsonart® are two major US brands, no endorsement implied. They also come in many other patterns and colors...
That type of product is usually installed with contact cement - follow the directions very carefully as it works differently than most people expect (you apply to both surfaces, let dry completely, keep them separated while lining the laminate up, then remove the separators to bring the surfaces into contact, where they will grab immediately, for most types.)
Depending on the exact material you have, commonly available sheets (pretty much any home center, or large orange or blue box store has them or can order them in your chosen pattern) may be somewhat thicker than some of the "more than contact paper, but less than countertop" laminates you'll find on some mass-produced furniture. But countertop thickness is what you can easily find or get, IME. It wears quite well if carefully installed.
For the type of damage you show, it may be more economical to replace the top, rather than remove the laminate remaining and get the apparently damaged particle board flat to receive new laminate. You can possibly find a new pre-laminated countertop in a similar pattern.
Answer: That cabinet counter top must be replaced.
The original top surface has worn or been damaged and the particle board is now compromised.  The wood particles are coming apart and will be an issue that will be apparent when any repair is done. An attempt to glue a new surface over the degraded wood, will fail. Attempts to fill the area will result in the same and be noticeable as a dip or a bump.  Anything done to save this is a hack.
If you want a counter that is anything other than representing a poor repair, you need to replace it.
Comment: *IS* that a countertop? It looked to me like it's possibly the inside floor of the cabinet.
Comment: @FeRD,  I could not tell...and it's a moot point.  Repairing that is like repairing a wet Kleenex.
Comment: I would guess its the floor of a cupboard and someone has put slightly leaky/wet bottles of cleaner or similar here..  The quick fix is some wood-grain contact paper, or some opaque plastic trays for catching the moisture before it hits the chipboard.
Answer: Redo the finish? Not on your life.
But if I'm right, and that is indeed the cabinet floor, you are allowed to just completely replace it with Real Wood™. Get a few boards, cut to fit, and lay them side-by-side right on top of the shitty original floor. Screw down into the framing, and pretend this never happened.
If raising the cabinet floor by 1" won't cause huge problems (bumping up against pipes, or interfering with drawer/door motion), then that's probably what I'd do, if I really wanted to keep the cabinet.
(Replacing the whole cabinet is also an option. Not a cheap one, but not really that much more expensive than any worthwhile repair you could do.)
Comment: another option - add self-closing springs to the cabinet doors so it can't be seen so much.
Comment: Can you explain why it would be so difficult to redo the finish? (Sadly real wood (TM) is not an option due to interference from other parts of the cabinet.)
Comment: Because whatever you try to glue there as a new finish won't really stick to it. The bulk of the board is not wood but a mixture of ground wood particles and resin. This is what most furniture is made from nowadays. It's usually acceptable for its normal purpose but in your case, the compromised upper layer was removed, allowing moisture, dirt and whatever else to enter the board.
Comment: And in your case, this is not that important any more. You have to find the finish that matches your existing finish, that's the important part. When you already have it, replacing the full board will probably be a negligible price difference to trying to prep the existing one, removing the rest of the old finish, replacing possibly deteriorated parts of the substrate and gluing the new finish. Why not buy a full board with your new finish and replace the whole? Provided you _can_ find a finish that gives you good enough a match in the first place.
Comment: Maybe a dumb question: If the problem is that the glue won't stick to particle board / resin / etc, how did they glue on the laminate in the first place?
Comment: @user522 the laminate is a heat-set glue applied during manufacturing.  The laminate has a layer of thermoplastic glue on the back, and it is heated and pressed into placeby a roller.  This drives the glue deep into the open pores of the chipboard.   You might be familiar with edge-banding that is applied with a heater like a clothes iron?   Like that, but bigger with more pressure.
Comment: Last question (for future readers, this is the thread that is really answering my question!): In their answer @Ecnerwal, suggests "wood-grain laminate sheets", which I did find online and seem to be similar to what I was looking for. Is this the same, or different from what you are talking about here? If its different, would it be a suitable replacement for the heat-set laminate?
Comment: @user522 Part of the problem is that a lot of things can be called "wood-grain laminate" — those words typed into Google match everything from Formica laminate that has to be cut to order and installed with a laminate adhesive, to peel-and-stick vinyl rolls (effectively slightly-fancy contact paper). Something like the Formica, which is nearly 1mm thick and has some rigidity to it, might work. But how do you get it inside the cabinet in one (or even 2) piece(s)? Anything thin/flexible, like contact paper / vinyl, won't hide the damage underneath, and will probably be ruined by it.
Comment: The thing Criggie glossed over, re: factory lamination, is that the laminate is applied to a _completely smooth_, just-formed board surface. Those are ideal conditions. But you no longer have a completely smooth surface. You have a surface in two parts: the damaged bit that may **seem** smooth, but under a microscope looks like the cratered surface of the moon; and the part that's _already_ laminated. Neither is an ideal surface for accepting new laminate.


How to pass value of array from one Activity to other?

Question: I am building an android application where an user select their favorite stuff.
The name of stuff is added in an array when user clicks on the stuff's image.
Now I want to know how can I parse the value of that array to any fragment and show it in my spinner list.
For example: user select Mobile and tablet by clicking on respective images then these values added in to an array name 'stuffarray' now I want to pass this array to my fragment on an 'submitted' button and when I click on an spinner of my fragment it Should have mobile and tablet value in there list.
Here is my code for stuff selection :
I am building an android application where an user select their favorite stuff.
The name of stuff is added in an array when user clicks on the stuff's image.
Now I want to know how can I parse the value of that array to any fragment and show it in my spinner list.
For example: user select Mobile and tablet by clicking on respective images then these values added in to an array name 'stuffarray' now I want to pass this array to my fragment on an 'submitted' button and when I click on an spinner of my fragment it Should have mobile and tablet value in there list.
Here is my code for stuff selection :
submite = (ImageButton) findViewById(R.id.nextscreen);
next.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
    // TODO Auto-generated method stub

    Intent innext = new Intent(getApplicationContext(), MainActivitytabnew.class);

    startActivity(innext);

});
img1 = (ImageButton) findViewById(R.id.imageButton1);

 img1.setBackgroundResource(R.drawable.mobile);
 img1.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

     isClicked1=!isClicked1;
        if (isClicked1) {
            img1.setImageResource(R.drawable.mobile);
            start();
            stuff1 = "mobile";

               myList.add(stuff1);

        }else {
            img1.setImageResource(R.drawable.mobile);
            myList.remove(sport1);
            //sport1 = "";
            txt1.setText("");
        }
}
});

img2 = (ImageButton) findViewById(R.id.imageButton2);
img2.setBackgroundResource(R.drawable.tablet);
img2.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

    isClicked2=!isClicked2;
    if (isClicked2) {
        img2.setImageResource(R.drawable.tablet);
        start();
        stuff2 = "tablet";
       myList.add(stuff2);
    }else {
        img2.setImageResource(R.drawable.tablet);
       // sport2 = "";
        myList.remove(sport2);
    }
}
});

Comment: u can make the arraylist as static.
Comment: No I do not want my array list to be static
Comment: use the concept of singleton class.4
Comment: use the concept of singleton class.
Comment: How can I use singleton class for array parsing
Answer: Use putExtra():
int helloworld = 100;

Intent intent = new Intent( this, Class2.class );
intent.putExtra( "myInt", helloworld );
startActivity( intent );

then in your next activity use getExtra()
see documentation for intent.
int passedInt = getIntent().getExtras().getInt( "myInt" );

Comment: You need to get the value from the other class as well. `array[0] = getIntent().getExtras().getInt( "int" );`
Comment: I am done as your ans my code - Intent innext = new Intent(getApplicationContext(), MainActivitytabnew.class);
    innext.putExtra(mysportlist, myList);
    startActivity(innext);
    Toast.makeText(getApplicationContext(), mysportlist, Toast.LENGTH_SHORT).show();
Comment: but when i am toasting the value for checking it is null
Answer: You could also set the value before you open it.
First activity
Intent intent = new Intent( this, YourOtherClass.class );
int[] myArray = { 0, 1, 2, 3 };
YourOtherClass.array = myArray;
startActivity( intent );

Second activity
public static int[] array;

Where this is your activity.
Comment: @thanks can you please tell me now how can I add this array value to my spinner
Comment: That is a complete different story. Search for Spinner Adapter.


Laminate floor sliding out of place

Question: I learned the hard way not to plank on floating laminate floor when the board my feet were on slid toward the wall.
I fixed it initially by just applying force in the other direction, but now it keeps on slipping out and I keep on slipping it back. It doesn't take much to move it anymore.
Can I fix it with wood glue or something stronger? It slides a good half an inch so there's plenty of space to gunk stuff in there. Otherwise, it is pretty close to the edge of the trim so I could pull that back and try wedging something in to stop it from moving.
Answer: What happened is that you broke off the MDF tab that was holding that plank in place. That's why it slides freely now; nothing's mechanically holding it in place anymore. Since the core is MDF, any kind of wood glue should be totally fine to fuse them together, and once glued, those two planks will probably be more strongly held to one another than the other ones that are only mechanically fastened. Once you apply the glue, tape the planks together with masking tape or blue painter's tape to prevent the glue from expanding and pushing them apart.
If you really wanna make sure it never comes loose again, you can get some of the wood wood glue that's specifically made for this use: Titebond!
Comment: You should use a flooring glue not just any wood glue. Flooring glue is designed to remain flexible  so it will not crack and fail do to flexing from the weight of walking on it.
Comment: This *is* floating floor glue. It is specifically recommended by the manufacturers of many engineered floor boards. Of course, check first as manufacturers may have different recommendations.
Answer: I use a flooring glue also.  Mine would not slide easily and were in the middle of the floor.  I used a tool from another post.  It is the "Floor Gap Fixer".  Found it @floorgapfixer.com.  My problem was that it wasn't only one spot and they returned in different spots after they were glued.

Laminate floor sliding out of place


Fading Between Div's with Jquery

Question: I have the following HTML code:

---content

---content

Upon page load, the second div and it's contents are invisible (I don't know if it's better to use .hide() or CSS).  I would like to, using Jquery, upon some interaction on the page, make the first div fade out and be replaced with the second div.
On my own so far I've used fadein() and fadeout(), however it makes the divs jump around on the page.  I'm trying to seamlessly fade out the contents of div 1 and replace with div 2, consuming the exact space as div 1 and without making the formatting of the page jump around.
Answer: You could easily do with toggle class. I don't recommend doing fadeIn and fadeOut.
CSS
    #first {
        background-color: red;
        height: 250px;
        opacity: 1;
        -webkit-transition: .25s all ease;
           -moz-transition: .25s all ease;
            -ms-transition: .25s all ease;
             -o-transition: .25s all ease;
                transition: .25s all ease;
    }

    #second {
        background-color: green;
        height: 250px;
        opacity: 1;
        -webkit-transition: .25s all ease;
           -moz-transition: .25s all ease;
            -ms-transition: .25s all ease;
             -o-transition: .25s all ease;
                transition: .25s all ease;
    }

    .hidden {
        height: 0 !important;
        opacity: 0 !important;
    }

HTML

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus sequi iure, nesciunt laudantium a beatae autem, commodi culpa, quasi vitae sint ad. Itaque repellat cum voluptate, est aut provident ipsum?

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus sequi iure, nesciunt laudantium a beatae autem, commodi culpa, quasi vitae sint ad. Itaque repellat cum voluptate, est aut provident ipsum?

Javascript
jQuery(document).ready(function(){
    $('body').click(function(){
        $('#first, #second').toggleClass('hidden');
    });
});

Fiddle Link : https://jsfiddle.net/bngnxty9/
I have added click on body event, you could replace your own event there.
Answer: Use $(document).ready(); as listener.
$(document).ready(function(){
    $("#first").fadeOut();
    $("#second").fadeIn();
});

Use fadeIn(), fadeOut() to have a simple effect.
Plain javascript
var first = document.getElementById('first'),
    second = document.getElementById('second');

window.onload = function() {
   first.style.display = 'none';
   second.style.display = 'block';
}

Update:
Use position: relative on section and put position: absolute; top: 0; left: 0; right: 0; bottom: 0; on child, in your case. (#first, #second)
#first, #second {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

Comment: Sorry perhaps I wasn't clear in OP, but when trying that it makes the content below move around during the transition.  The first div fades out, content below jumps up then back down as div 2 starts fading in.
Comment: Thanks so much for helping out, that was very close but the second element fades right to the top of the window, is it possible to make it fill the section instead?
Comment: So far that's perfect, thanks :D  I thought complex javascript might be needed, turns out just some nifty positioning!
Comment: Glad I've helped. Once, you master the position relative absolute relationship. It can take your layout to the next level.
Answer: Use $.fadeOut() to fade #first out, and to get #second to show at the same exact time that #first disappears, use the callback in $.fadeOut()

$("button").on('click',function() {
  $('#first').fadeOut(function() {
    $('#second').removeClass('hidden');
  })
})
.hidden {
  display: none;
}

  first

  second

<button>click</button>
Answer: The only way I can think right now to seamlessly fade between both divs (overlapping each one) is to have both overlapped using absolute positioning, the issue is that sending both to absolute position doesn't allow us to expand containers (so JavaScript/jQuery would be required to handle that).
So, you need something like:
  section {
    position: relative;
  }
  #first, #second {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

When you do the fadeOut/fadeIn thing, the divs will make the fade in/out overlapping each other, not stacking, however, you need to give a height to the
 element, which can be the same of the tallest element between #first and #second, or you can also set that after the fade switching has been completed.
Hope this helps

Fading Between Div's with Jquery


What are the stats of companion NPC's default weapons?

Question: I know that the various companion NPC's all come with a 'default' weapon, which doens't use ammunition. That's pretty great, and all, but some of the weapons they are carrying... do not look very good. For instance, it seems that Nick Valentine is using a beat up old Pipe Revolver.
Is there any way to see the stats for these default weapons, so that I can better assess whether I'd rather part with some hard-earned ammunition to spare them the indignity of their defaults?
(Or just hand them Grognak's Axe and the Grognak costume and tell them to go smash things...)
Comment: I know you can force NPCs to unequip items by commanding them to equip an alternate item for the same slot. Ive had unique items appear in their inventories as a result, but I cant confirm this works for companions weapons. If it does, you should be able to look at the weapons as normal.
Comment: @Timelord64 That was the first thing I tried. Works for their clothing/armor, but doesn't seem to work for weapons. :(
Answer: No, there is no way to see what the stats of each companion's default weapon are as there is no way to get this weapon to show in their inventory (unlike their clothing/armor). Even if you equip them with another weapon, their default doesn't appear in their inventory.
Comment: +1, I have more than 3 days of playtime now, and this is correct. Somebody could probably use the console on PC or deconstruct some config files to figure it out, but there's no way to determine it in game.
Comment: From the followers I have found so far - they do seem to be generally worse than the defaults for companions in Fallout 3 (Charon's Shotgun anyone?) - I guess the idea is to force players to outfit companions in better gear in Fallout 4, and only default back to the stock weapon when *absolutely* required.
Answer: While there is no way to see the default weapon damage for each companion, you are able to see their default weapons on their individual pages on the Fallout 4 Companion wikia.
Using the damage output numbers of their default weapon and their SPECIAL stats, it would probably be possible to compute their default damage output, but you might as well just give them better equipment.


openCV track object in video and obtain a better image from multiple frames

Question: I'm working on detecting license plates with openCV, python and a raspberry pi. Most of it is already covered. What I want is to detect the ROI (Region of interest) of the plate, track it on a few frames and add those together to get a more clear and crisp image of the plate.
I want to get a better image of the plate by taking the information from several frames. I detect the plate, and have a collection of plates from several frames, as many as I wish and as many as the car is moving by the camera. How can I take all those and get a better version?
Answer: You need to ensure that your frame rate is fast enough to get a decent still of the moving car. When filming, each frame will most likely be blurry, and our brain pieces together the number plate on playback. Of course a blurry frame is no good for letter recognition, so is something you'll need to deal with on the hardware side, rather than software side.
Remember the old saying: Garbage in; Garbage out.


Django 1.6: What should be the location of the sitemap.py file?

Question: I want to implement django sitemaps but I'm little confused about where to put the sitemaps.py file and which urls.py file should i modify to include:
url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.index', {'sitemaps': sitemaps}),

Shall I put the above line in project(mysite) urls.py file or the app(sampleapp1) urls.py file?
Answer: You create sitemaps within the apps of your project (the ones you need sitemaps), documentation doesn't state what and where because you are free to do as you like, you only need to register them in a dictionary which is passed in the url.
For example, you have a your_project which has a blog app:
your_project
  - blog
    - models.py
    - views.py
    - ...
    - sitemap.py

In your sitemap.py:
from django.contrib.sitemaps import Sitemap
from blog.models import Entry

class BlogSitemap(Sitemap):
    changefreq = "never"
    priority = 0.5

    def items(self):
        return Entry.objects.filter(is_draft=False)

    def lastmod(self, obj):
        return obj.pub_date

Then in your urls.py (main urls.py of your project):
...

from blog.sitemap import BlogSitemap

sitemaps = {
    'blog':BlogSitemap
}

url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.index', {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),

You repeat the same for every sitemap you need, if your project is big (many apps) it would be wise to use different sitemaps per app, then in your urls.py:
...

from blog.sitemap import BlogSitemap
from fooapp.sitemap import FooSitemap
from barapp.sitemap import BarSitemap

sitemaps = {
    'blog':BlogSitemap,
    'foo':FooSitemap,
    'bar':BarSitemap,
}

Answer: The documentation does highlight this but here is the summarized version:

Make sure you have the correct settings. This boils down to two things:

Have django.contrib.sitemaps in INSTALLED_APPS
Make sure you have a site defined. It used to be that this was done by default, but from 1.6 it has become optional. However a lot of contrib apps and some third party apps rely on this to be in place.

Next, you have to decide where to put your sitemap.xml. This is important because the location of this will control what is included in the site map. If you point this to /foo/sitemap.xml only those urls that start with foo/ will be included in the sitemap. So, its best to put it in the root url conf, which is typically at your project level. All you have to do is add the line in your question to the appropriate urls.py.
Now you have to actually generate the sitemap. Django provides two automatic ways to generate this. GenericSiteMap for your models, and FlatPageSitemap for everything else.  You can of course create your own custom sitemap.

Create a class that inherits from django.contrib.sitemaps.SiteMap
In this class, create a method items. This is what will have the links in the sitemap. For your objects, you can just return a queryset. If you want to create custom links, then return a list of url names, and django will automatically call reverse() to calculate the URL.
Import this class name and pass it as the 'sitemap' dictionary in the root urls.py. So if you have ProductMap for all your products, then you would pass {'sitemaps': {'products': ProductMap}} as the last argument (after making sure you import it).

That's all there is to it.
Comment: Thanks for the detailed feedback. I tried doing GenericSiteMap but it's not generating the links properly. Here is the http://stackoverflow.com/questions/25230992/django-1-6-sitemaps-not-generating-links


Why is my app's UI not showing on VS android app emulator (both API level 19 and 23)?

Question: My app does show up in the emulator, but when I click on it the VS Emulator just shows a blank white screen for my app. enter image description here
Below is my code for my FirstLogin Activity
package com.example.android.fantappstic_app;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class FirstLogin extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first_login);

        Button login_button = (Button) findViewById(R.id.login_button);
        final EditText user_field = (EditText)findViewById(R.id.user_field);
        final EditText pass_field = (EditText)findViewById(R.id.pass_field);
        Button signup_button = (Button) findViewById(R.id.signup_button);

        login_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if(user_field.getText().toString().equals("codergal") && pass_field.getText().toString().equals("12345"))
                {
                    Intent GotoHomeScreen = new Intent(FirstLogin.this, HomeScreen.class);
                    FirstLogin.this.startActivity(GotoHomeScreen);
            }

                else
                {
                    Toast.makeText(getApplicationContext(), "Wrong Credentials",Toast.LENGTH_SHORT).show();

        }

    }
});
        signup_button.setOnClickListener(new View.OnClickListener() {
            @Override

            public void onClick(View v) {
                Intent GotoSignUpBasic = new Intent(FirstLogin.this, SignUpBasicInfo.class);
                FirstLogin.this.startActivity(GotoSignUpBasic);
            }
        });
    }}

Below is my XML File for FirstLogin Activity:
`<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.android.fantappstic_app.HomeScreen">

    <TextView
        android:id="@+id/login_welcome"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome to App!"
        android:textSize="36sp"
        tools:layout_editor_absoluteY="47dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <EditText
        android:id="@+id/user_field"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Username"
        app:layout_constraintHorizontal_bias="0.502"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        tools:layout_editor_absoluteY="258dp" />

    <EditText
        android:id="@+id/pass_field"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textPassword"
        android:text="Password"
        app:layout_constraintHorizontal_bias="0.502"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        tools:layout_editor_absoluteY="325dp" />

    <Button
        android:id="@+id/login_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="74dp"
        android:onClick="login"
        android:text="Log In"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

    <Button
        android:id="@+id/signup_button"
        style="@style/Widget.AppCompat.Button.Borderless"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="148dp"
        android:text="Sign Up"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_marginBottom="16dp" />
</android.support.constraint.ConstraintLayout>

And lastly, here is my AndroidManifest.xml file. I added FirstLogin as a parent function of HomeScreen activity.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.android.fantappstic_app">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".HomeScreen"
            android:parentActivityName=".FirstLogin">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".SignUpBasicInfo"></activity>

    </application>

</manifest>

So basically, a) I'm not getting any errors anywhere b) I have designed components such as buttons and TextViews but they aren't showing up in VS Emulator. Additionally, my VS Emulator is a 5.7" Marshmallow (6.0.0) XHDPI Phone API Level 23. I also tried 5" KitKat (4.4) XXHDPI Phone API Level 19 as a different device too.
Comment: What is inside Homeactivity?
Comment: @InziKhan as of now, i haven't coded anything inside of it yet
Answer: Here's the correct code.
    <?xml version="1.0" encoding="utf-8"?>
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.example.android.fantappstic_app">

            <application
                android:allowBackup="true"
                android:icon="@mipmap/ic_launcher"
                android:label="@string/app_name"
                android:roundIcon="@mipmap/ic_launcher_round"
                android:supportsRtl="true"
                android:theme="@style/AppTheme">
                <activity android:name=".FirstLogin"
                  >
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN" />

                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                </activity>
<activity android:name=".HomeScreen"
            android:parentActivityName=".FirstLogin" />
                <activity android:name=".SignUpBasicInfo"></activity>

            </application>

        </manifest>

Comment: what change was made? and what was the issue preventing anything from appearing on the emulator within my app?
Comment: In android application manifest file tells to Android os , which activity should be launched first.So i just declared Firstlogin activity as your Launcher activity
Comment: If My code is working then make it accepted an answer.


How can I cut regularly spaced 45 degree grooves in a piece of wood?

Question: I'm making a coat rack to hang behind a door, but there isn't room room for a hanger between the door and the wall when the door is opened so it's parallel to the wall.  My solution to this is to have the hangers align on a 45 degree angle between the door and the wall.  So I need a way to make a bunch of regularly-spaced, parallel grooves in a bar of wood which will act as my hanger bar.  Here's a rough pic of what I want to make:

I'm hoping to avoid the "table saw a bunch of times where you want the groove and then chip/chisel the remaining wood out" technique because it doesn't seem like that will give me nice, neat grooves easily.  I'd love to find a way to use a router (I have a small portable router table if that will help) to do this, but I can't think of a way to produce a bunch of exactly parallel grooves.  Anyone have any ideas?
Comment: Considered using a dado blade so you don't have to chip/chisel?
Comment: Exactly - a dado blade can give flat bottoms. However, a CHEAP wobble dado blade can give a bottom that has a bit of a curve to it, so this might even be best for your goal.
Answer: You could use a router set in a router table, with a crosscut sled set at 45 degrees.

Building a jig with a "pin" that fits into the previously cut groove, will make sure all the grooves are cut an equal distance apart.  The "pin" will be attached to the sled in some way, and will sit against the edge of the work piece for the first cut.  After the first cut, the "pin" will sit in the groove produced by the first cut. The board is then lifted and moved, so that the "pin" sits in the most recently cut groove. This process is repeated the length of the work piece.
I'd make a jig similar to this.
Comment: I'll try to add a diagram of the jig described above, when I get a few minutes to create a model.
Comment: +1 A router table will do this nicely, or a tablesaw would do as well using a similar setup. If the slot is wider than the width of a blade, a dado blade would help there.
Comment: In any case, a backer board is necessary to prevent tear out as the bit/blade comes through the back of the wood.


asp.net Invalid character in a Base-64 string

Question: I have a c# mobile site and have a problem with some of mobile clients. I have posted a trace below but basically browser of phone or wap gateway that phone connects to internet url encodes viewstate hidden input in the form.

/wEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA==

becomes

%2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D

so viewstate fails.
Is there anyway to override and urldecode viewstate info before proccessing?

System.Web.HttpException: The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException: Invalid viewstate.
 Client IP: 126.96.36.199
 Port: 37172
 User-Agent: SCH-R430 UP.Browser/126.96.36.199 (GUI) MMP/2.0
 ViewState: %2FwEPDwULLTExNTMyOTcwOTBkGAEFBlBtTGlzdA9nZA%3D%3D
 Referer:
 Path: /mobile/Inbox.aspx ---> System.FormatException: Invalid character in a Base-64 string.
   at System.Convert.FromBase64String(String s)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
   at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
   at System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.mobile_inbox_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Comment: (deleted my answer as I didn't spot the "viewstate" bit)
Answer: You can implement a custom ViewStatePersister object which handles this. You probably want to derive it from HiddenFieldPageStatePersister.  Take a look at this article which shows how to implement compression on top of ViewState, but is very similar to what you need to do.
There's a little bit of hackiness involved: you'll need to use reflection to set a field of the StateFormatter base class which is, contrary to what the MSDN docs say, not marked as virtual so can't be overridden without reflection.
Answer: Use below solution and check if it works. It works for me. Add this code in   your asp.net code behind which is causing the issue. Below code is in vb.net
<code>Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
        Return Session("_ViewState")
    End Function
Protected Overrides Sub SavePageStateToPersistenceMedium(viewState As Object)
        Session("_ViewState") = viewState
    End Sub
</code>
Comment: You need to provide code in the programming language the question asks, *not* the programming language of your choice.


"string" != "string"

Question: I'm doing some kind of own templates system. I want to change
<title>{site('title')}</title>

Into function "site" execution with parameter "title". Here's
private function replaceFunc($subject)
{
    foreach($this->func as $t)
    {
        $args = explode(", ", preg_replace('/\{'.$t.'\(\'([a-zA-Z,]+)\'\)\}/', '$1', $subject));
        $subject = preg_replace('/\{'.$t.'\([a-zA-Z,\']+\)\}/', call_user_func_array($t, $args), $subject);
    }
    return $subject;
}

Here's site:
function site($what)
{
    global $db;
    $s = $db->askSingle("SELECT * FROM ".DB_PREFIX."config");

    switch($what)
    {
    case 'title':
        return 'Title of page';
        break;
    case 'version':
        return $s->version;
        break;
    case 'themeDir':
        return 'lolmao';
        break;
    default:
        return false;
    }
}

I've tried to compare $what (which is for this case "title") with "title". MD5 are different. strcmp gives -1, "==", and "===" return false. What is wrong? ($what type is string. You can't change call_user_func_array into call_user_func, because later I'll be using multiple arguments)
Edit:
Strlen $what - strlen title
403 - 5
Heh - looks like I haven't cut the rest ;)
var_dump
string(403) "
title"
Comment: BTW, this is how one writes software with security holes.
Answer:
MD5 are diffrent. Strcmp gives -1,
  "==", and "===" return false.

Throw in var_dump() and strlen()
And this function for especially hard cases:
function dump(&$str) {
  $i=0;
  while (isset($str[$i])) echo strtoupper(dechex(ord($str[$i++])));
}

Comment: Probably my regex is bad, because it haven't cut off large part of site.
Answer: Have you tried to trim the whitespaces?
$what = trim($what)

Maybe there is a trailing/beginning whitespace character. Also make sure they are both equally cased:
$what = strtolower(trim($what)) //trim and lower

Answer: Are you sure that there aren't any whitespaces? Use trim() to get rid of them. If the md5s are different the strings are different. var_dump(str_split($what)) will output the string char by char, if a whitespace isn't your problem maybe this helps.
Answer:
I've tried to compare $what (which is for this case "title") with "title". MD5 are different.

That would suggest that $what is not "title". You should put in some debugging statements in there:
function site($what) {
    var_dump($what);
    die();
}

Check there's no extra spaces or characters you weren't expecting.

"string" != "string"


All of a sudden grub menu started showing

Question: I have a pure Ubuntu laptop (no dual boot). Today when I restarted, suddenly grub menu started showing. After I select Ubuntu, it boots boots as normal. So my questions are:

Why did it start appearing all of a sudden?
How do I hide it?

EDIT: output of cat /etc/default/grub:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq"
#GRUB_CMDLINE_LINUX_DEFAULT="acpi=force"
GRUB_CMDLINE_LINUX_DEFAULT=""
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"
#GRUB_CMDLINE_LINUX="acpi=force"
GRUB_CMDLINE_LINUX=""
#GRUB_CMDLINE_LINUX="acpi=noirq"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Comment: Please [edit] your question and add output of `cat /etc/default/grub` terminal command.
Comment: @Pilot6 edited the question with the details.
Comment: Run `sudo update-grub` and test.
Answer: You need to make a small change in your /etc/default/grub file to fix this problem.
Open a terminal from the Unity dashboard and do the following commands...

gksudo gedit /etc/default/grub
find the line, near the top of the file, that looks like GRUB_TIMEOUT=10
change GRUB_TIMEOUT=10 to read GRUB_TIMEOUT=0
save and quit gedit
sudo update-grub
reboot
Comment: Will try and revert shortly.
Comment: That fixed it. Why did it start appearing all of a sudden though?
Comment: @Jus12  A `Software Updater` update may have replaced the `/etc/default/grub` file with a new standard file.


Explanation and time/space complexity of tri tiling

Question: I am having problems understanding what exactly is going on in the solve function below. I see what it does, however it still is unclear to me - I cannot visualize it, or just get myself to understand it. Can someone explain it?
Original problem statement (link):

In how many ways can you tile a 3xn rectangle with 2x1 dominoes?
Here is a sample tiling of a 3x12 rectangle.

Code (taken from here):
#include <stdio.h>
int dp[32];
int solve(int n)
{
    if(dp[n]!=-1)
        return dp[n];
    else
    {
        int i;
        int res = 3*solve(n-2);
        for(i=4;i<=n;i+=2)
            res+=2*solve(n-i);
        return dp[n]=res;
    }
}
int main()
{
    int i;
    for(i=0;i<32;i+=2)
        dp[i]=-1;
    for(i=1;i<32;i+=2)
        dp[i]=0;
    dp[0]=1;
    scanf("%d",&i);
    while(i!=-1)
    {
        printf("%d\n",solve(i));
        scanf("%d",&i);
    }
    return 0;
}

Another thing is, what could be the time and space complexity of this algorithm? Since it is a recursive function, it might be O(log N), but I am not sure about that either.
Answer: Technically speaking, the runtime is O(1) because there is an upper bound on the size of the input (specifically, 32). But let's assume for a minute that the problem size isn't at most 32 and think about that problem. In that case, the runtime is O(n2). After a recursive call of some size has been made, any future recursive calls of the same size run in time O(1). This is due to the use of memoization in the dp table. This means that we can compute the total runtime by summing up, across all possible recursive calls that could be made, the amount of time required to fill in the dp table.
On a call of size n, there is O(n) work done to fill in the array. You can see this by the for loop that starts at 4 and counts up to n by two's, at each point doing O(1) work. Since the recursive calls are on sizes 0, 1, 2, ..., n, we have O(n) calls doing O(n) work each for a total of O(n2) total work.
Hope this helps!
Comment: Thanks, I get the complexity now. Could you please try to explain to me how the actual algorithm works (if you understand it)? :) I just need to know what is going on in the solve function, and how is it possible that like this it is able to count all the variations of the 3x2n tiling problem.


Is there a way to use javascript AJAX to search for all images in a folder on server?

Question: I need to find all images based on their extensions. (jpg, png, gif... etc) and place those images to be viewed in grid?
Comment: javascript is client side, so you can't do this without the help of a server side script. Check AJAX to see how this can be doable.
Answer: You can't do this with javascript alone as it's a client-side language, it doesn't "know" about the server (node.js being an exception to this).
However you can use AJAX to retreive a list of images from a PHP script or a JSP or similar.
You can read up on using PHP to get a list of files here: http://www.php.net/manual/en/function.scandir.php
And using AJAX here: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp
If you use jQuery: https://api.jquery.com/jQuery.get/
Or with JSON too: https://api.jquery.com/jQuery.getJSON/
Answer: You can do ajax request to server API, which should return that list for you. Server api can be done using Php, Asp.Net or Node.JS (which is javascript)


How to call an Epson TM-U220PD in Java to print USB port

Question: I'm trying to print on a EPSON TM-U220PD in windows 7, I', using Java for do It.
I'm developing a software for print orders in a restaurant. I did the software in linux, when I connect the printer on linux, printer works excellent. But when I connect the printer on windows It's not work.
My drivers are good, I know because I can print test page, but when I'm going to the software, printer not works.
Printer is configurated in a port "USB001"
my code is here:
<code>    public void printLocalOrder(ArrayList<String> orderArray, int n) {

    try {
        FileWriter file = new FileWriter("USB001"); //Here is the problem
        BufferedWriter buffer = new BufferedWriter(file);
        PrintWriter ps = new PrintWriter(buffer);
        ps.write(0x1B);
        ps.write("M");
        ps.write(1);
        for (String orderArray1 : orderArray) {
        ps.write(orderArray1);
        }
        ps.write(0x1B);
        ps.write("d");
        ps.write(4);
        ps.close();

    } catch (IOException e) {
        System.out.println(e);
    }
}
</code>
I have tried put the printer name so:
<code>     FileWriter file = new FileWriter("Ticketeadora"); //Name printer
</code>
But It's not works.
I hope you can help me. Thanks.
Comment: Why don't you use the facilities in Java that were made for printing?
Comment: I do not know what they are. Can you tell me about them ?
Comment: Didn't you do any research about [printing](https://docs.oracle.com/javase/7/docs/api/javax/print/package-summary.html) in Java? That's quite a poor way to start developing *anything*.
Comment: Thanks for the suggestion. I'm going to read and I'm going to search always before to start developing.
But, respect to my problem, how I can solve It ?
Comment: I think you have a big problem here. Why would you think that `new FileWriter("USB001");` connects to a printer?
Comment: because when I'm working on linux, I use this command for call the printer. `new FileWriter("/dev/usb/lp2");` lp2 is like linux detect printer.
Comment: Linux and `/dev/usb/lp2` is one thing, accessing the line printer through the file system. Windows and `USB001` is not the same thing at all. What error are you getting?
Comment: That's the strangest thing. When I'm going to print, There is not any error. The process "continue well" there are not exceptions or another thing.
Comment: And is there a file named `USB001` in the directory where you're running the program in?
Comment: No, There is not a file named USB001. `USB001` is the port where I configured my printer. And I have been searching information about how to configure this in windows and they call for example port `LPT1` or `COM4` but I have connected printer for USB. I don't know how I can call my printer for the port USB
Comment: Well, you can't. You can try [tricking](http://superuser.com/questions/182655/how-do-i-simulate-a-parallel-lpt-printer-with-a-usb-printer) to have it accessible through `LPT1`, but your current approach is and always was flawed. The wise thing to do would be to use the proper printing facilities, which I already linked to you.
Comment: OK Kayaman. I'm going to use the code you send me with printing facilities. I'm going to do tests. but I'm worried because I have some ESC commands for print with format and other things. With the link you send me I can use this commands normal ?
Comment: Nope. You probably shouldn't have gone with the line printer approach to begin with. Now you'll have to recode it or hack with the `NET USE` approach.
Comment: Thanks so much for help me. When I have done everything that you said me. I'm going to comment you for that you post a solution and I can qualify you positive
Comment: Alright. Just read up on your choices before you start doing anything. I haven't worked with the Print API, but it should provide you with better tools and better platform independence than the line printer approach.
Comment: Hi Kayaman I found a solution to my problem. First I followed your redomendation, I used Printable library and other designed by Java.
Second, I found this link, [Example printable java](http://www.mets-blog.com/java-pos-thermal-printer-example/) and I did everything there. Thanks so much for open my mind and help me
Comment: Glad to hear you got it working.
Answer: escpos-coffee is a Java library for ESC/POS printer commands. Can send text, images and barcodes to the printer. All commands are send to one OutputStream, then you can redirect to printer, file or network.
Code example:
<code>  PrintService printService = PrinterOutputStream.getPrintServiceByName("printerName");
  PrinterOutputStream printerOutputStream = new PrinterOutputStream(printService);
  EscPos escpos = new EscPos(printerOutputStream);
  escpos.writeLF("Hello Wold");
  escpos.feed(5);
  escpos.cut(EscPos.CutMode.FULL);
  escpos.close();
</code>


Configuring the install location for eclipse

Question: I am trying to set where my app will be installed, so far I have tried to put the path into
<code>android:installLocation="android/data/com/installedpath"
</code>
But the error said i wrote the wrong format, so do you guys know the correct format for the Install Location part?
Thank you
Answer: According Android Development Guide (http://developer.android.com/intl/es/guide/topics/data/install-location.html), this attribute could contain two values: "preferExternal" or "auto".
And its use is to allow to install the application on external storage.


Can I place rooms/equipment specific to non-alchemy professions in my Whiterun House?

Question: I've just purchased my first house in Skyrim, the one for 5000 gold in Whiterun. I see that I can add an alchemy lab, but that appears to be it. I'd like to add an enchanting table - is this possible? If not, will it be later on, perhaps in a different house?
Comment: the easiest enchanting table is in riverwood at the inn, its in the hidden celler, behind the big cabnet. just a quick trip away!!
Answer: As @yx. said, you cannot get anything besides what Proventus Avenicci will sell you (the only "useful" thing is the alchemy lab) in Breezehome.
If you're looking for a location to sleep and store things in a non-respawning container that has an enchanting table, I highly recommend the College of Winterhold.  For only 30 gold (to get into the College, which you don't need to pay if you already have the spell she asks for), you get a room in the College's living quarters (with a bed and a chest), which has an enchanting table and alchemy lab in the same zone.
Comment: Nice tip about the College - I'll be sure to check it out once I'm there.
Comment: I had `fear` to enter. But where did you get that the container in your college room is non-respawning? Other questions on this site seem to be not so sure.
Comment: fyi the spell she asks you to cast is randomized each time, so not necessarily its magelight.  In my 2 times so far, it was fire bolt and healing hands.
Comment: Oh, neat - is it ever more than 30 gold?
Comment: Great tip. I just started my "other" character as a mage, and I did not fancy saving up for the house in Whiterun just to get a place to store my stuff.
Answer: Its not possible to place a enchanting table into the house.  I've purchased all the upgrades and the only thing is the alchemy table.  I am unsure of other houses as I haven't purchased all of them yet.  (Solitude one costs a whooping 25k gold)
Comment: Thanks. Nice perk if you're an alchemist, and I suppose it makes sense given that they have hundreds of ingredients to store.
Answer: I don't know about buying houses but if you head to Anise's shack (just west of Riverwood) and kill her, she has a cellar with an enchanting table and alchemy lab. There's also a barrel or two but I'm not sure if it's safe to store stuff in.
Comment: Awesome.  I didn't know about this.  I will kill her tonight after I get off work and eat dinner.