text:
Q: Solr Cloud : Effect of Tf-IDF on Querying with multiple shards We have a huge set of text documents that we want to index in Solr. However since the index size is way too large we decided to split it among different shards using Solr Cloud. Now as per my understanding whenever a search is performed it will be distributed over all the shards and results from all the shards will be merged and returned. However a particular shard will search only in the index that it is hosting. My question is will it affect the quality of search results as IDF which actually should be calculated over the entire of set of documents will now be calculated over just the documents in a particular shard ?

A: Solr does not calculate universal term/doc frequencies, it is done per node. For most large-scale implementations, it is not likely to matter that Solr calculates TD/IDF at the shard level. However, if your collection is heavily skewed in its distribution across servers, you may find misleading relevancy results in your searches. In general, it is probably best to randomly distribute documents to your shards.
More on this here: https://cwiki.apache.org/confluence/display/solr/Distributed+Search+with+Index+Sharding


text:
Q: What would be the dimensions of on output matrix for the convolution of a $6\times 6\times 3$ input image and a $3\times3\times3$ kernel? (Using a stride of zero and padding of zero.)
For an input image of size $6\times6$ with $3$ channels (therefore $6\times6\times3$) and a kernel of size $3\times3$ with $3$ channels, the equation for the convolution is given as follows:
$\sum_{m}^{k_1-1}\sum_{n}^{k_2-1}\sum_{C=1}^{3} K_{m,n,c}I_{i+m, j+n,c} + b$
I know that the size of a 2D convolution is given by:
$\frac{I-R}{s} + 1 = \frac{6-3}{1}+1 = 4$
So therefore, the first $2$ dimensions will be given as $4\times4$
But what are the dimensions of the 3rd dimension? Is my final dimension going to be $4\times4\times3$ or $4\times4\times1$?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Unable to change object values on successful ping I am trying to replace variables in my table but I can't seem to do it. On a successful ping, I want the value under Success to be changed to a 1, but no matter what I do it stays a 0. $ping currently returns something like this:
+-------------------+----------+
|     Hostname      |  Success |
+-------------------+----------+
| BVL-W71455781745  |        0 |
| BVL-WX966103545   |        0 |
| BVL-W7583554017   |        0 |
+-------------------+----------+

$ping = Import-csv C:\temp\pingtst.csv -Header 'Hostname' | Select-object *,@{Name='Success';Expression={'0'}}
$i = 0
foreach ($HostName in $ping.Hostname) {

if (Test-Connection -ComputerName $HostName -count 3 -Quiet)
    {
        $ping.Success[$i] = '1'
        $i = ($i + 1)
        } else

        {$ping.Success[$i] = '0'
        $i = ($i + 1)
        }
        }

A: Your are iterating over your objects in a peculiar fashion. Also you are not indexing your array on the correct element. I do not have a technical explanation yet but when you index on Success like so

$ping.Success[$i]

That does return the correct value for the correct row. However you do not have direct access to set a value on that row. Your default value of 0 stays in that case.
If you instead did something like this you would get the result you were expecting.
$ping[$i].Success

The whole $i is not required either as there is a much better way to work through your object array.
$results = Import-csv C:\temp\pingtst.csv -Header 'Hostname' |
    Select-object hostname,@{Name='Success';Expression={'0'}} |
    ForEach-Object{
        # Test the connection. Since the value is already 0 only change on success
        if (Test-Connection -ComputerName $_.Hostname -count 3 -Quiet){
            $_.Success = 1
        }
        # Send this row down the pipeline
        $_

}

# This should look like you expect now.
$results


text:
Q: Express 4 Compression I am following the simple guide in the npm compression module, but I'm not seeing compression on my static pages.  It does look like the pages being redered by Express are being compressed.  Is there something I need to do to get the static files compressed as well?
I am using Express 4.2.0 and Compression 1.0.8.
var express = require('express');
var compression = require('compression');

var app = express();
app.use(compression());

Here is one of my router functions:
router.get('/:name', function(req, res) {
        res.render('test/blah/' + req.params.name, {
        title : entry.title
    });
}

A: in your middleware chain try to use compress middleware before the static middleware
app.use(compression());
app.use(express.static(__dirname+'/public'));


text:
Q: Add a comma after two digits in R? I would like to add a comma between numbers in all the column.
My data is a percentage, but it's delivered this way:
Percentage

3456
4444
325

Expected values:
Percentage

34,56
44,44
32,5

When I use gsub o sub I can't conserve my column as numeric. It doesn't matter if I use "." or "," the result is character.
Thanks!

A: We can make use of comma from formattable which will modify the format while keeping the numeric as it is
df1$Percentage <- formattable::comma(df1$Percentage, big.interval = 2, digits = 0)

-checking
> df1
  Percentage
1      34,56
2      44,44
3       3,25
> str(df1)
'data.frame':   3 obs. of  1 variable:
 $ Percentage: 'formattable' int  34,56 44,44 3,25
  ..- attr(*, "formattable")=List of 4
  .. ..$ formatter: chr "formatC"
  .. ..$ format   :List of 4
  .. .. ..$ format      : chr "f"
  .. .. ..$ big.mark    : chr ","
  .. .. ..$ digits      : num 0
  .. .. ..$ big.interval: num 2
  .. ..$ preproc  : NULL
  .. ..$ postproc : NULL

It is also possible to do calculations as it is a numeric column
> df1$Percentage * 100
[1] 34,56,00 44,44,00 3,25,00

data
df1 <- structure(list(Percentage = c(3456L, 4444L, 325L)), class = "data.frame", row.names = c(NA,
-3L))

A: We can make it in another way:
library(stringr)
library(dplyr)

x <- c("3333", "4223", "34215")

P1 <- x %>%
        str_replace_all("(^\\d{2})", "\\1.") %>%
        as.double() %>%
        data.frame()

colnames()[1] <- "Percentage"

Result:
> P1
  Percentage
1     33.330
2     42.230
3     34.215


text:
Q: The stable manifold of a fixed point on a non linear map i have a nonlinear map
$f(x,y) = (x/2, 2y-7x^2)$
the map has a fixed point at (0,0).
$Df(0,0)=\begin{pmatrix}0.5 & 0\\\ 0 & 2\end{pmatrix}$
then, the fixed point is a saddle.
On the book (Alligood K.T., Yorke J.A, T.D.Sauer. Chaos: An Introduction to Dynamical Systems)  said that the stable manifold of (0,0) is described by the parabola $y=4x^2$. How do i do to reach that result?

A: You can do this by verifying three things:

*

*$y=4x^2$ is invariant under $f(x,y)$

*Each point $(x,y)$ that lies on the curve $y=4x^2$ is attracted to $(0,0)$ under iteration of $f(x,y)$.

*The curve $y=4x^2$ is tangent at $(0,0)$ to the expanding eigenvector of $Df(0,0)$.


text:
Q: Can I charge 2S 18650 battery pack with a BMS and a 9V wall adapter? I have this cheap 2S BMS board that I want to use to charge a 2S 18650 battery pack (two 18650 in series.)
Can I use this BMS board with a 9V wall adapter to charge my battery pack? I want to make a portable battery pack for a school project.

A: No you must have a battery charge controller that is suited for lithium ion batteries.
Just connecting a voltage regulated power supply to a battery pack with BMS will result in an incorrect charging cycle and incorrect voltage to the batteries. Most batteries need a constant current charging cycle then constant voltage charging cycle, which a battery charging controller provides.

A: For charge it, i recommend using 2s charging module, i dont remember its model
But it had two mode, 1s and 2s battery charge
And then you can just charge it with 12v or maybe 9v wall adapter


text:
Q: Cannot proceed because gmp.dll was not found I have built a simple CGAL example but when I run it, I get an error that gmp.dll was not found.
I am on Windows 10, using CMake and MSBuild and trying to build a simple sample CGAL C++ program.
I used vcpkg (with environment variable VCPKG_DEFAULT_TRIPLET set as x64-windows) to install CGAL via the following commands:
.\vcpkg.exe install cgal[qt] --recurse
vcpkg integrate install

The C++ code I'm using is copied exactly from a CGAL constrained 2d triangulation example and placed into main.cpp.
My CMakeLists.txt is as follows:
cmake_minimum_required(VERSION 3.1...3.15)

project(hello-world)

find_package(CGAL REQUIRED)

add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} CGAL)

I make a build directory, move into it, and run cmake. When running cmake, I supply the variable -DCMAKE_TOOLCHAIN_FILE=<vcpkg_path>\scripts\buildsystems\vcpkg.cmake and use generator Visual Studio 16 2019. The command runs without issue. Here is a relevant piece of output:
-- Found GMP: <vcpkg_path>/installed/x64-windows/lib/gmp.lib

Next, I run MSBuild on the generated hello-world.sln file. Again, everything runs without issue, compilation and linking is successful. Here is some relevant info from the linking stage:
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OU
  T:"<current_directory>\Debug\hello-world.exe" /INCREMENTAL /NOLOGO "<vcpkg_path>\installed\x64-windows\debug\lib\mpfr.lib" "<vcpkg_path>\installed\x64-wind
  ows\lib\gmp.lib" kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /
  MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"<current_directory>/Debug/hello-world.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"<current_directory>/Debug/hello-world.lib" /MACHINE:X64  /machine:x64 "hello-world.dir\Debug\main.obj"
  hello-world.vcxproj -> <current_directory>\Debug\hello-world.exe

Now, finally when I try to run hello-world.exe, I get the error:

The code execution cannot proceed because gmp.dll was not found. Reinstalling the program may fix this problem.

I come from a Linux background so I'm not entirely comfortable with Windows' shared library conventions. I understand that gmp.lib contains relevant info for gmp.dll like the entry point? Does it also hold information about where to find it? I've read that generally the .dll files should be located beside the .exe, if so, should CMake be doing this? If not, why wouldn't vcpkg install them to a system directory, or at least the toolchain file I supplied could point to the .dlls?
I can manually copy gmp.dll from the vcpkg bin directory into the same directory as my .exe, but that seems like only a workaround.
I have another question that's a bit more specific to the vcpkg buffs. Can I easily install CGAL so that GMP is linked statically rather than dynamically?

A: Ok first of all there is a bug there. You are building debug and it links the release version of gmp. Since it is a C library it doesn't matter that much.
If you are using the VS IDE you might want to setup
https://cmake.org/cmake/help/git-stage/prop_tgt/VS_DEBUGGER_ENVIRONMENT.html
to add the VCPKG bin dir to PATH, alternativly you might run https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies to install any runtime dependencies into the build dir (vcpkg should normally do that with VCPKG_APPLOCAL_DEPS but maybe the configuration issue blocks it). Both things won't work if the dependency is just a plugin.


text:
Q: How to slow down the execution of code for popup blocker I've been working on an issue with my program executing too quickly to detect whether popup is being blocked by the browser. Even with the timeout, sometimes the window that is opened doesn't get closed. I've also tried opening a window and passing a value back to the parent window and that didn't work either.
setTimeout(DetectPopUp(), 1000);

