text:
Q: Permission denied (publickey) on github I work to understand Ruby on Rails with a tutorial of M Hartl.
I have finished chapter 6 and git push the work on git-hub, but I received this error:

rene@Linux-Ubuntu:~/rails_projets/sample_app$ git push Permission denied (publickey).
  fatal: The remote end hung up unexpectedly

I reinstalled a new publickey as a Help-Git instruction
    debug1: Next authentication method: publickey
    debug1: Offering DSA public key: rene@Linux-Ubuntu
    debug1: Authentications that can continue: publickey
    debug1: Offering RSA public key: rene@Linux-Ubuntu
    debug1: Authentications that can continue: publickey
    debug1: Trying private key: [~/.ssh/id_rsa]
    debug1: Trying private key: [~/.ssh/id_dsa]
    debug1: No more authentication methods to try.
    Permission denied (publickey).

And I have the files in a repository:

rene@Linux-Ubuntu:~/.ssh$ ls
  ak.bak  config  id_dsa  id_dsa.pub id_rsa  id_rsa.pub  key_backup/  known_hosts

What did I do wrong?

A: Have you told github about your public key?
https://github.com/settings/ssh
(it's the contents of id_rsa.pub that you need)


text:
Q: Propagating HealthKit Delete to back end Hope this question doesn't sound too silly, but I haven't been able to find a solution yet.  I'm currently writing an app using Xamarin that integrates with HealthKit.  Data stored in HK is periodically synced to a server. This is done through an HKAnchoredObjectQuery that pulls Food Correlations.
Since the Data is pulled periodically there is the scenario that between syncs, a user might delete a value in HealthKit.  That delete needs to be propagated back to the server on the next sync.
My initial thought was to do this with an Observer Query.
My Question is: Using an Observer Query for HealthKit, is there a way to determine if the action that triggered the query is a delete action?
public void CheckForDelete (Subject subject)
    {
        var sampleType = HKObjectType.GetCorrelationType (HKCorrelationTypeKey.IdentifierFood);
        var predicate = HKQuery.GetPredicateForSamples (NSDate.DistantPast, NSDate.Now, HKQueryOptions.None);
        var observerQuery = new HKObserverQuery (sampleType, predicate, (query, completion, error ) => {
            //...Determine if action was a Delete
            //Code to delete on backend

            completion();
        });

        HealthKitStore.ExecuteQuery (observerQuery);
    }

A: In iOS 9, HKAnchoredObjectQuery has been modified to report deleted objects.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Reformatting excel data in a specific way I have an excel sheet that has say, 10 different columns, with a few hundred records.
e.g.
column1|column2|column3|column4

data    data    data    data

I have another sheet, a template, which has the headings arranged in a certain way, e.g.
column1|column2
data    data
        column3   column 4
        data      data

So, the template block in my second sheet has to be copied and filled in for each record.
Is there a way to do this with VBA?
I am aware this is a horrible way of doing things, however I can not convince my superior of that, and so this is all I can try and do. If this is not possible, it will just be done by hand, so I am hoping some automation is possible.

A: Try this out:
Sub Tester()

    Const SHT_SRC As String = "Sheet1" 'sheet w source data
    Const SHT_DEST As String = "Sheet2" 'sheet w template
    Const RNG_COPY As String = "A1:E6" 'your template area

    Dim rngDest As Range, rngSrc As Range, rngCopy As Range

    Set rngCopy = ThisWorkbook.Sheets(SHT_DEST).Range(RNG_COPY)
    Set rngDest = rngCopy.Cells(1)
    Set rngSrc = ThisWorkbook.Sheets(SHT_SRC).Rows(2)

    Do While rngSrc.Cells(1).Value <> ""

        rngCopy.Copy rngDest 'copy template area
        With rngDest
            'adjust offsets to fit your template layout
            .Offset(1, 0).Value = rngSrc.Cells(1).Value
            .Offset(1, 1).Value = rngSrc.Cells(2).Value
            '...etc etc
            .Offset(5, 5) = rngSrc.Cells(10).Value
        End With

        Set rngDest = rngDest.Offset(rngCopy.Rows.Count + 1, 0)
        Set rngSrc = rngSrc.Offset(1, 0)
    Loop

End Sub

A: You can read the range into an array, then parse it out via individual elements:
Dim dataArray As Variant
Dim i As Integer

dataArray = Range("B1:B4").Value

For i = 1 to Ubound(dataArray)/2
  Range("B2").Offset(2 * (Ceiling(i/2)-1), Ceiling((i-1)/2)) = dataArray(1, i)
Next i

Using this function:
Public Function Ceiling(ByVal X As Double) As Integer

  Ceiling = Int(X) - (X - Int(X) > 0)

End Function


text: Q: Angular momentum in molecules When using the Born-Oppenheimer approximation to find the electronic energy levels of a diatomic molecule, $L^2$ doesn't commute with the Hamiltonian i.e. $l$ is not a good quantum number, but its projection on the internuclear axis is. If we are in a singlet state, such that the total intrinsic spin, S is 0, then we have that the total angular momentum of the molecule (we are looking only at the electronic energy for now, so no rotation or vibration) is $J=L+S=L$. However this means that $J^2$ doesn't commute with the Hamiltonian. But, I thought that in a closed system, the Hamiltonian is always commuting with the total angular momentum. Why is it not the case here?


text:
Q: address of entire row of 2 dimensional array in C - syntax My question is related to the syntax used in plain C to address an entire row from a 2-dimensional array. So, if I have a 2d array like:
arr[rows][columns]

and I want to pass the address of an entire row from this array to a given function f, would a construction like:
f(&arr[i])

be okay in plain C? Thanks a lot for any help.

A: int arr[rows][columns];

void f(int *array) {
   int i;
   for (i=0;i<columns; i++) {
      array[i] = 5 ; // as example
      ........
   }
}

and then you can called as mentioned in your question
f(&arr[i]);


text:
Q: cross domain issue There is a iframe in my page. This page is in domain A, the stuff in that iframe is belong to domain B. Is there any way I could get the source code of that page in that iframe?
This is a cross domain problem, the domain A and B are totally different. Also the domain B is third part domain, we can not do any changes on that.
For example, the stuff in iframe is google's homepage.

A: No, there is no reliable way to get the source of an iframe whose content is on a different domain that you do not control.

A: There are few techniques that can be applied here they are described in these writeups
http://www.julienlecomte.net/blog/2007/11/31/
http://softwareas.com/cross-domain-communication-with-iframes

A: You can set the iframe source
but you need to received the source with ajax call and set to the iframe.
I have done the same thing but i am facing different issue, i want to access the domain b function from the domain a.
{
Object.keys(db_obj).map(function(idx)
{
return(

    )

}.bind(this))
}

This is the react js code for given the iframe src with different url.May be it will help you.


text:
Q: Regarding PMDC motors attached to two different gear boxes Can some one help me on this??
We are using two different make PMDC motors with different gear ratios(motor to gear box to lead screw to load) in one of our application.Below are the details.
Application:Solar Tracking systems.
Load:Around 1 ton solar structure.
***At No load condition:***
Motor 1:                               Motor 2:
current: 0.2A                          current: 0.6A
speed:2100 rpm                         speed:3515 rpm
input voltage: 24V                     input voltage: 24V
Gear Ratio:67                          Gear Ratio:57.
Gear working:smooth                    Gear Working:smooth to hard.
Max current rating: 6A                 Max current rating: 12A
Load current: 1.2 to 2.3A(max)         Load current: 2.5 to 7A(max).

We are using the both motors for same application.

*

*We have used motor 1 and it's working fine.But we  have chosen motor 2 by thinking it has high no load and full current rating so that it can produce high torque.is it correct??

*For lifting the same load motor 2 taking high current. Why? and How to reduce load current??

*We need to reduce the load current around 3A when we are using motor2.How to achieve this for same load?

*is there any possibility to increase the load torque and reduce the load current when we are using motor 2??

*And finally where we have done wrong?and what are the changes need to do to get same performance as motor 1 connected to load???
Thanks

A: All the current ratings, no load, rated, max, of motor 2 are about 2x that of motor 1. The fact that it's taking twice the current of motor 1 when driving a load sounds consistent with all it's trying to tell you on the data sheet.
Note that motor 1 has about half the speed at the same voltage, which means its torque constant is about 2x that of motor 2. So you would expect half the current in motor 1 for the same torque.
Sounds like motor 1 is the one for the job.
So now the most difficult part is political. Having chosen motor 2 for the wrong reasons, does anybody have to lose face to choose motor 1 instead? I do not lie, after 4 decades of lab politics, this is often the most difficult part of any project, when you're halfway through and it suddenly dawns on the team that someone's made a wrong choice. Can you swallow pride and fix it, or do you do a Trump (other politicians are available), say nothing's wrong, and soldier on? Perhaps sneak into the workshop in the middle of the night and remove one of the brushes of motor 2, 'oh look, it's stopped working, now we'll have to use motor 1!'


text:
Q: how to use arrays in gekko optimizer for python I tried to convert an example from gekko python optimizer by using the list, array x[] instead of variables x1..x4. This is the code which gives the result, but I think it is not correct
from gekko import GEKKO
import numpy as np
# Initialize Model
m = GEKKO(remote=False)

#help(m)

#define parameter
eq = m.Param(value=40)

#initialize variables
x = [m.Var(value=1,lb=1,ub=5) for i in range(4)]
x[1].value=5
x[2].value=5

#Equations
m.Equation(np.prod([x[i] for i in range(0,4)])>=25)
m.Equation(np.sum([x[i]**2 for i in range(0,4)])==eq)

#Objective
m.Obj(x[0]*x[3]*(x[0]+x[1]+x[2])+x[2])

#Set global options
m.options.IMODE = 3 #steady state optimization

#Solve simulation
m.solve() # solve on public server

#Results
print('')
print('Results')
print('x1: ' + str(x[0].value))
print('x2: ' + str(x[1].value))
print('x3: ' + str(x[2].value))
print('x4: ' + str(x[3].value))

Please anyone could help me out how to use list, array of variables in gekko. This seems to me less elegant and I was wondering is there is a way of using Array() function instead of Var(). I can not figure out how and when we can use Array() function.

A: You can use the m.Array GEKKO function to create Variable, Parameter, FV, MV, SV, or CV as 1D or multi-dimensional arrays. Here is an example of using m.Array to declare the variables. In subsequent steps, I define the initial guess and the bounds.
import numpy as np
from gekko import GEKKO
m = GEKKO()
x = m.Array(m.Var,(4))
# intial guess
ig = [1,5,5,1]
# lower bounds
i = 0
for xi in x:
    xi.value = ig[i]
    xi.lower = 1
    xi.upper = 5
    i += 1
#Equations
m.Equation(np.prod(x)>=25)
m.Equation(sum(x**2)==40)
#Objective
m.Obj(x[0]*x[3]*(x[0]+x[1]+x[2])+x[2])
m.solve()
print(x)

Here are the results:
The solution was found.

The final value of the objective function is    17.0140171270735

 ---------------------------------------------------
 Solver         :  IPOPT (v3.12)
 Solution time  :   9.999999980209395E-003 sec
 Objective      :    17.0140171270735
 Successful solution
 ---------------------------------------------------

[[1.000000057] [4.74299963] [3.8211500283] [1.3794081795]]

A: This one will work as well.
#Equations
m.Equation(np.prod(np.asarray(x))>=25)
m.Equation(np.sum(np.asarray(x)**2)==eq)

A: Here is a simple example of solving the system of linear equations and the example of using for loop for many equations.
import numpy as np
from gekko import GEKKO

m = GEKKO(remote=False)

# Random 3x3
A = np.random.rand(3,3)
# Random 3x1
b = np.random.rand(3)
# Gekko array 3x1
x = m.Array(m.Var,(3))

# solve Ax = b
eqn = np.dot(A,x)
for i in range(3):
   m.Equation(eqn[i]==b[i])
m.solve(disp=False)
X = [x[i].value for i in range(3)]
print(X)
print(b)
print(np.dot(A,X))

with the the correct output. With the result X (np.dot(A,X)==b) - correct!
[[-0.45756768428], [1.0562541773], [0.10058435163]]
[0.64342498 0.34894335 0.5375324 ]
[[0.64342498]
[0.34894335]
[0.5375324 ]]

In the recent Gekko 0.2rc6 there is also introduced axb() function for linear programing. This might be the same problem solved with this function, but I am not sure how to get the correct result.
m = GEKKO(remote=False)

# Random 3x3
A = np.random.rand(3,3)
# Random 3x1
b = np.random.rand(3)
# Gekko array 3x1
x = m.Array(m.Var,(3))

# solve Ax = b
m.axb(A,b,x=x)
m.solve(disp=False)
X = [x[i].value for i in range(3)]
print(X)
print(b)
print(np.dot(A,X))

but it seems I missed something because the output is not the solution??? With the result X (np.dot(A,X)==b) - is not correct!
[[0.2560342704], [0.7543346092], [-0.084190799732]]
[0.27262652 0.61028723 0.74616952]
[[0.4201021 ]
[0.5206979 ]
[0.39195592]]


text:
Q: removing Spring Roo in gvNIX I tried to remove Spring Roo in project with gvNIX, using the following steps:

*

*Step 1: Push-In Refactor

*Step 2: Annotation Source Code Removal

*Step 3: Annotation JAR Removal

which are documented in:
http://docs.spring.io/spring-roo/reference/html/removing.html
But I have found that the removal is completed with some errors:

*

*The Java classes that using the utility "occ checksum" are with compilation errors (the method getMessageDigest(), its declare in .aj)

*All files .aj are not deleted (EquipoController_Roo_GvNIXDatatables.aj, ApplicationConversionServiceFactoryBean_Roo_GvNIXGeoConversionService.aj)

If I delete the files .aj and utility "occ checksum" is not used, everything is correct.
It is a bug in gvNIX? Maybe it could fix for the next version

//Creating Petclinic project
project --topLevelPackage com.gvnix.gmt --projectName gmt
// Persistence
jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
// Creating entitys and fields
entity jpa --class ~.domain.Equipo --sequenceName EQU_SEQ
field string --fieldName nombre --notNull --sizeMin 3 --sizeMax 30 --class ~.domain.Equipo
// Adding finders
finder add --finderName findEquiposByNombre --class ~.domain.Equipo
// Adding web layers
web mvc setup
web mvc all --package ~.web
web mvc finder all
web mvc language --code de
web mvc language --code es
// Enable gvNIX JPA utilities
jpa gvnix setup
// Creates a Spring @Service class with methods for entity batch updates
jpa batch all
// Enable gvNIX Web MVC Batch utilities
web mvc batch setup
// Add support for JPA batch operations in all controllers
web mvc batch all
// Adding JQuery, Datatables and Bootstrap
web mvc jquery setup
web mvc datatables setup
web mvc jquery all
web mvc bootstrap setup
// Creating master patterns
web mvc datatables add --type ~.web.EquipoController
// Setup menu
menu setup
// Adding Optimistic Concurrency Control
occ checksum set --entity ~.domain.Equipo
logging setup --level INFO
// Dynamic Configuration
configuration create --name local
configuration property add --name log4j.rootLogger
configuration property value --configuration local --property
log4j.rootLogger --value ERROR
configuration list
configuration export
// Modifying persistence to use POSTRGRES database with geo spatial support
jpa setup --provider HIBERNATE --database POSTGRES --userName gvnix --databaseName postgis_example --password gvnix --hostName localhost
// Adding spatial support to our project
jpa geo setup --provider HIBERNATE_SPATIAL
// Adding new geo fields to Owner entity
field geo --fieldName localizacion --type POINT --class ~.domain.Equipo
// Generating geo entity finders
finder geo all
// Modifying entity field to use Geo component
web mvc geo field --controller ~.web.EquipoController --field localizacion
// Creating different map views
web mvc geo controller --class ~.web.MapaEquipoController --preferredMapping mapequipos
web mvc geo entity add --controller ~.web.EquipoController --map mapequipos
web mvc geo controller --class ~.web.MapaGlobalController --preferredMapping mapaglobal
web mvc geo entity add --controller ~.web.EquipoController --map mapaglobal
//web mvc geo entity all
// Generating all entities geo web layer
// Adding base layers to our maps views
web mvc geo tilelayer --name satellit --url "http://maptile.maps.svc.ovi.com/maptiler/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8"
web mvc geo wmslayer --name "geological map of valencia" --url "http://mapas.igme.es/gis/services/Cartografia_Geologica/IGME_GeologicoCValenciana_400/MapServer/WMSServer" --format "image/png" --transparent true --version "1.1.1" --crs EPSG4326 --layers "0,1,2,3"
// Adding tools to our maps views
web mvc geo tool measure --name measure
web mvc geo tool custom --name latlng --icon fa-location-arrow --activateFunction activateLatLngTool --deactivateFunction deactivateLatLngTool --iconLibrary fa

A: If you think it is possible bug, raise bug against gvNIX, reference this questions and give more details and how to reproduce bug.


text:
Q: Calculate the residue of $\frac{z^{3/2}\log(z)}{(1+z^{2})^{4}}$ at $z = i$. To find the residue of $$\frac{z^{3/2}\log(z)}{(1+z^{2})^{4}} \qquad \qquad(1)$$ at $z = i$, this is what I've thought:
Express this as a partial fraction: The problem therein is that decomposition of (1) yields something like
$$P_{1}(\frac{1}{z-i}) + P_{2}(\frac{1}{z+i}) + g(z)$$ where
$g(z)$ is an analytic function and $P_{j}(z)$ is as polynomial of finite degree. The $g(z)$ term exists, since (1) is not a rational function, in which case (provided also that the denominator's degree exceeds that of the numerator), the partial fraction decomposition is some summation of $P_{j}$s.
Thus, the inclusion of $g(z)$ makes me a bit nervous to try and solve this.
One could express (1) as
$$ \frac{\frac{z^{3/2}\log(z)}{(z+i)^{4}}}{{(z-i)^{4}}}$$
and then take a third derivative of the numerator, evaluate this result at $i$, and then divide by $3!$, but that is also messy.
And I have no idea how one might express the laurent series of (1).
Is there any elegant way to do this?

A: The easiest approach would be to note that
$$f(z) = \frac{z^{3/2} \log (z)}{(z+i)^4} * \frac{1}{(z-i)^4}=g(z) \frac{1}{(z-i)^4}$$
where $g(z)$ is analytic and non-zero near $z=i$. Thus there is a pole of order $4$.
To find the residue, use the following theorem:

Theorem:
  If $f(z)$ has a pole of order $m$ at $z_0$, then
  $$R [ f,z_0 ] = \lim_{z \to z_0} \frac{1}{( {m - 1} )!} \frac{d^{m - 1}}{dz^{m - 1}} ( ( z - z_0 )^m f( z )).$$

Thus $$R[f, i] = \lim_{z \to i} \frac{1}{3!}\frac{d^3}{dz^3} \frac{z^{3/2} \log (z)}{(z+i)^4}.  $$ There will be some messiness with nested and repeated quotient and product rules, but it's "just" a Calc I problem from here.


text:
Q: Embedded Youtube videos slowwww things down I'm creating a site with a lot of embedded Youtube videos, but it seems the video players take a while to load. Is there a way I could speed things up?
If this is not possible, then how do you embed just the thumbnails and load the videos when a user clicks on the thumbnail?

A: About your first question:
You cannot control the load speed because the videos are not hosted on your server but on Youtube's one.
About your second question:
You can check this address in order to find out how to extract the thumbnails from the youtube videos: http://www.reelseo.com/youtube-thumbnail-image/
After that you can load the youtube video on onclick using Ajax or simple redirect to a separate page where video is positioned.


text:
Q: db_type in Django (attempting to install pootle w/ mysql) Similar query that was posed to here: Getting db_type() error while using django-facebook connect for DjangoApp
I'm attempting to install Pootle on a CentOS box with the following details:
[root@localhost pootle]# cat /etc/redhat-release

CentOS release 6.2 (Final)

[root@localhost pootle]# PootleServer --version

Pootle 2.1.6

Translate Toolkit 1.9.0

Django 1.4

[root@localhost pootle]# python -V

Python 2.6.6

I was getting the following error:
Creating tables ...
Traceback (most recent call last):
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 94, in run
    self.finish_response()
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 134, in finish_response
    for data in self.result:
  File "/usr/lib/python2.6/site-packages/django/http/__init__.py", line 710, in next
    chunk = self._iterator.next()
  File "/usr/lib/python2.6/site-packages/pootle_misc/dbinit.py", line 134, in staggered_install
    yield syncdb()
  File "/usr/lib/python2.6/site-packages/pootle_misc/dbinit.py", line 76, in syncdb
    call_command('syncdb', interactive=False)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 150, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 91, in handle_noargs
    sql, references = connection.creation.sql_create_model(model, self.style, seen_models)
  File "/usr/lib/python2.6/site-packages/django/db/backends/creation.py", line 44, in sql_create_model
    col_type = f.db_type(connection=self.connection)
TypeError: db_type() got an unexpected keyword argument 'connection'

After I edit /usr/lib/python2.6/site-packages/django/db/backends/creation.py to a way I thought would rectify the issue, I'm still getting the following output from my PootleServer screen when I attempt to load the webpage:
Creating tables ...
Traceback (most recent call last):
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 94, in run
    self.finish_response()
  File "/usr/lib64/python2.6/wsgiref/handlers.py", line 134, in finish_response
    for data in self.result:
  File "/usr/lib/python2.6/site-packages/django/http/__init__.py", line 710, in next
    chunk = self._iterator.next()
  File "/usr/lib/python2.6/site-packages/pootle_misc/dbinit.py", line 134, in staggered_install
    yield syncdb()
  File "/usr/lib/python2.6/site-packages/pootle_misc/dbinit.py", line 76, in syncdb
    call_command('syncdb', interactive=False)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", line 150, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.6/site-packages/django/core/management/commands/syncdb.py", line 91, in handle_noargs
    sql, references = connection.creation.sql_create_model(model, self.style, seen_models)
  File "/usr/lib/python2.6/site-packages/django/db/backends/creation.py", line 45, in sql_create_model
    col_type = f.db_type(self.connection)
TypeError: db_type() takes exactly 1 argument (2 given)

The webpage displays:
Error: "(1146, "Table 'p2.siteconfig_siteconfiguration' doesn't exist")" while attempting to access the Pootle database, will try to initialize database.

The line in question is number 44, and looks like this:
    col_type = f.db_type(connection=self.connection)

Which I have commented out, and added a line underneath it to look like this:
    #col_type = f.db_type(connection=self.connection)
    col_type = f.db_type(self.connection)

Previously running the server rendered this error, however it was preceded by a number of successful creation notices, as we can see here:
mysql> show tables;

+-----------------------------------------------+
| Tables_in_p2                                  |
+-----------------------------------------------+
| auth_group                                    |
| auth_group_permissions                        |
| auth_permission                               |
| auth_user                                     |
| auth_user_groups                              |
| auth_user_user_permissions                    |
| django_admin_log                              |
| django_content_type                           |
| django_session                                |
| django_site                                   |
| pootle_app_directory                          |
| pootle_app_language                           |
| pootle_app_permissionset                      |
| pootle_app_permissionset_negative_permissions |
| pootle_app_permissionset_positive_permissions |
| pootle_app_pootleprofile                      |
| pootle_app_pootleprofile_alt_src_langs        |
| pootle_app_pootleprofile_languages            |
| pootle_app_pootleprofile_projects             |
| pootle_app_project                            |
| pootle_app_submission                         |
| pootle_app_suggestion                         |
| pootle_app_translationproject                 |
| pootle_notifications_notice                   |
| pootle_store_qualitycheck                     |
| pootle_store_store                            |
| pootle_store_suggestion                       |
| pootle_store_unit                             |
| registration_registrationprofile              |
+-----------------------------------------------+
29 rows in set (0.00 sec)

I'm sorry if this is a lengthy question, however I'm attempting to provide as much relevant information as possible to give you a good idea of what's happening.
If you know a way to fix this issue, please let me know as the internet seems rather lacking in Pootle-related fixes.
Edit:
Saw this: How to fix django's db_type deprecation warning?
changed the settings.py file to have this in it:
    col_type = f.db_type(connection=connection)
    #col_type = f.db_type(connection=self.connection)
    #col_type = f.db_type(self.connection)

Getting this error:
NameError: global name 'connection' is not defined

A: It looks like Pootle doesn't support Django 1.4
Uninstall Django 1.4 and install the older 1.3.1 version.
This could be helpful:
How do I install an old version of Django on virtualenv?


text:
Q: ...so is applicable to all environments - Where did the subject of the verb go?
This book is about JavaScript and focuses on its object-oriented nature. The book starts from zero, and does not assume any prior programming knowledge. Although there is one chapter dedicated to the web browser environment, the rest of the book is about JavaScript in general, so is applicable to all environments.

What is applicable to all environments? Where did the subject of the verb go?

A: 1. Basic Answer.
The original author left out the subject, so you need to figure it out from context.1  As others noted, we can supply "a subject" by adding the word "it":

*

*"Although there is one chapter dedicated to the web browser environment, the rest of the book is about JavaScript in general, so it is applicable to all environments.
But that still doesn't answer, what is it? It's easier if you consider the same sentence based on a hypothetical book called How to Drive a Car:

*

*Although there is one chapter dedicated to the Honda Civic stick-shift, the rest of the book is about driving in general, so ________________________ is applicable to driving any car.
Answer: it | this book | the rest of the book.

So the answer is the same:

*

*Although there is one chapter dedicated to the web browser environment, the rest of the book is about JavaScript in general, so ________________________ is applicable to all JavaScript environments.
Answer: it | this book | the rest of the book.

2. More Detail - Understanding Sentence Structure
The key to answering this question is understanding "what the sentence saying".  And that requires both (1) understanding the semantics of the sentence structure  and  (2) world-knowledge about JavaScript.2  Let's start with the semantics of the sentence structure:

*

*Although X, Y, so Z"

*Although something-is-true, some-contrasting-thing-is-true, so/therefore some-conclusion-is-made.

*Although Joe was fast, Jim was faster, so/therefore ______________ won the race.
Answer: Jim. Because we know that "faster people wins races".

*Although the building has pipes, they aren't working, so/therefore ______________ need to be fixed.
Answer: they | the pipes. Because we know that "broken pipes need to be fixed".

3. More Detail - When can subjects be dropped?
Subjects can be dropped in a variety of ways.  The following shows how the original  sentence can be reworded with a more grammatical parallel structure so that the subject, "this book", is clearly shared across all three clauses:

*

*This book has only one chapter dedicated to the web browser environment, is about JavaScript in general, and therefore is applicable to all environments.
The above is just one example of a compound sentence with parallel structures.3

Footnotes
1. As noted in the following link, the author, a non-native English speaker, has some difficulty with English:  See https://ell.stackexchange.com/a/26899/3796. The phrase "so is applicable" might be used where there is less chance for ambiguity (see Google Ngram).  But leaving out the subject in this sentence verges between being poor style at best and being ungrammatical at worst.
2. Here's some info about JavaScript.  JavaScript is a general purpose scripting language that most notably runs in web-browsers, but also runs in other environments like servers, batch programs, desktop programs, and in applications. While many JavaScript books focus on the web-browser environment, programmers working in other environments will appreciate a book that focuses more on the language instead of any particular environment.
3. More specifically, as per @snailplane's comment, this is an example of verb phrase coordination.  An even simpler example of this is, "He sings and dances." (He sings and he dances.)

A: I'll first reiterate what the other answers said before I go into a bit more detail. The sentence is correctly read as:

Although there is one chapter dedicated to the web browser environment, the rest of the book is about JavaScript in general, so it is applicable to all environments.

This is because so here is a coordinating conjunction[1][2] and thus must be followed by an independent clause, which must contain a subject and verb. Since "is applicable to all environments" is not an independent clause, this sentence is incorrect. (Even though we can understand what it means.)
Both @CoolHandLouis and @SydneyAustraliaESLTeacher alluded to the fact that it was dropped either unknowingly or in an attempt to be colloquial, and I suspect this is the case as well. However, not only does it still remain ungrammatical, there is something to keep in mind...
The words so and therefore are often used interchangeably; however this is not always grammatical. The word therefore would actually be an adverb here, which need not be followed by an independent clause. It could read as follows:

Although there is one chapter dedicated to the web browser environment, the rest of the book is about JavaScript in general, and therefore is applicable to all environments.

Because an adverb here can be followed by either a dependent or independent clause, the use of it is optional here. As for the example you showed, however, so followed by a subject-less clause is incorrect, and thus it is required to be grammatical.

A: Every language has rules about what words must be included in a particular context, what words are usually included but can be left out, what words are usually left out but can be included, and what words must be left out. Some of these are common and widespread enough that they are specifically taught at language learner level. Others are rare and/or only used in particular contexts.
In the OP's sentence, it is certainly more usually to include the subject ('it') of the second clause, but the rules of English allow it to be left out. Why? Basically because English speakers across the centuries accepted that it could.
When elements (words, phrases, clauses) of English are 'coordinated' (joined by 'and', 'or' or 'but') some elements of meaning carry over and can be replaced by 'anaphora' ('referring back') or can be omitted. To take a simpler example:

My best friend is beautiful and my best friend is popular.

becomes:

My best friend is beautiful and she is popular. (less natural)

or:

My best friend is beautiful and popular. (more natural)

'So' is a subordinating conjunction, which complicates things:

My best friend is beautiful, so she is popular.

may become:

(?) My best friend is beautiful, so is popular.

'and so' uncomfortably combines the coordinating conjunction 'and' and the subordinating conjunction 'so':

My best friend is beautiful, and so she is popular. > (?) My best
  friend is beautiful,  and so is popular.

which is the same general structure as OP's sentence (among many differences, of course).
[EDIT: I've just re-read OP's sentence and realised that there's no 'and' in the middle of it.

A:
What is applicable to all environments? Where did the subject of the
  verb go?

*

*The rest of the book is applicable in all environments.

*The subject is rest of the book and it didn't go anywhere and it's perfectly OK right where it is. Were you expecting a pronoun; i.e. "it?" (to be applicable in all environments?) No, no pronoun is necessary and this paragraph makes for an easy read.

A good ESL teacher will come up with drills and situations to help you use and understand this structure with ease.

A: The subject of the verb is 'the rest of the book'. We could say 'the rest of the book is about JavaScript in general, so it is applicable ...'. English sometimes drops some words if they are understood (or understandable) from the rest of the sentence. Maybe if this sentence was written for English language learners, the writer would have included the word 'it', but I think it was written for native or advanced non-native speakers. I probably would have included it anyway.

A: The rest of the book is about JavaScript in general and it is applicable to all environments (web browser, and not)


text:
Q: Combine Octopress and a Rails 4.0 Application? I understand that Octopress is designed to run as a standalone web application.
I have a personal website, and I want to add a blog to it, and for numerous reasons I would like to use Octopress for this.  Rather than having two separate applications and repos in git, I would like to integrate these apps together.
Is there a reliable way to integrate Octopress into an existing Rails 4.0 application?
Would my best bet be to mount Octopress as a rack application inside the Rails router, or is there a better way?

A: I think your best bet is to have a frontend server like nginx as a reverse proxy and do the redirecting/proxying from there.
So you will have an nginx.conf something along the lines of:
server {
  listen 80;
  server_name domain.com;
  location / {
    # ... proxy config stuff to rails ...
  }
}

server {
  listen 80;
  server_name blog.mydomain.com;
  location / {
    root /to/octopress/static/folder
  }
}

My example is if you use a subdomain blog.domain.com. But obviously if you have domain.com/blog, it will still work, just do some tweaking on the nging.conf file.


text:
Q: Adjusting GAN hyperparameters

As shown in the two pictures above,while training a DCGAN model ,the gradient is not stable and fluctuate greatly.Because of this reason,the model can't draw a perfect image,even to draw a image that be recognized by human eyes.Does anybody can tell me how to adjust the parameter such as dropout rate or learning rate or something else to make the model run better?I will be great thankful to you!
Here is the model I have made before(Build with Keras):
the discriminator :
learn rate is 0.0005
dropout rate is 0.6
batch_size is 25
dis=Sequential()

dis.add(Conv2D(depth*1, 5, strides=2, input_shape=(56,56,3),padding='same',kernel_initializer='RandomNormal', bias_initializer='zeros'))

dis.add(LeakyReLU(alpha=alp))

dis.add(Dropout(dropout))

dis.add(Conv2D(depth*2, 5, strides=2, padding='same',kernel_initializer='RandomNormal', bias_initializer='zeros'))

dis.add(LeakyReLU(alpha=alp))

dis.add(Dropout(dropout))

dis.add(Conv2D(depth*4, 5, strides=2, padding='same',kernel_initializer='RandomNormal', bias_initializer='zeros'))

dis.add(LeakyReLU(alpha=alp))

dis.add(Dropout(dropout))

dis.add(Conv2D(depth*8,5,strides=1,padding='same',kernel_initializer='RandomUniform', bias_initializer='zeros'))

dis.add(LeakyReLU(alpha=alp))

dis.add(Dropout(dropout))

dis.add(Flatten())

dis.add(Dense(1))

dis.add(Activation('sigmoid'))

dis.summary()

dis.compile(loss='binary_crossentropy',optimizer=RMSprop(lr=d_lr))

the generator and GAN model:
learning rate is 0.0001
momentum is 0.9
gen=Sequential()

gen.add(Dense(dim*dim*dep,input_dim=100))

gen.add(BatchNormalization(momentum=momentum))

gen.add(Activation('relu'))

gen.add(Reshape((dim,dim,dep)))

gen.add(Dropout(dropout))

gen.add(UpSampling2D())

gen.add(Conv2DTranspose(int(dep/2),5,padding='same',kernel_initializer='RandomNormal', bias_initializer='RandomNormal'))

gen.add(BatchNormalization(momentum=momentum))

gen.add(Activation('relu'))

gen.add(UpSampling2D())

gen.add(Conv2DTranspose(int(dep/4),5,padding='same',kernel_initializer='RandomNormal', bias_initializer='RandomNormal'))

gen.add(BatchNormalization(momentum=momentum))

gen.add(Activation('relu'))

gen.add(UpSampling2D())

gen.add(Conv2DTranspose(int(dep/8),5,padding='same',kernel_initializer='RandomNormal', bias_initializer='RandomNormal'))

gen.add(BatchNormalization(momentum=momentum))

gen.add(Activation('relu'))

gen.add(Conv2DTranspose(3,5,padding='same',kernel_initializer='RandomNormal', bias_initializer='RandomNormal'))

gen.add(Activation('sigmoid'))

gen.summary()

GAN=Sequential()

GAN.add(gen)

GAN.add(dis)

GAN.compile(loss='binary_crossentropy',optimizer=RMSprop(lr=g_lr))

A: Stable GAN Training is an open research problem. Nevertheless I can give you two tips. If you stick with the original GAN Training routine and do not have absolute knowledge of what you are doing, use the DCGAN Architecture with the available hyperparameters as described in their paper (https://arxiv.org/pdf/1511.06434.pdf%C3%AF%C2%BC%E2%80%B0). GAN Training is highly volatile and using other hyperparameter will lead to mode collapse or vanishing gradients.
The easier route with GANs is to use the Wasserstein GAN. Those are quite stable with abritrary architectures. However, I strongly suggest to use the hyperparameter suggested in their paper, because for me the training also collapsed for different hyperparameters. Improved Wasserstein GAN: [https://arxiv.org/pdf/1704.00028.pdf]


text:
Q: Google Analytics shows blank page yesterday I received the google credentials from someone to set up something in their google analytics. When I head towards analytics I get this error.
I tried incognito mode in chrome and also safari with a clear cache. The user owning this account also has this problem on their machine.
Any idea anyone?

A: Solution: go to business.google.com. On the left side there is an menu for statistics. On this site I had to enable statistics und type in some information.


text:
Q: Typescript error: Type 'string' is not assignable to type '"allName" | `allName.${number}.nestedArray`' in react hook form I am working on the react hook form with typescript. My data structure looks array within array. so I try to use the useFieldArray
allName: [
    {
      name: "useFieldArray1",
      nestedArray: [
        { name1: "field1", name2: "field2" },
        { name1: "field3", name2: "field4" }
      ]
    },
    {
      name: "useFieldArray2",
      nestedArray: [{ name1: "field1", name2: "field2" }]
    }
  ]

But when I try to set the name for the input like allName[${nestIndex}].nestedArray
I got the below warning.
Type 'string' is not assignable to type '"allName" | `allName.${number}.nestedArray`'

Here I have attached the code sandbox link of my code.
https://codesandbox.io/s/gallant-buck-iyqoc?file=/src/nestedFieldArray.tsx:504-537
How to fix this issue?

A: Hello couple things I see,

1) you have to cast it to that type that you exported or const the compiler needs to be aware of the type explicitly.

2) I also noticed you have ` vs ' ticks/quote

3. ps. const works on the later/newer version of Tyspescript compiler, but for older versions if you change it any it should work!

 //option 1
 name: `allName.${nestIndex}.nestedArray` as const

// option 2 for older versions
name: `allName.${nestIndex}.nestedArray` as any

 // or if assigning a variable, but it wont work in your code
 // let name = <const> `allName.${nestIndex}.nestedArray`


text:
Q: sessions and cookies with roles in php The way I designed my roles in php is the following. When a user logs in the code checks whether the user is the moderator.
If he is a simple user, he gets a cookie that isnt requiring to have https. Otherwise,
if he is a moderator, I assign a special session like this:
ini_set('session.use_only_cookies',true);
session_start();

     //generate pass for the database && session
    $pass=microtime().Moderator::generate_salt(30);
    //Insert pass
    Moderator::insert_moderator($pass);

    //Encrypt the pass and give it back to the users session ID
    $_SESSION["mod"]=$mod->encrypt_pass($pass);

The code above takes the login time the moderator logs in, attaches a random salt, and inserts or updates the moderators pass depending if the session started or is over (in this case it is the first time, the mod is assigned the session as he logs in).
Also notice that this is the encryption and dycryption alogrithm I use:
       public function encrypt_pass($session_id)
   {
       $session_id=strip_tags($session_id);
       $session_id=trim($session_id);
       //inititialization vector is being created.- a seed for random encryption and decryption
       srand((double)microtime()*10000);
       //opens an ecryption algorithm for use.
       $this->td=mcrypt_module_open(MCRYPT_RIJNDAEL_256,'',MCRYPT_MODE_CFB,'');
       //creates an IV for out encryption. Two parameters: size of IV ti create and method used to create IV
       $this->iv=mcrypt_create_iv(mcrypt_enc_get_iv_size($this->td), MCRYPT_RAND);
       //get maximum size the algorithm will take.
       $this->ks=mcrypt_enc_get_key_size($this->td);
       //here teh key is created
       $this->keys=substr(sha1(Moderator::generate_salt()),0, $this->ks);
       //initialize the algorithm engine using , IV, and key we selected
        mcrypt_generic_init($this->td,$this->keys,$this->iv);
       //Two parameters, the algorithm resource and the data we actually want to encrypt. returns an incrypted value
       $this->ciphertext=mcrypt_generic($this->td,$session_id);
       //clean up!! parameter is -- algorithm resource
       mcrypt_generic_deinit($this->td);
       //end clean up!!
       mcrypt_module_close($this->td);
       //Goes to the moderators session $_SESSION['$ciphertext']
       return $this->ciphertext;
   }

   public function decrypt_pass($session_id)
   {
       $session_id=strip_tags($session_id);
       $session_id=trim($session_id);

       mcrypt_generic_init($this->td, $this->keys,$this->iv);
       $plaintext=mdecrypt_generic($this->td,$session_id);
       mcrypt_generic_deinit($this->td);
       mcrypt_module_close($this->td);
   }

This should prevent me from session fixation/hijacking, it would be simply too hard for a hacker to catch the moderators session id, and even if he did, as soon as the moderator makes another request the password resets itself and if he closes the browser the session ends. This leaves the hacker with a small time frame to get the password and pretend to be the moderator.
The question: Is this enough to cope with session hijacking/fixation or should I add any other precautions?
Notice that it is true that the way I use this algorithm slows the requests and responses. But there will be limited number of moderators, no more than 10.
The code updates itself with every request of the moderator,

A: Weakness of your algorithm is that you don't anyhow identify particular user. You're just putting there time and some random salt.
To prevent session/cookie hijacking you need to put into encrypted string as many identification factors as you can. For example, client's os, user-agent, browser version, ip, forwarded ip, etc ... . In this case you will decrypt string that you have sent to user, assuming that only you can decrypt it, because only you have an AES key, and will verify all parameters that you've inserted into encrypted string. Failure of even one factor verification means that probably someone hijacked session and you need to destroy it.
I will advice you to look at Suhosin at http://www.hardened-php.net/suhosin/. This is a PHP plugin that makes everything described above for you. It is transparent and lightweight.
When using Suhosin be aware of setting cookies via javascript, because javascript sets unecrypted cookie and though server can't read it.


text:
Q: How to force a newly created window to the foreground? I'm launching apps usin gtk-launch.  The app launches, however, if another instance of the app exists, the app doesn't come to the foreground.
Is there anyway I can force the last created window to the foreground?
Here's the code I'm using:
open_app(){
    msg="Launching app..."
    notify-send "$msg"; echo "$msg"
    qvm-run "$execution_qube" gtk-launch "$app_path" && exit # debian qubes
    qvm-run "$execution_qube" /usr/share/applications/"$app_path" && exit # fedora qubes
}

A: I use: wmctrl -a.
wmctrl -l .. a list of all opened windows, the last opened is the last one in the list
wmctrl -a [winname]

or
wmctrl -ia [winidHEX]


text:
Q: App was not working in some mobile devices I developed an application. My application includes video recording and playing.
I have to play video what I have recorded from mobile. This is working in most of devices(Samsung galaxy ace,Motorola Droid x, etc.,) and not working in some of devices(Droid x2,Nexus,etc.,).
I used below code for video playing
String temp_path=Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)+"/MySaveCellData/dbz_115.3gp";
    //Toast.makeText(this,getSaveCellPath(),Toast.LENGTH_LONG).show();
    if(temp_path!=null) {
            //int width = myView.getMeasuredWidth();
          //  int height = myView.getMeasuredHeight();
            //we add 10 pixels to the current size of the video view every time you touch
            //the media controller.
        Display display = getWindowManager().getDefaultDisplay();
        int width = display.getWidth();
        int height = display.getHeight();
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(myView);
        myView.setMediaController(mediaController);

        myView.setKeepScreenOn(true);

        //myView.setVideoAspect(width,height);
        //myView.setVideo
        myView.setVideoPath(temp_path);
        myView.start();
        myView.requestFocus();
    }
    else
        Toast.makeText(this,"Video Path Not Found, or is set to null",Toast.LENGTH_LONG).show();
}

What is the problem and solution?

A: The problem is not in video playing. The problem in video recording. When I record the video the hardware of device is not supporting to my code. So I changed the code of video recorder. It is working well in all devices.


text:
Q: what is the functionality of these methods "isIgnoreText()" and " isIgnoreGraphic()" in JAVAFX I recently started working with javafx.
I changed the jdk from 8 to 11 and using JAVAFX 15 version  in the project and there is a class that uses these method "isIgnoreText()" and "isIgnoreGraphic()" here am getting error like these
The method isIgnoreGraphic() from the type LabeledSkinBase<TableRow> is
not visible
- The method isIgnoreText() from the type LabeledSkinBase<TableRow> is not
visible
private void updateShowColumns() {
    boolean newValue = (isIgnoreText() && isIgnoreGraphic());

    if (showColumns == newValue)
        return;

    showColumns = newValue;

    this.getSkinnable().requestLayout();

}

I am not able to understand what this method does and how to rewrite this code for JavaFX 15


text:
Q: Autocomplete-Textview with listener My question is very basic, as is my experience! Sorry about the length of the post!
I am trying to create an AutoCompleteTextView with a listener so that I can do "stuff" when an item is selected.
The AutoCompleteTextView works fine, in so far as I can type in 2 characters and then select an item from the list which appears.
But the application never executes the listener code.
All my code, xml and log trace is here, so what is the simple piece that I am missing?
I've searched all the questions and it seems to be a common problem but none of the (very few) answers work for me.
Any help will be appreciated.
SOURCE
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.TextView;

public class A_New_StartActivity extends Activity {

private final String LOG_TAG = "CJM";
private static String result = "No result";
private static final String[] myitems =  {
"Item 1",
"Item 2",
"Item 3",
"Item 4",
"Item 5"
};
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    Log.d(LOG_TAG, "Entered onCreate");

    ArrayAdapter<String> itemAdapter = new ArrayAdapter<String>(this, R.layout.destination_item, myitems);
    AutoCompleteTextView itemView = (AutoCompleteTextView) findViewById(R.id.autocomplete_items);
    itemView.setAdapter(itemAdapter);

    itemView.setOnItemSelectedListener(new OnItemSelectedListener() {
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
            result = "Selected";
            Log.d(LOG_TAG, "Showing Result 1");
            TextView result_view = (TextView) findViewById(R.id.result_view);
            result_view.setText(result);
            View scroll_visibility = findViewById(R.id.result_scroll);
            scroll_visibility.setVisibility(View.VISIBLE);
            View result_visibility = findViewById(R.id.result_view);
            result_visibility.setVisibility(View.VISIBLE);
        }
        public void onNothingSelected(AdapterView<?> parent) {
            Log.d(LOG_TAG, "In Nothing Selected");
            result = "Nothing";
            Log.d(LOG_TAG, "Showing Result 2");
            TextView result_view = (TextView) findViewById(R.id.result_view);
            result_view.setText(result);
            View scroll_visibility = findViewById(R.id.result_scroll);
            scroll_visibility.setVisibility(View.VISIBLE);
            View result_visibility = findViewById(R.id.result_view);
            result_visibility.setVisibility(View.VISIBLE);
        }
    });
    Log.d(LOG_TAG, "completed onCreate");
}
}

MAIN.xml in R.layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp" >

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="10dp" >
</TextView>

<TextView
    android:id="@+id/item_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:text="@string/request_item"
    android:visibility="visible" />

<AutoCompleteTextView
    android:id="@+id/autocomplete_items"
    android:completionThreshold="2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp"
    android:visibility="visible" />

<ScrollView
    android:id="@+id/result_scroll"
    android:layout_width="220dp"
    android:layout_height="290dp"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="50dp"
    android:visibility="invisible" >

    <TextView
        android:id="@+id/result_view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:maxLines="5"
        android:scrollbars="vertical"
        android:text="@string/result"
        android:visibility="invisible" />
</ScrollView>

<Button
    android:id="@+id/reset_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="125dp"
    android:text="@string/button_text" />

DESTINATION_ITEM.xml in R.layout
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

STRINGS.xml in R.values
<resources>

<string name="app_name">A_New_Start</string>
<string name="request_item">Please enter the first 2 letters of the item</string>
<string name="result">Initialised</string>
<string name="button_text">OK</string>

LOG output
05-26 10:19:05.550: D/CJM(269): Entered onCreate

05-26 10:19:05.570: D/CJM(269): completed onCreate

A: You are setting wrong Listener for AutoCompleteTextView. You have to set addTextChangedListener() and do the processing in the override methods of addTextChangedListener.


text:
Q: java :loop user inputs individually I have a program which tells the user to input three ints and  converts each one to a string. I.e 1 = one ; ...etc. The problem here is defining the ints for every user input. How can i get it with just one input and loop it to take another, considering to separate inputs so we can use it individually in every phrase down here.
public static void main(String[] args) {

    String[] i = { "zero" , "one" , "two" , "three" , "four" ,
                    "five", "six", "seven" , "eight" , "nine" , "ten" };

    Scanner in = new Scanner(System.in);

    System.out.println("I have ..... Networking books, ..... Database books, and ..... Programming books. ");

    String text = "" , text1 = "", text2 = "" ;
    // loop i/p and using it in every phrase seperatellty

    for (int a = 1; a <= 1; a++) {
        int word = in.nextInt();
        int word1 = in.nextInt();
        int word2 = in.nextInt();

        text = i[word];
        text1 = i[word1];
        text2 = i[word2];
    }

    System.out.println("I have " + text + " Networking books, "
                                        + text1 + "  Database books, and "
                                        + text2 +" Programming books. ");

}}

A: Perhaps this is what you are trying to do
Note:
You have missed range check for the entered no. This will throw ArrayIndexOutOfBoundExceptionif you are trying to access the array i for indices above 10
import java.util.*;
class UserInputReader {

    private static final int EXPECTED_NUM_COUNT = 3;

    public static void main(String[] args) {
        String [] i = { "zero" , "one" , "two" , "three" , "four" ,
                    "five", "six", "seven" , "eight" , "nine" , "ten" };

        Scanner in = new Scanner (System.in);
        String[] words = new String[EXPECTED_NUM_COUNT];

        int numCount = 0;
        while(numCount < 3) {
            System.out.println("Enter the number");
            int num = in.nextInt();
            if (num >= 0 && num <= 10) {
                words[numCount] = i[num];
                numCount++;
            } else {
                System.out.println("Enter no is invalid. Try again entering a number between 0 - 10");
            }
        }

        System.out.println("Entered nums " + Arrays.toString(words));

    }
}


text:
Q: flatten ruby hash into array with keys removed Is there a quick way to flatten a hash into an array with the keys removed?
h={:at => [10, 20], :width => 100, :height => 200}

and result to:
[[10, 20], 100, 200]

A: This is pretty easy:
h.values

If you want it in a particular order you'll need to do some more work.

A: There is a built-in hash method: h.values


text:
Q: Make TextView as wide as possible without crowding out other views I want the following layout handling in my app:

As you can see, the text is allowed to be as wide as it can be without pushing off the screen the other views that appear to its right, ellipsizing as necessary. There will never be more than 3 color swatches, and no fewer than 1, and all swatches and the x in the circle must always be visible. When the text is short, it should behave as seen in the last 2 rows (the ferns).
I've tried to put the text and images in a LinearLayout, but when the text is too long the images are not visible (or not entirely visible). I assume there's some way to indicate that the images should always take up as much room as they need, with the TextView taking up the rest or as much as it needs, but I can't seem to figure out how. I don't know if a RelativeLayout would work better for this, or maybe a TableLayout/TableRow or GridLayout, though nothing I've read seems to cover this situation.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
    android:id="@+id/plant_name"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:maxLines="1"
    android:singleLine="true"
    android:ellipsize="end"
    android:layout_marginRight="3dp"/>

<LinearLayout
    android:id="@+id/color_0"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="2dp"
    android:layout_marginRight="2dp">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/btn_remove_plant"
        android:visibility="invisible"/>
</LinearLayout>

<LinearLayout
    android:id="@+id/color_1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="2dp"
    android:layout_marginRight="2dp"
    android:visibility="gone">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/btn_remove_plant"
        android:visibility="invisible"/>
</LinearLayout>

<LinearLayout
    android:id="@+id/color_2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="2dp"
    android:layout_marginRight="2dp"
    android:visibility="gone">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/btn_remove_plant"
        android:visibility="invisible"/>
</LinearLayout>

<ImageView
    android:id="@+id/remove_plant"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/btn_remove_plant"
    android:layout_marginLeft="3dp"/>

</LinearLayout>

A: Here is a working layout. Two things that are happening. One, the rows are using LinearLayout with layout_width="wrap_content". This keeps the LinearLayout from expanding beyond its content keeping everything left aligned (your bottom two examples). Two, the TextView is using android:layout_weight="1" and android:layout_width="0dp" to tell the LinearLayout that it should expand this TextView to fill the rest of the space of available but to not push out the other views (your top three examples). Note: this is not all layout_weight does, only that this is what it is doing in this context.
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:lines="1"
            android:text="This is a long line of text and is testing something. This is a long line of text and is testing something. This is a long line of text and is testing something." />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#F00" />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#0F0" />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#00F" />

        <Button
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:lines="1"
            android:text="This is a long line of text and is testing something. This is a long line of text and is testing something. This is a long line of text and is testing something." />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#F00" />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#0F0" />

        <Button
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:lines="1"
            android:text="This is some line of text." />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#F00" />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#00F" />

        <Button
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:lines="1"
            android:text="This is short" />

        <View
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:background="#F00" />

        <Button
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp" />
    </LinearLayout>

</LinearLayout>

A: This code gives you the screen size in dp and pixels. Set your images at a fixed size that you like, for example 30dp or Math.min(screenWidth,screenHeight)/100 to set it relative to the display size.
After that, since you know how many images will be shown substruct the (number of images) * imageSize from the tottal screenWidth and set this as the textview width
WindowManager wm2 = (WindowManager) con.getSystemService(Context.WINDOW_SERVICE);
Display display = wm2.getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics ();   display.getMetrics(outMetrics);
float density  = getResources().getDisplayMetrics().density;
dpHeight  = (int) (outMetrics.heightPixels / density);
dpWidth  = (int) (outMetrics.widthPixels / density);
screenWidth=outMetrics.widthPixels;
screenHeight=outMetrics.heightPixels;

this is how you set the textview's width programmatically
LinearLayout.LayoutParams params=(LinearLayout.LayoutParams)textView.getLayoutParams();
params.width=/calculated size/;
textView.setLayoutParams(params);

A:
When the text is short, it should behave as seen in the last 2 rows (the ferns).

I don't think that a standard layout is going to give you what you want. My guess is that you will have to create a custom ViewGroup that implements your requirements. Qberticus' implementation is probably as close as you'll get using out-of-the-box layouts.
That being said, I can't rule out GridLayout being able to pull this off, somehow.
Personally, I'd go with a TableLayout, with four columns for your color swatches and X icons, and a fifth column for the text. You could dynamically construct the table rows to have the text fill columns that are not going to be used by swatches, and you would use android:strechColums="0" to give all extra space to the left-most column where the text is based. As with Qberticus' approach, this leaves you with right-flush swatches and icons, which IMHO is a better UI.
If your concern with the right-flush swatches and icons is having gaps of whitespace between the text and the swatches/icons, make the text have right gravity (or end if you are support RTL languages).


text:
Q: Different actionRequest by environment I have a different behaviour / different actionRequest in localhost and other environment.
The line in question is:
String redirect = ParamUtil.getString(actionRequest, "redirect");

In local that actionRequest have the param "Redirect", but in the other environment is NULL.
How can i print or check where or why this request is null?

A: As Parkash requested to me, I attached the snapshot of the view.
I have problems only when i try to delete ("Eliminar") the content.


text:
Q: How to fix sequelize connection issue while generating index.js? I new in node.js and have some problems with sequelize-cli.
I have sequelize model and while I run the project, i get error in my index.js:
const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes);
TypeError: require(...) is not a function

The project can't find or read this (sequelize, Sequelize.DataTypes).
My project: server.js
const express = require("express");
const productRouter = require("./routers/productRouter");
const discountRouter = require("./routers/discountRouter")

const app = express();
const PORT = process.env.PORT || 3000;

app.use(express.json());

// Запрос на таблицу с продуктами
app.use("/shop", productRouter);
// Запрос на таблицу со скидками
app.use("/shop", discountRouter);

app.listen(PORT, () => console.log("Server is working ... "));

productRouter.js
const Router = require("express");
const router = new Router();
const productController = require("../controllers/productControllers");

// Получаем все товары
router.get("/products", async (req, res, next) => {
    const resultOfGetAllProducts = await productController.all();
    if(resultOfGetAllProducts === Error) {
        return res.sendStatus(500).json(Error);
    } else {
        return res.sendStatus(200).json(resultOfGetAllProducts);
    };
});

// Получаем конкретный товар
router.get("/product/:id", async (req, res, next) => {
    if(!req.params.id) return res.sendStatus(400).send("Product ID is not specified.");
    const id = req.params.id;
    const result = null;
    const resultOfGetOneProduct = await productController.one(id, result);
    if(resultOfGetOneProduct === Error) {
        return res.sendStatus(500).json(Error);
    } else {
        return res.sendStatus(200).json(resultOfGetOneProduct);
    };
});

// Добавляем товар
router.post("/product", async (req, res, next) => {
    if(!req.body) return res.sendStatus(400).send("Product parameters are not specified.");
    const product = {
        product_name: req.body.product_name,
        price: req.body.price,
        product_description: req.body.product_description
    };
    const result = null;
    const resultOfCreateProduct = await productController.create(product, result);
    if (resultOfCreateProduct === Error) {
        return res.sendStatus(500).json(Error);
    } else {
        return res.sendStatus(200).send("The product has been created.");
    }
});

// Обновляем товар
router.put("/product/:id", async (req, res, next) => {
    if(!req.params.id) return res.sendStatus(400).send("Product ID is not specified.");
    if(!req.body) return res.sendStatus(400).send("Product parameters are not specified.");
    const product = {
        product_name: req.body.product_name,
        price: req.body.price,
        product_description: req.body.product_description
    }
    const id = {id: req.params.id};
    const result = null;
    const resultOfUpdateProduct = await productController.update(id, product, result);
    if(resultOfUpdateProduct === Error) {
        return res.sendStatus(500).json(Error);
    } else {
        return res.sendStatus(200).send("The product has been updated.");
    };
});

// Удаляем товар
router.delete("/product/:id", async (req, res, next) => {
    if(!req.params.id) return res.sendStatus(400).send("Product ID is not specified.");
    const id = {id: req.params.id};
    const result = null;
    const resultOfDeleteProduct = await productController.delete(id, result);
    if(resultOfDeleteProduct === Error) {
        return res.sendStatus(500).json(Error);
    } else {
        return res.sendStatus(200).send("The product has been deleted.");
    }
});

module.exports = router;

productControllers.js
const productModels = require("../models/productModels");

exports.all = async function getAllProducts() {
    const result = await productModels.all(function(err, docs) {
        if (err) {
            console.log(err);
            return err;
        } else {
            return docs;
        };
    });
    return result;
};

exports.one = async function getOneProduct(id, cb) {
    const result = await productModels.one(id, function(err, doc) {
        if (err) {
            console.log(err);
            return err;
        } else {
            return doc;
        }
    });
    cb = result;
    return cb;
};

exports.create = async function createProduct(product, cb) {
    const confirmationOfCreate = await productModels.create(product, function(err, result) {
        if (err) {
            console.log(err);
            return err;
        } else {
            return result;
        }
    });
    cb = confirmationOfCreate;
    return cb;
};

exports.update = async function updateProduct(id, product, cb) {
    const confirmationOfUpdate = await productModels.update(id, product, function(err, result) {
        if (err) {
            console.log(err);
            return err;
        } else {
            return result;
        }
    });
    cb = confirmationOfUpdate;
    return cb;
};

exports.delete = async function deleteProduct(id, cb) {
    const confirmationOfDelete = await productModels.delete(id, function(err, result) {
        if (err) {
            console.log(err);
            return err;
        } else {
            return result;
        }
    });
    cb = confirmationOfDelete;
    return cb;
};

productModels.js
const Sequelize = require("sequelize");
const productsModel = require("./products.js");
const db = require("./index.js");

// Получаю с бд все продукты
exports.all = async function getProducts(cb) {
    //const products = await db.query('SELECT * FROM products');
    const products = await db.findAll({raw: true});
    if(products === null) {
        return cb(Error, null);
    } else {
        return cb(null, products);
    };
};

// Получаю с бд конкретный продукт
exports.one = async function getOneProduct(id, cb) {
    //const getOneQuery = 'SELECT * FROM product where id = $1';
    //const getDiscount = 'SELECT * FROM discounts where product_id = $1';
    //const curDiscount = await Discount.findOne({where: id});
    const product = await db.findAll({where: {id: id}});
    const productDiscount = await Discount.findAll({where: {product_id: id}});
    const priceWithDiscount = product.price - (product.price * ((productDiscount.discount)/100));
    if (product === null) {
        return cb(Error, null);
    } else if(productDiscount === null) {
        return cb(null, product)
    } else {
        product.price = priceWithDiscount;
        const result = product;
        return cb(null, result);
    };
};

// Создаю в бд продукт
exports.create = async function createProduct(product, cb) {
    // const createQuery = 'INSERT INTO product (product_name, price, product_description) values ($1, $2, $3) RETURNING *';
    // const arrayQuery = [product.product_name, product.price, product.product_description];
    // const newProduct = await db.query(createQuery, arrayQuery);
    const newProduct = await db.create(product);
    if(newProduct === null) {
        return cb(Error, null);
    } else {
        return cb(null, newProduct);
    };
};

// Обновляю в бд конкретный продукт
exports.update = async function updateProduct(id, newData, cb) {
    // const updateQuery = 'UPDATE product set product_name = $1, price = $2, product_description = $3 where id = $4 RETURNING *';
    // const arrayQuery = [newData.product_name, newData.price, newData.product_description, id];
    const product = await db.update(newData, {where: id});
    if(product === null) {
        return cb(Error, null);
    } else {
        return cb(null, product);
    };
};

// Удаляю в бд конкретный продукт
exports.delete = async function deleteProduct(id, cb) {
    //const deleteQuery = 'DELETE FROM product where id = $1';
    const product = await db.destroy({where: id});
    if(product === null) {
        return cb(Error, null);
    } else {
        return cb(null, product);
    };
};

product.js
'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class products extends Model {
    /**
     * Helper method for defining associations.
     * This method is not a part of Sequelize lifecycle.
     * The `models/index` file will call this method automatically.
     */
    static associate(models) {
      // define association here
    }
  };
  products.init({
    product_name: DataTypes.STRING,
    price: DataTypes.NUMBER,
    product_description: DataTypes.STRING
  }, {
    sequelize,
    modelName: 'products',
  });
  return products;
};

index.js
'use strict';

const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const basename = path.basename(__filename);
const env = process.env.NODE_ENV || 'development';
const config = require(__dirname + '/../config/config.json')[env];
const db = {};

let sequelize;
if (config.use_env_variable) {
  sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
  sequelize = new Sequelize(config.database, config.username, config.password, config);
}

fs
  .readdirSync(__dirname)
  .filter(file => {
    return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js');
  })
  .forEach(file => {
    const model = require(path.join(__dirname, file))(sequelize, Sequelize.DataTypes);
    db[model.name] = model;
  });

Object.keys(db).forEach(modelName => {
  if (db[modelName].associate) {
    db[modelName].associate(db);
  }
});

db.sequelize = sequelize;
db.Sequelize = Sequelize;

module.exports = db;

Also i have migration's and config's files.
What I must to do to issue this errors or another problems?

A: Move productModels.js to 'repository' directory
because, there is no 'default' export in this file
And, db operation file cannot sit in models folder

I fixed that, and upload to git https://github.com/nkhs/node-sq-stack.git


text:
Q: Silverlight Custom Validation I have a Silverlight App in which I am using data binding, INotifyPropertyChanged and CustomValidation to perform validation on my input screens.
On one of my input screens the custom validation is dependent on a category the user selects. Based on the category, certain fields become mandatory or not.
The way my input screens work, incorrect input fields get a red box around them when they are not valid. My problem however, is that the validation in the background is working but it does not update on the screen, i.e. the user has no visual que that a certain field is now mandatory.
Fields which become mandatory as a result of a category change, do not get the red box around them unless the user goes into the field and change it.


text:
Q: ExactTarget: URL in a variable - not tracked I believe I've come across a bug.  I wondered if anyone else have come up with a solution for this?
%%[
set @bodycopy = "Visit the all new whatever I'm talking
                 about. Click here!!"
]%%
%%=v(@bodycopy)=%%

(Spacing/linebreak added to code for legibility on StackExchange.)
The HREF doesn't go to ExactTarget and counted as a click.  It renders fine and the click functions perfectly as far as the subscriber is concerned (perhaps even faster than tracked links) but I don't get credit for the click.
I've also tried
set @bodycopy = Concat("Visit the all new whatever I'm talking about. Click
                here!!")

(Spacing/linebreak added to code for legibility on StackExchange.)
with the same results.
I don't have the luxury of splitting the variable into multiple parts or just rendering in HTML.  As near as I can tell...
The options I can think of...

*

*I have the link in my variable and don't track it

*throw out my entire template for these rare cases with a link

*refactor my code to have four variables (before link, link url, link copy, after link) for these rare cases

*convince Salesforce they have a bug

*manually insert the http://click.em.whatever.con in front of the final destination (if that's possible?)

I'll be forever grateful if someone's got a solve or another option I haven't thought of.


text:
Q: Eclipse generating equals method: if ( obj == null ) vs. if ( null == obj ) Eclipse likes to generate equals methods (for classes having no super class) with a nullcheck like this:
if ( null == obj )
    return false;

However, I like
if ( obj == null )
    return false;

much more, because it is more readable. (It kind of disturbs me all the time.)
Q:
Why does Eclipse generate it with null coming before obj, given that the if ( null == obj ) is an obsolete practice stemming from C/C++ as described here?:
(obj == null) vs (null == obj)?
Are there any (runtime) differences between the two? I can only speculate...

Update:
Eclipse Kepler seems to generate if ( obj == null ), so this applies to former Eclipse versions only.
Class before:
public class Burp
{
    private Long id ;

    public Burp()
    {
        // test
    }
}

Class after:
public class Burp
{
    private Long id ;

    public Burp()
    {
        // test
    }

    // hashCode() omitted

    @Override
    public boolean equals( Object obj )
    {
        if ( this == obj )
            return true;
        if ( obj == null )
            return false;
        if ( getClass() != obj.getClass() )
            return false;
        Burp other = ( Burp ) obj;
        if ( this.id == null )
        {
            if ( other.id != null )
                return false;
        }
        else if ( !this.id.equals( other.id ) )
            return false;
        return true;
    }
}

I think we have some cleaning up to do for our pre-Kepler generated equals methods.

A: Some people write null == obj instead obj == null, because there is no risk to type = instead of ==, but it doesn't change how your code works. Keep in mind that in Java it's only possible to write obj = null (without an error) when obj is Boolean. This way of writing code comes from other programming languages like C where it's completely valid to write obj = null by mistake.

A: You can modify the template for generating equals method in Eclipse, refer the following link
As far as Runtime differences between the two are concerned I think both the expressions should be the same as the compiler would optimize both the null check expressions in a similar way (i.e same bytecode will be generated). Its more about what conventions people like to use , and it varies from person to person.

A: There is no difference and the convention in Java (if we assume that the JDK is a reference) is to use if (obj == null). See for example the code of Objects#requireNonNull:
public static <T> T requireNonNull(T obj) {
    if (obj == null)
        throw new NullPointerException();
    return obj;
}

For what it's worth, Netbeans auto-generates equals with if (obj == null) return false;.
Whichever you use won't make a difference at runtime and will generate the same bytecode.

A: also some people like Master Yoda style where you compare constant and then varible
if (5 == i) -- Yoda style


text:
Q: Will purchases from Heroes of the Storm remain once the final version is launched? I have used some gold to buy a hero in "Heroes of the Storm". Will that hero remain after the final game is released or will all the money disappear? Please cite your source if you answer the question.

A: After this announcement the 10th of July 2014 there shouldn't be any more wipes as far as gold and XP go.

... Also, there are no more planned wipes, so any XP and gold you earn from this point on will remain in your account for good... source

With the transition from alpha to beta there weren't any wipes. Neither from closed beta to open beta.
It'll be very strange for Blizzard to wipe all purchased content. Especially content that you can only purchase during the beta phase (certain mounts).


text:
Q: How to create a matching problem where only one party indicates preference I want to set up a matching algorithm for the following problem:

*

*Goal: we want to match a mentee with a mentor; each mentee will indicate top 3 mentor that they wish to be matched with

*Constraint: 1 mentee will only be matched with 1 mentor, and 1 mentor can only be matched to at most 2 mentees

*Question: how to create an algorithm to automatically find the optimal matching?

Is there an existing algorithm for this? If so what is the name? I can only find Gale-Shapley algorithm, but in that case both parties indicate preference for each party.


text:
Q: Bootstrap, datatable, AJAX, search I understand that there is AJAX: https://datatables.net/examples/data_sources/server_side.html
and there is searching: https://datatables.net/examples/api/multi_filter.html
but I have no idea how to combine the two. Exactly, when .search, which column does it search by? And what if I want to connect the conditions with ADD ?

A: In server-side processing mode, jQuery DataTables sends the following parameters among many others:

search[value]   Global search value. To be applied to all columns which have searchable as true.
columns[i][search][value]   Search value to apply to this specific column.

So in the request there would be global search value and search value for each individual column ( columns[0][search][value], columns[1][search][value], etc.).
You would need to construct your database query to handle both parameters and return result in the appropriate format.
If you're using PHP, there is ssp.class.php that does it for you. Otherwise you may want to search for a library for your language of choice or write your own from scratch.
See server-side processing for more information.


text:
Q: angular2 2.0.0-beta.6 routing Hey Everyone i have a question with Angular 2 routing:
i have this app component (working normally and showing its content)
import {Component, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router';
import {bootstrap} from "angular2/bootstrap";
import {Floors} from "./Component/floors";
import {RoomService} from "./service/room.service";
import {Campus} from "./Component/campus";
import {RoomDetail} from "./Component/room.detail";

@Component({
    selector: 'my-app',
    templateUrl: 'app/partials_html/app.component.html',
    styleUrls: ['app/partials_css/app.component.css'],
    directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
    {path: "/...", as: "Floors", component: Floors},
    {path: "/Floors/...", as: "Floors", component: Floors},
    {path: "/roomDetail/:id", as: "RoomDetail", component: RoomDetail}
])
export class AppComponent {
    constructor() {
    }
}

html of this component:

floors

<router-outlet></router-outlet>

and then i have this Floors component
import {Component, ViewEncapsulation} from 'angular2/core';
import {Router, RouteParams} from 'angular2/router';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router';
import {CORE_DIRECTIVES} from "angular2/common";
import {FORM_DIRECTIVES} from "angular2/common";
import {Room} from "./../entity/room";
import {FloorList} from "./floor.list.component";
import {FloorMap} from "./floor.map.component";
import {RoomService} from "../service/room.service";
import {Campus} from "./campus";
import {RoomDetail} from "./room.detail";

@Component({
    selector:'floors',
    templateUrl: 'app/partials_html/floors.html',
    directives: [CORE_DIRECTIVES, FORM_DIRECTIVES]
})

@RouteConfig([
    {path: "/floorList/:id", as: "FloorList", component: FloorList},
    {path: "/floorMap/:id", as: "FloorMap", component: FloorMap},
])
export class Floors {
    private listViews:string[] = ["MapView", "Listview"];
    private listFloors:number[] = [1, 2, 3, 4];
    private selectedView:string = "MapView";
    private selectedFloor:number = 1;

    router:Router;

    constructor(router:Router) {
        this.router = router;
        this.setCorrectView();
    };

    onSelectFloor(floor:number) {
        this.selectedFloor=floor;
    }

    onSelectView(view:string) {
        this.selectedView=view;
        this.setCorrectView();
    }

    listView(floor:number) {
        this.router.navigate(['/FloorList', {id: floor}]);
    }

    mapView(floor:number) {
        this.router.navigate(['/FloorMap', {id: floor}]);
    }

    setCorrectView() {
        if (this.selectedView = "MapView") {
            this.mapView(this.selectedFloor);
        }
        if (this.selectedView = "Listview") {
            this.listView(this.selectedFloor)
        }

    }
}

but its not showing it's html content:

            test
            <select>
                <option *ngFor="#view of listViews "
                        (change)="onSelectView($event.target.value)">{{view}}
                </option>
            </select>

            <select>
                <option *ngFor="#floor of listFloors "
                        (change)="onSelectFloor($event.target.value)">{{floor}}
                </option>
            </select>

<router-outlet></router-outlet>

i have tried many examples, adding extra things that are also in appComponent,...
Am i missing something here,
I want to accomplish that Floor is shown in appcomponent (working) And that FloorList anf FloorMap are shown in floors
I would really apreciete the help


text:
Q: Cross domain XSS I am trying to execute an XSS inside the <iframe> that I am invoking in my website/browser for another legitimate website.
Here is what I have worked around though,which doesn't work.
<iframe src="legitwebsite.com" id="targetFrame" onmouseover="document.getElementById('targetFrame').contentWindow.alert(document.location.href);">

I don't know if this is workable or not, but I believe that if a website has clickjacking vulnerability, then it can probably be escalated to an XSS even on non-sensitive pages using this.
Any thoughts?


text:
Q: Nodal analysis for nonlinear elements I have this circuit. I'm trying to find the \$I_{3}, U_{3}, P_{3}\$. For the nonlinear element I have this volt-ampere characteristics: \$ I_{3} = 3U_{3}^2 -U_{3}\$.

That's what I am doing. Using the KCL \$ I_{1} = I_{2} + I_{3}\$. So \$1= I_{2}+I_{3}\$.
Using Ohm's law for \$ I_{2}\$  I have \$ 1 = 0,2U_{1}+I_{3}\$.
Usings KVL the equation is: \$ 0=I_{3}.R_{3}+U_{3} +U_{0}-U_{1}\$ and then \$ 0=3I_{3}+U_{3}-U_{1}\$.
I'm replacing \$ I_{3} \$ with \$ 3U_{3}^2 - U_{3}\$.
\$ 0 = 9U_{3}^2 - 3U_{3} +U_{3} -U_{1}\$;
then I get
\$U_{1} = 2U_{3}+9U_{3}^2\$
And I'm not sure what to do next. I saw an example with quadratic equation but i don't know to form the equation.

A: Try converting R1 and I1 (which are in a Norton equivalent configuration) to a Thévenin equivalent, that way you will have a voltage supply followed by one linear resistor and one nonlinear resistor (after you calculate the series equivalent resistance of the linear resistors you have).
This should give you just two equations, one from KVL and one from the fact that all elements have the same current going through them. The resulting equation for current/voltage will be a polynomial of degree 2.

A: In any case assuming your formulation is correct then:
Set -U1/9 == C
Set 2/9 == B
Then your equation becomes the familiar quadratic:
x^2 + Bx + C ==0
Which has two solutions:
x -> 1/2 (-B - Sqrt[B^2 - 4 C]) and
Substitute for B and C to get the solution, you may find one of these is meaningless for your particular case.
x -> 1/2 (-B + Sqrt[B^2 - 4 C])


text:
Q: Exception of type 'Microsoft.Rest.Azure.CloudException' was thrown I am trying to assign role on web app using VSTS but below error displayed.
Powershell :
$webappname = "devt002"
$resourcegroup = "devt002RG"

#Get webapp object id
$webapp = Get-AzureRmWebApp -ResourceGroupName "$resourcegroup" -Name "$webappname"
$objectid = [System.Guid]::Parse($webapp.Identity.PrincipalId)
write-host "Object ID datatype :" $objectid.GetType().FullName
write-host "Object ID :" $objectid

#Get Assign role if already exist
$roles = Get-AzureRmRoleAssignment -ObjectId $objectid
write-host "Already Assigned Roles :" $roles.RoleDefinitionName

Error :
2019-04-05T11:20:23.7408185Z ##[debug]Caught exception from task script.
2019-04-05T11:20:23.7408790Z ##[debug]Error record:
2019-04-05T11:20:23.7408993Z ##[debug]Get-AzureRmRoleAssignment : Exception of type 'Microsoft.Rest.Azure.CloudException' was thrown.

Note : It is working fine in local powershell client. Issue only with VSTS.

A: Check have you provided correct Object ID. If you are providing Object ID via Variables, Value needs to be changed.


text:
Q: What is the difference between PopUpWindow and Dialog? Basically the question is stated in the title. Any preferences in using one or another? Maybe some specific tasks where one is superior/ more efficient/ better than the other?

A: Dialog
"A dialog is a small window that prompts the user to make a decision or enter additional information. A dialog does not fill the screen and is normally used for modal events that require users to take an action before they can proceed."
AlertDialog has many variants and as far as I can assume your problem, You can have a cross button too in the top-right corner of the dialog (You can set the icons anywhere, as you can provide a custom layout to an AlertDialog).
-Capable of adding any view
-Easy to edit
-Can be adapted to tablets or cellphones in landscape or portrait just by modifying the layout
-Can dedicate a whole new class just to modify it your way
PopupWindows
"This class represents a popup window that can be used to display an arbitrary view. The popup window is a floating container that appears on top of the current activity."
PopupWindow is another tool to customize your custom pop up anywhere in the screen. If you're showing this popup always in the middle of the screen, then I would like to suggest not to use this. The AlertDialog should work fine.
-Simpler
-Easier to code
-It's more standard so it'll be harder for the user to be confused with it

A: Here are the differences between popup box and dialog box.  A dialog box typically has a question(s) and a prompt for an answer within the box itself.  For example, the box may have dialog that says, "Do you want to close the window?  There might be button such as CANCEL, YES, NO.
Therefore, there is a simulated dialog between the box and the user.
In a popup box, although there may be required input or selections from menus, dropdowns, etc., there will typically be no dialog because the box information itself is intuitive for the user.
Hope that helps to clarify it for you.

A: Dialog is designed for taking controlled action on popup events where you need to take action before proceed to continue next. It's auto-adjustable with the screen at center aligned manner.
But PopupWindow is informative popup which deals as layout. It can be shown anywhere in the screen as per position set and You can also use this with animated form as there is animation facility also with it.
So if you are looking for just show the information in popup then I suggest use PopupWindow and if you want some action control like "YES", "No" or any decision making action then go with Dialog.


text:
Q: Maven Build Issues : Reading jacoco.exec file We have several different faults with our jacoco.exec file, see the Error types below.
Can you please help us with this problem, we have at least 25% build failures due to Jacoco.
Error Type 1:
 09:18:17 [INFO] ------------------------------------------------------------------------
 09:18:17 [INFO] BUILD FAILURE
 09:18:17 [INFO] ------------------------------------------------------------------------
 09:18:17 [INFO] Total time: 02:02 min
 09:18:17 [INFO] Finished at: 2015-12-22T09:18:17+01:00
 09:18:17 [INFO] Final Memory: 148M/2933M
 09:18:17 [INFO] ------------------------------------------------------------------------
 09:18:17 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project athena: Unable to read /repo/jenkins/production/workspace/CSW_All_Build_PreMerge-gate/support-functions/Common/target/jacoco.exec: malformed input around byte 2 -> [Help 1]
 09:18:17 [ERROR]
 09:18:17 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 09:18:17 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 09:18:17 [ERROR]

Error type 2:
 11:44:13 [INFO] ------------------------------------------------------------------------
 11:44:13 [INFO] BUILD FAILURE
 11:44:13 [INFO] ------------------------------------------------------------------------
 11:44:13 [INFO] Total time: 02:04 min
 11:44:13 [INFO] Finished at: 2015-12-21T11:44:14+01:00
 11:44:13 [INFO] Final Memory: 141M/3045M
 11:44:13 [INFO] ------------------------------------------------------------------------
 11:44:13 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project athena: Unable to read /repo/jenkins/production/workspace/CSW_All_Build_PreMerge-gate/support-functions/Common/target/jacoco.exec: Invalid execution data file. -> [Help 1]
 11:44:13 [ERROR]
 11:44:13 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 11:44:13 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 11:44:13 [ERROR]
 11:44:13 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 11:44:13 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 11:44:14 Build step 'Execute shell' marked build as failure
 11:44:14 [htmlpublisher] Archiving HTML reports...

Error type 3:
 14:33:23 [INFO] ------------------------------------------------------------------------
 14:33:23 [INFO] BUILD FAILURE
 14:33:23 [INFO] ------------------------------------------------------------------------
 14:33:23 [INFO] Total time: 01:51 min
 14:33:23 [INFO] Finished at: 2015-12-21T14:33:23+01:00
 14:33:24 [INFO] Final Memory: 149M/2977M
 14:33:24 [INFO] ------------------------------------------------------------------------
 14:33:24 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project athena: Unable to read /repo/jenkins/production/workspace/CSW_All_Build_PreMerge-gate/support-functions/Common/target/jacoco.exec: Unknown block type 2d. -> [Help 1]
 14:33:24 [ERROR]
 14:33:24 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 14:33:24 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 14:33:24 [ERROR]
 14:33:24 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 14:33:24 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 14:33:24 Build step 'Execute shell' marked build as failure
 14:33:24 [htmlpublisher] Archiving HTML reports...

Versions:

*

*tried both jacoco-maven-plugin:0.7.4.201502262128 and
jacoco-maven-plugin:0.7.5.201505241946  org.testng:6.9.9

*org.apache.maven.plugins.maven-failsafe-plugin:2.18

*org.apache.maven.plugins.maven-surefire-plugin:2.18.1

*SonarQube 4.5.5  Sonar-maven-plugin 2.7.1