text:
Q: Source.queue with cachedHostConnectionPool in Java I am trying to use source.queue with cachedHostConnectionPool in java but not able to get the correct output. Below is my attempt at it. I am always getting success response, which i understand why but not sure what is the right way to do it.
Reason why i am getting success response is because i have defined Try as HttpResponse.create() , which is always giving me success response but my doubt is why it is not getting overwritten when i am doing queue.offer(Pair.create(httprequest,promise)).
Can someone please help me to understand what am i doing wrong here.
// Method to return queue
  public SourceQueueWithComplete<Object> httpGetRequestWithPool
          (Materializer materializer)
{
    final Http http = Http.get(system);
     final Flow<Pair<HttpRequest, Object>, Pair<Try<HttpResponse>, Object>, HostConnectionPool> flow;
      flow = http.cachedHostConnectionPool(ConnectHttp.toHost("host:port"));
    final SourceQueueWithComplete<Object> queue= Source.queue(3,OverflowStrategy.dropNew())
                 .map(d -> Pair.create(HttpRequest.create("contextpath"),d))
                 .via(flow)
                 .toMat(Sink.foreach(p -> p.first()), Keep.left())
                 .run(materializer);
    return queue;
  }

// Here i am trying to use.

  SourceQueueWithComplete<Object> queue = util.httpGetRequestWithPool(materializer);
        Source<Object, NotUsed> source = Source.from(ListOfObject);
        source.mapAsyncUnordered(3,x-> {
            String url = util.getServiceUrl("servicename").append(x.getId).toString();
            HttpRequest httpRequest = HttpRequest.create(url);
            Try<HttpResponse> promise = Try.apply(()->HttpResponse.create());
            queue.offer(Pair.create(httpRequest,promise))
                    .thenCompose(result -> {
                        if(result instanceof QueueOfferResult.Enqueued$){
                         return CompletableFuture.completedFuture(promise)
                                    .thenApply(res ->{
                                       if(res.get().status().intValue()==200){
                                           System.out.println("success");
                                       }
                                       return res;
                                    });
                        }
                        else{
                            return CompletableFuture.completedFuture(HttpResponse.create().withStatus(StatusCodes.SERVICE_UNAVAILABLE));

                        }
                    });
            return null;
        }).run(materializer);
```


text:
Q: Conditionally styling an array value from an API I am grabbing data from an API that is very easy to utilize, the values for percent change can either be positive or negative. I am trying to add a class to the item so if the value is negative I can display a class and vice versa.
Here is what I've tried so far with no luck:

  -- Grabs first 5 items in API

 0 }" v-html="info.percent_change">

The code properly displays the percent_change value but does not apply any class to it regardless if it is negative or positive.
Sample output showing no class names:

0.8%

-6.57%

A: You should clear % sign using replace('%','') as follows :

 0 }" v-html="info.percent_change">

and the method looks like :
methods:{
    getNumValue(percent){
       return percent!=undefined?percent.replace('%',''):0;
    }
   ...
 }

A: Better parse the value first because it's comparing string against 0 (zero).
Something like { positive: parseFloat(info.percent_change) > 0 }

A: You can parse the string value and convert it to float value which can be compared with 0.
html

ts
public isPositive(v:string){
   return parseFloat(v) > 0; //parseFloat will ignore the %
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Magento 2: Get Product URL in Shipment Email I was trying to link the product name in the shipment mail to the product on our page, so the customer can click on the product name in the shipment mail.
I have tried with

$_item->getProduct()->getProductUrl()

but getProduct() returns null.
The same code worked for the order confirmation mail.
Does anybody know how I can get the product URL?
Thanks

A: Try this code :-
<?php
    $_item = $block->getItem();
    $product_key = $_item->getProduct()->getUrlKey();
    echo $product_key;
?>

More information :-
How to get "product url" for multi website in sales email template
Thanks...


text:
Q: Podman fails to add container to a pod [firewalld, nftables] Can't start a podman container nor can I add container to a pod on CentOS8.
I've tried the usual actions, e.g.:
Made sure I am starting with clean state:

*

*sudo podman system reset which has deleted all images, containers, etc.

*sudo podman run -dt --rm nginx -- the image gets pulled successfully, but podman throws then the following error:

 Error while adding pod to CNI network "podman": failed to add the address 10.88.0.122/32 to trusted zone: COMMAND_FAILED: 'python-nftables' failed:
JSON blob:
{"nftables": [{"metainfo": {"json_schema_version": 1}}, {"insert": {"rule": {"family": "inet", "table": "firewalld", "chain": "raw_PREROUTING_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "saddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "raw_PRE_trusted"}}]}}}, {"insert": {"rule": {"family": "inet", "table": "firewalld", "chain": "mangle_PREROUTING_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "saddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "mangle_PRE_trusted"}}]}}}, {"insert": {"rule": {"family": "ip", "table": "firewalld", "chain": "nat_PREROUTING_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "saddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "nat_PRE_trusted"}}]}}}, {"insert": {"rule": {"family": "ip", "table": "firewalld", "chain": "nat_POSTROUTING_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "daddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "nat_POST_trusted"}}]}}}, {"insert": {"rule": {"family": "inet", "table": "firewalld", "chain": "filter_INPUT_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "saddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "filter_IN_trusted"}}]}}}, {"insert": {"rule": {"family": "inet", "table": "firewalld", "chain": "filter_FORWARD_IN_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "saddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "filter_FWDI_trusted"}}]}}}, {"insert": {"rule": {"family": "inet", "table": "firewalld", "chain": "filter_FORWARD_OUT_ZONES_SOURCE", "expr": [{"match": {"left": {"payload": {"protocol": "ip", "field": "daddr"}}, "op": "==", "right": {"prefix": {"addr": "10.88.0.122", "len": 32}}}}, {"goto": {"target": "filter_FWDO_trusted"}}]}}}]}

What prevents podman from adding pod to podman network?

A: Are you using nftables network plugin?
Read here:
https://github.com/greenpau/cni-plugins


text:
Q: How to sort array based dictionary in Python I have data that has been arranged in the following format
products{} = {'001':['001','Espreso',2.50],
              '002':['002', 'Latte',1.50],
              '003':['003', 'Orange Juice',1.00],
              '004':['003', 'Apple Juice',1.00],
              }

I would like to sort the dictionary based on price so that I can get the following output.
products{} = {'003':['003', 'Orange Juice',1.00],
              '004':['003', 'Apple Juice',1.00],
              '002':['002', 'Latte',1.50],
              '001':['001','Espreso',2.50],
              }

Being a newbie to python, I cant seem to find a proper guidance to sort this.
I have an array as value.
Please guide how to achiece this?
Is this even a correct way of assigning array as value to a key.?
Is this known as ordered dictionary?

A: To sort dictionary you can pass it's items into a sorted() and initialize new dictionary from sorted key-value pairs.
To sort items of your dictionary by last element of value, we should pass to key argument of sorted() a lambda which will return receive key-value pair and return last element (-1 index) of value (1 index).
Code:
products = {
    '001':['001','Espreso',2.50],
    '002':['002', 'Latte',1.50],
    '003':['003', 'Orange Juice',1.00],
    '004':['003', 'Apple Juice',1.00]
}
sorted_products = dict(sorted(products.items(), key=lambda x: x[1][-1]))


text:
Q: Is there a limit to how big a Photos library can be? I have a 250gb Photos library on an external harddrive. Recently Photos has begun to crash after about 15-30 seconds of use. Every time.
I haven't been able to find any info on why. This thread suggests that it is choking on movies, and I have a lot of movies. https://discussions.apple.com/thread/6985998
Is there an upper limit to how big a Photos library can be?


text:
Q: How Do I Align Text Vertically in a Round Button? I'm trying to create resizing buttons using CSS. Here's what I have so far (onclick handlers will come later).
It's almost correct, except the text in the last button (just a hyphen), isn't centered vertically. The first two buttons are vertically centered as intended, but not the last button.
Can anyone see what I'm doing wrong? I'm guessing it might something inherent in the way the dash character is designed in this font. It that's the case, can anyone suggest a better Unicode dash character that would properly align vertically?

body {
  background-color: Aqua;
}

.button {
  height: 25px;
  width: 25px;
  background-color: white;
  border-radius: 50%;
  border: 2px solid black;
  display: block;
  font-size: 200%;
}

.button div {
  vertical-align: middle;
  font-weight: 800;
}

.button:not(:last-child) {
  margin-bottom: .4cm;
}

Resizer Buttons

+

×

–

A: Try
−
 for the last button. Also, when I tried your code in my computer the text in the buttons didn't center vertically and I changed the display property of button class to flex. You might want to consider doing that as well.

A: A note first: In the snippet you posted, also the first two button's contents are not properly center-aligned vertically.
BUT: If you add display: flex; flex-direction: column; justify-content: center; to the CSS rule for .button, the alignment works as intended.
This changes the display property from block to flex, in this case "vertical flex" (i.e. flex-direction: column)  and (vertically) centers the contents using justify-contents: center

body {
  background-color: Aqua;
}

.button {
  height: 25px;
  width: 25px;
  background-color: white;
  border-radius: 50%;
  border: 2px solid black;
  font-size: 200%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.button div {
  font-weight: 800;
}

.button:not(:last-child) {
  margin-bottom: .4cm;
}

Resizer Buttons

+

×

–

A: You could use display:flex for the button instead of block. Then you can use align-items:center and justify-contentcenter` like this:
    .button {
      height: 25px;
      width: 25px;
      background-color: white;
      border-radius: 50%;
      border: 2px solid black;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 200%;
    }

