text:
Q: How select only all first child of another div Suppose to have this html code:

...

...

I want take the all only first child directly of div with colora_riga like class. I dont' want the div another div. This is my css:
.colora_riga > div:first-child {
    border:1px ridge #999999;
}

This rule works only for the first child of div with "colora-riga" like class, for the second directly child the rule is not applied. Anyone can help me?

A: If I understood you correctly, you want every div directly under .colora_riga, you don't need :first-child then :
.colora_riga > div {
    border:1px ridge #999999;
}


text:
Q: How do I make frame environment play nice with \textbf? I am getting a strange error message when I put textbf into a frame environment.
Minimal Example
\documentclass{article}
\listfiles

\begin{document}

\begin{frame}
\textbf{Lemma 1}

\end{frame}

\end{document}

Error Message:
! Missing number, treated as zero.
<to be read again>
                   }
l.8 \textbf
           {Lemma 1}

When I comment out the \textbf, the file compiles fine.
When I use \textbf normally, the file also compiles fine.
Note: I am using pdflatex on Linux.

A: I'm not sure whether you want to use beamer's frame environment, or LaTeX's \frame command (which I haven't even known before:). If the former is the case, you're not loading the beamer class! If the latter: \frame is a command, not an environment. It takes only one argument: in your case, this will be a lone \textbf --- thus the error.
Thus, either:
\documentclass{beamer}

or:
\frame{\textbf{Lemma 1}}

Or, the third framed:
\usepackage{framed}
% ...
\begin{framed}
  \textbf{Lemma 1}
\end{framed}

A: I'm not famliar with the frame environment.  But the error seems to suggest that the frame environment takes some kind of argument and \textbf is getting slurped into that argument sans {Lemma 1}.  This is why {\bf Lemma 1} appears to work.
Where did you run across \begin{frame}...\end{frame}?
\documentclass{article}
\listfiles
\usepackage{mdframed}
\pagestyle{empty}
\begin{document}

\begin{frame}{}
\textbf{Lemma 1}

\end{frame}

vs.

\begin{frame}{The}
\textbf{Lemma 1}

\end{frame}

\framebox{\textbf{Lemma 1}}

\end{document}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Apps are not deployed in the Google Play console I have updated an existing app, but it is stuck in this state.
Waiting for 3 days, when will it be completed?
When deployed, I chose a 20% rollout. Does this have anything to do with it? Thank you.
My App Update State Image


text:
Q: Need help about transfer from two table but copy all detail in other table i have a question,  i have two diffrent table example
Table_data    Table_history.
the situation is,when new users register a form all the detail will be insert into table_data, then if the users want add a nominee  the detail is still  will be insert into table_data  and it will replace the detail with that user, and the information about the user in table_data will transfer to another table call table_history.
My question is,how i can transfer all the detail from table_data for the first useer into table_history .?after the nominee information is insert into table_data?

A: I would do an INSERT INTO Table_history before I update Table_data
INSERT INTO Table_history (ColA, ColB, ...)
VALUES (
(SELECT ColA FROM Table_data WHERE id = ... ),
(SELECT ColB FROM Table_data WHERE id = ... ),
....
)

A: You can create a trigger for this situation.
The trigger should be created for after insert on table table_data.
Please refer to following link for complete reference.
http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html
you may be have use identifier OLD to reference the current data in Table_data

A: I din't get your question perfectly.
You can write a DB trigger to sense when user is adding nominee, Before insert, you can delete the record from Table_data table and insert it into Table_hostory table in trigger logic.


text:
Q: How can I extract a function from lists import matplotlib.pylab as plt

x = [0.999,0.9995, 0.9999,0.99993, 0.99995,0.99998, 0.99999]
y = [30, 50, 80, 120, 150, 400, 500]

plt.plot(x,y,'o')

Hello!
I want to extract a mathmatical function from two lists by using scipy or something.
is there a way?

A: You can interpolate your data using scipy
import matplotlib.pylab as plt
from scipy import interpolate
import numpy as np

