text:
Q: Visual Studio 2015 "Apply Code Changes" is disabled When using Visual Studio 2015, "Apply Code Changes" is always disabled. I've seen MANY posts regarding this, but I haven't found a solution.
Here are some details:

*

*Project > Properties > Linker > General > Enable Incremental Linking is "Yes (/INCREMENTAL)".

*Project > Properties > C/C++ > General > Debug Information Format is "Program Database for Edit and Continue (/ZI).

*Tools > Options > Debugging > General > Enable Edit and Continue has a checkmark, as do Enable Native Edit and Continue, Apply changes on continue, Warn about stale code, and Allow precomiling are all checked.

*Project > Properties > General > Platform Toolset is set to "Visual Studio 2010 (v100)".

*I deleted my project's *.ilk file.

This was working with this project. I think it stopped working when I changed to the VS 2015 IDE (as noted above, I still compile it using the 2010 compiler).
Thanks!

A: The default debugger does not support Edit and Continue with v100 toolset.
Here's a workaround to get Native ENC working with older toolsets (eg. v100):

*

*Add C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ (or corresponding path for a custom VS2010 install) to your VS environment PATH variable. You can add this through:

*

*Global environment variables: Control Panel > System and Security > System > Advanced System Settings > Advanced > Environment Variables…  and Edit "Path"> New to add. -or-

*Alternatively, you can open up a Developer Command Prompt for VS2015, call
SET PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ and call devenv.

*In Debug > Options, ensure "Use Native Compatibility Mode" and "Enable Native Edit and Continue" are enabled.

*In your project properties, ensure the C/C++ > General > Debug Information Format is "Program Database for Edit and Continue (/ZI)", among other settings (see my blog post for reference).


text:
Q: Why break command didnt work in sql oracle? I need to make a job application report, I need to produce a table where the duplicated job_id and job_name will be removed from the table
And I actually want to compute total applicants who apply for the job and then I need to get remaining job vacancies (no_of_vacancies - count()) and get the percentage by (count()/no_of_vacancies*100)

Applicant ID
Job ID
Job Name
No of Vacancies
Remaining Job Vacancies
Percentage(%)

A0001
Clinical Specialist
J0001
30
24
20

A0072

A0076

but I could only get this

Applicant ID
Job ID
Job Name
No of Vacancies
Remaining Job Vacancies
Percentage(%)

A0001
Clinical Specialist
J0001
30
29
3

A0072
Clinical Specialist
J0001
30
29
3

A0076
Clinical Specialist
J0001
30
29
3

The duplicated job id and name, no of vacancies and remaining vacancies is still there, and the percentage they shown is incorrect too
Here's the code:
SET pagesize 30
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY';

ACCEPT v_jobID CHAR FORMAT 'A5' PROMPT ' Enter job id:  '

COLUMN job_id FORMAT A12 HEADING "Job ID";
COLUMN job_name FORMAT A20 HEADING "Job Name";
COLUMN applicant_id FORMAT A12 HEADING "Applicant ID";
COLUMN no_of_vacancies FORMAT 999 HEADING "No of Vacancies";
COLUMN Remaining_Job_Vacancies FORMAT 999 HEADING "Remaining Job Vacancies";
COLUMN Percentage FORMAT 999 HEADING "Percentage(%)";

BREAK on J.job_id on job_name skip2 on no_of_vacancies, Remaining_Job_Vacancies, Percentage;
COMPUTE number LABEL 'Total Applicants' ON A.applicant_id;

TTITLE CENTER 'Job Application Report for ' _DATE -
RIGHT 'Page No: ' FORMAT 999 SQL.PNO SKIP 2

SELECT A.applicant_id, J.job_id, job_name, no_of_vacancies, (no_of_vacancies - count(*)) AS Remaining_Job_Vacancies, (count(*)/no_of_vacancies*100) AS Percentage
FROM applicant A, job J, application AP
WHERE A.applicant_id = AP.applicant_id
AND AP.job_id = J.job_id
AND J.job_id LIKE '&v_jobID'
GROUP BY A.applicant_id , J.job_id, job_name, no_of_vacancies
ORDER BY J.job_id;

--CLEAR COLUMNS
--TTITLE OFF

A: That's because you don't break on table_alias.column_name
BREAK on J.job_id
         --
         ^
         |
        this

but only on column name (or its alias):
BREAK on job_id

I don't have your tables nor data, so I'll use Scott's sample schema to illustrate it.
This is what you did:
SQL> break on e.deptno
SQL>
SQL> select e.deptno, e.ename from emp e order by e.deptno;

    DEPTNO ENAME
---------- ----------
        10 CLARK
        10 KING
        10 MILLER
        20 JONES
        20 FORD
        20 ADAMS
        20 SMITH
        20 SCOTT
        30 WARD
        30 TURNER
        30 ALLEN
        30 JAMES
        30 BLAKE
        30 MARTIN

14 rows selected.

This is what you should have done:
SQL> break on deptno
SQL>
SQL> select e.deptno, e.ename from emp e order by e.deptno;

    DEPTNO ENAME
---------- ----------
        10 CLARK
           KING
           MILLER
        20 JONES
           FORD
           ADAMS
           SMITH
           SCOTT
        30 WARD
           TURNER
           ALLEN
        30 JAMES
           BLAKE
           MARTIN

14 rows selected.

SQL>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Error when building universal app for the store: "Manifest references file 'MyAppName.dll' which is not part of the payload." I am having this error in Visual Studio 2015 when try to create app package for the store for a windows universal applicaiton:

Manifest references file 'MyAppName.dll' which is not part of the payload.

The error is in the ...\..MyAppSourcePath..\Package.appxmanifest file.
This is somehow related Manifest references file 'Bing.Maps.dll' which is not part of the payload but in my case the error shows up only when build package for the store and is related to the MyAppName.dll (where MyAppName is the name of the name of my application).
Another related question in MSDN: https://social.msdn.microsoft.com/Forums/en-US/f137091e-f550-4eab-b7e2-418149b97d40/error-appx0703-manifest-references-file-myappnamedll-which-is-not-part-of-the-payload?forum=windowsstore

A: A bug fix for the Visual Studio Tools for Universal Windows Apps (v1.1.1) is released on 5 October 2015. This update requires that you already have the UWP tools v1.1 installed. You can determine whether you have UWP tools 1.1 installed by opening About Microsoft Visual Studio from the Help menu in Visual Studio. If you have "Visual Studio Tools for Universal Windows Apps 14.0.23309.00" installed, then you have the UWP tools 1.1.
To install this update

*

*You must have an internet connection throughout the setup process.

*For machines without Visual Studio

*

*Install Visual Studio from https://dev.windows.com/downloads.

*For machines with UWP Tools 1.1 installed

*

*Run this installer (http://go.microsoft.com/fwlink/?LinkId=627168) to update the UWP tools to v1.1.1.

*For machines without UWP Tools 1.1 installed

*

*For Visual Studio 2015 Community, Professional, and Enterprise, you can install by

*

*Modifying your setup to install the updated tools.

*Clicking on the entry for the UWP tools in the Notifications pane.

*Using the Extensions and Updates dialog to update Visual Studio.

*Running the installer at https://dev.windows.com/downloads, which will add the updated tools to an existing Visual Studio installation.

*For Visual Studio 2015 Express for Windows

*

*Run this installer (http://go.microsoft.com/fwlink/?LinkId=624822) to update the UWP tools to v1.1.

To confirm that you have installed the UWP tools 1.1.1 update,

*

*Go to Programs and Features in the Windows Control Panel, and click View installed updates.

*Look for "Update for Microsoft Visual Studio 2015 (KB3073097)", version 14.0.23315
Source: https://social.msdn.microsoft.com/Forums/en-US/73f2d56d-9e8e-4b57-bcfa-0a972dfd75d7/update-11-generating-store-associated-package-fails-for-a-uwp-application-with-a-winrt-component?forum=Win10SDKToolsIssues

A: It turns out this is known issue in Windows 10 SDK (Update 1.1). Reference: https://social.msdn.microsoft.com/Forums/en-US/73f2d56d-9e8e-4b57-bcfa-0a972dfd75d7/update-11-generating-store-associated-package-fails-for-a-uwp-application-with-a-winrt-component?forum=Win10SDKToolsIssues
To workaround this issue, add the below ItemGroup in your project file and regenerate the package.
<ItemGroup>
    <AppxSystemBinary Include="<Assembly Mentioned in the error>" />
</ItemGroup>

For example, if the assembly name is MyAppName.dll, include:
<ItemGroup>
    <AppxSystemBinary Include="MyAppName.dll" />
</ItemGroup>

This ItemGroup can be expanded if the error still occurs for other assemblies, for example:
<ItemGroup>
    <AppxSystemBinary Include="MyAppName.dll" />
    <AppxSystemBinary Include="OtherAssembly.dll" />
</ItemGroup>

A: I had a hell of a time trying to work this out and it's a slightly different issue to what the OP posted but hopefully this will help someone else out because I couldn't find the answer on StackOverflow and finally found it here: https://social.msdn.microsoft.com/Forums/Sharepoint/en-US/65bc5999-662c-4eda-9967-e1b3031db8c4/error-appx0703-error-manifest-references-file-assetssplashscreenpng-which-is-not-part-of-the?forum=wpdevelop after many hours of mucking around and trying different things.
My error was the same except the file was for the various store and tile image files thus: "Manifest references file 'Assets\Store\StoreLogo.png' which is not part of the payload."
All the files did exist but turned out I was running Visual Studio on a VM using Parallels and the project opened through shared folders and using a UNC path.  Ran the project from a mapped drive and it builds all good.
I do realise now that referencing UNC paths using a VM in Parallels Desktop has caused a few issues for me in the past. So just need to keep in mind that things should be run via a mapped drive instead to avoid this.


text:
Q: Why doesn't this html 'aside' appear on the side? I'm using some very simple html that I would expect to produce a sidebar, but the text in the sidebar simply appears as a next paragraph on the same page.  True in both Chrome and Safari.
<!DOCTYPE html>

         This is the main content.  I'm not content to have main content without a sidebar.

         As an aside, I want this to be at the side.

Do I need to add styling elements?  Based on the documents I wouldn't have thought so.  I have also tried this with a much longer 'section' text, to no avail.  I've also tried the <sidebar> tag.

A: These html5 tags,

, ,

and so on, have no impact on the browser, it's like writing

.
The sole purpose of their existence is to make your source code more readable.
By the way, I do not think that  actually exists.

A: From the HTML 5 specification:

The aside element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography.

It is not something that effect visually like other HTML tags.
Consider to use Flexbox

#section {
  display: flex;
  flex-direction: row;
}
<!DOCTYPE html>

      This is the main content. I'm not content to have main content without a sidebar.

        As an aside, I want this to be at the side.

You can also try to use float.

A: You will need to use CSS for this. The semantic HTML tags - section, article, aside, etc... do not have a lot of impact on the rendering of the page. Some of them usually just add a default display: block style, but that's about it.


text:
Q: Local standard App Engine/Py fails auth with remote datastore Chapter 1
Hello, I'm attempting to move the development process of a GAE/Py backend service to my local machine (so I don't annoy people [a crazy bunch of designers] using the service under the development environment while I'm implementing new features or whatever evil stuff I might be doing)
The actual state is that I have the local server up and running. I went through a first stupid issue (that you can discover in the link above).
So when I request my local server I step into what looks like a failure to Auth with google API or the google datastore it self, I cannot decipher the logs more than that so I offer you the joy :
INFO     2018-07-20 13:06:31,168 main.py:40] running on local server
INFO     2018-07-20 13:06:31,288 client.py:515] Attempting refresh to obtain initial access_token
INFO     2018-07-20 13:06:31,484 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:31,648 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:31,805 client.py:536] Refreshing due to a 401
INFO     2018-07-20 13:06:31,966 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:31,966 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:32,128 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:32,289 util.py:126] new_request() takes at most 1 positional argument (6 given)
WARNING  2018-07-20 13:06:32,289 util.py:126] new_request() takes at most 1 positional argument (6 given)
INFO     2018-07-20 13:06:32,450 client.py:536] Refreshing due to a 401
INFO     2018-07-20 13:06:32,618 client.py:536] Refreshing due to a 401
WARNING  2018-07-20 13:06:32,618 util.py:126] new_request() takes at most 1 positional argument (6 given)
.
.
repeats a lot of times
.
.
Then:
ERROR    2018-07-20 13:06:36,180 webapp2.py:1528] HTTP Error 401: Unauthorized Too many auth attempts.
Traceback (most recent call last):
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1077, in __call__
return handler.dispatch()
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "PROJECT_PATH\main.py", line 130, in post
configure_remote_api_dev_safe ('pvpsquad-dev.appspot.com')
File "PROJECT_PATH\main.py", line 43, in configure_remote_api_dev_safe
'/_ah/remote_api')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1052, in ConfigureRemoteApiForOAuth
rpc_server_factory=rpc_server_factory)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1137, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 842, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 259, in Send
NeedAuth()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 235, in NeedAuth
RaiseHttpError(url, response_info, response, 'Too many auth attempts.')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 85, in RaiseHttpError
raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
HTTPError: HTTP Error 401: Unauthorized Too many auth attempts.
ERROR    2018-07-20 13:06:36,184 wsgi.py:279]
Traceback (most recent call last):
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\runtime\wsgi.py", line 267, in Handle
result = handler(dict(self._environ), self._StartResponse)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1108, in add_context_wrapper
return synctaskletfunc(*args, **kwds)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1087, in synctasklet_wrapper
return taskletfunc(*args, **kwds).get_result()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\ndb\tasklets.py", line 1057, in tasklet_wrapper
result = func(*args, **kwds)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1519, in __call__
response = self._internal_error(e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1505, in __call__
rv = self.router.dispatch(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1253, in default_dispatcher
return route.handler_adapter(request, response)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 1077, in __call__
return handler.dispatch()
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 547, in dispatch
return self.handle_exception(e, self.app.debug)
File "GOOGLE_SDK_PATH\google_appengine\lib\webapp2-2.3\webapp2.py", line 545, in dispatch
return method(*args, **kwargs)
File "PROJECT_PATH\main.py", line 130, in post
configure_remote_api_dev_safe ('pvpsquad-dev.appspot.com')
File "PROJECT_PATH\main.py", line 43, in configure_remote_api_dev_safe
'/_ah/remote_api')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1052, in ConfigureRemoteApiForOAuth
rpc_server_factory=rpc_server_factory)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 1137, in ConfigureRemoteApi
app_id = GetRemoteAppIdFromServer(server, path, rtok)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 842, in GetRemoteAppIdFromServer
response = server.Send(path, payload=None, **urlargs)
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 259, in Send
NeedAuth()
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 235, in NeedAuth
RaiseHttpError(url, response_info, response, 'Too many auth attempts.')
File "GOOGLE_SDK_PATH\google_appengine\google\appengine\tools\appengine_rpc_httplib2.py", line 85, in RaiseHttpError
raise urllib2.HTTPError(url, response_info.status, msg, response_info, stream)
HTTPError: HTTP Error 401: Unauthorized Too many auth attempts.
INFO     2018-07-20 15:06:36,226 module.py:880] default: "POST / HTTP/1.1" 500 -

