text:
Q: Retrieving web part ID (GUID) with SharePoint REST API I need to get the ID of a web part on a page before I have redirected the browser to the page.
The reason for this is that I need to update a field value that contains web part settings, which are linked via the web part ID's. I can access the page field and update it through a POST-call using the REST API, but I have yet to find a way to retrieve the web part ID's on the page.
If the case was that I could load the page first, then it would have been simple to retrieve them with jQuery.
Is this possible, or do I have to find another way? Using CSOM would be an acceptable answer as long as it's done with JavaScript.

A: You can get the ID through GetLimitedWebPartManager method
You need file URL, the scope and something to filter by.
Here is an example:
_api/Web/GetFileByServerRelativeUrl('/sites/test/Home.aspx')/GetLimitedWebPartManager(scope=1)/WebParts?$expand=WebPart&$filter=WebPart/Title+eq+'Test'


text:
Q: Can someone help me convert an codepen into an react sandbox fiddle? I created an codepen with react code and I'm importing its libraries trough CDN.
Now I want to implement this code (working) into my react project.
But first It could be handy to put all code into a react sandbox so I can make changes before deploying to my code.
I tried to copy paste all code into a sandbox and add all libraries (react, react-dnd, reactdndhtml5backend, react-dom), but it still gives me a lot of errors.
Also the files in my own project are .tsx and not .js.
My current codepen is found here: https://codepen.io/darkinfore/pen/daJxyP
This works, but just not when I implement this into a react sandbox.
I also tried to implement this into a react sandbox: https://codesandbox.io/s/w01l077w1w
But as you can see it gives me some strange errors.
Can someone help me with converting this codepen into a react sandbox without errors?

A: I looked over your codesandbox and then forked it here. Actually, the only error encountered had to do with ReactDnD not being defined (such that DropTarget could not be found). This was due to your import statement near the top of index.js:
import ReactDnD from "react-dnd";

Because of the way the react-dnd package is designed, this way of importing will not work for you. The package has multiple exports (for example, DragDropContext and DropTarget) rather than a single, default export. You need to take all of these exports and import them together into a single named import, called ReactDnD. So, what you need to do is:
import * as ReactDnD from "react-dnd";

I did this in the forked codesandbox, and this got you past the TypeError and then displayed your table.

Helpful information:

*

*Different ways to use import

*Exported modules from react-dnd package

redpajama_set_name: RedPajamaStackExchange


text:
Q: CXF request response logging using log4j: debug I am trying to enable logging for cxf framework in weblogic application server along with log4j.
I have placed cxf.xml in domain home and have modified setdomainenv to add cxf.xml entry -Dcxf.config.file.url=cxf.xml.
I am setting System.setProperty("org.apache.cxf.Logger", "org.apache.cxf.common.logging.Log4jLogger") before making a webservice call and i have tried configuring all 3 types of configuration specified in http://cxf.apache.org/docs/configuration.html. But nothing seems to work.
I even tried creating org.apache.cxf.Logger file containing  value org.apache.cxf.common.logging.Log4jLogger.
my log4j.properties
    log4j.rootLogger = DEBUG, FILE
    log4j.logger.org.apache.cxf=DEBUG
    log4j.appender.FILE=org.apache.log4j.FileAppender
    log4j.appender.FILE.File=<>/logFile.log
    log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
    log4j.appender.FILE.layout.conversionPattern=%m%n
CXF version: 2.7.5
Please suggest if there is change required for me to log both request and response xml?

A: Make sure your org.apache.cxf.Logger file is under META-INF/cxf.  Inspect your war to make sure.
Also, assuming you are defining your services using jaxws, make sure you're defining loggers under the jaxws:inInterceptor and jaxws:outInterceptor
<jaxws:client id="..." serviceClass="..." address="..." >
  <jaxws:outInterceptors>
    <ref bean="logOut" />
  </jaxws:outInterceptors>
  <jaxws:inInterceptors>
    <ref bean="logIn"/>
  </jaxws:inInterceptors>
</jaxws:client>

<bean class='org.apache.cxf.interceptor.LoggingInInterceptor' id='logIn'/>

<bean class='org.apache.cxf.interceptor.LoggingOutInterceptor' id='logOut'/>


text:
Q: Display uploaded image in JSF I have a view scoped bean where I create a person. A person can have a picture. This picture is uploaded the same page the person is created. The picture is not stored in a database or on disk (since the person isn't created yet). The bean has to be view scoped since a person can be created elsewhere and this uses the same bean. If the bean is session scoped and a user uploads a picture but does not save the person, the picture will be displayed next time the user tries to create a person.
I solved this by using two beans; one view scoped bean to create the person and a session scoped bean to upload the picture and to get the picture as a stream. This however causes the problem noted above.
How can I solve this in a better way?
The upload bean:
@ManagedBean(name = "uploadBean")
@SessionScoped
public class UploadBean
{
    private UploadedFile    uploadedFile;

    public UploadedFile getUploadedFile()
    {
        return uploadedFile;
    }

    public StreamedContent getUploadedFileAsStream()
    {
        if (uploadedFile != null)
        {
            return new DefaultStreamedContent(new ByteArrayInputStream(uploadedFile.getContents()));
        }
        return null;
    }

    public void uploadFile(FileUploadEvent event)
    {
        uploadedFile = event.getFile();
    }
}

The create-a-person bean:
@ManagedBean(name = "personBean")
@ViewScoped
public class PersonBean
{
    private Person newPerson = new Person();

    public Person getNewPerson()
    {
        return newPerson;
    }

    private UploadedFile getUploadedPicture()
    {
        FacesContext context = FacesContext.getCurrentInstance();
        ELContext elContext = context.getELContext();
        UploadBean uploadBean = (UploadBean) elContext.getELResolver().getValue(elContext, null, "uploadBean");
        return uploadBean.getUploadedFile();
    }

    public void createPerson()
    {
        UploadedFile uploadedPicture = getUploadedPicture();
        // Create person with picture;
    }
}

The relevant JSF page part:
<h:form enctype="multipart/form-data">

</h:form>

A: I've gone for a different approach. I initially went for displaying an uploaded image, however if the Person isn't created yet it seemed like a better idea to keep it all client side. I found this question and created the following based on the chosen answer:
In the head I include html5shiv if the browser is IE and the version is less than 9 for compatibility:
<h:outputText value="<!--[if lt IE 9]>" escape="false" />
<h:outputScript library="js" name="html5shiv.js" />
<h:outputText value="<![endif]-->" escape="false" />

To display/upload the image I have these elements:

And some JavaScript/jQuery magic:
function readPicture(input, output)
{
    if (input.files && input.files[0])
    {
        var reader = new FileReader();
        reader.onload = function(e)
        {
            output.attr('src', e.target.result);
        };
        reader.readAsDataURL(input.files[0]);
    }
}

$("[id='#{upload.clientId}']").change(
    function()
    {
        readPicture(this, $("[id='#{image.clientId}']"));
    });

The uploadedPicture property is now a simple property:
@ManagedBean(name = "personBean")
@ViewScoped
public class PersonBean
{
    private UploadedFile uploadedPicture;

    public UploadedFile getUploadedPicture()
    {
        return uploadedPicture;
    }

    public void setUploadedPicture(UploadedFile uploadedPicture)
    {
        this.uploadedPicture = uploadedPicture;
    }
}

A: Add.xhtml
<h:form id="add-form" enctype="multipart/form-data">

         <h:panelGrid columns="2">

         </h:panelGrid>
</h:form>

Here is Managed Bean Code:
@ManagedBean
@RequestScoped
public class ProductController implements Serializable{
    private ProductBean bean;
    @ManagedProperty(value = "#{ProductService}")
    private ProductService productService;
    private StreamedContent content;
    private UploadedFile file;
    public StreamedContent getContent() {
        FacesContext context = FacesContext.getCurrentInstance();

         if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) {
                return new DefaultStreamedContent();
            }
         else{
             String imageId = context.getExternalContext().getRequestParameterMap().get("id");
            Product product = getProductService().getProductById(Integer.parseInt(imageId));
            return new DefaultStreamedContent(new ByteArrayInputStream(product.getProductImage()));
         }
    }
    public ProductController() {
        bean = new ProductBean();
    }

    public void setContent(StreamedContent content) {
        this.content = content;
    }
    public UploadedFile getFile() {
        return file;
    }

    public void setFile(UploadedFile file) {
        this.file = file;
    }
    public void saveProduct(){
        try{
            Product product = new Product();
            product.setProductImage(getFile().getContents());

            getProductService().saveProduct(product);
            file = null;

        }
        catch(Exception ex){
            ex.printStackTrace();
        }
    }
    public void validateFile(FacesContext ctx,
            UIComponent comp,
            Object value) {
        List<FacesMessage> msgs = new ArrayList<FacesMessage>();
        UploadedFile file = (UploadedFile)value;
        int fileByte = file.getContents().length;
        if(fileByte > 15360){
            msgs.add(new FacesMessage("Too big must be at most 15KB"));
        }
        if (!(file.getContentType().startsWith("image"))) {
            msgs.add(new FacesMessage("not an Image file"));
        }
        if (!msgs.isEmpty()) {
            throw new ValidatorException(msgs);
        }
    }
}

