text:
Q: OpenOffice in server mode with PHP on Windows I am working on a project which requires me to generate documents as docx and then convert to doc and pdf.
This project is written in PHP (using Zend Framework) and running on IIS on Windows (client requirements - definitely not my choice!).

*

*Windows Server

*IIS 7.5

*PHP 5.3

*OpenOffice 3.2

I am researching the ways in which I can carry out the document conversion (including the LiveDocx service) and am currently looking into using OpenOffice running as a service to convert the documents.
I have a PHP script which works -- it is similar to the code in this post How do I convert RTF to PDF from my PHP web page using OpenOffice? -- but I wanted to know how well this will scale. the PHP script is basically a PHP version of the PyOD converter using PHP's COM functions. On this page (http://code.google.com/p/jodconverter/wiki/GettingStarted) it specifically says that the PyOD script is not intended for to work with multiple concurrent connections. I would therefor assume that the PHP script will be equally unsuitable.
Having read around, it seems that the OpenOffice process which is running will only support one connection at a time. Is this definitely correct? If so then am I right in thinking that it is simply not a viable solution? I would be expecting high usage for the product so concurrent conversions are a must. Does anyone have any experience with this in a production environment?
In finishing, does anyone have any other recommendations for carrying out the conversions? If not, I will go back to using the LiveDocx service. My only real gripes with it were speed and some inaccuracies with the conversions.
Thank you in advance for your help.

A: You probably can scale OpenOffice to do what you require.  Having done work directly with the OpenOffice UNO api in the past, you might find you have a lot of work to do though.  Trying to use a single OpenOffice process in a multithreaded-fashion only lead me to grief.  You can however spawn several OpenOffice processes and single-thread each.  It depends on what your performance criteria are as to whether this is going to be scalable enough...
JODReports and Docmosis sit over OpenOffice so it might be worth trying one of these systems out to see if you could potentitally scale to what you require before investing any development effort yourself with the particular technologies.  You might also look at LibreOffice which has evolved a little further recently than OpenOffice.
Hope that helps.


text:
Q: Postgres index for a conditional join I have 3 tables (all simplified here)
job (id int, type char(1))
data (job_id int, owner int, creator int, value int)
user (id int)

My query is
select user.id, job.id, sum(data.value)
from job
join data on job.id = data.job_id
join user on case job.type when 'O' then data.owner else data.creator end = user.id
group by user.id, job.id

How do I create an index in Postgres which caters for the case statement in the join?
Job would have maybe a dozen rows, users 1000s and data millions.
Thanks

A: In your example, you don't need the table "user" to get the results:
SELECT
    CASE
        WHEN job.type = '0' THEN DATA.OWNER
        ELSE DATA.creator
    END AS user_id,
    job.ID,
    DATA.VALUE
FROM
    job
    JOIN DATA ON job.ID = DATA.job_id -- indexes on the id's
GROUP BY 1,2;

Edit: Assumption: There is a foreign key between "data" and "user" that checks if a user exists.

A: Seems this isn't possible. Solved my issue by refactoring code to add a row into data for each type, along with a new "type" column and then indexed against this.

redpajama_set_name: RedPajamaStackExchange


text:
Q: PyCharm type hinting return types I can't get typing hinting for return types to generate any warnings. For example the following code generates no warnings:
def foo():
    """
    :rtype : bool
    """
    return "bar"    # Returning wrong type

x, y = foo()        # Incorrectly expecting tuple

Do return types generate warnings, or are they only used for code completion? Type warnings when using type hinting for function parameters is working as expected. Python is 2.7, PyCharm is 4.5.3.

A: You can use -> to hint the return type like this:
def hello(name: str) -> str:
    return 'hello '+name

Type hints are just hints that help IDE. Those types are not enforced. You can add a hint for a variable as str and set an int to it like this:
a:str = 'variable hinted as str'
a = 5  # See, we can set an int

PyCharm will warn you but you will still be able to run the code. Because those are just hints. Python is not a type strict language. Instead, it employs dynamic typing.

A: Return types are only used for code completion, what you've done has thoroughly confused PyCharm as to what you actually want to return.
Furthermore, x,y = <string> is valid if string is 2 characters long, so your last statement is not an invalid one.
In[3]: x, y = "ac"
In[4]: x
Out[4]: 'a'
In[5]: y
Out[5]: 'c'


text:
Q: OpenJFX cross-platform compatibility So with Java 11 getting rid of JavaFX I will have to switch to OpenJFX however I am still unsure on how to allow people to just download my application and have it work right out of the box. Right now I have people using it on Mac, Linux and Windows and I would love to continue this support without asking them to install or download anything.
Is there any way I can ship OpenJFX alongside my jar and especially allow it to be cross-platform compatible?
Any help is appreciated


text:
Q: Jquery clear form in a section for the following:

                    Login1 (adress e-mail) :
                    <input type="text" class="text">

                    Input field1 :
                    <input type="password" class="text">

                remove

        Add

when I run this:
$('div.addControl a.button').click(function () {
    var parent = $(this).closest('.section.grouping').find('.parent:last');
    parent.after(parent.clone());
});

it clones 'parent' section which works great. But i want it to clone it without values in the input fields.
what's the best way to clear all input fields in a section?
thanks

A: Can't see any reason why this won't work..
var oClone = parent.clone();
oClone.find("input").val("");
parent.after(oClone);


text:
Q: sequential execution of an action rails I have a need in which I have to return a record from the db and then update it so that the next time same record is not returned. This is required to make a live queue.
The problem I'm facing is that multiple calls are happening on my action at the same instant. Due to this, the same record is getting returned to multiple users.
I tried using lock! function but it puts a write lock and not the read lock.
Please suggest some way to achieve this.

A: Try adding a new column in by creating migration database say read_locked with type as boolean and default false ( just to keep it simple )
def change
  add_column :your_table_name, :read_locked, :boolean, default: false
end

Then use a default scope on Model
default_scope where(:read_locked => false)

Next time you want to lock some record you just have to change read_locked value to true
model_object.read_locked = true
model_object.save

All requests after that which are read_locked will be escaped
Hope this helps


text:
Q: Confusion matrix graphic not displaying data I am working on a logistic regression with just some of the classifiers of the complete data set. It works fine, I get a good confusion matrix, but I can't get the plot to work. I'm using Python 3.6 in a Jupyter Notebook, all packages I have imported I verified are up to date.
Here is where I get and process the data set:
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import os
os.chdir('C:/Users/theca/Desktop/Rstuff')
data = pd.read_csv('telco_customer_churn.csv')

categorical = data[["gender", "SeniorCitizen"]]
df = data[["tenure", "MonthlyCharges","Churn"]]
dummies = pd.get_dummies(categorical)
df_new = dummies.join(df)
df_new.head()

X = df_new.iloc[:,[0,1,2,3,4]]
y = df_new.iloc[:,[5]]
#Splitting the data set
from sklearn.model_selection import train_test_split
X_train,X_test, y_train,y_test = train_test_split(X,y, test_size = 0.25,random_state = 0)

#Fitting logistic regression
from sklearn.linear_model import LogisticRegression
classifier = LogisticRegression(random_state = 0)
classifier.fit(X_train,np.ravel(y_train))

#predicting the test results
y_pred = classifier.predict(X_test)
#making the confusion matrix
from sklearn.metrics import confusion_matrix
cm = confusion_matrix(y_test,y_pred)

The confusion matrix:
[[1164  134]
[ 250  213]]
Now I'm trying to use a method I found for sklearn at
http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html
Here is how I adapted it:
def plot_confusion_matrix(cm, classes,
                          normalize=False,
                          title='Confusion matrix',
                          cmap=plt.cm.Blues):
    """
    This function prints and plots the confusion matrix.
    Normalization can be applied by setting `normalize=True`.
    """
    if normalize:
        cm = cm.astype('float') / cm.sum(axis=1)[:, np.newaxis]
        print("Normalized confusion matrix")
    else:
        print('Confusion matrix, without normalization')

    print(cm)
    plt.imshow(cm, interpolation='nearest', cmap=cmap)
    plt.title(title)
    plt.colorbar()
    tick_marks = np.arange(len(classes))
    plt.xticks(tick_marks, classes, rotation=45)
    plt.yticks(tick_marks, classes)

    fmt = '.2f' if normalize else 'd'
    thresh = cm.max() / 2.
    for i, j in itertools.product(range(cm.shape[0]), range(cm.shape[1])):
        plt.text(j, i, format(cm[i, j], fmt),
                 horizontalalignment="center",
                 color="white" if cm[i, j] > thresh else "black")

    plt.tight_layout()
    plt.ylabel('True label')
    plt.xlabel('Predicted label')

Then I tried to generate the graphic:
plt.figure()
plot_confusion_matrix(cm, classes=df_new[["Churn"]],
                      title='Confusion matrix, without normalization')

My graphic looked like this, with no data on it:

I realized that this method is not using a pandas dataframe,  but maybe a numpy array? How would I make it display properly?
Thanks!

A: You can use seaborn to plot the confusion matrix graphic. I am passing the true and predicted labels to the function. Here's the code:
def plot_confusion_matrix(true, pred):
    from sklearn.metrics import confusion_matrix
    confusion_matrix = confusion_matrix(true, pred, labels=[1, 0])

    import seaborn as sns; sns.set()
    import matplotlib.pyplot as plt

    cm_df = pd.DataFrame(confusion_matrix,
                 index = ['1', '0'],
                 columns = ['1', '0'])
    ax = sns.heatmap(cm_df, fmt = 'd' , cmap="YlGnBu", cbar = False,  annot=True)

    plt.ylabel('True label')
    plt.xlabel('Predicted label')
    plt.title('Confusion Matrix')
    plt.show()

A: This code can also be helpful.
import numpy as np
import matplotlib.pyplot as plt
import itertools
from pycm import ConfusionMatrix

def plot_confusion_matrix(cm,
                          normalize=False,
                          title='Confusion matrix',
                          cmap=plt.cm.Blues):
"""
This function modified to plots the ConfusionMatrix object.
Normalization can be applied by setting `normalize=True`.

Code Reference :
http://scikit-learn.org/stable/auto_examples/model_selection/plot_confusion_matrix.html

"""

plt_cm = []
for i in cm.classes :
    row=[]
    for j in cm.classes:
        row.append(cm.table[i][j])
    plt_cm.append(row)
plt_cm = np.array(plt_cm)
if normalize:
    plt_cm = plt_cm.astype('float') / plt_cm.sum(axis=1)[:, np.newaxis]
