Can we have fractal dimension more than 3?

Question: Menger sponge is a 3d fractal however it's fractal dimension is still less than 3. In fact  most of the natural objects like coast lines have fractal dimensions between 2 and 3. This might be because we are calculating fractal surface dimension. But how does it make sense to have a 3d fractal (menger sponge) and get 2.727d value?
Comment: This is just a matter of expressing the generating equation in $\mathbb{R}^n$, and i dont see any impedimeny to formulate them in major dimensions. Besides one thing is the space dimension, and other is the dimension metric associated with the set.
Answer: That would of course depend on the exact definition for the fractal dimension, but if we're using box-counting definition then there's nothing hindering it, you just have to create it in a dimension larger than $3$ to start with.
For the box-counting dimension the dimension of the space the fractal is a subset of is a hard limit.
Comment: Indeed, every notion of dimension that I am aware of is monotone, in the sense that if $A \subseteq B$, then $\dim(A) \le \dim(B)$.  Also, every notion of dimension that I am aware of has $\dim(\mathbb{R}^n) = n$ (with respect to the usual Euclidean metric).  Thus no subspace of $\mathbb{R}^n$ can ever have dimension greater than $n$.
Comment: " you just have to create it in a dimension larger than 3 to start with." Is there any software for that?
Answer: As skyking pointed out, there are various ways to characterize the "dimension" of a set.  However, when we are talking about fractals, we are generally trying to connect metric properties with properties of measures.  Roughly speaking, a metric is a way of measuring distances between points in an abstract set, while a measure is a way of measuring the "volume" (or length, or area, or content) of a set.
For example, if we shrink a cube by a factor of $\frac{1}{2}$, we are reducing all of the distances by a factor of $\frac{1}{2}$.  Thus a cube that is 1 unit on each side shrinks down to a cube that is $\frac{1}{2}$ of a unit on each side.  However, the measure of a cube is the product of its length, width, and height.  Thus the original cube has a measure (or volume) of 1 unit$^3$, while the smaller cube has a measure of $\frac{1}{2^3}$ units$^3$.  In general, if we compare the scaling of a unit cube and the volume of a scaled cube, we get the relation
$$ \text{volume} = \text{scaling}^3.$$
The exponent on the length tells us about the dimension of a cube; a cube is three-dimensional.
Generalizing this construction to a Menger sponge, suppose that the volume of some Menger sponge is 1.  If we shrink the sponge down by a factor of $\frac{1}{3}$, what is the volume?  This is a little hard to get at directly, but notice that I can put 20 of the scaled sponges together to get the original sponge.  Since each of these 20 little sponges are identical, it is reasonable to assume that they all have the same volume, thus if we let $v$ represent the volume of the little sponges, we have
$$ 1 = 20v \implies v = \frac{1}{20}. $$
But we also know that the volume of the little sponges should behave like side length raised to some power, thus we have
$$ v = \left( \frac{1}{3} \right)^s. $$
But now we have
$$ \frac{1}{20} = \left(\frac{1}{3}\right)^s
\implies -\log(20) = -s \log(3)
\implies s = \frac{-\log(20)}{-\log(3)} = \frac{\log(20)}{\log(3)} \approx 2.7268. $$
Thus the Menger sponge is about 2.7-dimensional.
Comment: but hansdoff dimension should exceed topological dimension of 3?
Comment: If by "topological dimension" you mean Lebesgue covering dimension, my recollection is that the Lebesgue covering dimension of the sponge is 1.  I'm not sure I understand the problem...
Comment: Sponge occupies space so it's topological dimension is 3 bu then it's hansdoff dimension is 2.72
Comment: @quantised What do you mean that it "occupies space?"  It is a subset of $\mathbb{R}^3$, but so is a smooth curve, which is very much one-dimensional.  The sponge has zero Lebesgue measure, so in that sense, it *does not* occupy space.  And, again, its Lebesgue covering dimension (the usual notion of topological dimension) is 1.


how do I save all my texts before I reset it?

Question: I have an android HTC 660 how do I save all my texts before I reset it? Not for sure how to send to my SIM card
Answer: HoverChat has an SMS backup feature. It saves all your SMS in a .ninja file, then you can send it in a mail. You must have HoverChat if you want to restore your backup afterwards.
Answer: I have looked up on the web there's a couple of applications such as :

SMS Backup+
G Cloud Backup
SMS backup restore

Personally,I would take a couple of screenshots and send them into my PC(as backup). Then reset my cell phone and re-transfer my pictures into it.
But if you want them as a txt form, use an application to back up them.
Answer: Install Superbackup and make backup of contacts , texts and call logs and you can move it local SD card to your inbox.


Can I host a SandstoneDB app on www.Seasidehosting.st?

Question: Did someone ever manage to make a seasidehosting-hosted web application cooperate with SandstoneDb? It seems that they disallow creating of subdirectories, which is important for SandstoneDb. Am I wrong?
Answer: I haven't personally tried sandstoneDB on seasidehosting.st, but I know that it is possible to create subdirectories. Just stay below FileDirectory default. The Pier CMS also uses a file structure to store data and it perfectly works on seasidehosting.st.
Answer: Ok, i talked to the sandstoneDB inventor AND to the seasidehosting.st support staff. They are both fantastically friendly and helpful. (They did not communicate to each other, but I think I got it figured out by now.
So, it turns out that you CAN create files and directories on seasidehosting.st. But not the way sandstoneDB does it. Here's the general workaround:  http://lists.squeakfoundation.org/pipermail/seaside/2006-August/008746.html.
So, I think I will modify SandstoneDB to create its files this way and I hope that Ramon will put the change into his release.
cheers,
Niko
Edit: This is becoming a major operation. I've read this thread now and it is not the solution to my problems. I am not even completely certain what my problem is.
I think this is going to be a little more of a problem and I will need something like Smalltalk-shell access on the server. This basically means that I will have to switchc my app to development mode on the server. It's a little scary. But I really see no other way. I've uploaded enough files of 20 MB each. Time for the big guns. But not today. On the weekend.


The requested URL /magento/ was not found on this server

Question: I try to install magaento2 with php7 apache2 from web.
it succeded. Installation succeeded.
Magento Admin Info:

Username:
admin
Email:
email@example.com
Password:
******
Your Store Address:
http://localhost/magento/
Magento Admin Address:
http://localhost/magento/admin/

but when i click those linkss
i got error
Not Found

The requested URL /magento/ was not found on this server.

Apache/2.4.18 (Ubuntu) Server at localhost Port 80

in other topics, people say
go to
/etc/php/7.0/apache2/conf.d

and some lines. But at that directory, i hve a lot of ini, it is not a texxtfile
"/etc/php/7.0/apache2/conf.d" is a directory.

when i try to open wit gedit
what can i do now?
but for
gedit /etc/apache2/apache2.conf

it shows
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf-enabled
#   |   `-- *.conf
#   `-- sites-enabled
#       `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.

# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
Mutex file:${APACHE_LOCK_DIR} default

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 188.8.131.52 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

when i change some parts, it affects the localhost root. for example when i dsable, localhost becomes forbidden.
this is error log
[Thu Sep 08 10:08:07.838247 2016] [mpm_prefork:notice] [pid 27202] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Sep 08 10:08:07.838287 2016] [core:notice] [pid 27202] AH00094: Command line: '/usr/sbin/apache2'
[Thu Sep 08 10:08:10.217465 2016] [mpm_prefork:notice] [pid 27202] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Thu Sep 08 10:08:10.264056 2016] [mpm_prefork:notice] [pid 27202] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Sep 08 10:08:10.264067 2016] [core:notice] [pid 27202] AH00094: Command line: '/usr/sbin/apache2'

in
/var/log/apache2/error.log

i also created apache.conf like this
<VirtualHost *:80>
    DocumentRoot /var/www/html
    <Directory /var/www/html/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>

in
/etc/apache2/sites-available/magento.conf

and theen did this
sudo a2ensite magento.conf
sudo a2dissite 000-default.conf

i looked from here but
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-magento-on-ubuntu-14-04
but nothing changed
Answer: The default port used for http in apache is 8080 .
So try accessing your store through this url:
http://localhost:8080/magento
Comment: Sir i use apache v2.4 and the default port is 8080 for http and 443 for https. so according to me the default port is 8080 for  http on Apache 2.And u should not configure apache to listen to port 80 as it is already reserverd to avoid such errors.
Comment: Pretty sure the default port is 80 on Apache 2
Comment: http://localhost:8080/magento cant be rached. localhost 80 forwards to localhost and same error


Is there a shortcut key for changing Google Sheets text color to the "last color"?

Question: I often find myself changing text colors to the same color for five minutes at a time which is really unnecessarily mouse-intensive.
Comment: I'd rather use autoformat and change a value of some cell (autoformat can apply to a cell based on other cell value, use "formula" method)
Comment: @LogicDaemon if you think this is a valuable way to do this, please write up a fully functional answer.
Comment: It will not be doing exactly "this". To apply autoformatting, the whole workflow will have to change. But without any specifics, I cannot advise any further, this is why it's a comment, not an answer.
Answer: If the last action that you made was to apply the color then use Redo Ctrl + y
Answer: Here are the steps:

Press Alt + /
Type the color (eg. blue, red etc)
Hit Enter

Alt + / is like a command palette for all available commands. It's in Help menu.
Comment: For changing a color to "dark green 3", that's still quite a lot of keys to press.
Answer: The answer is no for:

shortcut key for changing text color to the last color?

but you can always make one for color change:

first you will need to click on the toolbar/ribbon to escape the cell

now use this combo:

 10x +  15x +  3x + select color
now you can use something like AHK to save this combo (including that initial click) under one key. for example:

red color under F7 key: click + tab (10x) + right arrow (15x) + down arrow (4x) + right arrow (1x) + enter
reset (black) color under F8 key: click + tab (10x) + right arrow (15x) + down arrow (1x) + enter
Comment: Based on SM Adnan's answer, I've been using the following script in AHK:
F7::
Send, {alt down}
Send, {/ down}
Send, {alt up}
Send, {/ up}
Sleep 100
Send, red
Send, {Down}
Send, {Down}
Send, {Enter}
return
Comment: Nowadays you need 13×tab + 17×→. Might depend on your system and google account features, though.
Answer:
Copy the cell that has the formatting that you need (Ctrl+C)
Paste format only on top of the cell(s) that you want to be formatted the same way (Ctrl+Alt+V)
Answer: No there is not. But you can try following topic? maybe it will be a solution for you, to override some keys on new ones.
https://productforums.google.com/forum/?hl=en#!category-topic/docs/docs-community/lOia0JT4dX4
Comment: The related thread is very old. The  initial post was posted almost 10 years ago and was locked on 2010.


User story for drag and drop feature

Question: Can anyone help me create a User Story for the dragging and dropping feature, where I can drag and drop projects from "New Project" to "In progress" etc Column
Comment: Hi -- it would help us for you to show us what you know, what you have tried and then ask a specific question.  Unfortunately, this isn't a programming question -- so it might be closed as off topic.  If you ask elsewhere, you should try to write the story as best you can and ask for advice/help on making it better
Comment: Maybe this will help you get started: https://www.atlassian.com/agile/project-management/user-stories
Comment: I actually want to know the acceptance criteria for dragging and dropping projects across different column
Answer: User-stories describes a feature from the user's point of view, making clear what the user wants to achieve.  We cannot invent stories for your users: normally, you should discuss this with your users.  But if you're learning and it could help, here an hypothetical example:

As a project manager I can drag a project icon in the "new project" column across my kanban board and drop it on the "in progress" column, so that I can easily and intuitively communicate that a project was started and is still going on.

Be aware that referring explicitly to a drag and drop seems very detailed and might not leave much room to propose better solutions. In this regard, you need to keep in mind that a story is not a detailed specification.  It's just a placeholder for a conversation.  Personally, I'd rather go for something simpler like:

As a project manager I can easily chose a project to launch and show that it is currently in-progress, so that the other users know on which project they may work.

I would then discuss with the user about the details of the story.  Maybe drag and drop is the way to go. Maybe keyboard control (tab to select, space to chose target) is needed for accessibility reasons.  But perhaps I'll discover that some users prefer to update the status in the project card if it's on the screen.
Anyhow, during this conversation you'd write down all the expectations, positive and negative, for the acceptance criteria.  For example:

Dragging from "new" and dropping on "new" cancels the drag&drop operation
When dragging from "new" a visual feedback should be given to show the project moving
During the dragging,  the use of the escape button may cancel the operation.
When the project is dropped by accident,  the user may undo the operation.
When the project is successfully dropped on the "in progress" column,  any open view of the project card should be immediately opened to show the new status of the project.
Attempting to drag a project, of which the user is not responsible, should lead to an error message about missing authorisations, etc.. .

User story for drag and drop feature


Is sarcasm prohibited in Islam?

Question: When being sarcastic, usually what is being said is opposite to the truth but in an expression or tone which can give away that one is being sarcastic. So is it considered forbidden and same as lying?
Answer: You can divide sarcasm into two types:

Involving Lying

Not involving lying

The second is in the Quran itself, so that is definitely halal:

Those who defy Allah's signs and kill the prophets unjustly, and kill those who call for justice from among the people, congratulate them of a painful punishment. (3:21)

The word used here for "congratulate" is بَشِّر, and a commentary on what it means:

ما البِشارَةُ ؟ الجَوابُ: أنَّها الخَبَرُ الَّذِي يُظْهِرُ السُّرُورَ، ولِهَذا قالَ الفُقَهاءُ: إذا قالَ لِعَبِيدِهِ: أيُّكم بَشَّرَنِي بِقُدُومِ فُلانٍ فَهو حُرٌّ، فَبَشَّرُوهُ فُرادى عُتِقَ أوَّلُهم؛ لِأنَّهُ هو الَّذِي أفادَ خَبَرُهُ السُّرُورَ، ولَوْ قالَ مَكانَ بَشَّرَنِي: أخْبَرَنِي، عُتِقُوا جَمِيعًا؛ لِأنَّهم جَمِيعًا أخْبَرُوهُ، ومِنهُ البَشَرَةُ لِظاهِرِ الجِلْدِ، وتَباشِيرُ الصُّبْحِ: ما ظَهَرَ مِن أوائِلِ ضَوْئِهِ، وأمّا ﴿فَبَشِّرْهم بِعَذابٍ ألِيمٍ﴾ [آل عمران: ٢١] فَمِنَ الكَلامِ الَّذِي يُقْصَدُ بِهِ الِاسْتِهْزاءُ الزّائِدُ في غَيْظِ المُسْتَهْزَأِ بِهِ، كَما يَقُولُ الرَّجُلُ لِعَدُوِّهِ: أبْشِرْ بِقَتْلِ ذُرِّيَّتِكَ ونَهْبِ مالِكَ.
What is Bishaarah? Answer: It is a news that brings happiness [...] As for "congratulate them of a painful punishment" (3:21), it is a mocking phrase that increases the severity on the one being mocked. It is similar to how a man would say to his enemy, "Congratulations on the death of your children and destruction of your wealth." (Tafsir Ar-Razi)

As you can see, Allah did not make any lying statement, but the sarcasm was instead with his word choice of using 'congratulate' for a punishment.
But, the other type of sarcasm is basically lying but meaning the opposite. Something like this:

Person A: You have got to believe me!
Person B: Sure, I believe you.

This type is not good and should be avoided. Lying is a sin in Islam:

The Prophet (ﷺ) said, "Whoever does not give up false statements (i.e. telling lies), and evil deeds, and speaking bad words to others, Allah is not in need of his (fasting) leaving his food and drink." (Sahih Bukhari)
"The sign of a hypocrite is that whenever he speaks he lies, and whenever he makes a promise he does not fulfill it, and if he is entrusted he betrays." (Jami Tirmidhi)
"Woe to the one who talks about something to make the people laugh, in which he lies. Woe to him! Woe to him!" (Jami Tirmidhi)
Abdullah said, "Lying is not correct, neither in seriousness nor in jest. None of you should promise his child something and then not give it to him. (Adab Mufrad)
"They said: 'O Messenger of Allah! You joke with us?' He said: 'Indeed I do not say except what is true.'" (Jami Tirmidhi)