Add these lines of code in web.xml
<filter>
    <filter-name>PrimeFaces FileUpload Filter</filter-name>
    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>PrimeFaces FileUpload Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

And following jar files in WEBINF/lib folder.
commons-io-X.X  and commons-fileupload-X.X, recommended most recent version.

commons-io-2.4,commons-io-2.4-javadoc,commons-io-2.4-sources,commons-io-2.4-tests,commons-io-2.4-test-sources,commons-fileupload-1.3,commons-fileupload-1.3-javadoc,commons-fileupload-1.3-sources,commons-fileupload-1.3-tests,commons-fileupload-1.3-test-sources
View.xhtml
<h:form id="ShowProducts">

                <f:param name="id" value="#{products.productId}" />

            #{products.productName}

</h:form>

A: I managed to do that by simply encoding uploaded image to base64 and then showing it normally via html  tag.
Here's my managed bean:
@ManagedBean
@ViewScoped
public class ImageMB {

private String base64Image;

public void onUploadImage(FileUploadEvent event) {
    String fileName = event.getFile().getFileName();
    //Get file extension.
    String extension = "png";
    int i = fileName.lastIndexOf('.');
    if (i > 0) {
        extension = fileName.substring(i + 1).toLowerCase();
    }

    String encodedImage = java.util.Base64.getEncoder().encodeToString(event.getFile().getContents());
    this.base64Image = String.format("data:image/%s;base64, %s",
         extension, encodedImage));
}

And here's JSF part:


text:
Q: looking for a more elegant way to solve this task I'm pretty new in Angular and I'm looking for a more elegant way to solve this task.
Code bellow works fine, but I'm not sure that is a right way to make it done.
HTML

Filtering input:

<input type="text" ng-model="search" />

            {{ x.name + ', ' + x.country }}

JS
var searchVal;
angular.module('CustomFilterModule', [])
  .filter('myFilter', function() {
  return function( input ) {
    searchVal = searchVal || '';
    var s = searchVal.toLowerCase();
    var arr = [];
    for (var i = 0; i < input.length; i++) {
      if(input[i].name.toLowerCase().indexOf(s) === 0 || input[i].country.toLowerCase().indexOf(s) === 0) arr.push(input[i]);
    }

    return arr;
  };
});

angular.module('ngFilterApp', ['CustomFilterModule'])
  .controller('namesCtrl', function($scope) {
  $scope.names = [
    {name:'Moscow',country:'Russia'},
    {name:'Kiev',country:'Ukraine'},
    {name:'Yerevan',country:'Armenia'},
    {name:'Washington',country:'USA'},
    {name:'Madrid',country:'Spain'},
    {name:'Tbilisi',country:'Georgia'}
  ];

  $scope.$watch('search', function() { searchVal = $scope.search; }, true);
});

JSBIN http://jsbin.com/bomotocota/edit?html,js,output

A: You can pass the query string in to the filter as an argument, see modified JSBIN:
http://jsbin.com/yivomusoso/edit?html,js,output


text:
Q: Como utilizar os códigos do plunker em minhas aplicações? Sou profissional Oracle há 12 anos e estou iniciando no desenvolvimento web com AngularJS.
Procurei pela internet por "login screen angularJs" e cheguei ao plunker com seu modelo: http://embed.plnkr.co/tg25kr/?show=preview
Obviamente, me empolguei e baixei o código fonte e para a minha decepção, não funcionou em meus browsers.
A pergunta é: Por quê?! Se o código é o mesmo que aparece no plunker, o que está faltando para que ele funcione?

A: Você precisa de um servidor para rodar o AngularJS.
Uma opção muito simples é o NodeJS, através do seu módulo http-server.
Instalação:
Para instalar globalmente digite: npm install -g http-server.
Execução:
Entre no diretório do projeto e rode com http-server -o.
O parâmetro -o abre o navegador na página principal do projeto.


text:
Q: Android Auth Error: "GetToken failed with status code: INVALID_AUDIENCE" There are a couple of questions about this vague error code already, but none have solved this issue for me, so I'll try again. First, here is the boilerplate code for signing in.
      GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestEmail()
        .requestServerAuthCode("web app client ID copied from Dev API Console", false)
        .build();

  mGoogleApiClient = new GoogleApiClient.Builder(this).enableAutoManage(this, this).addApi(Auth
        .GOOGLE_SIGN_IN_API, gso).build();

  Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
  startActivityForResult(signInIntent, RC_SIGN_IN);

With this code, I get a dialog and can select the appropriate user account. Yay! However, I then get a canceled code in onActivityResult, so I check logcat and notice the error message in the title. Then I search for other people with this issue, but haven't been able to figure out what the issue is in my case.
So let's check off common issues from other posts.

*

*The Firebase console shows my app is registered with the correct SHA-1 and SHA-256 fingerprints

*Both release and debug builds use the same keystore

*In the Google API manager, my "OAuth consent screen" is configured

*I've also verified the domain of the authorized redirect URIs

*I've re-downloaded the Firebase GoogleServices.json file, just to be sure

*There are no package name issues. In fact, Firebase Analytics has been running just fine on this app in the wild

*In the Play Store dev console, my OAuth client shows up in "Settings->API access"

*My Firebase project is linked in the Play Store dev console "Linked Accounts" settings section

*I've waited 10 hours, just to see if Google's backend would take time to set this up

For searchability, right after the logcat error message in the title, I get the following logcat print.

You have wrong OAuth2 related configurations, please check. Detailed
  error: INVALID_AUDIENCE

A: Your Web Client ID has to be generated in the same user account as Firebase, not your Play Store account. In my case, the two accounts are separate, and Google throws this error instead of linking the information properly. My Firebase account is linked to my Play Store account but that apparently doesn't mean the web client ID will be shared. I tried some other solutions such as linking the API Manager accounts, and that didn't work either. You must create the Web Client ID inside the same project Firebase uses in the API Manager account that is the same as your Firebase account.

A: The problem is with your client_id, for google auth process.Delete the file from current project.Then add a new instance. This time paying careful attention to the id. use android-studio to generate the settings for firebase.
You have to have a project with multiple client ids
One is for your android app, with the SHA. Safest bet is delete your current project in the google console.Then re-create it.Then in android studio go tools= > firebase then choose the settings you want to integrate. I do not recommend manual addition.

A: Implement to your activity
GoogleApiClient.OnConnectionFailedListener

Setup these private variables
private GoogleApiClient mGoogleApiClient;
private FirebaseAuth mFirebaseAuth;
private FirebaseAuth mFirebaseAuth;
private static final int RC_SIGN_IN = 9001;

Configure Google Sign In
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(SignInActivity.this.getResources().getString(R.string.default_web_client_id))
            .requestEmail()
            .build();

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .build();

Initialize FirebaseAuth
mFirebaseAuth = FirebaseAuth.getInstance();
    mFirebaseUser = mFirebaseAuth.getCurrentUser();
    if (mFirebaseUser == null) {
        // Not signed in, launch the Sign In activity
    } else {
        // Already signed in, launch the Home activity
        //You can use mFirebaseUser.getDisplayName() / getUid() / getEmail() /getPhotoUrl()

    }

Sign In Method
private void signIn() {
    Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
    startActivityForResult(signInIntent, RC_SIGN_IN);
}

onActivityResult()
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.e("Data",data.getExtras().toString());
    // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
    if (requestCode == RC_SIGN_IN) {
        GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        Log.e("Result","status "+result.getStatus()+"Success"+result.isSuccess()+" "+result.getSignInAccount());
        if (result.isSuccess()) {
            // Google Sign In was successful, authenticate with Firebase
            GoogleSignInAccount account = result.getSignInAccount();
            firebaseAuthWithGoogle(account);
        } else {
            // Google Sign In failed
            Log.e(TAG, "Google Sign In failed.");
        }
    }
}

firebaseAuthWithGoogle
private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
    Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
    AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
    mFirebaseAuth.signInWithCredential(credential)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());

                    // If sign in fails, display a message to the user. If sign in succeeds
                    // the auth state listener will be notified and logic to handle the
                    // signed in user can be handled in the listener.
                    if (!task.isSuccessful()) {
                        Log.w(TAG, "signInWithCredential", task.getException());
                        Toast.makeText(SignInActivity.this, "Authentication failed.",
                                Toast.LENGTH_SHORT).show();
                    } else {
                        Toast.makeText(SignInActivity.this, "Authentication Successful.",
                                Toast.LENGTH_SHORT).show();
                    }
                }
            });
}

onConnectionFailed()
 @Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
    // An unresolvable error has occurred and Google APIs (including Sign-In) will not
    // be available.
    Log.d(TAG, "onConnectionFailed:" + connectionResult);
    Toast.makeText(this, "Google Play Services error.", Toast.LENGTH_SHORT).show();
}