You will need to work with the minus symbol for your last button because it doesn't play well with the alignment. Sunay's suggestion sounds like a good alternative.


text:
Q: Test many associations from a single model in Ruby on Rails using RSpec I have a User model and a Project model.
Users can create many projects, while a project has one owner and can have many members.
#app/models/user.rb
class User < ApplicationRecord
    has_secure_password
    has_many :projects
    has_and_belongs_to_many :projects
end

#app/models/project.rb
class Project < ApplicationRecord
    belongs_to :user
    has_and_belongs_to_many :users
end

And this will create a database tables something like this:
create_table "projects", force: :cascade do |t|
    t.string "name"
    t.integer "user_id" #id of the owner of the projects
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["user_id"], name: "index_projects_on_user_id"
  end

  create_table "projects_users", force: :cascade do |t|
    t.integer "user_id" #id of the member of the project
    t.integer "project_id" #project that the member joined
    t.index ["project_id"], name: "index_projects_users_on_project_id"
    t.index ["user_id"], name: "index_projects_users_on_user_id"
  end

  create_table "users", force: :cascade do |t|
    t.string "first_name"
    t.string "last_name"
    t.string "email"
    t.string "password_digest"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

Where the projects_users table is the junction/bridge table created for has_and_belongs_to_many association.
But whenever I run a test using rspec and shoulda only one of them succeeds the other one fails since in the user.rb file :projects are defined twice.
#spec/models/user_spec.rb
require 'rails_helper'
RSpec.describe User, :type => :model do
      context 'associations' do
        it { should have_many(:projects) } #error
        it { should have_and_belong_to_many(:projects) } #success
      end
    end

The error is Failure/Error: it { should have_many(:projects) }
       Expected User to have a has_many association called projects (actual association type was has_and_belongs_to_many)
#spec/models/project_spec.rb
require 'rails_helper'

RSpec.describe Project, :type => :model do
  context 'associations' do
    it { should belong_to(:user) } #success
    it { should have_and_belong_to_many(:users) } #success
  end
end

How can I test many associations in one model correctly?

A: As per the description shared , I was able to test has_many using the below mentioned snippet:
RSpec.describe User, :type => :model do
  context 'associations' do
   it "should have many projects" do
     subject { described_class.new }
     assc = described_class.reflect_on_association(:projects)
     expect(assc.macro).to eq :has_many
   end
 end
end

A: Well the answer for the part of has_man_belongs_to_many just change for something like this:
RSpec.describe Project, :type => :model do
  context 'associations' do
    it 'should have many and belongs to many Projects' do
     subject {described_class.new }
     response = described_class.reflect_on_association(:projects)
     expect(assc.macro).to eq :has_and_belongs_to_many
    end
  end
end


text:
Q: Angular provider not using mock class in Test bench I am trying to write unit tests for one of my Angular components that gets data from a web service call. Everything runs fine but the Angular test bench is always using the real service call instead of the provided mock service class. I am using Angular 6 & Jasmine 3.
Here is the spec file, as you can see I am providing a mock service that returns an observable with my predefined data.
describe('MyComponent Service Integration', () => {
  let component: MyComponent;
  let fixture: ComponentFixture<MyComponent>;

class MockService{
  getData(){
    return of(data); //data imported from json file
  }
}

beforeEach(() => {
  TestBed.configureTestingModule({
    declarations: [ MyComponent],
    imports:[HttpClientTestingModule],
    providers:[{provide : MyService, useClass: MockService}],
  })
  .compileComponents();
});

beforeEach(() => {
  fixture = TestBed.createComponent(BalanceComponent);
  component = fixture.componentInstance;
  fixture.detectChanges();
});

it('should create a my component with data from the service', () => {
  ngOnInit();
  expect(component.data).toBe(data);
}

Is there something I am missing here? When the test bench creates MyComponent it should inject my MockService into the component not MyService correct? I just can't figure this one out, any help would be great.
Here is my dead simple component that is under test.
export class MyComponent implements OnInit {

  data : any;

  constructor(private myService: MyService) { }

   ngOnInit() {
     this.myService.getData().subscribe(
     response =>{
       this.data = response;
     },
     error =>{
       console.log("ERROR");
     });
   }
}

A: I'd bet that compileComponents() is not complete when the second beforeEach() method runs because its running from a sychronous beforeEach() method with a synchronous lambda - Jasmin should helpfully handle that for you if you just make the lambda async.
From the docs:
beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ BannerComponent ]
    })
    .compileComponents();
  }));

See https://angular.io/guide/testing#compilecomponents-is-async


text:
Q: custom object with null type error in Android Studio I'm trying to get an image of my API but not understanding, it is returning a null as an error, I can't fix it, can someone help me?
Log:
  private final com.example.pokedex.model.PokemonImage images = null;
                                                     ^
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
   > java.lang.reflect.InvocationTargetException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more
log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s

class PokemonIem:
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.example.pokedex.Converters
import com.google.gson.annotations.SerializedName
import java.io.Serializable

@Entity(tableName = "PokemonItem")
@TypeConverters(Converters::class)
data class PokemonItem(
    @PrimaryKey(autoGenerate = false)
    var id: String = "",
    @SerializedName("name") val nome: String = "",
    val images: PokemonImage,
    val types: List<String>,
    val abilities: List<PokemonAbility>,
    val hp: String = ""

) : Serializable

data class PokemonImage
data class PokemonImage(
@SerializedName("small") val smallImageUrl: String
)

I tried to create a converter but it didn't work for my PokemonImage

A: class PokemonItem.java which is called by clicking on the error
private final com.example.pokedex.model.PokemonImage images = null;
@org.jetbrains.annotations.NotNull()


text:
Q: Antipodal map on $ S^n $ homotopic to identity map if $n$ is odd I want to prove that the antipodal map from $S^n$ to $S^n$ is homotopic to the identity map if $n$ is odd. (I know it's actually true if and only if)
If I consider the map $ H(x,t) = (1-2t)x $, why doesn't this work? I don't really see how this  is any different if $n$ is odd or even. Is it continuous? Again, I don't see why it isn't
Thanks

A: This follows easily from some algebraic topology, but you can:
1) prove that $GL(n,\mathbb{C})$ is path-connected (by hands)
2) $U(n)$ is path-connected, because they are homotopy-equivalent (equivalence being the Gram-Schmidt orthogonalisation.)
Every element of $U(2n)$ restricts to a map of $S^{2n-1}$. But both identity and antipodal maps lie in $U(n)$, so they are connected by a path. This will be your required homotopy.

A: Your $H(x,t) = (1-2t)x$ fails to land within $S^n$ if $t$ is strictly between $0$ and $1$.
Hint: $-I\in SO(k)$ iff $k$ is even.