It is still considered lying regardless of the unsaid meaning.
The third hadith above clinches it since the Prophet (SAW) did not even allow lying for humor, and sarcasm at its best is humorous and at its worst creates negative feelings between people. So, it is not allowed so much that the Prophet (SAW) cursed the one who does it.
Answer: A deliberate lie can be defined as an untrue statement meant to deceive. Since when are being sarcastic, the meaning is understood by both parties, it cannot be called a deliberate lie, same as fiction or figurative language cannot be called a lie. What matters is your intention to convey the truth and not get laughs by fabricating a false story since that is prohibited in Islam.
The Prophet (Pbuh) said :
" Woe to him who speaks and tells lies so as to make people laugh thereby. Woe to him! Woe to him!"
I hope this time my answer is satisfactory
Answer: Lying refers only to actual lies where the intent is to deceive.
For more information, I am quoting : the Fatwa Department Research Committee - chaired by Sheikh `Abd al-Wahhâb al-Turayrî

Sarcasm is to say something with an underlying insulting or caustic implication. Irony is a form of expression in which an understood implicit meaning is concealed or contradicted by the explicit meaning of the expression. Sarcasm is often used in conjunction with irony. Both of these modes of speech are often conveyed with a particular vocal intonation when spoken and are sometimes rendered with italics when written, like in: "Great! That's all I need!" or "Oh, very funny".

What matters is the honesty of the meaning that is being conveyed by the communication, not the literal implications of the words.

For instance, in the example that you give in your question, a person is writing something down. The onlooker can see this, but asks: "Are you writings something?"

The person who is writing responds to the onlooker's question by saying: "No, I am playing football."

What he means is: "Of course I am writing, and it is silly of you to ask." This is the meaning that is communicated and understood.

In English, there are some phrases that are always ironic. Consider when a person says: "Big deal" or "Wise guy".

Therefore, ironic and sarcastic statements are not lies, any more than figurative speech is a lie. "He was a lion on the football field" is a figurative statement, not a lie - though certainly the football payer is not a great cat.

In the same way, irony and sarcasm are recognized modes of speech which convey an intended meaning understood by both the speaker and the listener.

Irony and sarcasm are therefore quite different than a joke that is a deliberate lie, where the teller of the joke means to communicate a falsehood. Whether or not the listener is aware that it is a lie, what matters is that the speaker fully intends to communicate by what he says a meaning that is false, with the intention of provoking laughter on account of that falsehood.

And Allah knows best.

The following video provided greater insight on how to joke without crossing boundaries
https://www.youtube.com/watch?v=6dPI4W5XZlk (Yasir Qadhi - Joking in Islam)
Answer: Doing Sarcasm only suits the Creator . Not creation . Because only He SWT is pure from any fault . And he did not allow us to make fun of His creation .

Is sarcasm prohibited in Islam?


Affiliation in collaborative work

Question: If I contribute to a collaborative research work in the conceptualization and data analysis phase (not with the PI), can I use the name of my university in the affiliation ? I have heard that I can only use the university affiliation if I have used the university resources or the research was carried out in the university. But if I am contributing to the conceptualization and data analysis, I am technically not using any university resource. Then what should be my affiliation ?
Comment: Are you a student or faculty member at that institution?
Comment: @Buffy I started the work as an independent research (mainly involving statistical studies) during my PhD, asked my supervisor for help - which he didn't. So, I carried out the work on my own. Now I am doing job in industry which is also unrelated to the topic of the project. Recently, I have found a collaborator and with his research work I can combine my personal project work. But I am thinking about which affiliation to use as the work was technically done during my PhD but not with my supervisor, I can't use the name of my current company either
Comment: Independent researcher usually works
Comment: @Buffy I thought about that. But I can not see many research papers authored by independent researchers in reputed peer reviewed journals. I had the impression that the publishers don't take independent researchers seriously, as it is hard to say whether the researcher has a PhD from Oxford or is an amateur writer
Comment: No, there just aren't many independent researchers out there.
Answer: Consider affiliation to be a mutual thing. If you are employed by a university or you are a student there then you are affiliated with them. It isn't about resources, but about a relationship that is recognized by both parties. I once did some consulting to IBM, but I wasn't affiliated with them. The people I consulted with there, were, however, affiliated (employees).
You aren't affiliated with the university of a collaborator unless they, somehow, recognize that relationship and will attest to it if asked. That is still true even if you somehow use some of their resources on a collaborative project.
There can be edge cases, of course. If a university founds some research center and invites you as a member of the team, even unpaid, you can probably claim affiliation. But most cases aren't that subtle. Collaboration between faculty at different institutions isn't the same thing.

Affiliation in collaborative work


Is there a #define associated with the SubSystem

Question: I'm creating main with a macro and need to be able to check the selected SubSystem at compile time, /SUBSYSTEM:WINDOWS or /SUBSYSTEM:CONSOLE, in order to generate the appropriate main function.  Is there a #define I can check that accomplishes this?
Comment: You should not generate a main function, because generating it is worthless to yourself and a hindrance to others. I.e. it has negative utility to do it. But if you do, like, hell-bent on generating a `main` function, then *generate a standard `main`*. It works fine no matter subsystem of the build. Note: with Microsoft tools, which are a bit challenged in this department, set linker option `/entry:mainCRTStartup` unless you're doing an MFC application, in which case you're up against the problem of others (namely Microsoft) having had the same Really Bad Idea™ of taking over `main`.
Answer: _CONSOLE should do the trick for you.
Also you can select the subsystem using #pragma comment( linker, "/subsystem:windows" ) or #pragma comment( linker, "/subsystem:console" ) if you really want to go this route.
Comment: This is definitely the better answer as it directly answers the original question of manually specifying the system vs. letting the linker determine it (or changing project settings).
Comment: How/where does `_CONSOLE` get defined?
Comment: @jww You have to pass it as a compiler option `/D "_CONSOLE"`.
Answer: If you are trying to make things easy for users of your library (or whatever it is), you could just generate both WinMain and main from your macro. The linker by default sets console apps to start at main, and win32 apps to start at WinMain. The other "main" function will be ignored.
(Presumably the rest of the code doesn't use any of the main function arguments (argc, argv, hInstance, etc.), if it's to work with both.)
The _CONSOLE define could be used, but it doesn't appear automatically; you have to add it manually in to the project properties. The selection of startup symbol, on the other hand, is automatic. So just providing both functions, and letting the linker pick, might make life easier, because the project creator doesn't have to set anything up, and can indeed switch from windows to console app (possibly even per-configuration) without having to do anything.
Comment: "The linker by default sets console apps to start at main, and win32 apps to start at WinMain". No. (1) That's the Microsoft linker, not e.g. the MinGW linker. And (2) execution doesn't start at these functions.
Answer: That's not how it really works.  You have to write dramatically different code in a console app vs a native Windows app.  In a console app, you use printf or cout to produce output, don't have much if any use for a mouse.  A native Windows app requires a message loop and creating a window with a window procedure that detects the WM_PAINT message to update the window.  Etcetera.
But you can write code that does both.  Just write both a main() and a WinMain() function, the CRT automatically calls the correct one.
Comment: Indeed. All my apps are console apps in the debug build, and it's basically 6 lines of extra code: a main function that does `return WinMain(0,0,0,0)`, all inside `#ifdef _CONSOLE`. You don't even really need the `#ifdef`.
Comment: While the statements you made are true, they don't tell the whole story. It is possible to write an application that functions with or without the console subsystem via a few small tweeks. Typically this would be a windowless application (or it may simply call MessageBox) and have no UI thread. The standard pipes are available to non-console apps as well, though of course their output would not be seen unless redirected.


Can't setup reminder or calendar appointment using Siri on Mac

Question: Any idea why I can't setup a reminder or calendar appointment with Siri on the Mac? When I attempt to setup a reminder I just get her saying "One sec". When I press confirm after telling her to setup an appointment I get "Sorry Scott I can't do that".
Any ideas? Is there something I have to do to get these useful features working?
Answer: In System Settings, grant permissions to access Calendar and Location data for Siri, then disable and re-enable Siri.


Can't run Doggcatcher and Endomondo simultaneously

Question: I'd like to listen to music with Doggcatcher and record the routes with Endomondo while bicycling. The problem is, when I start Endomondo, after a couple of minutes Android kills Doggcatcher. When I start Doggcatcher, after a couple of minutes Android kills Endomondo. What can I do? I'd rather kill any other application or service than these two, but I've already tried uninstalling almost every other app except the system apps. I have stock Android ICS and Huawei Honor.
Comment: Rather than editing your solution into your question, you should create a new answer with that information and then _accept_ it.
Answer: I'm answering my own question from what I've gathered. There seems to be no way to prioritize, say, Doggcatcher, if it's playing music in the background. When the operating system runs out of memory, it starts summarily killing background processes. The best I can do is kill dispensable background processes before starting these two apps.
First I turn off sync. Then I go to Manage apps and open the Running tab, note which apps are running, open the Downloaded tab, and from there Force stop the apps. Note that if you simply stop the services from the Running tab, the apps will usually restart them. After that I clear the app cache from the All tab. I'm not sure how necessary this step is, as the problem occurs rather nondeterministically. After that I start Doggcatcher and Endomondo.
Especially Facebook app just keeps starting all kinds of services that consume a lot of memory, no matter how it's configured, so I uninstalled the app and started using the mobile site with web browser. The mobile site is also more robust, I think it has more features, and I got rid of the annoying notifications.
Comment: You're right that when memory is tight, Android starts killing background services; but if it shows an "ongoing" notification then Doggcatcher is running as a *foreground* service. This ensures that Android won't kill it until there are no background services left.
Comment: Now that you mention, I don't think Doggcatcher shows the playback controls in the notification area anymore. I don't know if that's the problem, but surely Android kills Doggcatcher while Facebook and other apps still have a bunch of background services running.
Comment: If it doesn't, then that's a bug in Doggcatcher, and you should report it to the author. Its screenshots on Google Play show a notification icon.
Comment: Thanks for the tip. Turned out Doggcatcher should show a notification icon when playing music in the background with the intention of keeping it alive. Usually it doesn't, but changing the preference Settings > Advanced > Keep Alive to Always will make the notification icon stay there. (Now the icon shows even when Doggcatcher is not playing music, but it doesn't matter since one can exit the application to release the memory it's reserving.)