Sign Out Method
private void signOut() {
        Auth.GoogleSignInApi.signOut(mGoogleApiClient).
                setResultCallback(new ResultCallback<Status>() {
                    @Override
                    public void onResult(@NonNull Status status) {
                    }
                });
        mFirebaseAuth.signOut();
}

Keep logs at everypoint .
if you followed all the points properly combining with the list you made it should work.


text:
Q: TWTweetComposeViewController alerts that No twitter Profile found I'm using TWTweetComposeViewController for tweet a message. In IOS 6.1 working perfectly, but incase of IOS 7, the twitter account from the device was fetched and properly getting user details from the twitter site. while opening tweet sheet, a alert the saying "no twitter account configured.you can add or create a twitter account in settings".
note: a twitter account  has been configured in settings.
i encounted same problem in SLComposeViewController
UPDATE: working in device not in simulator.

A: You need to go into the Simulator (or Device you are testing on) and go into settings and log into a twitter account on there for this to work.


text:
Q: How to Stop python from ruuning a function automatically I'm working on my new program and i there is an issue with it that I need your help.
When I run my python code and there is a function like the codes below, it automatically runs it but I wanna stop it from running, what can I do?
def hello():
    print("hello world!")
hello()

When you run it, it prints hello world!, but I want it to get compiled when it was asked for. What can i do?

A: Remove the call to the function so that only the def statement remains:
def hello():
    print("hello world!")

A: def hello():
    print("hello world!")
hello() # <-- This line here calls the function hello

Remove the last line if you don't want it to print "hello world!".


text:
Q: There are 1 unused configuration paths (dbt-env) C:\dbt_project>dbt compile
20:21:56  Running with dbt=1.3.1
20:21:56  [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:

*

*models.dbt_project.example

20:21:56  Found 0 models, 0 tests, 0 snapshots, 0 analyses, 339 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
20:21:56
20:21:56  [WARNING]: Nothing to do. Try checking your model configs and model specification args
20:21:56  Done.
and the adapter is dby-synapse

dbt_project.yml
name: 'dbt_project'
version: '1.0.0'
config-version: 2
profile: 'dbt_project'
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
target-path: "target"
clean-targets:
- "target"
- "dbt_packages"
models:
dbt_project:
example:
+materialized: view

dbt init dbt_projct...
Note:  dbt debug.. all is successful
Configuration:
profiles.yml file [OK found and valid]
dbt_project.yml file [OK found and valid]
Required dependencies:
git [OK found]
Connection test: [OK connection ok]
All checks passed!
when compiling or run get the error

A: My case was folder issue.. i was running the dbt from wrong folder


text:
Q: CSS make li display none when it doesn't contain checked checkbox I have a ul with 3 li's each one contains a checkbox and a its label (Woocommerce shipping methods). How I can set display:none the li's without the checked checkbox?
Here is the html where in the specific example I want to hide everything than free_shipping li:

            <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate8" value="flat_rate:8" class="shipping_method porto-control-input">
                Flat rate 5:

                        <bdi>
                            €5,00
                        </bdi>

                <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate9" value="flat_rate:9" class="shipping_method porto-control-input">
                    Flat rate 10:

                            <bdi>
                                €10,00
                            </bdi>

                    <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_free_shipping10" value="free_shipping:10" class="shipping_method porto-control-input" checked="checked">
                        Free shipping

A: You can use filter to all radio inside li and hide if is not checked.

$('li input[type="radio"]').filter(function() {
  return !$(this).is(":checked");
}).closest('li').hide();

            <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate8" value="flat_rate:8" class="shipping_method porto-control-input">
            Flat rate 5:

                    <bdi>
                        €5,00
                    </bdi>

            <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate9" value="flat_rate:9" class="shipping_method porto-control-input">
            Flat rate 10:

                    <bdi>
                        €10,00
                    </bdi>

            <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_free_shipping10" value="free_shipping:10" class="shipping_method porto-control-input" checked="checked">
            Free shipping

A: You can use jQuery to achieve this.

*

*First select all the checkboxes except the checked one.

*Then get the parent li and add CSS to it.

$("document").ready(function() {
  var $uncheckedLi = $("ul li input:not([checked])").parents("li");
  $uncheckedLi.css("display", "none");
});

      <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate8" value="flat_rate:8" class="shipping_method porto-control-input">

        Flat rate 5:

          <bdi>€5,00</bdi>

      <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate9" value="flat_rate:9" class="shipping_method porto-control-input">

          Flat rate 10:

              <bdi>€10,00</bdi>

      <input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_free_shipping10" value="free_shipping:10" class="shipping_method porto-control-input" checked="checked">
      Free shipping


text:
Q: Remove spacing and vertical align divs I'm trying to make the boxes in view:

*

*touch each other

*vertical align so they all touch the top of the parent div

*keep the slider without JavaScript

Codepen
I've been trying cell-spacing, vertical-align, border-spacing, and etc. but either I'm not understanding how to apply them or I've gone in a bad direction with the DOM.

Why in a codepen? I'm building a theme for Bootstrap 2.

A: You have a padding applied to the td elements, remove that and set vertical-align: top.
Codepen
CSS
td {
  padding: 0;
  vertical-align: top;
}


text:
Q: T-Sql @@Identity Does someone know how can I return the @@Identity when using T-Sql?
Something like this:
set @Sql = "insert into table....values()..."
exec @sql
return @@Identity

A: It looks like one of your implicit requirements is the execution of dynamic SQL. While I'd advise against this, you can accomplish what you're looking for with this:
set @Sql = 'insert into table....values()...; select SCOPE_IDENTITY()'
exec(@Sql)

A: Like this:
INSERT INTO Table(...)
OUTPUT INSERTED.IdColumn
VALUES(...)

A: Append ";select @@identity" to your insert statement:
insert into tab (x,y,z) values (a,b,c); select @@identity

The returned value is the ID (use ExecuteScalar)

A: INSERT INTO TableName (Field1, Field2, Field3) VALUES (1, 2, 3);
SELECT SCOPE_IDENTITY();

This is a multi-statement batch, so I'm not sure that every client library will return values the same way; in classic ADO, for example, it's possible that you might need to advance to the next recordset before you can read the value. But if you're using ADO.NET, I know that you can just use ExecuteScalar on the whole string above, and it will return your SCOPE_IDENTITY value just fine.
Caution: ADO.NET will return the value as a decimal, not an int like you might expect. This is because SCOPE_IDENTITY, for whatever reason, is typed as numeric(38,0). So you either need to cast the ExecuteScalar result to decimal before you cast it to int, or you need to SELECT CAST(SCOPE_IDENTITY() AS INT) (assuming your IDENTITY field is an INT, and not some larger numeric type).

A: You can use this
Insert into Table(Col2, Col3)
output inserted.Id
values ('xyz', 'abc')

Where Id is your Identity field


text:
Q: systemd analyze blame says Excess arguments My Ubuntu 16.04 takes long time to boot, so I tried to figure out what is the problem. When I run systemd analyze blame, it says Excess arguments in red color. What can be wrong with my system?

A: I searched the systemd code base for the string "Excess arguments." which helped find the answer. It says it is emitted when "we aren't run as an init system"
That seems strange and unrelated until I looked twice at what you ran. You ran:
 systemd analyze blame

Which is a typo. You meant to run:
 systemd-analyze blame

The code comment turns out to be right on-- you were running systemd not as init system, making the analyze and blame arguments to be excess.


text:
Q: Custom UIView in storyboard not showing subviews I have created a custom UIView to show an UIActivityIndicatorView and a message. Idea is to reuse this across my app for consistency. Below is the code:
@implementation CDActivityIndicator

@synthesize activityIndicator, message;

//init method called when the storyboard wants to instantiate this view

- (id) initWithCoder:(NSCoder*)coder {

    if ((self = [super initWithCoder:coder])) {

        activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];

        message = [[UILabel alloc] initWithFrame:CGRectZero];
        [message setBackgroundColor:[UIColor clearColor]];
        [message setTextColor:[UIColor whiteColor]];
        [message setTextAlignment:NSTextAlignmentCenter];
        [message setFont:[UIFont fontWithName:@"HelveticaNeue" size:15.0f]];

        [self addSubview:activityIndicator];
        [self addSubview:message];

        //set background color
        [self setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5]];
    }

    return self;
 }

-(void) layoutSubviews {

    [super layoutSubviews];

    //position the indicator at the center of the view
    [activityIndicator setCenter:[self center]];

    //position the label
    [message setFrame:[self frame]];

}

- (void) begin {

    //make sure the current view is visible, and message is hidden
    [self setHidden:NO];
    [activityIndicator setHidden:NO];
    [self bringSubviewToFront:activityIndicator];
    [message setHidden:YES];

    [self performSelectorOnMainThread:@selector(startAnimating) withObject:self waitUntilDone:YES];
}

- (void) startAnimating {
    if( !activityIndicator.isAnimating ) {
        [activityIndicator startAnimating];
    }
}

To try this out, I added a UIView to one of my views in the storyboard and set the class for that view to CDActivityIndicator. When I call begin() from the corresponding View Controller, the CDActivityIndicator gets shown as an empty view with the expected background color. However, the activity indicator doesn't show. All methods are getting called as expected.
Any idea what I might be missing? Thanks!