plt.imshow(plt_cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
tick_marks = np.arange(len(cm.classes))
plt.xticks(tick_marks, cm.classes, rotation=45)
plt.yticks(tick_marks, cm.classes)

fmt = '.2f' if normalize else 'd'
thresh = plt_cm.max() / 2.
for i, j in itertools.product(range(plt_cm.shape[0]), range(plt_cm.shape[1])):
    plt.text(j, i, format(plt_cm[i, j], fmt),
             horizontalalignment="center",
             color="white" if plt_cm[i, j] > thresh else "black")

plt.tight_layout()
plt.ylabel('Actual')
plt.xlabel('Predict')

and then this function can be used as follows:
cm = ConfusionMatrix(matrix={0:{0:13,1:0,2:0},1:{0:0,1:10,2:6},2:{0:0,1:0,2:9}})

plt.figure()
plot_confusion_matrix(cm,title='cm')
plt.figure()
plot_confusion_matrix(cm,title='cm(Normalized)',normalize=True)
plt.show()

for plot using seaborn and pandas see here


text:
Q: Prevent PhpStorm from arranging constructor arguments like a table The arguments of my constructor are written on different lines. When I press Ctrl+Alt+Shift+L to format code PhpStorm adds spaces to the shorter argument types so that the columns become of equal length.
I can't figure out which code style settings is responsible for that. I want to disable it.
What it does:
public function __construct(
    AdvertisingDetailsAdapter $advertisingDetailsAdapter,
    AdAccountService          $adAccountService,
    BusinessManagerService    $businessManagerService
)

What I want:
public function __construct(
    AdvertisingDetailsAdapter $advertisingDetailsAdapter,
    AdAccountService $adAccountService,
    BusinessManagerService $businessManagerService
)

A: I believe the relevant configuration toggle is shown on the picture


text:
Q: jsGrid включить или выключить checkbox в зависимости от значения переменной Есть стандартный код inline редактирования jsQgrid и в одной ячейке я сделал checkbox. Как можно сделать чтобы checkbox был активным, если в другой ячейке определённые данные и не активным, если данные другие? Пытался сделать вот так:
{name:'okb', width: 50, index:'okb',edittype: 'checkbox', sortable:false, editoptions: {value: "True:False"},formatter: "checkbox", formatoptions: {disabled: true},
        cellattr: function(rowId, value, rowObject, colModel, arrData) {
            var okb = rowObject[6];
            if (okb === 'Y') {
                return "formatoptions: {disabled: true}";
            }else{
                return "formatoptions: {disabled: false}";
            }
        }
    },

Но этот вариант не работает... Может быть ошибка в синтаксисе? Помогите пожалуйста! Заранее спасибо!


text:
Q: count rows with same date i got a table named date_use and has a column id & dateUSE.
id   dateUSE
1    2015-01-01
2    2015-01-01
3    2015-01-01
4    2015-01-02
5    2015-01-02

now if i will submit another date 2015-01-01 to this table using my php code, it will first count the rows that has the same date and if it is equals to 3 then the date 2015-01-01 that i selected will not be saved and will not be available to be selected.
i want to compare first the date i submitted then if that date has already inputted 3 times in the database then the date i submitted will not be available to be saved and i will just select other date.
just like in checking a reservation date availability, i will select a date then click a button then it will check first my database to see if that date was entered three times then the date i selected will not be available.

A: You should do this:
SELECT
  COUNT(*) AS Total
FROM tablenames
WHERE dateUSE = '$date';

Then in your php code, read this value for total if it is equal 3, then don't do the insert.

A: You need either a trigger for this or application level logic.  Here is an example of application-level logic:
insert into t(date)
    select '2015-01-01' as newdate
    from (select count(*) as cnt
          from t
          where date = '2015-01-01'
         ) x
    where x.cnt < 3;

A: You can try execute this in phpmyadmin if you have installed:
SELECT count(*) FROM date_use WHERE dateUSE='2015-01-02';

after this you will figure out how to implement this in script.


text:
Q: merge and display array of object data in table using react js I need to merge array1 and array2 , display in a table
    array1= [ {id: 1,event:party, oldcity: Singapore}
              {id: 2, event:fest,oldcity:Paris }]
    array2= [ {id: 1,event:party, newcity: bombay}
              {id: 2, event:fest,newcity:madras }]
output of merge array
mergearray= [ {id: 1,event:party,oldcity: Singapore,newcity: bombay}
              {id: 2, event:fest,oldcity:Paris,newcity:madras }]

display mergearray in table
  id    event oldcity   newcity
  1     party singapore  bombay
  2     fest  paris      madras

if i merge the array
 mergearray[{id: 1,event:party, oldcity: Singapore}
            {id: 2, event:fest,oldcity:Paris }
           {id: 1,event:party, newcity: bombay }
          {id: 2, event:fest,newcity:madras }]

but am expecting to be like this
mergearray= [ {id: 1,event:party,oldcity: Singapore,newcity: bombay}
          {id: 2, event:fest,oldcity:Paris,newcity:madras }]

A: How do you merge the arrays ?

const array1 = [{
  id: 1,
  event: 'party',
  oldcity: 'Singapore'
}, {
  id: 2,
  event: 'fest',
  oldcity: 'Paris'
}];
const array2 = [{
  id: 1,
  event: 'party',
  newcity: 'bombay'
}, {
  id: 2,
  event: 'fest',
  newcity: 'madras'
}];

// I would merge arrays this way
const mergedArray = [...array1, ...array2];

console.log('mergedArray: ', mergedArray);


text:
Q: Any way to get past Access-Control-Allow-Origin for development on my own server? I'm getting this JavaScript error

XMLHttpRequest cannot load http://foo.bar.no/API/map_tools/clean_addresses/check. Origin http://foo.bar.no:9294 is not allowed by Access-Control-Allow-Origin.

This is all on the same domain and the same server, but my JavaScript project is being hosted by a standalone server script that automatically bundles the JavaScript and it's dependencies into one file.
How do I get past this restriction while I'm developing?

I've tried allowing my JavaScript server script to connect. This is the result of a curl to the url:

HTTP/1.1 200 OK
Date: Wed, 11 Jan 2012 09:05:14 GMT
Server: Apache/2.2.16 (Debian)
Access-Control-Allow-Origin: http://foo.bar.no:9294
Vary: Accept-Encoding
Content-Length: 70
Content-Type: text/plain

array(1) {
  ["q"]=>
  string(31) "map_tools/clean_addresses/check"
}

And still I get the exact same error as I pasted above. Why does Chrome still refuse to connect to the damn URL when it's obviously allowed to!?

A: OK I figured it out. I was looking for a simple and quick fix since I only need the cross domain requests for development purposes. Turns out that I just had to set both
header("Access-Control-Allow-Origin: http://foo.bar.no:9294");
header("Access-Control-Allow-Credentials: true");

In my PHP script on Apache. Then in my JavaScript code:
# Set jQuery ajax to use 'withCredentials' globally
$.ajaxSetup({
    xhrFields: {
        withCredentials: true
    }
});

And that did the trick

A: Use your webserver's reverse proxy capabilities to proxy  http://foo.bar.no/API/map_tools/clean_addresses/check to http://foo.bar.no:9294/API/map_tools/clean_addresses/check.
So, as you use Apache, you should add something like
    <Proxy *>
            Order allow,deny
            allow from all
    </Proxy>

    ProxyPass /API/map_tools/ http://foo.bar.no:9294/API/map_tools/
    ProxyPassReverse /API/map_tools/ http://foo.bar.no:9294/API/map_tools/

to your vhost config

A: You can get around cross-domain security restrictions in chrome by starting it with the --disable-web-security flag.
E.g. (on OS X):
open /Applications/Google\ Chrome.app/ --args --disable-web-security


text:
Q: Numeric column is coerced to character column when another character column is modified I have a data frame with two columns, the first one contains numbers, the second one strings. My problem is: once I replace a string in the second column by another string, the first column is coerced from class numeric to character. Here is an example:
df <- data.frame(num = c(1,2), char = c("a", "b"), stringsAsFactors = F)
class(df$num) # "numeric"
class(df$char) # "character"
df[df$char == "a", ] <- "c"
class(df$char) # "character"
class(df$num) # "character" !!

What's the reason for this behavior and how to stop it?

A: I found my error: df[df$char == "a", ] <- "c" overwrites the whole row, which is why the first column is coerced. The correct way to replace "a" by "c" is: df$char[df$char == "a"] <- "c".

A: Look at df after you change it:
> df
  num char
1   c    c
2   2    b
>

So of course $num has become character.  Your command (because of its comma syntax) identified entire rows to be changed.
A different substitution command
df[df == "a"] <- "c"

does what you were expecting.


text:
Q: Trick C-compiler to assign whole struct to zero, without for-loop I am currently writing a small part of an embedded OS, where I some times need to assign all the variables in a large struct to 0. The elements range from uint8 to uint64.
As of now, the only thing I have gotten to work, is to loop through each of the types of variables, assigning each of them to 0, but this takes many cycles and the code is "ugly".
I was thinking if it was possible to make a pointer of the type of the struct, and then assigning the value of the pointed element to 0, as that element should have the size sizeof(MyStruct)?
The struct to assign to 0:
struct AMD64Context{
uint8_t fp_context[512] __attribute__((alligned(16)));
uint64_t rax;
....
....
};

A: Two "classic" methods:

*

*memset
AMD64Contex context;
memset(&context, 0, sizeof(context));

*initialization with {0}
AMD64Contex context={0};

Notice that the result is slightly different: in the first case, you are brutally zeroing all the memory, which guarantees that all the integral fields are zero and any padding that may be present is zeroed too. For FP values, the zeroing is not guaranteed by the standard (but it's so on any "normal" platform anyway; also, since you are writing an OS you surely know if on your platform an "all zero" FP value is actually zero).
The second one instead is guaranteed to zero the fields, but it's unspecified if it affects the padding. If you are not interested in the values of the padding, you should probably use this one - it's more succinct, and it's more obvious to the compiler what is the intent (so it may optimize this better).


text:
Q: Logout sinch user in iOS I'm working on call/video application. I'm using SINCH SDK and i successfully integrated in swift project and call video work fine but i have a problem that when user is logged out from application still received a notification, i don't know why i used this function to logout
func logOutSinchUser() {
    if let client = self._client {
        client.stopListeningOnActiveConnection()
        client.terminate()
        client.unregisterPushNotificationData()
    }

    self._client = nil
}

Anyone can help me please ?

A: Please try to unregister the push token first(unregisterPushNotificationDeviceToken if you use sinch managed push) before you terminate the sinch client.
Also use terminateGracefully instead, to give the SDK more time to handle the unregistration process before shut off.
Could be sth like:
func logOutSinchUser() {
    if let client = self._client {
        client.stopListeningOnActiveConnection()
        client.unregisterPushNotificationDeviceToken()
        client.terminateGracefully()
    }
    self._client = nil
}


text:
Q: Transversality of maps Let $X\xrightarrow{f} Y \xrightarrow{g} Z$ be a sequence of smooth maps of manifolds, and assume that $g$ is transverse to a submanifold $W$ of $Z$. Show $f\pitchfork g^{-1}(W) \leftrightarrow g\circ f \pitchfork W$.
From the definition of transverse,
$$\forall x \in g^{-1}(W), \text{im}d_xg + T_ZW = T_ZZ$$
Then I was trying to start the first side of the proof, $f\pitchfork g^{-1}(W) \rightarrow g\circ f \pitchfork W$, but I'm confused about $f \pitchfork g^{-1}(W)$. Does it mean
$$\forall x \in W, \text{im}d_xf + T_ZW = T_ZZ$$
I'm not sure where to go from there either.

A: No, first of all I'd suggest that you use letters to guide you to the locations of the points. Use $x$ for elements of $X$, $y$ for elements of $Y$, and $z$ for elements of $Z$. Next, your subscripts of $Z$ are incorrect. Maybe you want $x\in f^{-1}(g^{-1}(W))$, $f(x)=y$, and $g(y)=z$.
$f\pitchfork g^{-1}W$ means that for all $x\in f^{-1}(g^{-1}(W))$ we have $\text{im}(df_x) + T_{f(x)}(g^{-1}(W)) = T_{f(x)}Y$. But since $g\pitchfork W$, we have $T_y(g^{-1}(W)) = (dg_y)^{-1} T_{g(y)}W$. Note also that $(g\circ f)^{-1}(W) = f^{-1}(g^{-1}(W))$. Can you make some progress now?


text:
Q: Looking to edit X axis on histogram to show large values in R I have a variable, Avg_Salary, where the min is $16,970 and the max is $5,991,000. However, when I go to plot a histogram in R, it shows the values on the x and y axis in scientific notation it looks like. 0e+00, 1e+06, 2e+06, etc. How do I get it to show the numbers in the thousands and millions. Is it because they are too big to be displayed on the graph? Can I edit this to change my axis?
hist(rs$Avg_Salary, freq=F, xlab = "Avg_Salary", main = "Histogram of Avg_Salary")
![histogram][1]

A: You can pass the argument axes=F, and then make your own axis.
# plot your histogram without axes
hist(blah blah blah ,
    axes=F)

# plot the usual y-axis
axis(2)

# get the values where the ticks on the x-axis would normally be
ticks <- axTicks(1)

# format the tick labels (you could get fancy here)
lables_in_millions <- paste0(round(x / 1e6, 1), "M")

# add the x axis
axis(1,at=ticks,lables=lables_in_millions)

The only thing you need to change to use this method on an ordinary plot is to call box(), b/c axes=F will remove the box as well as the axis ticks and labels.


text:
Q: Fixed (Flexible) and Stretched (Expanded) elements in a Flex in Flutter In the Flutter layout system, I thought placing a Flexible and and Expanded in a Column would make the Flexible be the size of its children and the Expanded take up the whole remaining space. However, the Expanded does not fill up all of the remaining space and leaves some empty space that follows it.
Here is what I want to do:
+-----------------------------+
| Flexible, decides own size. |
+-----------------------------+
| Expanded, fills up the rest |
|                             |
|                             |
|                             |
|                             |
|                             |
|                             |
|                             |
|                             |
|                             |
+-----------------------------+

However, this is what happens instead:
+-----------------------------+
| Flexible, decides own size. |
+-----------------------------+
| Expanded, takes up only     |
| some of the remaining space |
| looks like about 50% of     |
| the whole parent            |
|                             |
|                             |
+-----------------------------+
| LOL here's unused space     |
| for no good reason          |
|                             |
+-----------------------------+

I was doubting myself, then I saw the same thing reported as a bug for a row: https://github.com/flutter/flutter/issues/20575
I guess my question is, how can I have a fixed-size widget (whose size is determined by its children), followed by a widget that takes up the rest of the parent?

A: Ok, the answer is just to omit the Flexible in the first one and just put its contents there. Then, the Expanded fills up the rest of the space just fine.
So the solution is this:
+------------------------------+
| Just put your self-sized     |
| widget here without Flexible |
+------------------------------+
| Expanded, fills up the rest  |
|                              |
|                              |
|                              |
|                              |
|                              |
|                              |
|                              |
|                              |
|                              |
+------------------------------+


text:
Q: Array de objetos em JAVA Fala galera beleza ?
Então, sou iniciante em desenvolvimento java e minha primeiro dúvida cruel que bati de frente em uma questão no curso foi a seguinte.
"Faça o cadastro dos dados de uma conta corrente ou uma conta poupança. Peça ao usuário para digitar cada informação solicitada. Apos inserir os dados, imprima o valor de cada atributo da classe instanciada.
Crie também os métodos Sacar, Depositar, Imprimir dados, Aplicar Rendimento.
Atributos:
Conta Corrente tem: Agencia, Nr_conta, Saldo, Nome do Titular, Limite;
Poupança: Agencia, Nr_conta, Saldo, Nome do Titular,rendimento;
Crie uma classe Principal com Void Main(),
Faça um menu para:
Menu
1 - Cadastrar Conta Corrente
2 - Cadastrar Poupança
3 - Saque de Conta Corrente
4 - Saque de Poupança
5 - Depósito em Conta Corrente
6 - Depósito em Poupança
7 - Saldo de Conta Corrente
8 - Saldo de Poupança
9 - Aplicação de Rendimentos na Poupança
10- para sair
Faça o diagrama de classe e o programa.
Deixe os atributos das classes como private, crie os metodos gets e sets.
Faça os demais métodos, conforme o menu."
Até ai tudo bem, fiz tudo corretamente, e o prof já corrigiu, depois ele me pediu o seguinte.
"Faça a questão acima e armazene cada objeto em um vetor.
Dica: como temos um vetor que é um conjunto de objetos, antes de realizar qualquer operação você deverá localizar, para assim realizar a tarefa. Crie também uma variável para controlar o índice, do último objeto armazenado.
Faça também o método informar a quantidade de conta corrente ou poupança cadastrados.
Limite o vetor a 20 posição para cada tipo de objeto."
package aula_21desafio;
import java.util.Scanner;
public class Programa {
public static void main(String[] args) {

    Scanner read = new Scanner(System.in);

    int opt;

    ContaCorrente[] cc = new ContaCorrente[20];
    ContaPoupança[] cp = new ContaPoupança[20];

    do {

        System.out.println("\tMenu\n");
        System.out.println("Escolha abaixo qual opção desejada:\n");
        System.out.println("1 - Cadastrar Conta Corrente");
        System.out.println("2 - Cadastrar Conta Poupança");
        System.out.println("3 - Sacar Conta Poupança");
        System.out.println("4 - Sacar Conta Corrente");
        System.out.println("5 - Depósito Conta Poupança");
        System.out.println("6 - Depósito Conta Corrente");
        System.out.println("7 - Saldo Conta Poupança");
        System.out.println("8 - Saldo Conta Corrente");
        System.out.println("9 - Aplicação de Rendimentos na Poupança");
        System.out.println("10 - Sair");
        System.out.print("Opção: ");

        opt = Integer.parseInt(read.nextLine());

        switch (opt) {

        case 1:
            System.out.println("Você escolheu conta corrente");

            System.out.println("Qual o seu nome? ");
            String nomeDoTitular = read.nextLine().trim();

            System.out.println("Digite o número da agência: ");
            String agencia = read.nextLine();

            System.out.println("Digite o número da conta: ");
            String numeroDaConta = read.nextLine();

            System.out.println("Qual o limite desejado? ");
            double limite = Double.parseDouble(read.nextLine().replace(",", "."));

            System.out.println("Digite um valor inicial a ser depositado: ");
            double saldo = Double.parseDouble(read.nextLine().replace(",", "."));

            for(int i =0;i<=cc.length;i++) {
            cc[i]= new ContaCorrente(nomeDoTitular, agencia, numeroDaConta, limite, saldo);
            cc[i].exibirInfos();
            break;
            }
            break;

Quando tento acessar qualquer indice diferente do 0, recebo NullPointerException, porque ele nao salva cada conta em cada indice ?

A: Você tem um break; dentro do loop, isso faz com que o loop seja interrompido na primeira iteração e seja adicionado apenas cc[0], retire essa quebra para adicionar a todos os índices do array
Mas por que preencher um array com os mesmos dados? Não faria mais sentido adicionar apenas um e, quando o usuário solicitar, adicionar outro
Observaçao: o padrão de nomenclatura do Java não usa acentos, ou seja, em vez de ContaPoupança coloque ContaPoupanca

A: Acredito que seu for esteja adicionando cc apenas na posição 0 por causa do break dentro. Porem se tirar o break serão criadas várias contas iguais no array.


text:
Q: Wordpress Page Buttons I have uploaded buttons to my front page in WordPress.org.  When you click on one of the buttons it takes you to another page.  all the buttons work perfectly.  However, I would like to create the effect of the button actually being pressed when clicked on.  What would be the best approach to create this effect in WordPress?

A: I think you're looking for :active
.myBtn:active {
    position:relative;
    top:1px;
}

Fiddle


text:
Q: do Carmo Differential forms and application Chapter 2 Exercise 6
Line integrals are quite useful in the study of complex functions $f:\Bbb C\to \Bbb C$. Here the complex plane $\Bbb C$ is identified with $\Bbb R^2$ by setting $z=x+iy$, $z\in\Bbb C$, $(x,y)\in\Bbb R^2$. It is convenient to introduce the complex differential form $dz = dx+idy$ and to write
$$ f(z) =u(x,y)+iv(x,y) = u+iv.$$
Then the complex form
$$f(z)dz = (u+iv)(dx+idy) = (udx-vdy)+i(udy+vdx)$$
has $udx-vdy$ as its real part and $udy+vdx$ as its imaginary part. Define
$$\int_c f(z) dz = \int_c(udx-vdy)+i\int_c(udy+vdx)$$
Assume that $u,v\in C^1$. Recall that $f$ is holomorphic if and only if $u_x = v_y, u_y = -v_x$

Question. If $f$ is holomorphic, the function $f'(z)$ (the derivative of $f$ in $z$) given by the equation $df:=du+idv = f'(z)dz$ is well defined and $f'(z) = u_x-iu_y$.
In the question I what should I check for well definedness?

A: Here is a complete answer. Write $f(x,y) = u(x,y) + i v(x,y)$. Then $u$ and $v$ are real valued function and:
\begin{align}
\mathrm{d}f &= \mathrm{d}u + i \mathrm{d}v & \text{by Do Carmo's definition } (":=")\\
&= \left(\frac{\partial u}{\partial x} \mathrm{d}x + \frac{\partial u}{\partial y}\mathrm{d}y\right) + i \left(\frac{\partial v}{\partial x} \mathrm{d}x + \frac{\partial v}{\partial y}\mathrm{d}y \right) & \text{by definition of partial derivatives}
\end{align}
Suppose now that $f$ is holomorphic, that is, according to Do Carmo, $\frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}$ and $\frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x}$. Then the last equality becomes:
\begin{align}
\mathrm{d}f &= \left(\frac{\partial u}{\partial x}\mathrm{d}x + \frac{\partial u}{\partial y}\mathrm{d}y \right) + i \left(-\frac{\partial u}{\partial y}\mathrm{d}x + \frac{\partial u}{\partial x}\mathrm{d}y  \right) \\
&=\left(\frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y} \right) \mathrm{d}x + \left(\frac{\partial u}{\partial y} + i \frac{\partial u}{\partial x} \right)\mathrm{d}y \\
&= \left(\frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y} \right) \mathrm{d}x + \left(\frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y} \right) i\mathrm{d}y \\
&= \left(\frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y} \right) \left(\mathrm{d}x + i \mathrm{d}y\right) \\
&= \left(\frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y} \right) \mathrm{d}z &\text{by definition of } \mathrm{d}z
\end{align}
Hence, writing $x+iy = z$ and defining $f'(z) = \frac{\partial u}{\partial x} - i \frac{\partial u}{\partial y}$, it follows that if $f$ is holomorphic, one can write $\mathrm{d}f = f'(z)\mathrm{d}z$.
Hence, if $f$ is holomorphic, the function $f'$ is uniquely determined by the relation $\mathrm{d}f = f'(z)\mathrm{d}z$: this is what is implicitly suggested by "well defined" I guess.


