text:
Q: C# ASP.NET MVC: How do I get the browser to automatically download a pdf from my response? I have created an ASP.NET MVC web app in which I accept some information from the client via an AJAX post and create a pdf using iTextSharp. On returning a response to the client, I would like the browser to automatically download the pdf on the user's computer. I began by actually saving the file to a folder and returning the absolute path, so I know the code generates the pdf successfully. Instead of returning the actual path, though, I have read that I can instead store it in a MemoryStream and put that in my response. I have tried returning the actual MemoryStream, converting it to a byte array and returning that, returning a FileStreamResult, and adding the MemoryStream to the Response, but nothing seems to be working. I know similar questions have been asked, but none of the code I have found seems to solve my problem. Can someone please tell me what I need to change in my code to accomplish this, please?
AJAX code:
.ajax({
    url: "/Reports/GenShoppingList",
    type: "Post",
    contentType: "application/json; charset=utf-8",
    data: JSON.stringify(recipeIdArray),
    datatype: "application/pdf"
 });

Pdf Creation and Response code:
public static void GenShoppingListPDF(StringBuilder ingredientNames)
{
    MemoryStream MemoryStream = new MemoryStream();
    doc = new Document();
    PdfWriter.GetInstance(doc, MemoryStream).CloseStream = false;
    doc.Open();
    doc.Add(new Paragraph(ingredientNames.ToString()));
    doc.Close();
    string fileName = "ShoppingList-" + DateTime.Now.ToString() + ".pdf";
    HttpResponse response = HttpContext.Current.Response;
    response.Clear();
    response.ContentType = "application/pdf";
    response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
    response.BinaryWrite(MemoryStream.ToArray());
    response.Flush();
    response.Close();
    response.End();
}

The StringBuilder object is passed into the code via a controller action that simply creates the object and calls this static method. The controller action return type is void.
Final Solution: Through further research and discussion, I have concluded that JQuery AJAX does not support posting data and returning a pdf. Rather, it is best to simply use a plain XMLHttpRequest and forego using JQUERY.

A: Look with the library you are using this works for me and download the file correctly.
public ActionResult File()
{
  string ingredientNames = "Hello David";
  using (MemoryStream stream = new MemoryStream())
  {
    var doc = new Document();
    PdfWriter.GetInstance(doc, stream).CloseStream = false;

    doc.Open();
    doc.Add(new Paragraph(ingredientNames.ToString()));
    doc.Close();

    return File(stream.ToArray(), System.Net.Mime.MediaTypeNames.Application.Pdf, "file.pdf");
  }
}

A: Final Solution: Through further research and discussion, I have concluded that JQuery AJAX does not support posting data and returning a pdf. Rather, it is best to simply use a plain XMLHttpRequest and forego using JQUERY.


text:
Q: ngModelChange not triggering when change in ngModel I am trying to fire an event when input value changes. I am using ngModel with ngModelChanges. But its not working
HTML

<input type="number"
[(ngModel)]='myModel' (change)="myModelChange()" >

<button (click)='changeModel()'>Change</button>

Typescipt

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  myModel: number;
  ngOnInit(){
    this.myModel =100;
  }
  changeModel() {
    this.myModel = Math.floor(Math.random() * 100);
  }
  myModelChange() {
    console.log('changed');
  }
}

Example : Code here
Is it it possible to do this with ngModelChanges. If not then is there any other way?

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to run a utils POD on K8S which doesn't run a process I have this docker image which has many useful tools installed. I use it inside docker to debug stuff, like testing connections to other containers. Now I would like to use this image in Kubernetes. However, because it doesn't run a process the pod will not start
Dockerfile:
FROM ubuntu:latest
RUN .... useful tools ...

And the kubernetes file:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: uitls
spec:
  replicas: 1
  selector:
    matchLabels:
      bar: utils-xxl
  template:
    metadata:
      labels:
        bar: utils-xxl
    spec:
      containers:
      - name: utils
        image: jeanluca/base

When I try to apply this the pod it ends up in the CrashLoopBackOff state. Is there a way in kubernetes to start this pod? Maybe with exec and bash? Any suggestions?

A: You can kubectl run a one-off pod for interactive debugging.
kubectl run jeanluca-debug \
  --generator=run-pod/v1 \
  --rm -it \
  --image=jeanluca/base

This is basically equivalent to a docker run command with the same options, except that the pod name is a required positional parameter.
This technique is useful for the sorts of debugging tasks you describe.  If your image has tools like redis-cli, a mysql or psql client, DNS lookup tools like host or dig, and so on, it can be useful to figure out why exactly your combined system is broken.  The image's default command can be CMD ["/bin/bash"] and that's fine, but it will exit immediately if it doesn't have an input stream attached, so you need to run it via kubectl run like this instead of trying to get a Deployment to keep it alive.
In general there's no point to keeping a container or pod running that's doing literally nothing.  There are certainly tricks to keep a Docker container from exiting but I'd suggest avoiding them.

A: If you want an always up pod that you can use for exec-ing into and running commands, you can just tell the container to open a shell and sleep.
Something like this:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: uitls
spec:
  replicas: 1
  selector:
    matchLabels:
      bar: utils-xxl
  template:
    metadata:
      labels:
        bar: utils-xxl
    spec:
      containers:
      - name: utils
        image: jeanluca/base
        command: ["/bin/sh"]
        args: ["-c", "while true; sleep 999; done"]

A: You can try something like this:

*

*Add CMD tail -f /dev/null at the end of your dockerfile. In this case the same deployment yaml should work.

OR

*

*Modify your k8s deployment.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: uitls
spec:
  replicas: 1
  selector:
    matchLabels:
      bar: utils-xxl
  template:
    metadata:
      labels:
        bar: utils-xxl
    spec:
      containers:
      - name: utils
        image: jeanluca/base
        command: ["tail"]
        args: ["-f", "/dev/null"]

OR

*

*Run a container in k8s like docker run using kubectl run refer this.


text:
Q: Adding a filter to qTranslate to change display of language chooser This is a problem I am having with qTranslate, but I suppose the solution is more of an instruction in how Wordpress hooks and filters work.
Instead of using the qTranslate widget, I am using the hook
<?php echo qtrans_generateLanguageSelectCode('text');?>

