text:
Q: IIS rewrite URL in asp.net goes to into infinity loop I just need to create a rule in my web config file to rewrite all URLs to given into rule
ex:
url/services/presentations-evenementielles to
url/Services/Presentations-Evenementielles
This is all made for SEO purposes to avoid duplicates.
<rule name="ProductionRule2" stopProcessing="true" patternSyntax="ExactMatch" >
                <match url="^/productions/xyz" ignoreCase="true" />
                <action type="Redirect" url="Productions/XYZ" redirectType="Permanent"/>
              </rule>

Above code its gives me infinite loop error.

A: There was some mistakes with your rule
1.You were trying to use "^" in an exact match rule. Please set it to regular expression
2.You are trying to use "/" in match url.  The match url part of domain/productions/xyz is
productions/xyz instead of /production/xyz.
3.You are enabling ignore case when you redirect URL to itself.
So please try to modify the rule like this
<rule name="ProductionRule2" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="^productions/xyz" ignoreCase="false" />
                <action type="Redirect" url="Productions/XYZ" redirectType="Permanent" />
              </rule>

Update:
Please modify the rule like this
<rule name="ProductionRule2" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
                <match url="^Productions/XYZ" ignoreCase="false" negate="true" />
                <action type="Redirect" url="Productions/XYZ" redirectType="Permanent" />
                    <conditions>
                        <add input="{ToLower:{URL}}" pattern="/productions/xyz" />
                    </conditions>
              </rule>

And this is working on my side

Please remember to clean browser cache when you test the rule.And the URL should be prODuctions/Xyz instead of prODuction/Xyz.


text:
Q: Spring MVC selected value in form:selected after form validation error I have a problem with the validation form, the form have a lot of different fields (input text fields, select option, multiple select option...). I have developed all the logical sourcecode about validation form with spring security, but when the validation form fails (for example, a user don't fill anything) and reload the form again all the input text fields are correctly filled but the select option and multiple select options have been deleted and the user must select it again. Why not get filled as the text fields?
This is a piece of my view:

            <form:label path="TechContactName"><spring:message code="label.techcontactname"/>*</form:label>
            <form:input path="TechContactName" />
            <form:errors path="techContactName" cssClass="error" />

            <form:label path="LicenseProduct"><spring:message code="label.licenseproduct"/>*</form:label>
            <form:select path="licenseProduct" id="selectProduct" size="6" >
                        <option >Option 1</option>
                        <option >Option 2</option>
                        <option >Option 3</option>
                        <option >Option 4</option>
                        <option >Option 5</option>
                        <option >Option 6</option>
                </form:select>
            <form:errors path="licenseProduct" cssClass="error" />

            <form:label path="DeployCountries"><spring:message code="label.deploycountries"/>*</form:label>
            <form:select path="deployCountries" id="selectCountries" multiple="multiple" >
                       <option value="AT">Austria</option>
                       <option value="BE">Belgium</option>
                       <option value="DK">Denmark</option>
                       <option value="FI">Finland</option>
                       <option value="FR">France</option>
                       <option value="DE">Germany</option>
                </form:select>
           <form:errors path="deployCountries" cssClass="error" />

And my controller:
@SuppressWarnings("finally")
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    public String addLicense(@Valid @ModelAttribute(value="license")  LicenseEntity license, BindingResult result, ModelMap map, HttpServletRequest request)
    {
        if(result.hasErrors()){
            System.out.println("validation errors size..."+result.getErrorCount());

            return "editLicenseList";
        } else {
            //all works correctly
        }

    }

The form input text field si correctly filled when the validation fails but the form:select and form:select multiple fail and reload the form with any value selected.
Thanks in advance!

A: Try using Spring's <form:option> tag, rather than the HTML's own <option> tag. This will ensure that the option remains selected after validation failure (because Spring will set the selected attribute).
<form:select path="licenseProduct" id="selectProduct" size="6" >
    <form:option value="Option 1"/>
    <form:option value="Option 2"/>
    <form:option value="Option 3"/>
    <form:option value="Option 4"/>
    <form:option value="Option 5"/>
    <form:option value="Option 6"/>
</form:select>

And
<form:select path="deployCountries" id="selectCountries" multiple="multiple" >
    <form:option value="AT" label="Austria"/>
    <form:option value="BE" label="Belgium"/>
    <form:option value="DK" label="Denmark"/>
    <form:option value="FI" label="Finland"/>
    <form:option value="FR" label="France"/>
    <form:option value="DE" label="Germany"/>
</form:select>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Python 3.X accessing results of cursor.callproc I need help understanding the following situation. I want to call a stored mysql procedure and store the output in a variable and then access the content to check if some text is present. I'm new to python and having difficulties understanding how I should do it. I absolutely need to call that procedure rather then do the mysql query show slave status;. But basically the function does that query.
Python 3.3.2+ (default, Feb 28 2014, 00:52:16)
[GCC 4.8.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>> conn = mysql.connector.connect(host = "xxxx", port = xxxx, user = "xxxx", password = "xxxx", database = "xxxx")
>>> cursor = conn.cursor()
>>> cursor.callproc('show_slave_status')
()
>>> for result in cursor.stored_results():
...     print(result.fetchall())
...
[]

If I try to run the query instead of using cursor.callproc, I have the following error:
>>> cursor.execute("call show_slave_status")
Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/mysql/connector/cursor.py", line 508, in execute
    self._handle_result(self._connection.cmd_query(stmt))
  File "/usr/local/lib/python3.3/dist-packages/mysql/connector/connection.py", line 640, in cmd_query
    'Use cmd_query_iter for statements with multiple queries.')
mysql.connector.errors.InterfaceError: Use cmd_query_iter for statements with multiple queries.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.3/dist-packages/mysql/connector/cursor.py", line 512, in execute
    "Use multi=True when executing multiple statements")
mysql.connector.errors.InterfaceError: Use multi=True when executing multiple statements

and if I set multi=True it does not get any better.
here is the function output is I run the query in a mysql console
mysql> call show_slave_status;
+----------------------------------+-------------+-------------+-------------+---------------+------------------+---------------------+------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+
| Slave_IO_State                   | Master_Host | Master_User | Master_Port | Connect_Retry | Master_Log_File  | Read_Master_Log_Pos | Relay_Log_File   | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_Do_DB | Replicate_Ignore_DB | Replicate_Do_Table | Replicate_Ignore_Table | Replicate_Wild_Do_Table | Replicate_Wild_Ignore_Table | Last_Errno | Last_Error | Skip_Counter | Exec_Master_Log_Pos | Relay_Log_Space | Until_Condition | Until_Log_File | Until_Log_Pos | Master_SSL_Allowed | Master_SSL_CA_File | Master_SSL_CA_Path | Master_SSL_Cert | Master_SSL_Cipher | Master_SSL_Key | Seconds_Behind_Master | Master_SSL_Verify_Server_Cert | Last_IO_Errno | Last_IO_Error | Last_SQL_Errno | Last_SQL_Error | Replicate_Ignore_Server_Ids | Master_Server_Id |
+----------------------------------+-------------+-------------+-------------+---------------+------------------+---------------------+------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+
| Waiting for master to send event | localhost   | xxxx        |        xxxx |            60 | mysql-bin.000025 |             5782876 | relay-bin.000075 |       5782979 | mysql-bin.000025      | Yes              | Yes               |                 |                     |                    |                        |                         | xxxx%.%\_NUM\_MEM          |          0 |            |            0 |             5782876 |         5783275 | None            |                |             0 | No                 |                    |                    |                 |                   |                |                     0 | No                            |             0 |               |              0 |                |                             |             xxxx |
+----------------------------------+-------------+-------------+-------------+---------------+------------------+---------------------+------------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+--------------------+------------------------+-------------------------+-----------------------------+------------+------------+--------------+---------------------+-----------------+-----------------+----------------+---------------+--------------------+--------------------+--------------------+-----------------+-------------------+----------------+-----------------------+-------------------------------+---------------+---------------+----------------+----------------+-----------------------------+------------------+
1 row in set (0.10 sec)

and here is the procedure definition
mysql>  SHOW CREATE PROCEDURE show_slave_status\G
*************************** 1. row ***************************
           Procedure: show_slave_status
            sql_mode:
    Create Procedure: CREATE DEFINER=`xxxx`@`localhost` PROCEDURE `show_slave_status`()
BEGIN show slave status; END
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.27 sec)

A: You are doing it correctly using the stored_results() method. It's not necessary (or wise) to use multiple statements. Although we support it, it's better to do one by one.
Seeing that the result is empty, it looks like you are connecting to a master or a MySQL which has simply no slave status.
I have blogged about getting results after calling a procedure. We probably have to document this better.


text:
Q: Insert using Dapper on asp.net core using (IDbConnection dbConnection = openConnection)
{
    string uQuery = "INSERT INTO User (Email, UserName, Password)"
                    + " VALUES(@Email, @UserName, @Password)";
    dbConnection.Open();
    dbConnection.Execute(uQuery, User);
}

I'm getting a sql exception: Incorrect syntax near the keyword 'User'. on the db.Connection.Execute statement.  I get the same error even if I omit the User parameter of the statement.  Am I doing the insert wrong?

A: User is a reserved work in SQL server. Wrap User between brackets as [User] to solve.
Reference Reserved Keywords in SQL Server: https://msdn.microsoft.com/en-us/library/ms189822.aspx
Hope this helps.


text:
Q: the source file is different from when the module was built This is driving me crazy.
I have a rather large project that I am trying to modify.  I noticed earlier that when I typed DbCommand, visual studio did not do any syntax highlighting on it, and I am using using System.Data.Common.
Even though nothing was highlighted, the project seemed to be running fine in my browser. So I decided to run the debugger to see if things were really working as they should be.
Every time the class that didn't do the highlighting is called I get the "the source file is different from when the module was built" message.
I cleaned the solution and rebuilt it several times, deleted tmp files, followed all the directions here Getting "The source file is different from when the module was built.", restarted the web server and still it tells me the source files are different when they clearly are not.
I cannot test any of the code I have written today because of this.