text:
Q: Как получить текущее время с помощью функции NOW в timestamp witchout time zone без миллисекунд? Записываю текущее время в поле с типом timestamp witchout time zone вот таким способом:
SELECT NOW();
Проблема в том что выводятся миллисекунды

А они не нужны.
Вопрос как получить timestamp witchout time zone без миллисекунд? нужно получит вот такой формат:

A: надо подрезать последнюю секунду:
SELECT date_trunc('seconds', now()::timestamp);


text:
Q: Swift passing data between views I am working on a Swift app and I've run into a slightly weird issue.  I'm quite new to Swift and iOS development so think I may not be doing this the correct way.
I have a UITableView and I am able to read the contents of the selected cell without issue:
override func tableView(_ tableView: UITableView, didSelectRowAt
indexPath: IndexPath) {
    let cell = self.tableView.cellForRow(at: indexPath)
    selectedItem = (cell?.textLabel?.text)!
}

I have a variable set at the top of my class like so:
var selectedItem: String = String()

I then use a prepare for seque to seque to the new page/view and pass in the data selected:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "showDetails"
    {
        if let destinationVC = segue.destination as? ItemDetails {
            destinationVC.detailsToDisplay = selectedItem
        }
    }
}

The problem is that while the data does get passed between the views and appears in the UI, it's not the most recent data.  For example when I run the code and select the item, the first time, nothing appears, but if I click the back button, select the item again, this time it does appear in the next view.  And on subsequent selections in the UI, it navigates to the next view but doesn't update the text until I pick another item.
In my mind it's almost like the selectedItem variable is not being set on each selection as I expect and passed through, but instead on subsequent selections in the UI, it is updated.
How do I get this to pass the actual correct item each time and not the previous one or none at all (which is what happens on the first run).
Thanks!