to call the language chooser in my header and then modifying its appearance in my CSS. This is no problem. However, I would like to add a "style" to the Language Select Code function so that instead of displaying the full language text, which would be "Francais" and "English" in my case, it will show just the language code instead (EN and FR). I had figured this out by changing (and I know this a very bad thing to do) qtranslate_widget.php and adding a new case to function qtrans_generateLanguageSelectCode($style='', $id='').
This worked great, but then I updated Wordpress and had to update qTranslate as well, so obviously my modification went away. So instead of re-doing that operation, I was wondering if anyone has any suggestions for how to add a filter to the function in my own theme's functions.php? I figure it would be something like
add_filter('qtrans_generateLanguageSelectCode', 'qtrans_myLanguageSelectcode',

but after that I get lost and don't know enough about filters. I hope this is clear enough!
When I updated, I obviously lost my modification but I think that below is what should work (I haven't tested it yet!)
case 'code':
foreach(qtrans_getSortedLanguages() as $language) {
            $classes = array('lang-'.$language);
            if($language == $q_config['language'])
               $classes[] = 'active';
            echo '''.$language.'';
         }
break;

Not to make this post too long, but the following is the existing function in the qTranslate plugin:
    // Language Select Code for non-Widget users
function qtrans_generateLanguageSelectCode($style='', $id='') {
    global $q_config;
    if($style=='') $style='text';
    if(is_bool($style)&&$style) $style='image';
    if(is_404()) $url = get_option('home'); else $url = '';
    if($id=='') $id = 'qtranslate';
    $id .= '-chooser';
    switch($style) {
        case 'image':
        case 'text':
        case 'dropdown':
            echo '
';
            foreach(qtrans_getSortedLanguages() as $language) {
                $classes = array('lang-'.$language);
                if($language == $q_config['language'])
                    $classes[] = 'active';
                echo '
'.$q_config['language_name'][$language].'
';
            }
            echo "

";
            if($style=='dropdown') {
                echo "\n";
            }
            break;
        case 'both':
            echo '
';
            foreach(qtrans_getSortedLanguages() as $language) {
                echo '
'.$q_config['language_name'][$language].'
';
            }
            echo "

";
            break;
    }
}

A: In my header.php, where I want qTranslate language chooser to live, I put this in:
<?php echo qtrans_SelectCode('code');?>

Then, I added this code to functions.php. It's a little redundant in that it repeats the built-in qTranslate options (image, text, dropdown) which I am not using on my page - but I wanted to retain the code since my filter is overwriting the qtrans_generateLanguageSelectCode function. (If anyone can figure out how to just ADD a style in and not overwrite the whole function, that would be awesome!)
The style that I use is called 'code' (you'll see it near the bottom) and just outputs the language code - ie: FR and EN in my case. You could write whatever output you want by creating a new style:
if( function_exists( 'qtrans_getLanguage' ) )
{
// qTranslate Language Select Code filter

    add_filter( 'qtrans_generateLanguageSelectCode', 'qtrans_SelectCode' );

    function qtrans_SelectCode( $style = '', $id = '' ) {
        global $q_config;
        if( $style == '' )
            $style = 'text';
        if( is_bool( $style ) && $style )
            $style = 'image';
        if( is_404() )
            $url = get_option( 'home' );
        else
            $url = '';
        if( $id == '' )
            $id = 'qtranslate';
        $id .= '-chooser';
        switch( $style ) {
            case 'image':
            case 'text':
            case 'dropdown':
                echo '
';
                foreach( qtrans_getSortedLanguages() as $language ) {
                    $classes = array( 'lang-' . $language );
                    if( $language == $q_config['language'] )
                        $classes[] = 'active';
                    echo '
' . $q_config['language_name'][$language] . '
';
                }
                echo "

";
                if( $style == 'dropdown' ) {
                    echo "\n";
                }
                break;
            case 'both':
                echo '
';
                foreach( qtrans_getSortedLanguages() as $language ) {
                    echo '
' . $q_config['language_name'][$language] . '
';
                }
                echo "

";
                break;

            case 'code':
                $count = 0;
                foreach( qtrans_getSortedLanguages() as $language ) {
                    if( $count > 0 )
                        print '  ';
                    $count++;
                    if( $language == $q_config['language'] ) {
                        print '';
                        print $language;
                        print '';
                    }
                    else {
                        print '';
                        print $language;
                        print '';
                    }
                }
                break;
        }
    }
}

It is important to enclose the functions in:
if(function_exists('qtrans_getLanguage'))

in case the qTranslate plugin breaks or you deactivate it, otherwise your functions.php will not work properly and you won't be able to get at your site!
Sorry I took a little while to get back, I am not a web developer by profession so I haven't touched this stuff in a few months. I'm completely self-taught, which is why my terminology may be a little unclear. But I hope this helps!


text:
Q: Publish to Glassfish server stucks at 15% and all the other progresses are blocked When I try to run a project (Only this project and others work fine), it always stucks at the publishing(copy and paste point). It can work perfectly fine until one time I(not sure) accidentally click incrementally publish and then stop it forcefully. Then this problem persists. I try to clean the server and also try to empty the domain folder but none of them works. It is like very strange bug.
I don't want to try creating a new domain since I have add JAAS configuration and JNDI in this domain. Or can anyone tell me how to import the configuration into a new domain?

If I wait long time for it to finish, random problem occurs:

The problem is other project can be run in debug and this project also can previously. It is all just out of sudden when I forcefully stop some process in eclipse tho I am not sure whether it is because of.
This is so annoying and can anyone give some constructive advice? Thx a lot!
Anyone encountering similar situation and sharing his/her experience here will be appreciated. It does not have to be exactly same and any lead or hint are welcome, please.

A: Actually, I think it is definitely an eclipse bug.
Creating a new workspace and importing all the related projects and glassfish servers can solve the problems though I don't know the actual reason.


text:
Q: VBA Print #1 select range (for exporting from Excel to a file)? I have a simple macro that exports desired cells to a txt-file. Can I instead of individually telling the macro what cells I want to export, choose a range of cells?
Here's the very simple code I have:
Sub TEST()
    Open "C:\text.txt" For Output As #1
        Print #1, Cells(1, 1) & Cells(1, 2)
        Close
End Sub

With that I can export Excel sheet cells A1, A2. But if I want to export wide range of cells, this method isn't too convenient. So is there a way I could, let's say easily export cells A1:A100?
Thanks!

A: I see joseph4tw has already responded, but my answer is a little different and might give you another idea, so I'll put it here anyway.
Sub TEST()
    Dim c As Range, r As Range
    Dim output As String
    For Each r In Range("A1:C3").Rows
        For Each c In r.Cells
            output = output & c.Value & ","
        Next c
        output = output & vbNewLine
    Next r
    Open "H:\My Documents\text.txt" For Output As #1
    Print #1, output
    Close
End Sub

A: You can use the InputBox and set the type to 8, which will allow the user to click in Excel and select a range.
Here is an example:
Sub test()
    Dim r As Excel.Range, cell As Excel.Range
    On Error Resume Next
    Set r = Application.InputBox("Select Range", "Select Range", Type:=8)
    On Error GoTo 0
    If r Is Nothing Then Exit Sub

    Open "C:\text.txt" For Output As #1
    For Each cell In r
        Print #1, cell.Value
    Next
    Close
End Sub

A: I notice that the example by mkingston puts the comma first. This would cause everything to start in the second column of the .csv (first column would be blank). A little better would be to put the comma at the end of the statement. You could remove the last ',' with REPLACE() but it isn't necessary.
   Dim c As range, r As range
        Dim output As String
        For Each r In range(DataRange).Rows
            For Each c In r.Cells
                output = output & c.Value & ","
            Next c
            output = output & vbNewLine

        Next r

A: If you want to select all non-empty cells (contigouos) use this:
Range("A1").CurrentRegion.Select

You can then export it in whatever way you fancy ;)


text:
Q: The tag "XXX" does not exist in xml namespace My SolutionName: TestBA
My AssemblyName: TestBA
Default namespace: Examples.Bootstrapper
In TestBA assemble I have Converters folder:
namespace Examples.Bootstrapper.Converters
{
    class PercentToPixelsConverter : IValueConverter
(...)

I trying to use:
xmlns:c="clr-namespace:Examples.Bootstrapper.Converters;assembly=TestBA"

(...)
<c:PercentToPixelsConverter x:Key="MyName" />

I get an error:

The tag 'PercentToPixelsConverter' does not exist in XML namespace
  'clr-namespace:Converters;assembly=TestBA'.

A: You will need to make your class public:

public class PercentToPixelsConverter

A: You don't have to specify assembly name if the namespace is from the same project or assembly :
xmlns:c="clr-namespace:Examples.Bootstrapper.Converters"


text:
Q: Can I safely delete all apps data except the current one from my google-services.json file? So, the Firebase has a limit on the number of projects on the free plan. When the number of apps which I worked on exceeds them - I had to add several apps to 1 project.
Suppose I have a Firebase project called Job. And there are apps called A, B, C. When the customer of C app receives the app repository, he can see A and B apps data in the google-services.json file.
Can I delete the data of A and B from this file so that it doesn't break the normal work of the C app and all of it Firebase services?

A: It should be OK.  google-services.json is not just copied entirely into your app.
You'll know it's OK because your app will still build.  The google services gradle plugin just copies the relevant values out of there in to string resources in your app, based on the ID of the app build.
After the app builds, google-services.json is no longer used when the app runs.

A: In my opinion, you are able to do that. Just try to remove lines correctly.
This sometimes happens when you already added google-services.json to your project and add new app package name into Firebase. Then google-services.json from Firebase becomes different than your local one. And it still works.


text:
Q: Unity Facebook SDK custom share Is there any way to customize Unity's Facebook share dialog with title, description and picture?
I am working on a Unity game, targeting iOS and Android. I have installed the Facebook SDK 7.9.0. I am relatively new to Facebook development/implementation but I am quite familiar with the process.
I have search all over the internet for almost a week and I have not being able to find any example that works for me. I have tried everything from using the Unity Facebook SDK FB.ShareLink and FB.FeedShare methods to trying to open a web page with the open graph implementation of facebook share.
I read that these parameters (title, description and picture) where disables from April 2017 (https://developers.facebook.com/docs/sharing/ios/share-button) in the current and older versions of the Graph API, but there has to be a way because I still see some games and applications that have custom Facebook share dialog.
Unfortunately I am not allowed to post code, since I am working for a company.
P.S.: I know this is probably a topic, but most questions related to this topic where posted before the April 2017, so I am expecting more recent feedback.


text:
Q: Missing meta data for conan package buildInfo in Artifactory I tried to upload the buildInfo for my Conan package to Artifactory followed the guide in Conan official page. https://docs.conan.io/en/latest/howtos/generic_ci_artifactory.html
Everything looks fine except the missing of "Repo Path" in Artifactory.
As shown in the screenshot bellows:
missing of repo path in buildInfo
The repo path is always missing for Conan packages.
I tried to upload the package using jfrog cli or Artifactory Jenkins plugin and then upload the buildInfo. They can solve the Repo Path issue, but the directory structure will be very different than uploading it using "conan upload" command.


text:
Q: Kotlin like scope functions (let, also, apply, run) in Javascript? Is it possible to create Kotlin like scope functions in Javascript/Typescript? Is there any library that does it?
Reference: https://kotlinlang.org/docs/reference/scope-functions.html

A: No, you can't do that in JavaScript or TypeScript. But depending on why you're trying to do it, destructuring can help.
The closest you can get is to use the deprecated with statement, which adds an object to the top of the scope chain, so any freestanding identifier references are checked against the object's properties:

function example(o) {
    with (o) { // deprecated
        console.log(answer);
    }
}
const obj = {
    answer: 42
};
example(obj); // Outputs 42

There are several problems with with, though, which is why it's disallowed in the strict variant of JavaScript (which is the default inside modules, class constructs, and other new scopes created in ES2015+, as well as any function or script with "use strict"; at the beginning).
Another close version is to pass an object to a function that uses destructuring in its parameter list:

function example({answer}) {
    console.log(answer);
}
const obj = {
    answer: 42
};
example(obj); // Outputs 42

but a major caveat there is that you can't assign new values to properties that way (and worse, if you try — for instance, with answer = 67 — it updates the parameter's value but not the object's property value).
To deal with that, you might use destructuring inside the function instead, with const so you don't forget you can't update the value (or to get an early error if you try):

function example(o) {
    const {answer} = o;
    console.log(answer);
    // answer = 67;   // <== Would cause error
    // o.answer = 67; // <== Would work
}
const obj = {
    answer: 42
};
example(obj); // Outputs 42

A: If anyone is still looking for an answer, there is an excellent library for those scope functions for javascript (I am not affiliated):
https://github.com/TheDavidDelta/scope-extensions-js

A: https://www.npmjs.com/package/lazymacro
This package provides the feature you need and its implementation is pretty simple (through Object.defineProperty see code).

*

*obj.PIPE(f) is similar to let in kotlin

*obj.PIPETHIS(f) is similar to run in kotlin

*obj.WITH(f) is similar to also in kotlin

*obj.WITHTHIS(f) is similar to apply in kotlin

Then you can write something like:
["I", "am"]
    .WITH(v => v.push("lazynode."))
    .WITH(console.log)
    .PIPE(v => v.join(" "))
    .PIPE(v => console.log(`${v}`))
    ?.PIPE(v => console.log("null safety features can be used together!"));

AND IN ADDITION
It provides scope functions for Promise, which can save you from the await/then hell

*

*promise.THEN(f)

*promise.WAIT(f)
example:
Promise.resolve({})
    .WAIT(async local => local.datax = await getSomeRemoteData())
    .WAIT(async local => local.datay = await getSomeRemoteData())
    .WAIT(async local => local.dataz = await getSomeRemoteData())
    .WAIT(async local => await doSomething(local.datax, local.datay, local.dataz));

A: While not exactly what you're looking for, a pattern that I use let a lot for in Kotlin is
val thing = nullable?.let{ // case if not null } ?: run { // case if null }

The closest I've come to this in Javascript (well, typescript) in terms of readability and ergonomics is something like:
const thing = some?.deeply?.nested?.nullable?.thing ?? (() => {
// case if null
})

Which gets you halfway there. :)


text:
Q: How to get nearby city or state name of a geopoint in water in ios? I am developing a location-based application in which I need to get nearby location name of any geopoint selected by user. I'm using Google Places API which is working fine for me.
Only problem is the service returns null for geopoints in water. Is there any way that I can retrieve nearby locations for a geopoint in water or ocean?

A: AFAIK the API has no way to do that.
So, you've got two options, in order of the effort it takes:

*

*When user taps water just throw a dialog saying "Please select a
point on land". Next to no effort and will slightly annoy the user.

*Try to find the closest land geopoint yourself and use it to run the API request on
(instead of the original point). Below are some ideas on that.

A good approach can be based on this answer: basically you can get a KML file with land polygons. For performance reasons, you can simplify the polygons to the extent that makes sense for your zoom levels. Now if your point is in one of those polygons -- it's sea. And you can simply iterate over all polygon edges and pick the one that's closest to your point, then pick a point on it - again closest to your point - and do one little epsilon-sized step towards the outside of the polygon to get a land point you can do a geocode request on. Also, the original author suggests you can use Haversine formula to determine neares land point -- I'm not really familiar with the appliance of that one.
The downside is, you have to deal with KML, iterate over a lot of polygons and optimize them (and lose precision doing that, in addition to possible differences between marineregions.org data and Google Places data)
Another cool trick you could try is using Sobel Filter [edge detection] on the visible map fragment to determine where coastline is (although you will get some false positives there), then trace it (as in raster->vector) to get some points and edges to calculate the closest land position with, in a manner similar to the former approach. Here's a clumsy drawing of the idea
For Sobel edge detection, consider GPUImage lib -- they have the filter implemented and it's probably going to work crazy fast since the lib does all the calculations on GPU.
UPD Turns out there's also a service called Koordinates that has coastline data available, check the answer here


text:
Q: How to approach to develop a multi target mobile web application i'm newbie to mobile devices, and i've to develop a simple database driven application targeted for mobile devices, in asp.net .
In particular, my customer needed to:

*

*Access with their account to our database

*Make Photos to some items

*Associate to it some datas: price, some date, ...

*Publish it

I thought i can build a "single" web app maybe with jquerymobile, instead one app for device .
So customers can access to web app via browser and a standard www.something.com .
Could this approach be good ?

A: Web apps don't have access to camera. In your case you might want to go native or use something like phonegap or appcelerator.

A: Yes, that would work. Not sure what the question is beyond that?


text:
Q: Silverlight exception not being handled with JS I am debugging Silverlight 2 on Firefox. I get an unhandled error in firebug:

Unhandled Error in Silverlight 2 Application
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.GetValue(INativeCoreTypeWrapper obj, DependencyProperty property)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
at System.Windows.FrameworkElement.SetBinding(DependencyProperty dp, Binding binding)
at FileAudit.Page..ctor()
at FileAudit.App.Application_Startup(Object sender, StartupEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

points to Silverlight.js line 26 which is
control = new ActiveXObject('AgControl.AgControl');

my html is

        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="431" height="30" id="Xaml2">
            <param name="source" value="/ClientBin/FileAudit.xap" />
            <param name="onerror" value="onSilverlightError" />
            <param name="background" value="white" />
            <param name="minRuntimeVersion" value="2.0.31005.0" />
            <param name="autoUpgrade" value="true" />
            <param name="initParams" value="id=slPlugin1,embeddingTechnique=objectElement" />

        </object>

Why is it not getting handled in JS and being displayed in errorLocation?
Also sorry my formatting sucks.

A: Came up with a solution
Went to the App.xaml.cs file and reworked the Unhandled_Exception Function
With that and a bit of call this JS it was easy
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
    {
        // If the app is running outside of the debugger then report the exception using
        // the browser's exception mechanism. On IE this will display it a yellow alert
        // icon in the status bar and Firefox will display a script error.

        // NOTE: This will allow the application to continue running after an exception has been thrown
        // but not handled.
        // For production applications this error handling should be replaced with something that will
        // report the error to the website and stop the application.
        e.Handled = true;

        try
        {
            ThrowRightError(e.ExceptionObject);
            //System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight  a 2 Application " + errorMsg + "\");");
        }
        catch
        {
        }

    }
    private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
    {
        try
        {
            ThrowRightError(e.ExceptionObject);
            //System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight 2 Application " + errorMsg + "\");");
        }
        catch (Exception)
        {
        }
    }

    private void ThrowRightError(Exception e)
    {
        string errorMsg = "";
        var exLayer = -1;
        //errorMsg += String.Format("
Layer {0}
", exLayer);
        Exception ex2 = e;
        while (ex2 != null)
        {
            errorMsg += "Message :
" + ex2.Message + "
Data :
" + ex2.Data + "
StackTrace :
" + ex2.StackTrace;
            exLayer++;
            errorMsg += String.Format("
Layer {0}
", exLayer);
            ex2 = ex2.InnerException;
        }
        errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"
");

        HtmlPage.Window.CreateInstance("foo2", new[] { errorMsg });
    }

then for the JS
function foo2(theAlert) {
     $("#errorLocation").html(theAlert);
}

I also figured out what the original error was
ClientIdTextBlock.SetBinding(TextBox.TextProperty, ClientIdBinding);

A textBox binding for a TextBlock...stupid mistake.


text:
Q: Why am I not getting a plot of my function? I consider the polynomial $f(c,x):=x^{c+1}-c^c-1$ and I want to plot the function $\frac{\rho_c}{1+\frac{\ln(c)}{c}}$, where $\rho_c$ is the largest positive real root of $f(c,x)$.

I tried the following:
First, I define the function f:
f[c_, x_] := x^(c + 1) - x^c - 1

The function $g$ detects the real roots and the function $g1$ the largest positive real root:
g[c_, x_] := NSolve[f[c, x], x, Reals]

g1[c_, x_] := Max[x /. g[c, x]]

Finally, I define the desired function of $c$:
g2[c_] := 1 + (ln[c]/c);

g3[c_] := g1[c, x]/g2[c]

This works, for example I get
g3[5]

1.2852/(1 + ln[5]/5)

Now I tried to plot the function $g3$ as a function of $c$ for $2\leq c\leq 100$, by
Plot[g3, {c, 2, 10}]

and I also tried
Plot[g3[c], {c, 2, 10}]

but nothing happens, nothing is plotted (only the axes):

What am I doing wrong? Please note that I am a beginner.

A: The correct syntax for $ln$ is Log and g3[c]=g3[c_]:= is not the correct way for assignment.
f[c_, x_] := x^(c + 1) - x^c - 1

g[c_?NumericQ] := NSolve[f[c, x], x, Reals]

g1[c_] := Max[x /. g[c]]

g2[c_] := 1 + (Log[c]/c);

g3[c_] := g1[c]/g2[c]

g3[5]

Plot[g3[c], {c, 2, 1000}]


text:
Q: Working with global Dictionary inside threads Suppose that I have a Dictionary<string, string>. The dictionary is declared as public static in my console program.
If I'm working with threads and I want to do foreach on this Dictionary from one thread but at the same time another thread want to add item to the dictionary. This would cause a bug here because we can't modify our Dictionary while we are running on it with a foreach loop in another thread.
To bypass this problem I created a lock statement on the same static object on each operation on the dictionary.
Is this the best way to bypass this problem? My Dictionary can be very big and I can have many threads that want to foreach on it. As it is currently, things can be very slow.

A: Try using a ConcurrentDictionary<TKey, TValue>, which is designed for this kind of scenario.
There's a nice tutorial here on how to use it.

A: The big question is: Do you need the foreach to be a snapshot?
If the answer is "no", then use a ConcurrentDictionary and you will probably be fine. (The one remaining question is whether the nature of your inserts and reads hit the striped locks in a bad way, but if that was the case you'd be finding normal reads and writes to the dictionary even worse).
However, because it's GetEnumerator doesn't provide a snapshot, it will not be enumerating the same start at the beginning as it is at the end. It could miss items, or duplicate items. The question is whether that's a disaster to you or not.
If it would be a disaster if you had duplicates, but not otherwise, then you can filter out duplicates with Distinct() (whether keyed on the keys or both the key and value, as required).
If you really need it to be a hard snapshot, then take the following approach.
Have a ConcurrentDictionary (dict) and a ReaderWriterLockSlim (rwls). On both reads and writes obtain a reader lock (yes even though you're writing):
public static void AddToDict(string key, string value)
{
  rwls.EnterReadLock();
  try
  {
    dict[key] = value;
  }
  finally
  {
    rwls.ExitReadLock();
  }
}
public static bool ReadFromDict(string key, out string value)
{
  rwls.EnterReadLock();
  try
  {
    return dict.TryGetValue(key, out value);
  }
  finally
  {
    rwls.ExitReadLock();
  }
}

Now, when we want to enumerate the dictionary, we acquire the write lock (even though we're reading):
public IEnumerable<KeyValuePair<string, string>> EnumerateDict()
{
  rwls.EnterWriteLock();
  try
  {
    return dict.ToList();
  }
  finally
  {
    rwls.ExitWriteLock();
  }
}

This way we obtain the shared lock for reading and writing, because ConcurrentDictionary deals with the conflicts involved in that for us. We obtain the exclusive lock for enumerating, but just for long enough to obtain a snapshot of the dictionary in a list, which is then used only in that thread and not shared with any other.

A: With .NET 4 you get a fancy new ConcurrentDictionary. I think there are some .NET 3.5-based implementations floating around.

A: Yes, you will have a problem updating the global dictionary while an enumeration is running in another thread.
Solutions:

*

*Require all users of the dictionary to acquire a mutex lock before accessing the object, and release the lock afterwards.

*Use .NET 4.0's ConcurrentDictionary class.


text:
Q: How to get an id of the user in Codeigniter? This is actually very easy but yet I am confused how to do this:
I have Reseller that can request X-number of users to admin. So that value gets saved to database. Now when admin logs in he can see the requests of resellers. Like this :

Now Admin Can either approve or reject the request. If He approves the request the code creates users in users table mapped to that reseller. The mapping is done with a unique field called Key Now Creating users works perfectly but my problem is :
When I click on Approve it creates users but for only for the reseller wit id = 1.  I want to create something like when I click on first record it creates users for 1st reseller and when on 2nd same as above[This is as per the image].
This is my view:
<?php if(count($users)): foreach($users as $user): ?>

    <?php echo  $user->id; ?>
    <?php echo  $user->user_requested; ?>
    <?php echo  $user->key; ?>
    <?php echo  $user->date_requested; ?>
    Yes&nbsp
    No&nbsp<?php echo'';?>
    <?php echo  $user->status; ?>	&nbsp

<?php endforeach; ?>
<?php else: ?>

    There are no new Requests.

<?php endif; ?>

The Controller
public function create_user()
{
    $this->load->model('more_m');
    $id= $this->session->userdata('id');
    $rajan =$this->more_m->get(array('user_requested',$id));
    $request=$rajan->user_requested;

    $this->load->model('reseller_m');

    $query=$this->db->select('key');
    $query=$this->db->get('reseller');

    if($query->num_rows() > 0)
    {
        $row = $query->row_array();
        $key= $row['key'];
    }

    for($i=1; $i<=$request;$i++)
    {

        $userdata=array('key'=>$key);

        $this->db->insert('users',$userdata);

    }

    $this->load->model('more_m');
    $id = $this->session->userdata('id');
    $this->db->set('status', "'approved'",FALSE);
    $this->db->where('id',$id);
    $this->db->update('user_request');

    redirect('admin/new_user');
}

My mistake is in controller where I define $id. As when admin logs in his id would be fetched I don't know how to fetch the id of the reseller as per the record.

A: Its so simple with Codeigniter
What you have to do is pass the ID with the URL (You are wrong Use base_url()as well with the pointing controller)
ex <a href="<?php echo base_url()?>reseller/create_user/<?php echo $user->key; ?>"
so now your URL looks like (assume id is equal to 2)

http://localhost/<path to project>/reseller/create_user/2

so in Controller
function create_user($id)//So this know incoming Value to this
{
   //then in here
   echo $id; //this will show 2
   //Continue rest of your code with $id
}

A: If you wanna do it in php way,You can pass key in your url and get key in your controller using $this->uri->segment(n)
   <?php if(count($users)): foreach($users as $user): ?>

        <?php echo  $user->id; ?>
        <?php echo  $user->user_requested; ?>
        <?php echo  $user->key; ?>
        <?php echo  $user->date_requested; ?>
        <a href="reseller/create_user/<?php echo  $user->key; ?>" class="btn btn-primary">Yes&nbsp
        No&nbsp<?php echo'';?>
        <?php echo  $user->status; ?>	&nbsp

    <?php endforeach; ?>
    <?php else: ?>

        There are no new Requests.

    <?php endif; ?>

If you want jquery+php than use ajax.
add value attr. to button pass your key.
<button id="some_id" value="YOURKEY">Click Me</button

This is your script to update :


text:
Q: Standard ML: Searching through a list of lists I wrote this function to determine whether a given element is stored in a list of list of tuples, however at the moment it only searches the first list. How would I go about searching the rest of the lists?
fun findItem (name : command, ((x,y)::firstlist)::tail : (command*command) list list) =
    if x = name then true else findItem(name, firstlist::tail)
    | findItem(name, [[]]) = false

A: You would recurse over the rest of the lists (you need three cases):
fun findItem (name, ((x,_)::firstlist)::tail) = x = name orelse findItem(name, firstlist::tail)
  | findItem (name, []::tail) = findItem (name, tail)
  | findItem(name, []) = false

But it's much easier on the eye if you first write a function that searches through a list and then use that in another function:
fun findItemHelper (_, []) = false
  | findItemHelper (name, (n', _)::ns) = name = n' orelse findItemHelper (name, ns)

fun findItem (_, []) = false
  | findItem (name, n::ns) = findItemHelper (name, n) orelse findItem (name, ns)

These are exactly the same except for the part before orelse, so we can abstract that out with a predicate function:
fun find (_, []) = false
  | find (found, x::xs) = (found x) orelse find (found, xs)

and use it:
fun findItemHelper (name, ns) = find (fn (n, _) => name = n, ns)

fun findItem (name, nss) = find (fn ns => findItemHelper (name, ns), nss)

A: To complement molbdnilo's answer, here is how I would implement it. Using the standard List.exists library function it becomes a one-liner:
fun findItem (x, ll) = List.exists (List.exists (fn (y,_) => x = y)) ll


text:
Q: Find the Taylor polynomial of degree n
-Find the Taylor polynomial of degree $n$ for $f(x) = \sqrt{(1+x)}$, centered at $x = 0$.

-I know how to find taylor polynomial but when it comes to finding the $n^{th}$ term, I'm a little lost on finding what the pattern is.
We have $f^{'}(0) = \frac{1}{2}, f^{''}(0) = -\frac{1}{4}, f^{'''}(0) = \frac{3}{8}, f^{4}(0) = \frac{-3*5}{16}$ and $f^{n}(0) = \frac{-1^{n+1}}{2^n}*$ ?
Thanks!

A: It would be easier to apply the bionomial theorem.
$$(1+x)^a=\sum_{n=0}^\infty\binom{a}{n}  x^n$$ and, if required, truncate where ever you need.
If $a=\frac 12$, remember that
$$\binom{a}{n}=\frac{\sqrt{\pi }}{2 \left(\frac{1}{2}-n\right)! n!}$$ which then makes
$$\sqrt{1+x}=\frac{\sqrt{\pi }}{2}\sum_{n=0}^\infty\frac {x^n}{\left(\frac{1}{2}-n\right)!\,n!}$$


text:
Q: How do I add a score text list that adds 1 each time I click my cookie sprite? (python) Game code deals with classes Cookie and Shop. How do I make it so that I have a text box which says {Cookie Number} Cookies? Is there a command that says if event.click then cookie +1?
Inside of the game_loop is a simple text box that just says "some cookie number, with the word cookies at the end. I think I would have to create a list but I am not sure how to do that. Would I use {}? Also, thank you to everyone for your help.
import pygame as pg
import os

WIDTH = 1024
HEIGHT = 768

CLOCK = pg.time.Clock()
FPS = 60

WHITE = (255, 255, 255)
BROWN = (153, 51, 51)
DARKGRAY = (40, 40, 40)
BGCOLOR = DARKGRAY

game_folder = os.path.dirname(__file__)
img_folder = os.path.join(game_folder, "img")

screen = pg.display.set_mode((WIDTH, HEIGHT))
pg.display.set_caption("Cookie Clicker")

class Cookie(pg.sprite.Sprite):

    def __init__(self):
        pg.sprite.Sprite.__init__(self)
        self.image = pg.image.load(os.path.join(img_folder, "2.png")).convert()
        self.rect = self.image.get_rect()
        self.rect.center = ((WIDTH - 670, HEIGHT / 2))

cookie = Cookie()

class Shop(pg.sprite.Sprite):

    def __init__(self):
        pg.sprite.Sprite.__init__(self)
        self.image = pg.Surface((300, 768))
        self.image.fill(WHITE)
        self.rect = self.image.get_rect()
        self.rect.center = ((WIDTH - 150, HEIGHT / 2))

def game_loop():
    pg.init()
    pg.font.init()

    my_font = pg.font.SysFont("Comic Sans MS", 30)

    text_surface = my_font.render('SOME NUMBER - Cookies', False, (0, 255, 0))

    running = True
    while running:
        for event in pg.event.get():
            if event.type == pg.QUIT:
                running = False

        all_sprites = pg.sprite.Group()
        all_sprites.add(cookie, shop)
        all_sprites.update()

        screen.fill(BGCOLOR)
        all_sprites.draw(screen)
        screen.blit(text_surface, (175, 100))
        pg.display.flip()

        CLOCK.tick(FPS)

    pg.quit()

game_loop()

A: In the event loop, check if the user presses a mousebutton, then see if the cookie.rect collides with the event.pos (or use pg.mouse.get_pos()), and if they collide, increment a score variable:
elif event.type == pg.MOUSEBUTTONDOWN:
    # Use the collidepoint method of this `pygame.Rect`.
    if cookie.rect.collidepoint(event.pos):
        score += 1
        print(score)

To blit the text onto the screen, you need to put the score into a string with the help of the .format method: '{} Cookies'.format(score). Then pass it to my_font.render and blit the returned surface.
text_surface = my_font.render('{} Cookies'.format(score), True, BROWN)
screen.blit(text_surface, (30, 30))

Also, you shouldn't create and fill the all_sprites group inside of the while loop. Here's the updated game_loop function:
def game_loop():
    pg.init()

    my_font = pg.font.SysFont("Comic Sans MS", 30)
    cookie = Cookie()
    shop = Shop()
    all_sprites = pg.sprite.Group()
    all_sprites.add(cookie, shop)
    score = 0

    running = True
    while running:
        for event in pg.event.get():
            if event.type == pg.QUIT:
                running = False
            elif event.type == pg.MOUSEBUTTONDOWN:
                if cookie.rect.collidepoint(event.pos):
                    score += 1
                    print(score)

        all_sprites.update()

        screen.fill(BGCOLOR)
        all_sprites.draw(screen)
        screen.blit(text_surface, (175, 100))
        text_surface = my_font.render('{} Cookies'.format(score), True, BROWN)
        screen.blit(text_surface, (30, 30))
        pg.display.flip()

        CLOCK.tick(FPS)

    pg.quit()
    sys.exit()  # import sys at the top of the file.


text:
Q: Jquery each and Selector behaving differently I created a function in Jquery which is supposed to center elements vertically (I could not do it using css, got tired and just made it programically ^^). The problem now is that I initially created it using .each, and then, since it was already creator, I tried calling it using the selector ($('something').center), but it is behaving differently for some reason.
Using the selector, it seems to be doing just the same to every element. It does it with the first element, and then just applies all values to the remaining elements. So, for example, my function takes the element height and does some operations with it, but the selector just takes the first one and then applies its parameters to everyone..
I'll keep using each since it works best right now, but I still can't understand why they are doing that..
Centering Function:
$.fn.center = function (){
/*If this is the highest element, or
  if this element has full use of the width,
  then there's no need to align it.
 */

if(this.height() == this.parent().height() ||
this.width() == this.parent().width())
{
    this.css({
        position : "relative",
        top : 0
    });
}
else //Should be aligned.
{
    this.css({
        position : "relative",
        top : (this.parent().height()/2)-(this.height()/2)
    });
}
return this; //Used for chaining.

};
Here's an example of what I mean ^^
http://jsfiddle.net/lrojas94/pmbttrt2/1/

A: For simple things, like just changing the CSS in the same way for all elements with the same class, you can call it directly without using .each(). For example:
$('.elem').css('color', '#fff');

But if each of the divs needs to end up with an individual value, you should use .each(). For example (sorry it's a bit weird):
var border = 1;
$('.elem').each(function() {
    $(this).css('border', border + 'px solid #000');
    border += 1;
});

Basically, if you don't use .each(), it'll check what you want to change (just once!) and apply it to all elements with that class. If you do use .each(), it'll do it individually for each element.

A: Simply put, this within a jQuery plugin function is not a DOM node. It's the jQuery object that wraps around all the nodes that were matched by the selector.
Your function's body should rather look like:
return this.each(function () {
    var $el = $(this);

    //centering logic for $el goes here
});


text:
Q: Spring JPA Unidirectional Ont To Many entity mapping giving error (deserialize) Hi I am gettinn 'could not deserialize' error while trying to query for an entity with oneToMany mapping in spring jpa.
My Entities
WebForm.java
package com.globalfoundries.partshub.persist.entity.admin;

@Entity
@Table(name = "FORM_PROPERTIES")
public class WebForm  implements Serializable{

/**
 *
 */
private static final long serialVersionUID = -8883246076117334766L;

/**
 *
 */

@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(name = "id", nullable = false)
private Long id;

@Column(name = "class", nullable = false)
private String className;

@Column(name = "FIELD", nullable = false)
private String field;

@Column(name = "DISPLAY_NAME")
private String displayname;

@Column(name = "type")
private String type;

@Column(name = "length")
private String length;

@Column(name = "visible")
private String visible;

@Column(name = "required")
private String required;

@Column(name = "list", nullable = true)
private BigDecimal list;

@Column(name = "display_order", nullable = true)
private Integer displayOder ;

public Integer getDisplayOder() {
    return displayOder;
}

public void setDisplayOder(Integer displayOder) {
    this.displayOder = displayOder;
}

@Column(name="searchable")
private Number searchable;
public Number getSearchable() {
    return searchable;
}

public void setSearchable(Number searchable) {
    this.searchable = searchable;
}

@OneToMany
@JoinColumn(name="list_id",referencedColumnName="list")
private Collection<ListEntry> listEntries;

public Collection<ListEntry> getListEntries() {
    return listEntries;
}

public void setListEntries(Collection<ListEntry> listEntries) {
    this.listEntries = listEntries;
}

public String getClassName() {
    return className;
}

public void setClassName(String className) {
    this.className = className;
}

public String getField() {
    return field;
}

public void setField(String field) {
    this.field = field;
}

public String getDisplayname() {
    return displayname;
}

public void setDisplayname(String displayname) {
    this.displayname = displayname;
}

public String getType() {
    return type;
}

public void setType(String type) {
    this.type = type;
}

public String getLength() {
    return length;
}

public void setLength(String length) {
    this.length = length;
}

public String getVisible() {
    return visible;
}

public void setVisible(String visible) {
    this.visible = visible;
}

public String getRequired() {
    return required;
}

public void setRequired(String required) {
    this.required = required;
}

public BigDecimal getList() {
    return list;
}

public void setList(BigDecimal list) {
    this.list = list;
}
}

ListEntry.java
package com.globalfoundries.partshub.persist.entity.admin;

@Entity
@Table(name = "LIST_ENTRY")
@Embeddable
public class ListEntry implements Serializable{

/**
 *
 */
private static final long serialVersionUID = 2833227944278025887L;

/**
 *
 */

@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(name = "id", nullable = false)
private Long id;

@Column(name = "entry", nullable = false)
private String entry;

@Column(name="active")
private boolean active;

@Column(name="list_id")
private BigDecimal listId;

public boolean getActive() {
    return active;
}

public void setActive(boolean active) {
    this.active = active;
}

public BigDecimal getListId() {
    return listId;
}

public void setListId(BigDecimal listId) {
    this.listId = listId;
}

public String getEntry() {
    return entry;
}

public void setEntry(String entry) {
    this.entry = entry;
}
}

WebFormRepo.java
public interface WebFormRepo extends JpaRepository<WebForm, Long> {

List<WebForm> findByClassNameIgnoreCase(String category);

List<WebForm> findAll();

@Query("select f,al.entry from WebForm f left join f.listEntries al where upper(f.className)=upper(?1)")
List<WebForm> findClassNameIgnoreCasewithList(String category);

}
From controller , I am invoking
formRepo.findByClassNameIgnoreCase(category);

Exception
Hibernate: select webform0_.id as id1_0_, webform0_.class as class2_0_, webform0_.display_order as display_order3_0_, webform0_.DISPLAY_NAME as DISPLAY_NAME4_0_, webform0_.FIELD as FIELD5_0_, webform0_.length as length6_0_, webform0_.list as list7_0_, webform0_.required as required8_0_, webform0_.searchable as searchable9_0_, webform0_.type as type10_0_, webform0_.visible as visible11_0_ from FORM_PROPERTIES webform0_ where upper(webform0_.class)=upper(?)
2016-07-25 12:24:44.196 ERROR 5920 --- [nio-8080-exec-7] o.a.r.exception.ExceptionHandlerAdvice   : Unhandled exception
org.springframework.orm.jpa.JpaSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:314) ~[spring-orm-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225) ~[spring-orm-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:436) ~[spring-orm-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at com.sun.proxy.$Proxy103.findByClassNameIgnoreCase(Unknown Source) ~[na:na]
at com.globalfoundries.partshub.controller.SearchController.searchForm(SearchController.java:52) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) ~[spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilterInternal(ResourceUrlEncodingFilter.java:52) [spring-webmvc-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) [spring-security-web-4.0.4.RELEASE.jar:4.0.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) [tomcat-embed-core-8.0.33.jar:8.0.33]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.33.jar:8.0.33]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
Caused by: org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:262) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:155) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:130) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:70) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1696) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1628) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.getRow(Loader.java:1515) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:726) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.processResultSet(Loader.java:953) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.doQuery(Loader.java:921) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2554) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.doList(Loader.java:2540) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.Loader.list(Loader.java:2365) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1300) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:67) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:114) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:78) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:100) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:91) ~[spring-data-jpa-1.9.4.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:462) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.11.4.RELEASE.jar:na]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.2.6.RELEASE.jar:4.2.6.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.2.6.RELEASE.jar:4.2.6.RELEASE]
... 82 common frames omitted
Caused by: java.io.EOFException: null
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2353) ~[na:1.8.0_91]
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2822) ~[na:1.8.0_91]
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:805) ~[na:1.8.0_91]
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301) ~[na:1.8.0_91]
at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
at org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
... 126 common frames omitted

