Django CMS error when displaying advanced settings for page

Question: This is the error I get when trying to change the advanced settings of a page while in admin mode:
TypeError at /admin/cms/page/5/advanced-settings/
__str__ returned non-string (type __proxy__)

Environment:

Request Method: GET
Request URL: http://localhost:8000/admin/cms/page/5/advanced-settings/?language=en&cms_path=/

Django Version: 2.1.7
Python Version: 3.6.7
Installed Applications:
['djangocms_admin_style',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.sitemaps',
 'django.contrib.staticfiles',
 'django.contrib.messages',
 'cms',
 'menus',
 'sekizai',
 'treebeard',
 'djangocms_text_ckeditor',
 'filer',
 'easy_thumbnails',
 'djangocms_column',
 'djangocms_file',
 'djangocms_link',
 'djangocms_picture',
 'djangocms_style',
 'djangocms_snippet',
 'djangocms_googlemap',
 'djangocms_video',
 'structuresend']
Installed Middleware:
['cms.middleware.utils.ApphookReloadMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cms.middleware.user.CurrentUserMiddleware',
 'cms.middleware.page.CurrentPageMiddleware',
 'cms.middleware.toolbar.ToolbarMiddleware',
 'cms.middleware.language.LanguageCookieMiddleware']

Template error:
In template /usr/local/lib/python3.6/dist-packages/django/forms/templates/django/forms/widgets/select_option.html, error at line 1
   __str__ returned non-string (type __proxy__)
   1 : <option value="{{ widget.value|stringformat:'s' }}"{% include "django/forms/widgets/attrs.html" %}> {{ widget.label }} </option>
   2 :

Traceback:

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  156.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  154.                 response = response.render()

File "/usr/local/lib/python3.6/dist-packages/django/template/response.py" in render
  106.             self.content = self.rendered_content

File "/usr/local/lib/python3.6/dist-packages/django/template/response.py" in rendered_content
  83.         content = template.render(context, self._request)