A: Your prepare for segue called before the didSelectRow at index
change the code like below
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "showDetails"
    {
        if let destinationVC = segue.destination as? ItemDetails {

let cell = tableView.cellForRowAtIndexPath(self.tableView.indexPathForSelectedRow!) as UITableViewCell

destinationVC.detailsToDisplay = (cell.textlabel?.text)!

        }
    }
}

A: If you want to pass data between controllers, you can create a global variable declared above the class. Store the result in that global variable.
For example,
In ViewController class:
var result:String!
class ViewController:UIViewController{
result = // your data }

In SecondViewController class:
class SecondViewController:UIViewController{
var fetch = result
if(fetch != result){
print("Got the value")
}
else
{
print("Null value")
}


text:
Q: WPF XAML Grid Visibility Trigger I have a status message located on the first row of my grid and I want it to slide in and out when the visibility changes.
The first visibility trigger works great and slides the first grid row open quickly. As soon as I add the 'Collapsed' trigger, nothing works at all. How do I reverse the animation to slide closed when the visibility is set to collapsed?
<Grid Grid.Row="0" Height="55" Visibility="{Binding StatusMessageVisibility, Mode=TwoWay}">
    <Grid.Style>
        <Style TargetType="Grid">
            <Style.Triggers>
                <Trigger Property="Visibility" Value="Visible">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" From="0" To="55" Duration="0:0:.1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
                <Trigger Property="Visibility" Value="Collapsed">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" From="55" To="0" Duration="0:0:.1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Grid.Style>
    <TextBlock Text="Hi There" />
</Grid>

A: You should remove the Visibility binding in your grid and use a DataTrigger that binds to the StatusMessageVisibility property. If you bind the grid's visibility then once it's collapsed it's collapsed and you won't be able to see the animation.
Also, instead of having two data triggers with EnterActions, use a single data trigger that also has an ExitAction for the collapsed state:
<Grid Grid.Row="0" Height="55">
    <Grid.Style>
        <Style TargetType="Grid">
            <Style.Triggers>
                <DataTrigger Binding="{Binding StatusMessageVisibility}" Value="Visible">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" From="0" To="55" Duration="0:0:.1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Height" From="55" To="0" Duration="0:0:0.1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Grid.Style>
    <TextBlock Text="Hi There" />
</Grid>


text:
Q: How to get back my Laravel Hashed Password? I already saved my Password as hashed password in database and how to get password in original format?
My Password is:
 $2y$10$WASUjz4XeyjusUI5M7PY3.6vUNOofzMUiVEH/7agw6Gf4JQCWVwiy

A: You cannot decrypt laravel password hash which is bcrypt. You can change it with new password.
And apply comparisons like this
Edit
You can get the hashedPassword like this:
$hashedPassword = Auth::user()->getAuthPassword();

And check like this:
if (Hash::check('password', $hashedPassword)) {
    // The passwords match...
}


text:
Q: How to remove url query string in htaccess I have this url:
http://www.example.com/?option=com_php&Itemid=1&ep=3&lang=us
I want to this url:
http://www.example.com/?ep=3&lang=us
How to remove this line option=com_php&Itemid=1& in htaccess?
I have read many responses on this subject and I searched the web, but unfortunately no solution works. Please help me :)

A: Put these lines in your .htaccess file:
Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^option=([^&]+)&Itemid=([^&]+)&(ep=[^&]+)&(lang=[^&]+)$ [NC]
RewriteRule . %{REQUEST_URI}?%3&%4 [L,R]


text:
Q: Textures not drawing if multiple EAGLViews are used I'm having a bit of a problem with Apples EAGLView and Texture2D. If I create an instance of EAGLView and draw some textures, it works great. However, whenever I create a second instance of EAGLView, the textures in the new view(s) aren't drawn.
Being new to OpenGL, I've got absolutely now clue as to what is causing this behavior. If somebody would like to help, I've created a small project that reproduces the behavior. The project can be found at http://www.cocoabeans.se/OpenGLESBug.zip
Many thanks,
Tim Andersson
Update
I tried using sharegroups but I'm not really sure if I used them correctly. However, it did change the behavior slightly; instead of the texture drawing only in the first instantiated view, it now draws the texture in the last instantiated view and draws white rectangles in the other views. I don't know if that is better or worse, but at least something is showing up in the other views now.
This is driving me crazy and I would be very grateful if somebody could help me with this problem. I've updated the project at http://www.cocoabeans.se/OpenGLESBug.zip to reflect the changes.
Cheers,
Tim
Second Update
After trying some more things, it seems that the problem is related to Apple's Texture2D class, though I'm not sure exactly what is causing the behavior. I think the best thing to do is to write my own texture class (it will help me understand how OpenGL handles textures, which will probably come in handy).

A: (Haven't downloaded your code.)
The OpenGL drawing contexts are different if you just use two EAGLViews (the code in that base class creates and owns the GL context as well as render/frame/depth buffers). If you generate/bind some textures in one context, they won't be available in the other. You can share contexts if you like using a sharegroup (see this question for more: How to use OpenGL ES on a separate thread on iphone?). Or define the textures (if small) in both places, etc.


text:
Q: Rails 5: Fastest way to fetch huge records in select I have a Rails application which loads more than 2k registers from a model on a select with cocoon for association. I'm already use select2 jQuery plugin to scroll it and search the topics, but it loads very slowly.
<%= f.select :subject_id, options_for_select(Subject.all.map{ |c| [c.name, c.id, {}] }, f.object.subject_id), {include_blank: 'Select a subject'}, {required: true, class: "select2 "} %>

This model load more than 2k registers from model and makes select load slowly, what's is the best practice to load the register more quickly from model for user?

A: You should consider using a javascript plugin such as Select2, which will enable you to search through your associations with a remote ajax call. You can see Select2 ajax in action here https://select2.org/data-sources/ajax.
Then, you'll need to initialize select2 in javascript and make sure your registers controller responds to json (you should also paginate these results, with e.g. the Kaminari gem).
Any time you are adding a reference to an association that may contain many records, you'd want to use this remote method for selecting the records.
If you find that you have many associations that need this same remote lookup behavior, you can use a gem such as SimpleForm to help make a reusable custom input that handles setting up this behavior for you.

A: You should never load 2k records at once from the DB, your data has to be paginated/limited per request. You will have Ruby performance issues (memory issues) and your JS will perform very bad.
One possible solution is to move the records from your SQL to Redis. Because Redis is faster. Then fetch the data from Redis.
To handle large data sets in Select2 follow this plnkr: http://embed.plnkr.co/db8SXs/preview

A: I got a solution with parameters of Select2. I made it start the search only after type at last 3 digits. This way it not be slow anymore with a huge of data.
$(".select2").select2({
          width: '100%',
          placeholder: 'Start ',
          minimumInputLength: 2,
          tags: true
        });


text:
Q: 'noun + likely to + verb' and 'likely to + verb + noun' Are the following sentences grammatically correct? If yes, which one does sound more idiomatic?

*

*Modularization by design decision likely to change.

*Modularization by likely to change design decision.

The meaning that I want to convey is the following. In a system, all design decisions can be changed, but it is impossible that they are equally easy to change. So when designing a system, the designer should identify the design decisions that are likely to change and make them easy to change by confining them in single modules. This is a criterion, known as information hiding, for decomposing a system into modules.

A: Based on this comment, my understanding is that the intended meaning is:

We want to organize the software architecture into modules by separating the concerns of various design decisions, all of which are subject to change (so that such changes affect as small a scope as possible).

If that's true, the first option is unclear: "likely to change" could modify either "modularization" or "design decision."
The second option seems to attempt the right meaning, but it really ought to use hyphens: "Modularization by likely-to-change design decision." Which is still pretty unwieldy and unclear.
If it's okay to use full sentences, I would suggest something like: "Modularization aligns with design decisions which are likely to change."


text:
Q: How to share a Windows 7 folder with vmplayer guest? The docs say this :

Check permission settings. Permission settings on the host computer
  determine access to files in the shared folder. For example, if you
  are running VMware Player as a user named User, the virtual machine
  can read and write files in the shared folder only if User has
  permission to read and write them.

My host is Windows 7. I am running another Windows 7 guest under the username Fake. According to the docs, I have to share my intended folder, say c:\share, by giving Fake the read permission, no? But I am unable to do that as the host says no such user is found. What am I doing wrong?
Daniel.

A: Ensure you have a matching user name ("Fake") and password on the share's host computer. Then you can apply the share/file access to that user account.
Check out:

*

*How to share folders in home network in Windows 7 like we did in Windows XP?

*How can I access a shared folder from VMware workstation?

*Windows 7 Professional Network Sharing Permissions


text:
Q: Is there a way to show a message from a Composer repository? If I had a Composer repository (not a Composer package or a Git repository) that lists packages and that people could include in their composer.json under the repositories section, would it be possible to display a message from the owners of the repository?
So, for example, if I have a repository at example.com/packages.json and a user adds the following to their project's composer.json:
"repositories": [
        {
            "type": "composer",
            "url": "https://example.com"
        }

how would I add something to my packages.json that says "Hello, this is the example.com repository"?

A: There is indeed a way.
You can decide whether you want to display an "info" or a "warning" message and then set either "info" or "warning" in packages.json to the message that you want to be displayed.
Then you also need to set either "info-versions" or "warning-versions" to the versions of Composer for which you want to display the message. If you want to display it for all versions of Composer, you could use >=0.0.0.
If you're interested, the source code where Composer calls a function called outputWarnings to display the messages is here.
The message(s) will be displayed every time you run a Composer command that needs to fetch packages from the repository, including composer install, composer update and composer require.
Here is an example packages.json file that will display both a warning and an info message:
{
    "packages": {},
    "warning": "Warning message",
    "warning-versions": ">=0.0.0",
    "info": "Info message",
    "info-versions": ">=0.0.0"
}

I've added this file to a gist. You can try it out by adding it as a repository to your composer.json file and then running composer install:
    "repositories": [
        {
            "type": "composer",
            "url": "https://gist.githubusercontent.com/delenamalan/3c0d998a316031af8f0f9c0165eacc28/raw/491d2716bb8d36fea562633f2384340f560aceb6"
        }
    ],

Here is an example output:
$ composer install
Loading composer repositories with package information
Warning from https://gist.githubusercontent.com/delenamalan/3c0d998a316031af8f0f9c0165eacc28/raw/491d2716bb8d36fea562633f2384340f560aceb6:
Warning message
Info from https://gist.githubusercontent.com/delenamalan/3c0d998a316031af8f0f9c0165eacc28/raw/491d2716bb8d36fea562633f2384340f560aceb6:
Info message
Updating dependencies (including require-dev)


text:
Q: React App running on Node/Express not rendering after transpile with Webpack. I am trying to serve my React app on top of Node/Express after transpiling with Webpack. I've used create-react-app, but want learn to build from scratch so am new to using Node/Express/Webpack. After going through various tutorials, I am stuck trying to render React elements after transpiling with Webpack (Only HTML is being served).
I also run the following commands to create my bundle.js file and navigate to localhost:3000
-npm run webpack
-node server.js
<!doctype html>

    <title>React App</title>

This is from the HTML file

My webpack.config.js is currently...
var webpack = require('webpack')
var path = require('path')

module.exports = {
  entry: [
    './src'
  ],
  output: {
    path: path.join(__dirname, 'public'),
    filename: 'bundle.js'
  },
  module: {
    loaders: [{
      test: /\.js$/,
      exclude: /node_modules/,
      loader: 'babel-loader',
      query: {
        presets: ['react', 'es2015']
      }
    }]
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoEmitOnErrorsPlugin()
  ]
}

My server.js file is as follows...
var express = require('express')
var path = require('path')
var fs = require('fs')

var app = express()

var PORT = process.env.PORT || 3000

app.set('view engine', 'html')

app.engine('html', function(path, options, callbacks) {
  fs.readFile(path, 'utf-B', callback)
})

app.use(express.static(path.join(__dirname, 'public')))

app.get('*', function(req, res) {
  res.sendFile(path.join(__dirname, 'public'), 'index.html')
})

app.use(function (err, req, res, next) {
  res.status(err.status || 500)
})

app.listen(PORT, function() {
  console.log('Server running on localhost:' + PORT)
})

And my App.js only contains the follow React elements:
import React, { Component } from 'react'

class App extends Component {

  render() {
    return (

This is the main App

    )
  }
}

export default App

Also, my package.json
{
  "name": "poke-mean",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "NODE_PATH=$NODE_PATH:./src node server",
    "dev": "npm start & webpack-dev-server --progress --colors",
    "webpack": "webpack"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.15.3",
    "react": "^15.5.4",
    "react-dom": "^15.5.4",
    "react-router-dom": "^4.1.1"
  },
  "devDependencies": {
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "webpack": "^2.6.1",
    "webpack-dev-server": "^2.4.5"
  }
}


text:
Q: How do I stop PuTTY becoming unresponsive to input when displaying large amounts of text? I use a windows 7 machine to ssh into a remote Linux machine using PuTTY 0.62. When I accidentally forget to stream the output to a file and run a program that prints a lot of data to the screen I find that putty becomes unresponsive to Ctrl+C and I just have to wait 5 minutes before my keystroke to be registered.
Is there any way to limit the incoming data rate so I can still send keystrokes to the remote machine in the event that I get myself in this situation again?
I should add that it's not really PuTTY per se becoming unresponsive, but it's just not sending keystrokes, presumably because network throughput is being gobbled up by millions of lines of text being displayed on the screen.
I am using tmux, and the session is equally slow to respond to Ctrl+b as to any other command.

A: If you're using a router that allows you to provide traffic shaping, you could set the inbound SSH traffic rate (port 22 or whatever port you're using for the remote host) to be something slightly less than the max line rate on your windows 7 host.  That way, your putty session will be able to shove ctrl+C (or other commands) into the remote host.
I'm not sure how to do traffic shaping or QoS on windows 7, but I'm sure there are apps that will allow you to accomplish something similar on your host.
Finally, you can use Enter, ~,. to escape the session, and then send a Enter, ~,B (send break) but I'm not sure if that will help your problem... worth a shot.  Please let us know if it works!


text:
Q: Iterate user input and convert to binary I am doing a Binary counter program. I need it to print a decimal equivalent and the corresponding binary equivalent....
so far I have managed to get this  far , but I need to convert the binary from 0 up to the user input value, I have been playing around with it but I can't figure it out: Any help is appreciated :)
Please enter number: 12

Decimal: 1  = binary: 1100
Decimal: 2  = binary: 1100
Decimal: 3  = binary: 1100
Decimal: 4  = binary: 1100
Decimal: 5  = binary: 1100
Decimal: 6  = binary: 1100
Decimal: 7  = binary: 1100
Decimal: 8  = binary: 1100
Decimal: 9  = binary: 1100
Decimal: 10  = binary: 1100
Decimal: 11  = binary: 1100
Decimal: 12  = binary: 1100

From this code
dec = input('Please enter number')

new_list = []
index = 0
output = ''
counter = 0
dec = int(dec)
upper_range = int(dec)

#for x in range(0,upper_range):

while dec > 0:
        output += str(dec % 2)
        dec = (dec // 2)
output = output[::-1]

new_list.append(output)

while counter < upper_range:
    print('Decimal:', counter + 1, end=' ',)
    print(' = binary:' , *new_list)
    counter = counter + 1

A: You should do the decimal-to-binary conversion inside the loop instead; otherwise it only does the conversion of the upper bound value:
dec = input('Please enter number')

counter = 1
upper_range = int(dec)

while counter <= upper_range:
    binary = ''
    dec = counter
    while dec > 0:
        binary += str(dec % 2)
        dec = (dec // 2)
    binary = binary[::-1]
    print('Decimal:', counter, end=' ',)
    print(' = binary:' , binary)
    counter = counter + 1

A: I think this might answer your question.You can take help of built-in bin function or you can do it manually using the below convTobin method.
    #This is with the help of built-in
    n = int(input())
    for i in range(n+1):
        print('Decimal: ',i,' Binary: ',bin(i).split('b')[1]);

   #This is doing it manually
    n = int(input())

    def convTobin(num):
        if num == 0:
            return '0'
        s = ''
        while num:
            s = str(num&1) + s
            num = num>>1
        return s

    for i in range(n+1):
        print('Deciaml: ',i,'Binary: ',convTobin(i))

A: n = int(input("Please enter number:"))
for i in range(1,n+1):
print "Decimal: "+str(i)+" = binary: "+str(format(i,'04b'))


text:
Q: Regex with path? While I am doing iOS development, I find it useful to open the following file:
/Users/disappearedng/Library/Application Support/iPhone Simulator/6.1/Applications/B957F50E-CF57-4797-AA14-C580F5596E56/Documents/MyApp.sqlite

currently I have the following aliased in my bash_profile:
alias cdi='cd /Users/disappearedng/Library/Application\ Support/iPhone\ Simulator/6.1/Applications'

The reason why I have to stop here is because every new install of the app on my iOS simulator the hash, B957F50E-CF57-4797-AA14-C580F5596E56, will change.
Does anyone know of a good way to alias this so that I can alias the following to a command in my bash_profile?
'/Users/disappearedng/Library/Application Support/iPhone Simulator/6.1/Applications/<any-hash>/Documents/*.sqlite'

I tried using wildcard for the has but the existence of the .DS_Cache file in the folder has cause this to fail.

A: This is obviously only something you want during development when running in the simulator. Why not have your app, on startup, get the path to the file and then write the path to a file in your home directory. Update your .bash_profile to source this file.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
#if TARGET_IPHONE_SIMULATOR
    NSString *sqlitePath = ... // path to the Documents folder
    NSString *command = [NSString stringWithFormat:@"alias cdi='cd %@'", sqlitePath];
    [sqlitePath writeToFile:@"/Users/disappearedng/.sqlitePath" atomically:YES encoding:NSUTF8StringEncoding error:nil];
#endif
}

Then in your .bash_profile, do:
. ~/.sqlitePath

A: How about:
find /Users/disappearedng/Library/Application Support/iPhone Simulator/6.1/Applications/.{38}/Documents/MyApp.sqlite | xargs <your_text_editor>

A: If there are more than one matching directories, and you want to enter the newest one, use this script:
cd "$(find "/Users/disappearedng/Library/Application Support/iPhone Simulator/6.1/Applications/" -name '*.sqlite' -type d -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")"

A: You can try adding .DS_Cache to the FIGNORE shell parameter. That way, the wild card should match just one directory, and the cd will still work. In your .bashrc file:
# To avoid adding .DS_Cache multiple times, just to be safe
[[ $FIGNORE =~ .DS_Cache ]] || FIGNORE="$FIGNORE:.DS_Cache"


text:
Q: Why is it when I debug my table which is an Actor in my stage the widget orientation is mirrored I am using the libgdx scene2d.ui library to create a stage and a table as the Actor. I have created a FitViewport using final variables for the width and height. I am also using the FillViewports OrthographicCamera. when I run debug on my table the Widgets cells are mirrored to the rest of the cells.
I have read the documentation and the wiki on scene2d.ui and as much as I can find on widgets, tables, stages and nothing relating to my issue. I thought maybe it was a scaling thing like if the widgets were larger then the cell bounds but I've scaled the widgets down with minWidth and perfWidth nothing changes. I've tried different view ports, tried a separate Orthographic camera and tried different skins all resulting in the same thing and its like this on all my screens
[]
everything seems to be working correctly but my OCD is driving me nuts over this. if anyone could give me some incite that would be awesome. or just tell me that its a glitch in the matrix and its not going to cause issues down the road and to move on with my coding.
This is my gameScreen Manager code
package com.armadillo.game.screens;

import com.armadillo.game.Arma;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;

public class GameScreenManager {
    private Arma game;
    //viewport variables
    protected Viewport screensViewport;
    protected Viewport playViewport;