A: First of all, you have a bidirectional mapping. You're just not defining it properly. In ListEntry, you have:
@Column(name="list_id")
private BigDecimal listId;

This is the other side of your mapping. The mapping should probably be changed to:
WebForm:
// remove listId and listEntries properties
@OneToMany(mappedBy="list")
private Collection<ListEntry> list;

and:
@JoinColumn(name="list_id")
@ManyToOne
private WebForm list;

If List is a different object in your model, add it to WebForm and map ListEntry back to it. As you have a single List per 'WebForm' (per the list property) and the List has some number of ListEntries, I'd recommend including it in the domain model, if you're reusing Lists in multiple WebForms or elsewhere. If not, my example of WebForm owning ListEntries is correct.
Second, you're trying to map the list_id and 'list' columns twice in ListEntry. Once from the JoinColumn in WebForm, and once from theColumndefinitions inListEntryandWebForm`.
I'm not sure that cleaning these up will solve your issue, but your current mappings can't be helping the situation.


text:
Q: Using Arduino to read BLE I have an Arduino MEGA2560, I hooked it up to a BLE module HM-19 through serial. I can send AT commands and receive responses from the HM-19 successfully.
I have a BLE Smart wristwatch. This BLE smart wristwatch stores my Daily steps, Heart rate & Blood Oxygen.
I can send AT commands to my HM-19 BLE module to successfully connect to my BLE Smart wristwatch. However, after connecting/pairing the HM-19 and the smart wristwatch there doesn't seem to be much I can do.
Question: What AT commands do I have to send to read the wristwatches BLE services and characteristics?
I want to read the daily step counts, heart rate, blood oxygen, battery percentage, etc.
Does anyone know how?