After finishing writing this I m more and more thinking about the solution to be a sort of a Google cloud Console IAM service/account authorization thing, I m going to keep looking for this but I'm totally blind.
I would appreciate any kind of help so thanks in advance.
Solution : (thanks to @snakecharmerb and this answer
just run

gcloud auth application-default login
  --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email


text:
Q: Eager / auto loading of EJB / load EJB on startup (on JBoss) EJBs seem to be loaded lazily - whenever accessed.
However, I want to initialize them eagerly - i.e. whenever the container starts-up. How is this achieved (in JBoss in particular)
This topic gives some hints, but isn't quite satisfactory.

A: As of EJB 3.1, singleton beans can be notified of module start and stop:
@Singleton
@Startup
public class StartupBean {
    @PostConstruct
    private void postConstruct() { /* ... */ }

    @PreDestroy
    private void preDestroy() { /* ... */ }
}

Prior to EJB 3.1, there is no standard, EJB-only solution.  I'd suggest adding a WAR to your EAR and using a servlet-context-listener.

A: According to Adam Bien's Real World Java EE Patterns - Rethinking Best Practices (see a summary of the patterns) and the Service Starter pattern, it is indeed as bkail suggests

*

*with Java EE 6 = EJB 3.1 use @Singleton with @Startup (and perhaps also with @DependsOn)

*prior to that the only standard and portable way is to use the Servlet API, e.g. a HttpServlet starting the EJBs in its init() method and load-on-startup set to 1 in web.xml.


text:
Q: Detect what value to use for scroll positions javascript I was fiddling around on a jsfiddle and I discovered a potential issue. Within the fiddle, I have a logger setup to track the position of the scroll if the site is embedded in a iframe (which it is on jsfiddle). However, I need to be able to detect with javascript which value I used would be appropriate for tracking scroll position within an iframe across all browsers. I used the values:
window.scrollTop
document.documentElement.scrollTop
document.body.scrollTop
The fiddle's js:
window.addEventListener("scroll",
  function() {
    console.log(
      "window:" + window.scrollTop +
      "; documentElement:" + document.documentElement.scrollTop +
      "; body:"+ document.body.scrollTop
    );
  }
);

The fiddle's CSS:
html{ height : 300% }

Using Chrome, I get logs that are similar to:
window:undefined; documentElement:0 (always 0); body:[some number] (variable number-actual scroll)
NOTE: in response to charlieftl's comments I need to make a script that will detect which of the three values I listed is appropriate for tracking the scroll position.
Also, the purpose of the script is to get the appropriate scroll position based upon whether the website is iframed(embedded) or not. When it is not the appropriate value is window.scrollTop, but inside an iframe it seems to be document.body.scrollTop. Also, I need to know when it is appropriate to use document.documentElement.scrollTop.
NOTE: jQuery solutions are appreciated, but native javascript is preferred.

A: Because I am nice, I went and tested this fiddle on several browsers (except Opera-for what ever reason I can't download it).
I found that your script logs a value for document.documentElement.scrollTop when it is in IE and Firefox. While in Chrome, it logs the value for body.scrollTop. IE, Chrome, and Firefox all log undefined for the window.scrollTop value.
Therefore, window.scrollTop is useless for the iframed content. But just for the sake of the case that this is not true in Opera, I made this code:
window.scrollTo(0,20);
document.documentElement.scrollTo(0,20);
document.body.scrollTo(0,20);

/* ^^these scroll values are only temporary */

if(isset(window.scrollTop) && window.scrollTop=20)
  alert("use window as object");

if(isset(document.documentElement.scrollTop) && document.documentElement.scrollTop=20)
  alert("use documentElement as object");

if(isset(document.body.scrollTop) && document.body.scrollTop=20)
  alert("use documentElement as object");

window.scrollTo(0,0);
document.documentElement.scrollTo(0,0);
document.body.scrollTo(0,0);

/* ^^default the scroll value back to normal state */

NOTE: However, I would be wary of using window, because it may be actually referencing the parent window and not the iframe -don't quote me on this. I am not very familiar with iframes, I was just playing around with your fiddle


text:
Q: Как расширить список экспортированных настроек в phpstorm? Передо мной стала задача экспортировать настройки на другой компьютер, вот только не все настройки перенеслись. Например, горячие клавиши и плагины, которые я по-отключал, чтобы повысить производительность.
Вот мои настройки из filesettings.jar:

а вот те же настройки, которые я нашел в интернете у товарища, только он не отвечает на запрос(невооруженным глазом видно, что их больше):

Так как же быть с настройками, нужна помощь...


text:
Q: Boole's inequality, Big Union/Intersection Symbol and a Sequence of Biased Coin Flips I am confused with the notation used for an example using Boole's inequality.
First of all, here's the question:
"Consider a sequence of tosses of biased coins. Let $A_k$ be the event that the $k$th toss is a head. Suppose $P(A_k) = p_k$. The probability that an infinite number of heads occurs is
$$ P(\bigcap_{i=1}^{\infty}\bigcup_{k=i}^\infty A_k) \leq P(\bigcup_{k=1}^\infty A_k) = p_i + p_{i+1} + ...$$
Hence if $\sum_{i=1}^\infty p_i < \infty$ the right hand side can be made arbitrarily close to 0.
This proves that the probability of seeing an infinite number of heads is 0.
If we assume coin tosses are independent then the reverse is also true: if $\sum_{i=1}^\infty p_i = \infty$ then P(# of heads is infinite) = 1"
As far as I can understand,
$$ \bigcap_{i=1}^{\infty}\bigcup_{k=i}^\infty A_k = (A_1 \cup A_2 \cup ... \cup A_\infty) \cap (A_2 \cup A_3 \cup ... \cup A_\infty) \cap .. \cap A_\infty = A_\infty$$
Which is just the event of a head for $k \rightarrow \infty$ - clearly I'm misunderstanding the notation in some way.

A: There is no such event as $A_\infty$.  No matter how long you count, you never get to $\infty.$  Informally, $\bigcup_{k=i}^\infty A_k$ is the set of heads that occur on or after toss number $i$.  If the intersection of these is nonempty, it must be that heads occurs infinitely often.  If not, there would be some toss $n$ on which the last heads occurred, and then we'd have $\bigcup_{k=n+1}^\infty A_k=\emptyset$, and then the intersection would be empty, and have probability $0$.

A: In your problem, there is no notion of $A_\infty$. So the last thing you wrote does not make any sense.
Now let us try to find the meaning of that strange intersection. Before that, set $B_i = \bigcup_{k=i}^\infty A_k$ and observe that $B_i$ is the event that you get at least one head on or after the $i$-th toss. Now, if you get finitely many heads, then at least one $B_i$ won't occur. In other words, for getting infinitely many heads, we need all the $B_i$'s to occur. Thus, the event of getting an infinite number of heads is $\bigcap_{i=1}^\infty B_i.$
Interestingly, here the sequence of events $B_i$ has the property that $B_{i+1}\subset B_i$ for every $i\ge 1.$ Hence we may denote $B_\infty = \lim_{n\to \infty} B_n$ and in that case you can show that $\bigcap_{i=1}^\infty B_i = B_\infty.$


text:
Q: Identify the greatest common divisor (GCD) of the two values using Euclid's Algorithm My program asks a user for two numbers, and then I have to pass those numbers to my function. My function is supposed to  "Identify the greatest common divisor (GCD) of the two values using Euclid's Algorithm. Return true if this value is greater than 1 and less than the smaller of the two  numbers. Set the call-by-reference parameter to the value of the GCD. In main() output the  GCD and whether or not your function returned true or false." How do I do this?
int gcd (int a, int b)
{
    int c;

    if ( b == 0 )
        return a;

    else
        while ( b != 0 )
        {
            c = b;
            b = a % b;
            a = c;
        }

        return a;
}

A: Dude, it could not have been simpler... STFG
Your code is getting close to the example 2, but you have an error in this line
   if ( b == 0 )
        return a;

The checking and returning should be in opposite order
I would try this wiki implementation in pseudo-code:
function gcd(a, b)
    while b ≠ 0
       t := b
       b := a mod t
       a := t
    return a

but you should at least try to google something up man. =)

A: this is the most hardest logic that you are using, there are very easy logics that you can get from blogs, i found this one from
http://www.programmingtunes.com/finding-greatest-common-divisor-of-2-numbers-c/:
//greatest common divisor of 2 numbers in C++
#include <iostream>
using namespace std;
void main()
{
int x = 24;
int y = 18;
int temp = 1 ;
for(int i = 2; i<=y; i++)
{
    if(x%i == 0 && y%i == 0)
    {
    temp = i;
    }

}

cout<<temp<<endl;

}


text:
Q: How to test sangrid localhost - nextjs I try to test my sangrid application. I use this tutorial https://github.com/manuarora700/sendgrid-contact-form
i had problem with message "the string do not match to the pattern" then I change res.json() to res.text() and the following error stop appearing.
It should all work properly but does not. It is showing message "mail is send" but I did not received any, and even of sangrid control panel there is no information.
I do not know what I should do next to repair it.
update:
i change approach. Now I test this guy: https://dev.to/markdrew53/integrating-sendgrid-with-next-js-4f5m
I look inside my consul, and this work good, there is "OK". But I do not see mail on my mail-box, or on dashboard of sandgrid...
update2
I read this tutorial Sendgrid returns 202 but doesn't send email but I get 202status and any mail goes to server bounced, blocked, invalid.. non of them, what's more I have veriefied my domain and email, so no clue what's more.
update3
i test once again where is the error. I use "node pages/mail.js" as a test
MacBook-Air-Konrad:SuperCool konrad$ node pages/mail.js
API key does not start with "SG.".
ResponseError: Unauthorized
    at node_modules/@sendgrid/client/src/classes/client.js:146:29
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  code: 401,
  response: {
    headers: {
      server: 'nginx',
      date: 'Thu, 14 Apr 2022 17:15:29 GMT',
      'content-type': 'application/json',
      'content-length': '116',
      connection: 'close',
      'access-control-allow-origin': 'https://sendgrid.api-docs.io',
      'access-control-allow-methods': 'POST',
      'access-control-allow-headers': 'Authorization, Content-Type, On-behalf-of, x-sg-elas-acl',
      'access-control-max-age': '600',
      'x-no-cors-reason': 'https://sendgrid.com/docs/Classroom/Basics/API/cors.html',
      'strict-transport-security': 'max-age=600; includeSubDomains'
    },
    body: { errors: [Array] }
  }
}

the problem is my all API Keys does not start with SG. so I put to terminal command  from registration key echo 'sandgrid_api_key='SD. ()...' and 3 lines more, press enter and then tried again. It resolved problem api_key, I can send mail.
the last problem is to trigger form to trigger send mail. I still have 202, but it does not trigger the script. I back to first approach, because I have problems to instal typescript to use second one.
pages/api/sendgrid.js
const sgMail = require('@sendgrid/mail')
sgMail.setApiKey(process.env.SENDGRID_API_KEY)

function message (req, res) {
    var message = req.body.message;
    var email = req.body.email;
    var subject = req.body.subject;
    var fullname = req.body.fullname;
}

const msg = {
  to: 'kon@gmail.com', // Change to your recipient
  from: 'ssss@dddd', // Change to your verified sender
  subject: 'tssssest najwyzszego orderu',
  text: 'bla bla bla',
  html: 'and easy ${req.body.email} to do anywhere, ${req.body.subject} even with Node.js',
}

sgMail
  .send(msg)
  .then((response) => {
    console.log(response[0].statusCode)
    console.log(response[0].headers)
  })
  .catch((error) => {
    console.error(error)
  })

and in front-end
import React, { useState } from "react";

export default function Contactform() {

  const [fullname, setFullname] = useState("");
  const [email, setEmail] = useState("");
  const [subject, setSubject] = useState("");
  const [message, setMessage] = useState("");

  //   Form validation
  const [errors, setErrors] = useState({});

  //   Setting button text
  const [buttonText, setButtonText] = useState("Send");

  const [showSuccessMessage, setShowSuccessMessage] = useState(false);
  const [showFailureMessage, setShowFailureMessage] = useState(false);

  const handleValidation = () => {
    let tempErrors = {};
    let isValid = true;

    if (fullname.length <= 0) {
      tempErrors["fullname"] = true;
      isValid = false;
    }
    if (email.length <= 0) {
      tempErrors["email"] = true;
      isValid = false;
    }
    if (subject.length <= 0) {
      tempErrors["subject"] = true;
      isValid = false;
    }
    if (message.length <= 0) {
      tempErrors["message"] = true;
      isValid = false;
    }

    setErrors({ ...tempErrors });
    console.log("errors", errors);
    return isValid;
  };

  //   const [form, setForm] = useState(false);

  const handleSubmit = async (e) => {
    e.preventDefault();

    let isValidForm = handleValidation();

    if (isValidForm) {
      setButtonText("Sending");
      const res = await fetch("pages/api/sendgrid", {
        body: JSON.stringify({
          email: email,
          fullname: fullname,
          subject: subject,
          message: message,
        }),
        headers: {
          "Content-Type": "application/json",
        },
        method: "POST",
      });

      const { error } = await res.text();
      if (error) {
        console.log(error);
        setShowSuccessMessage(false);
        setShowFailureMessage(true);
        setButtonText("Send");

        // Reset form fields
        setFullname("");
        setEmail("");
        setMessage("");
        setSubject("");
        return;
      }
      setShowSuccessMessage(true);
      setShowFailureMessage(false);
      setButtonText("Send");
      // Reset form fields
      setFullname("");
      setEmail("");
      setMessage("");
      setSubject("");
    }
    console.log(fullname, email, subject, message);
  };

  return (
   <>
      <form
          onSubmit={handleSubmit}
          className="rounded-lg shadow-xl flex flex-col px-8 py-8 bg-white dark:bg-blue-500"
        >

            Send a message

            Full name*

          <input
            type="text"
            value={fullname}
            onChange={(e) => {
              setFullname(e.target.value);
            }}
            name="fullname"
            className="bg-transparent border-b py-2 pl-4 focus:outline-none focus:rounded-md focus:ring-1 ring-green-500 font-light text-gray-500"
          />
          {errors?.fullname && (

Fullname cannot be empty.

          )}

            E-mail*

          <input
            type="email"
            name="email"
            value={email}
            onChange={(e) => {
              setEmail(e.target.value);
            }}
            className="bg-transparent border-b py-2 pl-4 focus:outline-none focus:rounded-md focus:ring-1 ring-green-500 font-light text-gray-500"
          />
          {errors?.email && (

Email cannot be empty.

          )}

            Subject*

          <input
            type="text"
            name="subject"
            value={subject}
            onChange={(e) => {
              setSubject(e.target.value);
            }}
            className="bg-transparent border-b py-2 pl-4 focus:outline-none focus:rounded-md focus:ring-1 ring-green-500 font-light text-gray-500"
          />
          {errors?.subject && (

Subject cannot be empty.

          )}

            Message*

          <textarea
            name="message"
            value={message}
            onChange={(e) => {
              setMessage(e.target.value);
            }}
            className="bg-transparent border-b py-2 pl-4 focus:outline-none focus:rounded-md focus:ring-1 ring-green-500 font-light text-gray-500"
          ></textarea>
          {errors?.message && (

Message body cannot be empty.

          )}

            <button
              type="submit"
              className="px-10 mt-8 py-2 bg-[#130F49] text-gray-50 font-light rounded-md text-lg flex flex-row items-center"
            >
              {buttonText}
              <svg
                width="24"
                height="24"
                viewBox="0 0 24 24"
                className="text-cyan-500 ml-2"
                fill="currentColor"
                xmlns="http://www.w3.org/2000/svg"
              >
                <path
                  d="M9.00967 5.12761H11.0097C12.1142 5.12761 13.468 5.89682 14.0335 6.8457L16.5089 11H21.0097C21.562 11 22.0097 11.4477 22.0097 12C22.0097 12.5523 21.562 13 21.0097 13H16.4138L13.9383 17.1543C13.3729 18.1032 12.0191 18.8724 10.9145 18.8724H8.91454L12.4138 13H5.42485L3.99036 15.4529H1.99036L4.00967 12L4.00967 11.967L2.00967 8.54712H4.00967L5.44417 11H12.5089L9.00967 5.12761Z"
                  fill="currentColor"
                />
              </svg>
            </button>

            {showSuccessMessage && (

                Thankyou! Your Message has been delivered.

            )}
            {showFailureMessage && (

                Oops! Something went wrong, please try again.

            )}

        </form>
        </>
  );
}


text:
Q: Need help scoring randomly generated SEC football rankings So my task is to score all the possible rankings of the 14 SEC football teams and find the best one, using who won in head-to-head games as the sole criterion (so not factoring in strength of schedule or homefield advantage yet).
RandomSample[Range[14]] gives me one random ranking of the 14 teams, then I score that ranking by seeing how many wins and losses it actually predicted. For example, if "1" represents Missouri (miss) and "3" represents Georgia (ga), then if the generated ranking has 1 listed before 3, that ranking gets +1 to its ranking score, since Missouri beat Georgia this season.  If 3 is listed before 1, the ranking score receives a -1 to its score, for incorrectly ranking those teams with respect to each other.  And so on for every head-to-head SEC match up from last year.
Once I can correctly score one ranking, I would use Permutations[RandomSample[Range[14]]] and apply the scoring algorithm to all the permutations of a list of 14, and select the list (ranking) with the max ranking score (k).
My main issue right now is comparing the positions of teams in the rankings.  In the code, k is the ranking score and one test for Missouri being listed before Georgia is listed at the bottom, with the output below it.  However {{7}} cannot be compared to {{5}} as in 7 > 5, and that's my problem.
Here's the code:
list1 = RandomSample[Range[14]]

(* Out: {11, 6, 8, 13, 3, 9, 1, 4, 5, 12, 7, 14, 10, 2} *)

miss = Position[list1, 1]];
  sc = Position[list1, 2];
  ga = Position[list1, 3]];