*

*How can the source be different than the binary when I just complied
it?

*Is there any way to knock some sense into visual studio, or am
I just missing something?

A: Follow these steps

*

*Just delete the bin directory from the project where the DLL is generated.

*Re-build the project.

*Remove reference from the project that make reference to the DLL.

*Include again the reference.

*Enjoy.

A: Some things for you to check:
Have you double checked your project references?
Do you have a Visual Studio started web server still running? Check the system tray and look for a page with a cog icon (you may have more than one):

(source: msdn.com)
Right click and close/exit it. You may have more than one. Can you debug your changes now?
Are you running the debug version but have only built the release version (or vice versa)?
Did the compile actually succeed? I know I've clicked through the "there were errors, do you want to continue anyway?" message a couple of times without realising.

A: In addition to these answers I had the same issue while replacing new DLLs with old ones because of the wrong path. If you are still getting this error you may not refer the wrong path for the DLLs. Go to IIS manager and click the website which uses your DLLs. On the right window click Advanced Settings and go to path of the Physical Path folder on File Explorer and be sure that you are using this folder to replace your DLLs.

A: With web services, the problem can be caused by using the Visual Studio "View in Browser" command. This places the service's DLL and PDB files in the bin and obj folders. When stepping into the web service from a client, somehow Visual Studio uses the PDB in the bin (or obj) folder, but it uses the DLL in the project's output build folder. There are a couple workarounds:

*

*Try deleting the DLL and PDB files in the web service bin and obj files.

*Try clicking "View in Browser" in Visual Studio.

If you previously got the source file mismatch error, Visual Studio might have added the filename to a black list. Check your solution properties. Choose "Common Properties -> Debug Source Files" on the left side of the dialog box. If your web service source files appear in the field "Do not look for these source files", delete them.

A: Unload the project that has the file that is causing the error.
Reload the project.
Fixed

A: I was just having this same problem, my projects were all in the same solution so they were using Project to Project references, so as one changed the others should have been updated.  However it was not the case, I tried to build, rebuild, close VS2010, pulled a new copy from our source control.  None of this worked, what I finally ended up trying was right clicking on the project and rebuilding each project individually.  That updated the .dlls and .pdb files so I could debug through.
The issue here is that your dll and or your pdb files are not in sync.

A: I just had this issue.
I tried all the above, but only this worked:

*

*delete the .pdb file for the solution.

*delete the offending .obj files (for the file being reported out of sync)

build the solution.
This fixed the issue for all builds moving forward for me.

A: In Visual Studio 2017 deleting the hidden .vs folder in the resolved this issue for me.

A: I got this issue running a console app where the source that was different was the source that had the entry-point (static void Main). Deleting the bin and obj directories and doing a full rebuild seemed to correct this, but every time I made a code change, it would go out-of-date again.
The reason I found for this was:

*

*I had checked "Only build startup projects and dependencies on Run" (Tools -> Options -> Projects and Solutions -> Build and Run)

*In Configuration Manager, my start-up project didn't have "Build" checked

(For #2 -> accessible via the toolbar under the 'Debug/Release' drop down list.)

A: This is how I fixed the problem in Visual Studio 2010:
1) Change the 'Solutions Configurations' option from "Debug" to "Release"
2) Start debugging
3) Stop debugging and switch the 'Solutions Configurations' option back to "Debug"
This worked for me. Step 3 is optional - it was working fine when I changed it to "Release" but I wanted to change it back.

A: My solution:
I had included an existing project from a different solution in a new solution file.
I did not notice that when the existing project was rebuilt, it was putting the final output into the NEW solution's output directory. I had a linker path defined to look into the OLD solution's output directory.
Switching my project to search in the new solution's output directory fixed this issue for me.

A: I had this problem, and it turns out I was running my console application as a windows application. Switching the output type back to console fixed the issue.

A: I had the same problem. To fix it I used the "Release Mode" to debug in VS2013. Which is sufficient for me, because I'm working in a node js\c++ addon.

A: My problem was that I had two projects in my solution. The second one was a test project used to call the first one. I had picked the path to the references from the bin folder's release folder.
So whenever I made a change to the first project's code and rebuilt it, it would update the dlls in the debug folder but the calling project was pointing to the release folder, giving me the error, "the source file is different from when the module was built."
Once I deleted the reference to the main project's dll in the release folder and set it to the dll in the debug folder, the issue went away.

A: In my case, the @Eliott's answer doesn't work.
To solve this problem I had Exclude/Include From Project my deficient file, andalso Clean and Rebuild the solution.
After these actions, my file with my last modifications and the debugger are restored.
I hope this help.

A: solution:-
 the problem is:-
if your some projects in a solution , refer to some other projects,
then sometimes the dll of some projects, will not update automatically, whenever you build the solution,
some projects will have previous build dlls, not latest dlls
you have to go manually and copy the dll of latest build project into referenced project

A: I was using Visual Studio 2013 and I had an existing project under source control.
I had downloaded a fresh copy from source control to a new directory.
After making changes to the fresh copy, when building I received the error in question.
My solution:
1) Open Documents\IISExpress\config\applicationhost.config
2) Update virtualDirectory node with directory to the fresh copy and save.

A: My problem was that I had a webservice in the project and I changed the build path.
Restoring the default build path solved my issue.

A: I had this same problem and I followed the majority of the guidance in the other answers posted here, nothing seemed to work for me.
I eventually opened IIS and recycled the application pool for my web application. I have IIS version 8.5.9600, I right-clicked my web application, then: Deploy > Recycle > Recycle application pool > OK.
That seems to have fixed it, breakpoints now being hit as expected. I think that doing this along with deleting the bin and obj folders helped my situation.
Good luck!

A: I know this is an old question but I just had the same problem and wanted to post here in case it helps someone else. I got a new computer and the IT dept merged my old computer with the new one. When I set up TFS, I mapped a different local path than what I was previously using, to an additional internal drive. The old path still existed from the merged data on my hard drive so I could still build and run. My IIS paths were also pointing to the old directory. Once I updated IIS to the correct path, I was able to debug just fine. I also deleted the old directory for good measure.

A: I also experienced that. I just open the obj folder on the project and then open the debug folder delete the .pdb file and that's all.

A: This error also happens if you try to make changes to a source file that is not part of the project.
I was debugging a method from a .dll of another one of my projects, where Visual Studio had quite helpfully loaded the source because the .dll had been built on the same machine and it knew the path to the source. Obviously, changing such a file isn't going to do anything unless you rebuild the referenced project.

A: *

*Delete all breakpoints.

*Rebuild.

*Done

A: At Visual Studio 2015, using C++, what fixed for me the the source file is different from when the module was built problem was

*

*restart Visual Studio.

A: Check if the location you pointed to using mex() in Matlab is correct (contains lib and obj files which are modified to the last date you compiled the library in Visual studio).
If this is not the case:
Make sure you are compiling Visual studio in a mode that saves .lib files :

*

*properties -> Config properties -> General -> Config type -> static library

*properties -> Config properties -> General -> Target extension=.lib (instead of exe)
Make sure the output and intermediate directories match the Matlab directory in

*

*properties -> Config properties -> General -> Output directory

*properties -> Config properties -> General -> Intermediate directory

A: I get this issue when debugging sometimes w/ Visual Studio but when the application is served by IIS. (we have to develop in this form for some complicated reasons that have to do with how the original developer setup this project.)
When I change the file and rebuild, that fixes it a lot of the time.  I know that sounds silly, but I was just trying to debug some code to see why it's doing something weird when I haven't changed it in a while, and I tried a dozen things from this page, but it was fixed just by changing the file..

A: In my case, the problem was that the debugger exe path was pointing to a net5.0 bin folder. I am using net6.0, so I should've updated the exe path back when I updated the target framework. Works fine now.

A: Debug-> start without debugging.
This option worked for me. Hope this helps!


text:
Q: How to get the count of the object(data) My Code:
$.post("@(Url.Action("SelectAction", "ControllerName"))", function(data){
    // How to get the count of the data(object)
});

How to get the count of the data(object). I used data.count but is returning as "undefined".

A: If you want to count the no. of properties in an object, you could use:

Object.keys(data).length

Or if you want a cross-browser approach, you'll need to loop through the object itself using:
var count = 0;

for (i in data) {
    if (data.hasOwnProperty(i)) {
        count++;
    }
}

A: Use Object.keys as pointed out in other answers (Object.keys(data).length).
Don't use a temporary fix if you want cross-browser compatibility however. Use a shim. It's simple enough and will just be better for newer browsers. Old browsers will simply use the shim.
Quick shim:
if (!Object.keys) Object.keys = function(o) {
  if (o !== Object(o))
    throw new TypeError('Object.keys called on a non-object');
  var k=[],p;
  for (p in o) if (Object.prototype.hasOwnProperty.call(o,p)) k.push(p);
  return k;
}

Source: http://tokenposts.blogspot.com.au/2012/04/javascript-objectkeys-browser.html


text:
Q: After supervisord crash, how to restart without killing all process? I have an issue where supervisord is crashing due to out of memory conditions. I know what is causing this (other processes consuming too much memory), but it's going to take a little time to fix.  In the meantime, I would like to bring supervisor back up if it crashes.  The problem here seems to be that it will not pick up where it left off and forgets about all the existing processes.  It seems to just attempt to restart all processes instead of recognizing that they were already running.
Is this a problem in my config (pid files not in the right place or something, it seems correct though) or is this just how supervisord works? Are there any workarounds to get the manager process to continue where it left off before it crashed?