x = [0.999,0.9995, 0.9999,0.99993, 0.99995,0.99998, 0.99999]
y = [30, 50, 80, 120, 150, 400, 500]
x_new = np.linspace(0.999,1,40)

fnc = interpolate.interp1d(x,y,fill_value='extrapolate')
y_new = fnc(x_new)

plt.plot(x,y,'o',x_new,y_new)
plt.show()

Or, if you have a function you'd like to fit it to, you can explore curve fitting


text:
Q: java.lang.VerifyError: Verifier rejected. Rejecting invocation, expected 36 argument registers, method signature has 37 or more when I'm trying to decode a bunch of json data represented as a String it crashes and says:
java.lang.VerifyError: Verifier rejected class com.example.package.MySampleClass$$serializer: failed to verify:
com.example.package.MySampleClass com.example.package.MySampleClass
$$serializer.deserialize(kotlinx.serialization.encoding.Decoder):
[0x1E18] Rejecting invocation, expected 36 argument registers, method signature has 37 or more (declaration of
'com.example.package.MySampleClass $$serializer' appears in
/data/data/com.example.package/code_cache/.overlay/base.apk/classes11.dex)

To Reproduce
  val response = httpClient.get<HttpResponse>(ApiEndPoints.languages)
  val result = response.readText()
  val jsElement = Json.parseToJsonElement(result)
  val  arr = (jsElement as JsonObject)["data"] as JsonArray
  arr.forEach {
   //    I tried to use 3 different ways but all of them causes the same error.
         val example1 = Json{ignoreUnknownKeys = true}.decodeFromString<LanguageData>(it.toString())
   //    val example2 = Json.decodeFromJsonElement(LanguageData.serializer(),it)
   //    val example3 = Json.decodeFromJsonElement<LanguageData>(it)
  }

@Serializable
data class LanguageData(
  @SerialName("code")
    val code: String,
    @SerialName("flag")
    val flag: String,
    @SerialName("keys")
    val keys: Keys,
    @SerialName("name")
    val name: String
)
@Serializable
data class Keys(
@SerialName("AlertMessages")
    val alertMessages: AlertMessages,
    @SerialName("Alerts")
    val alerts: Alerts,
    @SerialName("SampleKey1")
    val sampleKey1: SampleKey1,
    @SerialName("SampleKey2")
    val sampleKey2: SampleKey2
    ...
    @SerialName("MySampleClass")
    val mySampleClass: MySampleClass
)

each of the serializable classes has more than 200 fields.
P.S.
There is no difference If I use LanguageData as a returned type instead of HttpResponse
Expected behavior
Decode jsonString response as LanguageData.
Environment

*

*Kotlin version: 1.4.31

*Kotlin serialization Library version: 1.1.0

*Kotlin platforms: JVM, Native

*Gradle version: 4.2.0-beta06

UPDATE 1.0
I have removed all key classes except MySampleClass and from that class also removed a bunch of fields (there was ~300, now I have just ~20 field) and now it works.
Seems there is some field quantity limitations but how can I resolve that issue?
UPDATE 1.1
Tried with Gson and Moshi but it throws the same error. It seems that its not the Kotlinx.serialization library issue
Gson().fromJson(jsonString, MySampleClass::class.java)

val adapter: JsonAdapter<MySampleClass> = moshi.adapter(MySampleClass::class.java)
    val result = adapter.fromJson(jsonString)

UPDATE 2.0
The problem appears in Kotlin data classes, seems that jvm class constructor can accept max ~244 fields, now I have changed my data class with "sample" class and it works using Gson and also tried with my own parsing using reflection and it also worked, but using with Kotlinx.serialization still throws the same error.


text:
Q: Custom db entry for 3 way habtm in ROR I am converting an existing perl gtk app into a ROR app
I have a 3 way habtm association model.
class CustomerMaster < ActiveRecord::Base
  has_and_belongs_to_many :address_master, :join_table => "customer_phone_addres"
  has_and_belongs_to_many :phone_master, :join_table => "customer_phone_address"