vandy = Position[list1, 4];
fl = Position[list1, 5];
tenn = Position[list1, 6];
kent = Position[list1, 7];
aub = Position[list1, 8];
bama = Position[list1, 9];
lsu = Position[list1, 10];
tam = Position[list1, 11];
missst = Position[list1, 12];
olemiss = Position[list1, 13];
ark = Position[list1, 14];

k = 0;
If[miss > ga, k++, k--]
(* Output:  If[{{7}} > {{5}}, k++, k--] *)

A: Id suggest it will be far more efficient if you do
  rank=Ordering@list1;

then you can access the rank directly, ie
  rank[[1]] -> same as Position[list1,1][[1,1]]

If you really intend to process all 90 billion permutations this i think will make a big difference vs calling Position 14 times.


text:
Q: Localization is not working in Jquery date picker I have calendar functionality in my application.I am referring from http://jqueryui.com/datepicker/. I had seen the "Localize Calendar" example in that web page.But there itself localization is not working.Is it bug or anything i need to do extra.
My Code
$(function () {
    $.datepicker.setDefaults( $.datepicker.regional[ "fr" ] );

        $("#w_datePicker").datepicker({
            showOn: "button",
            buttonImage: "style/images/calendar.gif",
            buttonImageOnly: true,
            altField: '#show_date_on_select',
            altFormat: 'DD, MM d',
            //dateFormat: 'DD, MM d',
            onSelect: function (dateText, inst) {
                //var selDate = FormatDate(dateText);
                //$("#show_date_on_select").html(selDate);
            }
        });

});