function DetectPopUp() {
  var puTest = setTimeout(window.open("", "", "width=1,height=1,top=2000"));

  try {
    puTest.close();
    return false;
  } catch (e) {
    return true;
  }
}

Any ideas on how to do this?

A: As already mentioned the source of the OP's currently failing code is how the OP uses setTimeout and its return value. The latter is not the handle of a window reference as the OP seems to assume but the timeout specific identifier which can be used for e.g. canceling the timeout before the execution of the to be delayed code happens.
Thus, the OP actually does not need to write a deferred version of a popup blocker test since window.open immediately returns the result of its action which either is a Window object (no popup blocker) or is the null value (most probably due to a popup blocker).
But of cause one could come up with promise based test functionality implemented as a single async function which then can be utilized either as chained promise or within another async function by the await operator.

async function promisedPopupBlockerTest() {
  return new Promise((resolve, reject) => {
    try {
      const result = { hasBlocker: true }; // result default.

      const handle = window.open('', '', 'popup=true,width=1,height=1,top=2000');
      if (!!handle) {

        handle.close();
        result.hasBlocker = false; // result value change.
      }
      resolve(result); // resolve always with a valid result.

    } catch (reason) {

      reject(reason); // reject for/with whatever reason.
    }
  });
}

// ... usage as ...

// ... either chained promise ...
promisedPopupBlockerTest()
  .then(result => console.log(`resolved with ${ JSON.stringify(result) }`))
  .catch(reason => console.log(`rejected with ${ JSON.stringify(reason) }`));

// ... or with async...await syntax ...
(async () => {
  const result = await promisedPopupBlockerTest();
  console.log('awaited test result ... ', result);
})();

// prove of the popup blocking behavior of SO sandboxes.
const handle = window.open('', '', 'popup=true,width=1,height=1,top=2000');
console.log({ handle });


text:
Q: javascript on with namespacing events there is a weird behavior that when I use namespace event that the handler will always get fired.

click
click

$("#div1").on("click.me", function(event, data){
     $(this).append(data.from);
});

$("#span1").on("click", function(event){
     $("div").trigger("click.me", [{from:"span1"}]);
});

$("#span2").on("click", function(event){
     $("div").trigger("click", [{from:"span2"}]);
});

so the div will append the data when I clicked on both span1 and span2. why is that ? didn't I only added the handler specific to "click.me" ?
I have it on jsFiddle http://jsfiddle.net/cY5sk/1/

A:
Didn't I only added the handler specific to "click.me" ?

No, that's not how namespaces work. The handler is still bound to the particular event, but the namespace gives you an additional way to refer to them. It doesn't matter which namespace a handler belongs to, if the event is triggered, all handlers for that event are called, regardless which namespace the belong to.
Consider:
$("#div1").on("click.me", function(event, data){
     $(this).append(data.from);
});

$("#div1").on("click", function(event, data){
     $(this).append(data.from);
});

$('div').trigger('click.me') would only trigger the first handler, because you specified the me namespace. However, $('div').trigger('click') will trigger both handlers regardless of their namespace.
From the documentation:

An event name can be qualified by event namespaces that simplify removing or triggering the event. For example, "click.myPlugin.simple" defines both the myPlugin and simple namespaces for this particular click event.

It seems like you are looking for custom events, e.g.
$("#div1").on("foo", function(event, data){
     $(this).append(data.from);
});

$("#span1").on("click", function(event){
     $("div").trigger("foo", [{from:"span1"}]);
});

$("#span2").on("click", function(event){
     $("div").trigger("click", [{from:"span2"}]);
});


text:
Q: Nuget server on IIS7 / Win2008 faults w3wp.exe I realize this is borderline non-development, but I'm a developer trying to create a NuGet Server, not an IIS guy, so hopefully someone here has experienced this.
I have some libraries used across several applications, so I wanted to make NuGet packages out of them. I also wanted to set up a proper NuGet server so that people collaborating with me would have easy access, and to ease the integration with the CI side (pushing new packages from TeamCity builds). I followed the instructions here, starting at "Creating Remote Feeds":
http://docs.nuget.org/docs/creating-packages/hosting-your-own-nuget-feeds
I followed it to the letter, of course using the latest version of the NuGet.Server package available as of writing. It worked fine on my dev box using VS2010, so I deployed it to the live server (Win2008, IIS7). The app pool is running .Net in Integrated mode, the app is running using the NetworkService identity, and I gave full rights on the designated packages directory to the Network Service account.
Then when I try to access the site, I immediately get this error in the Application event viewer:
Faulting application w3wp.exe, version 7.0.6001.18000, time stamp 0x47919ed8, faulting module ntdll.dll, version 6.0.6001.18538, time stamp 0x4cb73957, exception code 0xc0000374, fault offset 0x00000000000a7857, process id 0xa8c, application start time 0x01cc9f77f1f23af0.
The web server is running many other web applications, most of them ASP.NET MVC, so in general it should be fine.
How would someone not very knowledgeable on IIS go about finding out what causes this fault? I don't have an IIS admin to lean on, so the developer has to play IT guy. :|

A: If ntdll.dll is faulting, something is badly wrong. I would try again with the latest version of NuGet Gallery - there have been many changes recently.
The docs online at nuget.org are a bit out of date. We followed the details here, which worked pretty much first time:
http://www.codecapers.com/post/How-to-Set-Up-a-Local-NuGet-Gallery.aspx


text:
Q: Repeating Task in Foreground service in Doze mode I'm working on an application in which I have to do some repeating task at fixed interval (let's say after 2 mins) which should complete even in doze mode. My observations are mentioned below -

*

*Doing repeating task using Alarms (using RTC flag) aren't accurate. Android system batches alarms. If we use RTC_WAKEUP then it is better than RTC, but it shows WAKEUP count in Android Vitals which is not good.

*Jobschedulers are useful but will not work for lesser interval like 2 mins. I had tried Firebase Jobdispatcher but that is also not very accurate, I started Job with 2 mins Trigger time but it was varying from 10-20 mins.

*Used Handlers and Timers for repeating task in Foreground service. In this scenario Foreground service continue to run in Doze mode but handlers and timer stops repeating task. I read about Handlers.postDelayed() and found that this is also affected by doze mode.

I don't want to acquire WAKELOCK for this repeating task.
Can someone please suggest me some better/clean way by which we can do short interval repeating task in doze mode?
For reference -
Android: What is the best way to make repetitive Background Tasks Android Oreo ready?
How does doze mode affect background/foreground services, with/without partial/full wakelocks?

A: Not exactly a direct answer but still - I needed to schedule an action every minute in my foreground service (give or take a second).
Fortunately I was capturing sensors in this foreground service too, I made onSensorChanged event check if the right time has passed and act if needed.


text:
Q: Multitask to update the file contept every second with python Im trying to write a chat logic, so here what I want to do
def chatlogic():
    talk=True
    while talk:
        if __name__ == '__main__':
            Thread(target = fluse).start()
        message = raw_input('enter a message: ')
        if not message: #Ending Conversation if empty message was sent
            talk=False
        conv_file.write('[%s]%s: %s\n' %(msgtime,user,message))
        #conv_file.flush()
        return 'Conversation Ended'

def fluse():
    while True:
        time.sleep(1)
        conv_file.fluse()

the file must update every second, nomatter what you are doing.
What am i doing wrong?
note: I have never used multitasking before

A: There are many problems in this code, but the one you seem to be asking about is here:
while talk:
    if __name__ == '__main__':
        Thread(target = fluse).start()

This means that each time through the loop—that is, once per message—you're going to fire off a new fluse thread. And that thread loops forever, calling conv_file.fluse() every second until the end of time.
So, if you type messages at 0.3, 2.7, and 5.1 seconds after app startup, you're going to get a fluse at 5.3 seconds, another at 5.7, another at 6.1, and so on.
If you want this to only happen once/second, just start a single thread, instead of starting a new one each time through the loop. For example:
if __name__ == '__main__':
    Thread(target = fluse).start()
while talk:
    # etc.

If, instead, you want it to happen a second after each write, but not every second again after that, just take the loop out of the function:
def fluse():
    time.sleep(1)
    conv_file.fluse()

Although in this case, threading.Timer is an easier way to do the same thing.

Anyway, even with this fix, as I said, there are a number of other problems:

*

*You're calling a file method that doesn't exist—presumably you meant flush instead of fluse?

*The file doesn't exist either. Maybe you meant it to be a global, created outside the functions? Or an argument to them?

*You're trying to loop forever until an empty message, but you call return each time through the loop, which means you're only going to loop once.

*There's no way to exit your program, because you fire off a non-daemon background thread that runs forever.

*You never call the chatlogic function anyway, so the program just exits immediately without doing any work.

If I fix all of the other errors in your program, and add something that shows me whether the fluse thread is doing its job, it does something… and maybe you can tell us whether it's the thing you wanted.
from threading import Thread
import time

def chatlogic(conv_file):
    user = 'Nobody'
    t = Thread(target=flusher, args=[conv_file])
    t.daemon=True
    t.start()
    while True:
        message = raw_input('enter a message: ')
        if not message: #Ending Conversation if empty message was sent
            break
        msgtime = time.asctime()
        conv_file.write('[%s]%s: %s\n' %(msgtime,user,message))
    return 'Conversation Ended'

def flusher(conv_file):
    while True:
        time.sleep(1)
        print 'Flushing the file now'
        conv_file.flush()

if __name__ == '__main__':
    conv_file = open('convfile.txt', 'w')
    chatlogic(conv_file)

This is still a strange design. The file is being flushed once/second even if you didn't write anything, and that there's no guarantee it actually gets flushed at the end, and so on. But this is what it sounds like you were attempting to do.


text:
Q: How do I set workbook as fpath & listboxvalue
Encounter Runtime Error 424, Object Required

For code below
 Public fpath as string, fwbk As Workbook

 Private Sub BtnCloseWoSaving_Click()
 'Error on code below
 Set fwbk = fpath & Me.ListBoxWbk.Value
 End Sub

I'm using a userform to open files, close & automate data.
Stuck at this stage of setting opened file as workbook.
Thanks for the help in advance (:

A: Public fpath as string, fwbk As Workbook

 Private Sub BtnCloseWoSaving_Click()
 'Error on code below
 Set fwbk = workbooks.open(fpath & Me.ListBoxWbk.Value )
  '    ...
 End Sub


text:
Q: Issues seen during compilation of Net::SSLeay on linux and windows We have downloaded Net::SSLeay module source from cpan and would like to compile it locally and use it. We are facing issues in two situations.
We need your suggestions on couple of items:
1)  We need to use Net::SSLeay module. We have compiled it on Linux x86_64 box using the following statements:
perl Makefile.PL INC=-I"/include" LIBS=-L" /lib"
This generates a Makefile which doesn't seem to use –lcrypto option. I want to use this option since we are seeing the following error at the runtime:
undefined symbol: X509_EXTENSION_free
From the below link, it appears that we need to include –lcrypto option. Please help us how to include this option. I tried looking into Makefile.pl but could not understand much since I am new to this Makefile.
http://w3facility.org/question/what-is-undefined-symbol-x509_extension_free/
2)  Secondly, while building on Windows, we need to include openssl_path, but INC= and LIBS= doesn't seem to work. Openssl libraries are already present in a local directory. Please let us know how to include the path with the #perl Makefile.pl option.
Your suggestions will be very much appreciated.