text:
Q: twitter PWA doesn't open in native-app like setting I am new to PWA and super excited about this. Sorry, this question is not technical at all, but I wanted to demo a successful PWA in the market to people at my work. And I have saved twitter to my home screen on my iPhone, and when I click it on the home screen to open the PWA, it automatically opens in safari browser..
Can someone please tell me how I can open twiter app in PWA?
To make sure it's not my phone's problem, I saved the below PWA on my phone and this opens as a native app like setting: https://angular2-hn.firebaseapp.com/news/1
Thanks so much and sorry for asking stupid non-technical question here...
I googled everywhere but couldn't find a similar question being asked anywhere.

A: Based from this blog, in order to use PWA, make sure that you have met the specific criteria:

*

*Must be HTTPS (see let's encrypt)

*Valid manifest with required properties (Web Manifest Validator)

*Must have service worker

*Manifest start_url must always load, even offline (using service worker)

*Must supply its own navigation

*Should be responsive to different screen sizes and orientations

Hope this helps.


text: Q: Astana Studio Context Assist with jQueryMobile Running Aptana Studio 3 "AP3" with jQuery.mobile-1.4.5.css in my project subfolder. I typed a opening div tag then Tab, then AS3 put the closing tag, then I moved the cursor to the opening tag after "v" and hit space and the context menu showed up. Is it expected to see a list of jQuery tag properties along with HTML Core properties already show in the context assist output shown in this image? If yes. How can I get it?  Thanks


text:
Q: Boundary condition, mode expansion and partition function of a free fermion CFT on a torus I've been following Ginsparg's notes (http://arxiv.org/abs/hep-th/9108028) and Francesco et al's big yellow book on modular invariance of CFT on a torus, particularly on the $c=1/2$ (free fermion) case.
I thought I understood the derivation of the modular-invariant partition function, but then I realized I did not. For example, in Ginsparg's notes, the computation of the partition function relies on the mode expansion of the free fermion field (let's say antiperiodic case) $$\psi(z)=\sum_{n\in\mathbb{Z}} b_n z^{-n-1/2},$$ where $[L_0, b_{-n}]=nb_n$, and then the partition function is just summing over the $b_{-n}|0\rangle$ states. Taking this, I can follow the rest of his derivation.
However, this mode expansion is for a plane (which can be transformed into a cylinder, but not into a torus) -- it is only anti-periodic (periodic if you drop the $1/2$) in one direction (here angular direction). The above expansion can never satisfy the periodic or anti-periodic boundary condition in the other direction, which in $z$ plane is the radial direction.
So to be specific, when Mr Ginsparg was calculating the Virasoro character for (A,A) sector (note the second A), say in Eq. (7.13 a), what are his eigenbases for $L_0$?

A: First of all, it is not correct to say that the plane can not be transformed into a torus. This is precisely what the trace in equation (7.13a) does. Let me be more precise. When you compute the partition function for the free fermion on the torus, you need to specify two kinds of periodicity.

*

*The first one is the "spatial" periodicity, if you think of the CFT as a worldsheet CFT in string theory. It is the periodicity along the angular direction, if you think on the plane. Depending on this, $L_0$ takes two slightly different forms:

*

*If the fermion is periodic along the angular direction on the plane (this is the Ramond condition), then $$L_0^R = \frac{1}{24} + \sum\limits_{m=1}^{\infty} m b_{-m} b_m$$

*If the fermion is anti-periodic along the angular direction on the plane (this is the Neveu-Schwarz condition), then (here the sum runs over half-integers $r$) $$L_0^{NS} = -\frac{1}{48} + \sum\limits_{r=1/2}^{\infty} r b_{-r} b_r$$

*The second periodicity that you have to choose is the "temporal" periodicity (in the worldsheet point of view), or radial direction on the plane. This is imposed by the way you take the trace, denoted by $\mathrm{tr}_P$ or $\mathrm{tr}_A$ in Ginsparg's notes, and it boils down to adding a $(-1)^F$ for periodic conditions, and nothing for anti-periodic conditions.
Now you can compute, say, the partition function on the torus with anti-periodic conditions in the two directions, as in (7.13a). So you need no $(-1)^F$, and you have to use $L_0^{NS}$. This gives $$\mathrm{tr} \, q^{L_0^{NS}} = q^{-1/48} \prod\limits_{r=1/2}^{\infty} \sum\limits_{N_r \in \{0,1\}} q^{rN_r} = q^{-1/48} \prod\limits_{r=1/2}^{\infty} (1+q^r) = \frac{\theta_3^4}{\eta} \, . $$


text:
Q: How to format Hightcharts charts data in python? I have the following chart:

I would like the data in a csv file, preferably using python, but I am not familiar with JS.
The source of the data is a tool called Helium10, which is a free Chrome extension to get insights into Amazon data. It's totally legal. The charts show number of items sold on a given day. Here's my URL: https://members.helium10.com/black-box
For the first data point for date Jun 11, this is the data:
<path fill="none" class="highcharts-crosshair highcharts-crosshair-thin
undefined" stroke="#cccccc" stroke-width="1" style="pointer-events:none;"
visibility="hidden" d="M 63.5 10 L 63.5 326"></path>

For visible chart this is the data:
<path fill="none" d="M 0 301.99066666666664 C 0 301.99066666666664 96.72
275.6994666666667 161.2 224.14933333333335 C 225.67999999999998 172.5992 257.91999999999996 44.24000000000001 322.4 44.24000000000001 C 386.88
44.24000000000001 419.12000000000006 197.60533333333336 483.6
197.60533333333336 C 548.08 197.60533333333336 580.3199999999999
29.072000000000003 644.8 29.072000000000003 C 709.28 29.072000000000003
741.52 62.04133333333334 806 62.04133333333334 C 870.4799999999999
62.04133333333334 967.2 23.48933333333332 967.2 23.48933333333332"
class="highcharts-graph" stroke="#7cb5ec" stroke-width="2" stroke-
linejoin="round" stroke-linecap="round"></path>

and this right below:
<path fill="none" d="M -10 301.99066666666664 L 0 301.99066666666664 C 0
301.99066666666664 96.72 275.6994666666667 161.2 224.14933333333335 C
225.67999999999998 172.5992 257.91999999999996 44.24000000000001 322.4
44.24000000000001 C 386.88 44.24000000000001 419.12000000000006
197.60533333333336 483.6 197.60533333333336 C 548.08 197.60533333333336
580.3199999999999 29.072000000000003 644.8 29.072000000000003 C 709.28
29.072000000000003 741.52 62.04133333333334 806 62.04133333333334 C
870.4799999999999 62.04133333333334 967.2 23.48933333333332 967.2
23.48933333333332 L 977.2 23.48933333333332" stroke-linejoin="round"
visibility="visible" stroke="rgba(192,192,192,0.0001)" stroke-width="22"
class="highcharts-tracker"></path>

I not sure how these numbers are calculated as data points? And using python, how I could scrape these Highcharts. I've seen multiple examples on SO of others that have done it, but none of their codes are working anymore.
Other examples:
Example 1
Example 2
Let me know if I need to clarify stuff.


text:
Q: Mobx and React. No support for experimental syntax I have problem with Mobx syntax. This is my first project with Mobx.
I've got message: "Support for the experimental syntax 'decorators-legacy' isn't currently enabled"
What shoud I do? How should syntax look? Or syntax is good and I should do this: Syntax error - Support for the experimental syntax 'decorators-legacy' isn't currently enabled
My store:
import React from 'react';
import { observable, action } from 'mobx';

class VehicleStore {
    @observable makeInput = React.createRef();
    @observable modelInput = React.createRef();
    @observable imageInput = React.createRef();
    @observable isSorted = false;
    @observable newId = React.createRef();
    @observable newMake = React.createRef();
    @observable newModel = React.createRef();
    @observable newImage = React.createRef();

    @observable cars = [
        { id: "0", VehicleMake: "Hyundai", VehicleModel: "i30", image:"https://p7.hiclipart.com/preview/240/803/583/hyundai-motor-company-car-hyundai-i30-go-hyundai-tucson-hyundai-i30.jpg" },
        { id: "1", VehicleMake: "Volkswagen", VehicleModel: "Golf (Mk8)", image:"https://cdn.motor1.com/images/mgl/OYNeX/s3/volkswagen-golf-8-2019.jpg" },
        { id: "2", VehicleMake: "Škoda", VehicleModel: "Octavia (Mk4) Combi", image: "https://360view.hum3d.com/zoom/Skoda/Skoda_Octavia_Mk4_combi_2020_1000_0001.jpg" },
        { id: "3", VehicleMake: "BMW", VehicleModel: "M340i xDrive", image: "https://the-drive.imgix.net/https%3A%2F%2Fapi.thedrive.com%2Fwp-content%2Fuploads%2F2018%2F11%2Fp90323745_highres_the-all-new-bmw-3-se-e1542124443158.jpg%3Fquality%3D85?w=1440&auto=compress%2Cformat&ixlib=js-1.4.1&s=4c3c15eb72a86204b03b02a0569d969b" },
        { id: "4", VehicleMake: "Mercedes", VehicleModel: "C63", image: "https://thumbor.forbes.com/thumbor/711x295/https://blogs-images.forbes.com/dougnewcomb/files/2018/05/Exterior.jpg?width=960" },
        { id: "5", VehicleMake: "Citroen", VehicleModel: "C4 Picasso", image: "https://i7.pngguru.com/preview/663/741/68/citroen-c4-picasso-car-citroen-ds-citroen-c4-cactus-citroen.jpg" },
        { id: "6", VehicleMake: "Hyundai", VehicleModel: "Tuscon", image:"https://www.irwinhyundai.com/assets/stock/colormatched_01/white/640/cc_2020hys02_01_640/cc_2020hys020105_01_640_r2u.jpg?height=400" },
        { id: "7", VehicleMake: "Škoda", VehicleModel: "Superb", image: "https://d3h256n3bzippp.cloudfront.net/skoda-superb-iv-white-background.jpg" },
        { id: "8", VehicleMake: "BMW", VehicleModel: "M4", image: "https://www.pngitem.com/pimgs/m/154-1541467_new-2020-bmw-m4-coupe-bmw-m4-2019.png" },
        { id: "9", VehicleMake: "Toyota", VehicleModel: "C-HR", image: "https://cdn-ds.com/blogs-media/sites/232/2019/10/07162921/WhatE28099s-New-for-the-2020-Toyota-C-HR-Design_o.jpg" },
        {id: "10", VehicleMake: "Volkswagen", VehicleModel: "Passat", image: "https://www.greeleyvolkswagen.com/assets/stock/colormatched_01/white/640/cc_2020vwc04_01_640/cc_2020vwc040002_01_640_0q0q.jpg?height=400"},
        {id: "10", VehicleMake: "Volkswagen", VehicleModel: "Tiguan", image: "https://p7.hiclipart.com/preview/98/115/693/2018-volkswagen-tiguan-car-sport-utility-vehicle-volkswagen-eos-2018.jpg"},
        {id: "11", VehicleMake: "Škoda", VehicleModel: "Fabia Estate", image: "https://cdn1.carbuyer.co.uk/sites/carbuyer_d7/files/car_images/skoda-fabia-estate-2018-cutout.jpg"},
        {id: "12", VehicleMake: "Ford", VehicleModel: "Mondeo", image: "https://purepng.com/public/uploads/medium/purepng.com-ford-mondeo-red-carcarvehicletransportford-96152463841846uwj.png"},
        {id: "13", VehicleMake: "Audi", VehicleModel: "A5 Sportback", image: "https://images.dealer.com/ddc/vehicles/2020/Audi/S5/Hatchback/color/Daytona%20Gray%20Pearl%20Effect-6Y6Y-70,72,68-640-en_US.jpg"},
        {id: "14", VehicleMake: "Hyundai", VehicleModel: "i20", image: "https://images.livemint.com/rf/Image-621x414/LiveMint/Period1/2014/10/11/Photos/car--621x414.jpg"},
        {id: "15", VehicleMake: "Audi", VehicleModel: "Q7", image: "https://pictures.dealer.com/aoa-images/42f3217ec5c4c42feeb7fae938ba6396.png"}
    ]

    //Add new car
    @action addCar = ({id, VehicleMake, VehicleModel, image}) => {
    this.cars.push({
        id: ++this.lastId,
        VehicleMake: this.newMake.current.value,
        VehicleModel: this.newModel.current.value,
        image: this.newImage.current.value
    })
}}

const store = new VehicleStore()

export default store

And my index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

import { Provider } from 'mobx-react';
import VehicleStore from './stores/VehicleStore.js';

const Root = (
    <Provider VehicleStore={VehicleStore}>
        <App/>
    </Provider>
)

ReactDOM.render(Root, document.getElementById('root'));
serviceWorker.unregister();

Many thanks for your help.

A: If you are using create-react-app, I believe that decorators are only supported when using typescript.

A: You can run npm run eject this will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you can modify them.
Then, you will need to modify Babel configuration and add babel plugin transform decorators to your babel configuration.
Or you can use alternative syntax for mobx
import { observable,action, decorate } from "mobx"

decorate(VehicleStore,{
   makeInput:observable,
   modelInput:observable,
   addCar:action
   // etc....
)

Check out the mobx documentation
Also, mobx in V6 will most likely drop support for decorators, at least until the spec for them stabilizes.


text:
Q: MapLibreGl, how to use it with specific Tiles? On a personal site, I use leaflet to display a map.
var cartoDb = L.tileLayer('https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png', {
    attribution: '© OpenStreetMap contributors © CARTO',
    subdomains: 'abcd',
    minZoom: 6,
    maxZoom: 13
  });

So with leaflet I can use a cartoDb tile without any problem, without any limitation.
On another site, I used to use Mapbox for their story telling feature (moving the map according to the scroll). As Mapbox is not free beyond a certain limit, I looked for an alternative and found MaplibreGl.
However, when I call my map in the following way, no map is displayed :
  var map = new maplibregl.Map({
      container: 'mapHome',
      style: {
     'version': 8,
     'sources': {
     'raster-tiles': {
     'type': 'raster',
     'tiles': [
       'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png'
      ],
      'tileSize': 256,
      'attribution':
      '© OpenStreetMap contributors © CARTO'
    }
   },
   'layers': [
    {
     'id': 'simple-tiles',
     'type': 'raster',
     'source': 'raster-tiles',
     'minzoom': 0,
     'maxzoom': 16
    }
   ]
  },

My question is how to use the tile
https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png with MaplibreGl?
The problem comes from the shape of the url, but even using another url like : https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png
it doesn't work.
If I go to the cartodb site, I see that it is also paid for beyond a certain limit, but with leaflet I can use it without restriction.
Is there a way to use it for free with MapLibreGl?

With help from @Ziggy's answer, it is now working, see the below example :
<!DOCTYPE html>

<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />

<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />

My only remark is that the visual rendering of the card is not quite the same, the labels on the card are bigger, and if we use the pitch and bearing functions, the labels do not get back into the axis, unlike the version used on leaflet.
A map with leaflet

same map with maplibre

Is this difference normal?
As we see it is much less detailed

A: this is copy paste of my working web map
  let mapConfig = {
      'container': 'map',
      'hash': true,
      'style': {
        'version': 8,
        'sources': {
          'carto-light': {
            'type': 'raster',
            'tiles': [
              "https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png",
              "https://b.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png",
              "https://c.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png",
              "https://d.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png"
            ]
          }
        },
        'layers': [{
          'id': 'carto-light-layer',
          'source': 'carto-light',
          'type': 'raster',
          'minzoom': 0,
          'maxzoom': 22
        }]
      },
      'center': [-73.9021,40.786],
      'zoom': 9,
      'pitch': 20
  };
  map = new maplibregl.Map(mapConfig);

A: Ok finally I got it working as expected, with better rendering. No the map has more details ! I use the code provided in the mapLibreGl example page, but using the url of Ziggy's example
<!DOCTYPE html>

<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />

<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />


text: Q: Internet slow on new computer when connecting through router I have a new Windows 10 computer and find that the internet is very slow on it when connected to our router. I've connected to our Netgear N300 router using both a wireless USB dongle and using the ethernet cable. Both are quite slow. I don't have this speed problem with any of the other devices in the home when they connect to the router (phones, laptop, etc). The new computer doesn't have speed problem when I use my phone as a wireless hotspot either, so it isn't entirely just a problem with the computer. There must be something going on with both the router and computer that doesn't make them very compatible. Any suggestions or is just time for a new router?


text:
Q: Animating several consecutive UILabels at the same speed at the same time to the same point I have 5 consecutive UILabel like this:

They were created with the same frame than the label 1 and then were moved using a CGAffineTransform property. So a CGAffineTransformIdentity will bring them all back on top of label 1.
I would like, when I press a button, to move them all back to the label 1, at the same speed and once they reach their destination, remove them from their superview.
So far I've done like the following but it doesn't work:
var reversedLabels = getLabels().reverse()
let duration: NSTimeInterval = 5
UIView.animateWithDuration(duration, animations: {
    for (index, label) in enumerate(reversedLabels) {
        let relativeDuration: NSTimeInterval = duration * Double(index) / Double(reversedLabels.count)

        UIView.animateWithDuration(relativeDuration, animations: {
            label.transform = CGAffineTransformIdentity
            }, completion: { finished in
                label.hidden = true
        })
    }
    }, completion: { finished in
        for (index, label) in enumerate(reversedLabels) {
            label.removeFromSuperview()
        }
})

The completion of the main animation gets called before the completions of the nested animations. Then I guess it's not the way to do it.
How would you do it? (and why the "final" completion isn't called at the very end?)

A: Since you are not animating any animatable property of any view inside first animation block, the completion block will get executed immediately after animation start. What I cant understand is why do you need that block at all. In completion of inner animations you are hiding your labels, which is the same UI behaviour as removing them from superview, so maybe this block of code (without outer animation) might bring to you the desired result
for (index, label) in enumerate(reversedLabels) {

    let relativeDuration: NSTimeInterval = duration * Double(index) / Double(reversedLabels.count)

    UIView.animateWithDuration(relativeDuration, delay: 0.0, options: UIViewAnimationOptions.CurveLinear, animations: {

            label.transform = CGAffineTransformIdentity

            }, completion: {finished in
            label.removeFromSuperview()=
        })
}

EDITED : relativeDuration should be calculating by adding +1 to index otherwise first animation will have 0 duration. Also to achieve same speed for all animations you should use UIViewAnimationOptions.CurveLinear


text:
Q: -lclsntsh not found in c++ connection with oracle programm i've centos 6.4 as server and centos7.5 as client both in VM. I  am trying to connect
oracle 11gr2 with c++ using codeblocks. following  is code
 #include <iostream>
  #include <oracle/11.2/client64/occi.h>
   #include <iomanip>
   using namespace oracle::occi;
   using namespace std;
   int main()
   {
       const string user="rahul", passwd = "rahul", connstring = "orcl";
       Environment *env =  Environment::createEnvironment();
       Connection *conn = env->createConnection(user, passwd, connstring);
       string strstmt = "select *from emp";
       Statement *stmt = conn->createStatement(strstmt);
       ResultSet *rs = stmt->executeQuery();
       while(rs->next())
       {
           cout <<  setw(4) << rs->getInt(1)  <<"  "<< setw(6) << rs->getString(2) << "  "
                 << setw(7) << rs->getString(3)<<"  "<<setw(4)<< rs->getInt(4) << setw(9)<<"     "
                < rs->getString(5)<< "  "<< setw(4) << rs->getInt(6) << "  " << setw(4)<< rs->
    tInt(7)<<"  "
                << setw(5) << rs->getInt(8)<<endl;
       }
       stmt->closeResultSet(rs);
       conn->terminateStatement(stmt);
       env->terminateConnection(conn);
       Environment::terminateEnvironment(env);
       return 0;
   }

is shows following  errors :-
    -------------- Build: Debug in oraconn (compiler: GNU GCC
    Compiler)---------------

    g++ -L/opt/oracle/instantclient_11_2 -L/opt/oracle
    /instantclient_11_2 -o bin/Debug/oraconn obj/Debug/main.o
    -lnnz11   -locci -lclntsh
    /usr/bin/ld: cannot find -lclntsh
    collect2: error: ld returned 1 exit status
    Process terminated with status 1 (0 minute(s), 0 second(s))
    2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

i added these libs in project->build options -> linker settings. and in search directories  i added following
    usr/include/oracle/11.2/client64
    opt/oracle/instantclient_11_2/sdk/include

also i added LD_LIBRARY_PATH env variables as :
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:/usr/local/lib:/usr/lib:/usr/local/lib6
:/usr/lib64:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=$PATH:/opt/oracle/instantclient_11_2; export PATH
TNS_ADMIN=/opt/oracle/instantclient_11_2/network/admin; export TNS_ADMIN
CLASSPATH=/opt/oracle/instantclient_11_2:/usr/lib/oracle/11.2/client64/lib:
$CLASSPATH; export CLASSPATH
ORACLE_HOME=/opt/oracle/instantclient_11_2; export ORACLE_HOME
INCLUDEPATH=/opt/oracle/instantclient_11_2/sdk/inclcue:$INCLUDEPATH; export
INCLUDEPATH


text:
Q: Excel pivot table recursive hierarchy This is my input data (sample)

Excel pivot table currently gives me this

However I want an output like this

Can pivot table be configured to give that output?
Or is there any other tool I can use to get it?
I want to get this done without any coding.

A: If you can arrange your data like this (staggered, level by level):

Lastly fill up like this:

Then a PIVOT can help (levels go right to left into rows):

Not sure who to get rid of the blanks though... maybe ="" or fill to the left (copy cell to the right if blank into all blanks to the left e.g. bottom row would be e e e d)


text:
Q: Change height of Preference items I have a PreferenceFragment subclass. I want each one of its items (Preferences and SwitchPreferences) to have a height of 120dp. How to do that?
Here is the related code:
public class SettingsFragment extends PreferenceFragment {
        public SettingsFragment() {}
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.main);
        }
}

and
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <SwitchPreference android:key="app_main_switch"
                      android:title="@string/app_name"
                      android:defaultValue="true"/>
    <Preference android:title="@string/events_lowercase"
                android:dependency="app_main_switch">
        <intent android:targetPackage="hu.ppke.itk.marma.android.bead"
                android:targetClass="hu.ppke.itk.marma.android.bead.EventList"/>
    </Preference>
    <Preference android:title="@string/filters_lowercase"
                android:dependency="app_main_switch">
        <intent android:targetPackage="hu.ppke.itk.marma.android.bead"
                android:targetClass="hu.ppke.itk.marma.android.bead.FilterList"/>
    </Preference>
    <SwitchPreference android:dependency="app_main_switch"
                      android:key="learn_switch"
                      android:defaultValue="false"
                      android:title="@string/learning"/>
</PreferenceScreen>

Here is how it looks like now:

So I want all four items of the list to have a height of 120dp. As you can see I'm not the one creating the ListView, it's created internally. I tried to retrieve it with
findViewById(android.R.id.list)

but iterating over its elements gives Preference objects which do not allow me to set the height.

A: Just do it this way:
<!-- Application theme -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
    <!-- Min item height -->
    <item name="android:listPreferredItemHeight">10dp</item>
</style>

another styling attributes that can be overridden can be found here preference item layout

A: Try creating a custom Preference class (you may have to do it for every type of Preference you are going to use/want height to be 120DP)
public class SwitchPref extends SwitchPreference {

Context context;

public Pref(Context context) {
    super(context);

    this.context = context;
}

@Override
protected View onCreateView(ViewGroup parent) {

    LinearLayout layout = new LinearLayout(getContext());

    LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT, dpToPx(120));

    layout.setLayoutParams(params1);

       //if this returns just the linearlayout, you will have to add your own switch
       // or reference to a layout.xml resource

    return super.onCreateView(layout);

}

public int dpToPx(int dp) {
    int valueInDp = (int) TypedValue.applyDimension(
            TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources()
                    .getDisplayMetrics());
    return valueInDp;
}

}

Then, in your preference.xml:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <!--use your custom SwitchPrefence class-->
    <my.package.name.SwitchPref android:key="app_main_switch"
                  android:title="@string/app_name"
                  android:defaultValue="true"/>
    <Preference android:title="@string/events_lowercase"
            android:dependency="app_main_switch">
        <intent android:targetPackage="hu.ppke.itk.marma.android.bead"
            android:targetClass="hu.ppke.itk.marma.android.bead.EventList"/>
    </Preference>
    <Preference android:title="@string/filters_lowercase"
            android:dependency="app_main_switch">
        <intent android:targetPackage="hu.ppke.itk.marma.android.bead"
            android:targetClass="hu.ppke.itk.marma.android.bead.FilterList"/>
    </Preference>
    <my.package.name.SwitchPref android:dependency="app_main_switch"
                  android:key="learn_switch"
                  android:defaultValue="false"
                  android:title="@string/learning"/>
</PreferenceScreen>

Hope this helps, happy coding!

A: Here is how I managed to do this:
I did need to subclass Preference but MattMatt's answer didn't work.
public class HigherPreference extends Preference {
    public HigherPreference(Context context) {
        super(context);
    }
    public HigherPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    @Override
    protected View onCreateView(ViewGroup parent) {
        Resources res=getContext().getResources();
        View v=super.onCreateView(parent);
        v.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, res.getDimensionPixelSize(R.dimen.rowheight)));
        return v;
    }
}

