text:
Q: List reverse recursively Here's a code which reverse a list recursively in lisp :
( defun rev1( list final )
    ( if ( eq list () )
    final
        ( rev1( cdr list )  ( cons ( car list ) final ) ) ) )

( defun rev( list )
   ( rev list nil ) )

Could anyone explain me how the assignment between cons cell and the variable final works? Is it pointer to the head ( car ) of that cons cell?

A: The final is nil at the beginning and you just cons the first element of a list onto it each time.
e.g. you have a list say '( a b c) and the first run will make the final to be '(a) and the recursive call will be (rev1 '(b c) '(a)) accordingly.
And then it goes like this:
(rev1 '(c) '(b a))
this goes on and when the list is nil, the final variable is '(c b a), which is you want.


text:
Q: Pandas drop ending tail zeros in column, grouping by another column I've created following function do drop ending zeros in column "value" for each "proj".
But seems it's, so to speak, "not optimal") Hope someone coould give advise how to make it right.
Input tabble:
+---+------+---------+--------------+-------+
|   | proj | weeknum | weekduration | value |
+---+------+---------+--------------+-------+
| 0 |    1 |       1 |            4 |     0 |
| 1 |    1 |       2 |            4 |    11 |
| 2 |    1 |       3 |            4 |     0 |
| 3 |    1 |       4 |            4 |     0 |
| 4 |    2 |       1 |            4 |    10 |
| 5 |    2 |       2 |            4 |    11 |
| 6 |    2 |       3 |            4 |    12 |
| 7 |    2 |       4 |            4 |     0 |
+---+------+---------+--------------+-------+

For each "proj" we have to select and drop weeknum with "value" == zero, but only at the end (sort by "weeknum").
For this example I should get Indexes: 2, 3, 7
+---+------+---------+--------------+-------+
|   | proj | weeknum | weekduration | value |
+---+------+---------+--------------+-------+
| 0 |    1 |       1 |            4 |     0 |
| 1 |    1 |       2 |            4 |    11 |
| 4 |    2 |       1 |            4 |    10 |
| 5 |    2 |       2 |            4 |    11 |
| 6 |    2 |       3 |            4 |    12 |
+---+------+---------+--------------+-------+

My simple draft code:
abnrm_list = []
for i in df.proj.unique():
    d = df[df['proj'] == i]
    last_week = d['weeknum'].max()
    cs_hrs = d[d['weeknum'] == last_week]['value'].values[0]
    while cs_hrs == 0:
        abnrm_list.append(d[d['weeknum'] == last_week].index[0])
        last_week = last_week - 1
        cs_hrs = d[d['weeknum'] == last_week]['value'].values[0]

But I'm sure should be some simpler clearer solution to this.
Also, need to update "weekduration" to new value after dropping zero rows.

A: Use boolean indexing with filter out last 0 values compared by Series.ne in helper Series created by swapping order of columns with GroupBy.cumsum:
mask = df['value'].iloc[::-1].groupby(df['proj']).cumsum().iloc[::-1].ne(0)
df = df[mask].copy()
print (df)
   proj  weeknum  weekduration  value
0     1        1             4      0
1     1        2             4     11
4     2        1             4     10
5     2        2             4     11
6     2        3             4     12

And then use Series.map with Series.value_counts:
df['weekduration'] = df['proj'].map(df['proj'].value_counts())
print (df)
   proj  weeknum  weekduration  value
0     1        1             2      0
1     1        2             2     11
4     2        1             3     10
5     2        2             3     11
6     2        3             3     12

Details:
print (df['value'].iloc[::-1])
7     0
6    12
5    11
4    10
3     0
2     0
1    11
0     0
Name: value, dtype: int64

print (df['value'].iloc[::-1].groupby(df['proj']).cumsum())
7     0
6    12
5    23
4    33
3     0
2     0
1    11
0    11
Name: value, dtype: int64

Performance:
You need avoid filtering per groups, becuse slow:
np.random.seed(123)
N = 1000000

df = pd.DataFrame({'proj':np.random.randint(10000, size=N),
                   'value': np.random.choice([0,1,2], N)}).sort_values('proj')
print (df)

In [76]: %timeit df.groupby('proj').apply(lambda grp: grp[grp.value[::-1].cumsum().gt(0)[::-1]]).reset_index(level=0, drop=True)
20.2 s ± 4.04 s per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [78]: %timeit df[df['value'].iloc[::-1].groupby(df['proj']).cumsum().iloc[::-1].ne(0)]
268 ms ± 1.22 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

A: To drop trailing zeroes run:
result = df.groupby('proj').apply(
    lambda grp: grp[grp.value[::-1].cumsum().gt(0)[::-1]])\
    .reset_index(level=0, drop=True)

The lambda function:

*

*takes value column in reversed order,

*computes cumsum,

*converts to bool (is cumsum > 0),

*reverts back to the "original" order,

*uses boolean indexing to drop trailing zeroes.

The above procedure is repeated for all proj groups.
All that remains to be done (at this step) is reset_index to drop the
top level of the index (grouping keys).
And now the second part - update weekduration:
result.weekduration = result.groupby('proj').weekduration\
    .transform(lambda grp: grp.size)

The final result is:
   proj  weeknum  weekduration  value
0     1        1             2      0
1     1        2             2     11
4     2        1             3     10
5     2        2             3     11
6     2        3             3     12

Edit
Or if you prefer an "all in one" solution, then define the following
function to filter a group and at the same time set weekduration:
def myFilter(grp):
    grp = grp[grp.value[::-1].cumsum().gt(0)[::-1]]
    grp.weekduration = grp.index.size
    return grp

Then compute the result, applying this function to each group (grouped
by proj):
result = df.groupby('proj').apply(myFilter).reset_index(level=0, drop=True)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Prevent Ajax Call When there is no session & Network Discoonects in codeigniter I  facing two issues in my project.Please help me to rid of those.

*

*I am using .load() function in javascript to load the other page
using Ajax. It's Working great. But if i opened my project in other
tab and logout and get back to here and try to make ajax call it is
showing the login page Where i am loading the page using .load()
function.How do i solve it.

*How do i stop ajax call when network disconnects ?
how to solve these two issues??

A: What you are trying to achieve is a little complex as you want your Browser (client) to keep a record of weather an active session for the current user exists on the server.
The Problem is that user's Session record is maintained at the server and  you want your client to know the sessions status. You will need to write some java script which will keep calling a function on server after a fixed interval of time to check if the session is valid.
I would do it something like this :
// this will call a function to make a request to server and check if session exist's after every 10 seconds.
var t=setInterval(checkSessionExist,10000);

function checkSessionExist(){
 $.get( "someFunctionToCheckSession", function( data ) {
   if(!data.isSessionActive){
     clearInterval(t);
     alert("Your Session has Expired. Please Login to continue !!");
     location.reload();
   }
});
}

On Server Side You will have some method named someFunctionToCheckSession
function someFunctionToCheckSession(){
  // CHeck user's active session here
  $data['isSessionActive'] = 0;
  if(isset($_SESSION['user_name'])){
      $data['isSessionActive'] = 1;
  }
  echo json_encode($data);

}