A: I don't know if it may help you, but I had a similar issue with Net::SSLeay when trying to install LWP::Protocol::https (in my custom path /root/perl):
debian:~# apt-get install libssl-dev
debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
Can't load '/root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so' for module Net::SSLeay: /root/perl/lib/site_perl/5.14.2/armv5tejl-linux/auto/Net/SSLeay/SSLeay.so: undefined symbol: X509_EXTENSION_free at /root/perl/lib/5.14.2/armv5tejl-linux/DynaLoader.pm line 190.

As suggested HERE, I solved by manually compiling Net-SSLeay-1.74 in this way:
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# perl Makefile.PL LIBS="-L/root/perl/lib -lssl -lcrypto -lcrypt3" INC="-I/root/perl/include"
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make
debian:~/.cpan/build/Net-SSLeay-1.74-Zaf3oe# make install

Then it works correctly:
debian:~# /root/perl/bin/perl -e "use LWP::Protocol::https"
debian:~#


text:
Q: What was the first release date of GNU Make? I know from the Wikipedia page for the Make utility, that Make first appeared in 1976 and its author was Stuart Feldman.  It is also mentioned on that Wiki page that Make went through many rewrites, probably most famously GNU Make.
The GNU Make Manual opens by saying that its original authors were Richard Stallman and Roland McGrath (and later Paul D. Smith), but fails to give a date.
I've scrounged around the internet trying to find the release date of the first Stallman/McGrath version of GNU Make, but I have come up fruitless.  Does anyone in this community happen to know?

A: The first commit in the source repository is:
commit d5998dcec13c4d3f5efe9584008b8dbfabc28f09
Author: Roland McGrath <roland@redhat.com>
Date:   Sat Apr 23 16:12:14 1988 +0000

    Initial revision
    This version was distributed by RMS in `binutils.tar'.

So this suggests it was previously available as part of a tarball release (but not tracked in source control) some time before Apr 23 1988.
The first copyright date in the GNU Make manual is also 1988.
The GNU's Bulletin, vol. 1 no. 4, February, 1988 says:

The GNU version of Make is now ready, and will be distributed soon.

And the GNU's Bulletin, vol. 1 no. 5, June, 1988 says:

We have been distributing the GNU `make' utility for several months.

So that means the initial release was distributed some time after February 1988.


text:
Q: get date of tomorrow using jstl I tried the following to get the date of tomorrow in JSTL:
           <c:set var="currDate" value="<%=java.util.Calendar.getInstance()%>"/>
           <fmt:formatDate type="date" value="${currDate.add(java.util.Calendar.DATE,1)}" var="dayEnd"/>

but when I printed out to check at least var currDate using
           <c:out value="${currDate}" />

apparently, it didn't work. What should i do then?

A: There is neater way to do this directly in JSTL
<jsp:useBean id="ourDate" class="java.util.Date"/>
<jsp:setProperty name="ourDate" property="time" value="${ourDate.time + 86400000}"/>
<fmt:formatDate value="${ourDate}" pattern="dd/MM/yyyy"/>

But you can't rely on java.util.Date when the clocks change to Summer Time for example.
So if you REALLY want to do this all in JSTL, you can, with Spring tags, Joda Time classes and Joda Tags.
    <jsp:useBean id="ourDate" class="org.joda.time.DateTime"/>
    <spring:eval expression="ourDate.plusDays(1)" var="tomorrow"/>
    tomorrow: <joda:format value="${tomorrow}" style="SM" />

The spring eval tag lets you do some of those naughty things we all used to do with scriptlets, and JodaTime can be trusted to always give you an accurate result.

A: <%@ page import="java.util.Date" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="today" value="<%=new Date()%>"/>
<c:set var="tomorrow" value="<%=new Date(new Date().getTime() + 60*60*24*1000)%>"/>
Today: <fmt:formatDate type="date" value="${today}" pattern="d"/>
Tomorrow: <fmt:formatDate type="date" value="${tomorrow}" pattern="d"/>

A: <%
Calendar now=Calendar.getInstance();
Calendar today=Calendar.getInstance();
Calendar calendar=Calendar.getInstance();
today.set(today.get(Calendar.YEAR),today.get(Calendar.MONTH), today.get(Calendar.DAY_OF_MONTH));

// Convert the date string into a date to manipulate the dates
String year = (String)pageContext.getAttribute("year");
String month = (String)pageContext.getAttribute("month");
String day = (String)pageContext.getAttribute("day");
if (year == null) {
    year = String.format("%4d",now.get(Calendar.YEAR));
    int mth = now.get(Calendar.MONTH) + 1;
    month = String.format("%02d",mth);
    day = String.format("%02d",now.get(Calendar.DAY_OF_MONTH));
}

String str_date = month + "/" + day + "/" + year;
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy");
Date date = (Date)format.parse(str_date);

calendar.setTime(date);
Date [] arrayOfDates = new Date[4];
arrayOfDates[0] = calendar.getTime();

pageContext.setAttribute("calendarDate",arrayOfDates);
pageContext.setAttribute("year",year);
pageContext.setAttribute("month",month);
pageContext.setAttribute("day",day);%>


text:
Q: Where should I add my PATH's? I need the command 'rails' to be added permanently to the PATH variable. I'm not sure if this should be happening automatically, as every rails guide seem to assume doing 'rails something' will work right after installing it. The same happened with other programs, so I think I'm the problem.
I searched this but I found many options, not sure which is the most appropriate way:
option 1) edit ~/.bashrc
option 2) edit ~/.profile
option 3) put a script into /etc/profile.d/
I haven't tried them yet, I don't want to make a mess in the system.
Any suggestions?
ps. I'm on Ubuntu 11 server edition 64 bits
My final choice: I used ~/.bashrc for the sake of simplicity, I only needed to open a new terminal after adding the path

A: If you connect the machine remotely using console, then .bash_profile is used. But if you're already logged into the machine and just open a new terminal window, then .bashrc is used. You might also find some useful info here.


text:
Q: How to stop the "searching for GPS" in android i am trying to stop the "searching for GPS" in my app.
when i am using this line of code:
this.locationManager.removeUpdates(this);

i can still see the icon of the GPS in the notification bar, and its not stopping at all.
what else can i do?
Thanks!

A: Instead of passing this you should pass the location Listener instance to removeUpdate method like this.
locationManager.removeUpdates(gpsLocationListener);

where
GPSLocationListener gpsLocationListener = new GPSLocationListener();

class GPSOnChangeLocationListener implements LocationListener {
           public void onLocationChanged(Location location) {}
           public void onProviderDisabled(String arg0) {}
           public void onProviderEnabled(String arg0) {}
           public void onStatusChanged(String arg0, int arg1, Bundle arg2) {}
}

A: i figured it out.
thats what i did and it works:
private void registerLocationUpdates() {
    Intent intent = new Intent(ParkOGuardActivity.class.getName()
            + ".LOCATION_READY");
    pendingIntent = PendingIntent.getBroadcast(
            getApplicationContext(), 0, intent, 0);
    // minimum every 30 minutes, 300 kilometers
    this.locationManager.requestLocationUpdates(this.provider, 30000,
            300000, pendingIntent);
}

private void cancelLocationUpdates() {
    this.locationManager.removeUpdates(pendingIntent);
}

Thanks to all of you who tried to help me.

A: try locationManager.removeUpdates(gpsl);


text:
Q: Programmatically Navigate w/ HashRouter I was originally using hashHistory from react-router and programmatically navigating my React app using this.props.history.push(). But with the move to using HashRouter from the react-router-dom package, this.props.history.push() now throws a Cannot read property 'push' of undefined error.
How do I programmatically navigate using HashRouter now?
ReactDOM.render(
  <Provider store={store}>
    <MuiThemeProvider>
      <HashRouter>

          <Route exact path="/" component={App} />
          <Route path="/landing" component={Landing} />

      </HashRouter>
    </MuiThemeProvider>
  </Provider>,
document.getElementById('root'));

Render func of App.js
render() {
  return (

      ...

        <Collapse isOpened={this.state.activeForm === 1}>
          <SignUpForm />
        </Collapse>
        <Collapse isOpened={this.state.activeForm === 2}>
          <SignInForm />
        </Collapse>
      ...

  );
}

Function in SignUpForm.js that's calling .push()
handleSubmit(e) {
  ...
  this.props.history.push('/landing');
  ...
}

A: If your component is rendered from a Route (like App and Landing), then you will have access to all router related props (match, history, location). However, since SignUpForm isn't rendered with a Route, you won't have access to those props by default.
But we can use withRoute higher-order component to explicitly get those props. We just need to wrap the component with this HoC before exporting it as follows.
export default withRouter(SignUpForm);

Now it will work as expected since SignUpForm gets history prop.

A: I have figured out what my issue is. My index.js is set up as such (below) with App.js as one of the routes, not SignUpForm.js, which is a container being rendered in App.js. This means that SignUpForm.js has no notion of the history prop within App.js.
By passing App.js's history prop to SignUpForm.js as a prop, I was able to call this.props.history.push() within SignUpForm.js to get my desired action.


text:
Q: Combining Swiper slider and photoswipe I'm looking for a combination of Swiper slider and Photoswipe (Or other  lightbox).
Trying to make a product slider with 3 products in a slide.
Each product has a lightbox/modal with video and a gallery.
The modals are generated within the boundaries of the product div.
When you click an 'open gallery' / 'show video' link. The lightbox opens fullscreen.
The problem I'm having is: the lightbox won't (but has to) exceed the boundary of the slider product boundary.
Looking for a solution.
Something like an empty modal/lightbox containers outside the slider with dynamic content when an 'open modal' link is clicked within the product slide.

A: instead using photoswipe, use only swiper like in this demo I did make:
<-------html------>

                  Slide 1

                  Slide 1.1

                  Slide 1.2

                  Slide 1.3

Slide 2

Slide 3

Slide 4

Slide 5

Slide 6

Slide 7

Slide 8

Slide 9

Slide 10

<---------html end----------->
<--------css----------->
html, body {
        position: relative;
        height: 100%;
    }
    body {
        background: #eee;
        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
        font-size: 14px;
        color:#000;
        margin: 0;
        padding: 0;
    }
    .swiper-container {
        width: 100%;
        height: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;
        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
    }