The layout XML goes like what he provided.


text:
Q: How to add a new jar file as a dependency to POM.xml of Java Maven web project? I want to connect to a Lotus Notes (8.5.3) database from my java web (Maven) project. after some searches, so in order to connect to Lotus Notes database from my java web project through CORBA DIIOP,
I need to add NCSO.jar as a new dependency to my Maven Java web project. I found this link: How to add\install to maven dependency of newly created\third party jar in pom.xml, but I still cannot figure out how to make it work. I can find NCSO.jar from my local machine, but based on that link, I need to create my own repository for  this file and then add it to my pom.xml file.
This is my first time to add a .jar dependency to my java web project (pom.xml). In my java web project, I have EJB part hand Web part, and each has pom.xml. No sure how to add this .jar to pom.xml.
 my java IDE is built on eclipse, the current workspace structure is like this: The current workspace called: developer, it contains followings:
 developer
    workspaces (folder)
      Java-2014prj (folder)
         .settings (folder)
         projEAR (folder)
         projEJB (folder)
         projWeb (folder)
         src (folder)
         .project
         pom.xml

is this the correct commands? and if this is correct and no errors, what should I do after the command executed? are all POM.xml added the NCSO.jar?
c:\developer>mvn install:install-file
Dfile=c:\NCSO.jar
DgroupId=lotus
DartifactId=domino
Dversion=1.0.0
Dpackaging=.jar
DgeneratePom=true