File "/usr/local/lib/python3.6/dist-packages/django/template/backends/django.py" in render
  61.             return self.template.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  171.                     return self._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  62.                 result = block.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  188.             return template.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  173.                 return self._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  150.             return compiled_parent._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  309.                 return nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  309.                 return nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  993.         return render_value_in_context(output, context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_value_in_context
  972.             value = str(value)

File "/usr/local/lib/python3.6/dist-packages/django/utils/html.py" in <lambda>
  397.     klass.__str__ = lambda self: mark_safe(klass_str(self))

File "/usr/local/lib/python3.6/dist-packages/django/forms/boundfield.py" in __str__
  33.         return self.as_widget()

File "/usr/local/lib/python3.6/dist-packages/django/forms/boundfield.py" in as_widget
  93.             renderer=self.form.renderer,

File "/usr/local/lib/python3.6/dist-packages/django/forms/widgets.py" in render
  230.         return self._render(self.template_name, context, renderer)

File "/usr/local/lib/python3.6/dist-packages/django/forms/widgets.py" in _render
  235.         return mark_safe(renderer.render(template_name, context))

File "/usr/local/lib/python3.6/dist-packages/django/forms/renderers.py" in render
  31.         return template.render(context, request=request).strip()

File "/usr/local/lib/python3.6/dist-packages/django/template/backends/django.py" in render
  61.             return self.template.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  171.                     return self._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/defaulttags.py" in render
  209.                     nodelist.append(node.render_annotated(context))

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/loader_tags.py" in render
  188.             return template.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  173.                 return self._render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in _render
  163.         return self.nodelist.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  937.                 bit = node.render_annotated(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_annotated
  904.             return self.render(context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render
  993.         return render_value_in_context(output, context)

File "/usr/local/lib/python3.6/dist-packages/django/template/base.py" in render_value_in_context
  972.             value = str(value)

Exception Type: TypeError at /admin/cms/page/5/advanced-settings/
Exception Value: __str__ returned non-string (type __proxy__)

The problem seems to be a value = str(value) not returning a string, although value is said to be 'Inherit the template of the nearest ancestor'. I'm not sure what's happening here.
Apparently it returns a __proxy__ type, which according to other questions is a type used for translation. What can I do to fix this? I need access to the settings of my page to change the html template it uses.
Comment: What version of CMS and what plugins do you have in the page?
Answer: I had the same problem-- setting I18N=True in my settings.py did the trick.
If that doesn't work, try pip installing django-parler and see if it helps.
Answer: For other people who have the same problem.
The settings I18N mustn't set to False.
If your goal is to deactivate multi language site you can delete "i18n_patterns" in urls.py.
Answer: As per this comment on the github
modify the urls.py as follows
# replace
urlpatterns += i18n_patterns(path("admin/", admin.site.urls), path("", include("cms.urls")))

# with
urlpatterns += i18n_patterns(
        path("admin/", admin.site.urls),
        path("", include("cms.urls")),
        prefix_default_language=False # NOTICE THIS HERE
        )

and in settings.py keep USE_I18N = True.


OpenCart upgrade 1.5.6. to 18.104.22.168

Question: I upgrade OpenCart from 1.5.6 to 126.96.36.199 it was upgrade successfully  and admin login work good but store front page not working, it's getting error.
The example.com page isn't working

example.com is currently unable to handle this request.
HTTP ERROR 500
Comment: Http error 500 could mean anything, you need to check the error logs... Hopefully there isn't too much wrong, but I wouldn't imagine OpenCart is something you can easily upgrade, especially from 1.5.* to 2.* - all your plugins & templates are probably not compatible... Best thing - if it's not something simple - may be to revert to the backup, and have a web developer do the upgrade properly.
Answer: Try to :

Edit your .htaccess file (just insert # before Options)
Reinstall vqmod
Read error log
Comment: I will disagree. First of all when you get `500 Internal server error` you should `read error log`. This should not be last try.
Comment: its not satisfactory answer
Answer: I got the following response when I asked the OpenCart team how to resolve this issue:

Thank you for your enquiry.
Please don't upgrade your store on your own. You will have a lot of
  errors. Try the qphoria upgrade service. He is one of our top
  developer.
  http://www.opencart.com/index.php?route=extension/extension/info&extension_id=20437&filter_search=upgrade
Best Wishes, John OpenCart Team

OpenCart upgrade 1.5.6. to 2.3.0.2


is the inverse of a absolutely continuous function with almost everywhere positive derivation absolutely continuous?

Question: suppose $f$ is an absolutely continuous on $[0,1]$,that almost everywhere $f'>0$.
is the inverse of $f$ necessarily absolutely continuous on $[f(0),f(1)]$?
thank you very much!
Answer: It is always useful to have more than one answer to a problem.  One learns quite a bit more.
Even better, however, is to have two contradictory answers to the same problem.  That is both more entertaining and more educational.  (The contradiction is just about what one wants to prove, not about errors.)
A friend of mine often tells an anecdote about a similar situation.  A well-known mathematician had posed an open problem at the end of one of his papers.  My friend sent him a solution.  He wrote back quite pleased and informed my friend that someone else had also submitted a solution using a completely different method.  He proposed that both should be published back-to-back in the Revue Roumaine to which, as an editor, he would submit them.  And they were published.  The methods were indeed completely different.  My friend had solved the problem positively and the adjacent paper "proved" the opposite.

Problem.  Suppose that $f:[0,1]\to\mathbb{R}$ is absolutely continuous and that $f'(x)>0$ for a.e. $x\in [0,1]$.  Prove that $f$
  has an absolutely continuous inverse.

Proof.  Clearly $f$ is continuous and strictly increasing on $[0,1]$ and
so it has a continuous and strictly increasing inverse $f^{-1}$.   Let $P$ be the set of points at which $f$ has a finite, positive derivative.  Let $Z$ be the remaining points which we know is a set of measure zero.  Since $f$ is AC it satisfies Lusin's condition (N) so $f(Z)$ is also a set of measure zero.
Let $E_1= f(P)$ and $E_2=f(Z)$.  These sets exhaust $[f(0),f(1)]$. We know that $f^{-1}$  has a finite positive derivative at each point of $E_1$ and that $E_2$ has measure zero.  The function $f^{-1}$ maps any measure zero subset of $E_1$ to a set of measure zero (because it has a finite derivative there).  Also $f^{-1}$ maps every subset of $E_2$ to a set of measure zero (i.e., a subset of $Z$).  Thus $f^{-1}$ satisifies Lusin's condition (N) on
$[f(0),f(1)]$. It follows that $f^{-1}$ is absolutely continuous.
[Note added:  The OP remembered a proof of this statement:

"Suppose $f'(x)$ exists at each point $x\in E$ and that $|f'(x)|\leq
  M$ there.  Then $m(f(E))\leq Mm(E)$.  Hence  $f(E)$ is
  measure zero if $E$ is measure zero.

But this can be pushed.  If $E$ has measure zero and $f'(x)$ is finite at every point of $E$ ($|f'(x)|$ not necessarily bounded) then simply write $E_n=\{x\in E: |f'(x)|\leq n\}$ and use the fact that
$$m(f(E)) \leq \sum_{n=1}^\infty m(f(E_n))\leq \sum_{n=1}^\infty nm( E_n)=0.$$
In fact, with bit more work, one can prove that
$$m(f(D)) \leq \int_D |f'(x)|\,dx$$
for any measurable set $D$ assuming that $f$ has a finite derivative at every point of $D$.
Comment: Umberto has proved that there is a strictly increasing Lipschitz function on $[0,2]$ whose inverse is not absolutely continuous.  He didn't promise that it had a *positive* derivative almost everywhere. (It doesn't).  If you add in that hypothesis then the counterexample disappears.  You should include both in your answer as the Umberto example shows that the hypothesis cannot be weakened to: "$f$ is absolutely continuous and strictly increasing."  (Not even to: "$f$ is Lipschitz and strictly increasing".)
Comment: note that "The function f−1 maps any measure zero subset of E1E1 to a set of measure zero (because it has a finite derivative there)." Is not necessarily true,because you must prove also that on that measure zero set ,derivative has a max.
Comment: @user115608  Not true.  I know why you might think that, but it is true that any function that has a derivative at every point of a set does indeed satisfy the Lusin (N) condition there.  Think about why you want a bounded derivative and then consider splitting the set into pieces on which you do have a bounded derivative and then adding them up.
Comment: so I can't believe!  Your answer vs Umberto ' s!Which one is true?
Comment: yes.u r right!  Thank you very much.would you please see this?http://math.stackexchange.com/questions/1546261/checking-the-proof-of-a-problem-about-equidistributed-sequences
Comment: How can we see "we know that $f^{-1}$ has a finite positive derivative at each point of $E_1$" ? I guess starting with the definition for the derivative of $f^{-1}$ and then changing of variables in the limit process. But applying change of variables is sometimes tricky.
Answer: Let $c: [0,1] \to [0,1]$ be the usual Cantor-Lebesgue function and let $g: [0,1] \to [0,2]$ be given by $g(x) = c(x) + x$. Then $g$ is continuous, increasing, and $g'(x) = 1$ almost everywhere. Since $$g(1) - g(0) > \int_0^1 g'(x) \, dx$$ it follows that $g$ is not absolutely continuous.
Let $f = g^{-1}(t)$ so that $f : [0,2] \to [0,1]$ is continuous and increasing.  If $x,y \in [0,2]$ and $x < y$ then $$\left| \frac{y-x}{f(y) - f(x)} \right| = \frac{y-x}{f(y) - f(x)} = \frac{g(f(y)) - g(f(x))}{f(y) - f(x)} = \frac{c(f(y)) - c(f(x))}{f(y) - f(x)} + \frac{f(y) - f(x)}{f(y) - f(x)}.$$ Since $c$ is nondecreasing, the last expression is greater than or equal to $1$. Thus $$|f(x) - f(y)| \le |x-y|.$$
It follows that $f$ is Lipschitz, hence AC, but $g = f^{-1}$ is not AC.
Comment: I upvoted this answer because it is so lucidly and elegantly expressed and does, indeed, contribute to an understanding of the problem.  It might be noted too that the function $g$ here has an infinite derivative on some set and that set maps by $g$ to a set of positive measure (at the points of which $f'$ is equal to zero).
Comment: your $f$ is not defined on $[0,1]$,what will happen if you consider the restriction?
Comment: How about using $f_1(x) = f(2x)$?
Comment: yes u r right.your beautiful counter example works.thank u.but we always say that with this assumption f is strictly increasing.true?


Trying to read binary file as text but scanner stops at first line

Question: I'm trying to read a binary file but my program just stops at first line..
I think it's because of the strange characters the file has..I just want to extract some directions from it. Is there a way to do this?..
public static void main(String[] args) throws IOException
{

    Scanner readF = new Scanner(new File("D:\\CurrentDatabase_372.txt"));
    String line = null;
    String newLine = System.getProperty("line.separator");
    FileWriter writeF = new FileWriter("D:\\Songs.txt");

    while (readF.hasNext())
    {
        line = readF.nextLine();

        if (line.contains("D:\\") && line.contains(".mp3"))
        {
            writeF.write(line.substring(line.indexOf("D:\\"), line.indexOf(".mp3") + 4) + newLine);
        }
    }

    readF.close();
    writeF.close();
}

The file starts like this:
pppppamepD:\Music\Korn\Untouchables\03     Blame.mp3pmp3pmp3pKornpMetalpKornpUntouchablespKornpUntouchables*;*KornpKornpKornUntouchables003pMetalKornUntouchables003pBlameKornUntouchables003pKornKornUntouchables003pMP3pppppCpppÀppp@ppøp·pppŸú#pdppppppòrSpUpppppp€ppªp8›qpppppppppppp,'ppÒppp'ÍpET?ppppppôpp¼}`Ñ#ãâK†¡H¤*(DppppppppppppppppuÞѤéú:M®$@]jkÝW0ÛœFµú½XVNp`w—wâÊp:ºŽwâÊpppp8Npdpp¡pp{)pppppppppppppppppyY:¸[ªA¥Bi   `Û¯pppppppppppp2pppppppppppppppppppppppppppppppppppp¿ÞpAppppppp€ppp€;€?€CpCpC€H€N€S€`€e€y€~p~p~€'€«€Ê€â€Hollow LifepD:\Musica\Korn\Untouchables\04 Hollow Life.mp3pmp3pmp3pKornpMetalpKornpUntouchablespKornpUntouchables*;*KornpKornpKornUntouchables004pMetalKornUntouchables004pHollow LifeKornUntouchables004pKornKornUntouchables004pMP3pppppCpppÀHppppppøp¸pppǺxp‰ppppppòrSpUpppppp€ppªp8›qpppppppppppp,'ppÒpppŠºppppppppppôpp¼}`Ñ#ãâK†¡H¤*(DpppppppppppppppppãG#™R'CA—®þ^bN °mbŽ'^¨pG¦sp;5p5ÓÐùšwâÊp
)ŽwâÊpppp8Npdpp!cpp{pppppppppppppppppyY:¸[ªA¥Bi `ۯǺxp‰pppppp2pppppppppppppppppppppppppppppppppppp¿

I want to extract file directions like "D:\Music\Korn\Untouchables\03 Blame.mp3".
Answer: You cannot use a line-oriented scanner to read binary files.  You have no guarantee that the binary file even has "lines" delimited by newline characters.  For example, what would your scanner do if there were TWO files matching the pattern "D:\.*.mp3" with no intervening newline?  You would extract everything between the first "D:\" and the last ".mp3", with all the garbage in between.  Extracting file names from a non-delimited stream such as this requires a different strategy.
If i were writing this I'd use a relatively simple finite-state recognizer that processes characters one at a time.  When it encounters a "d" it starts saving characters, checking each character to ensure that it matches the required pattern, ending when it sees the "3" in ".mp3".  If at any point it detects a character that doesn't fit, it resets and continues looking.
EDIT: If the files to be processed are small (less than 50mb or so) you could load the entire file into memory, which would make scanning simpler.
Comment: when I open the file in notepad++ it shows line numbers but I'm not sure if it's dividing the file at line separators..
I'll try your method and will tell you if it worked.
Thanks for your answer.
Comment: This absolutely worked!!.. Thank you so much for your advice!!..I've finally extracted all songs from the binary file.
Answer: As was said, since it is a binary file you can't use a Scanner or other character based readers.  You could use a regular FileInputStream to read the actual raw bytes of the file.  Java's String class has a constructor that will take an array of bytes and turn them into a string.  You can then search that string for the file name(s).  This may work if you just use the default character set.
String(byte[]):
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html
FileInputStream for reading bytes:
http://download.oracle.com/javase/tutorial/essential/io/bytestreams.html
Comment: Thx for the "ReadingBytes" link!!..I didn't know you can read a file byte by byte.
Answer: Use hasNextLine() instead of hasNext() in the while loop check.
while (readF.hasNextLine()) {
 String line = readF.nextLine();
 //Your code
 }

Comment: Thx for really quick answer!
I've fixed it but it's still stopping at first line..


Compact operator from $l_2$ to $l_1$

Question: Let $\{\alpha_n\} $ be the sequence of complex nubers. Operator $A:l_2\to l_1$ $A(x_n)\to \alpha_n x_n$. When A is compact.
Using Holder's inequality and definition of compact operator as an operator when image of bounded is totaly bounded easy to proof that if $\alpha\in l_2$ A is compact. But in opposite, i can not proof that if A compact, $\alpha\in l_2$.
Answer: $T$ is not even well-defined operator if $(\alpha_n) \notin l^{2}$. It is well known that $\sum |\alpha_n x_n| <\infty$ for  all $(x_n) \in l^{2}$ implies that $(\alpha_n) \in l^{2}$. [I suggest that you search this site for a proof. It has appeared many times in the recent past].

Compact operator from $l_2$ to $l_1$


Are these religious icons clear enough without supplementary labels?

Question: Given this UI (in HTML), do I need to put texts beneath the large images, or is the small image displayed in the lists enough to make the connection?

Conclusion
The client has signed off on the design above.  They feel that the tool-tips combined with a BG on mouseover of the big image, with the BG color repeated for the menu and body links, is enough to make the connection.  The colors of the small images have been made more obvious by not giving the image a black line border (doi!).  In the screenshot, the mouse is hovering over the image for The Quran - though I missed capturing the tooltip.
The client is happy with the images themselves.  (Which now have pretty gradients.)
Thanks to all for the tips!
Comment: I got three out of four. Not sure the 'fish' is globally accepted. I have no idea what the 'book' is about. I'm with Kashyap; add a little text.
Comment: What's it with the color coding? Any specific meaning?
Comment: @Andrew, regarding the colors - yellow for the Star of David is not a great choice, because of the [yellow patch](http://en.wikipedia.org/wiki/Yellow_badge), while blue is also the color of the Star of David on the Israeli flag, so it could raise the unnecessary connotation of the state of Israel. Also, the Old Testament is as much Christian and Muslim as it is Jewish. I would go for the symbol of the tablets of stone (the 10 commandments) instead of the star.
Comment: Not sure what the book one is, but yes text would definitely help.
Comment: I have no idea what the book is. Jesus Fish seems to be a much more commonly used symbol in the West, and Westerners tend to be less familiar with the Islamic Crescent. I'm not sure what context you're asking this in though. As @GUI Junkie said, a little label (almost) never hurts when ambiguity is an issue.
Comment: @Andrew Thanks for revising! I edited the title to more accurately represent your question.
Comment: Thanks for the revision, I think the little list at the top with the icons of each is helpful to show what each is. Color for those icons wouldn't hurt though; the Book of Mormon is hard to make out, looks like a little black square.
Comment: I'm not a theologian but the basic categories seem out of sync with each other. The first two are two parts of one particular christian tome. The 3rd is a separate religion's tome. And the 4th is an addendum tome to the first 2 for a particular Christian sect. The bigger concern is scalability. How would you scale the icon set going forth with any additional religions? Given the scale and variety of religions out there, it may be best to forgo icons in the first place.
Comment: @Rahul:  My apologies.  Your original assessment of this thread was spot on, and even my and your edits *largely* failed to draw the matter back to a 'user experience' question.  I'll try to make the questions more related to the user experience in future.  And thank you for allowing this thread to continue without canning it - I guess it might have occurred to you to re-close it several times since it was re-opened.
Comment: while this question is about choosing color and iconography rather than design, I would recommend you should find a proper graphic designer to refine the icons so they look more pleasing to the eye; these icons and menu bar -- as it stands now -- looks like they come straight from the early 1990s. While they're OK for scrap work, IMO they aren't good enough for a final product.
Comment: Fish
Judaism
Paperclip lovers
Green mooners
Comment: @Rahul Thanks for the edit and 2nd run!  Also many thanks to the contributors thus far.
Comment: @DA01  Fortunately the set (of freely distributable religious texts marked-up in XML format) is limited to those 4.  So I can't see 'feature creep' (extra religious tomes) being a problem.  If I can create 'reasonable' icons for those 4 tomes - I'll be happy.
Comment: @Vitaly  Interesting comment on the tablets - had not thought of that.  I'll stick with the (now blue) Star of David for a while and see if it works out.
Comment: This is probably off topic, but if there are three main monotheistic religions, why include the Book of Mormon?
Comment: @GUI Junkie  *"..why include .."* Because.. *"The individual works making up the set .. cannot be distributed separately without violating the terms under which the set is made available."* [E.G.](http://www.ibiblio.org/xml/examples/religion/nt/nt.xml). It is 'all or nothing'.
Comment: @Lie Ryan  Color me deeply offended - I spent a lot of time on the geometry/drawing of those images.  Nah, I'm just kidding (about being offended, at least).
Comment: Without any text, I'd associate the Star of David with the Torah or Talmud first, not with the Old Testament. The yellow book is meaningless. For Mormons, a quick search reveals their symbol is a guy with a trumpet, but that's not well known.
Answer: I think you mean, does a user recognize the religion based on the symbols?
If it's shown to a general audience, the answer is No. Well atleast I don't.
The name of the religion is needed below the image imho. The extra text adds minimal amounts in terms of UI, but could potentially make things clear for a large audience.
after the edit to the question
I still think you need the name under the image. The larger images are more prominent than  the icons in the left, so a description under it is important. I doubt if the user will be able to figure out instantly the conventions being used in the site.
If you really cannot have a description, then I guess the least you could do is have a 'tooltip' with the name. It'l also help if you use the same colours as the images for your icons, users may match based on 'colour' quicker.
I'm not a christian, but I've grown so used to recognizing the 'cross' to represent Christianity, that when I saw the 'fish' I figured that it cud've been any religion EXCEPT christianity. :s
Comment: Thanks for the astute observation.  :-)  I have significantly edited the question and am hoping it (both the context and the question) is now more clear.
Comment: edited my answer too, Andrew. hope it helps
Comment: Thanks for the update. With you and GUI Junkie both questioning the fish symbol as being a 'generally recognised' symbol of Christianity, I am almost at the point of swapping it for the cross. As to tool-tips - definitely planned. Repeating the colors in the smaller icons. I could use the color (or a brighter variant) as the mouse-over color for that link. It is not a conventional use of the mouse-over color, but perhaps I can get away with it for this use-case.
Comment: You may not even need to have the mouse over colours once your icon/image colours match. By the time the user focuses on the text link, mentally he would've matched the image and the icon anyway. Multiple mouse over colours sometimes don't look good.
Answer:
Jews do not call their religious books the "Old Testament", for reasons which should be obvious if you stop to think about it. They use the name Tanakh (this is the same set of texts as the Christian Old Testament, but in a different order).
Christians consider both the Old and the New testaments to be inspired scripture, though they may pay more attention to the New.
Mormons are Christians, and accept the full Bible along with the Book of Mormon, the Pearl of Great Price, and the Doctrine & Covenants. Listing Mormons as a separate category to Christians might be considered offensive.
Muslims do accept both the Old and New testaments (but not the Book of Mormon) as inspired texts, but are unlikely to refer to them for theological guidance, as they believe they have been corrupted. They might find them interesting reading, though.
The exact texts which constitute the "Old Testament" are ambiguous, as the Orthodox Church and the Roman Catholic Church both accept various deuterocanonical books (and they don't have quite the same list). The deuterocanonical books are not accepted as part of the Tanakh. Some of the deuterocanon is actually additions to existing books rather than independent books. Some Protestant bibles will include these books (and perhaps some others) in a separate section called "The Apocrypha". (In Orthodox and Roman Catholic bibles, the deuterocanonical books are not in a separate section: they are distributed among the other books of the Old Testament.) (New Testament Apocrypha also exists, but is rarely bound with the Bible, so you don't need to worry about it.)
The Book of Mormon was written in English (well, its backstory is that it was translated from golden tablets, but even if you believe that, the oldest extant version is in English). All the others were translated (from Hebrew, Aramaic, Greek, and Arabic). It would be helpful to indicate which translation you're using. Jews and Christians generally use different translations; Muslims usually do not rely on translations at all, viewing them as a rough guide at best. The Quran is basically considered untranslatable.
The word "Bible" is also ambiguous. To Jews, it is synonymous with the Tanakh. To Christians, it means the Old and the New testaments together.

The practical upshot of all this is:

Do not use religious icons to refer to the books. There is no one-to-one mapping between a book and its religious audience (except, perhaps, for the Quran).
List the books as Tanakh, Christian Bible, Quran, Book of Mormon. This is chronological order, so it shouldn't be offensive.
If the user chooses Tanakh, they get the texts in Tanakh order.
If the user chooses Christian Bible, they can then choose between the Old and the New testaments. The Old Testament is the same texts as the Tanakh, but in a different order.
If your Old Testament set includes any deuterocanonical books, give the users the choice of including them (in Orthodox order or Roman Catholic order), excluding them, or listing them in a separate section (Apocrypha).
For translated texts (all your texts except the Book of Mormon), indicate which translation is used. (Even if it's a sectarian translation: Tanakh: King James Version might not be a Jew's first choice, but it's better than giving no indication at all of which translation you're using.)
Comment: **Spot**. **On**.
Comment: We have a winner!
Answer: I understood the faith references, but did not immediately relate them to the relevant texts. The problem is that they relate more significantly to the faith than the book. In particular, the fish for Christianity (and while it is a recognised symbol within the Christian community, I do not think it is so widely recognised outside) would relate to the entire Bible - Old and New Testaments. Some Christians would be quite offended by the reference to the New Testament only.
I would interpret them as relating to the Talmud, the Bible, the Quran and my filofax. Which means that they are not immediately working. I would consider far more seriously the images you are using to reflect more closely the appropriate images, and definitely put text with them to clarify exactly what they mean. In this case, where there is some confusion or overlap between the different sections, I think it would serve better with text labels. Given that the links are to text, this may be more appropriate.
One problem is that people can get very heated up about religious iconography. They can easily become offended by this being used wrongly, and then refuse to use the site. Getting it correct is important.
(And I am an active Christian, and so know personally that some religious people are pains.)
Comment: +1 I understood each symbol to be a reference to the faith as well (in stead of to the book).
Comment: Any better in the latest edit?
Comment: Is it an improvement, but my other points are still valid. I don't know if the writing on the book would be considered offensive to Mormons.
Answer: Generally speaking (I guess this is a heuristic) symbol + text is better than text alone which is better than symbol alone. So I'd use symbol plus text.
Despite that, I'd use a cross for the Christian symbol. There are too many alternate religious interpretations of fish iconography.
And I'd also look again at the book. I understood it immediately, but I see other commenters did not. The beehive symbol would be an obvious choice (I think...) for Mormon followers (I may well be wrong here - if I am, apologies in advance), but it does not have wider recognition. You may have to do something banal like put the name of the Book on the symbol itself.
Comment: it's noteworthy that the fish used to be Christian's [secret handshake](http://en.wikipedia.org/wiki/Ichthys#The_early_church), but anyway I agree with the requirement of a text (at least on mouse-over)
Comment: The beehive symbol?  I can't say I've encountered it.  In any case, I doubt my ability to figure the geometry for it and reproduce it in an image.  (OK - a hexagon is not hard, but start to wrap them around a beehive and it goes beyond the geometric logic I can muster at ..5:30 a.m.  ;)  Hopefully the title on the cover will save the 'book icon' from the same fate as the fish icon.
Answer: It depends. You can leave out the text in two situations:

Your audience is highly educated in world religions and can be expected to know already.
You want your audience to discover what the symbols mean through a process of exploration.

Otherwise, include the textual name.
Also, you've made an error: You've used the Star of David for the Old Testament. But that symbol actually refers to Judaism, or in this context of books, perhaps the Torah. They are not equivalent. Therefore the Old Testament should also get the cross symbol. If you're going to include Jewish texts, then you can use the jewish symbols and names.
EDIT:
I know little about the Mormons. A google search for "mormon symbol" doesn't yield a definitive response, but it appears that perhaps a picture of Angel Maroni blowing a trumpet might be correct. "LDS symbol" gives an 8-pointed star. Here's a link: http://www.inplainsite.org/html/masonic_and_mormon_symbols.html
Comment: I could not let this rest.  I have started a thread at [Is there a freely distributable English translation of the Torah available?](http://judaism.stackexchange.com/questions/9724/is-there-a-freely-distributable-english-translation-of-the-torah-available) to get the opinion of the people I consider to be the experts on the matter.  I have yet to approach the client with this matter - but they have given my 'wide approval' to make decisions on the matter, so I'm hoping they will follow whatever advice I can determine from the expertise available here on SE.
Comment: glad to hear it


Why use a Display manager?

Question: I'm currently trying to free as much memory as possibile because I'm using my laptop for scientific simulations. One of the things I made is disable gdm and using login+startx to start GNOME session. Apart from eye-candy and comfor, is there any drawback of disabling the Display Manager? I mean, what are the reasons for the existence of GDM, KDM, LightDM and so on?
Comment: Are these scientific calculations dependent on a GUI program?
Comment: @Marco : Not really, in fact when I run big processes I just shut off X and everything not needed... But when I'm debugging and testing the code it's comfortable having X running :) Anyway it's not a matter of life disabling GDM, I was just curious to understand its utility :)
Answer: They handle pretty much everything (that isn't displaying graphics on hardware) for X. Logins, greeters, pass X the configuration for external connections, session choice.
You don't need a heavy DM but I would argue that GDM isn't that heavy. LightDM certainly isn't. But if you're really trying to hypermile things, take a look at NoDM. It's very raw and it's only intended for single-user systems. It won't provide you with any security and it might undermine what is already there.
I use NoDM on our media-centre, which just starts up X and then launches Boxee.
Comment: It could but it's certainly possible to do that. If you don't even want NoDM (which practically does just call startx), [you *can* hotwire tty1 to login and start X up](http://www.debianadmin.com/how-to-auto-login-and-startx-without-a-display-manager-in-debian.html). Very hacky though. NoDM would be preferable in almost every possible case.
Comment: so starting X just with `startx` could create some mis-configuration problems?
Comment: Thanks for your replies... but the problem is that my machine is multiuser so I need in every case a login mask. Your link is anyway very iteresting ;)
Comment: LightDM might be worth a go. It's quite new but it's going to be in the next version of Ubuntu. There is a PPA.
Comment: Actually I'm trying it.... Seems nice, even if very win95ish :) I'll play with it for a while... Do you know where can I find more info about session-init operations done by gdm or any dm? Googled something but didn't find so much...
Comment: I haven't read it in full but [this gives a good idea of what's going on in `xdm`](http://www.netads.com/~meo/pubsntalks/xrj/xdm.html) -- the first X display manager.
Comment: Nobody should really need NoDM anymore: [lightdm's autologin now does the right thing out of the box](https://www.enricozini.org/blog/2019/himblick/x-autologin).

Why use a Display manager?


Wet venting shower

Question: I know this comes up fairly often, but I wanted to check nonetheless.
I am roughing in a new shower and lav setup. The lav and shower both feed into a 2" sani tee. The lav has a 1-1/2" vent to the roof.
I am asking if I need to run a separate dry vent for the shower drain. I'd like to avoid this but I want to make sure there aren't issues with the proposed wet vent.
The diagram below shows the scheme. The line-drawn part is the dry vent for the shower that I dont want to run if possible. I can't take the shower vent straight up as there's a lot of water plumbing (shower valve, etc.) between those studs.
Details:

2x8 framing with header joists all around.
lav and shower are 2" lines under the floor joists. Lav riser and vent is 1-1/2"
WC last connected downstream with its own vent

Look ok?
Comment: Vent is a vent, as log it has adequate pipe size it will work providing air to the drain
Answer: The limiting factor is, then, the "lav riser" at 1.5" and the wet venting capacity of 1.5" pipe under your apllicable code (they don't all agree, though they are usually similar.)
Using a 2" "riser" and a 1.5" dry vent above that would be less limiting. i.e. don't reduce the lav pipe until you are at the dry vent point above where the trap arm enters it.
Under IPC, 1-1/2" as a wet vent only supports 1 DFU, while 2" as a wet vent supports 4 DFU. A DFU is a "drainage fixture unit" used for sizing drains and vents under code.
A 1-1/2" dry vent will vent up to 10 DFUs, for comparison, if it's less than 100 feet in developed length.
A lavatory is one DFU. A shower is at least 2 DFU, (could be more, up to 6 depending on flow rate, but likely not)
1 + 2 = 3 and 1 < 3 < 4 so as I read it, you need to make the lavatory riser 2"
I'm also a highly dubious about the application of a sanitary tee where you need a wye. Sanitary tees are for horizontal pipes entering vertical pipes. Wyes are for joining two horizontal pipes. That joint will probably clog as drawn, since flow is not directed "downstream" as a wye will do.
Comment: Ok. I've not glued anything yet (and can take the tee back to home depot ;-) Thanks!
Comment: Beware that if you cut PVC or ABS to "fit" without gluing, it ends up too short when glued...
Comment: Yup. I measure to the inside flange, for 2" that adds 3/4" at each end, for 1-1/2 it adds 11/16".

Wet venting shower


Doing a factory reset on a laptop

Question: My laptop used to come with windows 10, but then I decided to install ubuntu on it instead. Now I would like to install windows 10. Is there way to get windows 10 back?
Answer: First you will need a bootable USB - a USB flash drive that has at least 16GB of space (there are free programs that you will find available on internet to make the USB bootable), download  Windows 10 ISO file and add to the USB.
Alter the BIOS sequence on your PC so your USB device is first. In most instances, the BIOS will usually not be automatically set to your device. If you skip this step, your computer will start regularly from your hard drive instead of getting boot information from your USB device, then follow the steps to install the windows OS.

Doing a factory reset on a laptop


Do child processes copy entire arrays?

Question: I'm writing a basic UNIX program that involves processes sending messages to each other. My idea to synchronize the processes is to simply have an array of flags to indicate whether or not a process has reached a certain point in the code.
For example, I want all the processes to wait until they've all been created. I also want them to wait until they've all finished sending messages to each other before they begin reading their pipes.
I'm aware that a process performs a copy-on-write operation when it writes to a previously defined variable.
What I'm wondering is, if I make an array of flags, will the pointer to that array be copied, or will the entire array be copied (thus making my idea useless).
I'd also like any tips on inter-process communication and process synchronization.
EDIT: The processes are writing to each other process' pipe. Each process will send the following information:
typedef struct MessageCDT{
    pid_t destination;
    pid_t source;
    int num;
} Message;

So, just the source of the message and some random number. Then each process will print out the message to stdout: Something along the lines of "process 20 received 5724244 from process 3".
Comment: @FranziskusKarsunke I'm just trying to understand a concept and maybe a few tips. I'm not looking for actual code.
Comment: Could you post more information about the processes? What are they doing? Why don't you use Threads? Why do you use an array of flags and not one controlling process, which controls all other processes?
Comment: @FranziskusKarsunke Sorry for lack of detail, I've updated the information. This is just a homework assignment. Multithreading is not what I'm working on. Could you elaborate a bit more on how a controlling process would work?
Comment: Well... If it's an assignment you should do it on your own^^
Answer: Unix processes have independent address spaces.  This means that the memory in one is totally separate from the memory in another.  When you call fork(), you get a new copy of the process.  Immediately on return from fork(), the only thing different between the two processes is fork()'s return value.  All of the data in the two processes are the same, but they are copies.  Updating memory in one cannot be known by the other, unless you take steps to share the memory.
There are many choices for interprocess communication (IPC) in Unix, including shared memory, semaphores, pipes (named and unnamed), sockets, message queues and signals.  If you Google these things you will find lots to read.
In your particular case, trying to make several processes wait until they all reach a certain point, I might use a semaphore or shared memory, depending on whether there is some master process that started them all or not.
If there is a master process that launches the others, then the master could setup the semaphore with a count equal to the number of processes to synchronize and then launch them.  Each child could then decrement the semaphore value and wait for the semaphore value to reach zero.
If there is no master process, then I might create a shared memory segment that contains a count of processes and a flag for each process.  But when you have two or more processes using shared memory, then you also need some kind of locking mechanism (probably a semaphore again) to ensure that two processes do not try to update the shared memory simultaneously.
Keep in mind that reading a pipe that nobody is writing to will block the reader until data appears.  I don't know what your processes do, but perhaps that is synchronization enough?  One other thing to consider if you have multiple processes writing to a given pipe, their data may become interleaved if the writes are larger than PIPE_BUF.  The value and location of this  macro are system dependent.
-Kevin
Comment: Just so you know, no modern *nix actually copies the whole address space.  They do a copy-on-write thing, arranging page table entries so that the two address spaces point to the same memory, and no copying is done until one or the other attempts to write to a given page.
Answer: The entire array of flags will seem to be copied. It will not actually be copied until one process or another writes to it of course. But that's an implementation detail and transparent to the individual processes. As far as each process is concerned, they each get a copy of the array.
There are ways to make this not happen. You can use mmap with the MAP_SHARED option for the memory used for your flags. Then each sub-process will share the same region of memory. There's also Posix shared memory (which I, BTW, think is an awful hack). To find out about Posix shared memory, look at the shm_overview(7) man page.
But using memory in this way isn't really a good idea. On multi-core systems it's not always the case that when one process (or thread) writes to an area of shared memory that all other processes will see the value written right away. Frequently the value will hang out for awhile in the L2 cache and not be immediately flushed.
If you want to communicate using shared memory, you will have to used mutexes or the C++11 atomic operations to ensure that writes are properly seen by the other processes.
Comment: So if a process writes to one index of the array, the other processes won't see this change?
Comment: @seljuq70: No, they won't. No memory is shared between processes after a `fork` call unless you explicitly do something to make it happen.
Comment: Well, that answers that question. Shared memory it is, thanks for the help.
Comment: @seljuq70: Even with shared memory you will have to work to make sure processor caches stay appropriately synchronized. A shared array of flags will have odd results that you may not expect.

Do child processes copy entire arrays?


UX Design for a range slider which is optional

Question: I have a range slider field (to select age range) which is an optional field. I'm trying to make the UX as smooth as possible but there are a few things that I'm super confused about.

As this is an optional field, what should the default state of the slider look like? They currently rest at 0, but this confuses a lot of users and makes them think that the range slider is active at with 0 values when in reality it's not.
If a user accidentally selects a range for the slider but later wants to remove the slider values, what state should it fall back to? Should there be a reset button next to the slider?
Answer: You don't need a range slider. Don't make them fiddle with controls, when a single input will do the job.
Sliders can be problematic UI elements, as Nielsen Norman group has studied:

Selecting a precise value using a slider is a difficult task requiring good motor skills, even if the slider is well designed. If picking an exact value is important to the goal of the interface, choose an alternate UI element.
The wider or the denser the range selectable through a slider, the harder it is to select a precise value.

If a single value is good enough, just put an input field with an indicator that it's optional, and they can just delete the value if they change their mind.

Update: If you must work with canned ranges because of product requirements for data collection
If you're using discreet age brackets (i'm assuming for marketing and product data), then a range slider makes things even harder for the user, because they have to decide 'what range am I in?' and fiddle with the controls themselves.
Try radio buttons or a dropdown instead:
Comment: As it is a range input (users can select age range- 18 to 30, 45 to 90, etc),  I stuck with sliders as I thought that they would help the user visualise the range selected better than input boxes. I have other range fields in the form as well. Are input fields for range just as intuitive as range sliders?
Comment: @AshwinNepal in this case it's more intuitive, in my experience. People don't need to be very exact here, 18-30 will suffice, they won't want to select 21-23. So it's best to simplify and not give users more options than they actually need.


Why does "Else" statement still print even if "IF" statement is true in nested for loop

Question: Why does my "ELSE" statement still prints even if my "IF" is always true
I have an array wherein I am trying to search to see if there is a substring in it. When it does have that substring it should run another for loop with if and elif statements
test = ['SCHEDULE:1457H', 'SCHEDULE:1550H', 'SCHEDULE:1740H', 'SCHEDULE:1705H']
task = ['ST:124', 'BROWSE:testB', 'DOWNLOAD:DLthis', 'REJECT:rejectme', 'APPROVE:goodtoGo', 'ST:123']

while time.time() < t_end:
    index = 0
    for n in test:
        if "1457H" in n:
            for item in task:
                if "ST" in task[index]:
                    print(task[index])
                    index += 1
                    time.sleep(2)
                elif "LOGIN" in task[index]:
                    print(task[index])
                    index += 1
                elif "BROWSE" in task[index]:
                    print(task[index])
                    index += 1
                elif "DOWNLOAD" in task[index]:
                    print(task[index])
                    index += 1
                elif "REJECT" in task[index]:
                    print(task[index])
                    index += 1
                elif "APPROVE" in task[index]:
                    print(task[index])
                    index += 1

    else:
        print("Sleeping")
        time.sleep(2)

Results:

ST:124
BROWSE:testB
DOWNLOAD:DLthis
REJECT:rejectme
APPROVE:goodtoGo
ST:123
Sleeping

Then repeats it again because of the while loop. I can't figure out why the "ELSE" statement still prints. I tried fixing the tab spaces of the "ELSE" statement and it still prints and even worse than the current Results.
Comment: In addition to the tabs/spaces issue (which is probably driving your main issue), your code has a lot of other very weird stuff going on. There's no good reason to be looping with `for item in task` if you're not going to use the `item` value at all, and instead use a manually updated `index`. If you really did need an index in addition to the value, you could use `enumerate` to get them both at the same time (`for index, item in enumerate(task):`).
Comment: Why did you remove an indent level in your post just now? I noticed already that you must have manually added spaces to format the block as code, and that the indentation you must be seeing in your editor wasn't *quite* reproducable from a simple remove-4-spaces operation here. Did you re-paste the code or manually remove those spaces?
Comment: I just need to print the value inside because I'm still gonna use that value as a variable to run another command. I just really need to make the "else" statement run properly. @Blckknght
Comment: @MartijnPieters copied it from sublime then pasted it here.
Comment: So you didn't add or remove indentation the first time you copied, or the second time you copied?
Comment: Either way, the code would not run *at all* as the current indentation in the post would raise an `IndentationError` exception; the `else:` block would end up at the wrong level for either the `for` or the `if` statements as far as Python is concerned.
Comment: I tried fixing it and the results are still the same @MartijnPieters but `else` should be aligned with first for loop right? cause if it is aligned with the `if "1457H" in n:` it prints `sleep` 3 times then executes the `if` in the next loop
Comment: @GanzoPalumi: so what did you expect to happen? The `else` block on a `for` is not influenced by `if` statements in the loop.
Comment: Hi, your else is not indented with if, your, hence, it is printing after coming out of for loop. Also, instead of using too many nested if and elif, use some other technique, which would also help in increasing your code readability
Answer: You are mixing tabs and spaces in your code. Do not do this. Your editor is set to expand tabs to 4 spaces, while Python expands tabs to 8 spaces. For your code, where some lines use tabs only, some lines use spaces only, and some lines appear to mix tabs and spaces, this leads to a completely different set of indented blocks as far as Python is concerned.
The else branch is indented to match the for loop, not the if test. This means the else block is always run when the for loop completes without a break statement, and not when the if test fails.
Configure your editor to use spaces only when indenting, and replace all tabs with 4 spaces, and your code will work fine.
Comment: I edited my post, the else statement should be aligned with the `for n in test:`  how do I make the "else" statement stop printing even if the "if" is true. I checked the spacing in sublime and nothings wrong with it
Comment: @GanzoPalumi: the text *as posted into your question* has loads wrong with it. Select the text in Sublime, and you'll see vague lines for tabs, dots for spaces. Use `View > Indentation > Tab width: 8` to see what Python sees. Then set the `Indent Using Spaces` and `Convert Indentation to Spaces` in the same submenu to repair (after switching back to a 4-character tab width).
Comment: @GanzoPalumi: then indent the `else` line to match the `if` indentation.
Comment: I matched it with `if "1457H" in n:` the result is still the same.
Comment: @GanzoPalumi: it is entirely unclear what you expect the `else` block to do. If paired with the `for` loop it will **always** be executed unless you exited the `for` loop with `break`.
Comment: I tried just putting one value inside the `test = [SCHEDULE: 1457H]` it prints fine. is it just because of my array or how I for loop it?
Comment: Without a clear description of what behaviour you are trying to code here I can't help, sorry.


Is Battle of the Immortals safe to download and install?

Question: My youngest wants to download and install Battle of the Immortals from Perfect World.
I was suspicious straight away as it was installing games like this that caused problems on the kid's computer earlier this year - strange browser toolbars and the like being the most obvious ones. We've since reinstalled Windows and I'd like to keep the machine clean.
I've found a forum thread here that claims the game contains a trojan, but it's couched in language that makes me think of conspiracy theorists and doesn't offer any hard evidence. Also as Lee points out in his comment there isn't going to be any out-and-out malware in there. It's more the "extra" toolbars etc. that I'm sure will be included in the install that I'm worried about.
I'd like to be sure that I'm not going to let him install anything nasty onto their computer. I can obviously scan the exe before I run it, but that won't tell me if it installs any browser plugins etc. What else can I, and should I, check?
Comment: Your first link doesn't appear to claim the game is a trojan; it seems to be talking about a third party cheating program. The game's publisher is listed on the NASDAQ and worth over a billion dollars. I think that's reason enough to believe they won't include outright malware.
Comment: A side point - **always** go with the "advanced" or "custom" install. If a program wants to install toolbars or other such garbage, you'll have a choice to decline by not using the basic install.
Comment: @Lee - OK - my mistake, I'll remove that link.
Answer: Seeing as there is a large community for that game it's unlikely it's purely a malware. About it containing a trojan - reading the content of this forum thread and this post suggests it's a false positive by a specific security software (or two).
On the other hand, the poster from your provided link was pretty convinced that the game is up to no good.
I don't know the credentials of any of these people; but as the game does look serious and has some players, I doubt it contains a trojan (a back door into your machine). That's just my personal opinion, though. Services like Virustotal can help you see which anti-virus software flags a file as harmful and think for yourself if it looks like a false positive or not.
Comment: I saw that post on the BoI forum - I should have included it in the question. The more I read, the more it seems OK, but I'm still wary.


Asymptotic convergence of the total length of a graph

Question: I encoded the following algorithm: suppose we're in (0,1)x(0,1) and I randomly create a "village" one at a time. At each step, I link a newly randomly created village to the closest village already created.
So basically:
step 1: 1 village somewhere in (0,1)x(0,1)
step 2: I link village 2 to village 1
step 3: i create village 3 and link it to the closest village already existing (1 or 2)
etc...
Empirically I found that the total distance that link the villages all together grows like sqrt(n) when n goes to infinity.
Could anyone explain me why? I've though about it but could not come up with a good proof (I tried to find a recursive relationship but I did not get what I wanted). Also, when thinking about it, I realized there could be some issues when considering villages very close to the sides of the rectangle and so, you may not take this case into consideration.
Comment: Upvoted back to 0 as there's no good reason to downvote this question.
Answer: The density of villages goes up as $O(n)$, so the distance to the nearest one must go down as $O(1/\sqrt{n})$.  (Imagine a perfectly regular grid. If there are $n^2$ villages in the grid, the grid would be a square $n$ villages on a side, so their separation would be about $1/n$.)  The total distance would therefore be (with a slight abuse of notation) $\sum_{k=1}^n O(1/\sqrt{n}) \sim O(\sqrt{n})$.
ETA: The sum of $O(n^p)$ for $n$ from $1 \to \infty$ is $O(n^{p+1})$, broadly speaking.


PHP sdk to facebook page post, Uncaught OAuthException: (#200)

Question: I keep getting:
"Uncaught OAuthException: (#200) The user hasn't authorized the application to perform this action"
<code>require_once("resources/facebook_sdk/facebook.php");

    $app_id       = 'appid';
    $app_secret   = 'appsecret';

    $facebook = new Facebook(array(
        'appId' => $app_id,
        'secret' => $app_secret,
        'cookie' => true
    ));

    $user = $facebook->getUser();
    if($user)
    {

        $access_token=  $facebook->getAccessToken();

    }

    else {

        $loginUrl = $facebook->getLoginUrl(array(
            'canvas' => 1,
            'fbconnect' => 0,
            'scope' => 'offline_access,read_stream,user_photos,user_videos,publish_stream,manage_pages'
        ));
        echo ("<script> top.location.href='".$loginUrl."'</script>");
    }

    $req =  array(
        'access_token' => $access_token,
        'name' => 'My wall post',
        'message' => 'tralalala',
        'caption' => "www.mysite.com",
        'link' => 'http://www.mysite.com',
        'description' => 'Wall post',
        'picture' => 'http://farm6.static.flickr.com/1111/some-pic.jpg',
        'actions' => array(array('name' => 'My Site',
            'link' => 'http://www.mysite.com'))
    );

    print_r($req);
    $res = $facebook->api('/pageid/feed' ,'post',$req);
    if ($res) echo "succes";
    else echo "fail";
    print_r($res);
</code>
Any ideas what I'm doing wrong, publish stream permission is given?
Answer: This answer is taken in to consideration that you have all rights of server to upload on Facebook.Checkout some of links below for more information,
Facebook API OAuthException: (#200)
Facebook Open Graph API returns: (#200) Requires extended permission: publish_actions
Uncaught OAuthException: (#200), when trying to post on wall
Multiuser event invite graph api fails Permissions Error:200 OAuthException
You have give all permission which you define in scope,
<code>'scope'=>'offline_access,read_stream,user_photos,user_videos,publish_stream,manage_pages';
</code>
may help you.
Comment: @Phoenix_yay can you just write publish_stream in scope & check what will be done?
Comment: @Phoenix_yay can you solved this issue or find some problem, my answer help you or not?


tensorflow.contrib

Question: ModuleNotFoundError: No module named 'tensorflow.contrib'
I've had this error on two AI related projects so far and I can only see this occurring more and more often. The two projects for reference are GPT-2 (GPT-3 is not available to the public) and real-time-voice-cloning
What I've read on the internet so far, is that tensorflow.contrib was meant to be deleted with the new version of tensorflow 2.0. However, these projects don't support tensorflow 2.0, they were made for tensorflow 1.5
So my question is does anyone know of an archive for tensorflow.contrib so I can use these very popular irreplaceable projects?
Answer: I fixed it and this is how:
Install anaconda
If your terminal now begins with (base):
conda deactivate
Don't have anaconda load your base environment on startup (caused issues for me)
conda config --set auto_activate_base false
conda create –name project_name
conda activate project_name
conda install pip python==3.7
conda install tensorflow-gpu==1.15 or conda install tensorflow==1.15 if using cpu
(Installing tensorflow 1.15 had tensorflow.contrib in it already I think...)
Best of luck if you're having this issue too.

tensorflow.contrib


What does GLFW require linking with?

Question: I keep getting undefined reference errors trying to compile this code:
#include <GLFW/glfw3.h>

int main(void)
{
    if (!glfwInit())
        return -1;

    glfwTerminate();
    return 0;
}

I have the files test.cpp(the source file) and libglfw3.a(downloaded from the glfw website) on the same folder, while GLFW/glfw3.h is inside the same file as the other c++ headers like iostream, vector, etc...
I can generate the .o file just fine:
g++ -c test.cpp

And that gives me test.o, but when I try to link it with the libs like this:
g++ test.o libglfw3.a -lopengl32 -o test.exe

I get these errors:
test.o:test.cpp:(.text+0xe): undefined reference to `glfwInit'
test.o:test.cpp:(.text+0x23): undefined reference to `glfwTerminate'
collect2.exe: error: ld returned 1 exit status

What else am I supposed to be linking those files with, is there something wrong with my code, what am I missing here?
Edit: Okay, now I tried using the 64 bit pre compiled binaries instead of the 32 bit, and now I get this:
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
Warning: corrupt .drectve at end of def file
glfw3.lib(glfw.dir/Release/init.obj):(.text$mn+0x73): undefined reference to `__imp___stdio_common_vsprintf'
glfw3.lib(glfw.dir/Release/init.obj):(.text$mn+0x327): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/init.obj):(.xdata[$unwind$_glfwInputError]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x196): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x82): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x91): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x9b): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x206): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.text$mn+0x45): more undefined references to `__security_check_cookie' follow
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwPollMonitorsWin32]+0x20): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwSetVideoModeWin32]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwPlatformGetMonitorPos]+0x14): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwPlatformGetMonitorWorkarea]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwPlatformGetVideoModes]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_monitor.obj):(.xdata[$unwind$_glfwPlatformGetVideoMode]+0x14): more undefined references to `__GSHandlerCheck' follow
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0xe7): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0x97): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0xbc): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0x3bc): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0x1d2): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.text$mn+0x48): more undefined references to `__security_check_cookie' follow
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$_glfwIsWindowsVersionOrGreaterWin32]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$_glfwIsWindows10BuildOrGreaterWin32]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$_glfwInputErrorWin32]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$_glfwUpdateKeyNamesWin32]+0x20): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$_glfwPlatformInit]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_init.obj):(.xdata[$unwind$loadLibraries]+0x8): more undefined references to `__GSHandlerCheck' follow
glfw3.lib(glfw.dir/Release/window.obj):(.text$mn+0x29e): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/window.obj):(.xdata[$unwind$glfwCreateWindow]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/input.obj):(.text$mn+0x286): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/input.obj):(.text$mn+0x794): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/input.obj):(.xdata[$unwind$glfwUpdateGamepadMappings]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/input.obj):(.xdata[$unwind$parseMapping]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/context.obj):(.text$mn+0x594): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/context.obj):(.xdata[$unwind$_glfwRefreshContextAttribs]+0x18): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/egl_context.obj):(.text$mn+0x4b7): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/egl_context.obj):(.text$mn+0x49): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/egl_context.obj):(.text$mn+0x534): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/egl_context.obj):(.xdata[$unwind$_glfwInitEGL]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/egl_context.obj):(.xdata[$unwind$_glfwCreateContextEGL]+0x18): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.text$mn+0x447): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.text$mn+0x2d): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.text$mn+0x6c): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.text$mn+0x3a3): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.text$mn+0x77f): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.xdata[$unwind$_glfwInitWGL]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.xdata[$unwind$_glfwCreateContextWGL]+0x14): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/wgl_context.obj):(.xdata[$unwind$choosePixelFormat]+0x10): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x50): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x1a7): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x50): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x225): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x84): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.text$mn+0x3ee): more undefined references to `__security_check_cookie' follow
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformSetWindowPos]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformGetWindowSize]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformSetWindowSize]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformSetWindowSizeLimits]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformSetWindowAspectRatio]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_window.obj):(.xdata[$unwind$_glfwPlatformGetFramebufferSize]+0xc): more undefined references to `__GSHandlerCheck' follow
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x1d3): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x10e): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x233): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x38e): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x60): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.text$mn+0x518): more undefined references to `__security_check_cookie' follow
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$_glfwInitJoysticksWin32]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$_glfwDetectJoystickConnectionWin32]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$_glfwDetectJoystickDisconnectionWin32]+0x14): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$_glfwPlatformPollJoystick]+0x28): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$_glfwPlatformUpdateGamepadGUID]+0x8): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/win32_joystick.obj):(.xdata[$unwind$deviceObjectCallback]+0x10): more undefined references to `__GSHandlerCheck' follow
glfw3.lib(glfw.dir/Release/osmesa_context.obj):(.text$mn+0x21b): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/osmesa_context.obj):(.text$mn+0x4c): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/osmesa_context.obj):(.text$mn+0x1cd): undefined reference to `__security_check_cookie'
glfw3.lib(glfw.dir/Release/osmesa_context.obj):(.xdata[$unwind$_glfwInitOSMesa]+0xc): undefined reference to `__GSHandlerCheck'
glfw3.lib(glfw.dir/Release/osmesa_context.obj):(.xdata[$unwind$_glfwCreateContextOSMesa]+0x10): undefined reference to `__GSHandlerCheck'
collect2.exe: error: ld returned 1 exit status

I this sort of means that I am making progress, because now the functions are defined, whatever they use is missing. Still doesn't using the 64 bit libs mean that the .exe file will not work in a 32 bit system?
Comment: Tools exist to show symbols exported by libraries, so it's quite possible for you to find out what exports the symbols you need. Read up on `nm`, `objdump`, `readelf`, `ldd` and more..
Comment: Based on GLFW documentation, it mentioned that you need to explicitly link with gdi32 library (When using MinGW to link an application with the static version of GLFW, you must also explicitly link with gdi32).  https://www.glfw.org/docs/latest/build_guide.html#build_link_win32
Comment: The second set of errors looks like you're using binaries built for visual studio (`.lib`), not for MinGW (`.a`).
Comment: Also remember that the *order* you link things in matters. You should link objects that *need* a symbol before objects that *provide* the symbol. Since most linkers will process objects in the order given and throw out any symbols provided by the current object (as unneeded) if it has not previously seen anyone needing it.
Comment: I'm not sure if it matters, but instead of `libglfw3.a` you would normally use `-L. -lglfw3`.
Comment: @HolyBlackCat That was exactly what I needed to fix, thank you!
Answer: You try to link glfw library in a wrong way. The correct command is:
 g++ test.cpp -lopengl32 -lglfw3dll

This works only if glfw files are properly placed in MinGW folders. Make sure that
glfwf3dll.a file is placed in MinGW/lib,
glfw3.dll in MinGW/bin,
and GLFW folder with headers inside MinGW/include.

Otherwise, if you really want to use static GLFW library (.a), which will be placed in the same folder as your project, paste libglfw3dll.a to the project folder and compile the following way:
 g++ test.cpp -lopengl32 libglfw3dll.a

What does GLFW require linking with?


How Do I Plan for an Intrusion Detection System?

Question: I would like to plan for an intrusion detection system in a home that is currently under construction.  The home has a walkout basement that is sloping, shown in the rear elevation picture shown below.
I've included an image outlining the major alarm system components to provide a clear reference when referring to different components.
I was planning on installing magnetic contacts (#7113) at each window on the basement, and first floor level.  I was planning on installing a garage door contact (#7456) on each garage door.  Also, recessed magnetic door contacts (not in component diagram) at each of the 3 first floor entry ways.
I'm planning on installing a keypad near the entry of the front door and the door coming in from the garage (#7508).
The security system itself will be installed in the basement, with 22/4 home-runs running from each window/door contact, and Cat6 from the keypads to the panel.
These are the main questions I have:

Should I install a keypad anywhere else?
Is it recommended to install window sensors on windows that are not accessible except by a ladder (2nd floor, and some windows on 1st floor)?
I need help on where, and how to install glass break sensors (#7356), if necessary and recommended.
Do you recommend motion detectors, and if so, where would you recommend them in the floor plan?
Where is the siren typically installed?
Any other considerations?

Note, that the elevation diagram is from the stock plan purchased from an architect, and the  other floor plans are something I put together to show some modifications made to the stock plan/window placements.
Thanks.

Basement

Main Floor

Second Floor

Rear Elevation
Comment: @RyanWalkowski - your statement is confusing.  Cat6 comes in both stranded and solid.
Comment: Motion detectors are your primary means of intrusion detection.  Window and door contacts are primarily for ensuring your home in physically secured when you arm you alarm.  Any room with a window or door that could conceivably be a route for intrusion should have a motion sensor trained on the door/window.
Comment: @user115232 This comment clears things up.  This is how I see things based on all the excellent comments/answers.. While contacts provide some protection, they don't protect against entry by glass breaking, so then glass break sensors would be required, but these may produce many false-positives, or no alarm at all.  However, motion detectors cover all bases (forced entry, etc). Therefore, motion detectors are the primary means of intrusion detection.  The real value in contacts, are to provide a status that a home is physically secured.
Comment: Best not to use cat6 or any other solid conductor cable. Use screened braided cable in alarm systems it can make a big difference.
Comment: @RyanWalkowski Why does braided cable make a difference?
Answer: Note, I'm not anywhere near an alarm professional, however I have installed a couple systems before and have just recently been researching again as I prepare to move into a new house where I'd like to install an alarm.
Keypads
You'll want a keypad anywhere you normally enter/exit the house, such as by the garage door or back door. As @bib points out, you may also want one in the master bedroom to be able to use panic, or see status of the system.

Window Contacts
Whether contacts on the windows are worthwhile depends on what you are trying to protect.

My opinion is it's better and easier to cover the areas with a motion sensor. If someone breaks the window, the alarm still goes off if they come in. If you want to leave a window open (normally you'd have to bypass the zone to arm) you're still covered.
The caveat to this is for "stay" arming. Typically when you're at home and arming the system, all the interior motion sensors are bypassed. If there is a window that is easily accessible from the ground floor, you may want a contact on it. For the second floor, it's probably not likely that someone is going to manage to get a ladder up to your house without either waking you up or making the neighbours suspicious so it's probably overkill there.

Glass breaks
Glass break sensors are another good way to cover likely intrusion points through windows where someone is going to smash it to get in. Patio doors and sidelights beside doors are good options. The sensor you quoted is actually an older style, most of the new ones are audio sensors that listen for the sound of breaking glass and work in anywhere from a 10 to 25' radius (depends on the glass, check specs). You can get these combined with motion sensors as well.
Glass break sensors are good for "stay" arming (when motion sensors are bypassed) or if you want early warning. In most cases, a motion sensor is going to alarm even if the glass break doesn't.

Motion Sensors
I would probably put motion sensors in:

top-right corner of family room - covers windows at the back
somewhere in entry way (a 360-degree ceiling-mounted would work well) - covers anyone moving through the main area of the house and using the basement stairs
top-right corner of basement - covers the basement windows

Of course you can put more if you want, but you need to think of what you're trying to protect from. If someone breaks in through, eg, the dining room, they are probably going to walk around and set off a motion somewhere. If you do have enough valuables in a room that someone may break in, steal everything from that room and leave, then you may want to put motion or some other sensor in there.

Siren
The siren should go somewhere it can be heard inside and out. Typically it's just installed in the basement near the alarm panel. You may also consider installing in the attic, or outside (you can get them with flashing lights too) so it's audible/visible to neighbours.

Panel protection
I am also a fan of installing protection around the alarm panel. Usually there is a 30-second delay to put in your code, and that may give someone enough time to get to the panel and disable/disconnect it. If the panel is in its own room, put a door contact on that room and otherwise put a motion sensor in there. Either way that zone should be set up as instant -- even if the system is in the delay entry mode, activating either of those zones should instantly alarm the system. Normally interior zones are bypassed while in delay entry.
This is also a consideration for motion sensor placement -- you can set up the motion sensors so if you were to walk into eg, the living room without disarming first, the alarm would go off. You just have to carefully consider placement here, and ensure that you don't set this up somewhere a person would normally walk before disarming.

Door lock sensor
I am considering my own system, and one neat thing I thought of (though apparently I'm not the first) was to put a plunge sensor in the back of the deadbolt channel, so that it can detect if the deadbolt on the door is locked or not. This may not be part of the alarm, but it can at least let you check the door is locked without getting out of bed or after you're already at work (assuming you have internet connectivity on the system). Unfortunately in my house there is a sidelight integrated into the door that prevents me from doing this.

Garage
You should consider how you use the garage. There are several ways to alarm it.
If you're not trying to protect the garage, it's pretty simple, though you may still want contacts on the doors to at least let you see if they're closed or not.
If you're using a wireless system with remotes, you can arm/disarm the system with those allowing you to exit from the alarm. If not, you need to ensure you have enough time to arm the system from a keypad, and get out of and close the garage doors before the system is done its arming countdown. This may mean putting a keypad in the garage, but again it depends on your use.

Fire
You should also put in some smoke/heat detectors. They can be wired into the alarm and thus monitored as well as setting of the siren (usually it does a different noise) in case of fire.

Monitoring
If you're going to have a company monitor the system, you need to ensure there is connectivity. At least this means a telephone line or internet connection. For telephone lines, a special jack (RJ31X) is used that allows the alarm to disconnect and take over the line, and so you need to route the main telephone line to the alarm panel before it goes to any other jacks in the house.
However you should also consider that someone may cut the line, and in that case communications is down. You can get GSM cellular options for communication that work around this.
Comment: Great answer, here are a few more thoughts. Add a second sensor point on windows you may want to leave cracked open for fresh air. I wouldn't use a glass break sensor on "stay" because they can detect sounds like keys shaking. I'd put the siren out of reach since so it can't be disabled. For motion sensors, focus on where people cross side to side and aim high to avoid triggering on pets.
Comment: Door and window contacts are primarily for [ensuring doors and windows are closed when you arm](http://diy.stackexchange.com/questions/16081/how-should-i-wire-for-a-security-system-during-construction/16086#comment22551_16123).  They should not be relied upon for intrusion detection - use motions for that purpose.  Contacts should be installed on every door and window that must be closed to physically secure your home or prevent false alarms.
Comment: I have never seen a glass-break detect an intrusion that a motion did not.  I would rather have another motion sensor than a glass break detector.
Comment: Side rant: I haven't seen major alarm companies adopting the internet. They could integrate heartbeat monitoring, remote access, etc. If you have VOIP, you often have to get a second VOIP adapter for the alarm system to plug into the control panel's modem. It's enough to make any techie cringe.
Comment: @user115232 Very good points. It all makes perfect sense now. Thanks.
Answer: Ok, too many questions, but i will hack at a couple points.

On new construction, I would go with the recessed round contacts on the lower sash. completely hidden
The thief that comes in a gutter repair truck probably has ladders. My general rule is all windows get sensors unless they are visible from road and require more that a 15' ladder, or hidden and need a 25' ladder. It's OK to daisy chain a few windows together if they are likely to be open at once to reduce the number of runs, just make sure the wiring is good and accessible from the sensor hole with slack.
glass break detectors are great for detecting broken windows, but for intrusion the window and door sensors and motion sensors are better. They always seem to be either too sensitive (thunder,) or not sensitive enough.
keypads at entry's and M/B
Motion sensors are the best. Garage, two on main floor (maybe mounted on walls of central closet pointing out. cover the entire floor), and one 2nd floor hall.
I mount sirens up high, pointed at the neighbors, and safe from tampering. Some people point them to make the most noise in the house to rattle a theif, but you will soon regret that since everytime you forget to turn off the alarm you will jump.
Comment: The down side of daisy chaining windows is that you end up going to multiple rooms to figure out which one is preventing you from arming and causing you to be late for your appointment.
Answer: Keypads are typically also installed in the master bedroom to allow setting, disarming and panic activation.
I will leave the rest of the questions for someone whose installation experience is more recent than mine of 40 years ago.
Comment: I think that on some systems, you may be able to use a wireless remote in the bedroom (or elsewhere) or even a smartphone or tablet, but that is system specific and not as bulletproof as a wired keypad.
Answer: I am new to the alarm installation world, however I just completed installing mine after much extensive, intensive research- thinking like a thief & more importantly a desperate thug! I Have incorporated both wireless & wired detection with a vista21ip panel & 6160rf keypad. I recommend motion in all rooms doubled if you can afford it- also all entry points windows doors garage contact sensors followed by motions- on sliding glass door entry points contact & shock sensors. The use of gsm comm module is as they say the best, most reliable method of sending signal to the alarm monitoring co. Basically a 3 or 4g cellular mounted to your alarm panels board. I suggest having an interior alarm siren as close to the sleeping quarters as possible along with a strobe beacon mounted visible to the neighbors on the exterior, having an alarm is great confidence in safety but comes with !responsibility! & knowing/understanding operation with all capabilities of the system. Try not to false your system at all- but test it frequently. I use 3 arming modes- Away, Stay & Night Stay which I have pre-programmed selected zones to arm in Night Stay- Awesome feature. As for wiring 22awg for comm & 18-20 for carrying the power to sensors that require it (motion). All windows use wireless contact with tamper. I suggest going with Honeywell Products & the "Total Connect" system.


Compute in closed form : $\int_0^{\frac{π}{4}} x\ln(\tan x)\left(1-\frac{1}{\cos^2 x}\right)dx$

Question: Question :
Compute in closed form without use series
$I =\displaystyle\int_0^{\pi / 4} x\ln\left(\tan x\right)\left(1-\frac{1}{\cos^2 x}\right)\,dx$
I think use : $y=\tan x$ then $dy=\frac{1}{\cos^2 x}$
So :
$I =\displaystyle\int_0^{1} \arctan x\ln\left(x\right)x^{2}\,dx$
But I find integration arctan
Please give me ideas to approach it .
Comment: I edited it to a point where the Mathjax at least renders, but I don't know if it matches what you were trying to do. *Please* proof-read before posting.
Comment: Your new integral should be in terms of y if you used substitution, as in 'arctan(y)ln(y)(y^2)*(1/1-y^2) if I'm not mistaken
Comment: Roze: You have forgotten denominator (1+x^2) and multiply by -1.
Answer: \begin{align}I =\displaystyle\int_0^{\pi / 4} x\ln\left(\tan x\right)\left(1-\frac{1}{\cos^2 x}\right)\,dx\end{align}
Perform the change of variable $y=\tan x$,
\begin{align}I&=\int_0^1 \arctan x\ln x \left(\frac{1}{1+x^2}-1\right)\,dx\\
&=-\int_0^1 \frac{x^2\arctan x\ln x}{1+x^2}\,dx\\
&=\Big[\left(\arctan x-x\right)\arctan x\ln x\Big]_0^1+\int_0^1 \left(x-\arctan x\right)\left(\frac{\ln x}{1+x^2}+\frac{\arctan x}{x}\right)\,dx\\
&=\int_0^1 \frac{x\ln x}{1+x^2}\,dx+\int_0^1 \arctan x\,dx-\int_0^1 \frac{\arctan x\ln x}{1+x^2}\,dx-\int_0^1 \frac{\arctan^2 x}{x}\,dx\\
&=\left[x\arctan x-\frac{1}{2}\ln(1+x^2)\right]_0^1+\frac{1}{4}\int_0^1\frac{2x\ln(x^2)}{1+x^2}\,dx-\int_0^1 \frac{\arctan x\ln x}{1+x^2}\,dx-\\
&\Big[\ln x\arctan^2 x\Big]_0^1+2\int_0^1 \frac{\arctan x\ln x}{1+x^2}\,dx\\
&=\frac{\pi}{4}-\frac{1}{2}\ln 2+\frac{1}{4}\times -\frac{\pi^2}{12}+\int_0^1 \frac{\arctan x\ln x}{1+x^2}\,dx\\
\end{align}
And from,
Compute this following integral without Fourier series : $\int_0^{\pi/4}x\ln(\tan x)dx$
One knows that,
\begin{align}\int_0^1 \frac{\arctan x\ln x}{1+x^2}\,dx=\frac7{16}\zeta(3)-\frac{1}{4}\pi\text{G}\end{align}
Therefore,
\begin{align}\boxed{I=\frac{\pi}{4}-\frac{1}{2}\ln 2-\frac{1}{48}\pi^2-\frac{1}{4}\pi\text{G}+\frac7{16}\zeta(3)}\end{align}
Answer: With Maple I get
$$
I =
-\frac{\pi\,G}{4}-\frac{{\pi}^{2}}{48}+{\frac {25\,\zeta \left( 3
 \right) }{64}}+\frac{\pi}{4}-\frac{\ln\left( 2 \right)}{2} -
\frac{\text{Re}\;  {\rm Li}_3( i) }{2}
\approx 0.03971
$$
where $G$ is Catalan's constant
$$
G = \sum_{k=0}^\infty\frac{(-1)^k}{(2k+1)^2}
\tag{1}$$
and $\text{Li}_3$ is the polylogarithm
$$
\text{Li}_s(z) = \sum_{k=1}^\infty \frac{z^k}{k^s}
\tag{2}$$

Is it counted as "without series" when I use (1) and (2)?  And $\zeta(3)$ is also defined as a series.
Comment: The polylog has a closed-form as, $${\rm Li}_3(i)=-\frac{3\zeta(3)}{32}+\frac{\pi^3}{32}i$$