text:
Q: Manually typing links for my AngularJS website not working on server This is one of my first posts on stackoverflow and I really appreciate any help. I am going to try my best to adhere to the guidelines so apologies in advance if I do something wrong.
Contextual Info
I've been developing a "resume website" using the Yeoman AngularJS Generator. When I work on the site locally, everything seems to be working fine. For instance if a click a link to the projects page (Projects) this update my ng-view to display the Projects page and the url updates to http://localhost:9000/#/projects  , this also works the other way around. If I go to http://localhost:9000/#/projects , it takes me to my Projects page.
The problem occurs after uploading the website to my server. When I click the projects link, or any other link to view in app, the view updates but not the link. In other words, clicking the projects links takes me to the project page but the url is still http://www.url-example.com , when it should be http://www.url-example.com/#/projects . If I type in http://www.url-example.com/#/projects , it takes me to the default page of my app when it should be taking me to the projects page.
Here is the routing code for my website in the app.js file
'use strict';

angular
  .module('yakoApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'ui.bootstrap'
  ])
  .config(function ($routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/about.html',
        controller: 'AboutCtrl'
      })
      .when('/projects', {
        templateUrl: 'views/projects.html',
      })
      .when('/techfetch', {
        templateUrl: 'views/techfetch.html',
      })
      .when('/contact', {
        templateUrl: 'views/contact.html',
      })
      .otherwise({
        redirectTo: '/'
      });
  })
  .controller('HeaderCtrl', function ($scope, $location) {
    $scope.isActive = function (viewLocation) {
      return viewLocation === $location.path();
    };
  });

.htaccess file generated by Yeoman Angular Generator after performing a grunt build command in terminal
# Apache Configuration File

# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.

# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS)                                       #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Cross-domain AJAX requests                                                 |
# ------------------------------------------------------------------------------

# Enable cross-origin AJAX requests.
# http://code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
# http://enable-cors.org/

# <IfModule mod_headers.c>
#    Header set Access-Control-Allow-Origin "*"
# </IfModule>

# ------------------------------------------------------------------------------
# | CORS-enabled images                                                        |
# ------------------------------------------------------------------------------

# Send the CORS header for images when browsers request it.
# https://developer.mozilla.org/en/CORS_Enabled_Image
# http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
# http://hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/

<IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
        <FilesMatch "\.(gif|ico|jpe?g|png|svg|svgz|webp)$">
            SetEnvIf Origin ":" IS_CORS
            Header set Access-Control-Allow-Origin "*" env=IS_CORS
        </FilesMatch>
    </IfModule>
</IfModule>

# ------------------------------------------------------------------------------
# | Web fonts access                                                           |
# ------------------------------------------------------------------------------

# Allow access from all domains for web fonts

<IfModule mod_headers.c>
    <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
</IfModule>

# ##############################################################################
# # ERRORS                                                                     #
# ##############################################################################

# ------------------------------------------------------------------------------
# | 404 error prevention for non-existing redirected folders                   |
# ------------------------------------------------------------------------------

# Prevent Apache from returning a 404 error for a rewrite if a directory
# with the same name does not exist.
# http://httpd.apache.org/docs/current/content-negotiation.html#multiviews
# http://www.webmasterworld.com/apache/3808792.htm

Options -MultiViews

# ------------------------------------------------------------------------------
# | Custom error messages / pages                                              |
# ------------------------------------------------------------------------------

# You can customize what Apache returns to the client in case of an error (see
# http://httpd.apache.org/docs/current/mod/core.html#errordocument), e.g.:

ErrorDocument 404 /404.html

# ##############################################################################
# # INTERNET EXPLORER                                                          #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Better website experience                                                  |
# ------------------------------------------------------------------------------

# Force IE to render pages in the highest available mode in the various
# cases when it may not: http://hsivonen.iki.fi/doctype/ie-mode.pdf.

<IfModule mod_headers.c>
    Header set X-UA-Compatible "IE=edge"
    # `mod_headers` can't match based on the content-type, however, we only
    # want to send this header for HTML pages and not for the other resources
    <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
        Header unset X-UA-Compatible
    </FilesMatch>
</IfModule>

# ------------------------------------------------------------------------------
# | Cookie setting from iframes                                                |
# ------------------------------------------------------------------------------

# Allow cookies to be set from iframes in IE.

# <IfModule mod_headers.c>
#   Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
# </IfModule>

# ------------------------------------------------------------------------------
# | Screen flicker                                                             |
# ------------------------------------------------------------------------------

# Stop screen flicker in IE on CSS rollovers (this only works in
# combination with the `ExpiresByType` directives for images from below).

# BrowserMatch "MSIE" brokenvary=1
# BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
# BrowserMatch "Opera" !brokenvary
# SetEnvIf brokenvary 1 force-no-vary

# ##############################################################################
# # MIME TYPES AND ENCODING                                                    #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Proper MIME types for all files                                            |
# ------------------------------------------------------------------------------

<IfModule mod_mime.c>

  # Audio
    AddType audio/mp4                                   m4a f4a f4b
    AddType audio/ogg                                   oga ogg

  # JavaScript
    # Normalize to standard type (it's sniffed in IE anyways):
    # http://tools.ietf.org/html/rfc4329#section-7.2
    AddType application/javascript                      js jsonp
    AddType application/json                            json

  # Video
    AddType video/mp4                                   mp4 m4v f4v f4p
    AddType video/ogg                                   ogv
    AddType video/webm                                  webm
    AddType video/x-flv                                 flv

  # Web fonts
    AddType application/font-woff                       woff
    AddType application/vnd.ms-fontobject               eot

    # Browsers usually ignore the font MIME types and sniff the content,
    # however, Chrome shows a warning if other MIME types are used for the
    # following fonts.
    AddType application/x-font-ttf                      ttc ttf
    AddType font/opentype                               otf

    # Make SVGZ fonts work on iPad:
    # https://twitter.com/FontSquirrel/status/14855840545
    AddType     image/svg+xml                           svg svgz
    AddEncoding gzip                                    svgz

  # Other
    AddType application/octet-stream                    safariextz
    AddType application/x-chrome-extension              crx
    AddType application/x-opera-extension               oex
    AddType application/x-shockwave-flash               swf
    AddType application/x-web-app-manifest+json         webapp
    AddType application/x-xpinstall                     xpi
    AddType application/xml                             atom rdf rss xml
    AddType image/webp                                  webp
    AddType image/x-icon                                ico
    AddType text/cache-manifest                         appcache manifest
    AddType text/vtt                                    vtt
    AddType text/x-component                            htc
    AddType text/x-vcard                                vcf

</IfModule>

# ------------------------------------------------------------------------------
# | UTF-8 encoding                                                             |
# ------------------------------------------------------------------------------

# Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
AddDefaultCharset utf-8

# Force UTF-8 for certain file formats.
<IfModule mod_mime.c>
    AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
</IfModule>

# ##############################################################################
# # URL REWRITES                                                               #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Rewrite engine                                                             |
# ------------------------------------------------------------------------------

# Turning on the rewrite engine and enabling the `FollowSymLinks` option is
# necessary for the following directives to work.

# If your web host doesn't allow the `FollowSymlinks` option, you may need to
# comment it out and use `Options +SymLinksIfOwnerMatch` but, be aware of the
# performance impact: http://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks

# Also, some cloud hosting services require `RewriteBase` to be set:
# http://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-mod-rewrite-not-working-on-my-site

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
  # Options +SymLinksIfOwnerMatch
    RewriteEngine On
  # RewriteBase /
</IfModule>

# ------------------------------------------------------------------------------
# | Suppressing / Forcing the "www." at the beginning of URLs                  |
# ------------------------------------------------------------------------------

# The same content should never be available under two different URLs especially
# not with and without "www." at the beginning. This can cause SEO problems
# (duplicate content), therefore, you should choose one of the alternatives and
# redirect the other one.

# By default option 1 (no "www.") is activated:
# http://no-www.org/faq.php?q=class_b

# If you'd prefer to use option 2, just comment out all the lines from option 1
# and uncomment the ones from option 2.

# IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Option 1: rewrite www.example.com → example.com

<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Option 2: rewrite example.com → www.example.com

# Be aware that the following might not be a good idea if you use "real"
# subdomains for certain parts of your website.

# <IfModule mod_rewrite.c>
#    RewriteCond %{HTTPS} !=on
#    RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
#    RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# </IfModule>

# ##############################################################################
# # SECURITY                                                                   #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Content Security Policy (CSP)                                              |
# ------------------------------------------------------------------------------

# You can mitigate the risk of cross-site scripting and other content-injection
# attacks by setting a Content Security Policy which whitelists trusted sources
# of content for your site.

# The example header below allows ONLY scripts that are loaded from the current
# site's origin (no inline scripts, no CDN, etc). This almost certainly won't
# work as-is for your site!

# To get all the details you'll need to craft a reasonable policy for your site,
# read: http://html5rocks.com/en/tutorials/security/content-security-policy (or
# see the specification: http://w3.org/TR/CSP).

# <IfModule mod_headers.c>
#    Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
#    <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff|xml|xpi)$">
#        Header unset Content-Security-Policy
#    </FilesMatch>
# </IfModule>

# ------------------------------------------------------------------------------
# | File access                                                                |
# ------------------------------------------------------------------------------

# Block access to directories without a default document.
# Usually you should leave this uncommented because you shouldn't allow anyone
# to surf through every directory on your server (which may includes rather
# private places like the CMS's directories).

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Block access to hidden files and directories.
# This includes directories used by version control systems such as Git and SVN.

<IfModule mod_rewrite.c>
    RewriteCond %{SCRIPT_FILENAME} -d [OR]
    RewriteCond %{SCRIPT_FILENAME} -f
    RewriteRule "(^|/)\." - [F]
</IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Block access to backup and source files.
# These files may be left by some text editors and can pose a great security
# danger when anyone has access to them.

<FilesMatch "(^#.*#|\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

# ------------------------------------------------------------------------------
# | Secure Sockets Layer (SSL)                                                 |
# ------------------------------------------------------------------------------

# Rewrite secure requests properly to prevent SSL certificate warnings, e.g.:
# prevent `https://www.example.com` when your certificate only allows
# `https://secure.example.com`.

# <IfModule mod_rewrite.c>
#    RewriteCond %{SERVER_PORT} !^443
#    RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
# </IfModule>

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Force client-side SSL redirection.