projEAR, projEJB and projWeb each contains pom.xml as well.
the NCSO.jar is located on my local c:/NCSO.jar.
So I guess I should run the codes on my window command (black) screen. Should I run it on the project top folder c:\developer? or some subfolders?
I do not know how to create my local repository?
Can someone provide me with more details? Thanks.

Edit - the my result based on axiopisty's instructions below
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] PARENT project of MARKETPROJ
[INFO] EJB project of MARKETPROJ
[INFO] WAR project of MARKETPROJ
[INFO] EAR project of MARKETPROJ
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 o
r one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or
one of its dependencies could not be resolved: Failed to read artifact descripto
r for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-site-plugin/3.3/maven-site-plugin-3.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one
of its dependencies could not be resolved: Failed to read artifact descriptor fo
r org.apache.maven.plugins:maven-site-plugin:jar:3.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or
one of its dependencies could not be resolved: Failed to read artifact descripto
r for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plu
gin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read
artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-b
eta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin
:2.8 or one of its dependencies could not be resolved: Failed to read artifact d
escriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3
.2 or one of its dependencies could not be resolved: Failed to read artifact des
criptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metada
ta.xml
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm
l from/to central (https://repo.maven.apache.org/maven2): Failed to transfer fil
e: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.
xml. Return code is: 501 , ReasonPhrase:Not Implemented.
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/
to central (https://repo.maven.apache.org/maven2): Failed to transfer file: http
s://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml. Return co
de is: 501 , ReasonPhrase:Not Implemented.
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h
ttps://repo.maven.apache.org/maven2 was cached in the local repository, resoluti
on will not be reattempted until the update interval of central has elapsed or u
pdates are forced. Original error: Could not transfer metadata org.apache.maven.
plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2
): Failed to transfer file: https://repo.maven.apache.org/maven2/org/apache/mave
n/plugins/maven-metadata.xml. Return code is: 501 , ReasonPhrase:Not Implemented
.
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://
repo.maven.apache.org/maven2 was cached in the local repository, resolution will
 not be reattempted until the update interval of central has elapsed or updates
are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-
metadata.xml from/to central (https://repo.maven.apache.org/maven2): Failed to t
ransfer file: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metad
ata.xml. Return code is: 501 , ReasonPhrase:Not Implemented.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] PARENT project of MARKETPROJ ............................. SKIPPED
[INFO] EJB project of MARKETPROJ ................................ SKIPPED
[INFO] WAR project of MARKETPROJ ................................ SKIPPED
[INFO] EAR project of MARKETPROJ ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.624 s
[INFO] Finished at: 2015-01-18T13:30:32-05:00
[INFO] Final Memory: 9M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'deploy' in the current project and in the pl
ugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the rep
ositories [local (C:\Users\jsmith\.m2\repository), central (https://repo.maven.apa
che.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException

********************************
**EDIT again:**
 I just checked my pom.xml again, and found we have these codes
  <!-- local file-based repository on the team's shared drive -->
    <repository>
        <id>MARKETPROJ-repo-local</id>
        <name>MARKETPROJ File Based Internal Repository</name>
        <url>file://\\mark\mark_shrdata\MARKETPROJ\maven2\repo</url>
    </repository>

A: If your dependency is not available in a public repository, you'll need to install the dependency into a local maven repository. You might be tempted to install it into your ~/.m2/repository, this is the approach the other answers to this question have stated. If you do, the build will work fine for you, on that machine. But this is not the best solution. In fact, it is a bad solution because the project build is dependent on this manually installed artifact. If you delete the ~/.m2/repository directory your build will fail because the artifact won't be in the repository anymore.
If you have to install a dependency locally, it is best to install it into a project local repository, and commit the whole repository into your version control system. That way, if you share your project with anyone else, including yourself on a different machine, the build will still work for other people and they won't have to install the dependency locally too.
See here for a detailed explanation: https://devcenter.heroku.com/articles/local-maven-dependencies
For example if your project looks like this:
yourproject
+- pom.xml
+- src

Then you could create a project local repository like this:
yourproject
+- pom.xml
+- src
+- repo

And then install the dependency into the project local repository with this command:
mvn deploy:deploy-file -Durl=file:///path/to/yourproject/repo/ -Dfile=NCSO.jar -DgroupId=ncso -DartifactId=ncso -Dpackaging=jar -Dversion=1.0

So your project will now look like this:
yourproject
+- pom.xml
+- src
+- repo
   +- nsco
      +- ncso
         +- maven-metadata.xml
         +- ...
         +- 1.0
            +- ncso-1.0.jar
            +- ncso-1.0.pom
            +- ...

Then tell your project pom.xml file about your project local repository:
<repositories>
    <!--other repositories if any-->
    <repository>
        <id>project.local</id>
        <name>project</name>
        <url>file:${project.basedir}/repo</url>
    </repository>
</repositories>

And add your project local dependency to pom.xml too:
<dependency>
    <groupId>ncso</groupId>
    <artifactId>ncso</artifactId>
    <version>1.0</version>
</dependency>

EDIT - based on questions in the comments.
Assuming you have temporarily stored the dependency that needs to be deployed into your project local maven repository in the root of the C: drive, and that your project is also stored at the root of the C: drive, so your C: drive looks like this:
C:/NCSO.JAR
C:/yourproject
C:/yourproject/pom.xml
C:/yourproject/src
C:/yourproject/repo

Also assuming that you run the following command in a Command Prompt from within the root of the C: drive, then this would be the command you would use to install the dependency into your project local repository:
C:\> mvn deploy:deploy-file -Durl=file:///C:/yourproject/repo/ -Dfile=NCSO.jar -DgroupId=ncso -DartifactId=ncso -Dpackaging=jar -Dversion=1.0

After you have run this command successfully, you can then delete the file C:/NCSO.jar. It is no longer needed because it has been installed (duplicated) into your project local repository. At this point, you would also add C:/yourproject/repo, and all of its data, into your version control system so the repo folder and all of the data inside of it becomes a permanent part of your project.

A: Using the cmd prompt or terminal, you mvn install the jar as your link suggested so that it'll be created in your .m2 repository and then just add as follow to your pom.xml
In cmd prompt or terimal:
mvn install:install-file -Dfile="path-to-jar-file" -DgroupId=com.project.ncso -DartifactId=ncso -Dversion=1.0.0 -Dpackaging=jar
In your pom.xml inside the project directory add the following:
<dependency>
        <groupId>com.project.ncso</groupId>
        <artifactId>ncso</artifactId>
        <version>1.0.0</version>
    </dependency>


text:
Q: How to remove System Tools virus? My Windows XP netbook is infected with System Tools Virus? Does anyone know how to remove this virus?

A: Note that with any serious system infection, you can not guarantee that the malware can be fully removed. That being said, you might be better off just backing up your important data and performing a complete system reinstall.
Anyway, if you haven't done so already, install an up to date anti virus software like Microsoft Security Essentials, AVG, Avast, etc. Do a complete system scan and see what you can remove.
You could also try to manually remove the malware. Below is something from a Symantec forum. But be aware of the possibility that this will probably not work perfectly on a running infected system.
Stop These System Tool 2011 Processes:
5648541024.exe
System Tool 2011.exe

Find and Delete These System Tool 2011 Files:
%AppData%\[random]\
%AppData%\5648541024
%AppData%\5648541024\5648541024.bat
%AppData%\5648541024\5648541024.cfg
%AppData%\5648541024\5648541024.exe
%UserProfile%\Desktop\System Tool 2011.lnk
%UserProfile%\Start Menu\Programs\System Tool 2011.lnk

Remove These System Tool 2011 Registry Values:
HKEY_CURRENT_USER\Software\System Tool 2011
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run "5648541024?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run "[random]"

A: I successfully removed this using BitDefender Rescue CD
A users guide can be found here, make sure you are connected to the internet to download the newest definitions.


text:
Q: Using interpolate on pandas data frame and getting "no axis named 1" error I am looking to interpolate total revenue values in a data frame using the interpolate function.
I've tried changing the arguments I have provided to interpolate, like the following:
useducation_df["TOTAL_REVENUE"].interpolate('linear',1)
useducation_df["TOTAL_REVENUE"].interpolate('linear',0)
useducation_df["TOTAL_REVENUE"].interpolate('nearest',1)
useducation_df["TOTAL_REVENUE"].interpolate('nearest',0)

My code is below:
for i in range(0, len(useducation_df["TOTAL_REVENUE"])):
    if useducation_df["TOTAL_REVENUE"][i] == 0 or np.isnan(useducation_df["TOTAL_REVENUE"][i]):
        print("success 2")
        useducation_df["TOTAL_REVENUE"][i] = useducation_df["TOTAL_REVENUE"].interpolate('nearest',1)
print(useducation_df["TOTAL_REVENUE"])

I get the following error:
ValueError: No axis named 1 for object type

A: pandas.DataFrame.interpolate() is used to fill the missing values in a Series or Dataframe object. The documentation is here.
A Series object does not have an axis attribute, hence the error.
Remove the [axis =] 1 (second positional argument) in .interpolate()


text:
Q: Javascript to refresh multiple windows after window.open has run I have a number of url's for quick testing a REST API that I am running using window.open. to launch each call in a separate window. Each window has a 1 second delay before it opens.
However as there is some intermittent latency on the servers I need to refresh the windows after they have run.
I have tried to figure out how to use I tried using both: window.location.reload(true); and setTimeout(refresh, 5000);
But I'm not sure how to get the refresh to work on each window as per below.
This is what I am currently running:
setTimeout(function() {
    myWindow1 = window.open('http://xxx','mywindow1','width=200,height=200');
}, 0000);

setTimeout(function() {
    myWindow2 = window.open('http://xxx','mywindow2','width=200,height=200');
}, 0000);

setTimeout(function() {
    myWindow3 = window.open('http://xxx','mywindow3','width=200,height=200');
}, 0000);

A: Because they're cross-origin, you probably can't refresh them.
If you can in your environment, this is how:
myWindow1.reload(true);

...at the time you want it to happen (which is obviously after your timer callback has run and opened the window, so myWindow1 has a value). For instance, if you want to refresh it 20 seconds after you opened it:
setTimeout(function() {
    myWindow1 = window.open('http://xxx','mywindow1','width=200,height=200');
    setTimeout(function() {
        myWindow1.reload(true);
    }, 20000);
}, 0000);


text:
Q: How to iterate through specified div's non-direct input children I have multiple rows (DIVs), each with multiple child DIVs, each with a single INPUT.  Each row also has a button that calls the code listed below.
The calling code is correct as the first alert() pops up.
I've tried both the initial $('input... , the following (function () {... and the following line $("'#" + dest..., but neither work.  There is no subsequent alert(), which I'm expecting to iterate through each INPUT under the given main DIV.
function fnFinanceBudgetEditRecord(destDiv) {
  alert("fnFinanceBudgetEditRecord [" + destDiv + "]");

  $('input', $("'#" + destDiv + "'")).each(function () {
  //$('#' + destDiv + ' input').each(function () {
  //$("'#" + destDiv + "'").find('input').each(function () {
    alert(this.value); // "this" is the current element in the loop
  });

}

EDIT: On a hunch, I've changed my existing naming scheme from BDGT_Description_[e59c6468-049f-11e9-9de4-d050996c3d53]_Field to BDGT_Description_e59c6468-049f-11e9-9de4-d050996c3d53_Field and code that wasn't working now is.  So I'm going to rename all my IDs to exclude the square brackets.
Where am I going wrong?  Note, all elements are unique.

A: If you give the inputs a same class, you can get their values by using document.querySelectorAll(). Like so:
HTML
<div id="destDiv">
   <input class="destDivInput" type="text" />
   <input class="destDivInput" type="text" />
   <input class="destDivInput" type="text" />
</div>

JS
function fnFinanceBudgetEditRecord(destDiv) {
   var inputs = document.querySelectorAll('#' + destDiv + ' .destDivClass');
   inputs.forEach(function (input) {
      console.log(input.value);
      //
   });
}


text:
Q: Why is EMR Spark SQL's date_trunc function automatically casting timestamp to string? I'm running a Spark SQL query on an EMR instance and it seems like the date_trunc function is converting a timestamp variable to string, which then results in NaN values. Below is my query and the output data
SELECT
  date_trunc(start_time, 'HOUR'),
  item,
  count(*) as item_count
FROM schema.table
GROUP BY 1,2

date_trunc(CAST(start_time AS STRING), CAST(HOUR AS TIMESTAMP))| item | item_count
-------------------------------------------------------------------------------------
   NaN                                                         | A125 |  5
   NaN                                                         | BA85 |  2
   NaN                                                         | A81C |  6

Is there a way to avoid this? I've tried changing start_time to cast(start_time as timestamp) inside the date_trunc function, but this doesn't fix it.


text:
Q: Sentence Structure Nice to chatting with you is it correct ladies and gentlemen!
I would like to ask about a sentence if it is correct or not.
Is Nice to chatting with you right? Does it have a grammatical error?

A: Yes, it is ungrammatical. It should be either

It is nice chatting with you

or

It is nice to chat with you


text:
Q: QSqlQuery prepared statements - proper usage I'm trying to determine the proper way to use prepared statements with QSqlQuery. The docs are not very specific on this subject.
void select(const QSqlDatabase &database) {
    QSqlQuery query(database);
    query.prepare("SELECT * FROM theUniverse WHERE planet = :planet");
    query.bindValue(":planet", "earth");
    query.exec();
}

So will this snippet create a permanent prepared statement in the connection database? Will this prepared statement persist between calls to select(), i.e. will it be saved when the function returns and QSqlQuery query is disposed?
Or should I create QSqlQuery on the heap and use the same instance over and over again?

A: Ok, the idea is that you have to create QSqlQuery on heap, prepare the query and do the following with it:

*

*QSqlQuery::bindValue(s)

*QSqlQuery::exec

*read data with QSqlQuery::[next|first|last|...]

*QSqlQuery::finish

*rinse and repeat

the following snipped is useful to create, prepare and retrieve queries on heap:
QSqlDatabase database;
QMap<QString, QSqlQuery *> queries; //dont forget to delete them later!

QSqlQuery *prepareQuery(const QString &query)
{
    QSqlQuery *ret = 0;
        if (!queries.contains(query)) {
            QSqlQuery *q = new QSqlQuery(database);
            q->prepare(query);
            queries[query] = ret = q;
        } else {
            ret = queries[query];
        }
    }
    return ret;
}


text:
Q: Get X's configuration I have done some tests with 2 NVIDIA cards (not in SLI) and 4 monitors, with nouveau drivers.
Debian 8 testing and Arch are not able to use the 4 monitors at the same time, but somehow Fedora 21 is able.
So I thought I'd try the config that Fedora is using with Arch and see if my monitors start working, but for that I must get the config that X is using in Fedora.
How can I get the config? (I tried X :1 -configure and then reading the file that is generated in /root/xorg.conf.new, but that doesn't seem to make my 4 monitors work)


text:
Q: Extension of boost::asio hangs after being interrupted Boris' article shows us how to create extension of boost::asio. I try to add signal_set and async_wait on registered signals. Then the program hangs until a second SIGINT is triggered. Though, I would like to finish it properly within one signal only.
Here is my code. I test it with gcc-4.6.3 and boost-1.52.0 on Ubuntu.
To compile -
gcc -I/boost_inc -L/boot_lib main.cpp -lpthread -lboost_system -lboost_thread
#include <boost/asio.hpp>
#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <cstddef>

template <typename Service>
class basic_timer
  : public boost::asio::basic_io_object<Service>
{
  public:
    explicit basic_timer(boost::asio::io_service &io_service)
      : boost::asio::basic_io_object<Service>(io_service)
    {}

    void wait(std::size_t seconds)
    { return this->service.wait(this->implementation, seconds); }

    template <typename Handler>
    void async_wait(std::size_t seconds, Handler handler)
    { this->service.async_wait(this->implementation, seconds, handler); }
};

class timer_impl;

template <typename TimerImplementation = timer_impl>
class basic_timer_service
  : public boost::asio::io_service::service
{
  public:
    static boost::asio::io_service::id id;

    explicit basic_timer_service(boost::asio::io_service &io_service)
      : boost::asio::io_service::service(io_service),
      async_work_(new boost::asio::io_service::work(async_io_service_)),
      async_thread_(
        boost::bind(&boost::asio::io_service::run, &async_io_service_))
    {}

    ~basic_timer_service()
    {
      async_work_.reset();
      async_io_service_.stop();
      async_thread_.join();  // program is blocked here until the second
                             // signal is triggerd
      async_io_service_.reset();
    }

    typedef boost::shared_ptr<TimerImplementation> implementation_type;

    void construct(implementation_type &impl)
    {
      impl.reset(new TimerImplementation());
    }

    void destroy(implementation_type &impl)
    {
      impl->destroy();
      impl.reset();
    }

    void wait(implementation_type &impl, std::size_t seconds)
    {
      boost::system::error_code ec;
      impl->wait(seconds, ec);
      boost::asio::detail::throw_error(ec);
    }

    template <typename Handler>
    class wait_operation
    {
      public:
        wait_operation(
          implementation_type &impl,
          boost::asio::io_service &io_service,
          std::size_t seconds, Handler handler)
          : impl_(impl),
          io_service_(io_service),
          work_(io_service),
          seconds_(seconds),
          handler_(handler)
        {}

        void operator()() const
        {
          implementation_type impl = impl_.lock();
          if (!io_service_.stopped() && impl)
          {
              boost::system::error_code ec;
              impl->wait(seconds_, ec);
              this->io_service_.post(
                boost::asio::detail::bind_handler(handler_, ec));
          }
          else
          {
              this->io_service_.post(
                boost::asio::detail::bind_handler(
                  handler_, boost::asio::error::operation_aborted));
          }
      }

      private:
        boost::weak_ptr<TimerImplementation> impl_;
        boost::asio::io_service &io_service_;
        boost::asio::io_service::work work_;
        std::size_t seconds_;
        Handler handler_;
    };

    template <typename Handler>
    void async_wait(
      implementation_type &impl,
      std::size_t seconds, Handler handler)
    {
      this->async_io_service_.post(
        wait_operation<Handler>(
          impl, this->get_io_service(), seconds, handler));
    }

  private:
    void shutdown_service()
    {}

    boost::asio::io_service async_io_service_;
    boost::scoped_ptr<boost::asio::io_service::work> async_work_;
    boost::thread async_thread_;
};

class timer_impl
{
  public:
    timer_impl()
    {}

    ~timer_impl()
    {}

    void destroy()
    {}

    void wait(std::size_t seconds, boost::system::error_code &ec)
    {
      sleep(seconds);
      ec = boost::system::error_code();
    }
};

typedef basic_timer<basic_timer_service<> > timer;

template <typename TimerImplementation>
boost::asio::io_service::id basic_timer_service<TimerImplementation>::id;
void wait_handler(const boost::system::error_code &ec)
{
  std::cout << "5 s." << std::endl;
}

int main()
{
  {
    boost::asio::io_service io_service;
    boost::asio::signal_set signals(io_service);
    timer t(io_service);

    signals.add(SIGINT);
    signals.async_wait(
      boost::bind(&boost::asio::io_service::stop, &io_service));

    t.async_wait(2, wait_handler);

    std:: cout << "async called\n" ;
    io_service.run();
  }

  { // this block will not be executed
    boost::asio::io_service io_service;
    timer t(io_service);

    t.async_wait(2, wait_handler);
    std:: cout << "async called\n" ;
    io_service.run();
  }
  return 0;
}

A: After tried an example offered by the author of asio, I confronted the same behavior. Consequently, I dig into the library source and found that the source use io_service_impl's interfaces rather than ones of io_service. Furthermore, an operation functor posted to the io_service_impl is different from ones invoked by the io_service. Altogether, I decided to rewrite the timer example according to the internal interfaces of asio.
I hereby present the rewritten timer example.
#include <boost/asio.hpp>
#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <cstddef>

#define get_service_impl(X) \
  ba::use_service<bad::io_service_impl>(X)

namespace ba = boost::asio;
namespace bad = boost::asio::detail;

// Nothing changed
template <typename Service>
class basic_timer
  : public boost::asio::basic_io_object<Service>
{
public:
  explicit basic_timer(boost::asio::io_service &io_service)
    : boost::asio::basic_io_object<Service>(io_service)
  {}

  void wait(std::size_t seconds)
  { return this->service.wait(this->implementation, seconds); }

  template <typename Handler>
  void async_wait(std::size_t seconds, Handler handler)
  { this->service.async_wait(this->implementation, seconds, handler); }
};

// Nothing changed
class timer_impl
{
public:
  void wait(std::size_t seconds, boost::system::error_code &ec)
  {
    sleep(seconds);
    ec = boost::system::error_code();
  }
};

// ----- Change a lot! --------
class basic_timer_service
: public boost::asio::io_service::service
{
public:
  typedef boost::asio::detail::socket_ops::shared_cancel_token_type
    implementation_type;

  static boost::asio::io_service::id id;

  explicit basic_timer_service(boost::asio::io_service &io_service)
    : boost::asio::io_service::service(io_service),
      io_service_impl_(get_service_impl(io_service)),
      work_io_service_( new boost::asio::io_service ),
      work_io_service_impl_(get_service_impl(*work_io_service_)),
      work_(new ba::io_service::work(*work_io_service_)),
      work_thread_() // do not create thread here
  {}

  ~basic_timer_service()
  {  shutdown_service(); }

  void construct(implementation_type &impl)
  { impl.reset(new timer_impl()); }

  void cancel(implementation_type &impl)
  {
        impl.reset((void*)0, boost::asio::detail::socket_ops::noop_deleter());
  }

  void destroy(implementation_type &impl)
  { impl.reset(); }

  void shutdown_service()
  {
    work_.reset();
    if(work_io_service_.get()){
      work_io_service_->stop();
      if (work_thread_.get()){
        work_thread_->join();
        work_thread_.reset();
      }
    }
    work_io_service_.reset();
  }

  void wait(implementation_type &impl, std::size_t seconds)
  {
    boost::system::error_code ec;
    // XXX I not sure this is safe
    timer_impl *impl_ptr = static_cast<timer_impl*>(impl.get());
    impl_ptr->wait(seconds, ec);
    boost::asio::detail::throw_error(ec);
  }

  template <typename Handler>
  class wait_operation
  : public boost::asio::detail::operation
  {
  public:
    BOOST_ASIO_DEFINE_HANDLER_PTR(wait_operation);

    // namespace ba = boost::asio
    // namespace bad = boost::asio::detail
    wait_operation(
      bad::socket_ops::weak_cancel_token_type cancel_token,
      std::size_t seconds,
      bad::io_service_impl& ios,
      Handler handler)
      : bad::operation(&wait_operation::do_complete),
      cancel_token_(cancel_token),
      seconds_(seconds),
      io_service_impl_(ios),
      handler_(handler)
    {}

    static void do_complete(
      bad::io_service_impl *owner,
      bad::operation *base,
      boost::system::error_code const & /* ec */ ,
      std::size_t /* byte_transferred */ )
    {
      wait_operation *o(static_cast<wait_operation*>(base));
      ptr p = { boost::addressof(o->handler_), o, o};

      // Distinguish between main io_service and private io_service
      if(owner && owner != &o->io_service_impl_)
      { // private io_service

        // Start blocking call
        bad::socket_ops::shared_cancel_token_type lock =
          o->cancel_token_.lock();

        if(!lock){
          o->ec_ = boost::system::error_code(
            ba::error::operation_aborted,
                            boost::system::system_category());
        }else{
          timer_impl *impl = static_cast<timer_impl*>(lock.get());
          impl->wait(o->seconds_, o->ec_);
        }
        // End of blocking call

        o->io_service_impl_.post_deferred_completion(o);
        p.v = p.p = 0;
      }else{ // main io_service
        bad::binder1<Handler, boost::system::error_code>
          handler(o->handler_, o->ec_);
        p.h = boost::addressof(handler.handler_);
        p.reset();
        if(owner){
          bad::fenced_block b(bad::fenced_block::half);
          boost_asio_handler_invoke_helpers::invoke(
                        handler, handler.handler_);
        }
      }
    }

  private:
    bad::socket_ops::weak_cancel_token_type cancel_token_;
    std::size_t seconds_;
    bad::io_service_impl &io_service_impl_;
    Handler handler_;
    boost::system::error_code ec_;
  };

  template <typename Handler>
  void async_wait(
    implementation_type &impl,
    std::size_t seconds, Handler handler)
  {
    typedef wait_operation<Handler> op;
    typename op::ptr p = {
      boost::addressof(handler),
      boost_asio_handler_alloc_helpers::allocate(
        sizeof(op), handler), 0};
    p.p = new (p.v) op(impl, seconds, io_service_impl_, handler);
    start_op(p.p);
    p.v = p.p = 0;
  }

protected:
  // Functor for runing background thread
  class work_io_service_runner
  {
  public:
    work_io_service_runner(ba::io_service &io_service)
      : io_service_(io_service) {}

    void operator()(){ io_service_.run(); }
  private:
    ba::io_service &io_service_;
  };

  void start_op(bad::operation* op)
  {
    start_work_thread();
    io_service_impl_.work_started();
    work_io_service_impl_.post_immediate_completion(op);
  }

  void start_work_thread()
  {
    bad::mutex::scoped_lock lock(mutex_);
    if (!work_thread_.get())
    {
      work_thread_.reset(new bad::thread(
          work_io_service_runner(*work_io_service_)));
    }
  }

  bad::io_service_impl& io_service_impl_;

private:
  bad::mutex mutex_;
  boost::scoped_ptr<ba::io_service> work_io_service_;
  bad::io_service_impl &work_io_service_impl_;
  boost::scoped_ptr<ba::io_service::work> work_;
  boost::scoped_ptr<bad::thread> work_thread_;
};

boost::asio::io_service::id basic_timer_service::id;

typedef basic_timer<basic_timer_service> timer;

void wait_handler(const boost::system::error_code &ec)
{
  if(!ec)
    std::cout << "wait_handler is called\n" ;
  else
    std::cerr << "Error: " << ec.message() << "\n";
}

int main()
{
  {
    boost::asio::io_service io_service;
    boost::asio::signal_set signals(io_service);
    timer t(io_service);

    signals.add(SIGINT);
    signals.async_wait(
      boost::bind(&boost::asio::io_service::stop, &io_service));

    t.async_wait(2, wait_handler);

    std:: cout << "async called\n" ;
    io_service.run();
    std:: cout << "exit loop\n";
  }

  {
    boost::asio::io_service io_service;
    timer t(io_service);

    t.async_wait(2, wait_handler);
    std:: cout << "async called\n" ;
    io_service.run();
  }
  return 0;
}

To compile
gcc -I/boost_inc -L/boot_lib main.cpp -lpthread -lboost_system -lboost_thread
The new timer works fine. Still I would like to know how to write a non-intrusive extension of asio.


text:
Q: MacPort ports not overriding pre-installed older versions I have XCode 3.2.6 which includes SVN 1.6.x. I just installed MacPorts and got subversion which is 1.7.x, but when I run svn --version it shows 1.6.17.
I installed MacPorts after Xcode, why is Scode#s version taking precedence?

A: If you are running svn from a shell command line (like in a terminal window), you need to make sure that the bin directory where MacPorts installs things (the default is /opt/local/bin) comes before the location where the Apple-installed version is (/usr/bin).  This is controlled by the process environment variable PATH.
$ export PATH=/opt/local/bin/:$PATH

To make this change permanent, add the line to your shell startup file, for example, .bash_profile.
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
$ which svn
/usr/bin/svn$ svn --version
svn, version 1.6.17 (r1128011)
   compiled Feb  1 2012, 15:04:34
[...]
$ export PATH=/opt/local/bin:$PATH
$ echo $PATH
/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
$ which svn
/opt/local/bin/svn
$ svn --version
svn, version 1.7.4 (r1295709)
   compiled Mar  8 2012, 19:29:25
[...]

A: I had the same problem (svn --version showed 1.6.x), even though /opt/local/bin was at the front of the path, and which svn returned /opt/local/bin/svn, and running /opt/local/bin/svn --version showed 1.7.x.
For me, restarting Terminal fixed it.


text:
Q: Windows media player control not enabled in the active desginer VS 2015 Community I'm trying to load the WMP control into my WPF project using this guide.
When I try and do this, I get the following error message: The following controls were successfully added to the toolbox but are not enabled in the active designer.
I'm using Visual Studio 2015 Community (Version 14.0.25431), and targeting .NET Framework 4.6.2. I've tried targeting old versions, as well as moving the DLL into my project folder and adding a reference from there with no luck.

A: As Hans told me, I was using a guide for Winforms. This article shows you how to embed the Winforms control in WPF.


text:
Q: How to change magento layout design? I'm new to magento and would like to create a new theme.
I'm trying to make sense in all of it, but I would really like to hear your approach to theming in Magento 2.
So I understood only basics so far - how to start a new theme, register it, etc. But what I seem not to understand is that as soon as I create everything how to change the layout?
app\design\frontend\MyTheme\theme

When I create my theme with a parent /blank I can change(update) the layout in /Magento_Theme/layout/default.xml or deafult_head_blocks.xml - these files update the ones in vendor\magento\theme-frontend-blank\Magento_Theme\layout\*.xml.
My question therefore is how do I find a source of every block/container to edit or move it? Or is it better to create a new /default.xml in which I hide every element and then show it on a right place? What is the "right way" of creating layout? Should I use referenceContainer or create a new one?
Thanks for help.

A: There is no built in way to see what block/container is calling in the element (template) on the page. Enabling template hints in the admin will show what template is being pulled in, but as far as finding what reference name use can use in your override XML files, you have to dig into the modules themselves to see how they are created and what name they are given so you can reference that in your own files.
So say you want to edit the the header on the site, you can grep -r "header content" in the vendor/magento folder as you know from the front end of the site that the element that you want to edit has those css classes. That will point you to a few files, but in  /vendor/magento/module-theme/view/frontend/layout/default.xml you will see this:
<container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content">

This is where the container for the site is getting created. You can now use this name to add or remove things.
An alternative is the buy and use Commerce Bug. This will show you what XML nodes are being used and where. I have not personally used this on Magento 2, but everything Alan does it 100%, so it's well worth the cost.

A: Haha, after hours I finally understood it and was able to connect all the sources that are used for the template rendering.
Though I still don't understand how to insert my own code - I know I have to insert .phtml file but I don't how to register it.. Should I just create one in <theme_dir>/Magento_Theme/templates/html/*.phtml and then call it with: <block name="my.custom.phtml" class="Magento\Theme\Block\Html" Template="Magento_Theme::my_custom_phtml" /> Or is it necessary to create a module in app/code/<vendor>/<module_name>?


text:
Q: Are the speeds of the different wavelengths of visible light different or varying in a medium such as air? Are the speeds of the different wavelengths of visible light different or varying in a medium such as air? If so, please inform by how much?
Also, even if the wavelength speeds vary minimally, please inform.

A: Yes, it varies and this is a very important fact. You can see on wikipedia that this is the effect we use to separate different colors.


text:
Q: Is it possible to destructure a tuple with an irrefutable pattern in a function declaration? In rust I can currently do,
// this function accepts k,v
fn foo(
    k: &str, v: u8
) -> bool {
    true
}

But I can not destructure the arguments in the signature,
// this function accepts (k,v) tuple
fn bar(
    (k: &str, v: u8) // notice the parens
) -> bool {
    true
}

Is it possible to destructure a tuple with an irrefutable pattern?

A: What you have to do is type the whole tuple not the components inside it,
// this function accepts (k,v) tuple
fn baz(
    (k, v): (&str, u8) // notice the parens
) -> bool {
    true
}