A: i guess you need to have a language file for your selected language as well. From here: Datepicker Language File

A: Try this:
$.datepicker.regional['fr'] = {clearText: 'Effacer', clearStatus: '',
    closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
    prevText: '<Préc', prevStatus: 'Voir le mois précédent',
    nextText: 'Suiv>', nextStatus: 'Voir le mois suivant',
    currentText: 'Courant', currentStatus: 'Voir le mois courant',
    monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
    'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
    monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
    'Jul','Aoû','Sep','Oct','Nov','Déc'],
    monthStatus: 'Voir un autre mois', yearStatus: 'Voir un autre année',
    weekHeader: 'Sm', weekStatus: '',
    dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
    dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
    dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
    dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
    dateFormat: 'dd/mm/yy', firstDay: 0,
    initStatus: 'Choisir la date', isRTL: false};
 $.datepicker.setDefaults($.datepicker.regional['fr']);

The link for most of the languages: http://jquery-ui.googlecode.com/svn/tags/1.8.20/ui/i18n/
as Sudhir said in his answer

A: *

*First check there is all required language files are there or not. If you want to download language files for datepicker then you can download from below link: https://github.com/jquery/jquery-ui/tree/master/ui/i18n

*If you put file path into header section and it is not working then please move the script tag from header to body.
Above steps are working for me.


text:
Q: Java Preparedstatement error when reading from MySql Database I'm working on a simple application that pulls data from a local database. The below code works fine when I use a string for the SQL query, but I can not get it to work with PreparedStatement. I have reviewed similar problems posted here but most of those were caused by doing this, preparedStmt.executeQuery(query); instead of this preparedStmt.executeQuery(); Here is the code,
    private final String POSTTITLE=     "posttitle"; // DB Column name
    private final String POSTCONTENT=   "content"; // DB Column name

   public String getDbContent(){
        try{
            String query ="select values(?, ?) from blog";
            PreparedStatement preparedStmt = this.connect.prepareStatement(query);
            preparedStmt.setString (1,POSTTITLE);
            preparedStmt.setString (2,POSTCONTENT);
            ResultSet rs = preparedStmt.executeQuery();
            rs.next();
            return(rs.getString(this.POSTCONTENT)); //Will replace with loop to get all content
        } catch(Exception e) {
           System.err.println("Error Reading database!");
           System.err.println(e);
           return("Error: "+e);
        }
    }

This is the error I get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''posttitle', 'content') from blog' at line 1

A: Parameters in prepared statements are for values - you're trying to use them to select fields. They just don't work that way.
In this very specific instance, you'll need to make the SQL dynamic. However, you'll want to make sure that whatever code you have to allow your columns to be specified is tightly constrained to avoid SQL injection attacks. (For example, you could have an enum with the columns in, or a whitelist of allowed values.)

A: Try concatenating select query:
String query ="select "+POSTTITLE+","+POSTCONTENT+" from blog";

Remember that prepared statements are for values, not query parameters, for them we use simply concatenations.

A: Try this:
String query ="select POSTTITLE, POSTCONTENT from blog";
PreparedStatement preparedStmt = this.connect.prepareStatement(query);
ResultSet rs = preparedStmt.executeQuery();
rs.next();

There is no need to use field names as parameter.


text:
Q: How to get exact value of range slider on mouse drop in jquery I just want to get the exact value of range slider on mouse drop(release).
var rangeslidervalue= $('.ex2').val();

I am using input type text as bootstrap slider.I have got value every time on mouse drag but i want value only on Mouse release not every time because i am hitting Ajax on when slider is drag.I have got the problem when i drag slider Ajax is hitting every time and get ERROR Failed to load resource: net::ERR_CONNECTION_TIMED_OUT
Below is My slider.

My code:
$('sliderclass').change(function() {
  var scrollvalue = $(this).val();
  var dataString = JSON.stringify({
    scroll:scrollvalue
  });
  jQuery.ajax({
    type: "POST",
    data: dataString,
    contentType: "application/json; charset=utf-8",
    url: "ajax url",
    dataType: 'json',
    success: function(data1) {
      console.log(data1);
    }
  });
});

thanks in advance

A: if you are using jquery UI slider than you can get value like this way
$( "#slider" ).slider({
    max: 5,
    value: 2,
    stop: function( event, ui ) {
         alert(ui.value);
    }});

A: usually, there is a stop callback function on slider plugin which will run when you stop dragging the element. Here is the example code of jquery ui slider for reference:
$( "#some_example_slider" ).slider({
    range: true, step: 50, min: 0, max: 450,
    values: [ 0, 450 ],
    stop: function( event, ui ) {
        var v1 = ui.values[0];
        var v2 = ui.values[1];

        $.ajax({
            type: "POST",
            url: "ajax_file.php",
            data: "value1="+v1+"&value2="+v2,
            cache: false,
            success: function(html){
                //do suff
            }
        });
    }
});


text:
Q: LEX: code to read a specific grammar error Very new to lex. This is for project for Prog. Langs. class
Consider a language built over the following grammar:
<program> ::= <statement> | <program> <statement>
<statement> ::= <assignStmt> | <ifStmt> | <whileStmt> | <printStmt>
<assignStmt> ::= <id> = <expr> ;
<ifStmt> ::= if ( <expr> ) then <stmt>
<whileStmt> ::= while ( <expr> ) do <stmt>
<printStmt> ::= print <expr> ;
<expr> ::= <term> | <expr> <addOp> <term>
<term> ::= <factor> | <term> <multOp> <factor>
<factor> ::= <id> | <number> | - <factor> | ( <expr> )
<id> ::= <letter> | <id> <letter>
<letter> ::= a | b | c | d | e | f | g | h | i | j
| k | l | m | n | o | p | r | s | t
| u | v | w | x | y | z
<number> ::= <digit> | <number> <digit>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<addOp> ::= + | -
<multOp> ::= * | / | %

Implement a lex-based C program that scans for all the tokens of the language (keywords, identifiers, numbers, operators, and so on).
My problem is I get "l7t2.l:32: unrecognized rule" error. I believe it stems from the declaration of "word" above but not sure how to fix it.
Heres my lex file,  l7t2.l
%option noyywrap

%{
#include "l7t2.h"
int totDol = 0;
int *outword;
%}

digit [0-9]
number {digit}*

letter  [a-zA-Z]
word    ({letter}{[a-zA-Z0-9]}+)

%%

"if" {return IF;}
"then" {return THEN;}
"while" {return WHILE;}
"do" {return DO;}
"+" {return PLUSOP;}
"-" {return MINUSOP;}
"*" {return MULTOP;}
"/" {return DIVOP;}
"%" {return MODOP;}
";" {return SEMICOLON;}
"=" {return EQUAL;}
"print" {return PRINT;}

[ \t\n]+        ;

{word} {strcpy(outword, yytext);}

\${number}  {totDol = 0; totDol += strtod(yytext+1, NULL); return totDol;}

%%

A: word    ({letter}{[a-zA-Z0-9]}+)

The problem is here. {} is used to introduce prior definitions only. It should be:
word    ({letter}[a-zA-Z0-9]+)

On line 32, surely you should be returning a value from that rule?
NB You can get rid of all the single-special-character rules and have a final cover-all rule:
. return yytext[0];

This also means you can use the special characters directly in the grammar, e.g. '+' instead of PLUSOP. It also saves you from having to handle illegal characters at all in the lexer: the parser does it.


text:
Q: Generalized estimating equations output in SPSS I am hoping to confirm that I have a suitable way to analyse the different proportions of people who are categorized as left lateralised on the one hand, or bilateral/right lateralised on the other in two different tasks.
I cannot use an ordinary logistic regression (or chi square test) as the conditions are repeated measures.
I have used the Generalized Estimating Equations option in SPSS to allow for the within subjects individual intercepts to vary as for repeated measures, but am wondering how best to interpret the output to show that the proportion of those in each category differs between the two tasks.
Is it correct that I need to re-estimate the model but remove condition from my fixed effects and then compare measures of model fit in each estimation for a significant difference (e.g.using the AIC)? Or should I just stick to looking for a significant Wald statistic and leave it at that?
My final question is how to interpret the pairwise comparisons from this type of analysis. This shows a significant difference between my two conditions, but as I understand it to be a log odds value I'm not quite sure where to go with it.
I do apologise if I haven't made my problems clear, I am quite new to this.

A: It is generally understood that likelihood ratio tests have better statistical properties than Wald tests.  (Edited:) However, as @Macro reminds me, the generalized estimating equations are not a form of maximum likelihood estimation, thus likelihood ratio tests are not available.  So you can go ahead with the Wald test that is reported.
It is true that betas are log odds, however, you can exponentiate them and then interpret the result as an odds ratio.  If odds ratios aren't sufficiently intuitive (in my experience, people aren't born with the ability to think in odds ratios, but you can learn to use them), you can solve for two cases that have covariate values that seem typical, or are of interest to you, and that are identical except that in the first case CONDITION=0 and the other CONDITION=1. Exponentiating both will yield the two odds; computing $odds/(odds+1)$ in each case will yield two probabilities.  Remember that these probabilities and their difference hold only for that exact combination of covariate values.  Thus, if you want to know about what happens with a different set of covariate values, you have to go through the process again.
One last point about the interpretation of a model fit by the GEE: this model will describe how the population as a whole behaves, not how an individual within that population will behave.  For example, consider a study that looks at students within a classroom taking (and possibly passing) a test.  When the model is fit with GEE it is telling you about the class, if it had been fit with a GLiMM instead, it would have told you about an individual student conditional on that student's attributes.