How do I properly model orbitals in the EveHQ HQF Damage Analysis?

Question: When calculating chances to hit, how do you properly setup their velocity vectors for two ships trying to orbit each other? And one ship trying to orbit the other ship who is approaching?
Answer: You should be using the transverse velocity of the ship that is orbiting you and make the vector for that speed perpendicular to the ship that is firing.  Leave the ship that is firing stationary.
The math gets more complicated when you make an elliptical orbit, as you need to change the direction of the orbiting ship's velocity; it is no longer perfectly perpendicular.  The best model for this could be the speed and direction each ship is moving in at the exact moment of firing, but that isn't exactly what you want, is it?
Answer: Full disclaimer: I always screwed up vector assignments in my physics class. I'd suggest looking up orbital state vectors for a better description.  What follows are my best guesses as to how you'd go about this.
One approximation I think that will get the job done for you is to treat the slower ship as stationary and the orbital velocity of the faster object reduced by the speed of the slower ship.  So an interceptor going 4k orbiting a rifter going 2k would be the equivalent of the interceptor going 2k orbiting a stationary rifter.
In all orbits, both bodies are actually in orbit.  If the solar system consisted of the Earth and the Sun, the Sun would still have an orbit, though the radius of the orbit would be well inside the radius of the sun itself.  In the case of two ships whose speeds are comparable, the effect you will see is roughly equivalent to a double helix, which is basically two circles being translated along another axis.


Battery charging- Float mode and boost mode

Question: Based on my knowledge on batteries (AGM), the initial battery charging (for ex. a 12V, 200AH battery and a 24V, 20 amp charger ), takes not more than 2-3 hours for the first 70% charge and then it takes like 4-5 hours to charge to 100%. Why is that the initial charging happens so fast ?
Comment: You _MUST NOT_ charge a 12 volt battery with a 24 volt charger - that would destroy the battery  and/or charger!
Answer: A 12 volt "Smart" charger will deliver its full rated current until the battery's voltage reaches about 14.4 volts, then will reduce the charging current to maintain 14.4 volts.  After some time, the charger will reduce the charging current to allow the voltage to drop to a float charge level.
If you try charging a 12 volt battery with a 24 volt charger, the charger will deliver its full rated current for ever, as the battery voltage will never get up to the 28.8 volts the charger is trying for.  The battery will eventually boil dry and be destroyed.


Is there a term for the group of individual organisms whose matrilineally descended female ancestors all share a common ancestor?