# If a user types "example.com" in his browser, the above rule will redirect him
# to the secure version of the site. That still leaves a window of opportunity
# (the initial HTTP connection) for an attacker to downgrade or redirect the
# request. The following header ensures that browser will ONLY connect to your
# server via HTTPS, regardless of what the users type in the address bar.
# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/

# <IfModule mod_headers.c>
#    Header set Strict-Transport-Security max-age=16070400;
# </IfModule>

# ------------------------------------------------------------------------------
# | Server software information                                                |
# ------------------------------------------------------------------------------

# Avoid displaying the exact Apache version number, the description of the
# generic OS-type and the information about Apache's compiled-in modules.

# ADD THIS DIRECTIVE IN THE `httpd.conf` AS IT WILL NOT WORK IN THE `.htaccess`!

# ServerTokens Prod

# ##############################################################################
# # WEB PERFORMANCE                                                            #
# ##############################################################################

# ------------------------------------------------------------------------------
# | Compression                                                                |
# ------------------------------------------------------------------------------

<IfModule mod_deflate.c>

    # Force compression for mangled headers.
    # http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    # Compress all output labeled with one of the following MIME-types
    # (for Apache versions below 2.3.7, you don't need to enable `mod_filter`
    #  and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines
    #  as `AddOutputFilterByType` is still in the core directives).
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE application/atom+xml \
                                      application/javascript \
                                      application/json \
                                      application/rss+xml \
                                      application/vnd.ms-fontobject \
                                      application/x-font-ttf \
                                      application/x-web-app-manifest+json \
                                      application/xhtml+xml \
                                      application/xml \
                                      font/opentype \
                                      image/svg+xml \
                                      image/x-icon \
                                      text/css \
                                      text/html \
                                      text/plain \
                                      text/x-component \
                                      text/xml
    </IfModule>

</IfModule>

# ------------------------------------------------------------------------------
# | Content transformations                                                    |
# ------------------------------------------------------------------------------

# Prevent some of the mobile network providers from modifying the content of
# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5.

# <IfModule mod_headers.c>
#    Header set Cache-Control "no-transform"
# </IfModule>

# ------------------------------------------------------------------------------
# | ETag removal                                                               |
# ------------------------------------------------------------------------------

# Since we're sending far-future expires headers (see below), ETags can
# be removed: http://developer.yahoo.com/performance/rules.html#etags.

# `FileETag None` is not enough for every server.
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>

FileETag None

# ------------------------------------------------------------------------------
# | Expires headers (for better cache control)                                 |
# ------------------------------------------------------------------------------

# The following expires headers are set pretty far in the future. If you don't
# control versioning with filename-based cache busting, consider lowering the
# cache time for resources like CSS and JS to something like 1 week.

<IfModule mod_expires.c>

    ExpiresActive on
    ExpiresDefault                                      "access plus 1 month"

  # CSS
    ExpiresByType text/css                              "access plus 1 year"

  # Data interchange
    ExpiresByType application/json                      "access plus 0 seconds"
    ExpiresByType application/xml                       "access plus 0 seconds"
    ExpiresByType text/xml                              "access plus 0 seconds"

  # Favicon (cannot be renamed!)
    ExpiresByType image/x-icon                          "access plus 1 week"

  # HTML components (HTCs)
    ExpiresByType text/x-component                      "access plus 1 month"

  # HTML
    ExpiresByType text/html                             "access plus 0 seconds"

  # JavaScript
    ExpiresByType application/javascript                "access plus 1 year"

  # Manifest files
    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    ExpiresByType text/cache-manifest                   "access plus 0 seconds"

  # Media
    ExpiresByType audio/ogg                             "access plus 1 month"
    ExpiresByType image/gif                             "access plus 1 month"
    ExpiresByType image/jpeg                            "access plus 1 month"
    ExpiresByType image/png                             "access plus 1 month"
    ExpiresByType video/mp4                             "access plus 1 month"
    ExpiresByType video/ogg                             "access plus 1 month"
    ExpiresByType video/webm                            "access plus 1 month"

  # Web feeds
    ExpiresByType application/atom+xml                  "access plus 1 hour"
    ExpiresByType application/rss+xml                   "access plus 1 hour"

  # Web fonts
    ExpiresByType application/font-woff                 "access plus 1 month"
    ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    ExpiresByType application/x-font-ttf                "access plus 1 month"
    ExpiresByType font/opentype                         "access plus 1 month"
    ExpiresByType image/svg+xml                         "access plus 1 month"

</IfModule>

# ------------------------------------------------------------------------------
# | Filename-based cache busting                                               |
# ------------------------------------------------------------------------------

# If you're not using a build process to manage your filename version revving,
# you might want to consider enabling the following directives to route all
# requests such as `/css/style.12345.css` to `/css/style.css`.

# To understand why this is important and a better idea than `*.css?v231`, read:
# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring

# <IfModule mod_rewrite.c>
#    RewriteCond %{REQUEST_FILENAME} !-f
#    RewriteCond %{REQUEST_FILENAME} !-d
#    RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
# </IfModule>

# ------------------------------------------------------------------------------
# | File concatenation                                                         |
# ------------------------------------------------------------------------------

# Allow concatenation from within specific CSS and JS files, e.g.:
# Inside of `script.combined.js` you could have
#
#
# and they would be included into this single file.

# <IfModule mod_include.c>
#    <FilesMatch "\.combined\.js$">
#        Options +Includes
#        AddOutputFilterByType INCLUDES application/javascript application/json
#        SetOutputFilter INCLUDES
#    </FilesMatch>
#    <FilesMatch "\.combined\.css$">
#        Options +Includes
#        AddOutputFilterByType INCLUDES text/css
#        SetOutputFilter INCLUDES
#    </FilesMatch>
# </IfModule>

# ------------------------------------------------------------------------------
# | Persistent connections                                                     |
# ------------------------------------------------------------------------------

# Allow multiple requests to be sent over the same TCP connection:
# http://httpd.apache.org/docs/current/en/mod/core.html#keepalive.

# Enable if you serve a lot of static content but, be aware of the
# possible disadvantages!

# <IfModule mod_headers.c>
#    Header set Connection Keep-Alive
# </IfModule>


text:
Q: Flex/mate: mate doesn't cache instance, created with Object Builder If you once run an ObjectBuilder the object instantiated will be cached and next time you use an PropertyInjector or something else, the instantiated object will be used instead of creating a new object. Or at least this should be like this :)
But in the example below it seems that mate tries to instantiate the object again:
The following error occurs:
! TerminalPresentationModel - constructor called # dispatcher = [object GlobalDispatcher] !
<Injectors (started)    target="[class TerminalPresentationModel]"   includeDerivatives="false"   dispatcherType="inherit"   scope="[object Scope]">
        <PropertyInjector   sourceKey="currentDate"   targetKey="date"   source="[class DateManager]"   sourceCache="inherit"   softBinding="false"/>

---------------------------------------------------------
- ERROR: Wrong number of arguments supplied when calling the constructor
- TARGET: TerminalPresentationModel
- TAG: PropertyInjector
- METHOD: constructor
- FILE: TerminalMainEventMap
- NO ARGUMENTS SUPPLIED
- STACK TRACE: ###SHORTENED###
---------------------------------------------------------

---------------------------------------------------------
- ERROR: source is undefined in tag PropertyInjector
- TARGET: TerminalPresentationModel
- TAG: PropertyInjector
- FILE: TerminalMainEventMap
---------------------------------------------------------

- INFO: Data binding will not be able to detect assignments to date
</Injectors (end)    target=[class TerminalPresentationModel]>
! DateManager - constructor called # dispatcher = [object GlobalDispatcher] !
<Injectors (started)    target="[class TerminalContainer]"   includeDerivatives="false"   dispatcherType="inherit"   scope="[object Scope]">
    <ObjectBuilder   registerTarget="true"   constructorArguments="[object GlobalDispatcher]"   cache="inherit"   generator="[class TerminalPresentationModel]"/>
    <PropertyInjector   targetKey="pm"   source="[object TerminalPresentationModel]"   sourceCache="inherit"   softBinding="false"/>
- INFO: Data binding will not be able to detect assignments to pm
</Injectors (end)    target=[class TerminalContainer]>

Any hints what's wrong with my code?
Update 2010-08-16
As requestes by ktutnik, more details:
I use an EventMap:
<?xml version="1.0" encoding="utf-8"?>
<EventMap
    >

    <fx:Script>
        <![CDATA[
            // imports and namespaces shortened

            [Bindable]
            public var endpoint:String = "";
        ]]>
    </fx:Script>

    <fx:Declarations>
        <Debugger level="{Debugger.ALL}" />

        <myService:Services id="services" endpoint="{endpoint}"/>

        <maps:TimeEventMap endpoint="{endpoint}"/>

        <EventHandlers type="{FlexEvent.PREINITIALIZE}">
            <ObjectBuilder
                generator="{TerminalPresentationModel}"
                constructorArguments="{scope.dispatcher}" />
            <ObjectBuilder
                generator="{DateManager}"
                constructorArguments="{scope.dispatcher}" />
            <ObjectBuilder
                generator="{TerminalFaultHandler}" />
        </EventHandlers>

        <EventHandlers type="{DataServiceEvent.GET_CURRENT_TERMINAL_STATUS}">
            <RemoteObjectInvoker instance="{services.TerminalService}"
                 method="getCurrentTerminalStatus"
                 arguments="{[event.locationId,event.actualPlan]}"
                 showBusyCursor="false">
                <resultHandlers>
                    <MethodInvoker generator="{TerminalPresentationModel}"
                                   method="setCurrentTerminalStatus"
                                   arguments="{resultObject}" />
                    <MethodInvoker generator="{TerminalFaultHandler}"
                                   method="removeError" />
                </resultHandlers>
            </RemoteObjectInvoker>
        </EventHandlers>

        <Injectors target="{TerminalContainer}"
                   debug="true">
            <ObjectBuilder
                generator="{TerminalPresentationModel}"
                constructorArguments="{scope.dispatcher}" />
            <PropertyInjector
                targetKey="pm"
                source="{lastReturn}" />
        </Injectors>

        <Injectors target="{TerminalPresentationModel}"
                   debug="true">
            <PropertyInjector targetKey="date" source="{DateManager}" sourceKey="currentDate" />
        </Injectors>

        <Injectors target="{TerminalContent}">
            <PropertyInjector targetKey="faultHandler"
                source="{TerminalFaultHandler}" />
        </Injectors>

        <EventHandlers type="{UnhandledFaultEvent.FAULT}">
            <MethodInvoker generator="{TerminalFaultHandler}" method="handleFault"
                           arguments="{event.fault}" />
        </EventHandlers>
    </fx:Declarations>