A: You should change your subviews frame setting like this.
CGPoint point = [self.superview convertPoint:self.center toView:self];
[activityIndicator setCenter:point];
[message setFrame:self.bounds];

The frame defines the origin and dimensions of the view in the coordinate system of its superview. Every UIView has its own coordinate system. You should take this into account.


text:
Q: Draw line in tab I want to draw some lines into second tab, but I had error "...stop unexpectedly". Maybe someone can help...
tab_map.xml
    <?xml version="1.0" encoding="utf-8"?>
<FrameLayout
  android:id="@+id/map_view"
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#FFFFFF" />

TabMap.java
public class TabMap extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab_map);

        FrameLayout fLayout = (FrameLayout) findViewById(R.id.map_view);
        fLayout.addView(new TabMapLine(this, 0, 0, 50, 50));
    }

TabMapLine.java
public class TabMapLine extends View{

    private final float startX;
    private final float stopX;
    private final float startY;
    private final float stopY;
    Paint paint = new Paint();

    public TabMapLine(Context context, float x1, float y1,float x2, float y2){
        super(context);
        paint.setColor(0xFFFF0000);
        this.startX = x1;
        this.startY = y1;
        this.stopX = x2;
        this.stopY = y2;
    }

    protected void onDraw(Canvas canvas){
        super.onDraw(canvas);
        canvas.drawLine(startX, startY, stopX, stopY, paint);
    }
}

TabActivity: Training.java
public class Training extends TabActivity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_training);

    Resources res = getResources();
    TabHost tabHost = getTabHost();
    TabHost.TabSpec spec1;
    TabHost.TabSpec spec2;
    Intent intent1;
    Intent intent2;

    intent1 = new Intent().setClass(this, TabTimer.class);

    spec1 = tabHost.newTabSpec("tab1").setIndicator("Tren",
            res.getDrawable(R.drawable.tab_1)).setContent(intent1);
    tabHost.addTab(spec1);

    intent2 = new Intent().setClass(this, TabMap.class);
    spec2 = tabHost.newTabSpec("tab2").setIndicator("Map",
            res.getDrawable(R.drawable.tab_2)).setContent(intent2);
    tabHost.addTab(spec2);

    tabHost.setCurrentTab(0);
}

}
Log cat errors
E/AndroidRuntime( 2472):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 2472):at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 2472):at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 2472):at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 2472):at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2472):at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2472):at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 2472):at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2472):at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2472):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 2472):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 2472):at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2472):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 2472):at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
E/AndroidRuntime( 2472):at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
E/AndroidRuntime( 2472):at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
E/AndroidRuntime( 2472):at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)
E/AndroidRuntime( 2472):at android.widget.TabHost.setCurrentTab(TabHost.java:323)
E/AndroidRuntime( 2472):at android.widget.TabHost.addTab(TabHost.java:213)
E/AndroidRuntime( 2472):at org.me.piana.training.Training.onCreate(Train
ing.java:39)
E/AndroidRuntime( 2472):at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2472):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 2472):... 11 more
E/AndroidRuntime( 2472): Caused by: java.lang.ClassCastException: android.widget.TextView
E/AndroidRuntime( 2472):at org.me.piana.training.TabTimer.onCreate(TabTimer.java:59)
E/AndroidRuntime( 2472):at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 2472):at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 2472):        ... 20 more
W/ActivityManager(58):Force finishing activity org.me.piana/.training.Training
W/ActivityManager(   58):Force finishing activity org.me.piana/.PIaNA
W/ActivityManager(   58):Activity pause timeout for HistoryRecord{45114d10 org.me.piana/.training.Training}
D/SntpClient(   58): request time failed: java.net.SocketException: Address fami
ly not supported by protocol
W/ActivityManager(   58): Activity destroy timeout for HistoryRecord{45080400 or
g.me.piana/.PIaNA}
W/ActivityManager(   58): Activity destroy timeout for HistoryRecord{45114d10 or
g.me.piana/.training.Training}

A: As I can see from log output, problem is in the TabTimer onCreate() method. You are trying to cast TextView object to wrong type in the line 59 of TabTimer.java


text:
Q: How to show that a matrix is the eigenvector matrix I have the matrix $$\mathrm{T}=\left[\begin{array}{cc}
e^{B+J} & e^{-J} \\
e^{-J} & e^{-B+J}
\end{array}\right]$$
With the eigenvalues:
$$\lambda_{1,2}=e^{J} \cosh (B) \pm \sqrt{e^{2 J} \sinh ^{2}(B)+e^{-2 J}}, \quad \cot (2 \phi)=e^{2 J} \sinh (B), \quad 0<\phi<\frac{\pi}{2}$$
And I would like to show that $$S=\left(\begin{array}{cc}
\cos \phi & -\sin \phi \\
\sin \phi & \cos \phi
\end{array}\right)$$
Is the matrix of eigenvectors for $T$. What would be the simplest way to show this?


text:
Q: How to reduce costs with Azure IoT Suite? I started a IoT monitoring solution with azureiotsuite.com. This provisioned multiple services on my Azure account, which have dramatically increased the compute costs. The image shows all that have been provisioned for the suite:   All of these services have been provisioned within the same resource group. I would like to experiment further with the IoT suite, but not have things running while I'm not working on it.
Edit
Azure provisions two plans with Event Hubs, IoT Hubs, multiple storage and stream analytics instances. Although impressive, it is costly.  Can I stop or deallocate these services easily, or is the best course of action to provision and delete every time?

A: Those -plan services are Azure App Service Plans. These determine how much resources you get for the Web Apps running on them. (See https://learn.microsoft.com/en-us/azure/app-service/azure-web-sites-web-hosting-plans-in-depth-overview):

Your App Service plan can scale form Free and Shared SKUs to Basic, Standard, and Premium SKUs giving you access to more resources and features along the way.
If your App Service plan is set to Basic SKU or higher you can control the size and scale count of the VMs.

They can be scaled up/out easily. I do not know what plan is used now but maybe you can scale down? See https://azure.microsoft.com/en-us/pricing/details/app-service/plans/ for the available tiers. See https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-scale on how to scale up or down.
Scaling down might give a performance degradation but if it is just for experiments and not used for production I would give it a try. But beware: some parts of the IoT Suite might require a minimum tier of the App Service Plan that is used. (I have no experience with the IoT Suite)
You can't pause an App Service Plan, only option is to scale down or delete. See also How do I pause an Azure App Service Plan?.


text:
Q: Need Help in resampling the dataset I have a data set of dow_jones_index. I was asked to perform following activities:

*

*downsample the data filtered in the above step day wise and perform
interpolation to forward fill the first two 'Nan' values.

*return the first 10 samples of downsampled data to variable
'downsample'
I've written following lines of codes:
import pandas as pd
dataFrame = pd.read_csv('dow_jones_index.data',parse_dates=["date"], index_col="date")
dataFrame.head()
closeTS = dataFrame[(dataFrame.stock == 'AA')].close.str.replace('$',' ').astype(float)
down = closeTS.resample('D')
downsample = down.interpolate(method='linear',limit=None,limit_direction='forward').head(10)
from test_ts_resample_day import values
values.save_ans1(downsample)

But it is not satisfying all the test cases. Please help me to improve the code.

A: downsample = closeTS.resample('D', fill_method='ffill', limit=2).head(10)


text:
Q: Natbib citation issue I cannot seem to get natbib to work with author-year style citations.
The following standalone example:
\documentclass{article}

\usepackage[authoryear]{natbib}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}

@misc{A01,
   author = {Test, A. and Foo, B.},
   year = {2001},
   title = {Alpha},
}

@misc{A02,
   author = {Alex, A. and Bar, B.},
   year = {2005},
   title = {Alpha},
}

\end{filecontents}

\begin{document}

\citep{A01}, \citep{A02}, \citet{A02}

\bibliography{\jobname}

\end{document}

Simply returns the error

"! Package natbib Error: Bibliography not compatible with author-year
  itations."

I have looked about at the various answers surrounding this error but can't work out what's wrong in my case.
Thanks for any help :)
EDIT: Have added screenshot of code with the log-file too below:

A: Well, there seem to be two problems:

*

*You missed to add a bibliographystyle like \bibliographystyle{abbrvnat}

*It seems your TeX distribution is a little bit outdated ...

With the following MWE
\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Test, A. and Foo, B.},
  year = {2001},
  title = {Alpha},
}
@misc{A02,
  author = {Alex, A. and Bar, B.},
  year = {2005},
  title = {Alpha},
}
\end{filecontents}

\listfiles %<========= creates list of used packages and version numbers
\documentclass{article}

\usepackage[authoryear]{natbib}

\begin{document}

\citep{A01}, citep: \citep{A02}, citet: \citet{A02}

\bibliographystyle{abbrvnat} % <=======================================
\bibliography{\jobname}

\end{document}

I get without error message the following result:

If you take a look into the .log file (for example 386491.log, if the TeX file is names 386491.tex)
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit) (preloaded format=pdflatex 2017.4.26)  15 AUG 2017 19:37
entering extended mode
**./386491.tex
(386491.tex
LaTeX2e <2017-04-15>
Babel <3.9r> and hyphenation patterns for 76 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\filecontents\filecontents.sty"
Package: filecontents 2011/10/08 v1.3 Create an external file from within a LaTeX document
)

LaTeX Warning: Overwriting file `./386491.bib'.

\openout15 = `386491.bib'.

("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
) ("C:\Program Files\MiKTeX 2.9\tex\latex\natbib\natbib.sty"
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip43
\bibsep=\skip44
LaTeX Info: Redefining \cite on input line 694.
\c@NAT@ctr=\count87
)
(386491.aux)
\openout1 = `386491.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 23.
LaTeX Font Info:    ... okay on input line 23.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 23.
LaTeX Font Info:    ... okay on input line 23.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 23.
LaTeX Font Info:    ... okay on input line 23.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 23.
LaTeX Font Info:    ... okay on input line 23.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 23.
LaTeX Font Info:    ... okay on input line 23.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 23.
LaTeX Font Info:    ... okay on input line 23.
 (386491.bbl) [1

{C:/Users/Internet/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (386491.aux)

 *File List*
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX document
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  natbib.sty    2010/09/13 8.31b (PWD, AO)
  386491.bbl
 ***********

 )
Here is how much of TeX's memory you used:
 564 strings out of 493324
 6475 string characters out of 3138984
 58170 words of memory out of 3000000
 4171 multiletter control sequences out of 15000+200000
 4245 words of font info for 16 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 24i,4n,32p,145b,312s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmbx12.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public
/amsfonts/cm/cmr10.pfb>
Output written on 386491.pdf (1 page, 24658 bytes).
PDF statistics:
 14 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

you can see in the first line that I am using a current MiKTeX 2,9, version 3.14159265-2.6-1.40.18 (MiKTeX 2.9.6400 64-bit) and my system used the following packages (created with command \listfiles):
 *File List*
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX document
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
  natbib.sty    2010/09/13 8.31b (PWD, AO)

Please compare this numbers with yours. From the screenshot you showed us I guess your sytem is a little bit older.  Please update ...


text:
Q: Dependency Injection in Spring failed I want to inject some objects in my web application using spring dependency injection.
In EtudiantServiceImpl class (which has @Service annotation) I have :
@Autowired
private IEtudiantDao etudiantDao;

And in EtudiantAction class (which has @Service annotation) I have :
@Autowired
private EtudiantServiceImpl etudiantService;
@Autowired
public Etudiant etudiant;

But when I run my application I get this error message:
2015-01-02 06:14:38,741 ERROR (org.apache.struts2.dispatcher.Dispatcher:38) - Exception occurred during processing request: Unable to instantiate Action, tp.ihm.gestionEtudiants.web.EtudiantAction,  defined for 'etudiants' in namespace '/'Error creating bean with name 'tp.ihm.gestionEtudiants.web.EtudiantAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private tp.ihm.gestionEtudiants.service.EtudiantServiceImpl tp.ihm.gestionEtudiants.web.EtudiantAction.etudiantService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [tp.ihm.gestionEtudiants.service.EtudiantServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Unable to instantiate Action, tp.ihm.gestionEtudiants.web.EtudiantAction,  defined for 'etudiants' in namespace '/'Error creating bean with name 'tp.ihm.gestionEtudiants.web.EtudiantAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private tp.ihm.gestionEtudiants.service.EtudiantServiceImpl tp.ihm.gestionEtudiants.web.EtudiantAction.etudiantService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [tp.ihm.gestionEtudiants.service.EtudiantServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:316)
    at com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:397)
    at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
    at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
    at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:37)
    at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:552)
    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tp.ihm.gestionEtudiants.web.EtudiantAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private tp.ihm.gestionEtudiants.service.EtudiantServiceImpl tp.ihm.gestionEtudiants.web.EtudiantAction.etudiantService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [tp.ihm.gestionEtudiants.service.EtudiantServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1073)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:373)
    at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:203)
    at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:183)
    at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
    at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:171)
    at com.opensymphony.xwork2.factory.DefaultActionFactory.buildAction(DefaultActionFactory.java:22)
    at com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:141)
    at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:297)
    ... 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private tp.ihm.gestionEtudiants.service.EtudiantServiceImpl tp.ihm.gestionEtudiants.web.EtudiantAction.etudiantService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [tp.ihm.gestionEtudiants.service.EtudiantServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
    ... 36 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [tp.ihm.gestionEtudiants.service.EtudiantServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:924)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:793)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
    ... 38 more

And this is the application context file :
<!-- Configure jdbc.properties -->
    <bean id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
        p:location="/WEB-INF/jdbc.properties" />

    <!-- Data Source configuration -->
    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">

        <property name="driverClassName">
            <value>${jdbc.driverClassName}</value>
        </property>
        <property name="url">
            <value>${jdbc.databaseurl}</value>
        </property>
        <property name="username">
            <value>${jdbc.username}</value>
        </property>
        <property name="password">
            <value>${jdbc.password}</value>
        </property>
   </bean>

    <!-- Configure hibernate session factory -->
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation">
            <value>classpath:hibernate.cfg.xml</value>
        </property>
        <property name="configurationClass">
            <value>org.hibernate.cfg.AnnotationConfiguration</value>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${jdbc.dialect}</prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>
    <!-- Run SQL queries in transactions -->
    <tx:annotation-driven />
    <context:annotation-config></context:annotation-config>
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

</beans>

Edit1:
After I added this line to my spring configuration file :
<context:component-scan base-package="/" />

It solved that problem, but now I'm getting another error message :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genericDaoImpl' defined in file [C:\Users\Aimad\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\TP_WEB_GestionEtudiants\WEB-INF\classes\tp\generic\dao\GenericDaoImpl.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4772)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5196)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: 'sessionFactory' or 'hibernateTemplate' is required
    at org.springframework.orm.hibernate3.support.HibernateDaoSupport.checkDaoConfig(HibernateDaoSupport.java:118)
    at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
    ... 21 more

And this is the GenericDaoImpl class:
@Repository
public class GenericDaoImpl<T, PK extends Serializable> extends HibernateDaoSupport implements GenericDao<T,PK> {

    private Class<T> entityClass;

    public GenericDaoImpl(){
    }

    public GenericDaoImpl(final Class<T> entityClass){
        this.entityClass = entityClass;
    }

    public T getEntity(PK id) {
        return (T) getHibernateTemplate().get(entityClass, id);
    }

    public List<T> getAll(){
        return getHibernateTemplate().loadAll(entityClass);
    }

    public PK save(T entity) {
        return (PK) getHibernateTemplate().save(entity);
    }

    public void delete(PK id) {
        if(getEntity(id) != null)
            getHibernateTemplate().delete(getEntity(id));
    }

    public void update(T entity) {
        getHibernateTemplate().update(entity);

    }

A: You have to mention to auto scan for all the beans.
Please specify below configuration in Spring configuration xml file:
<context:component-scan base-package="com.x.y.z" />

Tutorial
Here is programmatically configuration for auto scan.

A: Not sure but are you using getter and setter for the private fields sometime it throws this kind of error in the situation where you are not having getter and setter.


text:
Q: How can I use git online witout github? I am right now learning to work with git. I am still very confused, because usually I have for example my index.php file on my server. I open it with my ftp client and make a change with my text editor. If I save it, I can just open www.mywebsite.com and I will see my changes online. It is simple and easy.
As far as I learned now, I can only make git Repositories local on my computer. So to make my file be online all tutorials tell me I need to use gitHub or something similar. But I just simply want to use my own server. It seems to be very complicated to connect my local directory now with my directory on my server.
My question is now, is it possible to use git directly on my own server (without a complicatied initialization?) Or do I need to use git hub, if I am not an expert.

A: If you are not an expect, then definitely the easiest way is to use hosted solution. Besides Github, there's also Bitbucket, GitLab and maybe others.
You can install a git server on your server machine, but you, as a novice, do not want to deal with it now.
Using hosted git, you will also learn about proper workflow. That is, no more changing files online. All changes go through git. You push to git server from your development machine and your server pulls those changes from git. Yes, you will spend some time and effort on implementing this, but that's how it must be done.

A: If your server supports git, it is no problem to clone your local repo to your remote server. As Sergio already answered, it is easier to use a hosted solution.


text:
Q: Airflow "Variable is not defined" I am working on an Airflow task that strips values from URL parameters.
I've used the same exact format - !set three variables, use schema, read $row_count at the end, etc.
This is the only task that is throwing an error.
!set stop_on_error=True
!set exit_on_error=True
!set variable_substitution=True

USE schema myDatawarehouse;

/*
CREATE OR REPLACE TABLE web_page_views (
      anonymous_id VARCHAR(80),
      email VARCHAR(765),
      utm_campaign VARCHAR(765)
);
*/

BEGIN;

CREATE OR REPLACE TABLE marketing_digital_traffic AS
   SELECT   anonymous_id
            , email
            , split_part(split_part(url, 'utm_campaign=', 2), '&', 1) utm_campaign
   FROM     segment.pages;

SET row_count = &__rowcount;

INSERT INTO etl.load_table(
    table_name
,   rows_inserted
,   job_message
)
values (
           'web_page_views'
       ,   $row_count
       ,   'etl process finished successfully'
)
;

commit;

When I run this task I get the error Variable  is not defined

A: So the issue is the ampersand ("&") in the select statement.
Airflow/python is interpreting that as the beginning of a new variable.
To avoid this, change '&' to '&&' within the Airflow task like so:
CREATE OR REPLACE TABLE marketing_digital_traffic AS
   SELECT   anonymous_id
            , email
            , split_part(split_part(url, 'utm_campaign=', 2), '&&', 1) utm_campaign
   FROM     segment.pages;

NOTE: You will get this error even if your SQL code is commented out. I learned this the hard way.


text:
Q: I have data at hourly basis and want to convert it into weekly at ssas cube level In my SQL Server database I have data at hourly basis. But I want that data weekly at weekly granularity using SSAS CUBE.

A: Assuming you have a date field could you create a new field in your fact table view or calculated column in dsv? This would be a week key that would join to a date dimension at week level.
The data wouldvthen get aggregated up from the underlying hour data.


text:
Q: Simple audio player that plays multiple audio files at the same time on click I'm creating a website that allows to play many different audios files (mp3) at the same time. All of them are looped and they have different length, so it will sound always a little bit different. That's the goal, but I can't make it happen!
This is the js code that I have at the moment and here you can find an example with different frog calls → http://petitbardo.club/
Please, help! And thanks a lot :-)
    function audioPlayer(){
        var currentSong = 0;
        $("#audioPlayer")[0].src = $("#playlist li a")[0];
        $("#audioPlayer")[0].play();
        $("#playlist li a").click(function(e){
           e.preventDefault();
           $("#audioPlayer")[0].src = this;
           $("#audioPlayer")[0].play();
           $("#playlist li").removeClass("current-song");
            currentSong = $(this).parent().index();
            $(this).parent().addClass("current-song");
        });

        $("#audioPlayer")[0].addEventListener("ended", function(){
           currentSong++;
            if(currentSong == $("#playlist li a").length)
                currentSong = 0;
            $("#playlist li").removeClass("current-song");
            $("#playlist li:eq("+currentSong+")").addClass("current-song");
            $("#audioPlayer")[0].src = $("#playlist li a")[currentSong].href;
            $("#audioPlayer")[0].play();
        });
    }


text:
Q: xdebug remote debugging with port 9000 forwarded through ssh tunnel - how to make it work? I have XAMPP 1.7.3a running on an "Amazon Linux" (Centos-derived) 32-bit instance in the Amazon EC2 cloud.  I downloaded/built/installed XDEBUG 2.1.0.  The relevant items in phpinfo() output look like this:
Directive                         Local Value  Master Value
xdebug.idekey                     ECLIPSE_DBGP ECLIPSE_DBGP
xdebug.default_enable             On           On
xdebug.remote_autostart           On           On
xdebug.remote_connect_back        Off          Off
xdebug.remote_cookie_expire_time  3600         3600
xdebug.remote_enable              On           On
xdebug.remote_handler             dbgp         dbgp
xdebug.remote_host                127.0.0.1    127.0.0.1
xdebug.remote_mode                req          req
xdebug.remote_port                9000         9000
xdebug.remote_log                 /opt/lampp/logs/xdebug_log
                                               /opt/lampp/logs/xdebug_log

I access the Linux box from a Windows laptop running XP SP3, using the SSH client in PuTTY version 0.60. Also on the laptop I've installed Eclipse PDT (Helios Service Release 1 Build id: 20100917-0705), and I think I've got it configured correctly to do XDEBUG remote debugging using port 9000.  I say I think, because I've had difficulty figuring out how to do that, and how to use Eclipse PDT in general.  But I did manage to get it configured and working for "remote" debugging of PHP code run by web pages served using XAMPP for Windows 1.7.3 on localhost (127.0.0.1), using port 9000.  The phpinfo() output for the server on the laptop which PDT is able to debug is the same as above, except for:
xdebug.idekey       my_username     no value
xdebug.remote_host  localhost       localhost
xdebug.remote_log   no value        no value

I'm pretty sure these differences are not related to the problem.  In fact, xdebug.idekey was originally "root novalue" on Linux, which I then changed to ECLIPSE_DBGP by both editing php.ini and setting environment variable DBGP_IDEKEY in the sudo-ed script that starts apache, in vain hope of getting things working.
I've got firewalls and a NAT router between the laptop and the Linux box.  So I am trying to use port forwarding through a PuTTY ssh tunnel to get the Linux XDEBUG talking to the Windows PDT.  I've been using X11 forwarding with PuTTY for a couple of months with no problems at all.  I set up the tunnel in PuTTY with local port 9000 forwarded to port 9000 on the Linux box, and port 9000 on the Linux box forwarded to port 9000 on 127.0.0.1, the PuTTY tunnel panel showing:
L9000  host...amazonaws.com:9000
R9000  127.0.0.1:9000

Looking at the PuTTY Event Log when the tunnel is set up, there appear to be no problems:
2010-11-16 18:07:59 Local port 9000 forwarding to host...amazonaws.com:9000
2010-11-16 18:07:59 Requesting remote port 9000 forward to 127.0.0.1:9000
2010-11-16 18:07:59 Remote port forwarding from 9000 enabled

But then when I go to PDT and click Debug on a configuration that specifies the remote web server, PDT shows background activity in the lower right corner that gets stuck at 57%, and if I click the icon to go to Progress view, that  shows "Launching: waiting for XDebug session".
When this happens, the PuTTY Event Log shows:
2010-11-16 19:05:42 Received remote port 9000 open request from 127.0.0.1:54474
2010-11-16 19:05:42 Attempting to forward remote port to 127.0.0.1:9000
2010-11-16 19:05:42 Forwarded port opened successfully
2010-11-16 19:05:42 Opening forwarded connection to host...amazonaws.com:9000
2010-11-16 19:05:42 Forwarded connection refused by server: Connect failed [Connection refused]
2010-11-16 19:05:42 Forwarded port closed

On the Linux box, /var/log/secure just shows:
Nov 16 19:01:51 ip-10-194-9-67 sshd[14555]: error: connect_to host...amazonaws.com port 9000: failed.

I've checked my /etc/ssh/sshd_config, and I think it's okay, even changing it explicitly to "AllowTcpForwarding yes", even though that is supposed to be the default.  In my web searches for a solution, I did come across one linuxquestions posting where the final reply says something rather cryptic about sshd needing to resolve a hostname:

this seemed to fix it:
  The hostname has always been domain-serv, since I always
  thought of my router as being domain.com...so after running
  hostname domain.com...bam! It finally works...
I guess sometimes it is too simple. sshd had to be resolving domain.com
  to my router, ergo the connection failed.

I sounds like this might be related to my problem, but it makes no sense to me, and since it's pretty old, and the author didn't seem to understand it, either, I thought I would ask here rather than there...
I did notice that a similar question was asked in this forum almost a year ago that got just one 0-value response, presumably because the question was so lacking in detail as to be unanswerable.  I hope this one has enough information, and isn't so long, so that somebody can steer me right.  After reading the faqs and how to ask a question, it wasn't entirely obvious to me whether the correct use of the forum was to post something under that original poorly-asked but content-identical question, or to post this new one - I'm sure someone will let me know what was the right choice on that :-)
I've been going nuts with this thing, and I suspect it's something pretty obvious to someone with experience.  I'm a noob to most of this stuff (PHP, web programming, network admin, and this forum), though not to old-fashioned C programming and user-level Linux and Windows setup.

A: How embarrassing, apparently my port forwarding setup was something only a network noob would do?  I guess I had decided that since the Xdebug running on the web server needs to talk to the PDT debugger client on the laptop, and the PDT debugger client on the laptop also needs to talk to Xdebug on the server, and there's only one port number (9000), that therefore I needed to forward local port 9000 to remote port 9000, and also forward remote port 9000 to local port 9000; I was confusing the direction of traffic with which side is the client initiating a (bi-directional) connection to a specific port that the server side is listening to.
What seemed to be happening was that the PDT debugger running on the laptop got stuck waiting for Xdebug running on Linux to make a connection.  Since I couldn't really think of a situation where Xdebug would need to be listening to port 9000, waiting for the PDT debugger to initiate a connection (rather it would be waiting for the PDT debugger to send it a command over a connection that had already been established by its opening port 9000 when it saw the XDEBUG_SESSION parameter in the request), I decided just to get rid of the forwarding of local port 9000 to remote port 9000.  I did that, and all of a sudden PDT was receiving the connection sent from the Linux server, and debugging proceeded normally from there.
But what's still not clear in my mind is why having the additional forwarding actually caused a problem.  Couldn't it be possible for a pair of programs on different hosts to operate such that, depending on state, sometimes one was the listener and sometimes the other was?  As long as the forwarding doesn't cause them both try to listen on the same port at the same time, I'd expect that to be okay.
Bottom line is that things seem to be working now because of a simplification I made, but I'd like to understand why the unneeded complexity actually caused a problem.  I've read a lot of stuff, including the excellent explanation of ssh and tunneling in the O'Reilly book, but I still don't get it.


text:
Q: Wep API to take multiple parameters I am new to web api. I created a sample web api and it works fine to return all data from a table and by Id. Right now I am trying to create a function to take multiple parameters but I get errors with "HTTP Error 404.0 - Not Found". Below is my code and I have no clue where the problem is:
enter code here
// GET: api/Biosample
// http://localhost:53205/api/Biosample/example1/catalognbr/campusstr/
        [Route("example1/{catalognbr}/{campusstr}")]
        [HttpGet]
        public IQueryable<Biosample> GetBiosample(float catalognbr, string campusstr)
        {

                var Biosample= (from a in db.Biosample
                                  where a.CATALOG_NBR  == catalognbr &&
                                        a.CAMPUS_NAME.Contains(campusstr)

                                       select a
                                  );

            return Biosample;
            }


text:
Q: Data Dependency Graph in a Frama-C plugin Is it possible to access or create the data dependency graph inside a frama-c plugin?
I want to create a frama-c plugin that will instrument the input C code based on the data dependency of its variables.
I have looked into the pdg plugin. It does produce the graph, though, it is not clear to me if and how I can access the dependency from inside my plugin.


text:
Q: What Is meta_id In wp_postmeta? I am trying to add some data in WordPress Custom Field and via adding more direct records/data in wp_postmeta table via SQL query. There are four column as mentioned below...

*

*'meta_id' - A unique id for each entry.

*'post_id' - The ID of the post for this metadata.

*'meta_key' - The name of the 'key'.

*'meta_value' - The value associated with the key.

Now I am using the below SQL query to add some more records/data.
$INSERTING_DATA = "INSERT INTO `wp_postmeta` (`meta_id`, `post_id`, `meta_key`, `meta_value`) values ('XXXXXXXXX', 'WordPress_Post_ID_No', 'WordPress_Post_Custom_Field_Name', 'WordPress_Post_Custom_Field_Value')";

So here I am able to add all my data but I want to know that what to add in meta_id column ? Is that auto increment value so I have to leave that value and should I use below SQL query...???
$INSERTING_DATA = "INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) values ('WordPress_Post_ID_No', 'WordPress_Post_Custom_Field_Name', 'WordPress_Post_Custom_Field_Value')";

So Now tell me which one is correct and Ok to use. First or second...??? Also describe me that what is meta_id in this table?

A: You should not be using direct SQL. Consider creating a PHP script that loads WordPress core functions and uses them (see https://stackoverflow.com/questions/9101503/include-wordpress-core-into-own-scripts#answer-9126230 for getting an idea how to do that).

*

*add_post_meta

*update_post_meta
But if you do want to create custom SQL (if you are asking the question you are asking I highly do not recommend it), you should probably get more information on postmeta table before doing so. Let me cover the topic for you.
First of all, let's get some overview of the table:
mysql> describe wp40.wp_postmeta;
+------------+---------------------+------+-----+---------+----------------+
| Field      | Type                | Null | Key | Default | Extra          |
+------------+---------------------+------+-----+---------+----------------+
| meta_id    | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| post_id    | bigint(20) unsigned | NO   | MUL | 0       |                |
| meta_key   | varchar(255)        | YES  | MUL | NULL    |                |
| meta_value | longtext            | YES  |     | NULL    |                |
+------------+---------------------+------+-----+---------+----------------+
4 rows in set (0,08 sec)

From that you can see that meta_id is auto_increment and thus MySQL will figure out itself what value it should add. Passing simple 0 instead of real meta_id is enough.
post_id refers back to the post to which the meta is associated. Default is 0 but you should pass a real post_id so you can see the meta in the custom fields editor on the post editing screen.
meta_key is the name of a meta. Pay attention, using a name starting with underscore eg.: _hidden_meta will hide the meta from custom field editor on edit screen.
meta_value is a longtext and can hold any text you need. But pass it strings only! (in case of an array of other objects, you can serialize the text).
But once again, consider using add_post_meta or update_post_meta functions.

A: meta_id in postmeta table is just an AUTO_INCREMENT id for the table, you can easily inspect that:

So, your guess is correct, you can leave it.
EDIT
Avoid raw SQL statements and introduce $wpdb for SQL purposes. And for postmeta insertion you can see the following tutorial I found a best one:

*

*Reusable Custom Meta Boxes - Code.TutsPlus.com


text:
Q: add java applet to php I'm trying to add java applet to my php code really I'm trying but still have the same error that the applet and the .jar not found can any one give me hello world example for that issue.

A: Rather that using applet tag look into using object tag instead. Applet is deprecated and isn't supported by all browsers.
And yeah, you don't need any PHP. It's HTML tags.

A: See Embedding an Applet in an HTML Page. PHP is not involved.


text:
Q: Print exact copy of the element Trying to achieve the goal of printing selected page's element ONE-TO-ONE - the exact same way it looks on the page.
What did I try:

*

*printElement() plugin.

*moving element to a new window:
var printwindow = window.open();
$(printwindow.document.body).html($('.contentwrap').html());
In both cases I needed to create separate styles (media='print') and/or new classes. At the same time - forms values were not copied to a new window.
My content is way too dynamic, populating data from ajax and data attributes on fly. Design of content is also based on JS.
Applying special styles and re-doing JS code - is NOT the way I want it to be. =)
I'm looking for a solution what makes EXACT copy of the element, ready to be printer and not be dependent on the browser print settings, styles/scripts adjustments.
It better be some kind of a screenshot =), letting client to download it as jpeg/pdf.
Any ideas?
Please help. Thanks.

A: if you use: $('selector').clone(true) it will clone your selector and event handlers too.  By default clone is set to false and does not clone the event handlers


text:
Q: How to install requirements.txt file from a python module? I am looking for an alternative to
pip install -r requirements.txt

which can be used to install packages from a python module. I  have used
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

for installing a package, however, this command seems to work only for a single package. Thanks in advance. Any help is appreciated.

A: Don't forget to replace "package" with "-r requirements.txt":
subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])


text:
Q: Docstrings in google colab What can be the reason behind the absence of Docstrings while writing any function in google colaboratory.
We all know how useful Docstring is while coding and this is the reason I need it many times a day
I tried using the following things:

*

*shift-tab

*keeping mouse within parenthesis

*using space and then backspace within the parenthesis.
4.ctrl-shift-space

[This is a sample just to show that the mouse is in between parenthesis and there is no Docstring. I have tried for many more functions]
also viewed (Quick Docstrings in Colaboratory),
but none of the methods mentioned worked in my case. Is there any other possibilities or change in some setting required?

A: Hit tab after opening a bracket
List.apppend(
Then hit a tab
or
you can type List.append?
Even try ctrl + space( I personally  used it)


text:
Q: SharePoint Web Page AutoSize What is a code I could put in the Edit Source to set the width and height of the SharePoint site?
<style type="text/css">

body {

width: 100%;

height: 100%;

}

</style>

The above script is not working.

A: The following style for your reference.
<style type="text/css">
body{
    width: 100% !important;
    height: 100% !important;
}
#s4-workspace{
    width: 100% !important;
    height: auto !important;
}
</style>

In SharePoint site, I suggest you create a Responsive Master Page to achieve your requirement.
Refer to the solution here: SharePoint Branding - Responsive Master Page


text:
Q: Multi column listview UWP I need to do this layout in my windows app (min 2 columns)

I've tried sync scroll in two ListView but it very laging.
The most important, I need high performance with virtualization.
Any idea?

A: With the lastest release the UWP Community Toolkit provides such a control.
It's called StaggeredPanel.
An example can be found here.
Here is an example screenshot taken from the the UWP Community Toolkit:

A: Not exactly sure about your requirement. But you may look into this solution Synchronized scrolling of two ScrollViewers whenever any one is scrolled in wpf


text:
Q: Erro ao executar login() 'AnonymousUser' object has no attribute '_meta' Estou tentando logar em uma conta do django para poder redirecionar para a pagina principal do meu projeto, mas o comando login me retorna o seguinte erro.
AttributeError at /login/
'AnonymousUser' object has no attribute '_meta'

Estou usando OneToOneField para usar cnpj/senha de uma table no meu banco de dados.
Estou testando tanto com o login e senha do django quanto os da tabela e ambos devolvem o mesmo erro.
views.py
def login_log(request):
    form = PessoaForm(request.POST, None)
    if request.method == 'POST':
        cnpj = form.data['cnpj']
        senha = form.data['senha']
        print(form.is_valid())
        if form.is_valid():
            user = authenticate(request, cnpj=cnpj, senha=senha)
            user2 = authenticate(request, username=cnpj, password=senha)
            print(user)
            print(user2)
            print(login(request, user))
            #return redirect('dashboard', idpessoa)
    return render(request, 'login.html', {'form': form})

idpessoa é usado pra mandar junto da url e acessar o usuário que esta logando. No meu código ele tem a utilidade corretamente e está funcionando. (Apenas para desencargo de consciência que ele não é o erro)
Sei que o erro está nesta linha
print(login(request, user))

e o print está ali apenas para testes

Caso necessario meu forms.py
class PessoaForm(ModelForm):
    class Meta:
        model = User
        fields = ['cnpj', 'senha']

A: Olá
Tente retirar a request , isso pode ser o possivel erro.
user = authenticate(cnpj=cnpj, senha=senha)

E para redirecionar para umna outra pagina em caso de sucesso
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import redirect

return HttpResponseRedirect(reverse('index'))

Vou dar um Exemplo que uso no meu sistema muito bom no forms.py:
from django.contrib.auth import authenticate, login,logout
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate
from django.contrib import messages
from django.shortcuts import redirect

def user_login(request):
    if request.method == 'POST':
        # Pegque o dados necessarios do HTML
        email = request.POST.get('email')
        password = request.POST.get('password')

        # Use a autenficação do Django
        user = authenticate(email=email, password=password)

        # Se tem usuario
        if user:
            #Checa se usuario esta ativo, é necessario para o futuro, caso voce destive o usuario ele não ira mais logar
            if user.is_active:
                # Logando.
                login(request,user)
                # SE LOGAR,Redireciona o usuario para uma pagina , nesse caso a Index .
                return HttpResponseRedirect(reverse('index'))
            else:
                # Envia para uma pagina dizendo:
                return HttpResponse("Sua conta não esta ativa.")
        else:
                #testes
                # print("Erro no login")
                # print("email usado: {} e senha {}".format(email,password))
                #essa parte é legal , mostra para o usuario uma resposta
                messages.error(request, 'Erro no email ou senha')
#volta para pagina do login para uma nova tentativa
            return redirect('login')

        else:
            #Inicianiliza a pagina.
            return render(request, '...login.html', {})

Use no login.html para aparecer o messages.error (eu uso bootstrap):
{% if messages %}

                      {% for message in messages %}

{{ message }}

                      {% endfor %}

             {% endif %}

Abraço,
E que a força esteja com você.


text:
Q: Navigation to child routes gives error "cannot match any routes" In my routes,Created child components and I can see the default child route in the router outlet.But when navigate to the other child routes ,shows error  "cannot match any routes".
routing.ts
const appRoutes: Routes = [
{
  path: '',
  component: HomeComponent
},
{
    path: 'dashboard',
    pathMatch: 'full',
    component: DashboardComponent,
    canActivate: [AuthGuard],
    children: [
      {
        path: '',
        pathMatch: 'full',
        component: DashboardhomeComponent
      } ,
       {
        path: 'profile',
         pathMatch: 'full',
        component: ProfileComponent
      }
    ]
  },
  {
    path: 'login',
    component: LoginComponent
  },

];

dashboard.ts
goto() {
  this.router.navigate(['dashboard/profile']);
}

A: Try
this.router.navigate(['/dashboard/profile']);

and change your route as,
const appRoutes: Routes = [
  {
    path: '',
    component: HomeComponent
  },
  {
    path: 'dashboardhome',
    component: DashboardhomeComponent,
    canActivate: [AuthGuard],
    children: [
      { path: 'profile', component: ProfileComponent }

    ]
  },
  {
    path: 'login',
    component: LoginComponent
  },

];


text:
Q: How to access rails request object in rspec integration test? In Rails 3.2.13, subdomain is provided by default. As such, I want to test my application such that when a merchant signs up, he goes by default to root_url with subdomain 'merchant' i.e. https://merchant.lvh.me:3000. However, I am having trouble testing the same in RSpec. My test looks like this:
  describe "Sign in" do
    before { visit signup_path }
    let(:submit) { "Sign up" }

    describe "with invalid information" do
        it "should not create a user" do
            expect { click_button submit }.not_to change(User, :count)
        end
    end

    describe "with valid information" do
        before do
            fill_in "Email", with: "user@gmail.com"
            fill_in "Password", with: "securepassword"
        end

        describe "as a merchant" do
            before { choose("Merchant") }

            it "should create a merchant user" do
                expect { click_button submit }.to change(User, :count).by(1)
            end

            describe "after creating the merchant user" do
                before do
            click_button submit
            request = ActionController::TestRequest.new(:host => "lvh.me:3000")
         end
                let(:merchant) { User.find_by_email('user@gmail.com') }

                expect (request.subdomain).to eq('merchant')
                it { should have_selector 'div.alert.alert-success', text: "Welcome to App!" }
                it { should have_link "Sign out", href: signout_path }
                it { should_not have_link "Sign in", href: signin_path }
                it { should have_content merchant.email }
          it { should have_selector "title", text: full_title(merchant.email) }
            end
        end

        describe "as a user" do
            before do
          choose("User")
          request = ActionController::TestRequest.new(:host => "lvh.me:3000")
        end

            it "should create a normal user" do
                expect { click_button submit }.to change(User, :count).by(1)
            end

            describe "after creating the normal user" do
                before { click_button submit }
                let(:user) { User.find_by_email('user@gmail.com') }

                expect (request.subdomain).to eq('user')
                it { should have_selector 'div.alert.alert-success', text: "Welcome to App!" }
                it { should have_link "Sign out", href: signout_path }
                it { should_not have_link "Sign in", href: signin_path }
          it { should have_content user.email }
          it { should have_selector "title", text: full_title(user.email) }
            end
        end
    end
  end

Error is:
19:58:54 - INFO - Guard::RSpec is running, with RSpec 2!
19:58:54 - INFO - Running all specs
Running tests with args ["--drb", "-f", "progress", "-r", "/usr/local/lib/ruby/gems/1.9.1/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "-f", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--failure-exit-code", "2", "spec"]...
Exception encountered: #<NameError: undefined local variable or method `request' for #<Class:0x007fe0d8058848>>
backtrace:
/home/app/spec/requests/user_pages_spec.rb:46:in `block (5 levels) in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `module_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `subclass'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:224:in `describe'
/home/app/spec/requests/user_pages_spec.rb:39:in `block (4 levels) in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `module_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `subclass'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:224:in `describe'
/home/app/spec/requests/user_pages_spec.rb:32:in `block (3 levels) in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `module_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `subclass'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:224:in `describe'
/home/app/spec/requests/user_pages_spec.rb:26:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `module_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `subclass'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:224:in `describe'
/home/app/spec/requests/user_pages_spec.rb:16:in `block in <top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `module_eval'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:238:in `subclass'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:224:in `describe'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/dsl.rb:18:in `describe'
/home/app/spec/requests/user_pages_spec.rb:3:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/test_framework/rspec.rb:11:in `run_tests'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:13:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
Done.

I tried to print request object to see if anything is there, but its blank. How to access request object in RSpec integration test or is integration test the right place to test for this kind of behavior? Please suggest.
Edit: More Information My data model consists of only single user table where all by default are normal users. However, some are merchants also. Now, when someone signs-in as a user (distinguished using radio button in sign-in form), he should be redirected to user.lvh.me and if he signs-in as a merchant, he should be redirected to merchant.lvh.me. This is what I am trying to test in my integration tests.

A: You can mock a request using
ActionController::TestRequest.new()

for example
request = ActionController::TestRequest.new(:host => test_domain)

A: I'm not really clear what behaviour you are trying to test here.
It seems that you have a sign up form where merchants can sign up. Once they have signed up they should get their own subdomain ( merchant1.lvh.me, merchant2.lvh.me). Is that right?
If that is right, then it looks like you are trying to test that the sub-domain for the sign up request should be set. I don't think thats how it works - the client is in control of the domain that the request is made to not the server. I suspect what you want to do is perform a redirect after successful signup to the appropriate subdomian. Thus you want to test that the response is redirecting to the subdomain.


text:
Q: Error while getting values from DB I want to get values from SQL Server by Groovy.
Sql.withInstance("jdbc:jtds:sqlserver://localhost;instance=SQLEXPRESS;",
           'login',
           'password',
           'net.sourceforge.jtds.jdbcx.JtdsDataSource') {
    it.execute("use Base")
    it.rows("select * from table") {
        List val = it.values()
    }
...
}

Method rows() should return List<GroovyRowResult>, but I have:

groovy.lang.MissingMethodException: No signature of method:  net.sourceforge.jtds.jdbc.JtdsResultSetMetaData.get() is applicable for argument types: () values: []

What am I doing wrong and how can I get values from database?

A: Because when you use  List val = it.values() , the "it" is mean JtdsResultSetMetaData . that is not your expect ResultSet and JtdsResultSetMetaData do not have values() method so will get exception. you can use this code try get your ResultSet
    Sql.withInstance("jdbc:jtds:sqlserver://localhost;instance=SQLEXPRESS;",
           'login',
           'password',
           'net.sourceforge.jtds.jdbcx.JtdsDataSource') {
    it.execute("use Base")
    List val = it.rows("SELECT * FROM table")
    print val
...
}