<---------css end------------->
https://jsfiddle.net/120ngmoh/

A: You can check it, here is example:

    Swiper.js (5.3.7) &
    Photoswipe.js (4.1.3) - Mobile Native feel
    slider gallery

Combine two of the most powerfull JS plugins (Endless options / Great docs / Fast / Modern / Mobile freindly) -
    SWIPER IS PERFECT FOR THIS IDEA BEACUSE OF
    ITS unique preventClicks Parameter (Prevent accidental unwanted clicks on links during swiping) -
    Works like magic. Also its really hard to find - Code example of working photoswipe
    combination with any slider out there(slick, flickity, owl etc.) and
    in general slider & lightbox - so i hope this example be usefull for you.

        <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

        <button class="pswp__button pswp__button--share" title="Share"></button>

        <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

        <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

      <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
      </button>

      <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
      </button>

Noted / Important

        A non-jQuery dependent

Cdns

Head (CSS)

        <!-- photoswipe CSS -->

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css" />

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.min.css" />

        <!-- swiper CSS -->

        <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css" />

Before body (JS)

        <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.js"></script>

        <script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>

        <script src="https://unpkg.com/swiper/js/swiper.min.js"></script>

        <!-- copy-paste the code under codepen js tab her (wrap with script tag) -->

Loop & Counter

         Wont work well  with swiper: loop = true; & photoswipe: counterEl:
        true,(What is counter? example: 1/5...2/5) - "loop" duplicate images - the photoswipe counter will be
        wrong. *** If you dont want a
        loop - you can set photoswipe counter counterEl: true,

Schema.org - ImageGallery Markup (0 ERRORS 0 WARNINGS )

        Schema.org markup + semantic HTML: use unordered (bulleted) list (If you want a div under photoswipe - change JS -
        "(find) control+f-->" tagname value) . Copy-paste - this code to check: Structured Data Testing Tool - Google

Match index - BY API

          Extra CODE "match index"
         - EXAMPLE: When you click(zoom) image1 -- goes to image 2 - close image2 (X) - also the swiper update
        is position (BETTER User Experience) (find(ctr +f)-->
        mySwiper.slideTo(getCurrentIndex, false);) -
        This idea miss
        in most slider & lightbox examples/plugins mixed.

        Very simple code idea (100% API solution) - get photoswipe index (for example 2) and swiper slideTo index (2 - in this example).

          Photoswipe API - pswp.getCurrentIndex()

 Swiper API - slideTo(index);

Photoswipe options

    JS - line (find) -ctr +f --> the term:// define options (if needed). You find endless options for
    photoswipe - This is the place to add/modify options. Full Options list her
    PhotoSwipe
      Options

SWIPER options

slideperview

    slideperview - option1: Set number (1,2,3 and so on)  - example  |||||
    option2("Carousel Mode" this example): Set to "auto"
    than add CSS width
    Property .swiper-slide (in thie case eash slide is 88% width) - example.

spaceBetween & centeredSlides

  Space Between slide by js option spaceBetween - and also usefull to change
  centeredSlides(true/flase).

  Swiper API

Related Example

  #FancyBox3 -
    lightbox & Flickity Slider

/* zero custom styles for photoswipe */

/*==================================
SWIPER - minimal styling
===================================*/
/* semantic HTML - remove bullet and space from the list */
ul.swiper-wrapper {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

/* Swiper container */
.swiper-container {
  max-width: 100%;
}

/* swiper responive image */
.swiper-container img {
  width: 100%;
  height: auto;
}

.swiper-slide {
  /* Remove this if you want 1 slide perview - than change slidesPerView js-option to 1 -or- 2+ instead of 'auto' */
  width: 80%;
}

/* Swiper custom pagination */
.swiper-pagination-bullet {
  width: 34px;
  height: 34px;
  text-align: center;
  line-height: 34px;
  font-size: 14px;
  color: #000;
  opacity: 1;
  background: rgba(0, 0, 0, 0.3);
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Swiper custom pagination */
.swiper-pagination-bullet:hover {
  transition: background-color 0.5s ease;
  background: rgba(0, 0, 0, 1);
  color: white;
}

/* Swiper custom pagination active state */
.swiper-pagination-bullet-active {
  color: #fff;
  background: black;
}

/*==================================================================
CODEPEN STYLES -(under codepen gear/setting icon)
==============================================++++++================*/
.tippy-tooltip.light-theme {
  color: #26323d;
  box-shadow: 0 0 20px 4px rgba(154, 161, 177, 0.15),
    0 4px 80px -8px rgba(36, 40, 47, 0.25),
    0 4px 4px -2px rgba(91, 94, 105, 0.15);
  background-color: white;
}

.tippy-backdrop {
  background-color: white;
}

.tippy-roundarrow {
  fill: white;
}

/* Default (sharp) arrow */
.tippy-popper[x-placement^='top'] .tippy-tooltip.light-theme .tippy-arrow {
  border-top-color: #fff;
}
.tippy-popper[x-placement^='bottom'] .tippy-tooltip.light-theme .tippy-arrow {
  border-bottom-color: #fff;
}
.tippy-popper[x-placement^='left'] .tippy-tooltip.light-theme .tippy-arrow {
  border-left-color: #fff;
}
.tippy-popper[x-placement^='right'] .tippy-tooltip.light-theme .tippy-arrow {
  border-right-color: #fff;
}
/* Round arrow */
.tippy-tooltip.light-theme .tippy-roundarrow {
  fill: #fff;
}

/* TOC
part one - Swiper instilaze
part two - photoswipe instilaze
part three - photoswipe define options
part four - extra code (update swiper index when image close and micro changes)

/* 1 of 4 : SWIPER ################################### */
var mySwiper = new Swiper(".swiper-container", {
  // If swiper loop is true set photoswipe counterEl: false (line 175 her)
  loop: true,
  /* slidesPerView || auto - if you want to set width by css like flickity.js layout - in this case width:80% by CSS */
  slidesPerView: "auto",
  spaceBetween: 10,
  centeredSlides: true,
  slideToClickedSlide: false,
  autoplay: { /* remove/comment to stop autoplay  */
    delay: 3000,
    disableOnInteraction: false /* true by deafult */
  },
  // If we need pagination
  pagination: {
    el: ".swiper-pagination",
    clickable: true,
    renderBullet: function(index, className) {
      return '' + (index + 1) + "";
    }
  },
  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
  // keyboard control
  keyboard: {
    enabled: true,
  }
});

// 2 of 4 : PHOTOSWIPE #######################################
// https://photoswipe.com/documentation/getting-started.html //

var initPhotoSwipeFromDOM = function(gallerySelector) {
  // parse slide data (url, title, size ...) from DOM elements
  // (children of gallerySelector)
  var parseThumbnailElements = function(el) {
    var thumbElements = el.childNodes,
        numNodes = thumbElements.length,
        items = [],
        figureEl,
        linkEl,
        size,
        item;

    for (var i = 0; i < numNodes; i++) {
      figureEl = thumbElements[i]; //
 element

      // include only element nodes
      if (figureEl.nodeType !== 1) {
        continue;
      }

      linkEl = figureEl.children[0]; //  element

      size = linkEl.getAttribute("data-size").split("x");

      // create slide object
      item = {
        src: linkEl.getAttribute("href"),
        w: parseInt(size[0], 10),
        h: parseInt(size[1], 10)
      };

      if (figureEl.children.length > 1) {
        //
 content
        item.title = figureEl.children[1].innerHTML;
      }

      if (linkEl.children.length > 0) {
        //  thumbnail element, retrieving thumbnail url
        item.msrc = linkEl.children[0].getAttribute("src");
      }

      item.el = figureEl; // save link to element for getThumbBoundsFn
      items.push(item);
    }

    return items;
  };

  // find nearest parent element
  var closest = function closest(el, fn) {
    return el && (fn(el) ? el : closest(el.parentNode, fn));
  };

  // triggers when user clicks on thumbnail
  var onThumbnailsClick = function(e) {
    e = e || window.event;
    e.preventDefault ? e.preventDefault() : (e.returnValue = false);

    var eTarget = e.target || e.srcElement;

    // find root element of slide
    var clickedListItem = closest(eTarget, function(el) {
      return el.tagName && el.tagName.toUpperCase() === "LI";
    });

    if (!clickedListItem) {
      return;
    }

    // find index of clicked item by looping through all child nodes
    // alternatively, you may define index via data- attribute
    var clickedGallery = clickedListItem.parentNode,
        childNodes = clickedListItem.parentNode.childNodes,
        numChildNodes = childNodes.length,
        nodeIndex = 0,
        index;

    for (var i = 0; i < numChildNodes; i++) {
      if (childNodes[i].nodeType !== 1) {
        continue;
      }

      if (childNodes[i] === clickedListItem) {
        index = nodeIndex;
        break;
      }
      nodeIndex++;
    }

    if (index >= 0) {
      // open PhotoSwipe if valid index found
      openPhotoSwipe(index, clickedGallery);
    }
    return false;
  };

  // parse picture index and gallery index from URL (#&pid=1&gid=2)
  var photoswipeParseHash = function() {
    var hash = window.location.hash.substring(1),
        params = {};

    if (hash.length < 5) {
      return params;
    }

    var vars = hash.split("&");
    for (var i = 0; i < vars.length; i++) {
      if (!vars[i]) {
        continue;
      }
      var pair = vars[i].split("=");
      if (pair.length < 2) {
        continue;
      }
      params[pair[0]] = pair[1];
    }

    if (params.gid) {
      params.gid = parseInt(params.gid, 10);
    }

    return params;
  };

  var openPhotoSwipe = function(
  index,
   galleryElement,
   disableAnimation,
   fromURL
  ) {
    var pswpElement = document.querySelectorAll(".pswp")[0],
        gallery,
        options,
        items;

    items = parseThumbnailElements(galleryElement);

    // #################### 3/4 define photoswipe options (if needed) ####################
    // https://photoswipe.com/documentation/options.html //
    options = {
      /* "showHideOpacity" uncomment this If dimensions of your small thumbnail don't match dimensions of large image */
      //showHideOpacity:true,

      // Buttons/elements
      closeEl: true,
      captionEl: true,
      fullscreenEl: true,
      zoomEl: true,
      shareEl: false,
      counterEl: false,
      arrowEl: true,
      preloaderEl: true,
      // define gallery index (for URL)
      galleryUID: galleryElement.getAttribute("data-pswp-uid"),
      getThumbBoundsFn: function(index) {
        // See Options -> getThumbBoundsFn section of documentation for more info
        var thumbnail = items[index].el.getElementsByTagName("img")[0], // find thumbnail
            pageYScroll =
            window.pageYOffset || document.documentElement.scrollTop,
            rect = thumbnail.getBoundingClientRect();

        return { x: rect.left, y: rect.top + pageYScroll, w: rect.width };
      }
    };

    // PhotoSwipe opened from URL
    if (fromURL) {
      if (options.galleryPIDs) {
        // parse real index when custom PIDs are used
        // http://photoswipe.com/documentation/faq.html#custom-pid-in-url
        for (var j = 0; j < items.length; j++) {
          if (items[j].pid == index) {
            options.index = j;
            break;
          }
        }
      } else {
        // in URL indexes start from 1
        options.index = parseInt(index, 10) - 1;
      }
    } else {
      options.index = parseInt(index, 10);
    }

    // exit if index not found
    if (isNaN(options.index)) {
      return;
    }

    if (disableAnimation) {
      options.showAnimationDuration = 0;
    }

    // Pass data to PhotoSwipe and initialize it
    gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options);
    gallery.init();

    /* ########### PART 4 - EXTRA CODE  ########### */
    /* EXTRA CODE (NOT FROM photoswipe CORE) -
    1/2. UPDATE SWIPER POSITION TO THE CURRENT ZOOM_IN IMAGE (BETTER UI) */
    // photoswipe event: Gallery unbinds events
    // (triggers before closing animation)
    gallery.listen("unbindEvents", function() {
      // This is index of current photoswipe slide
      var getCurrentIndex = gallery.getCurrentIndex();
      // Update position of the slider
      mySwiper.slideTo(getCurrentIndex, false);
      // 2/2. Start swiper autoplay (on close - if swiper autoplay is true)
      mySwiper.autoplay.start();
    });
    // 2/2. Extra Code (Not from photo) - swiper autoplay stop when image zoom */
    gallery.listen('initialZoomIn', function() {
      if(mySwiper.autoplay.running){
        mySwiper.autoplay.stop();
      }
    });
  };

  // loop through all gallery elements and bind events
  var galleryElements = document.querySelectorAll(gallerySelector);

  for (var i = 0, l = galleryElements.length; i < l; i++) {
    galleryElements[i].setAttribute("data-pswp-uid", i + 1);
    galleryElements[i].onclick = onThumbnailsClick;
  }

  // Parse URL and open gallery if it contains #&pid=3&gid=1
  var hashData = photoswipeParseHash();
  if (hashData.pid && hashData.gid) {
    openPhotoSwipe(hashData.pid, galleryElements[hashData.gid - 1], true, true);
  }
};

// execute above function
initPhotoSwipeFromDOM(".my-gallery");

https://codepen.io/ezra_siton/pen/XNpJaX/


text:
Q: Detecting end of stream on streams2 I just read that if a stream uses 'data' or 'end' listeners it switches to "classic" mode and stream-handbook says:

Note that whenever you register a "data" listener, you put the stream
  into compatability mode so you lose the benefits of the new streams2
  api

So what's the best way to use benefits of new streams api? If I'm currently doing this:
gulp.src(["./src/server/**/*.coffee"])
    .pipe(coffee  bare: true ).on("error", gutil.log)
    .pipe(gulp.dest "./bin/server")
    .on 'end',-> gutil.log "successfully compiled server coffeescript"

How can I do the same thing without registering 'end' listener

A: Only calling .resume()/.pause() or adding a 'data' listener will switch the streams2 stream to a streams1 stream. You can listen for 'end' without affecting anything.
In your particular example, even if it did switch it would not affect you since you are simply piping, which works in both streams1 and streams2 modes.
Additionally, you may not see an 'end' event if that last stream (gulp.dest "./bin/server") is not a Duplex stream or you do not consume data from it. If it is only a Writable stream, you should listen for 'finish' instead ('end' is only emitted on Readable streams).


text:
Q: Database Migration from SQL Server 2008 R2 to 2014 How to migrate all database at a time from SQL Server 2008 R2 to SQL Server 2014.
Single database can be migrated, restored and import successfully, but unable to attache database due to compatibility issue.


text:
Q: Did WPF announce a date or a version which will allow UI background thread? Did WPF announce a date or a version which will allow UI background thread?

A: You can set a simple value used in data binding from a background thread, right now.  There have been hints (see Rob Relyea's PDC talk) that some future version of WPF will allow bound collections to be modified from background threads, as well.  This would, I'm sure, not happen until at least the next major release of WPF, as it wasn't included in .NET 4.0.
That being said, there have been no discussions about allowing direct access to UI elements from background threads.


text:
Q: How Do I Compare Two Characters Ignoring Accents And Other Special Symbols?
Possible Duplicate:
Accent insensitive string comparison?

I need to compare two different characters, ignoring their accents (if they have any) and any other special symbols.
That being said, if I compare 'É' == 'E' it should give me true as the result (it should treat both characters as the same one). Same if I compare 'Õ' == 'O'.


text:
Q: ArgumentError (string contains null byte) when uploading file in rails I am trying to use the roo gem to run some operations on an excel File.  This works perfectly when I do it manually:
file = File.join(Rails.root, 'october_data.xlsx')
spreadsheet = Roo::Excelx.new(file)

However, this does not work when I upload the file via a form:
file = File.read params["Team Changes"]["document"].path
spreadsheet = Roo::Excelx.new(file)

I get the following error:
 ArgumentError (string contains null byte)

There seems to be a lot written about string contains null byte but nothing I've seen seems relevant to what I'm working on.  How do I fix this?

A: This happened to me. Apparently it is an encoding issue.
Try specifying encoding to 'ASCII-8BIT' when you read the file.
file = File.read(params["Team Changes"]["document"].path, encoding: 'ASCII-8BIT')
spreadsheet = Roo::Excelx.new(file)


text:
Q: How to Toggle post content within a "post" title in a page? I'm trying to give all "posts" title in a specific page. So If someone clicks on that posts, it's content must be toggle below the title and if some clicks the title again then the content must hide.
I solved half of the problem with the help of WP-Archives Plugin. And my page is looking like this Check this image here.. So these are
"Archives" titles links. And if someone clicks on it, it will take to the that.. I want the content in the particular posts to be in the same page in the form of toggle (in abvoe image..). Is it possible?

A: It sounds like you're describing an accordion function. Wordpress offers a bunch of accordion plugins. Here are a few:
http://wordpress.org/plugins/tags/accordion
If you're looking for something with a little more control you might want to look straight into the jquery accordion widget. See information here: http://jqueryui.com/accordion/
EDIT
To add the accordion plugin to your list, you'll need to apply the following changes. Add the following to your head tag:

In your wp-archives plugin modify the following line:
echo "

\n";

to this:
echo "

\n";

As for the content that should follow each post title, You will need to update the plugin once again to include the archive post content(either the entire post or a snippet, whichever you choose). It should look something like this if the database field holding the content were named "post_content".
$arcresults2 = $wpdb->get_results("SELECT ID, post_date, post_title, post_content, comment_status FROM " . $wpdb-> posts . " WHERE post_date LIKE '$thisyear-$thismonth-%' AND $current_posts AND post_status='publish' AND post_password='' ORDER BY post_date DESC");
...

...
$arc_title = $arcresult2->post_title;
$arc_content = $arcresult2->post_content;
...

...
echo "
" . wptexturize($text) .  "\n";
echo"

".$arc_content."

\n";

A: This is possible with an accordion script like jQueryUI Accordion, but if you want to apply this to your posts page, you will also have to edit your page template.
Here is one simple method (see source):

1) Add the following to your theme's functions.php
function add_accordion_script() {
  wp_enqueue_script('acc', get_template_directory_uri() . '/acc.js', array('jquery-ui-accordion'));
}
add_action('wp_enqueue_scripts', 'add_accordion_script');

2) Create acc.js in your themes directory thus:
jQuery(document).ready(function($) {
    $( "#accordion" ).accordion({
            header: "div.accordion-header",
            collapsible: true,
            active:false });
});