</EventMap>

Flex: 4.0
mate: 0.8.9

A: put debug="true" both in your EventHandlers and Injector tag and have a look which one earlier.. try to make combination of CreationComplete event either than PreIntitialize. if im not mistaken in Application CreationComplete is earlier than Preinitialize (but im not realy sure.. because it is confused me too).

A: It seems that you can't have two ObjectBuilder in one EventMap. This will cause this issue.
As I removed the ObjectBuilder in the Preinitialize-Event everything works fine.
This is a strange behaviour because in other places I wrote it like in this case and no problem occured.
So I don't really know WHY it works, but it seems that it fixed my problem.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Riemann-Stieltjes integral of continuous positive function This question is related to this question (for which I still don't know the answer). There I state this result but for Riemann-Stieltjes like this:
If $f,\alpha$ are continuous and $\alpha$ increasing, $f\geq0$ and $\int_a^b f(x)d\alpha=0$ then $f=0$.
I tried to follow the same proof but I never use the continuity of $\alpha$, so I think is wrong...which makes me wonder if this is even true! Seems true because $\alpha$ is increasing, so in the sums we have a term that will be $>0$

A: I am assuming that $\alpha$ is strictly increasing.
Suppose $f(x^*) >0$, and let $x_1\le x^* \le x_2$ with $x_2-x_1 >0$ be such that $f(x) \ge \epsilon >0 $ for $x \in [x_1,x_2]$.
Then consider the partition $P=(a, x_1, x_2,b)$. Then
$L(f,P,\alpha) \ge \inf_{x \in [x_1,x_2]} f(x) (\alpha(x_2)-\alpha(x_1)) \ge \epsilon (\alpha(x_2)-\alpha(x_1)) >0$.
Since $\sup_\pi L(f,\pi,\alpha) = \int_a^b f d \alpha = 0$, we obtain a
contradiction.
You don't need $\alpha$ to be continuous, just strictly increasing.


text:
Q: VS Code changes the default format of my HTML I don't really understand why VS Code changes the format of my HTML, I have already removed prettify. Any idea how to retain the format for the code that I've pulled? Because when I click save the format changes.
This is the format of the code when I pulled it

                    <ng-container *ngIf="formSnapshot">
                      <feedback-request-form-renderer [answers]="answers"
                        [canEditFeedbackForm]="canEditFeedbackForm"
                        [canEditFeedbackResponse]="canEditFeedbackResponse"
                        [formName]="templateNameDisplay()"
                        [sections]="formSnapshot"
                        (whenEditFeedbackResponse)="editFeedbackResponse($event)"
                        (whenEditNote)="editNote($event)"
                        (whenRemoveNote)="removeNote($event)"
                        (whenRemoveQuestion)="removeQuestion($event)"
                        (whenRephraseQuestion)="rephraseQuestion($event)"
                      >
                      </feedback-request-form-renderer>

                          <mat-form-field appearance="outline" class="pr-4" fxFlex>
                            <mat-label>Employee's comments</mat-label>
                            <textarea
                              cdkTextareaAutosize
                              cdkAutosizeMinRows="3"
                              formControlName="comments"
                              matInput
                            >
                            </textarea>
                          </mat-form-field>

But when I save it, the format changes to

                  <ng-container *ngIf="formSnapshot">
                    <feedback-request-form-renderer [answers]="answers" [canEditFeedbackForm]="canEditFeedbackForm"
                      [canEditFeedbackResponse]="canEditFeedbackResponse" [formName]="templateNameDisplay()"
                      [sections]="formSnapshot" (whenEditFeedbackResponse)="editFeedbackResponse($event)"
                      (whenEditNote)="editNote($event)" (whenRemoveNote)="removeNote($event)"
                      (whenRemoveQuestion)="removeQuestion($event)" (whenRephraseQuestion)="rephraseQuestion($event)">
                    </feedback-request-form-renderer>

                        <mat-form-field appearance="outline" class="pr-4" fxFlex>
                          <mat-label>Employee's comments</mat-label>
                          <textarea cdkTextareaAutosize cdkAutosizeMinRows="3" formControlName="comments" matInput>
                            </textarea>
                        </mat-form-field>

                  </ng-container>

Where is the setting in VS Code for that ? I want to follow the format of the code from the team I don't want to change it

A: Click settings in your VS code in the bottom left and type in save in the search bar, untick the Editor: Format On Save box and that should do it

A: I'm pretty sure that's one of your plugins, I don't think VSCode does that on its own.
If you think you've definitely uninstalled all your plugins (which should be listed under one of the options on the left hand side). Close the app and start it up again.


text:
Q: MERGE column when export excel using javascript? I can export excel but the problem is I can't merge the excel header column. I have attached an image you can check. this is what I want to export like this.

i want to export this table in excel.

                                Date Range

Last 30 Days

Previous 30 Days

                                A
                                B
                                C
                                D
                                E
                                A2
                                B2
                                C2
                                D2
                                E2

I used this code to export it works fine. I need to merge the first column cells.
you can avoid this solution if is there any solution for that.
here is the reference link: How to export Javascript array data to excel on the client side
var lineArray = [];
result_table.forEach(function(infoArray, index) {
  var line = infoArray.join(" \t");
  lineArray.push(index == 0 ? line : line);
});
var csvContent = lineArray.join("\r\n");
var excel_file = document.createElement('a');
excel_file.setAttribute('href', 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(csvContent));
excel_file.setAttribute('download', 'Visitor_History.xls');
document.body.appendChild(excel_file);
excel_file.click();
document.body.removeChild(excel_file);

A: I'd suggest using a javascript based excel library (e.g. SheetJS) to produce a true excel file.  You'll have a lot more options with it than faking it via a csv or html file with a bogus mime-type which is what your sample code is doing.
Here's a fiddle.

                                Date Range

Last 30 Days

Previous 30 Days

                                A
                                B
                                C
                                D
                                E
                                A2
                                B2
                                C2
                                D2
                                E2

<button onclick="return exportFile()">Export</button>