    //screen variables
    private LoadingScreen loadingScreen;
    private MenuScreen menuScreen;
    private PlayScreen playScreen;
    private OptionsScreen optionsScreen;
    private HighScoreScreen highScoreScreen;
    private PauseScreen pauseScreen;
    private GameOverScreen gameoverScreen;

    //screen switch values
    public final static int MENU = 0;
    public final static int PLAY = 1;
    public final static int OPTIONS = 2;
    public final static int HIGH_SCORE = 3;
    public final static int PAUSE = 4;
    public final static int GAMEOVER = 5;

    public GameScreenManager(Arma game) {
        this.game = game;
        //create and apply viewport with a OrthographicCamera centered to the viewport
        screensViewport = new FitViewport(Arma.GAME_WORLD_WIDTH , Arma.GAME_WORLD_HEIGHT );
        screensViewport.apply(true);

        //create, set and initiate the screen to loadingScreen
        loadingScreen = new LoadingScreen(this.game, this);
        this.game.setScreen(loadingScreen);

    }

    //method used to switch states of screens
    public void changeScreen(int screen) {
        switch (screen) {
            case MENU:
                if (menuScreen == null)
                    menuScreen = new MenuScreen(this.game, this);
                this.game.setScreen(menuScreen);
                break;
            case PLAY:
                if (playScreen == null)
                    playScreen = new PlayScreen(this.game, this);
                this.game.setScreen(playScreen);
                break;
            case OPTIONS:
                if (optionsScreen == null)
                    optionsScreen = new OptionsScreen(this.game, this);
                this.game.setScreen(optionsScreen);
                break;
            case HIGH_SCORE:
                if (highScoreScreen == null)
                    highScoreScreen = new HighScoreScreen(this.game, this);
                this.game.setScreen(highScoreScreen);
                break;
            case PAUSE:
                if (pauseScreen == null)
                    pauseScreen = new PauseScreen(this.game, this);
                this.game.setScreen(pauseScreen);
                break;
            case GAMEOVER:
                if (gameoverScreen == null)
                    gameoverScreen = new GameOverScreen(this.game, this);
                this.game.setScreen(gameoverScreen);
                break;
        }
    }
}

this is my Options Screen code
package com.armadillo.game.screens;

import com.armadillo.game.Arma;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Event;
import com.badlogic.gdx.scenes.scene2d.EventListener;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.*;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

public class OptionsScreen implements Screen {
    //passed through variables
    private Arma game;
    private GameScreenManager gsm;