text:
Q: Wrapper to unmanaged code How would you build a wrapper to unmanaged code in order to use it in managed code, and when exactly do you have to do that?

A: You don't often need a wrapper, many DLLs with straight-forward exported C functions can be pinvoked with the [DllImport] attribute.  An exception for C exports would be a poorly designed DLL that requires the client code to release memory, that can't be done by the managed code since it doesn't have access to the allocator.
The case where you have to have a wrapper is a native C++ class.  Managed code cannot pinvoke it directly since it doesn't know how to create an instance of the class (which requires knowing the size of the object and calling the constructor) nor how to destroy it (which requires calling the destructor).  It is pretty easy to do in C++/CLI.  Very mechanical, the SWIG project can do it automatically.  Learning that tool is however more of an investment than learning how to write the wrapper.


text:
Q: Strange Behaviour of Garbage Collector on Tomcat we have a really strange behaviour with one of our apps running on a Tomcat 7 (with Java 1.6)
The app runs really good for some days, then we see a peak in the Garbage Collector Time, the CPU Usage is more than 10 times of he normal load and the memory isn't freed anymore:

The last drop was a restart of the app so the performance gets better. as you can see in the graph the space which is freed by the GC gets lower and lower at each run and at the end it isn't going to free any memory, so the performance of the app goes really low.
how can this behaviour be improved?

A: This looks like a memory leak - if the GC can't free the memory any more, it is most probably due to some code retaining references to unused objects.  You should try to track the objects remaining in memory (that graphic tool of yours should have some way to peek into the heap memory regions and give you information on created objects) and make sure you erase any reference to unused objects so the GC can free them.


text:
Q: No implicit conversion of Nil to String Error with Paperclip In my app I've created a view which lists all the PDFs in my S3 Bucket, and for this I am using the Paperclip Gem. However I am now receiving this error in my terminal.
    Error performing Courts::SyncronizeBucketJob (Job ID: 8424356c-9717-4cca-9d76-4b157bab1065) from DelayedJob(default) in 450.5ms: TypeError (no implicit conversion of nil into String):