A: i hope this can help
in your function __construct  include this.
if(!$this->session->userdata('somevalue'){redirect('somevalue');}


text:
Q: Visual Studio for Mac is not synching the changes made in Xcode 11.6 and Interface Builder I am developing Mac OS app with Xamarin C# on Visual Studio for Mac, as my requirement is to make an already developed windows app compatible for mac or a new app for mac os similar to windows one, choosing Xamarin seems fair option as I thought of reusing some code from windows app, so I started fresh project for Mac using this guideline:
https://learn.microsoft.com/en-us/xamarin/mac/get-started/hello-mac
now when I am facing issue in synching of design code between Xcode and Visual studio, whatever UI changes, IBOutlet, Actions I am creating on Xcode, is not getting synch in visual studio designer file.
e.g. I have created IBOutlet for a label in viewcontroller.h (on Xcode), which should convert in C# code in viewcontroller.designer.cs file (Visual Studio) automatically, but sadly it is not happening.

A: I was struggling with this using VS for Mac and XCode 12.2, and I found that I was doing a couple of things incorrectly.

*

*It seems that XCode opens the .m files by default (this may not have always been the case in years past), so when I turned on the Assistant (I am working in a storyboard) the .m file was opened by default, but the outlets need to go into the .h file. I had to ensure I had the .h file open in the Assistant.

*When control-dragging into the .h file to create an outlet, I was placing the outlet inside of the curly braces for the @interface. This will create what looks like an outlet, but it's not recognized as such by Visual Studio. I had to ensure that I had the line pointing outside of the @interface's  curly braces in the .h file, so that the outlet created looked something like this:

@property (nonatomic, retain) IBOutlet UIImageView *myImageViewOutlet;

Once I did this, the outlet property was synched over to Visual Studio and was created in the corresponding .designer file.


text:
Q: how to write a range from 1 to 254 using CIDR notation? hello i am trying to make an app that shows all the connected devices to the network
how can write the range from 192.168.0.1 to 192.168.0.255 in CIDR notation ?

A: Scapy understands CIDR notation in IP address fields by automatically converting it to a Net object:
>>> import scapy.all as scapy
>>> scapy.Net("192.168.0.1/24")
Net("192.168.0.1/24")
>>> list(_)
['192.168.0.0',
 '192.168.0.1',
 '192.168.0.2',
 '192.168.0.3',
 ...

but in your example you can just do
>>> eth = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
>>> arp = scapy.ARP(pdst="192.168.0.1/24")
>>> scapy.srp(eth / arp, timeout=5)[0]

since, as I said, it's converted behind the scenes.


text:
Q: Archive distribution problem for watch extension app We've been developing and testing a Watchkit Extension app (iOS 12.1 and WatchOS 5.1) for the past few months and successfully testing it on a simulator and local, connected devices (iPhoneX + Watch 4) using xCode 10.1.
This past week we built an archive for posting to App Store Connect. We got stuck in the Archive Organizer after archiving for release. The "Validate Content" button was disabled, the Version is blank, the Identifier is blank, and the Type is "Generic Xcode Archive". Unfortunately, all we can do is export the .app files from the Archive Organizer; we can't push the archive to App Store Connect.
We made sure the build scheme was set to Release and we archived to a Generic iOS and WatchOS device. We also set Skip Install for the three targets (iOS app, Watch app, Watch extension) to No as we assumed none of those are static libraries.  We even tried every permutation of Skip Install settings. We looked at the  issue in the following link and we have no Header steps in the Build Phases of any targets:
https://developer.apple.com/library/archive/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ
We have two frameworks we included in the project using carthage.  We thought maybe these were causing issues, but we rolled back to a branch before we added them and still have the same problem.
We made sure the build in the Scheme is set to a single target and cleared out the Derived Data folder.  Still no dice.

A: I'm not 100% sure from your question, but are you trying to push an archive of the watch app to the App Store?
If so, that's not how you submit the app. The Watch app is embedded in the "regular" iOS app, and to distribute it you need to archive and submit that app as usual.
If I've misunderstood, feel free to ignore this!

A: I had the exact same problem. When I changed Skip install on the watch app and watch app extension to YES, it suddenly worked. No idea why.


text:
Q: Visual Studio Import issue I have created spring boot project in Visual Studio Code.

*

*Intellisense is not giving any suggestion

*VS code unable to suggest import  please view image here

*unnecessary error in the default spring boot code
please view image here
Please help me out. I have wasted my hold day just to make this work. Im using Visual Studio Code on Mac OS.
I have also tried the Command Palette--> Java Clean path.
Added java.home path in VS Code settings.json file.

A: VS Code IntelliSense features are powered by a language service, and there's AI-assisted IntelliSense called Visual Studio IntelliCode which you can install from extension marketplace. When you find IntelliSense has stopped working, the language service may not be running. Try reinstalling the java extension pack and restarting VS Code and this should solve the issue.


text:
Q: Why is my implementation of array.sorted( by: ) in Swift returning a strange order? I have a custom class:
class MyClass: MySuperClass
{
    var myNumber: Int

    required init ( id: Int, myNumber: Int )
    {
        self.myNumber = myNumber
        super.init( id: id )
    }

    required init ( id: Int )
    {
        fatalError( "init() has not been implemented" )
    }
}

I create an array of these objects of length 20:
var myNumbers: [ MyClass ] = []

I iterate through the array, printing out the values of myNumber:
0
1
1221
0
0
18394
0
0
0
0
0
1222
6
0
110
0
0
24
71
2

I then run a sort on them:
myNumbers.sorted( by: { $0.myNumber < $1.myNumber } )

And I iterate through the array a second time, printing out the values of myNumber:
0
0
0
0
0
0
0
0
0
0
0
2
1
6
24
71
110
1222
1221
18394

As you can see it sort of sorts them, but not very satisfactorily.
What am I doing wrong please? Thank you in advance.

A: You want .sortInPlace I believe..
myNumbers.sortInPlace( by: { $0.myNumber < $1.myNumber } )
/// Sort `self` in-place according to `isOrderedBefore`.
///
/// The sorting algorithm is not stable (can change the relative order of
/// elements for which `isOrderedBefore` does not establish an order).
///
/// - Requires: `isOrderedBefore` is a
///   [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings)
///   over the elements in `self`.


text:
Q: Importing spaCy object (nlp) into a different Docker container running Django project I am running a docker-compose file with 3 services (or containers):

*

*django-web

*nginx

*spacy-web
My final goal is to create 2 nlp objects (nlp_en, nlp_fr) in spacy-web and make use of them in django-web.
Does that look possible/desirable?
Of course, the reason behind splitting django-web and spacy-web is to have a cleaner scheme of containers.
I have created a Dockerfile for spacy-web.
I install spaCy and 2 language models (English/French).
With an entrypoint (which runs a python script: spacy_entrypoint.py), I then create 2 nlp objects, 1 for each language (nlp_en, nlp_fr).
My first problem is that this container exits immediately after creating the nlp objects. My guess is that I should add something at the end of the python script, to keep the container running, but without using much CPU. How do we keep a python container alive, to access objects created into it from another container?
If that problem can be solved, then I need to import the nlp objects (nlp_en, nlp_fr) in the other container, namely django-web. I never got there because spacy-web exits immediately after creation. In the relevant django views, I would try "from spacy-web import nlp_en, nlp_fr". Has anyone tried an python import from one Docker container to another Docker container?
Dockerfile.spacy
FROM python:3.7.4
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN pip3 install --upgrade pip
RUN pip3 install -U spacy
RUN python3 -m spacy download en_core_web_lg
RUN python3 -m spacy download fr_core_news_md
ENV updated_at 2019-09-06
EXPOSE 4000
RUN mkdir -p /temp
WORKDIR /temp
COPY compose_spacy/spacy_entrypoint.py /temp
ENTRYPOINT ["python3", "spacy_entrypoint.py"]

spacy_entrypoint.py
import spacy
nlp_en = spacy.load('en_core_web_lg')
nlp_fr = spacy.load('fr_core_news_md')

When I build an image and run a container based on those files, the container exits immediately. I'd be extremely grateful for any tip pointing to the right direction !

A: I would suggest starting simple and just having everything in one application and one container.


text:
Q: Rotate UIImageView around its center point? I have a transparent png inside a UIImageView (self.myImage) that I want to rotate around its center point.
The code should be pretty simple:
[self.myImage.layer setAnchorPoint:CGPointMake(0.5, 0.5)];
[UIView animateWithDuration:1.0 animations:^{
    [self.myImage setTransform:CGAffineTransformMakeRotation(angle)];
}];

The image rotates at the right speed/time and at the right angle, but its position gets shifted.  Here's an example of what's happening:

The gray square is just to show position in the screen. The transparent png (contained in a UIImageView) is the other figure. The white dotted lines show the center of the UIImageView.  The left side of the image shows the original position of the image, the right side shows the image after being rotated with the above code (which gets shifted a little down to the right). The black and white circles are in the center of the image file.
Is there something that I'm missing? As far as I understand, the first line above is not required because those are the defaults. Do I have to set/unset something in the storyboard/programmatically?

A: I found out that the code I need to accomplish what I needed was simpler than the one given by @Albin Joseph, but it did point me to the right direction.
My animation needs to pick up where it left off and rotate to a new position.  Some times it will be animated and sometimes it won't. So hence the code:
CGFloat duration = animated ? 0.5 : 0.01;

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [[self.turnIndicatorImage.layer presentationLayer] valueForKeyPath:@"transform.rotation.z"];
animation.toValue = angle;
animation.duration = duration;
animation.fillMode = kCAFillModeForwards;
animation.repeatCount = 0;
animation.removedOnCompletion = NO;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
[self.turnIndicatorImage.layer addAnimation:animation forKey:@"transform.rotation.z"];

A: You just try this code
  - (void)viewDidLoad
{
[super viewDidLoad];
CATransform3D transform = CATransform3DIdentity;
transform.m34 = -1 / 500.0;
transform = CATransform3DRotate(transform, .0 * M_PI_2, 1, 0, 0);/*Here the angle of transform set (Here angle set as 0)*/
self.transformView.layer.transform = transform;
}

 - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.fromValue = [NSNumber numberWithFloat:0];
animation.toValue = [NSNumber numberWithFloat:2 * M_PI];
animation.duration = 3.0;
animation.repeatCount = HUGE_VALF;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
[self.discView.layer addAnimation:animation forKey:@"transform.rotation.z"];
 }

 - (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
[self.discView.layer removeAllAnimations];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  }

In this you just change transformView with another view or ImageView


text:
Q: Let user change ordering of a ManyToManyField in Django model My models are something like following:
class Reading(models.Model):
    title = models.Charfield(max_length=250)
    url = models.URLField()

class Lesson(models.Model):
    name = models.CharField(max_length=250)
    description = models.TextField(null=True, blank=True)
    readings = models.ManyToManyField(Reading)
    created_by = models.ForeignKey(User)

The ordering of Reading(these are just blog posts) in Lessons matters. This can be done by meta class options *order_with_respect_to*. But I want that a user(creator of that Lesson) can change the ordering of the Reading in a Lesson. How can I do this?
One way I thought about this is, I should create a ForeignKey of Lesson from
Reading model and have one more field called ordering with IntegerField, which a User editing that can change. Is this right approach?
Also I found that this is same as saying a User having a todo list and should have ability to change the ordering of tasks he want to do.

A: You could use a through model. https://docs.djangoproject.com/en/dev/topics/db/models/#intermediary-manytomany


text:
Q: Why is the Dirac QFT Spin Operator depending on the state? I am reading the book Student friendly quantum field theory , I feel sorry to paste the entire page, but I just want to illustrate this more clear. This very a long page. Firstly the author defined the QFT spin operator in (4-110), and then he checked the result of this operator functions on a state to gain the desired value 1/2 in (4-116). During this process he seemed to used the fact that the operator should depend on the state being measured at the third term after the second equal sign in (4-116). This, I don't understand. How can a measurement be affected by the thing been observed?

A: The dirac operator is $ -i\not D $ , but it seems the author has called the Dirac hamiltonian the dirac operator. In QFT we make the local Hamiltonian out of quantum fields in order to ensure locality. The Hamiltonian operator is then an integral of a local hamiltonian densiy over all space-time. If you get the dirac equation and ask for what lagragian gives it and then from that construct the Hamiltonian you will get something like what the author calls the Dirac operator.

A: Do you mean that the equation $$\text{QFT}\Sigma _i=\int _V\psi ^{\dagger }\Sigma _i\psi~\mathrm d^3x$$
seems to say that $\text{QFT}\Sigma_i$ depends on the state $\psi$? Then I think your confusion comes from that in QFT, $\psi$ isn't a state, it's a field, and fields are operators.


text:
Q: Call Ruby class over java with jruby If I implement a class in ruby and compile it with jrubyc than it is not possible to call it from a java class directly if I start it with java. If I see this right I have to use org.jruby.embed... to implement a wrapper which takes a class name and a method to call my ruby class.
Do I have to do this also if I start the application with jruby? In my current project I start java workflow engine completely with jruby. The workflow has to call a method in a ruby class which it can't find.
Maybe easier to understand:
      [ruby_class]   <-----has to call----.
                                          |
jruby [ruby_start_script] --starts--> [java wfe]

A: I don't know if i understood, but to require your code, you just have to require it and make it sure that it its in your JAVA PATH or APP PATH. For example, in your jruby script you can do it:
require 'java'
java_import java.lang.System
version = System.getProperties["java.runtime.version"]

You can call as well java methods like:
 java.lang.System.currentTimeMillis

I would say that you make your class work with a java app, then you should put it in your app path, do a require 'java' and java_import your.class.here

A:
If I implement a class in ruby and
  compile it with jrubyc than it is not
  possible to call it from a java class
  directly if I start it with java.

Not sure if I understand the question entirely but if you are asking if you can call a Jruby method from a Java class using jrubyc, it is possible. Take a look at this blog post which shows how to call a JRuby method from Java.

A: IIRC, this is one of the newest integrations to JRuby, and may be subject to change. It seems to be possible as described in this post, albeit warns not being very efficient.


text:
Q: Will strategy increase the probability of winning in drawing lots? Say there are $n$ red balls and $m$ blue balls in a urn. $m+n$ people everyone withdraw a ball without returning and people draw red ball wins. It's a well known result that the odd of winning is independent of order, but if we can decide when when to draw in the process of game can we increase the probability of winning by using some strategy? Say draw the ball when first time the ratio of red against blue is greater than $n/m$.

A: Say we have a privileged person able to draw whenever he feels like it. This person could wait for "scenarios with better odds" to draw a red ball, but it is possible that all red balls get taken in a row, leaving nothing but blue balls. Intuitively, things could take a turn for better or for worse.
Let's say that at some point in time, there are $k$ blue balls and $l$ red balls left. This person can then decide either to pick a ball now, or wait till the next turn. The probability of picking a red ball now, equals $\frac{l}{k+l}$. If the person decides to let someone else pick first, we get:
$$\frac{l}{k+l} \cdot \frac{l-1}{k+l-1} + \frac{k}{k+l} \cdot \frac{l}{k+l-1} = \frac{l(k+k-1)}{(k+l)(k+l-1)} = \frac{l}{k+l}$$
On average, the expected probability of selecting a red ball on the next turn is the same as selecting a red ball in this turn. As such, the proposed scheme does not tend to result in a larger expected probability of selecting a red ball.


text:
Q: Select current date by default in bootstraps calendar I will have a small form on the page, there will also be a bootstrap calendar where you can select a date.
Now you need to click on the "click" button and select the date so that it appears and is displayed on the button instead of the inscription.
But I need to have the current date instead of the click inscription by default when loading this form.
How can i do this?

let restaurantReserve = {
  init: function() {
    let _self = this;

    $('#reservation-date').datepicker({
      startDate: '+0d'
    }).on('changeDate', function(e) {
      const arDate = e.date.toString().split(' ');
      let input = $('[name="RestaurantReservationForm[date]"]');
      input.val(arDate[3] + '-' + (e.date.getMonth() + 1) + '-' + arDate[2]);
      _self.unSetError(input);
      $('#reservation-date .js-value').text(arDate[2] + ' ' + arDate[1]);
    });
  },
  setError: function(ob) {
    $('#' + ob.data('btnId')).addClass('btn-error');
  },
  unSetError: function(ob) {
    $('#' + ob.data('btnId')).removeClass('btn-error');
  }
}
restaurantReserve.init();
.btn {
  border: none;
  border-radius: 8px;
  height: 40px;
  padding: 10px 15px;
  font-weight: 800;
  font-size: 14px;
  margin-right: 10px;
  cursor: pointer;
}

.btn-fourth {
  text-decoration: none;
  background: #e3e5e8;
  color: #747b8b;
}

.invisible {
  display: none;
}

ul.with-out>li:before,
.dropdown-menu li:before,
ul.whithout>li:before {
  display: none;
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu-height-fixed {
  max-height: 200px;
  overflow-y: auto;
}

.dropdown-item.active,
.dropdown-item:active {
  background: red;
}

.block-shadow {
  box-shadow: 0 2px 8px 0 rgba(32, 35, 44, 0.05);
}

.block-white {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
}

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" rel="stylesheet">

<form id="reservation" action="/restaurants/123/" method="post">

      ">
         click

      <input type="hidden" id="restaurantreservationform-date" class="form-control" name="RestaurantReservationForm[date]" data-btn-id="reservation-date">

A: If I get you right, you could use this code snippet in your init function:
  ...
  init: function() {
  let _self = this;

  let now = new Date();
  $('#reservation-date .js-value').text(now.toDateString());

  $('#reservation-date').datepicker({
  ...


text:
Q: Magento getParam v $_GET Can anyone explain the differences both functionally and in terms of good/bad practice whhy one of these should be preferred over the other:
$getParam = Mage::app()->getRequest()->getParam('getparam');

v
$getParam = $_GET['getparam'];

A: Mage::app()->getRequest()->getParam('getparam');

Will return you 'getparam' if it is send with GET, POST (not sure about DELETE, PUT ...) request. Did not work with Magento but if there parameters that sent through routing. I would expect them also being accessible through that function.
$_GET contains only parameters sent through GET
$_POST contains only parameters sent through POST

A: There is a significant difference between the two. $_GET is simply an array, like $_POST. However, calling Mage::app()->getRequest()->getParam('param_name') will give you access to both GET and POST (DELETE and PUT are not included here) - see code below:
lib/Zend/Controller/Request/Http.php

public function getParam($key, $default = null)
{
    $keyName = (null !== ($alias = $this->getAlias($key))) ? $alias : $key;

    $paramSources = $this->getParamSources();
    if (isset($this->_params[$keyName])) {
        return $this->_params[$keyName];
    } elseif (in_array('_GET', $paramSources) && (isset($_GET[$keyName]))) {
        return $_GET[$keyName];
    } elseif (in_array('_POST', $paramSources) && (isset($_POST[$keyName]))) {
        return $_POST[$keyName];
    }

    return $default;
}

In addition, if the system sets other params with Mage::app()->getRequest()->setParam(), it becomes accessible via the getParam() function. In Magento you want to always use getParam().


text:
Q: How to Download Android studio in i3 processor? How to download Android Studio in i3 processor?
I am trying to download Android Studio 3.3.1 but the buttons on their page seems to not work, I get no feedback. I tried on multiple browsers.
Please if you are good enough to share the download link.

A: may be change your browser and try this link:
https://developer.android.com/studio

A: I would suggest to update your processor anyhow if you will install on i3 your laptop may work slow.


text:
Q: defining object location by it's center point In c# .net 4 forms whenever I add an object, it's location is determined by it's top-left corner.
This means, that if I resize this object, it will be resized from this point.
I have a picture box. if I change the width and height to something smaller, then the picture box seems like it moved, since it's borders are now much closer to it's top-left, moving the picture-box center point.
I want the picture-box to rescale while maintaining it's position - meaning the center point of the picture will stay the same, while the size will be split around this point (half-up half-down and half-left half-right).
Is that possible?

A: This is off my mind and crafted quickly but something like:
void resizeFromCenter(PictureBox box, int w, int h)
{
  var cenx = box.Left + box.Width/2;
  var ceny = box.Top + box.Height/2;
  box.Left = cenx - w/2;
  box.Width = w;
  box.Top = ceny - h/2;
  box.Height = h;
}


text:
Q: Mystery data point at [0,0] in d3.js scatterplot chart I have a scatterplot that's based off of this. All of my data looks good, but I have a single point at the coordinates (0,0). There is nothing in my dataset that matches this though. I'm using tooltips to show the values associated with the circle when you roll over them. This mystery point just has a blank tooltip meaning it has no values at all.
Any thoughts on what this might be and how I can figure out where it's coming from?
The data source for this chart is a CSV. I have no blank lines or empty cells in the data file.

A: How are you determining there is an extra data point? I ran your code and looked at the Javascript console. There are 46 data points which is correct.


text:
Q: Support for AWS member accounts How to get support enabled for AWS member accounts? Having created the accounts through AWS organisations only role-based access is possible, how can I change the support plan?

A: I'm sad but you really have to recover your root account password first to gain access to your root user, before you can opt for a support plan change.
This is not only a security backdrop but a not needed extra hop. Not cool AWS!


text:
Q: make a unique, random number to use as an order ID I'm working right now to get a unique order number for the item being purchased.
The problem is such that I have payment gateway at quickpay and it comes up and says this: "Error in field: ordernumber"
I have tried to make it like this:
$idag = date("dmY");
    $a = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz@!*_-?>/+,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'), 0, 4);
    $total = $idag . $a;

    $sql = "SELECT pakker.pris FROM pakker WHERE pakker.id = 3";
    if ($stmt = $this->mysqli->prepare($sql)) {
        $stmt->execute();
        $stmt->bind_result($pris);
        while ($stmt->fetch()) {
            $protocol = '7';
            $msgtype = 'authorize';
            $merchant = '89898978';
            $language = 'da';
            $ordernumber = $total;// here must order number came up.

I have also tried to do it like this.
$idag = date("dmY");
        $rand = strtoupper(substr(uniqid(sha1(time())), 0,8));
        $a = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz@!*_-?>/+,ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'), 0, 4);
        $total = $idag . $a . $rand;

A: From the [API documentation for Quickpay]:

ordernumber
/^[a-zA-Z0-9]{4,20}$/
A value by merchant's own choice. Must be unique for each transaction. Usually an incrementing sequence. The value may be reflected in the your bank account list.

You need to alter your random order ID generator to exclude any non-alphanumeric characters.
i.e.
$idag = date("dmY");
$a = substr(str_shuffle('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'), 0, 4);
$total = $idag . $a;

if I were you, I'd use the unix timestamp and then add a few extra characters to the end.


text:
Q: Calculating field in which null values may be present? I would like to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have null values for one or more of the fields. For example, the new field name is 'total' and total is based upon adding field1 + field2 + field3. Some records (rows) have values for field1, field2, and field3, but some rows only have values for field1 and field2, then field3 is null. Do I need to go and replace all null values with a numeric value? Or, is there some workaround within the VB or python script?
I'm using ArcMap 10.1
I've used a python example from below and have been unable to get it to work. Here is the code I'm using:
#calculate new field 'summed' in feature class 'test'
inFeatures='test'
fieldName01='summed'
exSummed = "stack(!field01!+!field02!+!field03!)"
codeBlock = "def stack(*args):
    return sum(filter(None, args))"

arcpy.CalculateField_management(inFeatures, fieldName01, exSummed, "PYTHON", codeBlock)

where 'summed' is the field (short) I would like to populate and field01, field02, field03 are all short integers which may or may not have NULL's present.
I receive an error when I run this...

A: @ustroetz answer is almost correct.  However, it won't necessarily give you the correct results.
When you mutate the list while iterating over it, you may skip some values.
For example, if your list is defined as such:
mylist = [None, 3,4,5,6,7, None, None, 4,65,23,6, None]

and you use this code:
for item in myList:
  if item is None:
   myList.remove(item)

Then your resulting mylist will be:
[3, 4, 5, 6, 7, 4, 65, 23, 6, None]

Please see if statement in loop not working and Unexpected behaviour in looping a list (I asked the second question when I tried to replicate the above code) on Stackoverflow which cover similar issues.
@Gareth Latty's response describes using list comprehension to get the correct answer.
So, if we modify @ustroetz's answer, you should put the following as your pre-logic code:
def stack(*args):
  myList = list(args)
  myList [item for item in mylist if item]
  return sum(myList)

A: A nice Pythonic way of tackling this is to use the filter function, which takes two inputs: the value you'd like to exclude, and the input object (any interable).  After that, just sum the result:
def stack(*args):
    return sum(filter(None, args))

A: The following python field calculator code should do the job:
total =
stack( !field1!, !field2!, !field3!)

Pre-Logic Script Code:
def stack(*args):
 myList = list(args)
 for item in myList:
  if item is None:
   myList.remove(item)
 return sum(myList)


text:
Q: c# sharpdevelop , drawing rectangle or circle and fill it with color #fffffff c# sharpdevelop , drawing rectangle or circle and fill it with colour #fffffff
I'm using colour code like this #ffffff in my application. I need to draw a rectangle or circle and fill it with a specific colour by code.
Is there are anyway to do that?
e.Graphics.DrawRectangle(Pens.Black,55,400,715,20);

This code draw black not filled ..
How can I fill it with specific colour using codes like this #fffffff?
I google it but I couldn't find anything

A: I don't know C# at all, but I use Java, and its Graphics class has a drawRect and a fillRect method, so see if there is a method called e.Graphics.FillRectangle(...)


text:
Q: Flutter WidgetsBinding.instance.addPostFrameCallback((_) error Hello friends first off all sorry for my bad English.
I'm getting an error when I start debug my code in flutter-Dart.
          import 'package:flutter/foundation.dart';
          import 'package:flutter/material.dart';
          import 'package:get/get.dart';
          import 'package:http/http.dart' as http;

          // Bu alan benim soru değişkenlerimi Getx yardımı ile tuttuğum classdır.farkllı değişken classları yazılabilir.
          class memberController extends GetxController {
            //5 benim değikenimin ilk değeridir.
            var _memberName = "a".obs;
            var _memberPhoto = "a".obs;

            //get ile çeker, set ile veriyi atarım.
            get memberName => _memberName.value;
            set memberName(yeniDeger) => _memberName.value = yeniDeger;

            get memberPhoto => _memberPhoto.value;
            set memberPhoto(yeniDeger) => _memberPhoto.value = yeniDeger;
          }

          void main() => runApp(MyApp());

          class MyApp extends StatelessWidget {
            memberController _controller1 = Get.put(memberController());

            @override
            Widget build(BuildContext context) {
              return MaterialApp(
                title: 'Material App',
                home: Scaffold(
                  body: SafeArea(
                      child: Column(
                    children: [
                      TextField(
                        onChanged: (Value) {
                          _controller1.memberName = Value;
                        },
                        decoration:
                            InputDecoration(border: InputBorder.none, hintText: 'memberName'),
                      ),
                      TextField(
                        onChanged: (Value) {
                          _controller1.memberPhoto = Value;
                        },
                        decoration:
                            InputDecoration(border: InputBorder.none, hintText: 'memberPhoto'),
                      ),
                      ElevatedButton(
                        onPressed: () async {
                          final uriAAA = 'https://www.meshcurrent.online/myWebApp/add_user.php';
                          var map = new Map<String, dynamic>();
                          map['memberName'] = _controller1.memberName;
                          map['memberPhoto'] = _controller1.memberPhoto;

                          http.Response response = await http.post(
                            Uri.parse(uriAAA),
                            body: map,
                          );
                        },
                        child: Text('SORUYU EKLE'),
                      ),
                    ],
                  )),
                ),
              );
            }
          }

This is my code memberAdd.dart file.
Target of this code.
-There is two textfield and I will get text from textfields with getx library. When textfields onChanged getx _controller1.memberName and _conroller1.memberPhoto chancing.
-I will send my datas from texfields to webserber when I pressed the Elevatedbutton.
But I'm getting this error
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:357:33: Error: Method
   'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is
      potentially null. 'SchedulerBinding' is from
     'package:flutter/src/scheduler/binding.dart'
    ('/C:/src/flutter/packages/flutter/lib/src/scheduler/binding.dart').
      package:flutter/…/scheduler/binding.dart:1
     Try calling using ?. instead.
     SchedulerBinding.instance.addPostFrameCallback((_) {

There is a lot of error text like this.
Please help me.
I'm using visual Studio

A: Solution
This is a known issue.
You can use this temporary solution
But in summary, just update your pubspec.yaml:
dependencies:
  # ...
  get: ^4.6.x # Remove this line
  get: 4.6.1 # And replace with this line
  # ...

This will force to use a version where the bug doesn't exists.
But where this error came from?
This error means nothing from your code but from GetX package which you are using in your project. So there's nothing you can do in your project to fix that.
You can notice it's not about your code by looking at the exception location:
C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:357:33

The .pub-cache/hosted/pub.dartlang.org is a directory where Flutter hosts the libraries you depend on.
Sometimes we face with exceptions/errors that are not related our project itself but packages/libraries/plugins we depend on. This can have many causes but the most commons are when Flutter has significative breaking changes and the packages don't migrate correctly, then the users of the package fall in errors committed by the package maintainer's.
Solution approaches
To be quite straightforward: there's no absolute fix, but there's a right direction:

*

*Find where are the bug (which package? which repository?)

*Search for issues or PRs that mentions the same error as you (if you are luckly you'll find the solution in this step, which is your case right now)

*If you didn't find anything related to, search for a solution yourself and open a issue or pull request (or you can also just open an issue if you don't know how to fix, try to give much details as you can)

*Wait for merge and a new release with your bug fixes. You can either create a plugin fork which contains your fix and make your project dependant of it (a version which has the fix)

A: The problem is that the package causing this issue has been updated to be compatible with the latest version of Flutter, 3.0.0. You can either:

*

*Update your Flutter version to 3.0.0 or greater, or

*Downgrade the package version to the one it was still compatible with your current Flutter version, removing the caret symbol (^) in the pubspeb.yaml.

If you choose the second option, as it might not be desirable to update your project to the latest version of Flutter right now, your best shot is to see the version history of the package and downgrade to the version before it was made compatible with the new Flutter SDK version.
If the version history is not clear, the other option you have is to go to the package issues page at GitHub (See at the right side of the package page at pub.dev, "View/report issues"), search if anyone has already reported the problem (you can use the search bar and look for "SchedulerBinding" or something like that), and see if anyone in the comments of the issue points out the version before the change.
If you still can't find the last compatible version, you can do trial and error for each version available in the version history of the package. Don't forget to remove the (^) symbol in the version of the package of your pubspec.yaml or it will still use the latest version.

A: If you can't upgrade or downgrade the version of flutter, you can try this version of percent indicator (with double quotes).
percent_indicator: "^2.1.9+1" .
Then, clean and flutter pub get.
It's worked for me..

A: I got the same error and the solution that worked for me is as follows
probleme:
velocity_x: ^3.5.1 doesn't work with flutter 2.10., because ^3.5.1 is for flutter 3
solution:

*

*step: 1
in pubspec.yaml change velocity_x: ^3.5.1 by velocity_x: ^3.4.0

*step: 2
in pubspec.lock change velocity_x version: "3.5.1" by version: "3.4.0"

*step: 3
flutter clean

*step: 4
flutter run
i think it will work for you


text:
Q: Help with NGINX conf for reverse proxy for both WSS to ws and HTTPS to http, Debian 11, looping redirects My current config for NGINX results in infinite loop of redirects to https, when I try to access index.html. Does someone have the correct way to do this?
The goal is to forward inbound requests on port 443 that are for starting a WSS connection to a WS connection at localhost on the same port. Also, to forward requests on port 443 that are for web files, to localhost port 80.
Here is the redirecting conf (which is placed in /etc/nginx/conf.d/myFQDN.conf
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}

upstream to-websocket {
    server localhost:25565;
}

server_tokens off;

# SSL requirements. We use Certbot and LetsEncrypt
#ssl_certificate /etc/letsencrypt/live/-myFQDN-/fullchain.pem; # managed by Certbot
#ssl_certificate_key /etc/letsencrypt/live/-myFQDN-/privkey.pem; # managed by Certbot
#include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
#ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
#ssl_session_cache shared:SSL:1m;

#ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
#ssl_prefer_server_ciphers on;

server {
#   first redirect to https
    if ($scheme = "http") {
        return 301 https://$host$request_uri;
    }

#   Now webserver
#   Port 80 shouldn't be accesed from outside
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name -myFQDN- www.-myFQDN-;
    return 404; # managed by Certbot
    root /var/www/html;
}

server {
    root /var/www/html;
    index  index.html index.htm;
    server_name -myFQDN-;

#   Proxy our outside https to local http
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/-myFQDN-/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/-myFQDN-/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    location / {
        try_files /nonexistent @$http_upgrade;
    }
    location @websocket {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host -myFQDN-;
        proxy_set_header Referer https://-myFQDN-;
        proxy_set_header Referrer https://-myFQDN-;
#       proxy_pass http://localhost:25565;
        proxy_pass http://to-websocket;
    }

    location @ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host -myFQDN-;
        proxy_set_header Referer https://-myFQDN-;
        proxy_set_header Referrer https://-myFQDN-;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:80;
    }
}


text:
Q: I cannot get the latest meteor todos example chimp acceptance test to work on mac osx 10.11.16 with chrome Version 59.0.3071.86 I am running on OSX 10.11.6 with Chrome Version 59.0.3071.86 (Official Build) (64-bit) and I have downloaded and installed the latest meteor todos app, and following the tutorial performed the unit and integration testing examples successfully. When I try the chimp acceptance test and use --debug in the output I get the first log below which indicates a browser incompatibility. After changing the
node_modules/chimp/dist/bin/default.js seleniumStandaloneOptions
like this (notice version: 2.30)...
  seleniumStandaloneOptions: {
    // check for more recent versions of selenium here:
    // http://selenium-release.storage.googleapis.com/index.html
    version: '3.0.1',
    baseURL: 'https://selenium-release.storage.googleapis.com',
    drivers: {
      chrome: {
        // check for more recent versions of chrome driver here:
        // http://chromedriver.storage.googleapis.com/index.html
        //version: '2.25',
        version: '2.30',
        arch: process.arch,
        baseURL: 'https://chromedriver.storage.googleapis.com'
      },

.....
I get the second log below.
I do see a window flash briefly then go away - too fast to see what it is doing. There is no output on the meteor console either. I have tried many different options but cannot seem to make this work, and do not seem to know how to debug it. Do any of you have any other ideas or debugging help? The browser can exercise the todos app on localhost:3000 with no apparent problems. There are no console errors in the browser while it is accessing the todos app.
I would really appreciate any insight anyone has. Thanks.
First log.....
$chimp --ddp=http://localhost:3000 --test --mocha --path=tests --debug
[chimp] Chimp options are { watch: false,
  watchTags: '@watch,@focus',
  domainSteps: null,
  e2eSteps: null,
  fullDomain: false,
  domainOnly: false,
  e2eTags: '@e2e',
  watchWithPolling: false,
  server: false,
  serverPort: 8060,
  serverHost: 'localhost',
  sync: true,
  offline: false,
  showXolvioMessages: true,
  'fail-when-no-tests-run': false,
  path: './features',
  format: 'pretty',
  tags: '~@ignore',
  singleSnippetPerFile: true,
  recommendedFilenameSeparator: '_',
  chai: false,
  screenshotsOnError: false,
  screenshotsPath: '.screenshots',
  captureAllStepScreenshots: false,
  saveScreenshotsToDisk: true,
  saveScreenshotsToReport: false,
  jsonOutput: null,
  compiler: 'js:/usr/local/lib/node_modules/chimp/dist/lib/babel-register.js',
  conditionOutput: true,
  browser: null,
  platform: 'ANY',
  name: '',
  user: '',
  key: '',
  port: null,
  host: null,
  webdriverio:
   { desiredCapabilities: {},
     logLevel: 'silent',
     host: '127.0.0.1',
     port: 4444,
     path: '/wd/hub',
     baseUrl: null,
     coloredLogs: true,
     screenshotPath: null,
     waitforTimeout: 500,
     waitforInterval: 250 },
  seleniumStandaloneOptions:
   { version: '3.0.1',
     baseURL: 'https://selenium-release.storage.googleapis.com',
     drivers: { chrome: [Object], ie: [Object], firefox: [Object] } },
  noSessionReuse: false,
  simianResultEndPoint: 'api.simian.io/v1.0/result',
  simianAccessToken: false,
  simianResultBranch: null,
  simianRepositoryId: null,
  mocha: false,
  mochaCommandLineOptions: { bail: true },
  mochaConfig:
   { tags: '',
     grep: null,
     timeout: 60000,
     reporter: 'spec',
     slow: 10000,
     useColors: true },
  jasmine: false,
  jasmineConfig:
   { specDir: '.',
     specFiles: [ '**/*@(_spec|-spec|Spec).@(js|jsx)' ],
     helpers: [ 'support/**/*.@(js|jsx)' ],
     stopSpecOnExpectationFailure: false,
     random: false },
  jasmineReporterConfig: {},
  ddp: false,
  serverExecuteTimeout: 10000,
  phantom_w: 1280,
  phantom_h: 1024,
  phantom_ignoreSSLErrors: false,
  log: 'info',
  debug: false,
  seleniumDebug: null,
  debugCucumber: null,
  debugBrkCucumber: null,
  debugMocha: null,
  debugBrkMocha: null }

Chimp version:  0.49.0
ChromeDriver version:  ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262)
Java version:  java version "1.8.0_66", Java(TM) SE Runtime Environment (build 1.8.0_66-b17), Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
Selenium version:  3.0.1
Selenium drivers version:  chrome: 2.25, ie: 2.50.0, firefox: 0.11.1
OS version:  Darwin 15.6.0
Node version:  v6.11.0
[chimp][browserdriver] starting process
[chimp][browserdriver.stdout] Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 52347
Only local connections are allowed.

[chimp][browserdriver] started successfully
[chimp][browserdriver] kill called on browserdriver process with pid 48946
[chimp][browserdriver] checking if process exists
[chimp][browserdriver] browserdriver process exists, killing it with SIGTERM
[chimp][browserdriver] waiting for process to die (0/10)
[chimp][browserdriver] process is dead
Browser version:  chrome undefined

[chimp] Running...
[chimp] interrupting
[chimp] no processes to interrupt
[chimp][chromedriver] starting process
[chimp][chromedriver.stdout] Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 52347
Only local connections are allowed.

[chimp][chromedriver] started successfully
[chimp][mocha] Running...

[chimp][helper] Using the chai-expect assertion library
[chimp][ddp] creating DDP wrapper
[chimp][ddp] Connecting to DDP server { host: 'localhost',
  port: '3000',
  ssl: false,
  path: undefined,
  autoReconnect: true,
  autoReconnectTimer: 500,
  maintainCollections: true,
  ddpVersion: '1',
  useSockJs: true }
[chimp][ddp] creating DDP wrapper
[chimp][ddp] Connecting to DDP server { host: 'localhost',
  port: '3000',
  ssl: false,
  path: undefined,
  autoReconnect: true,
  autoReconnectTimer: 500,
  maintainCollections: true,
  ddpVersion: '1',
  useSockJs: true }
[chimp][helper] getting browser
[chimp][session-manager-factory] options are { host: 'localhost',
  port: 52347,
  user: undefined,
  key: undefined,
  browser: 'chrome',
  deviceName: undefined }
[chimp][session-manager] created a new SessionManager
[chimp][helper] webdriverioOptions are  {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","name":""},"logLevel":"verbose","host":"localhost","port":52347,"path":"/wd/hub","baseUrl":null,"coloredLogs":true,"screenshotPath":null,"waitforTimeout":500,"waitforInterval":250,"sync":true}
[chimp][session-manager] creating webdriver remote
[chimp][session-manager] checking connection to selenium server
[15:10:45]  COMMAND GET      "/wd/hub/status"
[15:10:45]  DATA        {}
[15:10:45]  RESULT      {"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.11.6"}}
[chimp][session-manager] Connection to the to selenium server verified
[chimp][session-manager] watch mode is false, not reusing a session
[chimp][hooks] init browser
[chimp][hooks] init browser callback
[15:10:45]  COMMAND POST     "/wd/hub/session"
[15:10:45]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","platform":"ANY","name":"","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}}
[chimp][helper] setupBrowserAndDDP had error
{ Error: session not created exception: Chrome version must be >= 58.0.3029.0
    at initBrowser (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/local/lib/node_modules/chimp/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/local/lib/node_modules/chimp/dist/lib/utils/fiberize.js:29:22
    (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)
  message: 'session not created exception: Chrome version must be >= 58.0.3029.0\n  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)',
  type: 'RuntimeError',
  seleniumStack:
   { status: 33,
     type: 'SessionNotCreatedException',
     message: 'A new session could not be created.',
     orgStatusMessage: 'session not created exception: Chrome version must be >= 58.0.3029.0\n  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)' } }
Error: session not created exception: Chrome version must be >= 58.0.3029.0
    at initBrowser (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/local/lib/node_modules/chimp/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/local/lib/node_modules/chimp/dist/lib/utils/fiberize.js:29:22
    (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)
[chimp][mocha] Closed with code 2
[chimp][mocha] Mocha not in a stopping state
[chimp] Finished running async processes with errors
[chimp] run complete with errors Mocha failed
[chimp] interrupting
[chimp] 2 processes to interrupt
[chimp][mocha] interrupting mocha
[chimp][mocha] kill called on mocha process with pid 48957
[chimp][mocha] checking if process exists
[chimp][mocha] mocha process does not exists, ignoring
[chimp][chromedriver] interrupt called
[chimp][chromedriver] stopping process
[chimp][chromedriver] kill called on chromedriver process with pid 48956
[chimp][chromedriver] checking if process exists
[chimp][chromedriver] chromedriver process exists, killing it with SIGTERM
Mocha failed
Error in chimp init Mocha failed

.......
Second log with chromedriver v 2.30.....
$chimp --ddp=http://localhost:3000 --test --mocha --path=tests --debug
[chimp] Chimp options are { watch: false,
  watchTags: '@watch,@focus',
  domainSteps: null,
  e2eSteps: null,
  fullDomain: false,
  domainOnly: false,
  e2eTags: '@e2e',
  watchWithPolling: false,
  server: false,
  serverPort: 8060,
  serverHost: 'localhost',
  sync: true,
  offline: false,
  showXolvioMessages: true,
  'fail-when-no-tests-run': false,
  path: './features',
  format: 'pretty',
  tags: '~@ignore',
  singleSnippetPerFile: true,
  recommendedFilenameSeparator: '_',
  chai: false,
  screenshotsOnError: false,
  screenshotsPath: '.screenshots',
  captureAllStepScreenshots: false,
  saveScreenshotsToDisk: true,
  saveScreenshotsToReport: false,
  jsonOutput: null,
  compiler: 'js:/usr/local/lib/node_modules/chimp/dist/lib/babel-register.js',
  conditionOutput: true,
  browser: null,
  platform: 'ANY',
  name: '',
  user: '',
  key: '',
  port: null,
  host: null,
  webdriverio:
   { desiredCapabilities: {},
     logLevel: 'silent',
     host: '127.0.0.1',
     port: 4444,
     path: '/wd/hub',
     baseUrl: null,
     coloredLogs: true,
     screenshotPath: null,
     waitforTimeout: 500,
     waitforInterval: 250 },
  seleniumStandaloneOptions:
   { version: '3.0.1',
     baseURL: 'https://selenium-release.storage.googleapis.com',
     drivers: { chrome: [Object], ie: [Object], firefox: [Object] } },
  noSessionReuse: false,
  simianResultEndPoint: 'api.simian.io/v1.0/result',
  simianAccessToken: false,
  simianResultBranch: null,
  simianRepositoryId: null,
  mocha: false,
  mochaCommandLineOptions: { bail: true },
  mochaConfig:
   { tags: '',
     grep: null,
     timeout: 60000,
     reporter: 'spec',
     slow: 10000,
     useColors: true },
  jasmine: false,
  jasmineConfig:
   { specDir: '.',
     specFiles: [ '**/*@(_spec|-spec|Spec).@(js|jsx)' ],
     helpers: [ 'support/**/*.@(js|jsx)' ],
     stopSpecOnExpectationFailure: false,
     random: false },
  jasmineReporterConfig: {},
  ddp: false,
  serverExecuteTimeout: 10000,
  phantom_w: 1280,
  phantom_h: 1024,
  phantom_ignoreSSLErrors: false,
  log: 'info',
  debug: false,
  seleniumDebug: null,
  debugCucumber: null,
  debugBrkCucumber: null,
  debugMocha: null,
  debugBrkMocha: null }

Chimp version:  0.49.0
ChromeDriver version:  ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262)
Java version:  java version "1.8.0_66", Java(TM) SE Runtime Environment (build 1.8.0_66-b17), Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
Selenium version:  3.0.1
Selenium drivers version:  chrome: 2.25, ie: 2.50.0, firefox: 0.11.1
OS version:  Darwin 15.6.0
Node version:  v6.11.0
[chimp][browserdriver] starting process
[chimp][browserdriver.stdout] Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 52418
Only local connections are allowed.

[chimp][browserdriver] started successfully
[chimp][browserdriver] kill called on browserdriver process with pid 49380
[chimp][browserdriver] checking if process exists
[chimp][browserdriver] browserdriver process exists, killing it with SIGTERM
[chimp][browserdriver] waiting for process to die (0/10)
[chimp][browserdriver] process is dead
Browser version:  chrome undefined

[chimp] Running...
[chimp] interrupting
[chimp] no processes to interrupt
[chimp][chromedriver] starting process
[chimp][chromedriver.stdout] Starting ChromeDriver 2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262) on port 52418
Only local connections are allowed.

[chimp][chromedriver] started successfully
[chimp][mocha] Running...

[chimp][helper] Using the chai-expect assertion library
[chimp][ddp] creating DDP wrapper
[chimp][ddp] Connecting to DDP server { host: 'localhost',
  port: '3000',
  ssl: false,
  path: undefined,
  autoReconnect: true,
  autoReconnectTimer: 500,
  maintainCollections: true,
  ddpVersion: '1',
  useSockJs: true }
[chimp][ddp] creating DDP wrapper
[chimp][ddp] Connecting to DDP server { host: 'localhost',
  port: '3000',
  ssl: false,
  path: undefined,
  autoReconnect: true,
  autoReconnectTimer: 500,
  maintainCollections: true,
  ddpVersion: '1',
  useSockJs: true }
[chimp][helper] getting browser
[chimp][session-manager-factory] options are { host: 'localhost',
  port: 52418,
  user: undefined,
  key: undefined,
  browser: 'chrome',
  deviceName: undefined }
[chimp][session-manager] created a new SessionManager
[chimp][helper] webdriverioOptions are  {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","name":""},"logLevel":"verbose","host":"localhost","port":52418,"path":"/wd/hub","baseUrl":null,"coloredLogs":true,"screenshotPath":null,"waitforTimeout":500,"waitforInterval":250,"sync":true}
[chimp][session-manager] creating webdriver remote
[chimp][session-manager] checking connection to selenium server
[15:16:54]  COMMAND GET      "/wd/hub/status"
[15:16:54]  DATA        {}
[15:16:54]  RESULT      {"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Mac OS X","version":"10.11.6"}}
[chimp][session-manager] Connection to the to selenium server verified
[chimp][session-manager] watch mode is false, not reusing a session
[chimp][hooks] init browser
[chimp][hooks] init browser callback
[15:16:54]  COMMAND POST     "/wd/hub/session"
[15:16:54]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","platform":"ANY","name":"","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}}
[chimp][helper] setupBrowserAndDDP had error
{ Error: session not created exception: Chrome version must be >= 58.0.3029.0
    at initBrowser (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/local/lib/node_modules/chimp/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/local/lib/node_modules/chimp/dist/lib/utils/fiberize.js:29:22
    (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)
  message: 'session not created exception: Chrome version must be >= 58.0.3029.0\n  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)',
  type: 'RuntimeError',
  seleniumStack:
   { status: 33,
     type: 'SessionNotCreatedException',
     message: 'A new session could not be created.',
     orgStatusMessage: 'session not created exception: Chrome version must be >= 58.0.3029.0\n  (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)' } }
Error: session not created exception: Chrome version must be >= 58.0.3029.0
    at initBrowser (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:189:43)
    at Object.setupBrowserAndDDP (/usr/local/lib/node_modules/chimp/dist/lib/chimp-helper.js:264:7)
    at Context.<anonymous> (/usr/local/lib/node_modules/chimp/dist/lib/mocha/mocha-helper.js:13:15)
    at /usr/local/lib/node_modules/chimp/dist/lib/utils/fiberize.js:29:22
    (Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)
[chimp][mocha] Closed with code 2
[chimp][mocha] Mocha not in a stopping state
[chimp] Finished running async processes with errors
[chimp] run complete with errors Mocha failed
[chimp] interrupting
[chimp] 2 processes to interrupt
[chimp][mocha] interrupting mocha
[chimp][mocha] kill called on mocha process with pid 49391
[chimp][mocha] checking if process exists
[chimp][mocha] mocha process does not exists, ignoring
[chimp][chromedriver] interrupt called
[chimp][chromedriver] stopping process
[chimp][chromedriver] kill called on chromedriver process with pid 49390
[chimp][chromedriver] checking if process exists
[chimp][chromedriver] chromedriver process exists, killing it with SIGTERM
Mocha failed
Error in chimp init Mocha failed

.......
I really want to get chimp working in order to implement acceptance testing on a significant meteor project that we are using in my group.
Failing getting chimp to work, if anyone knows of a better way to do automated acceptance testing on a meteor app I would appreciate that insight as well. Thanks.

A: I could not get Chrome to work but I could get safari to work, after uninstalling and reinstalling chimp and using --browser=safari in the scripts block of the package.json (or on the cli invoking chimp with npm.)
so ...
$chimp -v
0.49.0
$npm -v
5.0.3
$node -v
v6.11.0
$chimp --mocha --test --path=tests --debug --ddp=http://localhost:3000 --browser=safari

works.


text:
Q: Data disappears when url route I'm creating web app with tabletop.js, handlebars.js, and angular.js
So the data is fetching from google spreadsheet and using angular for routing
but when after route to another page and come back data disappears
Here's a Plunker of it
Can someone give a solution please, i've tried searching but no luck yet :/
Tabletop controllers

  var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AkLy8qCw6J5EdGlmeFZEVVVZZ3ZUSEhYcjhEdEZKelE&output=html';

  $(document).ready( function() {
    Tabletop.init( { key: public_spreadsheet_url,
                     callback: showInfo,
                     parseNumbers: true } );
  });

  function showInfo(data, tabletop) {
    var source   = $("#cat-template").html();
    var template = Handlebars.compile(source);

    $.each( tabletop.sheets("Cats").all(), function(i, cat) {
      var html = template(cat);
      $("#content").append(html);
    });
  }

And these are angular scripts
    var routeApp = angular.module('routeApp', []);

    routeApp.filter('range', function() {
        return function(input, total) {
            total = parseInt(total);
            for (var i=0; i<total; i++) {
                input.push(i);
            }
            return input;
        };
    });

    routeApp.config(function($routeProvider, $locationProvider) {

        $routeProvider.
            when('/home', { controller: HomeCtrl, templateUrl: 'partials/home.html' }).
            when('/movie/:id', { controller: BlogDetailCtrl, templateUrl: 'partials/movieDetail.html' }).
            when('/product', { controller: ProductCtrl, templateUrl: 'partials/product.html' }).
            otherwise({ redirectTo: '/home' });

        $locationProvider.html5Mode(false);

    });

    function MainCtrl($scope) {

        $scope.navs = [
            { text: 'Products', href: '#/product' },
        ];

    }

    function HomeCtrl($scope) {
        console.log($scope);
    }

    function BlogDetailCtrl($scope, $routeParams) {
        $scope.id = $routeParams.id;

        $scope.youAreClick = function(what) {
            alert('You are click on ' + what);
        }
    }

    function ProductCtrl($scope) {
        $scope.items = [
            { grid: 3.5, filename: '360x270' },
            { grid: 3.5, filename: '260x120' },
            { grid: 3, filename: '160x120' },
            { grid: 3, filename: '260x120' },
            { grid: 3, filename: '260x120' }
        ];
    }

A: Controllers are created/destroyed on the fly each time your route changes. Data stored in them is not persistent.
One way of overcoming this is to use a Service.
As stated in the documentation: "Lastly, it is important to realize that all Angular services are application singletons."

A: Check out Angular-Multi-View, specifically the persist() method. It lets you persist a view's scope across routing changes.


text:
Q: Looped Tasks Submitted Inside Try/Catch Blocks I have a background task "submitter" that handles one or more scheduled tasks:
...
While sdr.read()
    ...
    Dim oBackground As New Background
    Task.Run(Sub() CallByName(oBackground, sProcessKey, CallType.Method, iPQID))
End While

Before you ask, yes, the tasks are thread-safe.  :)
I want the submitter to end (go back to sleep) while the tasks operate; awaiting the next heartbeat, but I need to catch and handle exceptions in each thread.
The only way I've come up with to do this is to create a new task for each background job to be run and handle the exception there, but this seems inefficient:
Create new Task for each background job that then, submits the actual job and waits to see if an error happened and handles it:
Private Sub NewJob(sProcessKey, iPQID)
    Dim t As Task
    ....
    While sdr.read()
        ...
        Dim oBackground As New Background
        t = Task.Run(Sub() CallByName(oBackground, sProcessKey, CallType.Method, iPQID))
        Try
            t.Wait()
        Catch ex As AggregateException
            For Each IEx As Exception In ex.InnerExceptions
                HandleBackgroundException(IEx, sProcessKey)
            Next
        End Try
    End While
End Sub

Isn't there a better way to do this??
Thanks!

A: I believe I've found the answer to my own question.
Since each task is it's own thread, no additional thread submittal is needed.
The task is run directly and error handling happens within the task as shown above (but without Await'ing it). Thus:
Public Shared Sub MyTask()
    Try
        ... do some work here ...
    Catch ex As AggregateException
        For Each IEx As Exception In ex.InnerExceptions
            HandleBackgroundException(IEx, sProcessKey)
        Next
    End Try
End Sub

That's it!
I hope this helps someone else.


text:
Q: Overriding Responsive Row Defaults in Bootstrap I have a structure that looks like this:

The span3-phone CSS is a responsive class that makes the divs take up 32% of their container instead of whatever span3 usually takes up. The CSS is simple:
.span-3-phone {

  width: 32%;
}

This adjusts their width fine. The problem is that the presence of the row class breaks the divs up after the 4th div, whereas I want 3 divs per row. Is there any way to override the function of row for mobile devices so that it doesn't break the elements up? Without being able to do that it seems I will have to create an entirely different HTML document, which is not what I want.

A: You can over ride CSS by the use of !important. There are time when it's use is abused and considered lazy. It is a good solution when CSS needs over written and no other option is viable. A good example would be the use of !important when a javascript plugin is generating inline CSs and you need to overwrite it and you do not have the option to edit the plugin. If the one single use of !important would prevent you from having to re-write your entire html then i'd suggest it's use.
.span-3-phone {
    width: 32% !important;
}


text:
Q: Unable to launch application in Emulator I am using Eclipse for Android native development. For small Samples emulator is working, but when I imported Project and made to run, when I clicked on app icon.
It shows alert The application Customer Assist(Process com.blo.customer_Assist) has stopped unexpectedly. Please try again.
I googled it but didn't find solution
logcat
08-23 13:51:14.571: I/dalvikvm(309): Could not find method com.blo.Customer_Assist.activities.RescueActivity.getActionBar, referenced from method com.blo.Customer_Assist.activities.RescueActivity.onCreate
08-23 13:51:14.571: W/dalvikvm(309): VFY: unable to resolve virtual method 5941: Lcom/blo/Customer_Assist/activities/RescueActivity;.getActionBar ()Landroid/app/ActionBar;
08-23 13:51:14.571: D/dalvikvm(309): VFY: replacing opcode 0x6e at 0x0006
08-23 13:51:14.571: D/dalvikvm(309): VFY: dead code 0x0009-0077 in Lcom/blo/Customer_Assist/activities/RescueActivity;.onCreate (Landroid/os/Bundle;)V
08-23 13:51:14.581: I/dalvikvm(309): Could not find method android.content.SharedPreferences.getStringSet, referenced from method com.blo.Customer_Assist.activities.BaseActivity.getPreferenceValue
08-23 13:51:14.581: W/dalvikvm(309): VFY: unable to resolve interface method 325: Landroid/content/SharedPreferences;.getStringSet (Ljava/lang/String;Ljava/util/Set;)Ljava/util/Set;
08-23 13:51:14.581: D/dalvikvm(309): VFY: replacing opcode 0x72 at 0x0011
08-23 13:51:14.591: D/dalvikvm(309): VFY: dead code 0x0014-0014 in Lcom/blo/Customer_Assist/activities/BaseActivity;.getPreferenceValue (Ljava/lang/String;)Ljava/lang/Object;
08-23 13:51:14.601: I/dalvikvm(309): Could not find method android.content.SharedPreferences$Editor.putStringSet, referenced from method com.blo.Customer_Assist.activities.BaseActivity.setPreferenceValue
08-23 13:51:14.601: W/dalvikvm(309): VFY: unable to resolve interface method 316: Landroid/content/SharedPreferences$Editor;.putStringSet (Ljava/lang/String;Ljava/util/Set;)Landroid/content/SharedPreferences$Editor;
08-23 13:51:14.611: D/dalvikvm(309): VFY: replacing opcode 0x72 at 0x0012
08-23 13:51:14.611: I/dalvikvm(309): Could not find method android.content.SharedPreferences$Editor.apply, referenced from method com.blo.Customer_Assist.activities.BaseActivity.setPreferenceValue
08-23 13:51:14.611: W/dalvikvm(309): VFY: unable to resolve interface method 309: Landroid/content/SharedPreferences$Editor;.apply ()V
08-23 13:51:14.621: D/dalvikvm(309): VFY: replacing opcode 0x72 at 0x0018
08-23 13:51:14.621: D/dalvikvm(309): VFY: dead code 0x001b-001b in Lcom/blo/Customer_Assist/activities/BaseActivity;.setPreferenceValue (Ljava/lang/String;Ljava/lang/Object;)V
08-23 13:51:14.660: E/ResourceType(309): Style contains key with bad entry: 0x010102ce
08-23 13:51:14.671: D/AndroidRuntime(309): Shutting down VM
08-23 13:51:14.671: W/dalvikvm(309): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-23 13:51:14.691: E/AndroidRuntime(309): FATAL EXCEPTION: main
08-23 13:51:14.691: E/AndroidRuntime(309): java.lang.NoSuchMethodError: com.blo.Customer_Assist.activities.RescueActivity.getActionBar
08-23 13:51:14.691: E/AndroidRuntime(309):  at com.blo.Customer_Assist.activities.RescueActivity.onCreate(RescueActivity.java:449)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.os.Looper.loop(Looper.java:123)
08-23 13:51:14.691: E/AndroidRuntime(309):  at android.app.ActivityThread.main(ActivityThread.java:4627)
08-23 13:51:14.691: E/AndroidRuntime(309):  at java.lang.reflect.Method.invokeNative(Native Method)
08-23 13:51:14.691: E/AndroidRuntime(309):  at java.lang.reflect.Method.invoke(Method.java:521)
08-23 13:51:14.691: E/AndroidRuntime(309):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-23 13:51:14.691: E/AndroidRuntime(309):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-23 13:51:14.691: E/AndroidRuntime(309):  at dalvik.system.NativeStart.main(Native Method)

A: There's an indication in your LogCat already
Could not find method     com.blo.Customer_Assist.activities.RescueActivity.getActionBar, referenced from      method com.blo.Customer_Assist.activities.RescueActivity.onCreate

The emulator is crashing your app and thus you can't see it getting launched.
It couldn't find the getActionBar() method in the mentioned Activity class. Although it does sound strange, since all Activities in Android have this method. Are you sure you have extended an Activity class and used parenthesis after that? Can you post the code also, so that I can confirm?
PS: Also mention which version of Android OS are you trying in the emulator and what's the Minimum and Target API level?
Update:
ActionBars were implemented in HoneyComb (API level 11). So either change the minSdkVersion to 11 or use a support library to get the functionality and use getSupportActionBar() instead. More details are here - ActionBar


text:
Q: FTP IntegrationFlows Filters not working in Spring Integration 5.0.0.RC1 I have upgraded an integration flow from 4.3.12 to 5.0.0.RC1 to take advantage of the inbound stream capabilities. I'm finding that both the patternFilter and regexFilter are not filtering at all. To check that it wasn't just the streaming interface, I tried with the file based interface and I'm seeing the same results.
In 4.3.12 I had my file based flow defined by:
return IntegrationFlows
    .from(s -> s.ftp(ftpSessionFactory())
        .preserveTimestamp(true)
        .remoteDirectoryExpression(remoteDirectory())
        .regexFilter("sn\\.[0-9]{4}\\.txt$")
        .filter(ftpPersistantFilter())
        .localFilter(fileSystemPersistantFilter())
        .localFilename(f -> (currentUtcDay.toString("YYYYMMdd")) + "." + f)
        .localDirectory(new File(this.localDirectory)),
        e -> e.id("ftpInboundAdapter").autoStartup(true))
    .channel(MessageChannels.queue("ftpInboundResultChannel"))
    .get();

For consistency, here is the same definition in 5.0.0.RC1:
return IntegrationFlows
    .from(Ftp.inboundAdapter(ftpSessionFactory())
        .preserveTimestamp(true)
        .remoteDirectoryExpression(remoteDirectory())
        .regexFilter("sn\\.[0-9]{4}\\.txt$")
        .filter(ftpPersistantFilter())
        .localFilter(fileSystemPersistantFilter())
        .localFilename(f -> (currentUtcDay.toString("YYYYMMdd")) + "." + f)
        .localDirectory(new File(this.localDirectory)),
        e -> e.id("ftpInboundAdapter").poller(Pollers.fixedDelay(100)))
    .channel(MessageChannels.queue("ftpInboundResultChannel"))
    .get();

It is not filtering at all in 5.0.0.RC1. Has the configuration for the filters changed? Is there anything additional I need to do?
Edit:
For the next person who encounters this, here is the fix.
return IntegrationFlows
    .from(Ftp.inboundAdapter(ftpSessionFactory())
        .preserveTimestamp(true)
        .remoteDirectoryExpression(remoteDirectory())
        .filter(ftpPersistantFilter())
        .localFilter(fileSystemPersistantFilter())
        .localFilename(f -> (currentUtcDay.toString("YYYYMMdd")) + "." + f)
        .localDirectory(new File(this.localDirectory)),
        e -> e.id("ftpInboundAdapter").poller(Pollers.fixedDelay(100)))
    .channel(MessageChannels.queue("ftpInboundResultChannel"))
    .get();

Then I changed my ftpPersistantFilter from:
@Bean
public FtpPersistentAcceptOnceFileListFilter ftpPersistantFilter() {
    return new FtpPersistentAcceptOnceFileListFilter(metadataStore(), "ftpPersistentAcceptOnce");
}

to:
@Bean
public CompositeFileListFilter ftpPersistantFilter() {
    CompositeFileListFilter filters = new CompositeFileListFilter();
    filters.addFilter(new FtpPersistentAcceptOnceFileListFilter(metadataStore(), "ftpPersistentAcceptOnce"));
    filters.addFilter(new FtpRegexPatternFileListFilter(regexFilter));
}

A: The change in Spring Integration 5.0 is like that .filter(ftpPersistantFilter()) fully overrides the previous filter-aware options:
/**
 * Configure a {@link FileListFilter} to be applied to the remote files before
 * copying them.
 * @param filter the filter.
 * @return the spec.
 */
public S filter(FileListFilter<F> filter) {
    this.synchronizer.setFilter(filter);
    return _this();
}

So, your .regexFilter("sn\\.[0-9]{4}\\.txt$") is ignored.
The change is done like this to avoid confuses with unexpected internal compositions. For example regex and pattern filters are composed together with the FtpPersistentAcceptOnceFileListFilter: https://docs.spring.io/spring-integration/docs/5.0.0.RC1/reference/html/whats-new.html#__s_ftp_changes:

All the Inbound Channel Adapters (streaming and synchronization-based) now use an appropriate AbstractPersistentAcceptOnceFileListFilter implementation by default to prevent remote files duplicate downloads.

In other words: any filter-based options are mutually exclusive and the last one wins. That's much easier option to support and let end-user do not worry about unexpected mutations.
To fix your requirements you have to use CompositeFileListFilter for your ftpPersistantFilter and FtpRegexPatternFileListFilter.
I think we have to add some Migration Guide bullet on the matter.
Thanks for understanding.


text:
Q: Ionic 3 input set not firing when the value is changed inside onKeyboardShow function I have a Component with two <ion-fab> buttons that I want to move whenever I change the value of a variable called alturaTeclado: number. Here is the relevant part of the component:
import {Keyboard} from "@ionic-native/keyboard";
...

@Component({
    selector: 'page-login',
    templateUrl: 'login.html'
})
export class LoginPage {
    ...
    alturaTeclado: number = 0;

    constructor(
    ...
    private keyboard: Keyboard) {

        // setTimeout(()=>{
        //     this.alturaTeclado = 249;
        // },1000);

        this.keyboard.onKeyboardShow().subscribe(eventoTeclado => {
            // eventoTeclado.keyboardHeight is 249 when opened
            this.alturaTeclado = eventoTeclado.keyboardHeight;
            console.log('ABRIR teclado altura resultado', this.alturaTeclado);
        });

        this.keyboard.onKeyboardHide().subscribe(eventoTeclado => {
            console.log('Evento teclaod ', eventoTeclado);
            this.alturaTeclado = 0;
            console.log('CERRAR teclado altura resultado', this.alturaTeclado);
        });
    }

    moverBotones() {
        console.log('mover botones');
        if (!this.alturaTeclado) {
            this.alturaTeclado = 249;
        } else {
            this.alturaTeclado = 0;
        }
    }
}

This is what the HTML looks like:
<ion-fab bottom left fabDeslizante [alturaTeclado]="alturaTeclado">
    <button type="button" ion-fab color="primary" >
        <ion-icon name="ios-undo"></ion-icon>
    </button>
</ion-fab>

fabDeslizante is a Directive I've created to achieve that:
@Directive({
    selector: '[fabDeslizante]'
})
export class FabDeslizanteDirective implements OnInit, OnChanges {

    altura: number = 0;

    constructor(private el: ElementRef) {
    }

    @Input() set alturaTeclado(altTeclado: number) {
        console.log('Altura anterior', this.altura);
        console.log('Altura teclado', altTeclado);
        this.altura = altTeclado;
        this.el.nativeElement.style.transform = 'translate3d(0, -' + this.altura + 'px, 0)';
    }

    ngOnInit(): void {
        this.el.nativeElement.style.transitionDuration =  '0.3s';
    }

    ngOnChanges(changes: SimpleChanges) {
        console.log('Cambios ', changes);
    }
}

The problem is that the @Input() set alturaTeclado(altTeclado: number) function doesn't fire when the keyboard opens. Console shows the message of the component properly with the correct value of this.alturaTeclado (249 in this case) but not the messages from the Directive. After opening the keyboard, if I click anywhere it suddenly shows Directive messages and the button moves.
If I change the value of this.alturaTeclado from moverBotones() function, or from the commented setTimeout, it works well.
Keyboard plugin:
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"

Window is not resizing because I've changed windowSoftInputMode:
android:windowSoftInputMode="adjustPan"

Thank you in advance

A: It turns out that the code run inside onKeyboardShow() callback is outside Angular Zone and it doesn't update the UI and this is the cause of not firing @Input() set alturaTeclado(altTeclado: number) (even if the value of this.alturaTeclado is changing)
In case any other finds it useful, you can check if your code is in Zone importing NgZone:
import {NgZone} from '@angular/core';

and runnning:
NgZone.isInAngularZone()

In my example:
this.keyboard.onKeyboardShow().subscribe(eventoTeclado => {
    console.log('angular zone', NgZone.isInAngularZone());
    this.alturaTeclado = eventoTeclado.keyboardHeight;
    console.log('ABRIR teclado altura resultado', this.alturaTeclado);
});

It prints:
angular zone false

To solve my problem I just added the run() method from NgZone:
constructor(
    ...
    private keyboard: Keyboard,
    public zone: NgZone) {
        ...
    }
...
)

this.keyboard.onKeyboardShow().subscribe(eventoTeclado => {
    console.log('angular zone', NgZone.isInAngularZone());
    this.zone.run(() => {
        console.log('angular zone 2', NgZone.isInAngularZone());
        this.alturaTeclado = eventoTeclado.keyboardHeight;
    });
});

It works as I wanted and it prints:
angular zone false
angular zone 2 true

Official docs for NgZone
Hope it helps someone else


text:
Q: How to add diffrent css class to html for every foreach loop in knockout js KnockoutJS Data
function ExampleViewModel() {
    var self = this;
    self.ExampleData = ko.observableArray([]);
    self.update = function() {
        $.ajax("test.json", {
            success: function(allData) {
                var mappeddata = $.map(allData, function(item) {
                    return new DataItem(item)
                });
                self.ExampleData(mappeddata);
            }
        });
    }
}

function DataItem(data) {
    this.Name = ko.observable(data.name);
}
var exampleViewModel = new ExampleViewModel();
ko.applyBindings(exampleViewModel);

Html Data

How I can change class of below div in every foreach loop
  div class="has-topic-background-color

i need if in first loop its show red color then in second loop i need blue color insted of red

A: You can use css binding
http://knockoutjs.com/documentation/css-binding.html

function ViewModel() {
  var self = this;
  self.data = ko.observableArray([1, 2, 3, 4, 5, 6, 7, 8, 9]);
  self.className = function(index) {
    return index % 2 === 0? 'redClass' : 'blueClass';
  };
  self.textValue = function(index) {
    return 'Data  for index ' + index + ' has background ' + self.className(index);
  }
}

$(document).ready(function () {
  var myViewModel = new ViewModel();
  ko.applyBindings(myViewModel);
});

  You can inspect the element to see the class name