A: From looking at the documentation for the HM-19 module it looks like it might be difficult to do what you are looking for as the product looks like it focuses on supporting UART over BLE.

The only customisation is what UUIDs are used for the two UART characteristics.


text:
Q: Is there a clean way of defining a Java interface method that has different parameters for each implementation class? For example, say I have an interface that defines the method action(...) and I have three (in reality way more) classes that implement action with different parameters like so:
public class Class1 implements SomeInterface {
    public int action(int num) { ... }
}

public class Class2 implements SomeInterface {
    public String action(String string) { ... }
}

public class Class3 implements SomeInterface {
    public double action(double dub) { ... }
}

I feel like this isn't possible, but there's got to be some way to tell the user that each of these classes have an action method; maybe there's a way for it to dynamically accept arguments?
EDIT: What if we don't know that there is exactly one parameter? For example, is something like this possible?
interface SomeInterface<T, T, ..., T> {
    T action(T t1, S s, ..., U u);
}

I feel like this is a really strange question, so I'll try to provide some more context. I'm working on a card game where there are different Action Cards that do different things, and require different information. I thought an Action Card interface was in order here, but then I ran into the issue of how to specify action when each implementation class needs totally different parameters and a different number of parameters as opposed to them implementing the exact same method differently or them each requiring the same number of parameters. For this reason, it is my understanding that generics won't work here but maybe I'm wrong or there's a better way of doing this altogether; perhaps the interface was the wrong way to do it from the start?