A: Here is why your approach does not work:
If $t$ is not $0$ or $1$, then $(1-2t)$ will have modulus less than $1$. Hence $(1-2t)x$ does not belong to the sphere anymore. But if $H$ was a homotopy of maps to the sphere, it would take values on the sphere.

A: As Henning or Rasmus have explained to you, $H(x,t) = (1-2t)x$ fails to land within $S^n$ for $t\neq 0,1$. The usual trick to arrange that, namely redefine
$$
H(x,t) = \dfrac{(1-2t)x}{\| (1-2t)x \|}  \ ,
$$
doesn't work either because this new $H$ is not continuous for $t= \frac{1}{2}$.
If you want an specific homotopy from $\mathrm{id}_{S^{2n-1}}$ to $-\mathrm{id}_{S^{2n-1}}$, here is one.
Let's start with $n=1$. Let's think $S^1$ as the set of complex numbers $z \in \mathbb{C}$ of modulus 1: $\vert z \vert = 1$. Consider the map:
$$
H: S^1 \times I \longrightarrow S^1
$$
defined by
$$
H(z,t) = e^{i\pi t} z \ .
$$
This map is plainly continuous, its image lies on the sphere $\vert H(z,t) \vert = \vert e^{i\pi t}\vert \cdot \vert z \vert = \vert z \vert = 1$ and $H(z,0) = z$ and $H(z,1) = -z$. Hence, it may be the homotopy you were looking for, right?
For $n \geq 1$, exactly the same map works. Now you think your odd sphere $S^{2n-1}$ as being the subset of complex $n$-tuples $z = (z_1, \dots , z_n) \in \mathbb{C}^n$ of modulus 1, $\vert z \vert = \sqrt{\vert z_1\vert^2 + \dots + \vert z_n\vert^2 } = 1$. And you consider the same map:
$$
H: S^{2n-1} \times I \longrightarrow S^{2n-1} \ .
$$
Namely,
$$
H(z,t) = e^{i\pi t} z = (e^{i\pi t} z_1 , \dots ,e^{i\pi t} z_n ) \ .
$$
The same proof we did for $n=1$ applies now and shows that $H$ is the desired homotopy.
Notice that, since we had to rely on complex numbers, this does not work for even spheres.
Finally, if you prefer, another way to write the map $H$ for $n=1$, now thinking $S^1$ as the set of points $(x,y) \in \mathbb{R}^2$ such that $\| (x,y) \| = 1$, could be
$$
H(x,y,t) =
\begin{pmatrix}
\cos (\pi t)  &  -\sin (\pi t) \\
\sin (\pi t)  &  \cos (\pi t)
\end{pmatrix}
\begin{pmatrix}
x \\
y
\end{pmatrix}  \ .
$$
That is, we are rotating $(x,y)$ more and more, as $t$ increases, till we arrive at $(-x,-y)$. Notice that you need to be in $\mathbb{R}^2$ to do this: you couldn't rotate anything if we were talking about the "even" sphere $S^0 = \left\{ -1, +1\right\} \subset \mathbb{R}$ and clearly there is no homotopy from $\mathrm{id}_{S^0}$ to $-\mathrm{id}_{S^0}$; that is, a path inside $S^0$, joining $-1$ and $+1$.


text:
Q: how to show the friends of a person base on this table design, is my database design correct? table person & table friends - I have a table called person and friends,

*

*person has column: id, and name,

*friends has column: ctrl_no, person_id and friend_id

I want to show the name of a friend where person_id = 1, but it shows the name of the person WHERE person_id = 1,
person:
person id  |  name
---------- | ----------
1          |  Jervy
2          |  Pamela Shane
3          |  Hikari

friends:
ctrl_no    |  person_id     |  friend_id
---------- | -------------  | -----------
1          |  1             |  2
2          |  2             |  1
3          |  1             |  3
4          |  3             |  1

I tried my query below
SELECT person.name FROM person
JOIN friends ON person.person_id = friends.person_id
WHERE person.person_id = 1;

my query shows the name of person where person_id = 1 not his friend's name...
I want show. . . WHERE person.person_id = 1
Name
Pamela Shane
Hikari

It confusing me now. T.T

A: Your design is fine. The query just needs to be like this instead:
SELECT person.name FROM person
JOIN friends ON person.person_id = friends.friend_id
WHERE friends.person_id = 1

You want the friends' names, so you need to join the person table on friend_id. Otherwise you just get the same person's name repeatedly, which I assume is what you're seeing now.
And the criteria needs to check for friends.person_id rather than person.person_id. Since you want all the rows from that table for that person.

A: Try this query so you got your tables backwards:
SELECT person.name
FROM friends JOIN person
ON person.person_id = friends.person_id
WHERE person.person_id = 1

A: Try this:
SELECT person.name
  FROM person
  WHERE person.person_id =
  (
         SELECT friends.friend_id
         FROM friends JOIN person
         ON person.person_id = friends.person_id
         WHERE person.person_id = 1
    )


text:
Q: How to create "Embossed" effect on a text in iOS? I wanted to create "Embossed" text effect on a text in a UILabel. I am not able to choose a right option. Please guide me on how to implement this with the right available options. Do i need to use CoreGraphics or CoreText or Customized UILabel?. I just want the way how numbers appear on a Credit Card.

A: Try this,
[label setShadowColor:[UIColor darkGrayColor]];
[label setShadowOffset:CGSizeMake(0, -1)];

You can tweak this to get the desired effect.

A: UILabel's shadowColor and shadowOffset offer a limited customisation. You could also override UILabel's drawRect:
-(void)drawTextInRect:(CGRect)rect
{
    CGContextRef ref = UIGraphicsGetCurrentContext();
    CGContextSetShadowWithColor(ref, CGSizeMake(0.0, 2.0), 3.0, [UIColor blackColor].CGColor);
    [super drawTextInRect:rect];
}


text:
Q: Calculate the intersection points of a line and a parametrically defined 3D surface Thanks to  Henrik Schumacher  for advice to simplify the sample code:
I would be grateful for any pointers on the following issue.
A line from an external point intersects the surface at 2 points (near side and far side) The line can be defined as emanating from the origin {0,0,0} with a horizontal angle L and a vertical angle B  (or in Cartesian form)
I have tried several approaches to identify the distance along the line for each intersection with the 3D surface.
Obviously given any point on the surface this is straight forward and one might think that it would also be straightforward to look for two points on the same line (i.e. same L and B) and thus calculate the distance along the line to each intersection , but this has proved intractable as there are rarely exact matches and more data points creates confusion.
I have tried several approaches including meshing but to no avail, they just seem to give another set of points that do not seem to be  triangles that share edges, but that may be my misunderstanding of what a mesh does.
I note that If there is a single equation rather than a parametric set of them then NSolve or Solve can be used.
The example below includes enough code to generate a sample surface  the parameters are u and v and the x ,y and z values are given by rather involved functions of which these are simplified examples.

    ClearAll;

    fx[i_, j_, v_, h_] := 8.5 - j (1 - Sin[v]) Cos[v] Cos[h];

    fy[i_, j_, v_, h_] := i (1 - .2*Sin[v]) Cos[v] Sin[h];

    fz[k_, v_] := k (1 - Sin[v]);

    Manipulate[
     FB = ParametricPlot3D[{
        fy[i, j, v, h],
        fx[i, j, v, h],
        fz[k, v]
        },
       {v, 0, 2 Pi},
       {h, -Pi/2, Pi/2},

       Mesh -> Automatic
       ],

     {{i, 35, "y axis (i)"}, 5, 70, Appearance -> "Labeled"},
     {{j, 35, "x axis (j)"}, 5, 70, Appearance -> "Labeled"},
     {{k, 50, "z axis (k)"}, 5, 70, Appearance -> "Labeled"}
     ]

The vertices for that above can be generated by
    fbL = Flatten[Cases[Normal@FB, Line[x_] :> x, Infinity], 1]