    //screen layout variables
    private Stage stage;
    private Table table;
    private Skin skin;
    private TextButton mainMenu;

    //Label variables
    private Label titleLabel;
    private Label volumeMusicLabel;
    private Label musicEnabledLabel;
    private Label volumeSoundLabel;
    private Label soundEnabledLabel;

    //slider and CheckBox variables
    private final Slider musicVolSlider;
    private final Slider soundVolSlider;
    private final CheckBox musicCheckBox;
    private final CheckBox soundCheckBox;

    public OptionsScreen(Arma game, GameScreenManager gsm) {
        this.game = game;
        this.gsm = gsm;

        //create the stage using screenViewport parameters
        stage = new Stage(gsm.screensViewport);
        table = new Table();
        table.top();
        table.setDebug(true);
        stage.addActor(table);

        //create the skin that will used for layout design
        skin = new Skin(Gdx.files.internal("skin/neon-ui2.json"));

        //create labels
        titleLabel = new Label("Options", skin);
        volumeMusicLabel = new Label("Music Volume", skin);
        musicEnabledLabel = new Label("Music", skin);
        volumeSoundLabel = new Label("Sound Volume", skin);
        soundEnabledLabel = new Label("Sound", skin);
        mainMenu = new TextButton("Main Menu", skin);

        //create and set Music and sound slider to adjust volume of the music
        musicVolSlider = new Slider(0, 1, 0.1f, false, skin);
        musicVolSlider.setValue(game.getOptions().getMusicVolume());
        soundVolSlider = new Slider(0, 1, 0.1f, false, skin);
        soundVolSlider.setValue(game.getOptions().getSoundVolume());

        //create and set music and sound CheckBox to controll music on and off
        musicCheckBox = new CheckBox("ON/OFF", skin);
        musicCheckBox.setChecked(game.getOptions().isMusicEnabled());
        soundCheckBox = new CheckBox("ON/OFF", skin);
        soundCheckBox.setChecked(game.getOptions().isSoundEnabled());

        //sets the table size to its parent which is the stage
        table.setFillParent(true);

        //add labels sliders and checkBox's to table
        table.add(titleLabel);
        table.row();

        table.add(musicEnabledLabel);
        table.add(musicCheckBox);
        table.row();

        table.add(volumeMusicLabel);
        table.add(musicVolSlider);
        table.row();

        table.add(soundEnabledLabel);
        table.add(soundCheckBox);
        table.row();

        table.add(volumeSoundLabel);
        table.add(soundVolSlider);
        table.row();

        table.add(mainMenu).size(320, 60);

    }

    @Override
    public void show() {
        //set the stage to accept input
        Gdx.input.setInputProcessor(stage);

        //takes input from user and activates skin changes
        mainMenu.addListener(new ChangeListener() {
            @Override
            public void changed(ChangeEvent event, Actor actor) {
                gsm.changeScreen(gsm.MENU);

            }
        });

        //an input from user to register sliders and checkboxes
        musicVolSlider.addListener(new EventListener() {
            @Override
            public boolean handle(Event event) {
                game.getOptions().setMusicVol(musicVolSlider.getValue());
                return false;
            }
        });

        soundVolSlider.addListener(new EventListener() {
            @Override
            public boolean handle(Event event) {
                game.getOptions().setSoundVol(soundVolSlider.getValue());
                return false;
            }
        });

        musicCheckBox.addListener(new EventListener() {
            @Override
            public boolean handle(Event event) {
                boolean enabled = musicCheckBox.isChecked();
                game.getOptions().setMusicEnabled(enabled);
                return false;
            }
        });

        musicCheckBox.addListener(new EventListener() {
            @Override
            public boolean handle(Event event) {
                boolean enabled = soundCheckBox.isChecked();
                game.getOptions().setSoundEnabled(enabled);
                return false;
            }
        });

    }