A: You can use generics:
interface SomeInterface<T> {
    T action(T t);
}

class Class1 implements SomeInterface<Integer> {
    public Integer action(Integer i) { return null; }
}

class Class2 implements SomeInterface<String> {
    public String action(String s){ return null; }
}

class Class3 implements SomeInterface<Double> {
    public Double action(Double d) { return null; }
}

Generics can only be used for object types, so you have to use primitive wrappers instead of primitives.


text:
Q: Odoo: How to select custom fields using menu id I have made some custom fields into my_purchase_custom.py class like as below.

*

*Custom A

*Custom B

*Custom C

*etc.

Now, there are two menu items in purchase.order model

*

*Requests for Quotations [menu_id=314]

*Purchase Orders [menu_id=315]

What I want to do is I want to put field Custom A into menu_id=314 and fields Custom B and Custom C into menu_id=315
Please help in this regards how to change my .xml file. I went through this link: https://www.odoo.com/fr_FR/forum/help-1/question/hide-menu-for-existing-group-18704 but couldnot understand properly. An example code snippet will be good idea

A: You can assign an action to your menuitem and load the specific views that you want. For instance:
<record id="action_sale_order_view" model="ir.actions.act_window">
    <field name="name">Quotations</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">sale.order</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form,calendar,graph</field>
    <field name="domain">[('field_name','=',False)]</field>
    <field name="help" type="html">
      <p class="oe_view_nocontent_create">
        Click to define a new quotation.
      </p>
    </field>