Here is the original interface that I submitted, I will leave it in the question since there are several problems I had to solve in regard to manipulate and file saving that may be helpful to others.
    ClearAll;

    fx [i_, j_, d_, v_, h_, t_, w_, x0_, sf_] :=
          ( i (1 - d *Sin[v]) Cos[v] Sin[h] Sin[t] -
          j (1 - d*Sin[v]) Cos[v] Cos[h] Cos[t] +
          w*Log[2 - Sin[v]]*(-Sin[t] + Cos[t]))*sf + x0;

    fy [i_, j_, d_, v_, h_, t_, w_, y0_, sf_] :=
      (i (1 - d *Sin[v]) Cos[v] Sin[h] Cos[t] +
          j (1 - d*Sin[v]) Cos[v] Cos[h] Sin[t] +
          w*Log[2 - Sin[v]]*(Cos[t] + Sin[t]) )*sf + y0;

    fz[k_, v_, z0_, sf_] :=
      sf* k (1 - Sin[v])/2 + z0;

    fR[x_, y_, z_] := Sqrt[x^2 + y^2 + z^2];

    fL[x_, y_] := ArcTan[y/x];

    fB[x_, y_, z_] := ArcSin[z/Sqrt[x^2 + y^2 + z^2]];

    buildXYZCoords[np_, nq_, i_, j_, k_, d_, t_, w_, basex_] :=
     Module[{arr},
      pi = 3.14159265358979;
      hstep = pi/(nq - 1);
      vstep = 2*hstep;
      mb = fz[k, 0, 0, 1];
      sf = basex * Tan[d2r[mb]]/ mb;

      arr = {};
      For[v = 0, v <= 2 * pi, v = v + vstep,
       For[h =  -pi/2, h <= pi/2, h = h + hstep,
         x = fx[i, j, d, v, h, t, w, basex, sf];
         y = fy[i, j, d, v, h, t, w, 0, sf];
         z = fz[k, v, 0, sf];
         arr = Join[arr, {{x, y, z}}];
         ];
       ];
      (*  the last join must NOT have a semicolon,
      a NULL return coccurs if it does, hence the line below *)
      arr = Join[arr, {}]
      ]

    buildCoords[np_, nq_, i_, j_, k_, d_, t_, w_, basex_] := Module[{arr},
      pi = N[Pi];
      hstep = pi/(nq - 1);
      vstep = 2*hstep;
      mb = fz[k, 0, 0, 1];
      sf = basex * Tan[d2r[mb]]/ mb;

      arr = {{"id", "mid", "h", "v", "x", "y", "z", "R", "L", "B", "Ldeg",
          "Bdeg", "xm", "ym", "zm", "Rm", "Lm", "Bm", "Ldegm", "Bdegm"}};
      vid = 0;
      mid = 0;
      For[v = 0, v <= 2 * pi, v = v + vstep,
       For[h =  -pi/2, h <= pi/2, h = h + hstep,
         x = fx[i, j, d, v, h, t, w, basex, sf];
          y = fy[i, j, d, v, h, t, w, 0, sf];
          z = fz[k, v, 0, sf];
          R = fR[x, y, z];
          L = fL[x, y];
          B = fB[x, y, z];
          dL = r2d[L];
          dB = r2d[B];
          vid = vid + 1;

          arr = Join[arr, {{vid, mid, h, v, x, y, z, R, L, B, dL, dB}}];
         ];
       ];

      (* for export Semicolons as used above are required but the last \
    join must NOT have a semicolon i.e.
      output not surpressed hence the line below *)
      arr = Join[arr, {}]
      ]

    r2d[r_] := N[r*180/Pi];

    d2r[d_] := N[d *Pi/180];

    m8 = Manipulate[
      FB = ParametricPlot3D[{
         fy [i, j, d, v, h, t, w, 0, 1],
         fx [i, j, d, v, h, t, w, k, 1],
         fz[k, v, 0, 1]},
        {v, 0, 2 π},
        {h, -π/2 , π/2},
        ViewPoint -> Dynamic@vp,
        Mesh -> Automatic,
        MeshStyle -> mcolor,
        PlotStyle -> scolor,
        AspectRatio -> 1,
        PlotRange -> {{-50, 50}, {0, 150}, {0, 100}},
        AxesLabel -> {"y", "x", "z"}
        ],

      "Parameters defining the surface shape",

      {{i, 35, "L ~y axis (i)"}, 5, 70, Appearance -> "Labeled"},
      {{j, 35, "To GC ~x axis (j)"}, 5, 70, Appearance -> "Labeled"},
      {{k, 50, "B ~z axis (k)" }, 5, 70, Appearance -> "Labeled"},
      {{d, 0.2, "Thinness (d)"}, 0, 1, Appearance -> "Labeled"},
      {{t, 0, "xy Tilt (t)"}, -Pi/2, Pi/2, Appearance -> "Labeled"},
      {{w, 0, "'Wind' factor (w)"}, -20, 20, Appearance -> "Labeled"},
      Delimiter,
      {{vp, {0, 8.5, 0}, "View Point"},
       {{8.5, 8.5, 8.5} -> "xyz", {0, 8.5, 0} -> "yz", {0, 0, 8.5} ->
         "yx", {8.5, 0, 0} -> "xz"}, PopupMenu, ImageSize -> 140},
      Row[{Spacer[160],
        Button["Reset",
         FrontEndExecute[FrontEndToken["EvaluateNotebook"]],
         ImageSize -> 140]}],
      {{mcolor, RGBColor[0.`, 1.`, 0.07`], "Mesh"}, ColorSlider},
      {{scolor, RGBColor[255, 72, 255], "Surface"}, ColorSlider},

      Delimiter,
      Row[
       {Spacer[100], Button["Export cartessian vertices", Export[
          SystemDialogInput["FileSave",
           ToString[
            StringForm["FBdata_i=``_j=``_k=``_d=``_t=``_w=``.xlsx", i, j,
             k, d, t, w]]],
          TableForm[FB[[1, 1, 1]],
           TableHeadings ->  {None, {"x", "y", "z"}}  ]]
         , Method -> "Queued", ImageSize -> 160]}],
      Row[{Spacer[100], Button["Export to STL", Export[
          SystemDialogInput["FileSave",
           ToString[
            StringForm["FBdata_i=``_j=``_k=``_d=``_t=``_w=``.stl", i, j,
             k, d, t, w]]], FB]
         , Method -> "Queued", ImageSize -> 160]}],

      Delimiter,
      "Export coordinates x,y,z,L,B,R with a specified density of data \
    points",
      "Distance of bubble base from observer",
      {{basex, 8.5, "Observer to Base: basex (Kpc)"}, 4, 10,
       Appearance -> "Labeled"},
      {{ed, 60, "Export density"}, 10, 1000, Appearance -> "Labeled"},
      Row[{Spacer[100],
        Button["Print Parameters",
         Print["buildCoords[" <> ToString[ed] <> ","  <> ToString[ed] <>
           "," <> ToString[i] <> "," <> ToString[j] <> "," <>
           ToString[k] <> "," <> ToString[d] <> "," <> ToString[t] <>
           "," <> ToString[w] <> "," <> ToString[basex] <>
           "] // TableForm"],  Method -> "Queued", ImageSize -> 160]}],
      Row[{Spacer[100],
        Button["Export Data",
         Export[SystemDialogInput["FileSave",
           ToString[
            StringForm[
             "FBdata_np=``_i=``_j=``_k=``_d=``_t=``_w=``_gcd=_``_full_\
    with_L_B.xlsx", ed, i, j, k, d, t, w, basex]]],
          Evaluate@buildCoords[ed, ed, i, j, k, d, t, w, basex]],
         Method -> "Queued", ImageSize -> 160]}],
      Row[{Spacer[100],
        Button["Print Data",
         Print[TableForm[
           Evaluate@buildCoords[ed, ed, i, j, k, d, t, w, basex]]],
         Method -> "Queued", ImageSize -> 160]}],
      Row[{Spacer[100],
        Button["Print Calculated XYZ",
         Print[TableForm[
           Evaluate@buildXYZCoords[ed, ed, i, j, k, d, t, w, basex]]],
         Method -> "Queued", ImageSize -> 160]}],
      Row[{Spacer[100],
        Button["Plot Calculated Coords",
         Print[ListSurfacePlot3D[
           buildXYZCoords[ed, ed, i, j, k, d, t, w, basex],
           PlotRange -> {{0, 20}, {-10, 10}, {0, 20}},
           AxesLabel -> {"x", "y", "z"},
           PlotLabel -> {"Earth at (0,0,0)"}]], Method -> "Queued",
         ImageSize -> 160]}]
      ]


text:
Q: Want to deploy my site in ASP.NET on to the server with SQL server used as my database I have deployed my site on GoDaddy and its working fine but they are providing mi MySql and i have used SQL server 2008R2 so what should i do..
I have used Stored Procedures and all else I would have simply created my tables in MySQl

A: you can't deploy mysql code on mssql server,

get MSsql server

or

or convert your db to my sql


text:
Q: ASP.NET C# change selected value from drop down list output to label Ok so the problem i am having is with a drop down list.
the drop down list is supposed to output (Drinklabel) the selected value, it dose this but only the first in the list (the drop down list is generated by session variable).
I would like it so i could use the drop down list, select new value then have the label (Drinklabel) update itself.
*code bellow *
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Drinklabel.Text = "Your Chosen Beverage is A " + DropDownList1.SelectedValue.ToString() + " Drink.";
    }

////////////////////////////////////////////////////////////
Full about page code
public partial class About : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        MyFruit = Session["Fruitname"] as List<string>;
        //Create new, if null
        if (MyFruit == null)
            MyFruit = new List<string>();
        DropDownList1.DataSource = MyFruit;
        DropDownList1.DataBind();

    }

    public List<string> MyFruit { get; set; }

    protected void ButtonCalculate_Click(object sender, EventArgs e)
    {
        decimal total = calculatePrice(DropDownList1.SelectedItem.Text,
                                       TextBoxQuantity.Text.Trim());

        LabelResult.Text = "You would like " + TextBoxQuantity.Text.Trim() +
            DropDownList1.SelectedItem.Text + "(s) for a total of $" +
            total.ToString();
    }

    private decimal calculatePrice(string p1, string p2)
    {
        throw new NotImplementedException();
    }

    private decimal calculatePrice(string fruitName, int quantity)
    {
        // Ask the database for the price of this particular piece of fruit by name
        decimal costEach = GoToDatabaseAndGetPriceOfFruitByName(fruitName);

        return costEach * quantity;
    }

    private decimal GoToDatabaseAndGetPriceOfFruitByName(string fruitName)
    {
        throw new NotImplementedException();
    }

}

A: you are not checking the session object before assigning it to the Local List MyFruit.
hence add a check before assigning the Session object
Replace this:
MyFruit = Session["Fruitname"] as List<string>;

With following:
if(Session["Fruitname"]!=null)
MyFruit = Session["Fruitname"] as List<string>;

and in your Question you said that you are able to get only one item from DropDownList always.
but here you are only assigning Session object one time so obviously you will get one item.


text:
Q: Pebble C TupletCString compile error I have an issue compiling my pebble watchapp. I am trying to send strings to the Pebbl eJS script on the phone lihe this:
Tuplet password_tuple = TupletCString(PASSWORD_KEY, password_str);
Tuplet email_tuple = TupletCString(EMAIL_KEY, email_str);

The compiler error is: (they both error out like this, this is just one of the lines of output below)
./src/app_test.c:84:25: error: the address of 'email_str' will always evaluate as 'true'   [-Werror=address]

email_str and password_str are defined at the top of the program, like this:
static char email_str[30];
static char password_str[30];
#define PASSWORD_PKEY (int32_t)21
#define EMAIL_PKEY (int32_t)20

Does anyone notice anything wrong with this?

A: @ismail-badawi answer is very correct.
Pebble now recommends that you use dict_write_cstring.
dict_write_cstring(&iter, SOME_STRING_KEY, string);

A: Well it's certainly not obvious, but it turns out it's because TupletCString is a macro, and it'll expand to an expression that contains email_str ? strlen(email_str) + 1 : 0 as a subexpression, and this is what causes the error, because email_str can't be null and so the comparison isn't doing anything.
I found this thread on the Pebble forums with an explanation. The suggested fix is to define your own macro that doesn't have a conditional, e.g.
#define MyTupletCString(_key, _cstring) \
((const Tuplet) { .type = TUPLE_CSTRING, .key = _key, .cstring = { .data = _cstring, .length = strlen(_cstring) + 1 }})


text:
Q: Possible to execute jQuery on C# string object? I am retrieving the HTML source code from a remote URL via C#. I am storing the html in a string. I would like to parse through it, but do not want to use RegEx. Instead of want to leverage the jQuery engine to parse through it. Is this possible somehow?
This is how I getting the html from the remote url:
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
string html = (new StreamReader(wr.GetResponse().GetResponseStream())).ReadToEnd();

I found the Fizzler library (http://code.google.com/p/fizzler/), but it does not use the jQuery engine so there is a lot of things missing from it. Any suggestions on how to do this properly?

A: You can setup this server-side (it isn't pretty), but I'd recommend taking a look at something designed for just this purpose on the C# side: The HTML Agility Pack (which the library you linked is based on).
jQuery just isn't designed for this, go with a C# solution (or any .Net language/library you can include)...trust me when you're done you'll have much more hair.


text:
Q: Rails on Subdomain and Custom Port I have to run rails on a shared host for a client via cPanel.
The application is running on a subdomain and non standard port.
I am using Authlogic, so on the first visit it detects I am not logged in and I get a page with:

You are being redirected.
Clicking on that I get the login form, which then takes me to the target page, with the same redirect message. So the model detects the login, but no cookie or session is ever created.
I have tried the following with no success:

config.action_controller.session = {:domain => '.bbbb.com'}

I've also tried using an active record session with same result.
Please help :)
Thanks

A: Are you using, or have you looked at SubDomainFu?
http://github.com/mbleigh/subdomain-fu


text:
Q: Why this output? NSLog(@"%0.2f", 1.345); // output 1.34 **NSLog(@"%0.2f", 1.345); // output 1.34**
NSLog(@"%0.2f", 1.3451);// output 1.35
NSLog(@"%0.2f", round(1.345 * 100)/100.);//output 1.35

Why the first line output 1.34?!!
=======================================
Updated:
NSLog(@"%.2f", round([@"644.435" doubleValue] * 100) / 100); // output 644.43,

but
NSLog(@"%.2f", round([@"6.435" doubleValue] * 100) / 100); // output 6.44?

If I want to convert a NSString to keep two digit after the point, would you please advise how to convert?

A: Because 1.345 cannot be represented exactly in IEEE754. More than likely, it's something like 1.34444444449 which, when printed, gives you 1.34.
If you search for things like ieee754, precision and floating point, one of the billion or so articles should be able to enlighten you :-)
Look particularly for: What every computer scientist should know about floating point.
Going into a little more detail, examine the following C program:
#include <stdio.h>
int main (void) {
    float f = 1.345f;
    double d = 1.345;
    printf ("f = %.20f\nd = %.20lf\n", f, d);
    return 0;
}

The output of this is:
f = 1.34500002861022949219
d = 1.34499999999999997335

So the float value is a little above 1.345 and the double (which is what you get when you specify 1.345 without the f suffix) is a little below.
That explains why you're seeing it truncated to 1.34 rather than rounded to 1.35.


text:
Q: Using File.Open for a WPF Resource I've got the following code below.  High level overview is that it is a coverter that takes a .emf file from a file share, and then converts it into something WPF can use for Image.Source:
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var fileName = (string)value;
        if (fileName == null)
            return new BitmapImage();
        using (var stream = File.Open(fileName, FileMode.Open))
        {
            return GetImage(stream);
        }
    }

    internal BitmapImage GetImage(Stream fileStream)
    {
        var img = Image.FromStream(fileStream);
        var imgBrush = new BitmapImage();
        imgBrush.BeginInit();
        imgBrush.StreamSource = ConvertImageToMemoryStream(img);
        imgBrush.CreateOptions = BitmapCreateOptions.PreservePixelFormat;
        imgBrush.EndInit();
        return imgBrush;
    }

    public MemoryStream ConvertImageToMemoryStream(Image img)
    {
        var ms = new MemoryStream();
        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        return ms;
    }

Now, all is well and good here.  The users are going to need a "print calibration" page, so I included a "SampleDoc.emf" file into my application and marked it as a resource.
However, I can't seem to get the File.Open() part right when pointing to that resource file.  Any ideas on how I can do this?

A: When you marked your "SampleDoc.emf" as a resource it only resides inside the compiled assembly (to put it very simply). See Getting additional files in LightSwitch which I asked and answerd a similar question which can answer your Question.
// creates a StreamReader from the TestFile.txt
StreamReader sr = new StreamReader(assembly.GetManifestResourceStream("SomeFile.txt"));

With this code you can access your resources.
Another way would be to mark the BuildOption for your File as "Content"  and set the "copy action" to "copy always" or "only when newer" then your File gets copied to the outputdirectory when you build your Project.


text:
Q: InvalidDigit while converting vector of strings to vector of u32 in Rust I am trying to convert a vector of strings to a vector of u32, but I keep getting the InvalidDigit error.
The vector of strings is completely filled with numbers as strings, and there are no words or characters in them.
Here's my code:
struct DayTwo {
    input: String
}

impl DayTwo {
    pub fn get_values(&self, filter: &str) -> Vec<u32> {
        let input: Vec<u32> = self.input
            .split("\n")
            .into_iter()
            .filter(|n| n.starts_with(filter))
            .map(|x| x.trim_start_matches(filter))
            .map(|n| n.parse::<u32>().unwrap())
            .collect();

        for num in &input{
            println!("{}", num);
        }
        return input;
    }
}

Here's the error message:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', src/main.rs:11:163

A: Figured it out! When separating the string (e.g "forward 6") into just the integer, I left the space between the word and the number, so I had to add trim() to the second map function to get rid of the empty space.


text:
Q: SQL Order By in Left Join Select I have a system that contains two tables. A "projects" table, and an "additions" table.
The projects table contains original data for a "project". The details on the project cannot be changed directly. Instead an "addition" is used if any details need to change. This way the original entry in projects is maintained and as additions are added all the changes can be tracked in order.
One of the project fields is "projectEndDate" which contains the end date of the project. This can be overriden with an addition with "additionEndDate". Additions also contains "additionDateEntered" which logs when the addition was actually entered into the system.
I need to be able to grab all the projects while left joining the additions that contain a new endDate ordered by the newest "additionDateEntered" and getting the "additionEndDate" for that entry. And to finalize, the entire results should be ordered by the "realClosingDate" which is an alias of the newest end date. Usually I can work through these queries but I seem to be really struggling with this one.
Here's what I have so far
SELECT
    *,
    `additionEndDate`,
    GREATEST(COALESCE(`projectEndDate`, 0),
            COALESCE(`additionEndDate`, 0)) AS `realEndDate`
FROM
    (SELECT
        *
    FROM
        `projects`
    WHERE
        `projectStatus` = 'Active') AS A
        LEFT JOIN
    (SELECT
        *
    FROM
        `additions`
    WHERE
        `additionEndDate` IS NOT NULL
    GROUP BY `projects_projectId`
    ORDER BY `additionEnteredDate` DESC) AS B ON A.projectId = B.projects_projectId
ORDER BY `realEndDate`

The result does not get the latest additionEnteredDate but instead seems to get the first entry in additions only.
EDIT:
Here is a sample project and 4 sample additions tied to that project

The query above results in realClosingDate of 2020-02-12 however the require result should be 2020-02-22 as that is the latest entered addition but not necessarily the MAX() of additionEndDate

A: This answers the original question.
SELECT * with GROUP BY!!! That is just a bug.  And the most recent versions of MySQL don't even allow it.
It does at least make the logic easy to fix:
SELECT p.*, a.max_additionEndDate,
       GREATEST(COALESCE(p.projectEndDate, a.max_additionEndDate),
                COALESCE(a.max_additionEndDate, p.projectEndDate)
               ) as realEndDate
FROM projects p LEFT JOIN
     (SELECT a.projects_projectId, MAX(additionEndDate) as max_additionEndDate
      FROM additions` a
      GROUP BY projects_projectId
     ) a
     ON a.projectId = p.projects_projectId
WHERE p.projectStatus = 'Active'
ORDER BY `realEndDate`


text:
Q: LDAP in PHP code "Can't contact LDAP server" in windows server I have a problem in connecting to LDAP from windows server using PHP. My codes are below:
<?php

$ldaprdn  = 'myusername';     // ldap rdn or dn
$ldappass = 'mypassword';

// connect to ldap server
$ldapconn = ldap_connect("LDAP://myDomain")
    or die("Could not connect to LDAP server.");

    ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
    ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
if ($ldapconn) {
var_dump(ldap_bind($ldapconn, $ldaprdn, $ldappass));

    if ($ldapbind) {
        echo "LDAP bind  successful...";
    } else {
        echo ldap_error($ldapconn);
        echo "LDAP bind  failed...";
    }

}

?>

I always get "Can't contact LDAP server" error message. If I used .net application using same username, password, and domain, the connection always be made successfully. Am I doing wrong in the codes or perhaps configuration should be made?


text:
Q: HSQLDB Configuration with Spring - BeanCreationException: I'm trying to configure a HSQLDB using Spring, but I receive following ERROR:
Error creating bean with name 'hsqlDataSource' defined in class path resource [/config/HSQLDBConfig.class]: Initialization of bean failed;

CODE:
package at.irian.bibi.priceindexer.config;

import org.apache.commons.dbcp.BasicDataSource;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.jdbc.datasource.init.DataSourceInitializer;
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
import org.springframework.orm.hibernate4.HibernateTransactionManager;
import org.springframework.orm.hibernate4.LocalSessionFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;
import java.util.Properties;

@Configuration
@EnableTransactionManagement
@PropertySource("classpath:application.properties")
public class HSQLDBConfig {

  @Bean
  @Autowired
  public DataSourceInitializer dataSourceInitializer(DataSource dataSource) {
      ResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator();
      resourceDatabasePopulator.addScript(new ClassPathResource("/schema.sql"));

      DataSourceInitializer dataSourceInitializer = new DataSourceInitializer();
      dataSourceInitializer.setDataSource(dataSource);
      dataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator);
      return dataSourceInitializer;
  }

  @Bean
  public DataSource hsqlDataSource() {
      BasicDataSource basicDataSource = new BasicDataSource();
      basicDataSource.setDriverClassName(org.hsqldb.jdbcDriver.class.getName());
      basicDataSource.setUsername("sa");
      basicDataSource.setPassword("");
      basicDataSource.setUrl("jdbc:hsqldb:mem:priceindexerdb");
      return basicDataSource;
  }

  @Bean
  @Autowired
  public LocalSessionFactoryBean sessionFactory(Environment environment, DataSource dataSource) {
      String[] packageOfModelBeans = {Listing.class.getPackage().getName(), Residential.class.getPackage().getName(), LotsAndLand.class.getPackage().getName()};

      LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();

      factoryBean.setDataSource(dataSource);
      factoryBean.setHibernateProperties(buildHibernateProperties(environment));
      factoryBean.setPackagesToScan(packageOfModelBeans);
      return factoryBean;
  }

  protected Properties buildHibernateProperties(Environment environment) {
    Properties hibernateProperties = new Properties();
    hibernateProperties.setProperty("hibernate.dialect", environment.getProperty("hibernate.dialect"));
    hibernateProperties.setProperty("hibernate.show_sql", environment.getProperty("hibernate.show_sql"));
    hibernateProperties.setProperty("hibernate.format_sql", environment.getProperty("hibernate.format_sql"));
    hibernateProperties.setProperty("hibernate.hbm2ddl.auto", environment.getProperty("hibernate.hbm2ddl.auto"));
    hibernateProperties.setProperty("hibernate.use_sql_comments", environment.getProperty("hibernate.use_sql_comments"));
    hibernateProperties.setProperty("hibernate.generate_statistics", environment.getProperty("hibernate.generate_statistics"));
    hibernateProperties.setProperty("hibernate.connection.url", environment.getProperty("hibernate.connection.url"));

    hibernateProperties.setProperty("javax.persistence.validation.mode", environment.getProperty("javax.persistence.validation.mode"));
    hibernateProperties.setProperty("org.hibernate.envers.store_data_at_delete", environment.getProperty("org.hibernate.envers.store_data_at_delete"));
    hibernateProperties.setProperty("org.hibernate.envers.global_with_modified_flag", environment.getProperty("org.hibernate.envers.global_with_modified_flag"));

    return hibernateProperties;
  }

  @Bean
  @Autowired
  public HibernateTransactionManager   hibernateTransactionManager(SessionFactory sessionFactory) {
      return new HibernateTransactionManager(sessionFactory);
  }
}

If I kick out the HSQLDBConfig my program starts without trouble. I really don't know what causes the trouble.
I also tried to debug it and the Exception is thrown at return basicDataSource
Does anyone have an idea of what could cause the error?
EDIT
STACKTRACE:
2015-08-02T14:29:39.281 ERROR 11143 --- [           main] o.s.boot.SpringApplication               : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:293) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:293)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1186) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1186)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:370) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:370)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:990)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:975) ~[spring-context-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:752) ~[spring-context-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:975)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:752)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109) ~[spring-boot-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) [spring-boot-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) [spring-boot-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952) [spring-boot-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941) [spring-boot-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:952)
at at.irian.bibi.priceindexer.Application.main(Application.java:14) [classes/:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:941)
at at.irian.bibi.priceindexer.Application.main(Application.java:14)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:509) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:509)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:290) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:290)
... 27 common frames omitted
... 27 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hsqlDataSource' defined in class path resource [at/irian/bibi/priceindexer/config/HSQLDBConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:964)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:862)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1021) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:481)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:964) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
... 29 more
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:862) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:481) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
... 29 common frames omitted
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1546)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:296)
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerPostProcessor.postProcessAfterInitialization(DataSourceInitializerPostProcessor.java:62)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1559)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
... 38 more
Caused by: java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runScripts(DataSourceInitializer.java:146)
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runSchemaScripts(DataSourceInitializer.java:77)
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.initialize(DataSourceInitializer.java:71)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1546) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:296) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerPostProcessor.postProcessAfterInitialization(DataSourceInitializerPostProcessor.java:62) ~[spring-boot-autoconfigure-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:421) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1559) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
... 38 common frames omitted
Caused by: java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.setSeparator(Ljava/lang/String;)V
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runScripts(DataSourceInitializer.java:146) ~[spring-boot-autoconfigure-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runSchemaScripts(DataSourceInitializer.java:77) ~[spring-boot-autoconfigure-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.initialize(DataSourceInitializer.java:71) ~[spring-boot-autoconfigure-1.1.8.RELEASE.jar:1.1.8.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ~[spring-beans-4.0.7.RELEASE.jar:4.0.7.RELEASE]
... 51 common frames omitted

A: I manged to solve the problem by deleting all hibernate, hsqldb,.. dependencies from pom.xml and importing them carefully again.


text:
Q: Will disabling directx rendering help to low the cpu and memory usage? Sorry for the question asked before and it was not clear. Now I am trying to be more specific:
I am injecting a dll into an old simple 2d game and trying to low its cpu and memory usage when it's inactive(it's window mode). For now what I can think up is to hook directx functions and disable rendering when it's inactive. But:
1.Is that possible? I mean if this game can run properly if doing so.
2.If yes, is this helpful to low cpu and memory usage?

A: You haven't given much information, so the best I can give you is..

*

*Keep track of entities that need to always be updated [timers,etc], and update only them when the window is inactive.

*Don't draw anything while the window is inactive.
It's not a simple task to reduce memory usage based on whether a window is active or inactive.


text:
Q: Логи ошибок tomcat Запускаю проект из idea.
Командой sudo lsof | grep -E "java.*(out|txt|log)$" выяснил что логи живут в ~/.IntelliJIdea2017.1/system/tomcat/Unnamed_hellomvc/logs
их список:
 total 128
-rw-r----- 1 vpotseluyko vpotseluyko 32196 янв 21 23:50 catalina.2017-01-21.log
-rw-r----- 1 vpotseluyko vpotseluyko 83853 янв 22 00:54 catalina.2017-01-22.log
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 21 21:32 host-manager.2017-01-21.log
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 22 00:19 host-manager.2017-01-22.log
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 21 21:32 localhost.2017-01-21.log
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 22 00:19 localhost.2017-01-22.log
-rw-r----- 1 vpotseluyko vpotseluyko  3766 янв 21 23:52 localhost_access_log.2017-01-21.txt
-rw-r----- 1 vpotseluyko vpotseluyko   958 янв 22 00:56 localhost_access_log.2017-01-22.txt
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 21 21:32 manager.2017-01-21.log
-rw-r----- 1 vpotseluyko vpotseluyko     0 янв 22 00:19 manager.2017-01-22.log

в каком из них ошибки?!

A: HTTP статусы можно найти в localhost_access_log. Ошибки самого Tomcat находятся в catalina.


text:
Q: java.lang.NoClassDefFoundError: Could not initialize class iland.database.HibernateUtil I am getting following exception
Caused by: java.lang.NoClassDefFoundError: Could not initialize class iland.database.HibernateUtil

Following is my Class
public class HibernateUtil {

    private static final SessionFactory sessionFactory;

    static {
        try {
            // Create the SessionFactory from standard (hibernate.cfg.xml)
            // config file.
            sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            // Log the exception.
            System.err.println("Initial SessionFactory creation failed." + ex);
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory() {
        return sessionFactory;
    }
}

While calling
Session session = HibernateUtil.getSessionFactory().openSession();

How to resolve this exception
Stack Treace
SEVERE: Exception occurred during processing request: null
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
    at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
    at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563)
    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:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    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:744)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class iland.database.HibernateUtil
    at iland.login.LoginBusiness.HbmLogin(LoginBusiness.java:92)
    at iland.login.LoginAction.doLogin(LoginAction.java:46)
    ... 69 more


text:
Q: Write all combinations of values to csv I want to create a csv file that contains the following format.  For the first column, ABC repeat 3 times and AAA1 also repeat 3 times. and then AAA1 increment by 1 become AAA2 and then increment by another 1 become AAA3. I want to repeat such increment by N times and then switch to BBB1 and repeat also N times.  The following is my code. I know they are wrong. please help me.
with open(file.csv, 'r') as input:
    reader = csv.reader(input,lineterminator='\n', delimiter = ',')

    all = []
    row = next(reader)
    all.append(row)
    alist= ["AAA","BBB"]
    count=0
    for row in reader:
        count+=1
        row.insert(2, (random.choice(alist)+ (str(count))))
        all.append(row)

with open(file.csv, 'w') as output:
    writer = csv.writer(output, lineterminator='\n',delimiter = ',')

this is what I want to create

Block ID    Stage ID
A      AAA1
B      AAA1
C      AAA1
A      AAA2
B      AAA2
C      AAA2
A      BBB1
B      BBB1
C      BBB1
A      BBB2
B      BBB2
C      BBB2

A: I believe this is what you are trying to do:
  number_of_times_to_repeat_stage_prefix = 4
  stage_prefixes = ["AAA","BBB"]
  block_ids = list('ABC')
  text = []
  for stage_prefix in stage_prefixes:
      block_counter = 0
      for i in range(number_of_times_to_repeat_stage_prefix):
          for block in block_ids:
              text.append([block, stage_prefix + str(block_counter+1)])
          block_counter+=1

  with open("E:/file.csv", 'w') as output:
      writer = csv.writer(output, lineterminator='\n',delimiter = ',')
      writer.writerows(text)

With the repeat set to 4 I get:
A   AAA1
B   AAA1
C   AAA1
A   AAA2
B   AAA2
C   AAA2
A   AAA3
B   AAA3
C   AAA3
A   AAA4
B   AAA4
C   AAA4
A   BBB1
B   BBB1
C   BBB1
A   BBB2
B   BBB2
C   BBB2
A   BBB3
B   BBB3
C   BBB3
A   BBB4
B   BBB4
C   BBB4

A: You originally had an R tag, not sure if you're open to an R solution but here goes:
NN <- 2 #"repeat N times..."
DF <- data.frame("Block ID" = LETTERS[1:3],
                 "Stage ID" = paste0(rep(c("AAA", "BBB"), each = 3 * NN),
                                     rep(1:NN, each = 3)))
write.csv(DF, file = "file.csv")


text:
Q: MATLAB PollableDataQueue get last value Is it possible to make the a MATLAB PollableDataQueue last-in-first-out (LIFO) instead of first-in-first-out (FIFO)? Alternatively, is there a way to get the last entry in a queue instead of the first one?
See for example, the following code that illustrates the current behavior of  PollableDataQueue:
%parpool;

q = parallel.pool.PollableDataQueue;

f = parfeval(@test,1,q);

for jj = 1:4
    poll(q)
    pause(0.25)
end

fetchOutputs(f)
function x0 = test(q)

    x0 = [];
    for jj = 1:20
        x0 = [x0, rand(1)];
        send(q, x0);
        pause(0.01);

    end

end

ans =

     []

ans =

    0.7918

ans =

    0.7918    0.1528

ans =

    0.7918    0.1528    0.0854

ans =

  Columns 1 through 12

    0.7918    0.1528    0.0854    0.9955    0.3557    0.1679    0.6713    0.5398    0.6599    0.9344    0.7200    0.4450

  Columns 13 through 20

    0.6622    0.4427    0.9791    0.5114    0.0200    0.6054    0.0479    0.3470

Calling "poll(q)" returns the values added to x0, one by one, in the order in which they are added to the queue (FIFO). Instead, I would like to retrieve the last value in the queue, at the moment in which the moment in which poll(q) is called.
For example, since the code below waits 0.25 seconds between successive calls to "poll(q)", and since values are added to x0 every 0.01 seconds, I would suspect that by the second time "poll(q)" is called, the 25th value of x0 should be already recorded. Yet, the second time I call "poll(q)" I only get the first entry (FIFO instead of LIFO).

A: You can use a while loop inside the for loop to make the queue empty:
for jj = 1:4
  while q.QueueLength > 0
    x0 = poll(q);
  end
  x0
  pause(0.25)
end


text:
Q: WebDav on custom port with redirect Is it possible to connect to WebDav using custom port which also has redirect to https? When I remove redirect everything works.
DAVLockDB /var/www/DavLock
<VirtualHost *:882>
    DocumentRoot /var/www/storage

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/(.*) https://%{SERVER_NAME}:444/$1 [L,R]

    <Directory /var/www/storage>
        Options Indexes Multivews
        AllowOverride None
        Order Allow,Deny
        Allow from all
    </Directory>
    <Location />
         DAV On
         AuthType Digest
         AuthName "authname"
         AuthDigestProvider file
         Require valid-user
    </Location>
</VirtualHost>


text:
Q: jQuery animate function Good afternoon lads,
I've been working on a jQuery over function which allows you to highlight a div a preview div.
URL's:
Logo

jQuery below:
$("a.hoverlogo").hover(
function() {
    $("#preview-logo").animate({backgroundColor: '#cccccc'});
},
function() {
    $("#preview-logo").animate({backgroundColor: '#fff'});
});

But when i keep doing mouseover a several times the animation wont stop highlighting.
How-to stop the animations when I'm not on the a href URL anymore?
Thanks for your time,
Kind regards.

A: may be this: http://jsfiddle.net/Z8FsU/1
$("a.hoverlogo").hover(
    function() {
        $("#preview-logo").stop()
                          .animate({
            backgroundColor: '#cccccc'
        });
    }, function() {
        $("#preview-logo").stop()
                          .animate({
            backgroundColor: '#fff'
        });
    }
);

.stop() - stop the currently-running animation on the matched elements.


text:
Q: Is Pokemon Go supposed to keep your screen on? A lot of apps keep my phone's screen on (for example, youtube). Does Pokemon Go do the same thing? I'm asking because when I play the game, my screen turns off after a few seconds. I have to keep touching the screen so it won't turn off. The problem is that when I touch the screen, I lose the orientation that I am facing when I'm in "compass mode." If it is supposed to stay on, is there a setting or something that keeps it on?
I saw this question and answer which says that you are supposed to keep the game open to hatch an egg. Does that mean you have to keep touching the screen to keep it active?
I mostly just want to verify if it is a problem with my phone and it stays on for other players. I'm on android.

A: It doesn't, so you'll have to update your system settings.
On Android, the setting should be located somewhere like this, but might vary slightly depending on which phone you're using:
Settings -> My Device -> Display -> Screen Timeout
If your phone is like mine, you might find that the highest the inactivity timeout can be raised is to 10 minutes.  If that's a problem, you can install an app to keep your phone from timing out instead.

A: Full disclosure: I am the author of the app I'm about to recommend. The link is below.
Wakey is an Android app that is built to keep your screen on, on your terms. I've worked very hard to make it work well and be simple to use, and gives you lots of options which may improve battery life while using Pokemon Go. It works better than the "Battery Saver" mode included in Pokemon Go, which only really works when the screen is upside down. Wakey works in any orientation.
You can choose a mode that will allow the best combination of screen and battery - you can choose CPU only (this allows the screen to shut off, but the phone stays awake. I'm not 100% sure this is compatible with Pokemon Go, but if not...), or you can choose "Minimal Brightness" mode, which lowers your screen to the lowest brightness, but keeps it on. Finally, there's "Allow Dimming" mode, which lets the screen go partially dim, but not fully dim or off. I would recommend trying the modes in that order, as they are listed in the order of most battery saving.
With Wakey, you can set it to keep your screen on manually, or as long as Pokemon Go is on screen (or any app or apps you choose), or as long as the device is charging (the Auto features require in-app upgrade to Premium, but everything else I'm talking about here is free).
Android users can download it here

A: For those on Android 6.0 and up, you can use the quick tiles to add a screen on flag using the Tiles app.
Note:  No relation to the developer, just own the app.  I purchased it because I don't want a running service eating my system resources like some of the other options listed.

A: Changing global screen settings should not be done for one app only, this also drains ones battery faster out of Pokemon.
The best app I have come across to keep my screen on is Keep Screen On!, it requires no other rights than 'prevent phone from sleeping'. It is super simple and small. It is completely free, there are no in app purchases.
You can chose 'SCREEN_DIM_WAKE_LOCK'. The CPU stays on, but the screen dims completely until you touch it again. So you get notified when a Pokemon is nearby, but you need less battery, because your screen is not continuously bright.

A: In settings, under Device heading go to battery& power saving,g o to battery usage and go into ignore battery optimization. Toggle on apps that you want to override your screen. You don't need any third party apps I am using an lg g5.


text:
Q: Pandas Dataframe Keep Row If Column Contains Any Designated Partial String I have a pandas data frame. Below is a sample table.
Event   Text
A       something/AWAIT TO SHIP hello
B       13579
C       AWAITING SHIP
D       24613
E       nan

I want to only keep rows that contain the words "AWAIT TO SHIP" in the Text column or contains the string 13579 or 24613 in Text column. Below is my desired table:
Event   Text
A       something/AWAIT TO SHIP hello
B       13579
D       24613

Below is the code I tried:
df_STH001_2 = df_STH001[df_STH001['Text'].str.contains("AWAIT TO SHIP") == True | df_STH001['Text'].str.contains("13579") == True | df_STH001['Text'].str.contains("24613") == True]

Below is the error I get:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

A: You should not explicitly check == True, instead just use the call to contains.
Here's your sample:
First, we define the sample dataframe:
df1 = pd.DataFrame(data=[
('A', 'something/AWAIT TO SHIP hello'),
('B', 13579),
('C', 'AWAITING SHIP'),
('D', 24613),
('E', np.nan)], columns=['Event', 'Text'])

Then I build an intermediate mask with your conditions:
In [18]: mask = df1.Text.str.contains('AWAIT TO SHIP') |    \
                df1.Text.str.contains('13579') | \
                df1.Text.str.contains('24613')

Now you can index the original dataframe using this mask.
In [19]: df1.loc[mask]
Out[19]:
  Event                           Text
0     A  something/AWAIT TO SHIP hello