Question: A group of individual organisms that are all descended from a common ancestor is a clade. Is there a term for a group of individuals whose matrilineally descended ancestors (mothers, maternal grandmothers, maternal grandmothers' mothers, etc.) are all descended from a common ancestor?
Answer: I don't think there is a word for that.
However, you can refer to this specific DNA sequence as being exclusively maternally inherited (such as mtDNA for example; see also mtEve). For this sequence, the classical vocabulary from the field of phylogenetics and population genetics apply nicely.
Answer: I'm not aware of any one-word term for this. The term "common mitochondrial ancestor" is often used to refer to a shared female ancestor of a genetically related group. If you want to specify female descendants only, perhaps you could say "females sharing a common mitochondrial ancestor". I think that's about the shortest way to say it.
Comment: Thanks for this. I'm not specifying only females at the end of the chains, but every link above every group member must be female until you get to a female who is a common ancestor. So "all individuals who share a mitochrondrial ancestor" does the job nicely.


How does the Bone Orchard work in Bang! Wild West Show

Question: In Bang! When the Bone Orchard is still active, can the player return to the game many times or just once?
Answer: Yes, you can return to the game multiple times while BONE ORCHARD is in play.

Like a lot of rules in Bang! this is covered in the original Italian rules but was left out of the English translation.
Luckily the publisher has this covered in their English FAQ under Q21.

Q21. If I come back in play with Bone Orchad and I am killed again,
if the Bone Orchard is still in play when it is my next turn, do I
come back in play again?
A. Yes, you may come back into play at the beginning of each of your
turn while the Bone Orchard is play


Solid ended dashed line on Inkscape

Question: Using Inkscape 0.92.4, is there a way to have a dashed line of whatever length in which both ends have the drawn part of the pattern? Like the length of the dashes varies a bit from the one chosen to have an integer uneven number of segments.
Answer: TL;DR: No, but there are some hacks.
I'm not sure how useful they will be for your particular use case, but here goes:
As far as I know, there is no way to make the stroke-dasharray change dynamically as you adjust the length of the line, at least not by moving an end node.
However, you can edit the stroke-dasharay in the XML editor manually.
For example, a stroke-dasharay of 16 and 5 (total 20) will fit 5 times in a line of length 100 units.

Once you have a dash that fits a line, you can group (Ctrl+G) the line, then stretch it  with the Select and Transform Objects tool (F1), and the dashes and gaps will stretch.  This is achieved by adding a Matrix Transform to the group, it doesn't change the stroke-dasharay.
Example

Note: When you ungroup the line, the Matrix Transform will be released.
Comment: @Moini - Sure, but then using the xml editor to edit the stroke-dasharay avoids the need to eye-ball it. Ultimately it depends on how much precision the OP wants.  Perhaps you should write an answer. There's always more than one way to skin a cat!
Comment: I think it could be faster to change the line length with the node tool until it fits, instead of using the xml editor, then using the selection tool to stretch it with the option to 'scale stroke width when object is scaled' on.
Comment: I can set some custom `stroke-dasharray` on the XML editor (that is enough for my needs) but the grouping doesn´t work for me. The number of dashes change as I stretch the line.

Solid ended dashed line on Inkscape


leave one pair out cross validation

Question: I am trying to train and validate my datasets which contains 17 datasets. I have divided them as 15 for training and 2 for validation.
In the process, I train on 15 datasets and use the generated  model to predict the results on the remaining 2 datasets. This process is called leave out validation in my understanding.
Irrespective of the classifier  I use (SVM, optimizable SVM, knn, optimizable KNN), I always get a very high training accuracy closer to 90-100%.
The validation accuracy is comparatively poorer closer to 50-60  %.
The datasets in the validation set will be a part of training in some runs. In this case, I can not understand if they are doing so good in the training why the validation results are so bad.?
Answer: [edited after clarification by OP]

I can not understand if they are doing so good in the training why the validation results are so bad.?

This is certainly due to major differences between the datasets. Supervised learning relies on the assumption that both the training set and the test set are samples from the same population (i.e. they follow the same distribution). In your case the model assumes that the 15 datasets used as training data are a representative sample of "the" data distribution. If the two datasets used as test set have very different distributions, then what the model learned is simply not applicable to the test set.
I think this is a form of overfitting: the model learns some details of the instances instead of the true patterns which matter for the target variable. These details actually happen in the training set, so the performance is good on it. But they don't happen (at least not in the same way) in the validation set, so the true performance is poor.
Note: your evaluation setting is similar to leave one out (LOO) cross-validation, but this is not LOO because LOO means leaving a single instance as test set.
Comment: Hi. I mean datasets itself. So there around 700 instances in each dataset and 10500 instances on which model is trained in every iteration
Comment: @PallaviPatil Oh ok, I thought this was a confusion sorry. I changed the answer to take this into account.

leave one pair out cross validation


XCode can't find symbols for a specific iOS library/framework project

Question: I'm having a problem with breakpoints in the source code of a specific library / framework (new to Xcode - i'm not sure what the correct term is) in a fairly large iOS project.  I have all the code for this library. Breakpoints are working fine everywhere else, but in this one specific library, all breakpoints are ignored.
I can put a breakpoint in a function called from within one of those source files, and it will trigger, but then the callstack shows "__lldb_unnamed_function" for the location in the file i'm interested in, as if the symbols have been stripped.
I have the following settings for the library in question
<code>Generate Debug Symbols = YES
Strip Debug Symbols During Copy = NO
Strip Linked Product = NO
Dead Code Stripping = NO
</code>
I have been using a lot of #ifdefs to test alternate implementations of a few functions so i thought some stuff might be getting marked as dead code by accident (hence that last setting).  I already tried clean/rebuild.  I tried completely removing the app from the target iPhone.  I tried deleting intermediate file folder under
<code>/Library/Developer/Xcode/DerivedData
</code>
The code is definitely executing because all my NSLog calls show up properly.
I don't have much experience with Xcode so i'm hoping i'm just missing something simple
Thanks
Comment: Try to set Symbolic breakpoint
Comment: Thanks, i tried  symbolic breakpoints for several methods but none were triggered.  Had to look up how to set them: [link](https://developer.apple.com/library/ios/recipes/xcode_help-breakpoint_navigator/articles/adding_a_symbolic_breakpoint.html)
Comment: I did experience the same problem once, and it was caused by Cache stuff as you mentioned above. The methods you tried helped me that time. Did you also tried to clean up Build folder (press Cmd key when Xcode Product menu is dropped down)?
Comment: Thanks, i was not aware of that command.  Although it seems to be Option/Alt that you have to hold down, not Cmd.  I gave it a shot, but no help.  The distinctions between Clean and Clean Build Folder [link](http://stackoverflow.com/questions/8087065/xcode-4-clean-vs-clean-build-folder)
Comment: you're right, I meant Alt key of course)
Answer: Some part of your build process must be stripping this binary.  If you were generating an unstripped binary with no debug information, then you would see full symbol names in backtraces and the like, you just wouldn't have debug information for them.
The only good way to figure out who is doing this is to look at the full build log in Xcode, and expand each of the stages and grub through all the build stages to figure out who is doing this.  You expand the stages by hovering over each build line on the RHS and you'll get a disclosure dingus that looks like a bunch of lines on a page; click that to see the real commands.
Another way to finesse this may be to build the dSYM for this framework (by setting the Debug Format to "DWARF + dSYM".)  That should get made before anything gets stripped, so unless whoever is stripping this is being awfully clever this should preserve the debug information.


Am I correctly extracting JPEG binary data from this mysqldump?

Question: I have a very old .sql backup of a vbulletin site that I ran around 8 years ago. I am trying to see the file attachments that are stored in the DB. The script below extracts them all and is verified to be JPEG by hex dumping and checking the SOI (start of image) and EOI (end of image) bytes (FFD8 and FFD9, respectively) according to the JPEG wiki page.
But when I try to open them with evince, I get this message "Error interpreting JPEG image file (JPEG datastream contains no image)"
What could be going on here?
Some background info:

sqldump is around 8 years old
vbulletin 2.x was the software that stored the info
most likely php 4 was used
most likely mysql 4.0, possibly even 3.x
the column datatype these attachments are stored in is mediumtext

My Python 3.1 script:
<code>#!/usr/bin/env python3.1

import re

trim_l = re.compile(b"""^INSERT INTO attachment VALUES\('\d+', '\d+', '\d+', '(.+)""")
trim_r = re.compile(b"""(.+)', '\d+', '\d+'\);$""")
extractor = re.compile(b"""^(.*(?:\.jpe?g|\.gif|\.bmp))', '(.+)$""")

with open('attachments.sql', 'rb') as fh:
    for line in fh:
        data = trim_l.findall(line)[0]
        data = trim_r.findall(data)[0]
        data = extractor.findall(data)
        if data:
            name, data = data[0]
            try:
                filename = 'files/%s' % str(name, 'UTF-8')
                ah = open(filename, 'wb')
                ah.write(data)
            except UnicodeDecodeError:
                continue
            finally:
                ah.close()

fh.close()
</code>
update
The JPEG wiki page says FF bytes are section markers, with the next byte indicating the section type. I see some that are not listed in the wiki page (specifically, I see a lot of 5C bytes, so FF5C). But the list is of "common markers" so I'm trying to find a more complete list. Any guidance here would also be appreciated.
Answer: Update your question with a sample SQL statement, including a few lines/bytes of the JPEG string value. Perhaps the data is base64 encoded, or even straight hex values. We'll help you further.
Also, it's easier to see the type of a file's contents by issuing a:
<code>file yourfile.jpg
</code>


Is there any contact information on the SD card?

Question: I found an sd card that was definitely in someone's android phone. Is there any file within the card that would have it's owner's info, so that I might contact them somehow and return what they've lost? Just going out of my way to be a good samaritan here....
Comment: wow, thanks for the quick reply! My first thought was to just keep it, but when I looked inside (just over the surface) there seemed to be a lot of information, so I kinda felt bad for the guy who lost it. I left my # @ the place I found it in, so if someone comes looking for it, they'll find it. If not, I'll reformat it after a week or so.
Comment: If you used skype not some long time time, it saved all contact data into SD card...
Answer: Not by default, no. You can export contacts to the sdcard, but that would only contain "the owner" if they have themselves in their contacts. But you would also probably have no clue which one is them.
While it is a grand gesture on your part, I think you are the new owner of a used sdcard.
Comment: I agree.  Google most likely went out of their way to *not* store any user identifiable information on removable storage for security and privacy concerns.  Although you might find some left over app data or cache, I'd be very surprised if it contained anything useful for tracking down the previous owner.
Answer: As Ryan said, you can export the contacts to the card, if you were to put the card in your phone you could potentially look at the contacts and maybe they have someone in their phone listed as  "mom" or "girlfriend" or something that would help you identify them.
Comment: I have a BB, so.....
Comment: the exported file would already be on there probably saved as "contacts.csv" or something of the sort. if it's not there, then they never exported and you would be spending more time then the cost of a new sdcard trying to find data to identify the owner.
Comment: I assumed you had an Android phone, my bad.
Answer: Android by default doesn't save any personally identifiable info to the SD card, the system backs up/syncs important data to the web, not the SD card but there may be a chance that an app has saved something useful to there . Most apps store their main settings (which is where things like login names/email addresses would be) in the phone's internal memory, only using the SD card for storing larger files and cached data.
The most obvious would be to look for pictures, but depending how they use their camera, etc that may not be any help. They may have files with identifiable info in the Download folder, from saved email attachments, web pages, etc.
For some common apps that may be likely:
If they've used an app like LifeSaver to back up their call log or message log to their SD card, then you could open that and look for frequently contacted numbers. This would be a text file in a folder called LifeSever or LifeSaver-F that can be opened in Notepad.
If they use Dropbox, they may have saved files with useful info into the Dropbox folder.
Possibly the photos could be helpful
Comment: I don't think I saw any folders under that. I did go through a few pics, and if a magically bump into the guy I'd probably recognize him.... thanx again
Answer: I just found someone using Spotify data on the SD card at path:
/Android/data/com.spotify.music/files/spotifycache/Users/<10-digit-user-id>-user
Then check the URL:
https://open.spotify.com/user/<10-digit-user-id>
That was their Spotify account.


TDS remote deployment

Question: With TDS, I can set a non-local URL as my target website, leave the deploy folder blank, and do a "sync with Sitecore" just fine to push items. But it says I need a folder specified if I want to use the "Deploy" option instead. Is there any way to do ad-hoc remote deployments through Visual Studio?
Comment: First concern would be you need tds service in the remote server I.e. /website/_dev/tds service.asmx. Which is not ideal for cm or cd servers. Only development or equivalent env can have this service.
Comment: That's present, I set up Visual Studio on the dev server and did a sync/deploy locally. So now I want to take the next step. It just seems odd I can sync but not deploy remotely.
Comment: You mean, TDS +VS in dev server & able to sync with dev instance ? if that is the case would like to know Sitecore URL provided ? Please note that since you are in dev server you specific local binding URL (as mentioned in host file) & its deployment folder as /website.
Answer: There are a few options here (specifically for TDS). I haven't listed non-TDS options like doing MS Deploy packages or Visual Studio publish, since the question is specific about TDS remote deployment.

UNC SHARE: You can setup a UNC share on your target server and then set the deploy folder to that network path (e.g. \MyServerName\Website). If you use that approach, make sure you lock the security down on that share.
Sitecore Package Deployer: The Hedgehog Sitecore Package Deployer (https://www.teamdevelopmentforsitecore.com/Blog/sitecore-package-deployer) can be installed on your target instance and install packages for you. Generate packages with your items and files and then deploy to the secure 'Data' Folder that you specify during your configuration. The deployer will install for you.
Team City: My preference is not to do deployments directly from the developer machine and to put things through Continuous Integration. Set up the UNC share, but lock it down so only the TeamCity server/user can access it. This is more secure than allowing all devs access to the server. Then let TeamCity do your deployments for you.

.

TDS remote deployment


Subclassing a control

Question: Ok so i'm trying to subclass a ListView control. I'm using SetWindowLong(). Consider this code:
WNDPROC oldProc;
WNDPROC newProc(hwnd, msg, wparam, lparam) // not proper code, but you get the idea
{
  // some code here
}
MainProc(...)
{
  oldProc = SetWindowLong(control_hwnd, GWL_WNDPROC, (LONG) &newproc);
}
At the setwindowlong function call, i'm getting a compiler error.
error: address of overloaded function with no contextual type information
Yet as MSDN, their example is pretty much the same. What's wrong with my code?
Answer: It looks like the definition of newProc is incorrect. It should be:
LRESULT CALLBACK newProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
    // Some code here.
}

Subclassing a control


Grohe Lady Lux2 leaking cold side

Question: I have a Grohe Lady Lux 2. The cold water leaks down the inlet hose under the sink when I run the cold water only. Hot water is not affected. No leak when water is not running.
Comment: Hello, and welcome to Home Improvement. It sounds like you have a leak in your faucet, but without more info we can't say more. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to participate here.
Answer: It sounds like you may have a seal that came loose or is broken. If you are handy, you can remove the faucet handle and you will see the seals. We had this happen to us once and it turned out that there was a loose screw inside that had worked its way loose. I tightened the screw and put the faucet handle back together and it worked fine.
Answer: Does it only leak WHEN you run the faucet? Because if it were a leak in the inlet hose or where it attaches to the faucet, it would leak all of the time, not just when the faucet is running. Then if it were a leak in the faucet itself it would likely happen when you ran cold or hot water. The details matter.
And how much "leakage" are we talking about here? For example it might be condensation running down the inlet pipe because the movement of cold water through the pipe causes moisture in the air to condense on the outside of it and drip down.

Grohe Lady Lux2 leaking cold side


Network printing -- setting up and printing over network using Mac OS X

Question: I've connected a USB printer to a Mac OS X (10.4) machine -- this computer is connected to a network with a registered IP address -- and enabled sharing through the System Preferences setting (under "Shared" and "Print & Fax". Is this printer shared through the Bonjour or CUPS protocol (does it matter that I know)? How do I sent a print job to this computer (also from a 10.4 OS X machine on the same network)? It does not show up in the list of printers in the Default Network when I go to "add printer"; do I need to do anything else (on either machine)? Thanks much!
Answer: CUPS isn't relevant, it's more of a doc-to-printer-instructions server. Bonjour just informs everyone of whats available. I havn't shared from a Mac, but sharing does seem to be very easy. What happens when you try to put the ip or name of the computer in the ip section? To check it's actually being shared use Bonjour Browser (or many many options on iphone).
Comment: Thanks for the clarifying info -- the Mac I'm trying to print from seems to accept the IP address as a "printer", but nothing happens when I try to print...


Can't scrape a certain field from a webpage using requests even when that very field is available in page source

Question: I'm trying to scrape email address from a webpage. The email address is available in page source (ctrl + u). However, I still can't fetch it using requests. All I get is AttributeError. Any help on this would be appreciated.
webpage link
My current attempt:
import requests
from bs4 import BeautifulSoup

link = "https://www.facebook.com/pg/theultimatecollectionco/about/?ref=page_internal"

with requests.Session() as s:
    s.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36'
    r = s.get(link)
    soup = BeautifulSoup(r.text,"lxml")
    try:
        email = soup.select_one("a[href^='mailto:']").get("href")
    except AttributeError: email = ""
    print(email)

Comment: Have you looked at `r.text` to confirm the desired field is present?  If the website uses javascript to dynamically add page content, the `requests` module won't see it.
Answer: The page is constructed with with help of Javascript, so BeautifulSoup alone cannot see it (selenium helps here).
The easiest way is just to grep the page for any mailto: hrefs:
import re
import html
import requests

link = "https://www.facebook.com/pg/theultimatecollectionco/about/?ref=page_internal"

html_doc = requests.get(link).text
for email in re.findall(r'"mailto:([^"]+)"', html_doc):
    print(html.unescape(email))

Prints:
firstname.lastname@example.com


How to populate a custom checkbox field with tag data dynamically?

Question: Hi wondering if this is possible. I have a custom checkbox field for user interests added to the user profile. Is there a way to populate the checkbox options dynamically using tag data?
Comment: Any reason why you couldn't just use a [Tags](http://buildwithcraft.com/docs/tags-fields) field?
Comment: The data is going to be used on the front end so users can use checkboxes to select what they are interested in but using tag data as their selection choice so not sure a tag field will work.
Answer: I don't have enough reputation to post this as a comment, but this should help you pull the data on the front end with the LJ Dynamic Fields plugin.
Install the LJ Dynamic Fields plugin.
Create a 'Checkboxes (dynamic)' field with the following code:
<code>{% for tag in craft.tags %}
   { "value":"{{ tag.id }}" , "label":"{{ tag }}" }
   {% if not loop.last %},{% endif %}
{% endfor %}
</code>
Front-end template code:
<code>{% for tag in craft.tags %}
    <label>{{ tag }}</label>
    <input type="checkbox" value="{{ tag.id }}" {{ tag.id in entry.myCheckboxesDynamicField ? 'checked="checked"' }}>
{% endfor %}
</code>
Comment: No need to post as a comment... This is a legit answer! :)
Answer: Not tested. But it would seem to me that you could use a tags field on the backend, and a checkbox field on the front-end (built dynamically from the tags). To submit the data you could either: format the data on the front-end via javascript before form submission, or submit to a custom plugin controller that converts the checkbox data format to the expected tags format, before saving.
Unfortunately, I can't tell you what the proper format for submitting tag data is from a form (I assume an array of tagIds?). If anyone knows please leave a comment and I'l update the answer (or feel free to edit the answer yourself). Might even be as simple as setting the option values to the tagId values — idk.
Answer: There's plugin for populating fields with dynamic data: Dynamic Fields. But I'm not sure if it works, when pulling data from the same entry you're rendering the field into.
Comment: cheers will take a look at it. First glance would suggest it does what I need.
Comment: Plugin works great on the back-end and populates the fields with data from tags. However it does not work on the front-end when pulling out the data. I've spoke to Lewis who created the plugin and he was very helpful but says he needs to look into and adjust the plugin to do this. So currently it won't do what I require.
Comment: @Lettie Since I last spoke to you I came up with a solution which I've posted as an answer.


How to know if a USB-C dock will power a laptop via PD?

Question: I have a Dell Vostro 7500 that, according to Dell's site, supports Power Delivery via USB-C.  I have been looking at docking stations and most of them are 65W or 100W via USB-C.  Looking at the PD spec it looks like 100W is max?  The power brick that comes with the Vostro seems to be 130W.  Does that mean the Dock has to push out 130W?  If that's the case, maybe I'm looking at an older spec for PD?
Comment: Not entirely sure, that's why this is a comment, not an answer. I suspect the 130watt is to be able to take heavy loads, such as while gaming. If that is the case a 100W dock should still charge the battery if you are not doing power intensive tasks and if you do, should drain the battery slower.
Comment: As I research this I am seeing the same thing over and over.  It looks like the Dell dock can up itself to 130w [for a laptop like yours](https://www.dell.com/community/Vostro/Charging-Vostro-7500-through-USB-C/td-p/7802522).  It also looks like many other people have had the same exact problem of not getting a charge on a lesser wattage.  It seems to depend on the model as many people say that it works fine.
Answer:
Looking at the PD spec it looks like 100W is max? The power brick that
comes with the Vostro seems to be 130W. Does that mean the Dock has to
push out 130W?

No, it does not mean the dock has to "push out" 130W. Power Delivery over Type-C connector is a highly flexible technology. Your laptop has great flexibility in managing its internal power consumption, including display brightness, and will throttle CPU in accord with available power, be it external and/or battery. Your laptop will be perfectly aware of the dock (power provider) capability through PD messading protocol, and the system management software will limit laptop's consumption up to the negotiated capability. When using dock for power, you might have a little less performance on extreme power-demanding apps, that's it.
Answer: It's not clear what your question is. To properly charge a device over PD, you need to know the specs of the device and the specs of the charger.
What is the recommended wattage for charging the laptop? It came with a 130W brick, but I do not think that full wattage is needed to power the Dell. Likely you do not need that much wattage- but you need to search for this on the Dell site/Dell support.
If you are using a charger with lower wattage, it will charge but at a slower rate. If it charges less than power consumption, it will drain faster than it charges.


Under what circumstances would the large internal input resistance of an actual op amp affect circuit operation?

Question: I was able to find a lot about why the input resistance is high and basically infinite. I understand that the input resistance is high so that it doesn't become a load on the signal. I also know that it  makes sense like a voltage divider, the high impedance means that all of the voltage drops on the op amp. But I can't find any research on a case where the high resistance might actually affect the circuit itself (despite how high it is).
Comment: *the high impedance means that all of the voltage drops on the op amp* That's a weird sentence. You probably mean: *the opamp's high input impedance means that it does not load the voltage divider so the value of the voltage is not affected*
Comment: If you've designed an op-amp circuit and it is susceptible to problems due to high input impedance then you have designed it wrongly.
Comment: *But I can't find any research on a case where the high resistance might actually affect the circuit itself (despite how high it is).* Why would it be an issue? The high input impedance is there to **not affect** the circuit so why do you look for examples where there is an effect?
Comment: @Bimpelrekkie I want to know because despite the fact that it was built to not affect things, I imagine that there are scenarios where it could and want to know what these may be. Because I'm curious and maybe it could be an issue one day and I'd never know.
Comment: Instead of learning about what could be an issue, learn **how to do things right**. Suppose I make a list of things **not to do** and one with **good practices**. Which list will be longer? If you design an opamp circuit and the feedback resistors are in the same value as the opamp's input impedance (assuming that would be possible with a CMOS opamp with 1Tera ohm input resistance) then as Andy says: you're doing it wrong. So use reasonable value resistors.
Answer: Each opamp parameter which normally is neglected during calculation will affect the operation (the gain) of the amplifier (input and output impedances, finite and frequency-dependent open-loop gain,...).
However, in most cases we do not care about these effects because they will be either not too important (because the error is acceptable) or are overshadowed by external tolerances of the feedback network and/or  parasitic influences caused by the hardware realisation (pin capacitances,...).
This is a typical example for the fact that in electronics no formnula is correct by 100%. It is simply not possible - and it makes no sense - to include all possible known physical effects in our expressions, functions and formulas. And it is one of the most challenging engineering tasks to decide if - for a specific application - the "simplified" expression may be applied with sufficient accuracy or not.
As far as the finite input impedance is concerned, we try to follow a general rule which requires that each of the external resistors should be small if compared with this input resistance. However, what means "small"? Factor 10 or 100 or 1000 ? The answer simply depends on the required accuracy of the gain value. But in most cases, the resistor tolerances are more important.
As an example: Here is the gain expression (non-inverting) for resistive feedback (ideal: 1+R2/R1) if input and output resistances are taken into account.
G=N/D  with
N=(Eo R2 Rin + Eo R1 Rin + R1 Rout)
D=(Eo R1 Rin + Rin Rout + R2 Rin + R1 Rout + R1 Rin + R1 R2)
Note that the open-loop gain Eo is set to a fixed value. You can imagine how the expression would look like in case of a realistice frequency-dependent gain expression for a two pole model:
Eo(w)=Eoo/[(1+s/w1)(1+s/w2)]
Answer: If you have a low-gain opamp, perhaps in a high-frequency opamp where you are just happy as a clam to have a 1GHz UGBW opamp, and you are achieving that high UGBW with bipolar devices because the SiGe transistors are what you need to use, and you want high-gain-accuracy out where the gain-margin is poor (out near the closed loop F3dB) and the voltage across the "virtual ground" between (-) and (+) inputs becomes significant, that additional current thru the internal differential-mode resistance must be included in the modeling. {note: UGBW is Unity Gain Band Width}
Examine this comparison; The opamp model was edited to make UGBW=1GHz, keeping the high-value gain-set resistors. The RIn was edited: left graph is 2 MegOhms, middle is 2 KOhms; right graph is 2 KOHms, and openloopgain reduced from 100dB to 60dB.
Comment: Your audience won't know what UGBW means
Answer: whether it's an inverting or non-inverting circuit, if the feedback resistance \$R_F\$ and the other resistor connected to the inverting input terminal (usually called \$R_1\$), gets as large as the internal input resistance, then the internal input resistance of the op-amp begins to affect the circuit.
Comment: ....."begins to affect" ? According to my experineces, a remarkable influence of the finite opamp input impedance can be observed already when the effective external resistance at one of the input nodes is smaller by a factor of 5...10 than the opamps input resistance
Comment: you're right @LvW.  i was understating it.
Answer: You have it a little backwards.  In an ideal op amp, there is no current entering the amplifier inputs.  The behavior ddviates from ideal when this is not the case, meaning the equations are not accurate.
Thus, manufacturers make op amps with high input impedance so the behavior approaches ideal.


How can know the subnet mask in IPv6 network?

Question: How the host can know the subnet mask in the IPv6 network, in case the network does not use the default subnet mask which is /64. for example the subnet mask of the network is /88, How can the IPv6 host know the subnet mask is 88 and is not 64?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: The router advertisement contains the prefix length of advertised prefixes.
Comment: What about DHCPv6
Comment: DHCPv6 only provides addresses. Prefixes and their lengths still come from RA


Laptop fan speeds up after 10 minutes of inactivity

Question: My laptop's (Lenovo Legion Y520) fan starts running fast after 5-10 mins of inactivity out of nowhere. When I open up Task Manager, the CPU utilization seems around 25-30% and then drops to ~6% in 2-3 seconds, which is followed by the fan running slower in another 2-3 seconds. It seems like my computer is being used for a program while I am away from keyboard and I cannot detect it. Are there any solutions for that? I tried everything I can find in the internet. Thanks.
Answer:
When I open up Task Manager, the CPU utilization seems around 25-30%
and then drops to ~6% in 2-3 seconds

That is normal for Windows 10 and, by itself, does not present much of a CPU load.
My fan comes on for a steady 35% plus CPU load and that, too, is normal.
Open Task Manager, let it settle for 10 seconds and then see what processes are taking a lot of CPU.
For normal browsing conditions, CPU should run <5% more than 90% of the time.
I think you will find something is running that you did not anticipate or do not know about (virus) .
Answer: I had exactly same problem few years ago. Unfortunately, I cannot accurately remember what exactly solved it. I will list a few things I remember , try them.

Disable programs in TaskManager/ Startup.
Changing hardware acceleration for Chrome.
Decreased paging file size.
Keeping Task Manager open all the time so that I can locate problematic processes.
Suppressed some windows process that indexes files for better searchability. (this
might be different now that Cortana is there)
There are also programs to monitor CPU temperature.


Does adding a disconnect box below the meter mean that my service panel is now a subpanel?

Question: I don't understand the bonding at my main disconnect. My problem is that my main panel in the house was wired OK with the neutral bonded to ground. The power company added a disconnect box below the meter box.  I noticed the disconnect they installed doesn't have the neutral bonded to ground. Am I going to have a problem? From what I read my main panel is now a sub panel because they added a disconnect? I am wondering why they thought it was OK.
Comment: Where in the world are you?
Comment: What is your location?
Answer: If the power company did not change the bonding point, you still have a main panel ("the one with the bond in it.")
So long as there's only one, the location of the bond can and does vary with the preferences of the power company, mostly. Mine is inside the meter box, so my panel is wired as a sub-panel.
On a typical panel run from a meter and bonded in the panel, the meter itself is a disconnect point that's upstream of the bond, and that's not a problem.
You should realize that the neutral and ground conductors are not interrupted by a disconnect, so the bond in your panel is still effective even with a disconnect upstream of it.
If the power company had opted to move the bond point, they would have needed to rewire your panel - a considerable expense (for them) and inconvenience (for you) they avoid by not changing the bond point.


Eevee - Baking soft shadows

Question: I have a question about soft shadow option in eevee. Is there a way to bake them in eevee?
What is a problem - when I turn on soft shadow option it instances light depending on it size, and it looks nice but I need atleast 1000 eevee samples to make them look good and soft and well its not an option in Eevee(it will be faster in cycles). So my question is how to manage that to render everything with 32-64 samples which gave me results I want but shadow setup much higher or bake them that I will not waste time and calculating power. Thanks for any help
Answer: There is a way to bake indirect lighting in Eevee. Have you ever tried using irradiance volumes? They're in the light probes menu when you add a mesh. The basic concept is that the specific lighting contitions are baked within the boundaries of the irradiance volume. You can scale it up if you want, and increase it's resolution, but I wouldn't go over 20, seems like overkill to me, but if you want to test it, don't hold back. To bake it you go to the render tab, and click "Bake indirect lighting" under the "Indirect lighting" tab
Comment: Yes, I have archviz scene and it not solve the problem - its baking propagation of light that give this nice look to whole interior but shadows are still independent and not baked

Eevee - Baking soft shadows


Can gaussian low pass filter remove ringing effect from the image?

Question: An
image is
convolved with an ideal low pass filter. The resultant image is convolved with a Gaussian
low pass filter
to obtain a final image. Will you observe ringing effect in the final image. WPlease give reason.
Answer: The ringing from convolving with an ideal low pass filter is Gibbs oscillations. If you convolve with a smooth function, you won't get ringing, but of course you will get some smoothing and attenuation. You could try multiplying by a function like $\exp(-x^4)$ in the Fourier domain or its ilk. These functions are flat around $0$, unlike the Gaussian, so they are more ideal low pass filter-like.


Do I need to install CUDA and Nvidia Web Driver to use OpenCL on Nvidia GPU?

Question: I am working on writing OpenCL programs running on a MacBook Pro with built-in Nvidia GPU. I know that OpenCL kernels can run on the CPU, or the integrated Intel GPU. But if I want to configure it to run on the Nvidia GPU, do I need to install CUDA and other Nvidia stuff? Thanks!
Answer: No, you do not. OpenCL and Metal will run automatically on the Nvidia GPU. If you want to take advantage of Nvidia's CUDA architecture (which I highly recommend for software that takes advantage of it, like the Adobe CC suite), you need to install the CUDA driver. You do not need to install the Nvidia web driver because your machine has a built-in Nvidia card (the driver is built-in to MacOS).
Answer: If you want to use CUDA on High Sierra, you may well have to install both CUDA and the nVidia Web Drivers.  On older versions of MacOS you only need to install CUDA.  Apple rewrote the DisplayServer to use Metal for High Sierra, which is possibly the cause.
(I say 'may well', because this has certainly been my experience on a 2013 rMBP with a GT650M).
Comment: That's what I thought in the beginning as well. But I found I do not need to install CUDA or Web Driver to use OpenCL. Apple Developer documentation says Metal does not need additional drivers to be installed as well. However, I do find I need the Web Driver for CUDA to work. Coincidentally, my MacBook Pro also has a GT650M graphics card. Just as you said, High Sierra uses a new window server wrote in Metal, and it is causing problems —when I select the Web Driver, there will be some graphic errors in the window server and in Safari, and I sometimes have to reboot my Mac.
Comment: Yes, I misread your question, sorry.  It's *only* in the case of wanting CUDA support that you'll also need the Web Drivers, as you say.  Also, I've mostly used the standard High Sierra drivers, and I've had plenty of graphical corruption issues and the occasional lockup - so it's not just the nVidia drivers that suffer from that! :)


nvd3 Bubble chart with log scale

Question: I am using NVD3 scatter/ Bubble chart. This is a continuation from the question here. I am plotting the log base 2 values for the y axis. But I want the y axis to have the original values as labels corresponding to the log base 2 scale. I am unable to understand how to do so.
Edit
This is what I have for plotting
data[i].values.push({
    x: random()
  , y: log2(yValue)
  , size: Math.random()
  });

function log2(val) {
console.log("val = " + val + " : " + Math.log(val) / Math.LN2)
    return Math.log(val) / Math.LN2;
}

Now, the y axis ticks have the log2 values. I want to change the y axis ticks to have the original values displayed and not the log2 values.
Thanks,
Comment: Please put what you have so far in a fiddle or plunker. You will certainly increase the chances of having your question answered.
Answer: Instead of directly calculating the log when you create your data array, leave it as is and then use a log scale for your axis.
To use a custom scale in NVD3, you pass it as a parameter to the chart.yScale(scale) or chart.xScale(scale) methods.
var chart = nv.models.lineChart()
      .yScale( d3.scale.log() );

Just don't try to use a log scale for y values in a bar or area chart, since those automatically include 0 in the domain (and you'll get errors if you try to plot anything at log(0)!)
A couple warnings:

Tick formating functions work different on log scales than for other scales; you'll probably want to just leave it as the default.  See the docs (link above) for more info.
The .nice() method doesn't seem to work very effectively on log scales; when I was playing around on the NVD3 live code site, a domain of [1,99] was resulting in a final tick value of 98.999999999 on the axis.  You may want to explicitly check that the domain starts and ends at round numbers.

Also note that since you're never actually dealing with the calculated values for the logs (just with the relative positions on the scale) you don't need to specify a base to the logarithm.  The docs mention a logScale.base(number) method but that seems to be obsolete...

nvd3 Bubble chart with log scale


Apt-get uanble to locate package httplib and urllib

Question: I am using Pi 4. So few days back I installed two libraries httplib and urllib to run a code. But recently I found out that both these libraries are missing. So when I try to reinstall them again using sudo apt-get install httplib it is showing unable to locate package. Please help.
Comment: More like `apt-cache search httplib`
Comment: Not Pi specific.  You need to find the package which contains the library.  Perhaps use apt-cache search on the library.
Comment: like `sudo apt-cache httplib`?
Answer: So after a bit of digging I found out that the httplib library has been updated to http.client while the urllib is same, its atrributes have changed to some extent.


MVC Patterns - controllers and views

Question: When using the MVC pattern, should I implement a seperate controller for each view?
Answer: Create a new one if you need to.  Don't if you don't.
Patterns are not about data structures, they're about organizational patterns among communicating components.  If the same controller is appropriate for more than one view, great - especially if you can use it without modification.
If you have to change it, then you have a case for two separate controllers.  If there is shared code between them, then consider moving it to another class - either a base class or (my personal preference) shared via aggregation.
The easiest way to think about MVC is a command-line program.  The program is the Model.  The Controller is STDIN.  The View is STDOUT.
Answer: I believe there is no 'the' MVC pattern. There are almost as many MVC patterns as there are users of a MVC architecture. That being said, in my opinion, the answer to your question is 'no'.
Answer: I use to implement a controller for each module of my application, not for each view. A controller can call methods of other controller. I'm not sure if this is the better way to do it, but I think It's working well for me.
Answer: the idea is to separate/decoupling M, V and C, its not a problem if you want a single controller control multiple view, as long as the view and controller is decoupled

MVC Patterns - controllers and views


How to show multiple products in detail view on custom page?

Question: I want to show multiple products in full detail view on a custom page. Please, anyone, suggest to me the steps to follow for achieving that idea. my Magento version is 2.3. The screenshot is attached for a detailed view product.
Answer: This is something interesting for me as well!! Generally you need to use catelog_category_view.xml code with product detail page view and custom product collection query. I would recommend to follow  below basic instruction.

create a custom layout let's say yourpackage/yourmodule/view/frontent/layout/.xml
in <layout.xml> copy code from "catalog_category_view.xml" and change main phtml file to your module phtml file. change class which extends to "Magento\Catalog\Block\Product\ListProduct" and remove unnecessary code which you don't need.
Set default grid view to list view and and modify query to get attribute you want with 5 product to display as product details view.
now modify your phtml file as per your design.

Hope it helps!


How to categorize documents in sharepoint

Question: I am switching from Lotus Notes into sharepoint, but I find it hard to access the data that I want easily. I am currently using documents application on sharepoint. The only options it offers are creating or uploading a new file or folder. In my lotus notes I can access files in different ways based on some categorizations such as client, author, date modified and some other categorizations. Moreover I can even categorize them based on data and client at the same time for example. All I need to do is a single click and everything is managed by notes.
What are your suggestions?
Comment: what version of SharePoint (2007/2010/2013) and edition (Standard/Enterprise) are you using?
Comment: Sharepoint 2013 , microsoft server 2012 r2 enterprise
Answer: I too have went from Lotus Notes to SharePoint and found that creating categorized views and multiple views has helped a lot.  Not trying to bash SharePoint or Microsoft but the categorization in Notes was superior in my opinion.
Comment: I have the same opinion. I was thinking to create my own application for that , but it seems to complicated task to do.
Answer: SharePoint has some very powerful features for document management - metadata, navigation, content searching (with previews), version control and more.
A few links below to get you started -
Plan document management in SharePoint 2013
Best practices for setting SharePoint 2010 up for document management
Top 10 Best Practices for Document Libraries
Overview of managed metadata in SharePoint Server 2013.  Using Taxonomy hierarchy  (categorizations) in the document metadata.
SharePoint Document Center template (quick way to deploy a centrally managed document library)
Answer: After some research I found the solution to this problem,  and I have to say sharepoint is very similar and user friendly also. In order to do the categorization you should create a new app called custom list. In this list later on you can create new columns with different properties. After doing so you can create different views and use group by option to group the data.
For a full tutorial on this read SharePoint 2013 for dummies p(78-105).


Is there an idiom that means something is "the best thing or better than other things"?

Question: Is there an idiom that means something is "the best thing or better than other things"? I am looking for a phrase that would look good in the introduction of an essay where I talk about the best marketing strategy used by companies nowadays. Can you think about anything?
Answer: You could ue "optimal" as in "the optimal strategy" or the "optimal approach". That is a word, not an idiom, of course.
Answer: Quite an older phrase that might still apply, given your audience is at least 50 years old (in 2022), "it's the Cadillac of (insert competitive-market noun)". As in, "it's the Cadillac of reclining chairs."
Cadillac is a luxury car brand in the USA, known for soft floaty feeling rides and sometimes a lot of power. Generally admired by older people, starting around age 40.
As foreign cars have proven their dependability and value over the last 40 years there are more people that will take issue with a claim that your product is "the Cadillac" or apex choice, however that can be an opportunity to further interact with them and size up what they are looking for in a product. Be prepared for a light-hearted argument and don't take the stance that the Cadillac is the gold-standard of vehicles, it is all just marketing fluff after all. There are no absolutes; it's like arguing iPhone vs Android.
For reference, a 2012 article Cadillac brand 100 years and still strong
Another tongue-in-cheek reference when referring to a car (since a Cadillac is a car you would not reference it in that marketplace) Movie: Get Shorty - minivan test drive scene


How much rent is needed to create a new account?

Question: When creating a new account on Solana, how do I calculate the amount of rent (SOL) needed to pay for and create the account?
Answer: The amount of lamports needed to make an account rent-exempt is based on its size.

With the CLI you can use solana rent {bytes}
In a solana program, the Rent sysvar is provided. It has a minimum_balance method.
In the web3 javascript SDK there is a getMinimumBalanceForRentExemption method for a Connection.
Answer: Hey every account needs to pay a rent fee if it does not extends the accumulated rent for two years. The rent depends on the bytes of the account, because it costs the network to save the data I assume.
If you want to know the rent cost for an account you can use

solana rent "byte size of the account"

The minimum sol in an account to be exempt from the rent you can get from the RPC using this method:

getMinimumBalanceForRentExemption

For SPL Token accounts this is around 0.002 Sol, that is why you need to pay if you send someone a token he does not have yet. But you can get the sol in there back with if you close the empty account. (With the fee redeemer from SolAndy for example)