</record>

<record id="view_act_object_tree" model="ir.actions.act_window.view">
    <field name="view_mode">tree</field>
    <field name="view_id" ref="sale.view_quotation_tree" />
    <field name="act_window_id" ref="action_sale_order_view" />
</record>

<record id="view_act_object_form" model="ir.actions.act_window.view">
    <field name="view_mode">form</field>
    <field name="view_id" ref="sale.view_order_form" />
    <field name="act_window_id" ref="action_sale_order_view" />
</record>

<record id="view_act_object_calendar" model="ir.actions.act_window.view">
    <field name="view_mode">calendar</field>
    <field name="view_id" ref="sale.view_sale_order_calendar" />
    <field name="act_window_id" ref="action_sale_order_view" />
</record>

<record id="view_act_object_graph" model="ir.actions.act_window.view">
    <field name="view_mode">graph</field>
    <field name="view_id" ref="sale.view_sale_order_graph" />
    <field name="act_window_id" ref="action_sale_order_view" />
</record>

<menuitem id="main_sale_order_view"
          name="Quotations"
          parent="base.menu_sales"
          sequence="4"
          action="action_sale_order_view" />

And you can show or hide the elements that you wish in your custom views. Is that what you are looking for?

A: You can try to do the following way some things like this.
Add the Below code  in your .py File
from openerp.osv import fields, osv
class purchase_order(osv.osv):
    _inherit ="purchase.order"
    _columns = {
        'custom_a': fields.char('Custom A'),
        'custom_b': fields.char('Custom B'),
        'custom_b': fields.char('Custom C'),
    }