    @Override
    public void render(float delta) {
        //sets background color and clears screen
        Gdx.gl.glClearColor(0, .1f, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

        //draws the stage and all its components
        stage.act(Gdx.graphics.getDeltaTime());
        stage.draw();
    }

    @Override
    public void resize(int width, int height) {
        //updates viewport and camera adjusting sizes locally
        stage.getViewport().update(width, height, true);

    }

    @Override
    public void pause() {

    }

    @Override
    public void resume() {

    }

    @Override
    public void hide() {

    }

    @Override
    public void dispose() {
        //dispose of the stage helps with memory leaks and garbage collection
        stage.dispose();

    }
}

and this is my main class Arma
package com.armadillo.game;

import com.armadillo.game.screens.*;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class Arma extends Game {
    //the game world size
    public static final int GAME_WORLD_WIDTH = 1600;
    public static final int GAME_WORLD_HEIGHT = 900;

    //assetmanger for music sound
    public static AssetManager manager;

    //Options object used to access option preferences
    private GameOptions options;

    //entity variables
    public SpriteBatch batch;
    public BitmapFont font;
    public OrthographicCamera camera;
    public Texture img;

    private Music music;

    @Override
    public void create() {
        //create entities
        batch = new SpriteBatch();
        font = new BitmapFont();
        manager = new AssetManager();
        options = new GameOptions();
        manager.load("audio/music.wav", Music.class);
        manager.finishLoading();
        music = manager.get("audio/music.wav", Music.class);

        //create and initiate the GameScreenManager
        GameScreenManager gsm = new GameScreenManager(this);
    }

    public GameOptions getOptions() {
        return this.options;
    }

    @Override
    public void render() {
        super.render();
        //constantly check audio options
        music.setVolume(options.getMusicVolume());
        if (options.isMusicEnabled()) {
            music.play();
        } else if (!options.isMusicEnabled()){
            music.stop();
        }

    }

    @Override
    public void dispose() {
        //dispose of the stage, batch and manager. helps with memory leaks and garbage collection
        batch.dispose();
        music.dispose();
        manager.dispose();

    }
}

A: This has been fixed in LibGDX v1.10.0 (based on my testing). I don't see relevant information in the changelog; probably was too minor to bother mentioning? Or just incidentally cleaned up somehow.
https://libgdx.com/news/2021/04/gdx-1-10


text:
Q: filter data based on group completion data I have a table which contains groups of scheduled programs. Each group is represented by group_id and each program in the group depends on previous program to complete. But, I don't need to schedule anything if all the programs in that group are completed. So, I need to filter data if a group containing programs are all completed. order defines the order of the programs that need to be scheduled
id, group_id, trigger_group_id, trigger,  order
1    1         NULL             SCHEDULED  0
2    1         1                COMPLETED  1
3    1         1                SCHEDULED  2
4    2         NULL             COMPLETED  0
5    2         1                COMPLETED  1

How to filter data such that group 2 rows are not returned using mysql?

A: Select the last row of a group in a correlated subquery and compare the trigger value:
select *
from mytable t
where 'SCHEDULED' = (
  select `trigger`
  from mytable t2
  where t2.group_id = t.group_id
  order by t2.id desc
  limit 1
)

Demo: http://sqlfiddle.com/#!9/976d5/1


text:
Q: XLRD doesn't seem to be finding my variable inside the file I'm brand new to python and I'm trying to read an .xls file and look at the first column of each row to see if it matches my variable. I'm not sure what I'm doing incorrectly and hoping someone can help me out. My end goal is to find each row that starts with this variable in it's first column and then delete the rest of the rows or write those rows to another file. Here is what I've been working with:
import xlrd

file_location = "C:/Users/Administrator/Desktop/Test.xls"
workbook = xlrd.open_workbook(file_location)
sheet = workbook.sheet_by_index(0)

mid=5348120284087186

for row in range (sheet.nrows):
    var1=''+sheet.cell_value(row, 0)
    if var1==mid:
        for col in range(sheet.ncols):
            print sheet.cell_value(row, col)

This is what I've been using to attempt a test to see if it can initially find the rows that match the ID. var1 syntax was suggested by a friend to cheat the cell_value into a string. I can view the xls file and know the variable is there on multiple rows, but this doesn't result in anything. I have also tried a simpler variation where it just checks the variables and then prints the first cell_value but still results with no output. Thanks in advance for any insight
EDIT:
As suggested, I adjusted my recursion to what I understood needed to be changed to this:
for row in range (sheet.nrows):
    var1=str(sheet.cell_value(row, 0))
    if var1==str(mid):
        for col in range(sheet.ncols):
            print sheet.cell_value(row, col)

However, this is still resulting in no output in IDLE when testing

A: You say

var1 syntax was suggested by a friend to cheat the cell_value into a string.

Which implies that var1 is a string type.
However, you are comparing it with mid, which is not a string type.  Therefore var1 == mid will always evaluate to false.  Ensure your variables are of the same type before comparing.
Additionally, the syntax you use for var1 is gross.  If you really want a string out of it, just use var1 = str(sheet.cell_value(row, 0)).
Troubleshooting these sorts of problems can be greatly aided with the following:
for row in range (sheet.nrows):
    var1=str(sheet.cell_value(row, 0))

    print mid, var1, mid==var1, type(mid), type(var1)