3) Finally modify your theme page to something like this:
<?php if (have_posts()): ?>

    <?php while (have_posts()) : the_post();?>

<?php the_title();?>

            <?php the_excerpt();?>

<?php the_content();?>

    <?php endwhile; ?>

<?php else:?>

<?php _e('No posts'); ?>

<?php endif;?>

Depending on your wordpress template this may be more complicated to implement than is outlined above... in which case you'd have to provide more information.
Another alternative would be to use some sort of plugin specifically designed for this purpose. I found three that might work for you, but they do not seem to be well supported/maintained... so the above method may still be your best option:

*

*Wordpress jQuery Accordion Plugin

*WP Post Accordion

*Read More Right Here Plugin

A: Collapse-O-Matic Plugin for wordpress is another alternative for this which is working like a charm for my website but only if I'm changing it to default theme of Wordpress :(. Seems like there is any glitch in my theme. Anyways, thanks for all the responses posted above.


text:
Q: boost python threading segmentation fault Consider the following straightforward python extension. When start()-ed, Foo will just add the next sequential integer to a py::list, once a second:
#include <boost/python.hpp>
#include <thread>
#include <atomic>

namespace py = boost::python;

struct Foo {
    Foo() : running(false) { }
    ~Foo() { stop(); }

    void start() {
        running = true;
        thread = std::thread([this]{
            while(running) {
                std::cout << py::len(messages) << std::end;
                messages.append(py::len(messages));
                std::this_thread::sleep_for(std::chrono::seconds(1));
            }
        });
    }

    void stop() {
        if (running) {
            running = false;
            thread.join();
        }
    }

    std::thread thread;
    py::list messages;
    std::atomic<bool> running;
};

BOOST_PYTHON_MODULE(Foo)
{
    PyEval_InitThreads();

    py::class_<Foo, boost::noncopyable>("Foo",
        py::init<>())
        .def("start", &Foo::start)
        .def("stop", &Foo::stop)
    ;
}

Given the above, the following simple python script segfaults all the time, never even printing anything:
>>> import Foo
>>> f = Foo.Foo()
>>> f.start()
>>> Segmentation fault (core dumped)

With the core pointing to:
namespace boost { namespace python {

    inline ssize_t len(object const& obj)
    {
        ssize_t result = PyObject_Length(obj.ptr());
        if (PyErr_Occurred()) throw_error_already_set(); // <==
        return result;
    }

}} // namespace boost::python

Where:
(gdb) inspect obj
$1 = (const boost::python::api::object &) @0x62d368: {<boost::python::api::object_base> = {<boost::python::api::object_operators<boost::python::api::object>> = {<boost::python::def_visitor<boost::python::api::object>> = {<No data fields>}, <No data fields>}, m_ptr = []}, <No data fields>}
(gdb) inspect obj.ptr()
$2 = []
(gdb) inspect result
$3 = 0

Why does this fail when run in a thread? obj looks fine, result gets set correctly. Why does PyErr_Occurred() happen? Who sets that?