Add the Below code  in your .xml File
<record model="ir.ui.view" id="r3x_inherit_purchase_ord">
    <field name="name">Purchase Order Inherit Form</field>
    <field name="model">purchase.order</field>
    <field name="inherit_id" ref="purchase.purchase_order_form"/>
    <field name="arch" type="xml">

        <xpath expr="//field[@name='pricelist_id']" position="after">
            <field name="custom_a  attrs={'invisible':[('state','!=','draft')]}/>
            <field name="custom_b attrs={'invisible':[('state','=','draft')]} />
            <field name="custom_c attrs={'invisible':[('state','=','draft')]}/ />
        </xpath>

    </field>
</record>

please you can also set the path of the openerp.py file and add the entry in your .py file in init.py file.
check with the upgrade the module and restart the server and check the effect on purchase order form view.
I hope my answer may helpful for you :)


text:
Q: Boolean algebras as models of (quantifier-free) monadic predicate logic Suppose we have a Boolean algebra over $n$ bits, meaning when viewed as a vector space over $F_2$, the dimension is $n$.
Then we can define $n$ unary predicates $P_n$ which return the value of the $n$'th bit in the corresponding bitvector.
In other words, for some arbitrary element $v$ in the algebra, $P_n(v) = 1$ if the $n$'th bit of $v$ is $1$, or $P_n(v) = 0$ if it is $0$. In this case, we take $0$ and $1$ to be the minimal and maximal elements of the Boolean algebra, respectively.
It is clear that given a Boolean algebra and a set of unary predicates defined from it in this fashion, that we get a quantifier-free monadic predicate logic.
Question: Does the converse hold? In other words, given a quantifier-free monadic predicate logic, is it always equivalent to some Boolean algebra in the above fashion, or derived easily from what I've written here?
The tricky thing here is that defined the way we do it above, the predicates appear to distribute over $\land$, $\lor$, and $\lnot$. In other words, we have:

*

*$P_n(a \land b)$ = $P_n(a) \land P_n(b)$

*$P_n(a \lor b)$ = $P_n(a) \lor P_n(b)$

*$P_n(\lnot a)$ = $\lnot P_n(a)$

Arbitrary unary predicates do not have to obey these laws, but they do hold for the predicates stated above for bits in the Boolean algebra. However, it is relatively easy for us to define "compound predicates" from these primitive ones which exhibit more complex behavior, i.e. defining a predicate $P_x(a) = (\lnot P_1(a) \lor P_2(a)) \land (P_1(a) \lor \lnot P_2(a))$, for instance.


text:
Q: White background under the keyboard How to remove the white background that is under the keyboard?
In the screenshot below, I was able to capture the moment when a white background is visible.
Shown when the keyboard begins to appear.
In the end you can't see it but it is visible during the loading of the keyboard and it looks bad


text:
Q: Synchronisation of db state in blazor I have an app where certain data is stored in the database. Multiple users access the same set of data (similar of a collaboration tool). However, they can non deterministically work on stale data. For example, if there are three work tabs and someone is working on tab 1, it may not matter to him if tab 2 is modified. All CRUD operations are supported.
There are three different ways in which updates to the data can be communicated with the client apps:

*

*Notify all users on every change and force update the entire UI. (Easy to implement, extremely poor user experience)

*Notify all the users on change but only update the portion of UI that needs to be changed. (Complex to implement, optimal user experience)

*Notify on change, but don't update UI. Show exception only if there is an error in subsequent operations. (Easier to implement, can lead to suboptimal user experience)

What is a good architectural tool to implement this? So what I might be looking for is something like flux, but only distributed.


text:
Q: How to extract string between two special characters in mysql I am using a query to extract number between special characters from database.
select number from database where number between like '<%' and '%>'"

How to write MySQL script to get 101 out of <101>?

A: Use SUBSTRING_INDEX to achieve this.
Query
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(num,'>',1),'<',-1) AS extracted
FROM table_name;

Fiddle demo


text:
Q: SQL joins from 2 tables, grouped by joined data from a third Title confusing?  :)
I'm trying to generate a useful report from my shopping cart database.
There's a table orders that contains "date_ordered" (and a bunch of other stuff I don't care about) and a key "orders_id"
A second table, orders_products, has the same "orders_id" key and has info about what was ordered.  In particular, I'm interested in "products_id", "products_quantity", and "final_price"
What I want to do is generate a sales report showing the sum of quantity*price and grouped by products_id when the date_ordered is between two dates.  And I can do that with this:
SELECT op.products_id AS 'PID',
    SUM(op.products_quantity) AS 'sales Q',
    SUM(op.final_price * op.products_quantity) AS 'sales $'
FROM orders o
JOIN orders_products op
ON o.orders_id = op.orders_id
WHERE o.date_purchased
BETWEEN '2012-01-01' AND '2012-12-31'
GROUP BY op.products_id

That appears to work OK.   But now I "simply" wanted to add another column to the report which showed the products name.  That data is in yet another table, products_description in a column "products_name".  So I tried this:
SELECT pd.products_name AS 'Product',
    op.products_id AS 'PID',
    SUM(op.products_quantity) AS 'sales Q',
    SUM(op.final_price * op.products_quantity) AS 'sales $'
FROM orders o
JOIN orders_products op
ON o.orders_id = op.orders_id
JOIN products_description pd
ON op.products_id = pd.products_id
WHERE o.date_purchased
BETWEEN '2012-01-01' and '2012-12-31'
GROUP BY op.products_id

And at first it appeared to work, until I noticed all the sales Q and sales $ figures were 3x what they should be.
Its moved beyond my ability to grasp :)  Help appreciated.

A: Another thing... as others noted about adding the product name to the group by clause, you appear to still have some sort of Cartesian result. Without knowing the actual data, you might want to wrap your query up something like...
select
      pd.products_name AS 'Product',
      PreQuery.*
   from
      ( SELECT
              op.products_id AS 'PID',
              SUM(op.products_quantity) AS 'sales Q',
              SUM(op.final_price * op.products_quantity) AS 'sales $'
           FROM
              orders o
                 JOIN orders_products op
                    ON o.orders_id = op.orders_id
           WHERE
              o.date_purchased BETWEEN '2012-01-01' and '2012-12-31'
           GROUP BY
              op.products_id ) PreQuery
      JOIN products_description pd
         ON PreQuery.PID = pd.products_id

This should work as the internal query does the results all rolled-up on just the PID.  THEN, take that result and join to the product description table.
if you STILL get duplicates for each item, then your product description table would appear to have multiple records for the same product ID... such as there is a higher unique key, but there might be same product with multiple status, types, whatever causing the issue.


text:
Q: What is happening when I run grep -lr "search terms" without the dot? If I run grep -lr "search terms" . on a huge directory tree I get my list of matching files almost instantly. But if I forget the dot, it will run possibly forever. What is it doing? Whenever I make that mistake, I have to ctrl-z and then kill the background process. ctrl-c only works half the time.