/Users/conorquarry/RubymineProjects/pair/app/_modules/courts/models/ocr_document.rb:46:in `initialize'
/Users/conorquarry/RubymineProjects/pair/app/_modules/courts/models/ocr_document.rb:46:in `new'
/Users/conorquarry/RubymineProjects/pair/app/_modules/courts/models/ocr_document.rb:46:in `block in <class:OcrDocument>'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/interpolations.rb:35:in `block (2 levels) in interpolate'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/interpolations.rb:35:in `gsub!'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/interpolations.rb:35:in `block in interpolate'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/interpolations.rb:34:in `each'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/interpolations.rb:34:in `interpolate'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/attachment.rb:556:in `interpolate'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/attachment.rb:171:in `path'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/storage/s3.rb:355:in `block in flush_writes'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/storage/s3.rb:352:in `each'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/storage/s3.rb:352:in `flush_writes'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-6.0.0/lib/paperclip/attachment.rb:247:in `save'
/Users/conorquarry/.rvm/gems/ruby-2.5.1/gems/paperclip-meta-3.1.0/lib/paperclip-meta/attachment.rb:13:in `save'

Looking at the Paperclip Interpolation Documentation I can't see my error, does anyone have an idea of where I should start? Below is the code throwing me the error.
   Paperclip.interpolates :document_folder_name do |a, _s|
    Pathname.new(a.instance.object_key).dirname.to_s
  end

A: The error is reproducible by:
Pathname.new(nil)

So in this situation, a.instance.object_key is nil.
From the interpolations doc, a.instance will be the activerecord (or whatever ORM you're using) model that's trying to generate a paperclip path that includes :document_folder_name in it.
I'd guess #object_key is a method defined on your activerecord model and is returning nil.
You can put a pry / debugger or a print statement inside that block to see what the object is, then it should be fairly easy to write a unit spec for that method to ensure it returns the correct string.
In theory calling object_key.to_s would fix the error but would mean that :document_folder_name would interpolate to an empty string when paperclip is calculating the folder path, which may not be desirable.


text:
Q: Does PyIntObject still in python3.x source code? Does PyIntObject still in python3.x source code,or has it been replaced by PyLongObject? I can't find the code as follows:
typedef struct {
    PyObject_HEAD
    long ob_ival;
} PyIntObject;

A: From https://docs.python.org/3.2/howto/cporting.html (long/int Unification):

Python 3 has only one integer type, int(). But it actually corresponds to Python 2's long() type–the int() type used in Python 2 was removed. In the C-API, PyInt_* functions are replaced by their PyLong_* equivalents.

The best course of action here is using the PyInt_* functions aliased to PyLong_* found in intobject.h. The abstract PyNumber_* APIs can also be used in some cases.
Please check also the following discussion:
How does Python manage int and long?


text:
Q: Fixing IndexingError to clean the data I'm trying to identify outliers in each housing type category, but encountering an issue. Whenever I run the code, I receive the following error: "IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match).
grouped = df.groupby('Type')
q1 = grouped["price"].quantile(0.25)
q3 = grouped["price"].quantile(0.75)
iqr = q3 - q1

upper_bound = q3 + (1.5 * iqr)
lower_bound = q1 - (1.5 * iqr)

outliers = df[(df["price"].reset_index(drop=True) > upper_bound[df["Type"]].reset_index(drop=True)) | (df["price"].reset_index(drop=True) < lower_bound[df["Type"].reset_index(drop=True)])]
print(outliers)

When I run this part of the code
(df["price"].reset_index(drop=True) > upper_bound[df["Type"]].reset_index(drop=True)).reset_index(drop = True)

I'm getting boolean Series, but when I put it in the df[] it breaks.

A: Use transform to compute q1/q3, this will maintain the original index:
q1 = grouped["price"].transform(lambda x: x.quantile(0.25))
q3 = grouped["price"].transform(lambda x: x.quantile(0.75))

iqr = q3 - q1

upper_bound = q3 + (1.5 * iqr)
lower_bound = q1 - (1.5 * iqr)

outliers = df[df["price"].gt(upper_bound) | df["price"].lt(lower_bound)]

A: Use Series.map, then reset_index is not necessary:
outliers = df[(df["price"] > df["Type"].map(upper_bound)) |
              (df["price"] < df["Type"].map(lower_bound))]
print(outliers)


text: Q: How to determine the kind of atom of a given mathematical symbol? Is there a way to determine the type of atom assigned by TeX to a given mathematical symbol? For example, I suspect that both \exists and \forall are "type 1" math atoms (namely, operators), but I am thinking "mathematically" in this case.


text:
Q: How to get multiple class to BeautifulSoup? Trying to get torrent links from skidrowreloaded.
On the post detail page we have a div like this, I tried get this div by id but i think id is dynamic so I tried get this div by class but did not work,
<div id="tabs-105235-0-0" aria-labelledby="ui-id-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom" role="tabpanel" aria-hidden="false">

the following code is returning none
source2 = source.find("div", {"class": "ui-tabs-panel ui-widget-content ui-corner-bottom"})

err:
AttributeError: 'NoneType' object has no attribute 'find_all'

full code:
import os
from bs4 import BeautifulSoup
import requests
import webbrowser

clear = lambda: os.system('cls')
clear()
r = requests.get('https://www.skidrowreloaded.com/')
source = BeautifulSoup(r.content,"lxml")
source2 = source.find_all("h2")
games = []
for i in source2:
    games.append(i.a.get("href"))

lastgame = games[0]

r = requests.get(lastgame)
source = BeautifulSoup(r.content,"lxml")
source2 = source.find("div", {"class": "ui-tabs-panel ui-widget-content ui-corner-bottom"})
source3 = source2.find_all("a")
k = 0;
for i in source3:
    if k == 0: #hide steam link.
        k = k + 1
    else:
        if i.get("href") == "https://www.skidrowreloaded.com": #hide null links
            pass
        else: #throwing links to the browser
            print(i.get("href"))
            webbrowser.open(i.get("href"))
        k = k + 1

A: You can use find_all as noted in the BeautifulSoup documentation
import requests
from bs4 import BeautifulSoup
response = requests.get("your URL here")
soup = BeautifulSoup(response.text, 'html.parser')
raw_data = soup.find_all("div", class_="ui-tabs-panel ui-widget-content ui-corner-bottom")
# do something with the data

edit -
looking at the response.text, the div exists, but does not have the class you're looking for, hence it returns empty. You can search by using regex like so
import requests, re
from bs4 import BeautifulSoup
response = requests.get("your URL here")
soup = BeautifulSoup(response.text, 'html.parser')
raw_data = soup.find_all("div", id=re.compile("^tabs"))
for ele in raw_data:
    a_tag = ele.find("a")
    # do something with the a_tag

A: To get all the links try this:
import requests
from bs4 import BeautifulSoup

url = "https://www.skidrowreloaded.com/projection-first-light-goldberg/"
soup = BeautifulSoup(requests.get(url).text, "html.parser").find_all("a", {"target": "_blank"})
skip = 'https://www.skidrowreloaded.com'
print([a['href'] for a in soup if a['href'].startswith('https') and a['href'] != skip])

Output:
['https://store.steampowered.com/app/726490/Projection_First_Light/', 'https://mega.nz/file/geogAATS#-0U0PklF-Q5i5l_SELzYx3klh5FZob9HaD4QKcFH_8M', 'https://uptobox.com/rqnlpcp7yb3v', 'https://1fichier.com/?0syphwpyndpo38af04ky', 'https://yadi.sk/d/KAmlsBmGaI1f2A', 'https://pixeldra.in/u/wmcsjuhv', 'https://dropapk.to/v6r7mjfgxjq6', 'https://gofile.io/?c=FRWL1o', 'https://racaty.net/dkvdyjqvg02e', 'https://bayfiles.com/L0k7Qea2pb', 'https://tusfiles.com/2q00y4huuv15', 'https://megaup.net/2f0pv/Projection.First.Light-GoldBerg.zip', 'https://letsupload.org/88t5', 'https://filesupload.org/0d7771dfef54d055', 'https://dl.bdupload.in/17ykjrifizrb', 'https://clicknupload.co/o0k9dnd3iwoy', 'https://dailyuploads.net/n1jihwjwdmjp', 'https://userscloud.com/nircdd4q1t5w', 'https://rapidgator.net/file/b6b8f5782c7c2bdb534214342b58ef18', 'https://turbobit.net/m308zh1hdpba.html', 'https://hitfile.net/5OhkcqZ', 'https://filerio.in/0wbvn4md4i91', 'https://mirrorace.org/m/1Fiic', 'https://go4up.com/dl/0ee9f4866312b5/Projection.First.Light-GoldBerg.zip', 'https://katfile.com/w74l823vuyw5/Projection.First.Light-GoldBerg.zip.html', 'https://multiup.org/download/3d355ba18d58234c792da7a872ab4998/Projection.First.Light-GoldBerg.zip', 'https://dl1.indishare.in/hs55pkx4ex82']


text:
Q: integral problem $\int \frac{2 \lambda a}{\mathbf{ (e^{at}-1)\lambda \sigma^2+2ae^{-at}}}dt $ Does anybody know how to tackle the below integral? I am analyzing a formula derivation where this appears as the final calculation, but I don't know how to get it solved
$$\int \frac{2 \lambda a}{\mathbf{ (e^{at}-1)\lambda \sigma^2+2ae^{-at}}}dt $$
this should result in
$$\frac{2ab \ \big{[} \ at+log(2a)+log \big{(} \mathbf{(e^{at}-1)\lambda \sigma^2 +2ae^{-at}}\big{)} \ \big{]}}{\sigma^2}$$

A: HINT:
Note that the integral can be written
$$\int \frac{2 \lambda a}{ (e^{at}-1)\lambda \sigma^2+2ae^{-at}}\,dt=\int \frac{2 \lambda a e^{at}}{e^{at} (e^{at}-1)\lambda \sigma^2+2a}\,dt$$
Now, enforce the substitution $x=e^{at}$ with $dx=ae^{at}\,dt$ and evaluate the integral
$$\int \frac{2\lambda}{\lambda \sigma^2x(x-1)+2a}\,dx$$


text:
Q: Parsing HTML a convoluted Table w/ BeautifulSoup I am trying to create a csv file from NOAA data from their http://www.srh.noaa.gov/data/obhistory/PAFA.html.
I tried working with the table tag,but it failed. So I am trying to do it by identifying <tr> on each line.
So this is my code:
#This script should take table context from URL and save new data into a CSV file.
noaa = urllib2.urlopen("http://www.srh.noaa.gov/data/obhistory/PAFA.html").read()
soup = BeautifulSoup(noaa)

#Iterate from lines 7 to 78 and extract the text in each line. I probably would like
#space delimited between each text
#for i in range(7, 78, 1):
 rows = soup.findAll('tr')[i]
 for tr in rows:
    for n in range(0, 15, 1):
       cols = rows.findAll('td')[n]
       for td in cols[n]:
       print td.find(text=true)....(match.group(0), match.group(2), match.group(3), ...
       match.group(15)

At the moment some stuff is working as expected some is not, and the last part I am not sure how to stitch the way I would like it.
Ok so I took what "That1guy " suggested, and tried to extend it to the CSV component.
So:
import urllib2 as urllib
from bs4 import BeautifulSoup
from time import localtime, strftime
import csv
url = 'http://www.srh.noaa.gov/data/obhistory/PAFA.html'
file_pointer = urllib.urlopen(url)
soup = BeautifulSoup(file_pointer)

table = soup('table')[3]
table_rows = table.findAll('tr')
row_count = 0
for table_row in table_rows:
 row_count += 1
 if row_count < 4:
    continue

  date = table_row('td')[0].contents[0]
  time = table_row('td')[1].contents[0]
  wind = table_row('td')[2].contents[0]

  print date, time, wind
  with open("/home/eyalak/Documents/weather/weather.csv", "wb") as f:
   writer = csv.writer(f)
   print date, time, wind
   writer.writerow( ('Title 1', 'Title 2', 'Title 3') )
   writer.writerow(str(time)+str(wind)+str(date)+'\n')
 if row_count == 74:
    print "74"
    break

The printed result is fine, it is the file that is not.
I get:
Title   1,Title 2,Title 3
0,5,:,5,3,C,a,l,m,0,8,"

The problems in the CSV file created are:

*

*The title is broken into the wrong columns;column 2,  has "1,Title" versus "title 2"

*The data is comma delineated in the wrong places

*As The script writes new lines it over writes on the previous one, instead of appending
from the bottom.

Any thoughts?

A: This worked for me:
url = 'http://www.srh.noaa.gov/data/obhistory/PAFA.html'
file_pointer = urllib.urlopen(url)
soup = BeautifulSoup(file_pointer)

table = soup('table')[3]
table_rows = table.findAll('tr')
row_count = 0
for table_row in table_rows:
    row_count += 1
    if row_count < 4:
        continue

    date = table_row('td')[0].contents[0]
    time = table_row('td')[1].contents[0]
    wind = table_row('td')[2].contents[0]

    print date, time, wind

    if row_count == 74:
        break

This code obviously only returns the first 3 cells of each row, but you get the idea. Also, note some empty cells. In these cases, to make sure they're populated (or else probably receive an IndexError), I would check the length of each row before grabbing .contents. ie:
if len(table_row('td')[offset]) > 0:
    variable = table_row('td')[offset].contents[0]

This will ensure the cell is populated and you will avoid IndexErrors


text:
Q: .htaccess redirect not working with query URL I'm trying to make a redirect that goes from http://example.com/profile/{username} to http://example.com/profile?username={username}. I saw this question, but when I tried the solution, it redirected the homepage to:
http://example.com/profile/?user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=index.php

.HTACCESS
RewriteEngine On

RewriteRule ^profile/(.+)/$ profile/?user=$1 [R,L,QSA,NC]

As far as I can tell, this is supposed to redirect requests to the subdirectories of the profile directory to the profile directory. Why isn't this working?
UPDATE:
$_SERVER
Array
(
    [MIBDIRS] => C:/xampp/php/extras/mibs
    [MYSQL_HOME] => \xampp\mysql\bin
    [OPENSSL_CONF] => C:/xampp/apache/bin/openssl.cnf
    [PHP_PEAR_SYSCONF_DIR] => \xampp\php
    [PHPRC] => \xampp\php
    [TMP] => \xampp\tmp
    [HTTP_HOST] => msk.local
    [HTTP_CONNECTION] => keep-alive
    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1
    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
    [HTTP_DNT] => 1
    [HTTP_REFERER] => http://msk.local/profile/?user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=index.php
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.9,la;q=0.8,lb;q=0.7
    [HTTP_COOKIE] => PHPSESSID=4gsjup44pb85q6bsvh5aam2bke
    [PATH] => C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Ruby24-x64\bin;C:\Users\yakai\AppData\Local\Microsoft\WindowsApps;C:\Users\yakai\AppData\Local\atom\bin;C:\Users\yakai\AppData\Roaming\npm
    [SystemRoot] => C:\Windows
    [COMSPEC] => C:\Windows\system32\cmd.exe
    [PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW
    [WINDIR] => C:\Windows
    [SERVER_SIGNATURE] =>
Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1 Server at msk.local Port 80

    [SERVER_SOFTWARE] => Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1
    [SERVER_NAME] => msk.local
    [SERVER_ADDR] => 127.0.0.1
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => 127.0.0.1
    [DOCUMENT_ROOT] => C:/xampp/htdocs/msk
    [REQUEST_SCHEME] => http
    [CONTEXT_PREFIX] =>
    [CONTEXT_DOCUMENT_ROOT] => C:/xampp/htdocs/msk
    [SERVER_ADMIN] => postmaster@localhost
    [SCRIPT_FILENAME] => C:/xampp/htdocs/msk/profile/index.php
    [REMOTE_PORT] => 64756
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=index.php
    [REQUEST_URI] => /profile/?user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=profile/&user=profile&user=index.php
    [SCRIPT_NAME] => /profile/index.php
    [PHP_SELF] => /profile/index.php
    [REQUEST_TIME_FLOAT] => 1520623498.877
    [REQUEST_TIME] => 1520623498
)

It's not showing that it was redirected, so what is going on?

A: You should not be using R flag and your rule should be like this:
Options -MultiViews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^profile/([^/]+)/?$ profile/?user=$1 [L,QSA,NC]

Make sure to clear browser cache or use a new browser for testing.


text:
Q: Filter div Content by data-attribute with Checkbox using JQuery I have a list of cards inside a div with class name .cards-list
and I want to to filter those cards by data-attribute using checkbox
I tried the following jQuery code but it is not working, after checking checkbox all my cards are hidden and not showing again when I uncheck it
HTML

   <input class="cardCheckBox" type="checkbox" value="foo">

   <input class="cardCheckBox" type="checkbox" value="xyz">

card title

card title

card title

jQuery
$(".cardCheckBox").change(function () {
   var value = $(this).val();
   if (this.checked) {
      $(".cards-list.card").filter(function () {
         $(this).toggle($(this).data("category") == value);
      });
   } else {
       $(this).toggle($(this).data("category") == value);
   }
});

A: Explanation in code:

// Cache your elements
const $cards = $("[data-category]");
const $cardsCkb = $(".cardCheckBox");

$cardsCkb.on("change", function() {

  // Create an Array of checked values
  const checkedArr = $cardsCkb.filter(":checked").get().map(el => el.value);

  // Show all and exit if no filter is active
  if (!checkedArr.length) return $cards.removeClass("is-hidden");

  // Finally, use jQuery's .toggleClass() and JS's Array.prototype.includes()
  $cards.each(function() {
    const category = $(this).data("category");
    $(this).toggleClass("is-hidden", !checkedArr.includes(category));
  });

});
.card.is-hidden {
  display: none;
}

  <input class="cardCheckBox" type="checkbox" value="foo"> foo

  <input class="cardCheckBox" type="checkbox" value="xyz"> xyz

foo 1

xyz 1

foo 2

A: You made couple of mistakes.
You need this.checked == true in your if statement. this.checked gives you true and false, you need to specify what are you looking for.
Also no need for filter, you can do filtering in your element selector (witch was also not targeting right):
$(".cards-list  .card[data-category="+value+"]")

if you put .cards-list.card together it means they are next to each other, in your case .card is inside .cards-list.

$(".cardCheckBox").change(function () {
   var value = $(this).val();
   //console.log(value);
   if (this.checked == true) {
   //console.log(true);
      $(".cards-list .card[data-category="+value+"]").hide();
      }else{
      $(".cards-list .card[data-category="+value+"]").show();
      }
});

   <input class="cardCheckBox" type="checkbox" value="foo">

   <input class="cardCheckBox" type="checkbox" value="xyz">

card title foo

card title xyz

card title foo


text:
Q: Dynamic Textfield not Displaying as3 I have instantiated in my .as file:
private var heroLives:int;

heroLives = 3;

then later on in the code I call a function called showHeroLives() which looks like this:
public function showheroLives() {
    heroLivesTxt.text = String(heroLives);
    trace(heroLivesTxt.text);
    trace(heroLives);
}

I just used trace to make sure that heroLivesTxt gets updated with heroLives.  heroLivesTxt is a dynamic textfield on stage.  If I comment out showHeroLives() so it doesn't try to assign a value, the assigned value (within the stage) of heroLivesTxt shows up.  But once I implement showHeroLives() to update the text through code, it disappears, even though it trace shows that I have updated the text.  Please Help!

A: You need to embed the font. You can embed it via the properties panel of the TextField.


text:
Q: How can I add a custom toolbar to the touch keyboard in UWP apps? I'm having an input form with multiple TextBox elements and I would like to add a "Next" button on the touch keyboard that allows the user to advance to the next TextBox.
I've tried experimenting with the CommandBar as BottomAppBar (hide/show it based on touch keyboard visibility) but it doesn't really fit the purpose I think. What's the way to do it?

A: It is not possible to customize software keyboard in UWP app.

I've tried experimenting with the CommandBar as BottomAppBar (hide/show it based on touch keyboard visibility) but it doesn't really fit the purpose I think. What's the way to do it?

I think you've made a good decision to use CommandBar as BottomAppBar, and to hide/show it based on touch keyboard visibility. There is no facility for defining custom keyboard layouts in an application, so a bottom Commandbar is the best choice in this scenario under the current condition.


text:
Q: How should I filter a IReactiveList bound to a grid? my ViewModel has a IReactiveList which is bound to a grid in the View. I now want to filter the data based on user-driven events. My question is what is the best approach for this?
The only way I can see is to create a new ReactiveList instance containing just the filtered data and set it to the ViewModel IReactiveList property each time the filter event changes. I don't like this as I'd be creating new ReactiveList instance on each filter event.
Is there a better way? Obviously I could directly manipulate the View Grid filters in the VM but this would break the MVVM-ness.
Thanks a lot.

A: Since IReactiveList implements INotifyCollectionChanged, can't you just expose a CollectionView from your VM instead and change the filtering on that?
public class MyVM
{
    private readonly IReactiveList data;

    //bind grid to this
    public ListCollectionView DataCollectionView { get; private set; }

    public MyVM(IReactiveList data)
    {
        this.data = data;
        this.DataCollectionView = new ListCollectionView(this.data);
        this.DataCollectionView.Filter = FilterData;
    }

    private bool FilterData(object o)
    {
        //filter your data how ever you want in here.
    }
}

At the point your filter changes, just call this.DataCollectionView.Refresh() and the data will be refiltered.


text:
Q: MPI stacks on MPI_Init (100% cpu usage) I run this code on some machines but the program sticks on MPI_Init and one cpu per node reaches 100% of usage.
This happens when I run on node1, node2 for example. But when I run on node1, node3 the program runs successfully.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <mpi.h>
#include <time.h>

int comm_sz;
int my_rank;

int main(int argc, char **argv) {

  printf("Before init\n");
  MPI_Init(&argc, &argv);
  printf("After init\n");

  MPI_Comm_size(MPI_COMM_WORLD, &comm_sz);
  MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);

  if(my_rank == 0) {
    int proc_id;

    printf("*[%d] Hello world!\n", my_rank);

    for(int i = 0; i < comm_sz - 1; i++){
      MPI_Recv(&proc_id, 1, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
      printf("**[%d] Hello world!\n", proc_id);
    }
  }

  if(my_rank != 0) {
    MPI_Send(&my_rank, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
  }

  MPI_Finalize();
  return 0;
}

And I run the mpi program on cluster with:
mpirun -H node1,node2 -n 2 main

When the programs run on nodes 1,2 the program prints only "Before Init" twice and then sticks on that with one cpu per node to reach 100% of usage.


text:
Q: how do I eliminate linker error mingw32/bin/ld.exe: cannot find -lSDL I am trying to build SDL for use with Eclipse.  I am trying to remove this linker error:
Beginning Compilation
21:15:53 **** Incremental Build of configuration Debug for project CMD ****
Info: Internal Builder is used for build
g++ "-IC:\\MinGW\\include\\SDL2" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\CMD.o" "..\\src\\CMD.cpp"
g++ -o CMD.exe "src\\CMD.o" -lmingw32 -lSDL -lSDL2main -lSDL2

ERROR(s):

c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL
      collect2.exe: error: ld returned 1 exit status
      21:15:54 Build Finished (took 1s.36ms)

The most pertinent SO archive source I researched didn't seem to have an actionable answer for my problem, though it had the exact same problem/error:
title --
producing the same error message:

c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL.

If you click to the authors "solution" for the same error as mine its not clear to me how he solved it.
Any help?

A: Problem solved, SDL2 awesome. Ok:
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lSDL.
Reinstallation of SDL2 avoiding binary conflict between SDL files and SDL2 files
as keltar mentioned resolved the immediate problem, and the problem built with no errors!Fixing what was in the braces unmasked new problem: crashing. I stripped the program to bare bones and concluded the crashing was outside of the code since it was occurring even without code.
To solve the new problem would need to go the SDL2 distribution file (the one copied to MinGW) and copy the SDL2.dll from it [DLL from distributable][1]--- by dragging the file over your debug and/or release folders where the .exe file lives.(.exe + dll -> right?) moving dll to exes. Build/Run the program
it should work!
You should see a Welcome message!
https://www.caveofprogramming.com/c-for-complete-beginners/setting-up-sdl-windows.html


text:
Q: How to look at the Javascript that a page is using? Are you able to see the coding of a Javascript function on a webpage your viewing? Is there a way using Google Chrome DevTools for example?
Specifically, I want to figure out how to code something like this
!Example 1
from this page
http://www.indeed.com/cmp/Bruce-Productions/jobs/Graphic-Designer-0a8d9cff06bf2790
Thanks in advance for any help!

A: Yes there is a way to look at all of a webpages html, Javascript files, and CSS using Chrome.
Open up the page in chrome, right click on the page and select inspect element (or press ctrl+shift+I).
From there you can navigate the different elements on the the page and the structure of the HTML file.
To get at the Javascript and CSS files switch over to  the sources tab and look through the folders on the left to find the file you are looking for.
A word of warning, depending on the site the code that they are using may be minified (most all of the white space removed, and lots of variable names and other things shortened) or otherwise very difficult to read. If you are looking to do something more specific then I would recommend searching for that, or posting a question regarding that problem.

A: If you want to view the Javascript code, you can right-click the page, then select Inspect, then navigate to the javascript line by highlighting or selecting that line with .js extension and then position your pointer in the .js file, right-click & select Reveal in Sources panel.

A: In the browser you do right click to open a menu and select "View Source Code". Then you can read or save that page to analyze the content for any image or script.
But your question is so generic maybe you should try something basic and try to builds thing from there. Otherwise make a more specific question of what you want to do.

A: You can check it by opening the inspector in your browser and selecting the "coverage" menu. Then click on the "type" column until you find the .js files.
It is pretty much it, but you can read more details here: https://developer.chrome.com/docs/devtools/coverage/


text:
Q: Using function on the whole list of XTS objects I'm trying to analyze candlestick formation Marubozu in R. So far I was able to download the different stocks data and find the formation using "Candlesticks" library in one stock data. I would like to automate that process so that I can run the CSPMarubozu function on many stocks at the same time.
My main problem is that I cannot really understand how can I pass the list of data to this function. While trying to do it with for loop (Try 1) I get following error: "Error in CSPMarubozu((names(stocks_list[i])), n = 20, ATRFactor = 0.8,  :
Price series must contain Open, High, Low and Close." I know, that I can't pass the character variable to this function, but I can't find the way to get index names without the "" mark. (ex. "AMZN" and I need just AMZN"
My other try (Try 2) was to do it with lapply() function but the same problem occurs
Here is my code:
#install.packages(candlesticks)
        library(candlesticks)
        library(tidyquant)
        library(quantmod)

    #List of stock codes
    stocks <- c("AAPL","MSFT","GOOG","GOOGL","AMZN","TSLA","FB","ADI","ASML","ADBE","NTES","NFLX","JD","CSCO","AVGO","COST","PEP","CMCSA","PYPL","INTC","QCOM","INTU","TXN","TMUS","HON","AMAT","SBUX","CHTR","ISRG","AMGN","MRNA","ADP","LRCX","MU","TEAM","BKNG","GILD","MDLZ","CSX","PDD","MRVL","WDAY","REGN","KLAC","NXPI","ADSK","MELI","LULU","ILMN","ZM")

    #Timestamp
    start = '2019-01-01'
    end = '2020-01-01'

    #Stocks data download (creates XTS - objects)
    for (i in stocks)
    {
      i <- getSymbols(i, src = "yahoo", from = start, to = end)
    }

    #Stocks data download (creates list of XTS - objects
    stocks_list <- list()
    for (i in stocks){
      stocks_list[[i]] <- getSymbols(i, src = "yahoo", from = start, to = end, auto.assign=FALSE, return.class="xts")
    }

    #Finding Marubozu Candlestick in one stock
    AMZN_marubozu<- CSPMarubozu(AMZN, n=20, ATRFactor=.8, maxuppershadowCL=.017, maxlowershadowCL=.017)

    #Finding Marubozu Candlestick in the whole list of Stocks

      #Try 1
    for (i in names(stocks_list)){
      names(stocks_list[i]) <- CSPMarubozu((names(stocks_list[i])), n=20, ATRFactor=.8, maxuppershadowCL=.017, maxlowershadowCL=.017)
    }

      #Try 2
    DoMaru <- function(name)
    {
      CSPMarubozu(name, n=20, ATRFactor=.8, maxuppershadowCL=.017, maxlowershadowCL=.017)
    }

    apply_Marubozu <- lapply(stocks_list, DoMaru(stocks_list$name))

A: This downloads stocks and then shows three different equivalent ways of processing each stock.  We use dim(...) but that would be replaced with whatever processing is desired. Note that if x is an xts object for a stock having OHLC as well as adjusted close and volume then Op(x), Hi(x), Lo(x), Cl(x), Ad(x) and Vo(x) are the vectors of Open, High, Low, Close, Adjusted Close and Volume.
Although the code below seems preferable getSymbols(stocks); L <- mget(stocks) also works to put the stocks loose into your workspace and then collect them into a list L.
library(quantmod)
stocks <- c("AAPL", "MSFT", "GOOG")
getSymbols(stocks, env = e <- new.env())

# 1. iterate over components of e
out1 <- eapply(e, function(x) { dim(x) })

L <- as.list(e)

# 2. iterate over names
out2 <- Map(function(nm) { x <- L[[nm]]; dim(x) }, names(L))
out2a <- Map(function(nm) { x <- e[[nm]]; dim(x) }, ls(e))

# 3. iterate over components of list L
out3 <- Map(function(x) { dim(x) }, L)

str(out1)
## List of 3
##  $ AAPL: int [1:2] 3764 6
##  $ GOOG: int [1:2] 3764 6
##  $ MSFT: int [1:2] 3764 6

identical(out1, out2)
## [1] TRUE

identical(out1, out2a)
## [1] TRUE

identical(out1, out3)
## [1] TRUE


text:
Q: How to use Apache Logger or Log4J in Coldfusion MX Is there any source available which shows how may I use Logging functions in ColdFusion?
Or is there any Logger available in ColdFusion?

A: I am not sure you can use Log4j but whey don't you try Logbox (http://wiki.coldbox.org/wiki/LogBox.cfm). I had tried with coldbox framework but work without  framework as well.


text:
Q: Adding field to WCF data contract breaks clients? I have a WCF service that returns a class that implements IExtensibleDataObject. I need to add a new field to this class.  I updated the DataContract interface and made the change to the class.  Now when I try to run my client application I get the following error:

Could not load file or assembly
  'xxx.yyyy.zzzz, Version=1.3.9.26111,
  Culture=neutral,
  PublicKeyToken=b09e2f3e9b5894f0' or
  one of its dependencies. The located
  assembly's manifest definition does
  not match the assembly reference.
  (Exception from HRESULT: 0x80131040)

The AssemblyVersion of the WFC class has been changed - does that break client?
EDIT:
There are clients in production that use this service.  I do not want to make them update their service reference and redeploy their clients for this simple change if possible.

A: It depends on how you have set up your data contract.
In WCF, using all the defaults, your service will use the DataContractSerializer (DCS) to serialize your object into XML. The DCS will serialize your fields in order - first the public ones, then the private ones. Within each visibility group, it will order the fields/properties alphabetically by name.
Thus, if you introduce a new public property MiddleName and you already had FirstName and LastName, you would be fine: the old XML would have been
<YourObject>
   ....
   <FirstName>.....</FirstName>
   <LastName>.....</LastName>
</YourObject>

and your new one would just simply add a new property at the end:
<YourObject>
   ....
   <FirstName>.....</FirstName>
   <LastName>.....</LastName>
   <MiddleName>....</MiddleName>
</YourObject>

Such an update "add something at the end" should work just fine, the DCS will just simply ignore additional tags in the XML.
However: had you introduced a property called Gender, that would be stuck between <FirstName> and <LastName> and would thus break the order of the data in your XML and thus would break the data contract - no "old" client will be able to call your new service.
In order to take control of this, you can put specific Order= attributes on your data members in your data contract:
[DataContract]
public class SomeAddress
{
   [DataMember(Order=0)]
   public string FirstName;

   [DataMember(Order=1)]
   public string LastName;
}

Then you could easily add a new property - just add it to the end of the list!
[DataContract]
public class SomeAddress
{
   [DataMember(Order=0)]
   public string FirstName;

   [DataMember(Order=1)]
   public string LastName;

   [DataMember(Order=2)]
   public string Gender;
}

So by using the Order= attribute on your data contracts, you can take control of your XML layout, and you can make simple extensions of existing data contracts non-breaking updates.
For more background and in-depth know-how, you ought to read Serialization in Windows Communication Foundation on MSDN Magazine's web site - highly recommended.

A: From your service reference context menu choose... "Update Service Reference"


text:
Q: Issue while reading a from container how do i put the data in sql table with this issue file Error found when processing 'Csv/Tsv Format Text' source 'xyz_File' with row number 7: found more columns than expected column count: 65.. Activity ID:c310daeb-7c87-4176-95c3-47bab56a9b1b
I have tried with "\u0001" separator and it's providing only a single column.
Like Below.
col1,col2,col3......Col150
It should appear like.
col1,col2,col3......Col150==>>col1 Col2 col3

A: Try defining the schemas in the copy activity.
Also next time you ask try to explain a bit more your case so we can help you in a better way.
Hope this helped!


text:
Q: WP-admin plugin installation via FTP silently fails on shared hosting I have a problem installing plugins on shared hosting.
When I try to install plugins recommended by a theme via the admin interface the process starts, outputs the message 'Unpacking package' twice (loose translation - could be a bit different in english) but the installation process never finishes - regardless if I try bulk install or single install.
The plugin ends up in the wp-content/upgrade folder but doesn't move from there. I tried to set permissions on the wp-content/plugins directory to 755, 766, and even 777 but the problem seems to persist.
Wordpress tries to install plugins via FTP. In my wp-config.php file I tried putting:
define('WP_DEBUG', true); // Does not produce errors on frontend
define('WP_DEBUG_LOG', true); // Does not create a log file with errors
define('WP_MEMORY_LIMIT', '64M');
/**
  Following can be substituted by real values but the few seconds of time saved
  are not worth the vulnerabilty it causes.
  Should NOT be used on shared hosting due to security concerns.
 */
define("FTP_USER", "ftp_username");
define("FTP_PASS", "ftp_passs");

Using define('FS_METHOD', 'direct'); doesn't seem to be a good option here because the files would end up being owned by the server.
There are no errors on fronted the process just never finishes. Any ideas on what be causing this?

A: Well once again I posted too soon and figured out the solution shortly after. What worked for me was adding this to my wp-config.php file:
define('FS_METHOD', 'ftpsockets');

The above line tries to force Wordpress to use the PHP Sockets class when working with the filesystem - updating, installing etc.

For security concerns on shared hosting you should not store your FTP username and password in your wp-config.php file. So REMOVE these lines asap in case you are using them:
define("FTP_USER", "ftp_username"); // Substituted by real values obviously
define("FTP_PASS", "ftp_passs");


text:
Q: SpringMVC ListBox population I have a list box i am populating from the database when i run the UI i am able to see the itemLabel but not the itemsValue the code i see when the page is run is:

            Select Gender
            <select id="genderId" name="genderId">
            <option itemsValue="genderId" value="com.crimetrack.business.Gender@1a81bd5">Select Gender</option><option itemsValue="genderId" value="com.crimetrack.business.Gender@1bb60ad">FEMALE</option><option itemsValue="genderId" value="com.crimetrack.business.Gender@c80e21">MALE</option>
            </select>

I am not getting the values to show correctly but the description shows.
@Controller
................

private GenderManager genderManager;
Map<String, Object> myGender = new HashMap<String, Object>();

.........
 @RequestMapping(value="officer_registration.htm", method = RequestMethod.GET)
    public ModelAndView loadPage(HttpServletRequest request,
            HttpServletResponse response,@ModelAttribute Officers officer, BindingResult result, ModelMap m, Model model) throws Exception {

     try{

myGender.put("genderList", this.genderManager.getGenderList());

            model.addAttribute("gender", myGender);

         return new ModelAndView("officer_registration");

     }catch(Exception e){

        request.setAttribute("error",e.getMessage());
        return new ModelAndView("error_page");
     }
 }

     public void setGenderManager(GenderManager genderManager){

     this.genderManager = genderManager;
 }

jsp

            Select Gender
            <form:select path="genderId">
            <form:options items = "${gender.genderList}" itemsValue="genderId" itemLabel="genderDesc" />
            </form:select>
            <form:errors path="genderId"/>

A: I think you have got the attribute name wrong, should be itemValue not itemsValue
<form:options items = "${gender.genderList}" itemValue="genderId" itemLabel="genderDesc" />


text:
Q: Understanding a step in a proof of $\lim_{n\to\infty}\int_{[0,n]}(1+\frac{x}{n})^ne^{-2x}dx$ Why was this $\int_{[0,n]}(1+\frac{x}{n})^ne^{-2x}dx=\int_{[0,\infty)}(1+\frac{x}{n})^ne^{-2x}\chi_{[0,n]}dx$ written in the proof?
Does this is related to the measurability of the function $g_n(x)$?
I do not see how. Even so I think the answer is 'yes' because the remaining  hypotheses of DCT are mentioned in the proof.
See the hypotheses of the dominated convergence theorem are

*

*A sequence of measurable functions $f_n$

*$g\in L(\mu)$

*$|f_n|\le g$

*$f_n\to f$ pointwise

Calculate $\lim_{n\to\infty}\int_{[0,n]}(1+\frac{x}{n})^ne^{-2x}dx$ .
$\int_{[0,n]}(1+\frac{x}{n})^ne^{-2x}dx=\int_{[0,\infty)}(1+\frac{x}{n})^ne^{-2x}\chi_{[0,n]}dx$ for each $n\in\mathbb{N}$. Let $g_n(x)=(1+\frac{x}{n})^ne^{-2x}\chi_{[0,n]}dx$ for each $n\in\mathbb{N}$ and $x\in[0,\infty) $.Then $g_n(x)\leq e^{-x}$ for each $x\in[0,\infty)$ and $n\in\mathbb{N}$. $\int_{[0,\infty)}e^{-x}dx$ exists. Moreover $g_n(x)$ converges to $g(x)=e^{-x}$ for each $x$. Then by Dominated Convergence theorem $\lim_{n\to\infty}\int_{[0,n]}(1+\frac{x}{n})^ne^{-2x}dx=\int_{[0,\infty)}e^{-x}dx$.


text:
Q: Why is E6 favored over E8 for GUT building? What is the simplest explanation on why is E6 gauge group more favored as a group for Grand unified theory builders, while E8 is not? What about other exceptional groups? Which of them originate from the string theory in the most natural way, and why?

A: Saying that $E_6$ is "favored" over $E_8$ in GUT model building is a big understatement.
There can't be any grand unified theory with an $E_8$ gauge group because $E_8$ has no complex representations, i.e. representations that are inequivalent from their complex conjugates. The existence of complex representations is a necessary condition for the theory to contain chiral fermions, i.e. Dirac fermions whose left-handed components carry different quantum numbers (and interactions) than the right-handed components. One may also say that complex representations are needed for the violation of C, P, and CP.
$E_6$ is the only one among five exceptional groups that has any complex representations. It's related to the fundamental ${\bf 27}$ or antifundamental $\overline{{\bf 27}}$ representation of the group which are interchanged by an outer automorphism of $E_6$, a symmetry that boils down to the ${\mathbb Z}_2$ symmetry of its Dynkin diagram. $E_6$ is the only exceptional Lie group with a nontrivial symmetry of the Dynkin diagram.
All other exceptional Lie groups, namely $G_2, F_4, E_7, E_8$, only have real representations, a fact that can be seen by looking at their real fundamental representations, too. The spectrum of gauge theories using these groups would be inevitably left-right symmetric, and therefore experimentally excluded. Patterns about particles such as "neutrinos have to be left-handed" would be impossible.
Despite the comments above, $E_6$ is a subgroup of $E_8$. So in string theory, it is possible to break $E_8$ (a key group e.g. in heterotic string theory) to $E_6$ by stringy effects, e.g. by nontrivial configurations of the $E_8$ gauge field as a function of the extra (compact) dimensions in $E_8\times E_8$ heterotic string theory. Spontaneous breaking of $E_8$ by field-theoretical methods (Higgs mechanism) is no good because it would only produce real representations of $E_6$ again. In string theory, $E_6$, a viable GUT group, may emerge as a subgroup of $E_8$ (or $E_7$). $G_2$ and $F_4$ are too small to be relevant for GUT model building.
All papers that claim to build viable models of particle physics from an $E_8$ field theory are pseudoscientific gibberish, denying elementary features of the groups in which the known quantum fields transform. In the case of Garrett Lisi's paper, the absence of complex representations is the main point of the paper by Garibaldi and Distler.


text:
Q: android : customized action when home logo in action bar si clicked i changed the logo to an action icon and i want to perform an action when the logo is clicked.
How can i customize the action when the home logo in action bar is clicked?
thank you

A: In onOptionsItemSelected() of your activity, watch for an ID of android.R.id.home -- that will be when the home icon/logo is pressed. You can then perform whatever action makes sense (e.g., move to your app's main screen).


text:
Q: Meteor cordova build - how to deploy to device? I have been reading https://meteor.hackpad.com/Getting-Started-With-Cordova-Z5n6zkVB1xq#:h=Device-Setup and the docs on how to deploy a cordova app are a bit lacking, as to be expected with very new functionality! I execute: meteor build <bundle path> -p <host>:<port> which has built my app, I have a tarball for the server and an /android folder which contains an AndroidManifest.xml and all sorts of other files - I assume I need to compile this into an APK.
Is this correct? Can someone point me in the right direction? Thanks!

A: Inside "bundle path"/android you will find you apks already compiled.