text:
Q: Recursive backtracking in Python -- balancing weights on a scale Problem: Suppose you have a weight on one side of a scale. Given an array of other weights, see if the scale will balance. You can use weights on either side, and you don't have to use all the weights.
In my current solution, I have 3 branches at each level. The first adds the first weight in the array to the "left" side, the second simply discards it, and the third adds it to the "right" side. My issue seems to be that that after completing the first branch, it returns False if all of the branches come out to be False. Instead, I want it to move on to the next branch.
What tipped me off to this is that when I have weights = [4,1] and init_weight = 3, it gives me the wrong message (saying that it can't be balanced), but when I flip the order of weights to be [1,4], it gives me the correct message.
I just started learning Python yesterday, so my guess is that I'm missing some sort of syntactic subtlety. But that definitely doesn't rule out algorithmic issues!
def balanceable_rec(L, R, weights):

    print("L =", L, "  R =", R, "  weights =", weights)

    if (L == 0  or  L==R  or L in weights):
        return True
    if (len(weights) == 0):
        return False

    w = weights.pop(0)
    if balanceable_rec(L + w, R, weights):  return True
    if balanceable_rec(L, R, weights):      return True
    if balanceable_rec(L, R + w, weights):  return True

    return False

def balanceable(w, weights):
    return balanceable_rec(w, 0, weights)

# ----------------------

# weights = [1,4]
weights = [4,1]
init_weight = 3

if (balanceable(init_weight, weights)):     print("That can be balanced!")
else:           print("That cannot be balanced!")

Here's the output:

L = 3   R = 0   weights = [4, 1]
L = 7   R = 0   weights = [1]
L = 8   R = 0   weights = []
L = 7   R = 0   weights = []
L = 7   R = 1   weights = []
L = 3   R = 0   weights = []
L = 3   R = 4   weights = []
That cannot be balanced!

A: You need to pass copies of weights to your recursive calls, so that the pop call doesn't affect the original weights object, e.g.:
def balanceable_rec(L, R, weights):

    print("L =", L, "  R =", R, "  weights =", weights)

    if (L == 0  or  L==R  or L in weights):
        return True
    if (len(weights) == 0):
        return False

    w = weights.pop(0)
    if balanceable_rec(L + w, R, weights[:]):  return True
    if balanceable_rec(L, R, weights[:]):      return True
    if balanceable_rec(L, R + w, weights[:]):  return True

    return False


text:
Q: FluentNHibernate mapping of one column to two properties: is this possible? The legacy database I work with has a table with some sample information shown below:
LiabilityType
134
137
140
143
146
999
001
003
006
009

These codes actually contain two bits of information:

*

*Whether the debt is classified as an
expense or liability (if code starts
with '1' -> expense; if it starts
with '0' -> liability

*The type of
    debt (e.g. mortgage, funeral expense, overdraft etc)

As such, I would like to map this field to two properties in my entity.
I have looked at ICompositeUserType, but this appears to be about mapping two fields to one (composite) property, not mapping one field to two properties.
I can see how I can create two classes implementing IUserType which examine this field and convert it to the correct property values, but I can't work out how the class would convert the properties back to the appropriate database values. For example, I would like to map this such that I can create a linq query where I can say;
.Where(x => x.ExpenseOrLiability == ExpenseOrLiability.Expense)

and this will be converted into SQL like the following:
WHERE LiabilityType LIKE '1%'.

Is such a thing possible?

A: We handled this situation through denormalization. Store the code and the debt classification type in separate fields. This allows you to present the code to the user but use its intrinsics in queries.
To prevent the values from getting out of sync you have to derive one from the other. For example, derive the breakout:
public virtual LiabilityType LiabilityType { get; set; }
public virtual ExpenseOrLiability ExpenseOrLiability
{
    get
    {
        return // extract ExpenseOrLiability from LiabilityType
    }
    set{} // ignore set
}
public virtual DebtType DebtType
{
    get
    {
        return // extract DebtType from LiabilityType
    }
    set{} // ignore set
}

OR derive the code
public virtual LiabilityType LiabilityType
{
   get
    {
       return // combine ExpenseOrLiability with DebtType somehow
    }
   set { } // ignore set
}

public virtual ExpenseOrLiability ExpenseOrLiability { get; set; }
public virtual DebtType DebtType { get; set; }


text:
Q: Django templates json loops I use python/django views to get an output as:
{{ test }}

in my template. Here is the output
{'platform': 'xbox', 'amount': '50.00', 'title': 'title of something', 'description': 'description of something'}

If I use
{% for x in test %}
{{ x }}
{% endfor %}

it outputs
platform, amount, title, description

How do I get the values and not the keys?

A: This is just standard Python iteration over a dictionary, which defaults to iterating over the keys. If you want just the values, use {% for x in test.values %}. If you want key/value pairs, use {% for k, v in test.items %}.


text:
Q: Some weird problem with Nokogiri's xpath method doc.xpath('//img') #this will get some results
doc.xpath('//img[@class="productImage"]') #and this gets nothing at all
doc.xpath('//div[@id="someID"]') # and this won't work either

I don't know what went wrong here,I double checked the HTML source,There are plenty of img tag which contains the attribute(class="productImage").
It's like the attribute selector just won't work.
Here is the URL which the HTML source come from.
http://www.amazon.cn/s/ref=nb_sb_ss_i_0_1?__mk_zh_CN=%E4%BA%9A%E9%A9%AC%E9%80%8A%E7%BD%91%E7%AB%99&url=search-alias%3Daps&field-keywords=%E4%B8%93%E5%85%AB&x=0&y=0&sprefix=%E4%B8%93

please do me a favor if you got some spare time.Parse the HTML content like I do see if you can solve this one

A: The weird thing is if you use open-uri on that page you get a different result than when using something like curl or wget.
However when you change the User-Agent you actually get probably the page you are looking for:
Analysis:
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'pp'

URL = 'http://www.amazon.cn/...'

def analyze_html(file)
   doc = Nokogiri.HTML(file)
   pp   doc.xpath('//img').map { |i| i[:class] }.compact.reject(&:empty?)
   puts doc.xpath('//div').map { |i| i[:class] }.grep(/productImage/).count
   puts doc.xpath('//div[@class="productImage"]//img').count
   pp   doc.xpath('//div[@class="productImage"]//img').map { |i| i[:src] }
end

puts "Attempt 1:"
analyze_html(open(URL))

puts "Attempt 2:"
analyze_html(open(URL, "User-Agent" => "Wget/1.10.2"))

Output:
Attempt 1:
["default navSprite"]
0
0
[]
Attempt 2:
["default navSprite", "srSprite spr_kindOfSortBtn"]
16
16
["http://ec4.images-amazon.com/images/I/51fOb3ujSjL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/513UQ1xiaSL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/41zKxWXb8HL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51bj6XXAouL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/516GBhDTGCL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51ADd3HSE6L._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51CbB-7kotL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51%2Bw40Mk51L._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/519Gny1LckL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51Dv6DUF-WL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51uuy8yHeoL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51T0KEjznqL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/419WTi%2BdjzL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51QTg4ZmMmL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51l--Pxw9TL._AA115_.jpg",
 "http://ec4.images-amazon.com/images/I/51gehW2qUZL._AA115_.jpg"]

Solution:

*

*Use User-Agent: Wget/1.10.2

*Use xpath('//div[@class="productImage"]//img')


text:
Q: Combine Select Statements I am building a dashboard screen which requires multiple sql statements to return data. However all of these database calls are adding up in regards to performance.
As it stands now the code calls are online meaning I'm am making database calls inside my code. I would like to move all of the database calls to a stored procedure but I am not sure how to combine all of the database calls into one stored procedure to return multiple values as I have to display each of the values individually.
Can someone show me how to combine these select statements into one and return multiple values yo be used inside my code.
/*Pending Count */
Select Count(*)
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.ClosedDate is Null

/* Get Today's Issue Count */
Select Count(*)
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.IssueDate =  FormatDateTime(dateTimes, DateFormat.ShortDate)

/* Over Due Issue Count */
Select Count(*)
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.DueDate <  FormatDateTime(dateTimes, DateFormat.ShortDate)
      And Issue.ClosedDate is null

/*Get Closed Issue Count */
Select Count(*)
FROM Issue
WHERE Issue.WorkerKeyFk = lngWorkerKey
      And Issue.ClosedDate is not null

A: Here's how I would do it:
SELECT
    Sum(Iif(Issue.IssueDate = FormatDateTime(dateTimes, DateFormat.ShortDate), 1, 0) as Today_Issue_Count
    , Sum(Iif(Issue.DueDate < FormatDateTime(dateTimes, DateFormat.ShortDate) And Issue.ClosedDate is null, 1, 0) as Overdue_Issue_Count
    , Sum(Iif(Issue.ClosedDate is not null, 1, 0) as Closed_Issue_Count
FROM Issue
    WHERE Issue.WorkerKeyFk = lngWorkerKey

That way you only have one resultset to deal with, and execution should be pretty quick on the server.

A: Select Count(*), 'Pending' as Count_Label
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.ClosedDate is Null

Union All
Select Count(*), 'Today' as Count_Label
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.IssueDate =  FormatDateTime(dateTimes, DateFormat.ShortDate)

union all
Select Count(*), 'Overdue' as Count_Label
FROM Issue
WHERE Issue.WorkerKeyFk =  lngWorkerKey
      And Issue.DueDate <  FormatDateTime(dateTimes, DateFormat.ShortDate)
      And Issue.ClosedDate is null

union all
Select Count(*), 'Closed' as Count_Label
FROM Issue
WHERE Issue.WorkerKeyFk = lngWorkerKey
      And Issue.ClosedDate is not null


text:
Q: Split Two Dimensional Array into n more based on key value i've been busting my head over this array:
Array (
    [invoicenr] => Array (
                            [0] => 1234
                            [1] => 1234
                            [2] => 1234
                            [3] => 4321
                            [4] => 3214
                        )
    [invoicedate] => Array (
                            [0] => 17.07.2017.
                            [1] => 17.07.2017.
                            [2] => 17.07.2017.
                            [3] => 11.07.2017.
                            [4] => 11.07.2017. )
    [amount] => Array (
                            [0] => 10
                            [1] => 1
                            [2] => 23
                            [3] => 10
                            [4] => 1 )
    [cause] => Array (
                            [0] => 1
                            [1] => 1
                            [2] => 1
                            [3] => 1
                            [4] => 1 )
)

I'm trying to split array above based on 1st level key "invoicenr" value, but without luck so far.
I'm expecting result:
Array (
       [invoicenr] => Array (
                             [0] => 1234
                             [1] => 1234
                             [2] => 1234)
       [invoicedate] => Array (
                             [0] => 17.07.2017.
                             [1] => 17.07.2017.
                             [2] => 17.07.2017.)
       [amount] => Array (
                             [0] => 10
                             [1] => 1
                             [2] => 23)
       [cause] => Array (
                             [0] => 1
                             [1] => 1
                             [2] => 1)
            )
Array (
       [invoicenr] => Array (
                             [0] => 4321 )
       [invoicedate] => Array (
                             [0] => 11.07.2017. )
       [amount] => Array (
                             [0] => 10)
       [cause] => Array (
                             [0] => 1  )
        )
Array (
       [invoicenr] => Array (
                             [0] => 3214 )
       [invoicedate] => Array (
                             [0] => 11.07.2017. )
       [amount] => Array (
                             [0] => 1)
       [cause] => Array (
                             [0] => 1  )
        )

I want to know if this is possible and how, or i need to rewrite array first?
Thank you all in advance, i'm new into coding and struggling to learn so far. :)

A: Please post the code you attempted to solve the problem with.
I believe you will need a counter (i) to go through invoicenr and a temporary variable that remembers the last value (Array[i]) and compares it with the next value in the array of invoicenr. If the value is the same you keep going, and if it is different you print out all the other arrays[i].

A: i've finnaly did it, but i think my way is too primitive. Here is what i did:
//Count number of rows in initial array
$rows = count(array_filter($_POST['invoicenr']));
//Crete unique array that contains only $_POST['invoicenr'] which i can count later
$uniquearray = array();
for ($row = 0; $row < $rows; $row++) {
    $uniquearray[] = $_POST['invoicenr'][$row] ;
}
//return unique keys only
$invoicenrunique=array_keys(array_flip($uniquearray));
//count number of rows in unique array
$invoicenruniquecount=count(array_keys(array_flip($uniquearray)));
//do magic, this splits main array into n smaller arrays based on $_POST['invoicenr']
for($uniquerow = 0; $uniquerow < $invoicenruniquecount; $uniquerow++)   {
    $testarray = array();
    for ($row = 0; $row < $rows; $row++) {
        if($_POST['invoicenr'][$row]==$invoicenrunique[$uniquerow]){
            $testarray[$row]['invoicenr']=$_POST['invoicenr'][$row];
            $testarray[$row]['invoicedate']=$_POST['invoicedate'][$row];
            $testarray[$row]['amount']=$_POST['amount'][$row];
            $testarray[$row]['cause']=$_POST['cause'][$row];
        }
    }
    print_r(array_values($testarray));
    echo "<br>";
}

Do you have any suggestions on how to improve my solution?
Best regards!


text:
Q: Form selector not work working on dynamic markup When I execute the following code, it behaves like I expect (logs the contents of the DIV element):
var html = '<form action="/" method="get" name="myform">
123
</form>';
console.log($('div', html));

What I can't understand is why the following code does NOT work:
var html = '<form action="/" method="get" name="myform">
123
</form>';
console.log($('form', html));

They seem the same, so why does the DIV selector work when the FORM selector does not?

A: Quite simply, the second example doesn't work because there is no  element to find within the context of the string, whereas in the first example, there is a div that exists within the context of the string.
In jQuery, the format $('div', html) means find the div element within the context of the html variable. It's equivalent to $(html).find('div'). See http://api.jquery.com/jQuery/#expressioncontext

Selector Context
  By default, selectors perform their searches within the DOM starting
  at the document root. However, an alternate context can be given for
  the search by using the optional second parameter to the $() function.
  For example, to do a search within an event handler, the search can be
  restricted like so:
$( "div.foo" ).click(function() {
  $( "span", this ).addClass( "bar" );
});

When the search for the span selector is restricted to the context of
  this, only spans within the clicked element will get the additional
  class.
Internally, selector context is implemented with the .find() method,
  so  $( "span", this ) is equivalent to $( this ).find( "span" ).

Since your second example has no form within the string's content (only a div is within it), it finds no match.

A: For the selector, the second parameter should be a jQuery or DOM object. If you provide a string, it will search for the content of the string. To make it work, you should make the html variable to be an object by:
var html = $('<form action="/" method="get" name="myform">
123
</form>');
console.log($('div', html));

Then if you want, you can add it to your page by:
$('body').add(html);

It's also a good idea to use a $ for jQuery object variables:
var $html = $('<form action="/" method="get" name="myform">
123
</form>');

So you can easily know that this is a jQuery object already, and you don't have to call for ex. $(html).show() every time you want to do something with it, you can simply call $html.show();

A: var html = '<form action="/" method="get" name="myform">
123
</form>';
console.log($(html).html());

as the form is the root element of html, $(html) will already return you the desired JQuery Object.
So if you try to select a form tag Jquery tries to find another form-tag within your form, which - of course - does not exist.

A: $('form', html) works as $(html).find('form'). .find() doesn't look at original element, only at its children, so form can't be found.
You can use some workaround for it, like this one:
var html = '<form action="/" method="get" name="myform">
123
</form>';
console.log($('form', '
' + html + '
'));

Fiddle.


text:
Q: database: how to create the update cascade tables and query data? I want to create a database have two tables. I want to create a update cascade relationship between two tables. If the SNAME was changed in EMPLOYEE, then WORKREPORT will change his SNAME too.
EMPLOYEE:
SNO      SNAME           SPASSWORD     SEX      BDATE           HEIGHT    BTITLE
2014      boss            12345        male      1987-06-02       180       Manager
2015      Tom             1234567      male      1987-06-05       180       Employee

WORKREPORT
   SNO       SNAME             SDATA         SCHECKLIST       SIMAGE
   2014      boss            1987-06-02      abc               afafafaf
   2015      Tom             1987-06-05      affafa            afafafaf

My code works very well. My problems is that : I don't know how to only query the employee's information(rather than manager) from the "WORKREPORT", suppose there are many employees. What should I do? Am I right about about the designing "WORKREPORT"?
This is my code:
CREATE database  if not exists cm360_cm360_1;
use cm360_cm360_1;
CREATE TABLE IF NOT EXISTS EMPLOYEE(SNO VARCHAR(7) NOT NULL,  SNAME VARCHAR(8) NOT NULL,  SPASSWORD VARCHAR(11) NOT NULL,SEX VARCHAR(8) NOT NULL,  BDATE DATETIME NOT NULL,  HEIGHT DEC(5,2) DEFAULT 000.00,BTitle VARCHAR(15) NOT NULL,  PRIMARY KEY(SNO), UNIQUE KEY (SNAME))ENGINE=InnoDB ;

SET SQL_SAFE_UPDATES=0;
INSERT INTO EMPLOYEE VALUES (2014,'boss','12345','male','2014-6-10 11:00:00',160.00,'Manager');
INSERT INTO EMPLOYEE VALUES (2015,'Tom','1234567','male','2014-6-10 12:00:00',160.00,'Employee');
SELECT * FROM EMPLOYEE;

CREATE TABLE IF NOT EXISTS WORKREPORT(SNO VARCHAR(7) NOT NULL,  SNAME VARCHAR(8) NOT NULL,SDATA DATETIME ,  SCHECKLIST VARCHAR(150),SIMAGE VARCHAR(20),FOREIGN KEY (SNO) REFERENCES EMPLOYEE (SNO) ON UPDATE CASCADE,FOREIGN KEY(SNAME) REFERENCES EMPLOYEE (SNAME) ON UPDATE CASCADE ) ENGINE=InnoDB;

INSERT INTO WORKREPORT VALUES (2014,'boss',' 2014-6-10 14:38:59','abc','afdsfdfds');
INSERT INTO WORKREPORT VALUES (2015,'Tom',' 2014-6-10 15:38:59','abc','afdsfdfds');
SELECT * FROM  WORKREPORT order by SDATA ASC;

UPDATE WORKREPORT SET SCHECKLIST='elevator;floor' WHERE SNAME='hanlu2';
delete from workreport WHERE  SIMAGE='N/A' AND SNAME='enlan';

A: If you want to get Employee WORKREPORT information, query below should work..
SELECT WORKREPORT.*
FROM WORKREPORT, EMPLOYEE
WHERE EMPLOYEE.SNO = WORKREPORT.SNO
AND EMPLOYEE.BTITLE = "Employee"

A: If you just want to get all employee information, you can JOIN the two tables on SNO and/or SNAME since you have a FK relationship on those column and filter by the condition that BTITLE shouldn't be MANAGER
select e.*
from employee e
join workreport w on e.SNO = w.SNO
and e.SNAME = w.SNAME
and e.BTITLE <> 'Manager'


text:
Q: how to turn message.created_at into a timezone aware datetime with the timezone of utc? I am trying to check if a message is older then a day, then I delete it with discord.py, but it returns a error TypeError: unsupported operand type(s) for -: 'coroutine' and 'datetime.datetime' My code currently is
    async def _now(self):
    return datetime.now(timezone.utc)

and the check function
    async def _clean_channel(self, ignore = None):
    def check(message: Message):
        if ignore and message.id == ignore.id:
            return False

        return self._now() - message.created_at < timedelta(days=1)

    await self.bump_channel.purge(check=check)

I do not know what causes this error, but I think it is because of timezones in datetime objects


text:
Q: How can I get an expandable TextFormField in BottomNavigationBar Flutter I'm trying to get an expandableTextFormField in bottomNavBar that will automatically increase in height as the user types into a new line. In my bottomNavBar code below, I gave the container a height of 60px so it doesn't take up the whole screen.
bottomNavigationBar: SafeArea(
    child:  Container(
          height: 60,
          color: Colors.white,
          margin: EdgeInsets.only(
              bottom: MediaQuery.of(context).viewInsets.bottom),
          padding: const EdgeInsets.only(
            left: 12,
            right: 8,
          ),
          child: Row(
            children: [
              CircleAvatar(
                backgroundImage: NetworkImage(url),
                radius: 15,
              ),
              Flexible(
                child: Padding(
                  padding: const EdgeInsets.only(
                    left: 16,
                    right: 8,
                    top: 2,
                    bottom: 2,
                  ),
                  child: TextFormField(
                    expands: true,
                    maxLines: null,
                    minLines: null,
                    style: TextStyle(
                      fontSize: 14,
                    ),
                    textCapitalization: TextCapitalization.sentences,
                    controller: commentEditingController,
                    decoration: InputDecoration(
                      filled: true,
                      fillColor: Color(0x27AFAFAF),
                      hintText: 'Comment as $displayName...',
                      hintStyle: TextStyle(color: Color(0xFFAFAFAF)),
                    ),
                  ),
                ),
              ),
              InkWell(
                onTap: () {

                },
                child: Container(
                  padding: const EdgeInsets.symmetric(
                      vertical: 8, horizontal: 8),
                  child: const Text(
                    'Post',
                    style: TextStyle(color: Colors.blue),
                  ),
                ),
              )
            ],
          ),
        );
      },
    ),
  ),

I also attached a screenshot for more explanation of what I'm talking about:

A: here's my implementation
Container(
                  margin: const EdgeInsets.only(top: 20, bottom: 8),
                  decoration: BoxDecoration(
                    color: Colors.white.withOpacity(0.1),
                    borderRadius: BorderRadius.circular(2),
                  ),
                  constraints: BoxConstraints(
                    minWidth: MediaQuery.of(context).size.width,
                    maxWidth: MediaQuery.of(context).size.width,
                    minHeight: 25.0,//min height you want to take by container
                    maxHeight: 100.0,//max height you want to take by container
                  ),
                  child: Scrollbar(
                    child: TextField(
                      keyboardType: TextInputType.multiline,
                      textInputAction: TextInputAction.done,
                      onSubmitted: (value) {

                      },
                      maxLines: null,
                      // focusNode: focusNode,
                      controller: _message,
                      style: const TextStyle(color: Colors.white),
                      decoration: const InputDecoration(
                        border: InputBorder.none,
                        contentPadding:
                            EdgeInsets.symmetric(horizontal: 13, vertical: 13),
                        hintText: "Message(optional)",
                        hintStyle:
                            TextStyle(color: Colors.white24, fontSize: 14),
                      ),
                    ),
                  ),
                ),


text:
Q: Double hash entries while printing As part of a bigger program I've got a hash. I'm testing the program printing the keys but they are all duplicates, I don't know why
while ( my $line = <SEQ> ) {

  chomp $line;
  $line =~ s/>//;

  my ( @split1 ) = split( "\t", $line );

  foreach my $chr ( keys %position ) {

     #print Dumper \%position;
     print "$chr\n";

     foreach my $pos ( sort keys %{ $position{$chr} } ) {

        if ( $split1[0] =~ /$chr/ ) {
           #print "$chr\t$pos\n";
        }
     }
   }
}

%position is a nested hash, when I print the keys on print "$chr\n"; they are all doubled and I don't understand why.
The file opened on handle SEQ looks like this:
>chr1\tACTGTAGTCTCATCCTAT...
>chr2\tACGTAGCTAGT....

and so on

A: Start with this:
my %data;
while(<DATA>){
    chomp;
    my ($chr, $seq) = split;
    $data{$chr} = $seq;
}

print Dumper \%data;

A: You have a foreach loop inside a while which will print all of the keys of the %position hash for every line of input
That will cause symptoms like what you're describing. Is that what you're looking for?


text:
Q: Use Map instead of For loop in my Apex Trigger I'm new to coding and I need help in modifying the apex trigger below to the correct one. Can you also help me in creating a test class for this? Thank you so much!
trigger UpdateLadderedFields on OpportunityLineItem (before insert, before update)
{
   for (OpportunityLineItem oli: Trigger.new)
   {
      string OppprodSKUID;
      OppprodSKUID = oli.SKU_ID__c.substring(0,15);

      If(oli.Q4_Laddered__c != null)
      {
         List<Ladders_RDP__c> lr = [SELECT ID, SKU_ID__c, Total_Laddered__c, OE_Qtr__c
                                       FROM Ladders_RDP__c WHERE SKU_ID__c = :OppprodSKUID];
         for(Ladders_RDP__c l: lr)
         {
             If(l.OE_Qtr__c.contains('Q4')) {
                 oli.Q4_Laddered__c = l.Total_Laddered__c;}
             else If(l.OE_Qtr__c.contains('Q3')){
                 oli.Q3_Laddered__c = l.Total_Laddered__c;}
             else If(l.OE_Qtr__c.contains('Q2')){
                 oli.Q2_Laddered__c = l.Total_Laddered__c;}
             else IF(l.OE_Qtr__c.contains('Q1')){
                 oli.Q1_Laddered__c = l.Total_Laddered__c;}
         }
      }
   }
}

A: As a general rule, you should try to pre-fetch the data before entering the loop.
Re-writing a bit of your code, I will get this. I have not tested it, but you will get the general idea. Of course you need to bulk test this for your exact business scenario.
trigger UpdateLadderedFields on OpportunityLineItem (before insert, before update)
{
    Map<String,OpportunityLineItem> oppLineItemSKUIDMap = new Map<String,OpportunityLineItem>();

    for (OpportunityLineItem oli: Trigger.new)
    {
        string OppprodSKUID;
        OppprodSKUID = oli.SKU_ID__c.substring(0,15);
        oppLineItemSKUIDMap.put(OppprodSKUID,oli);

    }

    List<Ladders_RDP__c> lr = [SELECT ID, SKU_ID__c, Total_Laddered__c, OE_Qtr__c
                                FROM Ladders_RDP__c WHERE SKU_ID__c in:oppLineItemSKUIDMap.keySet()];

    for(Ladders_RDP__c l: lr){
        String skuId = l.SKU_ID__c;
        OpportunityLineItem oli = oppLineItemSKUIDMap.get(skuId);
        If(oli.Q4_Laddered__c != null)
        {
            If(l.OE_Qtr__c.contains('Q4')) {
                oli.Q4_Laddered__c = l.Total_Laddered__c;}
            else If(l.OE_Qtr__c.contains('Q3')){
                oli.Q3_Laddered__c = l.Total_Laddered__c;}
            else If(l.OE_Qtr__c.contains('Q2')){
                oli.Q2_Laddered__c = l.Total_Laddered__c;}
            else IF(l.OE_Qtr__c.contains('Q1')){
                oli.Q1_Laddered__c = l.Total_Laddered__c;}
        }
    }

}

As for your test method, you would need to just insert the Ladders_RDP__c, Opportunity and OpportunityLineItem and use Asserts to validate the values. If you can begin a simple test and post it, perhaps I can help fix it.


text:
Q: C# How to set 'return-path' for smtp mail I am trying to set the 'return-path' for my emails but I'm not seeing it as an available parameter.  It seems like replytolist is not the same thing.  I wan't to set the location that bounced emails are delivered.  Here is my code so far:
    private static void SendMail(string html,string taxId,string toEmail,string filePath,string fromEmail,string replyToEmail,string emailSubject,string emailAttachPath)
    {
        try
        {
            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(fromEmail);
            mail.To.Add(toEmail);

            mail.Subject = emailSubject;
            mail.Body = html;

            //specify the priority of the mail message
            mail.ReplyToList.Add(replyToEmail);

            SmtpClient SmtpServer = new SmtpClient("smtp.server.com");
            SmtpServer.Port = 25;
            SmtpServer.UseDefaultCredentials = true;
            SmtpServer.EnableSsl = false;
            mail.IsBodyHtml = true;

            SmtpServer.Send(mail);

        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.ToString());
        }
    }

A: If you dont write return path emailaddress. Server will take from email address convert into the return path. You also can see email report in your email original source.

If you want to add custom reutn path you can use
 MailMessage message = new MailMessage();
 message.Headers.Add("Return-Path", "response@*****.biz");

Also if you using postfix and you want add return path Automatically You will have to make changes in two files

*

*canonical :- put your return path emailaddress here.
//reply@domain.com

*main.cf :- write your code in main.cf file
canonical_classes = envelope_sender
sender_canonical_maps = regexp:/etc/postfix/canonical


text:
Q: Why aren't there two Flashes? At the end of The Flash S1E15, Out of Time, Barry accidentally

 travels back in time, finding himself about a day in the past.  He then stops at the exact same place and time that he did earlier in the episode, watching dogs bark at each other and a woman missing her taxi.

However, as we saw this same scene play out earlier in the episode, there should be two Flashes standing there.  Why wasn't there a second Flash?

A: Wells describes it as "Temporal Reversion." That Barry didn't travel back in time, so much as he reverted his consciousness to a previous time. Giving him basically a 'Groundhog Day' experience, as opposed to his future body physically traveling to the past.
Clip of Wells warning Barry about disrupting the timeline:
This is obviously different from the time travel Barry will experience later when he goes back in time to his home and battles the Reverse Flash.

A: I think that the writers chose this method of temporal reversion to be less confusing and to avoid having to deal with pardoxes and such, however, it runs counter to all the usual time travel examples like Back to the Future and the new Star Trek movies. In those, the character can travel back and see and even interact with their past self. That's a pretty simple thing to understand. This temporal reversion is just odd to me.
There SHOULD be two Barry's there. In the end though, the writers chose this method and we will just need to forget about the usual time travel conventions and move on. I mean, it doesnt line up with how Flash travels through time in the comics at all, but I guess this ISNT a comic book, yeah?
I still like the show, just not this particular delivery.

A: This method contradicts the future "time travels" but in essence he died in the blast and his mind traveled back. Either that or he merged or "phased into" himself. However, this is an Arrow episode so this isn't cannon for The Flash anyways. This is the Arrow writer's interpretation of time travel, as we've seen other types on The Flash.

A: I think if the Flash travelling back has the same physical state as the Flash from that time they merge. But if there are biological changes in the body, they are unable to merge and this results in 2 Flashes.


text:
Q: Javascript RenRen API I'm using the renren javascript API. to link a 3RD party app within an iframe to RenRen (the facebook of china). I've been able to authenticate and get an accessToken using
 Renren.ui({params});

Renren is inited when my document is ready. Renren.init({appId:appId});
So, in my authentication success handler, I want to request the logged in user's id. On the API it lists the parameters for a making a request, but not how to actually make it! I followed a link out that was supposed to be an example, but it is for the Java version, not js. http://wiki.dev.renren.com/wiki/API_Invocation
I'm using the built in translate feature in chrome to view the documentation. All i want is a clear example of how to make a request using their REST implementation. If i can get the response object, I think I can figure out how to parse it pretty easily.
In the JS documentation bundled with the zip file, i see:
 Renren.Request(options) or Renren.Request.Hidden(options)

Would it work just like the UI version? Is this how I would get objects like a user?
The source for their JS API is here: http://wiki.dev.renren.com/wiki/Js-sdk-1.0#Documentation

A: Since the JS API is broken (I emailed Renren and they said it is), Use the js API just to authenticate if you want to avoid using a backend API (which is even more confusing).
First, to get your application settings to save correctly turn off translation when submitting the form, enter Website Connect URL or you will get a redirect_uri error when you try to authenticate.
I was able to get the Flash API commands to work. If you're hacking it, remember that the "calculate sig" functionality actually take the WHOLE request minus sig and session key to make the signature key. Then you add the sig and submit the api request.


text:
Q: Change image from image folder on button click I would like to change image on button click. Basically I will let a user upload an image to the folder and when a button is clicked it will go to the next image in the folder when the previous button is click it will go back one image I have done something similar with switch statements, however I knew what images were in the folder making it easy to do that. My code for that is below:
  protected void Button2_Click(object sender, EventArgs e)
        {
            switch (Image1.ImageUrl)
            {
                case "image1":
                    Image1.ImageUrl = "image2";
                    break;
                case "image2":
                    Image1.ImageUrl = "image3";
                    break;:
                default:
                    break;
            }
}

This worked because I knew exactly what images were in the folder. The code I am trying to make Idk what images may be uploaded to the folder but would like to go through those as well with a button click.

A: You can use the Directory.GetFiles() method to get an array of all the filenames in your image directory. Let's call that myImageArray.
When you have the filename of the image currently displayed, Array.IndexOf() will tell you what position that file comes in the array. Let's call it n. Now myImageArray[n + 1] will give you the name of the next file.
I will leave it up to you to ensure you don't try to find another filename when you reach the last one.
As it says in the notes to Directory.GetFiles(), it's not guaranteed that the filenames will come out in any particular order. So you will need to use Array.Sort() before looking into it. And if your directory contains other files that are not images, you can use a filter as a second parameter. For example if you only want to cycle through .jpg files, do something like this:
var myImageArray = Directory.GetFiles("/my/path", "*.jpg");
Array.Sort(myImageArray);
int currentIndex = Array.IndexOf(myImageArray, Image1.ImageUrl);
// etc


text:
Q: Leer arhivos binarios en C (fread Matlab) En Matlab tengo un archivo binario leído de esta forma:
fid = fopen('nombrearcihvo', 'r', 'ieee-le')

el contenido son flotantes cortos, o de 32 bits (4 bytes) y para leer el primer elemento uso lo siguiente:
fread(fid, 1, 'float32')

Y me arroja 0.6721
Pero necesito leerlo en un çodigo en C, y he utilizado el siguiente código
float v;
ifile = fopen(namefileI,"r");
fread((void*)(&v), sizeof(v), 1, ifile);

Para ver el resultado lo hago enviando el contenido de v a otro archivo
de la forma:
fwrite ((void*)(&v), sizeof(v), 1, fp);

Y me arroja estos símbolos:
±
,?
En realidad, he probado varias maneras, con ninguna que me haya dejado algo satisfecha ya que el resultado no parece coincidir con el que me arroja Matlab.
Mi pc es Little-Endian, por lo que debería estar leyendo igual, y el tipo float32 es el mismo de 4 bytes de C....
Qué código o pasos debería realizar para convertir los datos del archivo y obtener el mismo resultado que en Matlab ?
Gracias!

A: La forma en como estás utilizando las funciones es correcta. Es decir, el tipo de los argumentos como los tamaños son acorde a lo que necesitas. El problema no es está en el uso de fopen(), fread() o fwrite().
Algo que hay que tener claro es que a la función fwrite no sabrá el tipo de los datos a los que se le hace apuntar. Esa es la intención de tener un void * como argumento. La función espera una dirección inicial y un tamaño para hacer una escritura en crudo (byte por byte) elemento por elemento.
Por tu descripción esperas que fwrite haga la conversión de punto flotante a caracteres para ser leídos porteriormente en un archivo de texto. Eso no ocurrirá con 'fwrite()'. Es por eso que en su lugar, al abrir dicho archivo sólamente ves caracteres inesperados:

± ,?

Al abrir dicho archivo se desplegarán en pantalla en base al caracter UTF-8 correspondiente:

*

*? en UTF-8 (hex) es 0x3F

*, en UTF-8 (hex) es 0x2C

*' ' (espacio) en UTF-8 (hex) es 0x20

*± en UTF-8 (hex) es 0xC2B1

Asumiendo que ese es el órden en cómo te aparecen los caracteres, ahora, si concatenamos todos estos datos nos da lo siguiente:
0x3F2C20C2B1

Si tomamos los 32 bits mas significativos:
0x3F2C20C2

y si decoficamos el valor en base al estándar IEEE-754 obtendremos:
0.67237484

El cual no es exactamente 0.6721 pero está en el rango. Si usamos la misma herramienta para obtener la representación hexadecimal de 0.6721 obtenemos:
0x3f2c0ebf

Podemos notar aquí que los dos primeros caracteres corresponden. Algo que considerar, y en base al comentario hecho por @eferion es que la precisión del tipo de datos floates de 6 dígitos. El error que vemos aquí pudiera ser por un error de conversión en las cifras mostradas.


text:
Q: Why do I see an "x" tick mark next to a few dependencies of node when I use brew info node? I am new to using Homebrew to manage and install packages. I installed node using nvm which was installed using the command brew install nvm. I then used brew info node and this came up:
==> Dependencies
Build: pkg-config ✘, python@3.9 ✘
Required: brotli ✔, c-ares ✔, icu4c ✘, libuv ✔, nghttp2 ✔, openssl@1.1 ✔

I am assuming that this indicates whether that package is installed or not. However, as it is listed as required, how is it that it wasn't installed along with the rest of the dependencies? Can someone explain to me what is happening? In the event that this is an issue I should fix, what steps do I need to take?

A: nvm and node are two different packages. You installed nvm but not node, so there's nothing wrong in that node's dependencies are not installed.


text:
Q: Why do I have a terminal error in VS Code? I'm trying to learn Python using VS Code. Onde of my task is to opne a file from folder in VS Code nad then run a terminal but when I'm opening it i have error like below in temrinal
PS C:\Users\Łukasz\Desktop\Exercise Files> & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/ukasz/Desktop/Exercise Files/Chap02/02_07_begin.py"
& : The term 'C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable progra
m. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:/Users/ukasz/...on39/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Łukasz\Desktop\Exercise Files>

Could you explain me what I'm doing wrong? I'm not sure what's wrong in the file path and what I can change. I was just adding a file from my desktop, and also just installing a Python on my computer, nothing more.
If it help - I'm learning from the Linkedin Learnign, so I'm just trying to do what they say ;)


text:
Q: Pagination in laravel for displaying awkwardly I have the following code to display unsolved questions from the database

 Unsolved Questions

    @if(!$questions)

 There are no Unsolved Questions

    @else

            @foreach($questions as $question)

 {{ $question->questions }}

            @endforeach

        {{ $questions->links() }}
    @endif

The result displays properly however the pagination results shows like this
«
1
2
»

Where could the problem be?
Controller
    public function create()
    {
        return View::make('questions.create')
            ->with('title', 'Q&A ask/Answer question')
            ->with('questions', Question::unsolved());
    }

Model
    public static function unsolved()
    {
        return static::where('solved', '=', 0)->orderBy('id', 'DESC')->paginate(5);
    }

A: I have been able to change this by editing apps/config/view.php
and changed pagination from 'pagination' => 'pagination::slider-3',
to 'pagination' => 'pagination::slider',
this gave me a pagination that looks like this `
« 1 2 »


text:
Q: VS and MonoDevelop code sharing Knocking my head against the wall trying to figure out a good workflow for sharing code between a few WP7, iOS, and Android applications, all implemented in .NET/Mono.  Anyone has figured this out?

A: I have some experiments in code sharing that you can see here: http://granite.codeplex.com/
What I've learned so far:

*

*Pure business objects are your best friend. Pushg as much logic as possible into these.

*Testing frameworks on mobile devices are just about useless, but you can unit test the heck out of your business objects using the desktop platforms (.NET or Mono).

*Mono has more bugs that .NET, so make sure you run your unit tests against it.

*Make sure you use a source control that works with MonoDevelop. That means no TFS.

*Make sure you use a Unit Test framework that Mono supports. (e.g. NUnit)

*View-models can be shared with the right abstraction layer, but it may not be worth it.

A: I use SVN in order to code in Mono on PC/MAC/LINUX - tho i rarely do anything on Linux other than POC's.
As far as workflow for sharing libraries between all of these different systems - good luck.  All i can offer is:
- Be sure to unit test as Jonathan pointed out
- Know all of your compiler hints that are available
- Avoid P/Invoke or any O/S specific calls if possible
- Pray
Good luck :-)


text:
Q: The $n-th$ term of a sequence is the LCM of the integers from $1$ to $n$
The $n-th$ term of a sequence is the least common multiple (LCM) of the integers from $1$ to $n$. Which term of the sequence is the first one that is divisible by $100$?

How I'll solve this?
Note: This is a problem from BDMO - $2012$

A: For some prime $p$, the greatest $p^n$ that divides the LCM of the integers $1$ through $n$ is the greatest $p^n$ that is less than $n$. For example, for the LCM of the integers $1$ through $50$, the greatest $7^n$ that divides the LCM is $49$ since $7^2=49<50$, but $7^3=343>50$. $7^3$ can not divide the LCM of the integers $1$ through $50$ because there is no integer less than or equal to $50$ that has $7^3$ as a factor.
Thus, for the number $100=2^2*5^2$, we need the LCM to divide $2^2=4$ and $5^2=25$. The maximum of these two prime powers is $25$. Thus, the lowest integer $n$ such that the LCM of $1$ through $n$ is divisible by $100$ is $25$ since it is the smallest LCM that has $5^2$ as a factor.


text:
Q: Need explanation of proof of Theorem 3 in Section 31, Chapter II of Kuratowski's Topology When I read Chapter II, Section 31: "B-measurable Functions" in Topology by Kuratowski, I have a problem in understanding the proof of Theorem 3.
Here is the image of that theorem.

I can not understand the left direction proof ($\Leftarrow$), which I marked with a blue line, especially the last sentence: "Secondly, the condition ...".
There is written "for sufficiently large $k$, if $|y-f(x)|<\frac{1}{k}$, then $y\in G$ (since $G$ open)."
I can not connect it with the definition of open set, i.e. the set G is open if for every $z\in G$, there exists $r>0$ such that $B(z,r)\subset G$.
So, can anyone explain, why if $G$ is open, implies that, for sufficiently large $k$, if $|y-f(x)|<\frac{1}{k}$, then $y\in G$?
Thanks for any explanation.
Note:
Definition of B-measurable function

A mapping $f:X\to Y$ is said to be B-measurable of class $a$ (or, briefly, of class $a$) if, for every closed subset $F\subset Y$, the set $f^{-1}(F)$ is borelian of multiplicative class $a$.

And $\delta[A]$ denotes diameter of set $A$.

A: He wants to show
$$f^{-1}(G) = Z := \bigcup\{Z^k_n \mid f(Z^k_n) \subset G \} .$$
By definition $Z \subset f^{-1}(G)$ since $f(Z^k_n) \subset G$ is equivalent to $Z^k_n \subset f^{-1}(G)$.
Next he considers $x \in f^{-1}(G)$ which is equivalent to $f(x) \in G$. Since $G$ is open, there exists $r > 0$ such that $B(f(x),r) \subset G$. This means that if $\lvert y - f(x) \rvert < r$, then $y \in G$. Now we may take w.l.o.g. $r = 1/k$ for some sufficiently large $k$. We know that $x \in Z^k_n$ for some $n$. Since $\delta(f(Z^k_n)) < 1/k$, we get $\lvert f(x) - f(x') \rvert < 1/k$ for all $x' \in Z^k_n$. Thus $f(x') \in G$ for all $x' \in Z^k_n$, i.e. $f(Z^k_n) \subset G$. This shows that $x \in Z^k_n \subset Z$.


text:
Q: Runnable.Run / StartCoroutine calles to Watson services from Unity In my ExampleStreaming.cs script, once the user utterance is recognized as final, I send it to both the Watson Assistant service and the Tone Analyzer. Because I am keeping the scripts for each service separate as they are, I have to make calls within each script to access the other service. You can see the call I make to the Tone Analyzer below (the .SendToneAnalysis method):
private void OnRecognize(SpeechRecognitionEvent result, Dictionary<string, object> customData)
{
    blah blah blah . . .

    /// Only send the recognized speech utterance to the
    /// Assistant once we know the user has stopped talking.
    if (res.final)
    {
        string _conversationString = alt.transcript;
        Runnable.Run( StopRecording(1f) ); // Stop the microphone from listening.

    /// Message.
    Dictionary<string, object> input = new Dictionary<string, object>
    {
        ["text"] = _conversationString
    };
    MessageRequest messageRequest = new MessageRequest()
    {
        Input = input,
        Context = _Context
    };

    _exampleAssistantV1_script.SendMessageAssistant(messageRequest);
    _exampleToneAnalyzer.SendToneAnalysis(_conversationString);

    . . .

In my ExampleToneAnalyzer.cs script, I make a simple call to the event-handling methods that are meant to contact the service and also handle success & failure:
public void SendToneAnalysis(string conversationString)
{
    _service.GetToneAnalyze(OnGetToneAnalyze, OnFail, conversationString);
}

These calls are typically made using StartCoroutines, particularly in the Watson Unity SDK that there is a specialized Runnable.Run which is essentially a helper class for running co-routines without having to inherit from MonoBehavior.
My question is whether my simple method call to the service might be problematic in certain situations or perhaps just wrong or bad programming, or whether it is perfectly OK to go for that method instead of something like the following:
public void SendToneAnalysis(string conversationString)
{
    Runnable.Run( SendAssistantToneAnalysis(conversationString) );
}

private IEnumerator SendAssistantToneAnalysis(string conversationString)
{
    if ( !_service.GetToneAnalyze(OnGetToneAnalyze, OnFail, conversationString) )
    {
        Log.Debug("ExampleToneAnalyzer.SendAssistantToneAnalysis()", "Failed to analyze!");
    }

    while (!_UserUtteranceToneTested)
        yield return null;
}

A: It's no problem.
Runnable.Run() eventually calls StartCoroutine() as the follow.
    public Routine(IEnumerator a_enumerator)
    {
        _enumerator = a_enumerator;
        Runnable.Instance.StartCoroutine(this);
        Stop = false;
        ID = Runnable.Instance._nextRoutineId++;

        Runnable.Instance._routines[ID] = this;
    #if ENABLE_RUNNABLE_DEBUGGING
        Log.Debug("Runnable.Routine()", "Coroutine {0} started.", ID );
    #endif
    }

Please refer to https://github.com/watson-developer-cloud/unity-sdk/blob/master/Scripts/Utilities/Runnable.cs
And the coroutine can be called from any gameobject, if it is active.

A: You don't need to make any of the service calls from within a coroutine. Only authentication using iamApikey should be done using a coroutine
IEnumerator TokenExample()
{
    //  Create IAM token options and supply the apikey. IamUrl is the URL used to get the
    //  authorization token using the IamApiKey. It defaults to https://iam.bluemix.net/identity/token
    TokenOptions iamTokenOptions = new TokenOptions()
    {
        IamApiKey = "<iam-api-key>",
        IamUrl = "<iam-url>"
    };

    //  Create credentials using the IAM token options
    _credentials = new Credentials(iamTokenOptions, "<service-url>");
    while (!_credentials.HasIamTokenData())
        yield return null;

    _assistant = new Assistant(_credentials);
    _assistant.VersionDate = "2018-02-16";
    _assistant.ListWorkspaces(OnListWorkspaces, OnFail);
}

The examples are only meant to show how to invoke the service call. The only reason the code is invoked from a coroutine is so we can wait for the response of one service call before running another service call (i.e. so we don't try to update or delete a workspace before the workspace is created).


text: Q: Readability API confidence call returning 0.5 for any string passed to it Readability API offers a /confidence resource that returns the confidence that a given URL will be parsed nicely by the Readability parser. But the call returns 0.5 for any random string passed to it, even if it's not a valid URL. Is this documented to be out of order somewhere? Getting the same average confidence for any article URL is not very helpful.


text:
Q: querying WITH a $variable ive been trying all kinds of things and for some reason no matter what i do i cannot seem to query with a avriable... so far, here is my code, its not all of it, but ive pin pointed where my problem is....
<?php

    $hostname = 'localhost';        // Your MySQL hostname. Usualy named as 'localhost', so you're NOT necessary to change this even this script has already online on the internet.
 $dbname   = 'ServiceHistoryDB'; // Your database name.
 $username = 'root';             // Your database username.
 $password = '';                 // Your database password. If your database has no password, leave it empty.

// Let's connect to host
 mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!');
 // Select the database
 mysql_select_db($dbname) or DIE('Database name is not available!');

$custnum = '1';

    function connect(){

        mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!');
        mysql_select_db($dbname) or DIE('Database name is not available!');
    }

    function close(){
        mysql_close();
    }

        function query(){
            $mydata = mysql_query("SELECT * FROM vehicles WHERE CustNum=1");
            while($record = mysql_fetch_array($mydata)){
                echo '<option value="' . $record["Model"] . '">' . $record["Model"] . '</option>';
        }

    }

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>testdropdown</title>
</head>

<body>

<select name="dropdown">
<?php query() ?>
</select>
<?php close() ?>
</body>
</html>

A: Okay, well, you can simply write in the variable like below:
$variable = 'someData';
"Select someColumn from yourTable where someColumn = $variable";

But, if you're doing this from a function you may need to declare a global variable to retrieve the value if the value was set outside the function:
function someFunc(){
    global $variable; // set above
    "Select someColumn from yourTable where someColumn = $variable";
}

Using prepared statements
You should switch to mysqli prepared statements as they are more secure:
if($stmt = $mysqli->prepare($yourSQL)){
    $stmt->bind_param("s", $variable);
    $stmt->execute();
    $stmt->bind_result($thisHoldsThe_QueryResult);
    $stmt->fetch();
    $stmt->close();
}


text:
Q: jqgrid - save data for inline editing I have a jqgrid. My requirement was "load the grid with ALL ROWS IN EDIT MODE by default". So I used Oleg answer in this link
Now. I want to save data on each cell that has data. How to do that?

A: One of the problem why one should not makes ALL ROWS IN EDIT MODE is the fact that all the change are not saved. Such grids have some other disadvantages: sorting is disabled for example. So you have to provide some additional interface like "Save all changes" button outside of the grid. You should call saveRow on every row in the save way like you called editRow at the beginning. See the old answer, this one or you can just place the part of code inside of $th.click(function () {...}) from the answer in your click event handler of "Save all changes" button.


text:
Q: How to use IMUL and MUL instruction in emu8086? How to use IMUL and MUL in emu8086? .. movzx in emu8086 is not allowed
like for example movzx is not allowed in emu8086, this alternative would
    allow me to use the instruction, does emu8086 has something like this
    alternative so i use instructions IMUL / MUL?
1  movzx bx,centerBot ;not allowed in emu8086
2
3  mov bh,00          ;alternative of line 1
4  mov bl,centerBot   ;to move centerBot to bx
                      ;in emu8086

is there something like this with the IMUL/MUL in emu8086 so i can these instructions?

A: As you can see by looking at a guide to the x86 instruction set (here or here), the mul and imul instructions have been supported since the 8086. Therefore, if Emu8086 actually emulates the Intel 8086, then it should emulate both of these instructions, too. You should have no problem using them.
MUL is for unsigned multiplication, and comes in two forms on the 8086: the 16-bit version and the 8-bit version:

*

*MUL r16|m16   ⇔   dx:ax = ax * r16|m16

*MUL r8|m8   ⇔   ax = al * r8|m8
IMUL comes in the same two versions, but treats the values as signed.

Regarding your workaround/emulation of movzx, it would be better to use:
xor bx, bx          ; clear BX (upper and lower bits)
mov bl, centerBot   ; copy centerBot to the lower bits of BX

Or you can just arrange for centerBot to be a word-sized variable/memory, which would make a direct move possible:
mov bx, centerBot


text:
Q: back button not working after javascript redirect I have a widget which is embedded in random sites. when the user clicks I call the server to update the click occured and the server returns redirect to the correct page. The problem is that the Back button of the browser no longer works.
I use location.href for the redirect.
I tried location.replace -which keeps the back button , but it goes to the page before the page in which the widget was clicked (it replaces it with the new page).
How can I do the page switch after reporting to the server and still allow the back button to work?

A: You cannot go back to a page that auto-redirects.  That's just a broken back button and a frustrated user.
User goes to page A.
User clicks on link to page B.
Page B automatically redirects to page C with window.location.
User hits back button and momentarily goes back to page B.
Page B automatically redirects to page C with window.location.
User hits back button and momentarily goes back to page B.
Page B automatically redirects to page C with window.location.
User is sad.

Obviously this doesn't work.  It has to work like this instead:
User goes to page A.
User clicks on link to page B.
Page B automatically redirects to page C with window.location.replace().
User hits back button and goes back to page A.
User is happy.

You must auto-redirect with window.location.replace() if you want the back button to work.


text:
Q: Placing arrow on existing background picture in R I would like to plot the result of fitted model on existing jpg. The result is between 0 and 1. And I would like the figure (as a pointer) to move nicely along the jpg axis (just about it as shown on the picture below).

A: I'm not sure that I like the approach of using a ready made scale and adding a pointer to it; but, if you must, here is a way. The tricky part is getting your point plotting to line up with the axis displayed in your jpeg scale:
Example
First, I made an example jpeg:
library(biOps)

#make jpeg of scale
jpeg("scale.jpeg", width=4, height=1, units="in", res=200, quality = 100)
par(mar=c(4,0,0,0), ps=10)
z <- seq(0,1,by=0.1)
breaks <- c(0,0.33,0.67,1)
image(x=z, z=matrix(z, nrow=length(z), ncol=1), xlim=c(0,1), axes=FALSE, xlab="", ylab="", breaks=breaks, col=c("red","yellow", "green"))
axis(1, at=seq(0.1,0.9,0.1))
box()
dev.off()

Then, I load this and place it in the lower panel of a device using layout, and added a point above at a given location (e.g. 0.2):
#add pointer above figure
pic <- readJpeg("scale.jpeg") # load jpeg

lo <- matrix(2:1, nrow=2, ncol=1) # layout info
WIDTHS <- c(4)
HEIGHTS <- c(0.2,1)

#make new jpeg
jpeg("scale_w_pointer.jpeg", width=4, height=1.2, units="in", res=200, quality = 100)
#quartz() # or x11() to preview
layout(lo, widths=WIDTHS, heights=HEIGHTS, respect=TRUE)
layout.show(2)

#plot 1
par(mar=c(0,0,0,0))
plot(pic)

#plot 2
par(mar=c(0,0,0,0))
plot(1, xlim=c(0,1), ylim=c(0,1), t="n", xaxs="i", yaxs="i", xlab="", ylab="", axes=FALSE)
points(0.2, 0.30, pch=25, bg=1, col=1)

dev.off()

A: This is a bit rough but should get you started. With scan, tcltk or shiny you could make this interactive/responsive and/or write to file as needed.
col <- c("green", "yellow", "red")
x <- matrix(col, nrow = 1L)

plot(0, xlim = c(0, 1), ylim = c(0, 0.5), asp = 1,
  xlab = "", ylab = "", axes = FALSE, type = "n")
axis(1, at = seq(0, 1, length = 6), line = -6, lwd = 0, lwd.tick = 1)

rasterImage(x, 0, 0, 1, 0.05, interpolate = FALSE)

p   <- cbind(c(0, 0.015, -0.015, 0) + runif(1), c(0.05, 0.065, 0.065, 0.05))
polygon(p, col = "black")