A: In short, there is a mutex around the CPython interpreter known as the Global Interpreter Lock (GIL).   This mutex prevents parallel operations to be performed on Python objects. Thus, at any point in time, a max of one thread, the one that has acquired the GIL, is allowed to perform operations on Python objects.  When multiple threads are present, invoking Python code whilst not holding the GIL results in undefined behavior.
C or C++ threads are sometimes referred to as alien threads in the Python documentation. The Python interpreter has no ability to control the alien thread.  Therefore, alien threads are responsible for managing the GIL to permit concurrent or parallel execution with Python threads.  With this in mind, lets examine the original code:
while (running) {
  std::cout << py::len(messages) << std::endl;           // Python
  messages.append(py::len(messages));                    // Python
  std::this_thread::sleep_for(std::chrono::seconds(1));  // No Python
}

As noted above, only two of the three lines in the thread body need to run whilst the thread owns the GIL.  One common way to handle this is to use  an RAII classes to help manage the GIL.  For example, with the following gil_lock class, when a gil_lock object is created, the calling thread will acquire the GIL.  When the gil_lock object is destructed, it releases the GIL.
/// @brief RAII class used to lock and unlock the GIL.
class gil_lock
{
public:
  gil_lock()  { state_ = PyGILState_Ensure(); }
  ~gil_lock() { PyGILState_Release(state_);   }
private:
  PyGILState_STATE state_;
};

The thread body can then use explicit scope to control the lifetime of the lock.
while (running) {
  // Acquire GIL while invoking Python code.
  {
    gil_lock lock;
    std::cout << py::len(messages) << std::endl;
    messages.append(py::len(messages));
  }
  // Release GIL, allowing other threads to run Python code while
  // this thread sleeps.
  std::this_thread::sleep_for(std::chrono::seconds(1));
}

Here is a complete example based on the original code that demonstrates the program working properly once the GIL is explicitly managed:
#include <thread>
#include <atomic>
#include <iostream>
#include <boost/python.hpp>

/// @brief RAII class used to lock and unlock the GIL.
class gil_lock
{
public:
  gil_lock()  { state_ = PyGILState_Ensure(); }
  ~gil_lock() { PyGILState_Release(state_);   }
private:
  PyGILState_STATE state_;
};

struct foo
{
  foo() : running(false) {}
  ~foo() { stop(); }

  void start()
  {
    namespace python = boost::python;
    running = true;
    thread = std::thread([this]
      {
        while (running)
        {
          {
            gil_lock lock; // Acquire GIL.
            std::cout << python::len(messages) << std::endl;
            messages.append(python::len(messages));
          } // Release GIL.
          std::this_thread::sleep_for(std::chrono::seconds(1));
        }
      });
  }

  void stop()
  {
    if (running)
    {
      running = false;
      thread.join();
    }
  }

  std::thread thread;
  boost::python::list messages;
  std::atomic<bool> running;
};

BOOST_PYTHON_MODULE(example)
{
  // Force the GIL to be created and initialized.  The current caller will
  // own the GIL.
  PyEval_InitThreads();

  namespace python = boost::python;
  python::class_<foo, boost::noncopyable>("Foo", python::init<>())
    .def("start", &foo::start)
    .def("stop", &foo::stop)
    ;
}

Interactive usage:
>>> import example
>>> import time
>>> foo = example.Foo()
>>> foo.start()
>>> time.sleep(3)
0
1
2
>>> foo.stop()
>>>


text:
Q: Parent Select CSS I need to apply a css style to the li element that contains the a element with attribute title equals to "Home"

1

2

3

4

5

I've tried with this selector but it doesn't work
li<a[title="Home"]{display:none;}

What css i should apply?
Thanks