    if var1==str(mid):

If you are concerned about superflous spaces, do
var1 = str(sheet.cell_value(row,0)).strip()


text:
Q: How can I roam Sublime Text settings but not roam the open files? I have a portable install of sublime text 2 that I sync across machines with skydrive. Roaming the settings through the cloud is great, but when it roams my open files it wrecks things. (because the files don't exist across machines) I definitely want it to remember my open files, but I'd like it to only do it per-machine instead of saved in the cloud. Is that possible?

A: Excluding the .sublime_session file(s) in /Data/Settings should probably do the trick for you. In fact, I think you can go ahead and exclude the entire /Data/Settings folder.

A: I've got that set up by making hard links from the sublime configuration folders to my dropbox folder.
I have a powershell script that, among other things, links the various files:
# initialize the sublime preferences
md "$env:appdata/Sublime Text 2/Settings/" -ea SilentlyContinue
ln "$env:appdata/Sublime Text 2/Settings/License.sublime_license" "$HOME/Dropbox/profile/st2/Settings/License.sublime_license"
md "$env:appdata/Sublime Text 2/Installed Packages/" -ea SilentlyContinue
ln "$env:appdata/Sublime Text 2/Installed Packages/Package Control.sublime-package" "$HOME/Dropbox/profile/st2/Installed Packages/Package Control.sublime-package"
new-junction "$env:appdata/Sublime Text 2/Packages/User" "$HOME/Dropbox/profile/st2/User"

foreach ($subfolder in (gci "$HOME/Dropbox/profile/st2/Packages"))
{
    new-junction "$env:appdata/Sublime Text 2/Packages/$subfolder" "$HOME/Dropbox/profile/st2/Packages/$subfolder"
}

(I think new-junction is an addition added by PSCX.)


text:
Q: Boxplot in R comparing two data frames I am trying to make a boxplot R. I have two loaded data frames- both of which have a column titled MEANS. I am trying to create a box and whiskers plot comparing both of the columns titled MEANS for both of these data frames in preparation to run an ANOVA. What is the most straight forward way to do this?

A: if the object names are 'df1', 'df2', then load this into a list, extract the column and apply boxplot
lapply(mget(paste0("df", 1:2)), function(x) boxplot(x$MEANS))

A: I would combine the two data frames into a single dataframe, then plot:
df1 <- data.frame(data = rep("data1",100),MEANS = rnorm(100))
df2 <- data.frame(data = rep("data2",100),MEANS = rnorm(100))

df <- rbind(df1,df2)

boxplot(data = df, MEANS ~ data)


text:
Q: On what parameters boot sequence varies? Does every Unix flavor have same boot sequence code ? I mean there are different kernel version releases going on for different flavors, so is there possibility of different code for boot sequence once kernel is loaded? Or they keep their boot sequence (or code) common always?
Edit: I want to know into detail how boot process is done.

*

*Where does MBR finds a GRUB? How this information is stored? Is it by default  hard-coded?

*Is there any block level partion architecture available for boot sequence?

*How GRUB locates the kernel image? Is it common space, where kernel image is stored?
I searched a lot on web; but it shows common architecture BIOS -> MBR -> GRUB -> Kernel -> Init.
I want to know details of everything. What should I do to know this all? Is there any way I could debug boot process?
Thanks in advance!

A: First of all, the boot process is extremely platform and kernel dependent.
The point is normally getting the kernel image loaded somewhere in memory and run it, but details may differ:

*

*where do I get the kernel image? (file on a partition? fixed offset on the device? should I just map a device in memory?)

*what should be loaded? (only a "core" image? also a ramdisk with additional data?)

*where should it be loaded? Is additional initialization (CPU/MMU status, device initialization, ...) required?

*are there kernel parameters to pass? Where should they be put for the kernel to see?

*where is the configuration for the bootloader itself stored (hard-coded, files on a partition, ...)? How to load the additional modules? (bootloaders like GRUB are actually small OSes by themselves)

Different bootloaders and OSes may do this stuff differently. The "UNIX-like" bit is not relevant, an OS starts being ostensibly UNIXy (POSIX syscalls, init process, POSIX userland,...) mostly after the kernel starts running.
Even on common x86 PCs the start differs deeply between "traditional BIOS" and UEFI mode (in this last case, the UEFI itself can load and start the kernel, without additional bootloaders being involved).
Coming down to the start of a modern Linux distribution on x86 in BIOS mode with GRUB2, the basic idea is to quickly get up and running a system which can deal with "normal" PC abstractions (disk partitions, files on filesystems, ...), keeping at minimum the code that has to deal with hardcoded disk offsets.

*

*GRUB is not a monolithic program, but it's composed in stages. When booting, the BIOS loads and executes the code stored in the MBR, which is the first stage of GRUB. Since the amount of code that can be stored there is extremely limited (few hundred bytes), all this code does is to act as a trampoline for the next GRUB stage (somehow, it "boots GRUB");

*the MBR code contains hard-coded the address of the first sector of the "core image"; this, in turn, contains the code to load the rest of the "core image" from disk (again, hard-coded as a list of disk sectors);

*Once the core image is loaded, the ugly work is done, since the GRUB core image normally contains basic file system drivers, so it can load additional configuration and modules from regular files on the boot partition;

*Now what happens depends on the configuration of the specific boot entry; for booting Linux, usually there are two files involved: the kernel image and the initrd:

*

*initrd contains the "initial ramdrive", containing the barebones userland mounted as / in the early boot process (before the kernel has mounted the filesystems); it mostly contains device detection helpers, device drivers, filesystem drivers, ... to allow the kernel to be able to load on demand the code needed to mount the "real" root partition;

*the kernel image is a (usually compressed) executable image in some format, which contains the actual kernel code; the bootloader extracts it in memory (following some rules), puts the kernel parameters and initrd memory position in some memory location and then jumps to the kernel entrypoint, whence the kernel takes over the boot process;

*From there, the "real" Linux boot process starts, which normally involves loading device drivers, starting init, mounting disks and so on.
Again, this is all (x86, BIOS, Linux, GRUB2)-specific; points 1-2 are different on architectures without an MBR, and are are skipped completely if GRUB is loaded straight from UEFI; 1-3 are different/avoided if UEFI (or some other loader) is used to load directly the kernel image. The initrd thing may be not involved if the kernel image already bundles all that is needed to start (typical of embedded images); details of points 4-5 are different for different OSes (although the basic idea is usually similar). And, on embedded machines the kernel may be placed directly at a "magic" location that is automatically mapped in memory and run at start.


text:
Q: Typo3 showClickmenu not working for certain plugin-provided item types I have a really old Typo3 plugin and some time ago (probably the problem is caused by a Typo3 upgrade; I currently use 4.7.11), users started to complain that the context menu of certain items in the backend does not work any more. The effect is limited on some tables, not all, but it looks like a class of items is either working or not.
The plugin does nothing special about the context menu, I would just expect the standard thing with the edit button etc. I understand from a web search that there changes have been made to the backend wrt. context menu. However, from the bug reports, it is not clear to me what I have to change, specifically because some of my stuff is working without modifications.
Is there any documentation about what I need to adapt in a plugin to work with the new context menu architecture?
Thanks in advance,
Christoph
PS: The strange thing is that the context menu is not working in the standard file browser neither. This might be related, but I do not have a solution for that yet...
Edit: The webdev console of Firefox reports the error "xml or text declaration not at start of entity" for the menus that fail. The XML looks OK for me though:
<?xml version="1.0"?>
<t3ajax><data><clickmenu><htmltable><![CDATA[

                <tr class="typo3-CSM-itemRow" onclick="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&edit[tx_visteaching_seminartopic][240]=edit';}Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&edit[tx_visteaching_seminartopic][240]=edit';}Clickmenu.hideAll();;return false;">
                      	Bearbeiten

                <tr class="typo3-CSM-itemRow" onclick="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&edit[tx_visteaching_seminartopic][-240]=new';}Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&edit[tx_visteaching_seminartopic][-240]=new';}Clickmenu.hideAll();;return false;">
                      	Neu

                      	Info

                <tr class="typo3-CSM-itemRow" onclick="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&reloadListFrame=1&CB[el][tx_visteaching_seminartopic%7C240]=1&CB[setCopyMode]=1');Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&reloadListFrame=1&CB[el][tx_visteaching_seminartopic%7C240]=1&CB[setCopyMode]=1');Clickmenu.hideAll();;return false;">
                      	Kopieren

                <tr class="typo3-CSM-itemRow" onclick="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&reloadListFrame=1&CB[el][tx_visteaching_seminartopic%7C240]=1');Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&reloadListFrame=1&CB[el][tx_visteaching_seminartopic%7C240]=1');Clickmenu.hideAll();;return false;">
                      	Ausschneiden

                <tr class="typo3-CSM-itemRow" onclick="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&cmLevel=1&subname=moreoptions');" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="showClickmenu_raw('/typo3/alt_clickmenu.php?table=tx_visteaching_seminartopic&uid=240&listFr=1&enDisItems=&backPath=%7Ce633b347b6&addParams=&ajax=1&cmLevel=1&subname=moreoptions');;return false;">
                     	Weitere Einstellungen...

                <tr class="typo3-CSM-itemRow" onclick="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&data[tx_visteaching_seminartopic][240][hidden]=1&prErr=1&vC=31e89da0b5&formToken=67e2328a3706432e0dd02d2f1e0923002537a3d0';}top.nav.refresh.defer(500, top.nav);Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&data[tx_visteaching_seminartopic][240][hidden]=1&prErr=1&vC=31e89da0b5&formToken=67e2328a3706432e0dd02d2f1e0923002537a3d0';}top.nav.refresh.defer(500, top.nav);Clickmenu.hideAll();;return false;">
                      	Verbergen

                <tr class="typo3-CSM-itemRow" onclick="var docRef=(top.content.list_frame)?top.content.list_frame:top.content.list_frame; docRef.location.href=top.TS.PATH_typo3+'alt_doc.php?edit[tx_visteaching_seminartopic][240]=edit&columnsOnly=hidden'+'&returnUrl='+top.rawurlencode(docRef.document.location.pathname+docRef.document.location.search);Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="var docRef=(top.content.list_frame)?top.content.list_frame:top.content.list_frame; docRef.location.href=top.TS.PATH_typo3+'alt_doc.php?edit[tx_visteaching_seminartopic][240]=edit&columnsOnly=hidden'+'&returnUrl='+top.rawurlencode(docRef.document.location.pathname+docRef.document.location.search);Clickmenu.hideAll();;return false;">
                      	Sichtbarkeitseinstellungen

                <tr class="typo3-CSM-itemRow" onclick="if(top.content.list_frame && confirm(String.fromCharCode(83,105,110,100,32,83,105,101,32,115,105,99,104,101,114,44,32,100,97,115,115,32,83,105,101,32,34,69,118,97,108,117,97,116,105,111,110,32,118,111,110,32,75,110,111,116,101,110,45,75,97,110,116,101,110,32,68,105,97,103,114,97,109,109,101,110,34,32,116,97,116,115,228,99,104,108,105,99,104,32,108,246,115,99,104,101,110,32,119,111,108,108,101,110,63,32,40,84,104,101,114,101,32,97,114,101,32,49,32,114,101,102,101,114,101,110,99,101,40,115,41,32,116,111,32,116,104,105,115,32,114,101,99,111,114,100,33,41)) ){top.content.list_frame.location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&cmd[tx_visteaching_seminartopic][240][delete]=1&prErr=1&vC=31e89da0b5&formToken=67e2328a3706432e0dd02d2f1e0923002537a3d0';}top.nav.refresh.defer(500, top.nav);Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="if(top.content.list_frame && confirm(String.fromCharCode(83,105,110,100,32,83,105,101,32,115,105,99,104,101,114,44,32,100,97,115,115,32,83,105,101,32,34,69,118,97,108,117,97,116,105,111,110,32,118,111,110,32,75,110,111,116,101,110,45,75,97,110,116,101,110,32,68,105,97,103,114,97,109,109,101,110,34,32,116,97,116,115,228,99,104,108,105,99,104,32,108,246,115,99,104,101,110,32,119,111,108,108,101,110,63,32,40,84,104,101,114,101,32,97,114,101,32,49,32,114,101,102,101,114,101,110,99,101,40,115,41,32,116,111,32,116,104,105,115,32,114,101,99,111,114,100,33,41)) ){top.content.list_frame.location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search)+'&cmd[tx_visteaching_seminartopic][240][delete]=1&prErr=1&vC=31e89da0b5&formToken=67e2328a3706432e0dd02d2f1e0923002537a3d0';}top.nav.refresh.defer(500, top.nav);Clickmenu.hideAll();;return false;">
                      	Löschen

                <tr class="typo3-CSM-itemRow" onclick="var docRef=(top.content.list_frame)?top.content.list_frame:top.content.list_frame; docRef.location.href=top.TS.PATH_typo3+'show_rechis.php?element=tx_visteaching_seminartopic%3A240'+'&returnUrl='+top.rawurlencode(docRef.document.location.pathname+docRef.document.location.search);Clickmenu.hideAll();" onmouseover="this.bgColor='#dedede';" onmouseout="this.bgColor='';" oncontextmenu="var docRef=(top.content.list_frame)?top.content.list_frame:top.content.list_frame; docRef.location.href=top.TS.PATH_typo3+'show_rechis.php?element=tx_visteaching_seminartopic%3A240'+'&returnUrl='+top.rawurlencode(docRef.document.location.pathname+docRef.document.location.search);Clickmenu.hideAll();;return false;">
                      	Verlauf/Rückgängig

]]></htmltable><cmlevel>0</cmlevel></clickmenu></data></t3ajax>

A: The context menu is rendered via a AJAX request. Make sure to have a look at the raw result with your browsers network inspection tools (Chrome and Firefox work best here). The raw result might contain an error message.
Also make sure to check the PHP error log.
I am not aware of any significant change to the context menu.

A: You can find the javascript for the clickmenu in the file class.t3lib_treeview.php. It uses javascript not ajax.
    function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$add$
    {
         $backPath = rawurlencode($this->backPath).'|'.t3lib_div$
         $onClick = 'if(event.stopPropagation){event.stopPropaga$
         '","'.$uid.'","'.$listFr.'","'.
          str_replace('+','%2B',$enDisItems).'","'.
          str_replace('&','&',addcslashes($backPath,'"')).'",$
          str_replace('&','&',addcslashes($addParams,'"')).'"$
          return $returnOnClick ? $onClick : '<a href="javascript$
                                                    htmlspecialchar$
     }


text: Q: I am using a payment gateway that sends an approved or declined response in plain text I am using a payment gateway that sends an approved or declined response in plain text (comma delimited). How can I capture that response in PHP? I need to be able explode the response into an array and use some of the data.


text:
Q: How to call yahoo weather api javascript function from within a html doc When placed in the head or body section of a html doc, these scripts immediately write to the document. How can I call their functionality from a button in the document. I have tried all the usual methods of calling a js function but none work. Please help, many thanks.

A: Take a look at this code. I get the wind chill and store it in a variable. Then, I use the onclick attribute of a button to put that value in a div. Does this help?

<input type="button" onclick="get_wind_chill();" value="Get wind chill" />

Note: This gets the wind chill when the page loads. If you need to get a new wind chill each time the button is clicked (without doing a page reload) then you will need to modify the above code.


text:
Q: AWS cognito - account from external provider gives error "User does not exist" I have a cognito account with users generated by Cognito, and they work just fine.
In a React App I'm using the aws-amplify React UI Libaries.
I.e. import { Authenticator, useAuthenticator, View } from "@aws-amplify/ui-react";
In the Cognito account, I have a user generated via a 3rd party Identity provider (using SAML - Azure AD). The user status is "External_provider". When that user is used to logon, Console error is "User does not exist".
If I use Authenticator i.e. from the React App, to make a new User - it creates just fine, in Cognito and can be used for logon.
Note: This is similar but not the same to my previous question


text:
Q: Generate 2 wsdl from 2 header files that import a third .h file without obtaining double structures I have some C++ headers files and I want to make their content available through a webservice using gSOAP.
The headers are:
Shared.h,
A.h,
B.h;

both A.h and B.h include (import) the Shared.h file.
I generated two separate WSDL documents: A.wsdl and B.wsdl and then I built them into a single header file (final.h) using the wsdl2h tool.
wsdl2h -x -o A.wsdl B.wsdl -tC:\gsoap-2.8.22\gsoap\typemap.dat

After that, I compiled the final.h file with soapcpp2 in order to get the C++ stubs of two proxy services (corresponding to the two WSDL mentioned above).
soapcpp2 -j -S final.h -IC:\gsoap-2.8.22\gsoap\import;C:\gsoap-2.8.22\gsoap -x -2
soapcpp2 -j -C final.h -IC:\gsoap-2.8.22\gsoap\import;C:\gsoap-2.8.22\gsoap -x -2

Two different namespaces have been used, one for each WSDL, and everything works properly, but there is a problem. Since the Shared.h file is imported by both the A.h and B.h files, the data structures coded in it appear two times in final.h file (once with the A__ prefix associated to the A namespace and once with the B__ prefix associated with the B namespace).
How can I manage to avoid this problem and get them only once?
I tried to generate a third WSDL (Shared.wsdl), but I don't know how to import it into the A.wsdl and B.wsdl. Is it possible? How should I modify the A.h and B.h files in order to do so?
Should I follow another procedure?


text:
Q: REST API remove contact from journey I'm using this REST API JSON call to remove a subscriber from a journey:
[
{
"ContactKey": "0031xxxxxxxxxxxxxx",
"DefinitionKey": "cexxxxxx-b20f-74ea-c67a-xxxx7c53xxxx",
"Versions": [0,1,2,3]
}
]

It works like a charm, but I'm unsure on the use of the array for the versions of the journey.
The documentation for the /interaction/v1/interactions/contactexit API only states, that this needs to be an array.
As I have three versions of the journey today, my solution is [0,1,2,3], but in stead I'd like a more flexible solution that always removes contacts from every version of the journey.
What are my options when using the array for referencing versions of a journey?
Thank you

A: The versions array is optional. I you don't specify this property, the contact is removed from all versions of the journey concerned:
POST /interaction/v1/interactions/contactexit
[
    {
        "ContactKey": "0031xxxxxxxxxxxxxx",
        "DefinitionKey": "cexxxxxx-b20f-74ea-c67a-xxxx7c53xxxx"
    }
]

A: The cleanest solution that comes to mind - do an API call before your original call that would be asking in which journey version this contact is.
You can do that with the following endpoint:
POST /interaction/v1/interactions/contactMembership