A: Calling grep with no file name or a single hyphen tells it to search the standard input. It's waiting for your input. If you type in a sentence that has your search term in it, it will return the matching section highlighted.
http://unixhelp.ed.ac.uk/CGI/man-cgi?grep


text:
Q: Hide many attribute columns in QGIS 3 I know this is pretty much a duplicate of Can you hide attribute columns in QGIS? but I have about 100 columns I want to hide so right clicking each column - Hide is not ideal.
Isn't there a way to hide many columns, then unhide the ones I want to see, like this in ArcMap:

A: Right click on a column name, as you do to hide a single column, but choose "Organize Columns..." instead.
Click "Deselect All" (The Select All and Deselect All buttons only appear if you have a lot of columns, otherwise you have to untick them individually).
IMPORTANT: Tick at least one column back on.
Click OK.
If you don't tick one column back on then you can not get any columns back:
How to show hidden columns in QGIS 3.6.1 (?)
At least until the fix is live:
https://github.com/qgis/QGIS/pull/33918
Update:
Fix has been merged into Master, so should be in the next version of QGIS 3.14. Should be backported into 3.10 LTR, and possibly 3.12.


text:
Q: How do I use a custom ReactJs component inside my JSX file from ReactJs.Net I would like to use the following react component ImageLoader but i dont understand how to integrate it into my current Asp.net mvc project. I m currently running my own reactJs components from a separate JSX using the help of ReactJs.net.

A: You can do it, but it's not a trivial task, because that component is developed using ES6, or, you could say, a new definition for Javascript (or more exactly, "ECMAscript"). You have two main options:
1) Develop the component yourself. You can access the source code of the component in its Github Page. Even if you are not familiar with ES6, I think the logic behind this component should be easy to figure (I recommend this if you don't want to dig on precompiling and using Npm/Bower/etc).
2) As ES6 is not supported by all browsers at this time (Dec 23, 2015). To make it work properly with your project in Visual Studio, you will need to configure your project to use NPM and GULP and BABEL (look up at the first link for more info) to "pre-compile" the file and be able to use it in your JSX. Using Bower or Npm you should be able to import that component into your project.
You could also copy and paste the code inside a file in your project a look up to precompile it with Babel for MSBuild.
Either way, you are going to need to be more aware about ES6 and/or precopiling javascript files in Visual Studio.


text:
Q: Conditionally displaying parts of my view Say I have an asp.net mvc website with a page that lists products. ON that page I have a "delete" button that should only show up for the user that inserted the product. What's the best way to do this?
One way I thought of doing it was setting a boolean in the controller to let the view know if the button should be displayed. Something like:
if(IsProductOwner(UserId))
    ViewData["CanDelete"] = true;

Then in the view I can just do
<% if((boolean)ViewData["CanDelete"] == true) { %>
    // show delete button
<% } %>

But is there a better way to do this?

A: My initial thought is that you should at least make that a function of the Product class so you can go:
<% if (product.IsOwnedBy(UserId)) { %>
    // show delete button
<% } %>

This removes some of the floaty ViewData and builds the business logic into your classes rather than floating out on the edges.
However, I haven't found a decent way to do this sort of conditional display in views unless the view is significantly different then I get the action to display a different view depending on the context.


text:
Q: How to grant a user access to pg_cast? I'm trying to install an application and in the error logs I can see "Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for table pg_cast" so im trying to grant the user access for this table. How would I go about doing this? I have tried GRANT ALL PRIVILEGES ON pg_cast TO mft_admin_group; and it doesnt work.

A: In PostgreSQL, every user (PUBLIC) has access to that table:
\dp pg_catalog.pg_cast
                                    Access privileges
   Schema   │  Name   │ Type  │     Access privileges     │ Column privileges │ Policies
════════════╪═════════╪═══════╪═══════════════════════════╪═══════════════════╪══════════
 pg_catalog │ pg_cast │ table │ postgres=arwdDxt/postgres↵│                   │
            │         │       │ =r/postgres               │                   │
(1 row)

You must either be working with a modified version, or an administrator broke your database by modifying the catalogs.


text:
Q: Operator '==' cannot be applied to same generic type I'm not sure I understand the cause of this error or what to do about it.
I have a generic class.
public class RadioCommandCollection<T> : List<RadioCommand<T>> where T : struct, IComparable<T>
{
    /// <summary>
    /// Sets the value associated with the selected menu item to button.
    /// </summary>
    public void SetValue(T value)
    {
        foreach (RadioCommand<T> command in this)
        {
            command.SetIsSelected(command.Value == value);
        }
    }
}

And the line in the foreach block gives me an error:

CS0019 Operator '==' cannot be applied to operands of type 'T' and 'T'

Note that RadioCommand<T>.Value is of type T. It seems like I'm only defining T once here. I don't get the conflict.
I added the IComparable<T> constraint but that didn't help. Note that I'd like to restrict T to an enum, but that's not a valid constraint.

A: Simpliest way
public class RadioCommandCollection<T> : List<RadioCommand<T>> where T : struct
{
    /// <summary>
    /// Sets the value associated with the selected menu item to button.
    /// </summary>
    public void SetValue(T value)
    {
        foreach (RadioCommand<T> command in this)
        {
            command.SetIsSelected(command.Value.Equal(value));
        }
    }
}

Other way
public class RadioCommandCollection<T> : List<RadioCommand<T>> where T : class
{
    /// <summary>
    /// Sets the value associated with the selected menu item to button.
    /// </summary>
    public void SetValue(T value)
    {
        foreach (RadioCommand<T> command in this)
        {
            command.SetIsSelected(command.Value == value);
        }
    }
}


text:
Q: Bootstrap Custom CSS Specificity Not Overwriting Brand Image Okay, so I am a beginner but I've read a decent amount on this situation. But I'm trying to put my brand image in my nav bar.
I know it will be something stupid and small. I can always overwrite the style in the HTML but I'd prefer to have it done in a custom css file.
First things first, getting the obvious out of the way. My custom CSS file is the last css declared in the head. I am able to modify other elements on the page like paragraph element colors, so I know the CSS file is linked properly. I understand specificity, at least the core concept of it.
To try to tackle the specificity issue. I first made a custom id for my  so within the tag I declared  and in my CSS file I wrote
#logo {
    height: 110%;
}

Nothing. So I tried being more specific and adding every single class declaration possible that could point to the logo file.
#logo .nav .navbar .navbar-inverse .navbar-fixed-top .navbar-brand {
...
}

again no luck. I tried just .navbar-brand and every single combination of classes. I just don't understand the hierarchy and who is taking precedence. My CSS file, if listed last in the header, with a properly Specified class declaration should overwrite any of bootstrap's code.
I know this question must get asked a lot but after hours of searching for the answer I haven't found it anywhere.
html snippet of the section

    <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
        Toggle navigation

    </button>

A: The thing is you are specifying the height in percentage, which requires the high of the parent element to be defined. In Bootstrap 3 the parent element of .navbar-brand is div.navbar-header and it has no defined height. For that reason height: 110%; does not work. So you need to define the height of the logo in pixels or define it in percentage and define div.navbar-header height in pixels.


text:
Q: mdwlist enumerate changes from Roman to Arabic after suspend In LaTeX, I am using the enumerate and mdwlist packages to create an enumerated list with a pause in the middle, using the suspend/resume commands. I want Roman numerals counting the list items, which I specify by supplying the option [(i)] to the enumerate environment.
The problem is that after the suspend/resume, the list resumes with Arabic numerals counting the list items, instead of Roman.
If I supply the option [(i)] to the resume command, it gives a compile error.
References to the list items also come out as mixed Roman/decimal.
Does anyone know how to fix this, and keep Roman everywhere?
Here is a minimal example:
\documentclass{article}
\usepackage{enumerate}
\usepackage{mdwlist}

\begin{document}
  \begin{enumerate}[(i)] % option [(i)] indicates Roman
    \item\label{itemi} First item % Roman
  \suspend{enumerate}
  Text between suspend and resume commands
  \resume{enumerate}[(i)]
    \item\label{itemii} Second item % decimal
  \end{enumerate}
  Ref to first item: ``\ref{itemi}''. Ref to second item: ``\ref{itemii}''.
\end{document}

A: Use enumitem instead. It allows you to resume* which resumes a list based on the previous settings:

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\begin{enumerate}[label=(\roman*)]% roman enumeration
  \item\label{itemi} First item
\end{enumerate}
Text between suspend and resume commands
\begin{enumerate}[resume*]
  \item\label{itemii} Second item
\end{enumerate}
Ref to first item: ``\ref{itemi}''. Ref to second item: ``\ref{itemii}''.
\end{document}

resume* effectively does resume,label=(\roman*) for the options. However, you can use the latter if you wish to update the formatting/options upon a resume.