text:
Q: spring jpa auditing lastmodifiedby and lastmodifiedDate are ok, but createdBy and createdDate annotation are always null I'm trying to setup (as a java beginner) spring jpa auditing for hours/days now ... and I'm starting to get very frustrating as I can't find the problem.
I would really appreciate some help.
@LastModifiedBy and @LastModifiedDate annotations are working, but @CreatedBy and @CreatedDate are always NULL.
Here is the sql query debugging output:
2017-06-16 16:40:39 [main] DEBUG n.t.d.l.l.SLF4JQueryLoggingListener n.t.d.s.SLF4JLogUtils writeLog -
Name:, Time:0, Success:False, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:
    ["update APPLICANT set APT_AGE_CRE=?, APT_DTE_CRE=?, APT_AGE_UPD=?, APT_DTE_UPD=?, APT_ADDRESS=?, APT_BIRTHDATE=?, APT_CITY=?, APT_FIRSTNAME=?,
    APT_INTERNAL_REF=?, APT_LASTNAME=?, APT_MATRICULE=?, APT_NATIONALITY=?, APT_COUNTRY=?, APT_SEX=?, APT_STATUS=?, APT_ZIP_CODE=?
    where PK_APT_NUM_ID=?"],
Params:[(NULL(INTEGER),NULL(TIMESTAMP),1,2017-06-16 16:40:39.618,1, rue des totos,1985-12-30 00:00:00.0,NULL(VARCHAR),Toto,NULL(INTEGER),Xyz,122222222126,127,127,M,NULL(VARCHAR),NULL(INTEGER),1)]
The important part is the first 2 parameters which are the @createdBy and @CreatedDate:
(NULL(INTEGER),NULL(TIMESTAMP),1,2017-06-16 16:40:39.618
The @ModifiedBy has value: 1
and the @ModifiedDate has value: 2017-06-16 16:40:39.618
Both are correct.
public class AuditorAwareImpl implements AuditorAware<Agent>{
protected static final Logger LOGGER_DEBUG = LoggerFactory.getLogger("debug");
@Override
public Agent getCurrentAuditor() {
    LOGGER_DEBUG.debug("Loading auditor");
    Agent agent = new Agent();
    agent.setId(1);
    return agent;
}

@MappedSuperclass
@EntityListeners(value = {AuditingEntityListener.class})
public class AbstractAuditedEntity extends AbstractEntity {

    private static final long serialVersionUID = 7151010030414095019L;

    @CreatedBy
    @OneToOne @JoinColumn(name = "APT_AGE_CRE", nullable = false)
    protected Agent createdBy;

    @CreatedDate
    @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")
    @Column(name = "APT_DTE_CRE", nullable = false) //@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
    protected ZonedDateTime creationTime;

    @LastModifiedBy
    @OneToOne @JoinColumn(name = "APT_AGE_UPD", nullable = false)
    protected Agent updatedBy;

    @LastModifiedDate
    @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")
    @Column(name = "APT_DTE_UPD", nullable = false) //@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
    protected ZonedDateTime updatingTime;

}

public class Applicant extends AbstractAuditedEntity  {

private static final long serialVersionUID = -5651129526769191543L;

@Id
@Column(name = "PK_APT_NUM_ID")
@SequenceGenerator(name = "ApplicantSequence", sequenceName = "SEQ_APPLICANT", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ApplicantSequence")
private Integer id;

@Column(name = "APT_INTERNAL_REF")
private Integer internalRef;

@NaturalId(mutable = true)
@Column(name = "APT_MATRICULE", unique = true, length = 13)
@NotNull
@MatriculeValidator
private String matricule;

@Column(name = "APT_SEX", length = 1)
@Enumerated(EnumType.STRING)
@NotNull
private SexCode sexCode;

@Column(name = "APT_LASTNAME", length = 100)
@NotNull
private String lastName;

@Column(name = "APT_FIRSTNAME", length = 100)
@NotNull
private String firstName;

@Column(name = "APT_STATUS", length = 1)
@Enumerated(EnumType.STRING)
private ApplicantStatusCode statusCode;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "APT_COUNTRY", foreignKey = @ForeignKey(name = "FK_APT_COUNTRY"))
private Country residencyCountry;

@Column(name = "APT_BIRTHDATE")
@NotNull
@DateTimeFormat(pattern = "dd/MM/yyyy")
private ZonedDateTime birthdate;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "APT_NATIONALITY", foreignKey = @ForeignKey(name = "FK_APT_NATIONALITY"))
private Country nationality;

@Column(name = "APT_ZIP_CODE")
private Integer zipCode;

@Column(name = "APT_ADDRESS", length = 250)
private String address;

@Column(name = "APT_CITY", length = 60)
private String city;

Now orm.xml and applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
        xmlns="http://java.sun.com/xml/ns/persistence/orm"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" version="2.0">
    <persistence-unit-metadata>
        <persistence-unit-defaults>
            <entity-listeners>
                <entity-listener class="org.springframework.data.jpa.domain.support.AuditingEntityListener" />
            </entity-listeners>
        </persistence-unit-defaults>
    </persistence-unit-metadata>
</entity-mappings>

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:jpa="http://www.springframework.org/schema/data/jpa"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:annotation-config/>

    <jpa:repositories base-package="aficom.model.repository" entity-manager-factory-ref="entityManagerFactory"
                      transaction-manager-ref="transactionManager"/>

    <bean id="auditorBean" class="aficom.model.audit.AuditorAwareImpl"/>
    <jpa:auditing auditor-aware-ref="auditorBean"/>

    <bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp2.BasicDataSource">
        <property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
        <property name="username" value="aficom"/>
        <property name="password" value="1234"/>
    </bean>

    <!-- sql proxy -->
    <bean id="dataSourceProxy" class="net.ttddyy.dsproxy.support.ProxyDataSource">
        <property name="dataSource" ref="dataSource"/>
        <property name="listener" ref="listeners"/>
    </bean>
    <bean id="listeners" class="net.ttddyy.dsproxy.listener.ChainListener">
        <property name="listeners">
            <list>
                <bean class="net.ttddyy.dsproxy.listener.logging.SLF4JQueryLoggingListener"/>
                <bean class="net.ttddyy.dsproxy.listener.DataSourceQueryCountListener"/>
            </list>
        </property>
    </bean>
    <!-- end sql proxy -->

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="aficom"/>
        <property name="packagesToScan" value="aficom.model"/>
        <!-- use sql proxy as datasource -->
        <property name="dataSource" ref="dataSourceProxy"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="true"/>
                <property name="database" value="ORACLE"/>
                <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect"/>
            </bean>
        </property>
        <property name="jpaProperties">
            <props>
                <!-- required jadira config for spring jpa auditing -->
                <prop key="jadira.usertype.autoRegisterUserTypes">true</prop>
                <prop key="jadira.usertype.javaZone">UTC</prop>
                <prop key="jadira.usertype.databaseZone">UTC</prop>
            </props>
        </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager"/>
</beans>

The test I'm trying to run:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "classpath:applicationContext.xml"})
@Transactional
public class TestRepo {

    protected static final Logger LOGGER_MODEL = LoggerFactory.getLogger("model");

    @PersistenceContext protected EntityManager entityManager;

    @Test
    @Rollback(false)
    @Transactional
    public void saveApplicant(){

        Applicant a = new Applicant();
        a.setId(1);
        a.setFirstName("Toto");
        a.setLastName("Xyz");
        a.setAddress("1, rue des totos");
        a.setMatricule("122222222126");
        a.setSexCode(SexCode.M);
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
        LocalDateTime localDate = LocalDate.parse("30/12/1985",formatter).atStartOfDay();
        ZonedDateTime zone = ZonedDateTime.of(localDate, ZoneId.of("Europe/Luxembourg"));
        a.setBirthdate(zone);
        a.setResidencyCountry(this.entityManager.find(Country.class,127));
        a.setNationality(this.entityManager.find(Country.class,127));
        LOGGER_MODEL.debug(a.toString());

        this.repo.save(a);
    }

Some of the log output:
2017-06-16 16:40:38 [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean o.s.o.j.AbstractEntityManagerFactoryBean buildNativeEntityManagerFactory - Initialized JPA EntityManagerFactory for persistence unit 'aficom'
2017-06-16 16:40:39 [main] INFO  o.s.t.c.t.TransactionContext o.s.t.c.t.TransactionContext startTransaction - Began transaction (1) for test context [DefaultTestContext@73c31181 testClass = TestRepo, testInstance = TestRepo@3d620a1, testMethod = saveApplicant@TestRepo, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@ef718de testClass = TestRepo, locations = '{classpath:TEST-applicationContextDao.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{}', contextCustomizers = set[[empty]], contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@5e5beb8a]; rollback [false]
Hibernate: select country0_.PK_COU_NUM_ID as PK_COU_NUM_ID1_2_0_, country0_.COU_IBAN_PATTERN as COU_IBAN_PATTERN2_2_0_, country0_.COU_ISO_2 as COU_ISO_3_2_0_, country0_.COU_ISO_3 as COU_ISO_4_2_0_, country0_.COU_LANG as COU_LANG5_2_0_, country0_.COU_NAME as COU_NAME6_2_0_, country0_.COU_NATIONALITY as COU_NATIONALITY7_2_0_, country0_.COU_ZIP_CODE as COU_ZIP_CODE8_2_0_ from COUNTRY country0_ where country0_.PK_COU_NUM_ID=?
2017-06-16 16:40:39 [main] DEBUG n.t.d.l.l.SLF4JQueryLoggingListener n.t.d.s.SLF4JLogUtils writeLog - Name:, Time:2, Success:True, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:["select country0_.PK_COU_NUM_ID as PK_COU_NUM_ID1_2_0_, country0_.COU_IBAN_PATTERN as COU_IBAN_PATTERN2_2_0_, country0_.COU_ISO_2 as COU_ISO_3_2_0_, country0_.COU_ISO_3 as COU_ISO_4_2_0_, country0_.COU_LANG as COU_LANG5_2_0_, country0_.COU_NAME as COU_NAME6_2_0_, country0_.COU_NATIONALITY as COU_NATIONALITY7_2_0_, country0_.COU_ZIP_CODE as COU_ZIP_CODE8_2_0_ from COUNTRY country0_ where country0_.PK_COU_NUM_ID=?"], Params:[(127)]
Hibernate: select applicant0_.PK_APT_NUM_ID as PK_APT_NUM_ID1_1_0_, applicant0_.APT_AGE_CRE as APT_AGE_CRE14_1_0_, applicant0_.APT_DTE_CRE as APT_DTE_CRE2_1_0_, applicant0_.APT_AGE_UPD as APT_AGE_UPD15_1_0_, applicant0_.APT_DTE_UPD as APT_DTE_UPD3_1_0_, applicant0_.APT_ADDRESS as APT_ADDRESS4_1_0_, applicant0_.APT_BIRTHDATE as APT_BIRTHDATE5_1_0_, applicant0_.APT_CITY as APT_CITY6_1_0_, applicant0_.APT_FIRSTNAME as APT_FIRSTNAME7_1_0_, applicant0_.APT_INTERNAL_REF as APT_INTERNAL_REF8_1_0_, applicant0_.APT_LASTNAME as APT_LASTNAME9_1_0_, applicant0_.APT_MATRICULE as APT_MATRICULE10_1_0_, applicant0_.APT_NATIONALITY as APT_NATIONALITY16_1_0_, applicant0_.APT_COUNTRY as APT_COUNTRY17_1_0_, applicant0_.APT_SEX as APT_SEX11_1_0_, applicant0_.APT_STATUS as APT_STATUS12_1_0_, applicant0_.APT_ZIP_CODE as APT_ZIP_CODE13_1_0_ from APPLICANT applicant0_ where applicant0_.PK_APT_NUM_ID=?
2017-06-16 16:40:39 [main] DEBUG n.t.d.l.l.SLF4JQueryLoggingListener n.t.d.s.SLF4JLogUtils writeLog - Name:, Time:3, Success:True, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:["select applicant0_.PK_APT_NUM_ID as PK_APT_NUM_ID1_1_0_, applicant0_.APT_AGE_CRE as APT_AGE_CRE14_1_0_, applicant0_.APT_DTE_CRE as APT_DTE_CRE2_1_0_, applicant0_.APT_AGE_UPD as APT_AGE_UPD15_1_0_, applicant0_.APT_DTE_UPD as APT_DTE_UPD3_1_0_, applicant0_.APT_ADDRESS as APT_ADDRESS4_1_0_, applicant0_.APT_BIRTHDATE as APT_BIRTHDATE5_1_0_, applicant0_.APT_CITY as APT_CITY6_1_0_, applicant0_.APT_FIRSTNAME as APT_FIRSTNAME7_1_0_, applicant0_.APT_INTERNAL_REF as APT_INTERNAL_REF8_1_0_, applicant0_.APT_LASTNAME as APT_LASTNAME9_1_0_, applicant0_.APT_MATRICULE as APT_MATRICULE10_1_0_, applicant0_.APT_NATIONALITY as APT_NATIONALITY16_1_0_, applicant0_.APT_COUNTRY as APT_COUNTRY17_1_0_, applicant0_.APT_SEX as APT_SEX11_1_0_, applicant0_.APT_STATUS as APT_STATUS12_1_0_, applicant0_.APT_ZIP_CODE as APT_ZIP_CODE13_1_0_ from APPLICANT applicant0_ where applicant0_.PK_APT_NUM_ID=?"], Params:[(1)]
Hibernate: select agent0_.PK_AGE_NUM_ID as PK_AGE_NUM_ID1_0_0_, agent0_.AGE_ACTIVE as AGE_ACTIVE2_0_0_, agent0_.AGE_EMAIL as AGE_EMAIL3_0_0_, agent0_.AGE_FIRSTNAME as AGE_FIRSTNAME4_0_0_, agent0_.AGE_IAM as AGE_IAM5_0_0_, agent0_.AGE_INFOS as AGE_INFOS6_0_0_, agent0_.AGE_LASTNAME as AGE_LASTNAME7_0_0_, agent0_.AGE_MATRICULE as AGE_MATRICULE8_0_0_, agent0_.AGE_PHONE as AGE_PHONE9_0_0_, agent0_.AGE_PROFILE as AGE_PROFILE10_0_0_, agent0_.AGE_TITLE as AGE_TITLE11_0_0_ from AGENT agent0_ where agent0_.PK_AGE_NUM_ID=?
2017-06-16 16:40:39 [main] DEBUG n.t.d.l.l.SLF4JQueryLoggingListener n.t.d.s.SLF4JLogUtils writeLog - Name:, Time:1, Success:True, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:["select agent0_.PK_AGE_NUM_ID as PK_AGE_NUM_ID1_0_0_, agent0_.AGE_ACTIVE as AGE_ACTIVE2_0_0_, agent0_.AGE_EMAIL as AGE_EMAIL3_0_0_, agent0_.AGE_FIRSTNAME as AGE_FIRSTNAME4_0_0_, agent0_.AGE_IAM as AGE_IAM5_0_0_, agent0_.AGE_INFOS as AGE_INFOS6_0_0_, agent0_.AGE_LASTNAME as AGE_LASTNAME7_0_0_, agent0_.AGE_MATRICULE as AGE_MATRICULE8_0_0_, agent0_.AGE_PHONE as AGE_PHONE9_0_0_, agent0_.AGE_PROFILE as AGE_PROFILE10_0_0_, agent0_.AGE_TITLE as AGE_TITLE11_0_0_ from AGENT agent0_ where agent0_.PK_AGE_NUM_ID=?"], Params:[(1)]
2017-06-16 16:40:39 [main] DEBUG debug l.e.m.a.m.a.AuditorAwareImpl getCurrentAuditor - Loading auditor
2017-06-16 16:40:39 [main] DEBUG debug l.e.m.a.m.a.AuditorAwareImpl getCurrentAuditor - Loading auditor
Hibernate: update APPLICANT set APT_AGE_CRE=?, APT_DTE_CRE=?, APT_AGE_UPD=?, APT_DTE_UPD=?, APT_ADDRESS=?, APT_BIRTHDATE=?, APT_CITY=?, APT_FIRSTNAME=?, APT_INTERNAL_REF=?, APT_LASTNAME=?, APT_MATRICULE=?, APT_NATIONALITY=?, APT_COUNTRY=?, APT_SEX=?, APT_STATUS=?, APT_ZIP_CODE=? where PK_APT_NUM_ID=?
2017-06-16 16:40:39 [main] DEBUG n.t.d.l.l.SLF4JQueryLoggingListener n.t.d.s.SLF4JLogUtils writeLog - Name:, Time:0, Success:False, Type:Prepared, Batch:False, QuerySize:1, BatchSize:0, Query:["update APPLICANT set APT_AGE_CRE=?, APT_DTE_CRE=?, APT_AGE_UPD=?, APT_DTE_UPD=?, APT_ADDRESS=?, APT_BIRTHDATE=?, APT_CITY=?, APT_FIRSTNAME=?, APT_INTERNAL_REF=?, APT_LASTNAME=?, APT_MATRICULE=?, APT_NATIONALITY=?, APT_COUNTRY=?, APT_SEX=?, APT_STATUS=?, APT_ZIP_CODE=? where PK_APT_NUM_ID=?"], Params:[(NULL(INTEGER),NULL(TIMESTAMP),1,2017-06-16 16:40:39.618,1, rue des totos,1985-12-30 00:00:00.0,NULL(VARCHAR),Toto,NULL(INTEGER),Xyz,1122222222126,127,127,M,NULL(VARCHAR),NULL(INTEGER),1)]
2017-06-16 16:40:39 [main] WARN  o.h.e.j.s.SqlExceptionHelper o.h.e.j.s.SqlExceptionHelper logExceptions - SQL Error: 1407, SQLState: 72000
2017-06-16 16:40:39 [main] ERROR o.h.e.j.s.SqlExceptionHelper o.h.e.j.s.SqlExceptionHelper logExceptions - ORA-01407: cannot update ("AFICOM"."APPLICANT"."APT_DTE_CRE") to NULL

2017-06-16 16:40:39 [main] INFO  o.h.e.j.b.i.AbstractBatchImpl o.h.e.j.b.i.AbstractBatchImpl release - HHH000010: On release of batch it still contained JDBC statements
2017-06-16 16:40:39 [main] ERROR o.h.i.ExceptionMapperStandardImpl o.h.i.ExceptionMapperStandardImpl mapManagedFlushFailure - HHH000346: Error during managed flush [org.hibernate.exception.ConstraintViolationException: could not execute statement]
2017-06-16 16:40:39 [main] WARN  o.s.t.c.TestContextManager o.s.t.c.TestContextManager afterTestMethod - Caught exception while allowing TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener@4cf4d528] to process 'after' execution for test: method [public void TestRepo.saveApplicant()], instance [TestRepo@3d620a1], exception [null]
org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:278)
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
    at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)
    at org.springframework.test.context.transaction.TransactionContext.endTransaction(TransactionContext.java:128)
    at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:227)
    at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:319)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:94)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.hibernate.dialect.Oracle8iDialect$3.convert(Oracle8iDialect.java:551)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:208)
    at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
    at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3188)
    at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3067)
    at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3447)
    at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:145)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:589)
    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463)
    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1435)
    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:491)
    at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3201)
    at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2411)
    at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)
    at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:146)
    at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
    at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:220)
    at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
    at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)
    ... 24 common frames omitted