class AddressMaster < ActiveRecord::Base
    has_and_belongs_to_many :customer_master, :join_table => "customer_phone_addres"
    has_and_belongs_to_many :phone_master, :join_table => "customer_phone_addres"

class PhoneMaster < ActiveRecord::Base
  has_and_belongs_to_many :customer_master, :join_table => "customer_phone_addres"
  has_and_belongs_to_many :address_master, :join_table => "customer_phone_addres"

The join table has the following schema
CREATE TABLE customer_phone_address
(
  id bigserial NOT NULL,
  customer_master_id bigint,
  phone_master_id bigint,
  address_master_id bigint,
  CONSTRAINT customer_phone_address_pkey PRIMARY KEY (id),
  CONSTRAINT address FOREIGN KEY (address_master_id)
      REFERENCES address_master (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT customer FOREIGN KEY (customer_master_id)
      REFERENCES customer_master (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT phone FOREIGN KEY (phone_master_id)
      REFERENCES phone_master (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT uniq_cust_phone_address UNIQUE (customer_master_id, phone_master_id, address_master_id)
)

And I have created a nested form for customer_master#new which takes inputs for both address_master and phone_master
Originally for the perl gtk app, only one entry is created in the join_table for each entry of customer, address and phone
id|customer_master_id|phone_master_id|address_master_id
186767|182774|500773|210683

However using the above relationship model, I get two entries in case of ROR
id|customer_master_id|phone_master_id|address_master_id
186769|182810|500775|nil|
186770|182810|nil|211935|

I need to maintain backward compatibility to the perl gtk app. How do I get that single entry in the join table instead of the two entries?
I think this question is similar to
https://stackoverflow.com/questions/5507150/custom-join-3-tables-usage-in-rails-2-3-8

A: Assume you are using Rails 3.
You should use habtm when your join table has only 2 foreign keys. For most cases, has_many :through will be more flexible.
In your case, you should create a model for the join table. First, you should disable pluralization for legacy DB schema. (I thought you already did that).
# In config/application.rb
config.active_record.pluralize_table_names = false

Create a join table, namely CustomerPhoneAddress by convention (I will give it a more meaningful name):
# customer_phone_address.rb
class CustomerPhoneAddress < ActiveRecord::Base
  belongs_to :address_master
  belongs_to :customer_master
  belongs_to :phone_master
end

Finally, associate your models with has_many and has_many :through:
# address_master.rb
class AddressMaster < ActiveRecord::Base
  has_many :customer_phone_addresses
  has_many :customer_masters, :through => :customer_phone_addresses
  has_many :phone_masters, :through => :customer_phone_addresses
end

# customer_master.rb
class CustomerMaster < ActiveRecord::Base
  has_many :customer_phone_addresses
  has_many :address_masters, :through => :customer_phone_addresses
  has_many :phone_masters, :through => :customer_phone_addresses
end

# phone_master.rb
class PhoneMaster < ActiveRecord::Base
  has_many :customer_phone_addresses
  has_many :customer_masters, :through => :customer_phone_addresses
  has_many :phone_masters, :through => :customer_phone_addresses
end

I tested the code and it works very well. To create an association:
CustomerPhoneAddress.create(
  :phone_master => PhoneMaster.first,
  :address_master => AddressMaster.first,
  :customer_master => CustomerMaster.first)

To query the association:
IRB> a = AddressMaster.first
=> #<AddressMaster id: 1, created_at: "2011-12-07 15:23:07", updated_at: "2011-12-07 15:23:07">
IRB> a.customer_masters
=> [#<CustomerMaster id: 1, created_at: "2011-12-07 15:23:15", updated_at: "2011-12-07 15:23:15">]
IRB> a.phone_masters
=> [#<PhoneMaster id: 1, created_at: "2011-12-07 15:23:19", updated_at: "2011-12-07 15:23:19">]
IRB> a.customer_phone_addresses
=> [#<CustomerPhoneAddress id: 1, address_master_id: 1, customer_master_id: 1, phone_master_id: 1, created_at: "2011-12-07 15:24:01", updated_at: "2011-12-07 15:24:01">]


text:
Q: How to read a csv file as series instead of dataframe in pandas? When I try to use  x = pandas.Series.from_csv('File_name.csv', header = None)
It throws an error saying IndexError: single positional indexer is out-of-bounds.
However, If I read it as dataframe and then extract series, it works fine.
x = pandas.read_csv('File_name.csv', header = None)[0]
What could be wrong with first method?

A: Add index_col=None parameter, seems it is reading entire file in one column and default first column is treated as index.
Pandas documentation says Series.from_csv is discouraged. read_csv is much more powerful alternative you should use that.

A: There is 2 option read series from csv file;

*

*pd.Series.from_csv('File_name.csv')

*pd.read_csv('File_name.csv', squeeze=True)
My prefer is; using squeeze=True with read_csv


text:
Q: Junit: Use same test object in multiple test classes I have multiple, individual test classes which all use the same test object. At the moment I'm using @Before in each of these classes, which is obviously not a very good solution.
One option of course is to inherit from an abstract class which creates this object. As stated here, this is not a good idea as well.
Another option would be External Resource, but that is - as the name says - for resources rather than test objects.
I feel like I'm missing something since this must be a basic task in JUnit.

A: You might be looking for a TestRule. To quote the Javadoc:

A TestRule is an alteration in how a test method, or set of test methods, is run and reported. A TestRule may add additional checks that cause a test that would otherwise fail to pass, or it may perform necessary setup or cleanup for tests, or it may observe test execution to report it elsewhere. TestRules can do everything that could be done previously with methods annotated with Before, After, BeforeClass, or AfterClass, but they are more powerful, and more easily shared between projects and classes.

It then goes on to list a few types, of which ExternalResource is one; but there are others also.
Given that you talk about doing things better than using @Before methods, and you're wanting to share between classes, this sounds very much like what you are describing.

A: Congratulations you've discovered something to improve in your design! This is an excellent result from writing tests.
You say you are using the same test object in multiple tests. I assume your tests are testing different classes. I expect you have uncovered some common behaviour in those different classes that could abstract out into a new class.
Afterwards your test object would test the new class, you could remove it from th other tests, and whatever behaviour remains is different each time. Seems like a good outcome!

A: You can add a general class in your test package where you make it available static. It will make it easier to use it in your tests due to static reference. But I'm not sure if it gives a win in test time consumption...
In case of unit test I actually think the win in time with the static object is less because it's all being built up from scratch again each test class, but I can remember somewhere the JVM has it done quicker. (Pls anyone who can confirm or otherwise, tell me as I'm curious about this)

A: Do not take everything that you read on the interwebz at face value.  Everyone has an opinion and writes about it in a blog, so what.  Inheritance may not be the nicest solution to the problem that you are facing, but it is a solution.  Alternative solutions are not any prettier.  I have tried tests with inheritance on multiple occasions, and they work like a charm.  Just don't go crazy with it, don't create entire inheritance hierarchies, and you will be fine.
If you really want to stay away from inheritance, you might be able to make it work with Parametrized Tests. I presume you are using JUnit 4, so you can read about them here: org.junit.runners Class Parameterized
Parametrized tests were not exactly invented for the purpose that you want them; they create instances for the cross-product of the test methods of a single class and some test data elements that you supply, but if you use a single data element, and if you use a factory to instantiate the same data element for all of your test classes, then you could possibly achieve the effect that you want.
Personally, I'd still prefer inheritance.


text:
Q: Bulk remove Wordpress admin columns for all post types I use this filter to remove / add columns in Wordpress "pages" type admin columns:
add_filter( 'manage_edit-page_columns', 'my_admin_remove_columns', 10, 1 );

Is there a way to use it in a "wild card" style to add / remove columns to all existing post types together without specifying each one in a separate filter?