Caused by: java.sql.SQLException: ORA-01407: cannot update ("AFICOM"."APPLICANT"."APT_DTE_CRE") to NULL

    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)
    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:910)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)
    at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)
    at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3865)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3845)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1061)
    at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
    at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.ttddyy.dsproxy.proxy.PreparedStatementProxyLogic.invoke(PreparedStatementProxyLogic.java:171)
    at net.ttddyy.dsproxy.proxy.jdk.PreparedStatementInvocationHandler.invoke(PreparedStatementInvocationHandler.java:32)
    at com.sun.proxy.$Proxy63.executeUpdate(Unknown Source)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:205)
    ... 43 common frames omitted
Caused by: oracle.jdbc.OracleDatabaseException: ORA-01407: cannot update ("AFICOM"."APPLICANT"."APT_DTE_CRE") to NULL

    at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:498)
    ... 67 common frames omitted

Process finished with exit code -1

A: Oh my god ... this was so stupid .... I found the problem here: https://github.com/jhipster/generator-jhipster/issues/1774 .
The Problem was that I do an update and while updating the createby and createDate are always NULL. I' have know added the "updatable = false" to both fields and it now working.
So my AbstractAuditedEntity looks some what like this, please note the "updatable = false" :
@CreatedBy
    @OneToOne @JoinColumn(name = "APT_AGE_CRE", nullable = false, updatable = false)
    protected Agent createdBy;

    @CreatedDate
    @Type(type = "org.jadira.usertype.dateandtime.threeten.PersistentZonedDateTime")
    @Column(name = "APT_DTE_CRE", nullable = false, updatable = false) //@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
    protected ZonedDateTime creationTime;


text:
Q: How to make it so that my initial list remains unchanged? (Python) Summary: Program takes in 5 inputs from the user (1 string and 4 integers). For the exercise, I'm doing we need to convert the placing into points e.g. 1st place = 5pts, 2nd place = 3pts, 3rd place = 1pts, anything else = 0pts. Then the result will be printed out.
def calc_points(points):
    for i in range(len(points)):
        if points[i] == 1:
            points[i] = 5
        elif points[i] == 2:
            points[i] = 3
        elif points[i] == 3:
            points[i] = 1
        else:
            points[i] = 0
    return points

def get_place():

    place = []

    place.append(int(input("What place did you come in for your first race?\n> ")))
    place.append(int(input("What place did you come in for your second race?\n> ")))
    place.append(int(input("What place did you come in for your third race?\n> ")))
    place.append(int(input("What place did you come in for your fourth race?\n> ")))
    return place

def get_rider_info():
    rider_info = []
    rider_info.append(input("What is the Rider's Name?\n> "))

    points = get_place()

    total_points = sum(calc_points(points))
    points.append(total_points)

    rider_info.extend(points)

    return rider_info

rider1 = get_rider_info()
print(rider1)

The problem is when the calc_points() is executed the list points changes e.g. input: Bob, 1, 2, 3, 4 Output: ['Bob', 5, 3, 1, 0, 9] when I want it to be ['Bob', 1, 2, 3, 4, 9].

A: In python when you pass a list, the list is not copied; you are passing the original list object itself, hence the actual elements themselves gets altered. Instead, you can create a new list in your calc_points like:
def calc_points(points):
    L=[]
    for i in range(len(points)):
        if points[i] == 1:
            L.append(5)
        elif points[i] == 2:
            L.append(3)
        elif points[i] == 3:
            L.append(1)
        else:
            L.append(0)
    return L

A: Because your list has only immutable values (integers are immutable), to do a copy, you can just use a slice which selects all the elements of the list:
def calc_points(points):
    points = points[:]
    for i in range(len(points)):
        if points[i] == 1:
            points[i] = 5
        elif points[i] == 2:
            points[i] = 3
        elif points[i] == 3:
            points[i] = 1
        else:
            points[i] = 0
    return points

def get_place():

    place = []

    place.append(int(input("What place did you come in for your first race?\n> ")))
    place.append(int(input("What place did you come in for your second race?\n> ")))
    place.append(int(input("What place did you come in for your third race?\n> ")))
    place.append(int(input("What place did you come in for your fourth race?\n> ")))
    return place

def get_rider_info():
    rider_info = []
    rider_info.append(input("What is the Rider's Name?\n> "))

    points = get_place()

    total_points = sum(calc_points(points))
    points.append(total_points)

    rider_info.extend(points)

    return rider_info

rider1 = get_rider_info()
print(rider1)

If you want to learn more about this behavior, see this question.

A: While the above solutions will produce expected results, the issue is that you are confusing ranks and points.  It is better to create a separate array for the points, and use a different name for the ranks.  Here is a cleaned up calc_points method.
def calc_points(ranks):
    points = []
    for rank in ranks:
        if rank == 1:
            points.append(5)
        elif rank == 2:
            points.append(3)
        elif rank == 3:
            points.append(1)
        else:
            points.append(0)
    return points


text:
Q: Http Post for WebClient I am trying to test my Post endpoint using WebClient of Vertx and always get 500 as a status code.
Can anyone please let me know what am I doing wrong here:-
final String jsonBody = "{\"url\": \"https://www.google.se\"}";
    WebClient.create(vertx)
            .post(8080, "::1", "/service")
            .sendJson(
                jsonBody,
                response ->
                    testContext.verify(
                        () -> {
                          System.out.println(response.result().statusCode());
                          assertEquals("OK", response.result());
                        }));

A: 500 is an internal server error.
It is not getting the required data in your case..I guess.
So try to send the payload using

*

*Convert string to jsonobject and send usig sendJsonObject method

*Convert buffer to jsonobject and send usig sendBuffer method

A: This should work for you. I show both the Vert.x client and the handler. The client creates a JsonObject from the string. The handler is in the server.
@Test
public void testPostURL(TestContext context) {
    Async async = context.async();
    final String body = "{\"url\": \"https://www.google.se\"}";
    WebClient.create(vertx)
            .post(8080, "localhost", "/service")
            .putHeader("content-type", "application/json")
            .sendJson( new JsonObject(body),
                     requestResponse -> {
                        context.assertEquals(requestResponse.result().statusCode(), 200);
                        async.complete();
                    });
}

The handler expects a JsonObject and returns the url (https://www.google.se)
    private void service(RoutingContext rc) {
    HttpServerResponse response = rc.response();
    JsonObject body = rc.getBodyAsJson();
    String site = body.getString("url");
    response.setStatusCode(200)
            .putHeader("content-type", "application/json; charset=utf-8")
            .end(Json.encodePrettily(site));
}


text:
Q: permutations and variations for chatbot user intents (first time posting, be nice. Also, I'm learning how to code, so I may not ask this question in the right way, be nice) I'm designing a chatbot and I'm having trouble finding a solution that creates all the possible permutations and variations for how a user would ask a question or make a request.  For example, if a user wants to know the weather they could ask "Wha't the weather?" or "Will it be sunny tomorrow?" or, or, or.  Any resources you could point me to will be appreciated.

A: This is called natural language processing and is not trivial. I wouldn't recommend working on something as complex as this for a beginner. https://en.wikipedia.org/wiki/Natural_language_processing
I found a couple threads where people wanted to do the same thing.
Any tutorials for developing chatbots?
https://softwareengineering.stackexchange.com/questions/132165/programming-a-chatterbot-understanding-language
But yeah, this isn't easy.


text:
Q: Spring Boot Suggestions Endpoint Optimization I have a microservice that have Rest endpoint which returns suggested item names. For every character entered in the text field (Min 3 character) this endpoint is invoked.
The endpoint internally calls elastic search which fetches the items based on query string.
When RPM increases with APM monitoring there is a huge spike in the heap consumptions as well.
Any idea how could I optimize this endpoint?


text:
Q: Android Find Phone App I am playing around and I am trying to make a Android find phone app like the onces in the market place.  if someone text my phone "beep" I want the phone to make a loud sound and if the phone is on silent i still want the sounds. I was thinking to use a alarm but the alarm does not make sound.  can someone give me some

A: you are right... try out to invoke media player. because Media player always work immaterial to phone ringer. Something like this http://www.anddev.org/video-tut_-_playing_mediamp3_on_the_emulator-t156.html


text:
Q: How to cast anonymous type to primitive type member using Lambda or Linq Hi I am trying to use Lambda Expression to cast anonymous type list to primitive type list, so far I have no luck.
I know I can use foreach to loop through 'a' and get the values, but I want to know how to do it in Lambda or Linq.
var a = new []{ new {name= "jerry", age = 32}, new {name="peter",age=23}};

List<string> b = a.Select(p => new System.String{p.name}).ToList();
List<int> c = a.Select(p => new System.Int32{p.age}).ToList();

A: var a = new[] { new { name = "jerry", age = 32 },new {name = "peter", age = 23}};

List<string> b = a.Select(p => p.name).ToList();
List<int> c = a.Select(p => p.age).ToList();

A:         var a = new[] { new { name = "jerry", age = 32 }, new { name = "peter", age = 23 } };

        List<string> b = a.Select(p => p.name).ToList();
        List<int> c = a.Select(p => p.age).ToList();

The problem is with your use of { and } in new System.String{p.name}. That isn't a valid way to instantiate a type.

A: Why do you try to instantiate a new instance by calling constructors?
this:
var a = new []{ new {name= "jerry", age = 32}, new {name="peter",age=23}};

List<string> b = a.Select(p => p.name}).ToList();
List<int> c = a.Select(p => p.age).ToList();

works fine. p.Age is an integer and therefore a value type. That means that it's copied by value so you do get a unique copy in your list c. p.name is a string. In .NET strings are immutable so it's perfectly save to share the instance of a string.
Note also that both constructs dont even exist!
Another note is that when calling a constructor, you need to use () not { }