Q: Kivy ScreenManager can't reference class from .py file class any more. Attribute error: 'super' has I just started developing my first app in python using kivy. I generated the general layout of the app and also some logic in an python file in addition to my main py to seperate everything a bit. This worked perfectly fine and the app was running without any issues. I wanted to add some screens when hitting buttons that provide extra information. Managed to do so, but now the app crashes when hitting the buttons that worked before adding the extra screens. Those buttons use classes that aren't implemented in the main.py but in a side file. Like I explained, they worked before adding the ScreenManager. here's the short version of the error I get: AttributeError: 'super' object has no attribute '__getattr__'
Main.py:
peenomat.py
import kivy
# -*- coding: iso-8859-1 -*-
from kivy.app import App

from kivy.uix.button import Label
from kivy.uix.widget import Widget
from kivy.uix.textinput import TextInput
from kivy.lang import Builder
from kivy.uix.anchorlayout import AnchorLayout
from kivy.core.text import LabelBase
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import BooleanProperty
from kivy.properties import ObjectProperty
from kivy.config import Config

Builder.load_file('Header.kv')
Builder.load_file('Statusbar.kv')
Builder.load_file('Inputparameters.kv')
Builder.load_file('Outputparameters.kv')
Builder.load_file('Extra.kv')
#loading main kv
Builder.load_file('peenomat.kv')

class Peenomat(Screen):
    pass

class Instruction(Screen):
    pass

class Additional(Screen):
    pass

# Create the screen manager
sm = ScreenManager()
sm.add_widget(Peenomat(name='peenomat'))
sm.add_widget(Instruction(name='instruction'))
sm.add_widget(Additional(name='additional'))

class PeenomatApp(App):
    def build(self):
        self.icon = 'icon.png'
        #return pm
        return sm
        #return Peenomat()

if __name__=="__main__":

    PeenomatApp().run()

the main kv.file:
peenomat.kv
<Peenomat>

    AnchorLayout:
        anchor_x: 'left'
        anchor_y: 'bottom'
        GridLayout:
            cols: 1

            InputParameters:
                id:_input_parameters

            StatusBar:
                id:_status_bar

<Instruction>:
    AnchorLayout:
        anchor_x: 'left'
        anchor_y: 'bottom'
        GridLayout:
            cols: 1
            canvas.before:
            Label:
                text:

            Button:
                text:
                on_release:
                    app.root.current = "peenomat"
                    app.root.transition.direction = "up"

<Additional>:
    AnchorLayout:
        anchor_x: 'left'
        anchor_y: 'bottom'
        GridLayout:
            cols: 1
            Button:
                text:
                on_release:
                    app.root.current = "peenomat"
                    app.root.transition.direction = "left"

the .kv file where I reference the function of the buttons:
statusbar.kv
#: import statusbar StatusBar

<StatusBar@BoxLayout>

    orientation:'horizontal'
    padding:
    spacing:

    Label:
        size_hint: 0.05, 1

    Button:
        text: 'Leeren'
        on_press: root.btn_clear()

    Button:
        text: "Mehr"
        on_release:
            app.root.current = "additional"
            app.root.transition.direction ="right"

    Button:
        text: u"Los schl\u00e4gts"
        on_press: root.btn_submit()

    Button:
        text: "?"
        on_release:
            app.root.current = "instruction"
            app.root.transition.direction ="down"

and finally the python file that provides the classes where i generate the functions of the buttons that now crash:
StatusBAr.py
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.properties import ObjectProperty
from kivy.properties import StringProperty
from kivy.app import App
from kivy.lang import Builder
#from Inputparameters import InputParameters

ver = ''
class InputParameters(GridLayout):
    verfahren =ObjectProperty(None)

    def on_state(self, togglebutton):
        tb = togglebutton
        global ver
        if tb.state == 'down':
            self.verfahren = tb.text
            ver = tb.text
            print(self.verfahren, ver)
            return self.verfahren

class StatusBar(BoxLayout):
    #InputGrößen
    group_mode = False
    prozess = ObjectProperty(None)
    vorbehandlung = ObjectProperty(None)
    material = ObjectProperty(None)
    haerte = ObjectProperty(None)
    rauheit = ObjectProperty(None)
    verfahren = ObjectProperty(None)

    #OutputGrößen
    frequency = StringProperty(None)
    speed = StringProperty(None)
    hub = StringProperty(None)

    def btn_submit(self):
        global ver
        ip = App.get_running_app().root.ids._input_parameters
        op = App.get_running_app().root.ids._output_parameters

        frequenz = 0
        if ip.haerte.value < 50:
            op.frequency = str(180) +" Hz"
            op.speed = str(2.4) +" mm/s"
            op.hub = str(3.4) + " mm"
        elif ip.haerte.value < 60:
            op.frequency = str(200) +" Hz"
            op.speed = str(3.5) + " mm/s"
            op.hub = str(5.23) + " mm"
        else:
            op.frequency = str(220) +" Hz"
            op.speed = str(1.2) + " mm/s"
            op.hub = str(7.2) + " mm"
        #control to see if right value is taken
        print(op.frequency)

    def btn_clear(self):
        ip = App.get_running_app().root.ids._input_parameters
        op = App.get_running_app().root.ids._output_parameters
        ip.pro1.state = "normal"
        ip.pro2.state = "normal"
        ip.pro3.state = "normal"
        ip.material.text = "Auswahl treffen"
        ip.vorbehandlung.text = "Auswahl treffen"
        ip.haerte.value = 55
        ip.rauheit.value = 5.5
        op.frequency = "---"
        op.speed = "---"
        op.hub = "---"

so if the buttons submit or clear are used I get the following error:
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "kivy\properties.pyx", line 860, in kivy.properties.ObservableDict.__getattr__
 KeyError: '_input_parameters'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "C:/Users/schum/Dokumente/TUD/Masterthesis/Peenomat.py", line 79, in <module>
     PeenomatApp().run()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\app.py", line 855, in run
     runTouchApp()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\base.py", line 504, in runTouchApp
     EventLoop.window.mainloop()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 747, in mainloop
     self._mainloop()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 479, in _mainloop
     EventLoop.idle()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\base.py", line 342, in idle
     self.dispatch_input()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\base.py", line 327, in dispatch_input
     post_dispatch_input(*pop(0))
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\base.py", line 233, in post_dispatch_input
     listener.dispatch('on_motion', etype, me)
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\core\window\__init__.py", line 1402, in on_motion
     self.dispatch('on_touch_down', me)
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\core\window\__init__.py", line 1418, in on_touch_down
     if w.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\screenmanager.py", line 1191, in on_touch_down
     return super(ScreenManager, self).on_touch_down(touch)
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\widget.py", line 549, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\relativelayout.py", line 288, in on_touch_down
     ret = super(RelativeLayout, self).on_touch_down(touch)
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\widget.py", line 549, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\widget.py", line 549, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\widget.py", line 549, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\widget.py", line 549, in on_touch_down
     if child.dispatch('on_touch_down', touch):
   File "kivy\_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\uix\behaviors\button.py", line 151, in on_touch_down
     self.dispatch('on_press')
   File "kivy\_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch
   File "kivy\_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
   File "kivy\_event.pyx", line 1098, in kivy._event.EventObservers._dispatch
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\venv\lib\site-packages\kivy\lang\builder.py", line 64, in custom_callback
     exec(__kvlang__.co_value, idmap)
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\Statusbar.kv", line 38, in <module>
     on_press: root.btn_submit()
   File "C:\Users\schum\Dokumente\TUD\Masterthesis\StatusBar.py", line 41, in btn_submit
     ip = App.get_running_app().root.ids._input_parameters
   File "kivy\properties.pyx", line 863, in kivy.properties.ObservableDict.__getattr__
 AttributeError: 'super' object has no attribute '__getattr__'

the function of the buttons is to get selected parameter out of this .kv.file
inputparameters.kv
#: import statusbar StatusBar

<InputParameters@GridLayout>
    #Initialisierung .py zu .kv Ids
    prozess: _prozess
    pro1: _prozess1
    pro2: _prozess2
    pro3: _prozess3
    vorbehandlung: _vorbehandlung
    material: _material
    haerte: _haerte
    rauheit: _rauheit

    cols: 2
    padding: 25
    spacing: 10

    #Prozess
    Label:
        text:'Prozess:              '

    BoxLayout:
        orientation: 'horizontal'
        id: _prozess

        ToggleButton:
            id:_prozess1
            text:'P-MOH'
            group: "proc_group"
            on_state: root.on_state(self)

        ToggleButton:
            id:_prozess2
            text:'E-MOH'
            group: "proc_group"
            on_state: root.on_state(self)

        ToggleButton:
            id:_prozess3
            text:'PE-MOH'
            group: "proc_group"
            on_state: root.on_state(self)

    #Material

    Label:
        text: 'Material:'

    Spinner:
        id: _material
        text: "Auswahl treffen"
        values: ['1.2379', 'Gusseisen', 'Kautschuk', 'Carbon', 'Adamantium']

    # Herstellschritte
    Label:
        text:'Fertigungsschritte:'

    Spinner:
        id: _vorbehandlung
        text: "Auswahl treffen"
        values: [u'Fr\u00e4sen', 'Erodieren', 'Schleifen', 'Polieren']

    # Haerte
    Label:
        text: u"H\u00e4rte:"

    BoxLayout:
        orientation: 'vertical'

        Label:
            text: str(_haerte.value) + ' HRC'

        Slider:
            id: _haerte
            min: 45
            max: 65
            step: 1
            value_track: True

    # Rauheit
    Label:
        text:'Rauheit:'

    BoxLayout:
        orientation: 'vertical'
        Label:
            text: str("%.1f" % _rauheit.value) + ' Rz' #eine Nachkommastelle

        Slider:
            id: _rauheit
            min: 1
            max: 10
            value_track: True

whats weirrd is that the togglebuttons can still use the function generatet in the statusbar.py and do their job.
I hope you can help me out with this and don't even know where to start...
Thank's in advance!

A: The ids dictionary is created for each rule in the kv file, and those ids are placed in the dictionary for the root of that rule. So the _input_parameters id is only in the ids of the Peenomat instance.
So, I think you need to change:
    ip = App.get_running_app().root.ids._input_parameters

to something like:
    ip = App.get_running_app().root.get_screen('peenomat').ids._input_parameters

The root of your App is the ScreenManager, and get_screen('peenomat') gets the Peenomat Screen instance.


Q: StackOverflowError on recursive algorithm I'm trying to code a recursive algorithm in order to generate a valid board(unique solution) for a game called kakuro.
When executing the program I keep getting a StackOverflowError. I tried debugging my code and it is working as expected, but it suddenly crashes in a non recursive method. I have been reading about this issue on the internet and I have already checked that I don't make two recursive calls with the same parameters. This algorithm tries different values for certain squares and (when every square has its own value, it should thus try every possible combination of values for those squares) solves it in order to see whether it has an unique solution.
 private boolean generarKakuroRecursivo(ArrayList<Negra> noColocados, Casella[][] tablero){
        if (noColocados.size() == 0 ){
            System.out.println(getStringTablero());
            if (kakuroUnico(tablero)){
                this.tauler = tablero;
                return true;
            }
            else return false;
        }

        Negra casillaNegra = noColocados.get(0);

        boolean fila = casillaNegra.getFila() == 0 && casillaNegra.getCoords().getElement1()+1 < dimensio && this.tauler[casillaNegra.getCoords().getElement0()][casillaNegra.getCoords().getElement1()+1].getTipus() == 'B';
        boolean columna = casillaNegra.getColumna() == 0 && casillaNegra.getCoords().getElement0()+1 < dimensio && this.tauler[casillaNegra.getCoords().getElement0()+1][casillaNegra.getCoords().getElement1()].getTipus() == 'B';
        ArrayList <Pair<Integer, ArrayList<ArrayList<Integer>> >> posibilidadesNegra = calcularPosibilidades(casillaNegra);

        //CALCULAMOS LOS POSIBLES NUMEROS PARA LA CASILLA NEGRA QUE HEMOS COGIDO

        int index1 = casillaNegra.getCoords().getElement0(), index2 = casillaNegra.getCoords().getElement1();
        for (Pair<Integer, ArrayList<ArrayList<Integer>> > posibilidad : posibilidadesNegra){
            int valor = posibilidad.getElement0();
            if (fila && columna){
                colocarNegra(((Negra)tablero[index1][index2]), valor, true);
                noColocados.get(0).setNumFil(valor); //poner fila =false
            } //actualizar restricciones
            else if(fila){
                colocarNegra(((Negra)tablero[index1][index2]), valor, true);
                noColocados.remove(0);
            }
            else if (columna){
                colocarNegra(((Negra)tablero[index1][index2]), valor, false);
                noColocados.remove(0);
            }
            if (generarKakuroRecursivo(noColocados, tablero)) return true;
            else{
                                                                                if (!noColocados.contains(casillaNegra)) noColocados.add(casillaNegra);
                if (fila){
                    retirarNegra((Negra)tablero[index1][index2],true);
                    if (!noColocados.contains(casillaNegra)) noColocados.add(casillaNegra);
                }

                else if (columna) {
                    retirarNegra((Negra)tablero[index1][index2], false);
                    if (!noColocados.contains(casillaNegra)) noColocados.add(casillaNegra);
                }

            }
        } //Caso recursivo

        //PROBAMOS RECURSIVAMENTE TODAS LAS OPCIONES

        return false;
}

This is the recursive function in discuss, noColocados is an ArrayList which contains the squares (belonging to tablero) where we want to try all the possible combinations (if one of those combinations generates a unique solution(it should happen) the algorithm stops).
Boards generated by the algorithm before crashing
As you can see in the picture above, the algorithm works well until it crashes.
Debug information of the crash
In this picture you can see where the StackOverflowError is triggered, as you can see calculaNumCells is a non recursive method.
Edit: I also tried not parsing the parameter tablero as it was unnecessary (it is the same as the implicit parameter of the class) to the recursive algorithm nor other methods like CalculaNumCells.
Anyway the execution keeps crashing in the same exact point that it was crashing before.

A: A StackOverflowError merely indicates that there’s no space available in the stack for a new frame. In your case, the recursive calls still fill up most of the stack but, since the method calls other methods besides itself, those can also exhaust the stack.
If, for example, your recursive method called only itself, the stack would always be exhausted when calling that one method.


Q: How to handle One-to-Many Join without repeat rows In MS SQL Server I have two tables [Products] and [Product_img] with relationship (ONE TO MANY).
SELECT p_id, name FROM dbo.products
| 15 |  | name1 |
| 17 |  | name2 |
SELECT p_id, path FROM dbo.product_img
| 1.jpg |   | 15 |
| 2.jpg |   | 15 |
| 3.jpg|    | 17 |
| 4.jpg |   | 17 |
SELECT dbo.product_img.p_id, dbo.products.name, dbo.product_img.path FROM dbo.product_img INNER JOIN dbo.products ON dbo.product_img.p_id = dbo.products.p_id
| 15 |  | name1 |   | 1.jpg |
| 15 |  | name1 |   | 2.jpg |
| 17 |  | name2 |   | 3.jpg |
| 17 |  | name2 |   | 4.jpg |
What is the SQL statement that can show the tables like this (with out repeating)?
| 15 |  | name1 |   | 1.jpg |   | 2.jpg |
| 17 |  | name2 |   | 3.jpg |   | 4.jpg |

A: USE MAX AND MIN
SELECT
  dbo.product_img.p_id
, dbo.products.name
, MAX(dbo.product_img.path)
, MIN(dbo.product_img.path)
FROM dbo.product_img
INNER JOIN dbo.products
    ON dbo.product_img.p_id = dbo.products.p_id
 GROUP BY dbo.product_img.p_id , dbo.products.name

A: If you can have more than two images per product you can do this to get one column with the img path's.
select
  p.p_id,
  p.name,
  stuff((select ', '+i.path
         from product_img as i
         where p.p_id = i.p_id
         for xml path(''), type).value('text()[1]', 'nvarchar(max)'), 1, 2, '') as path
from products as p

Result
p_id    name    path
-----   -----   ------------
15      name1   1.jpg, 2.jpg
17      name2   3.jpg, 4.jpg


Q: Rings such that every module is a direct sum of generator modules Is there a classification of those rings $R$ for which the category of left $R$-modules $\mathbf{Mod}(R)$ is generated by a small set of left $R$-modules under direct sums?
For example, every semisimple ring has this property, since every left $R$-module is a direct sum of simple modules, which in turn are isomorphic to $R/I$ for some maximal left ideal $I \subseteq R$. More generally, every Artinian principal ideal ring has the property that every left $R$-module is a direct sum of cyclic modules. But in my question I don't require the generator modules to be cyclic.

A: The condition is equivalent to the property that there is some cardinal $\kappa$ such that every left $R$-module is a direct sum of modules with at most $\kappa$ generators.
Theorem 2 of
Warfield, R. B. jun, Rings whose modules have nice decompositions, Math. Z. 125, 187-192 (1972). ZBL0218.13012.
shows that the commutative rings with this property are precisely the Artinian principal ideal rings.
For not necessarily commutative rings, Theorem 2.2 of
Griffith, P., On the decomposition of modules and generalized left uniserial rings, Math. Ann. 184, 300-308 (1970). ZBL0175.31703.
shows that all rings with this property are left Artinian.
There is a property of rings called (left) pure semisimplicity, which has several equivalent definitions. Section 4.5 of
Prest, Mike, Purity, spectra and localisation., Encyclopedia of Mathematics and its Applications 121. Cambridge: Cambridge University Press (ISBN 978-0-521-87308-6/hbk). xxviii, 769 p. (2009). ZBL1205.16002.
gives a good survey, including such results as:
(Theorem 4.5.4) A left pure semisimple ring is left Artinian, and every left $R$-module is a direct sum of indecomposable finite length indecomposable modules.
(Theorem 4.5.7) $R$ is left pure semisimple if and only if every left $R$-module is  a direct sum of indecomposable modules, if and only if there is a cardinal $\kappa$ such that every left $R$-module is a direct sum of modules of cardinality less than $\kappa$.
(Note that one consequence of all of this is that if every left $R$-module is a direct sum of modules with at most $\kappa$ generators for some $\kappa$, then in fact every left $R$-module is a direct sum of finitely generated modules.)
So a complete answer to the question is that the rings in question are precisely the left pure semisimple rings, although one might argue that this is just replacing the original condition with an equally mysterious one.
But there is a conjecture (the Pure Semisimplicity Conjecture, which is 4.5.26 in Prest's book) that the left pure semisimple rings are precisely the rings of finite representation type (i.e., for which every module is a direct sum of indecomposable modules, and with only finitely many indecomposables). It is known that every ring of finite representation type is left pure semisimple. Also, "finite representation type" is a left/right symmetric property, so if the conjecture is true then pure semisimplicity is a left/right symmetric property.


Q: What is the meaning of sock puppetry on Stack Exchange? I have seen the terms socking, sock puppet, sock puppeting, sock puppetry flying around in different questions here, but what do they actually mean? I know what a sock puppet is in the real world is a child's toy made from a sock, but what does it mean in this world?

Note: even though it's mentioned in Stack Exchange Glossary - Dictionary of Commonly-Used Terms, I would like to have a more detailed answer here, since this term has big impact.

A: The on-site description currently available is the tag-wiki for the tag sock-puppet:

A sock puppet is an extra account created in addition to the user's normal account and used for abusive purposes.
A sock puppet is an extra account created in addition to the user's normal account.
On Stack Exchange, one abusive reason for sock puppetry is serial voting, especially upvoting own answers.
Users found to be abusing sock puppets will have such accounts deleted and their main account will be suspended or deleted.
Note that having more than one account for a legitimate purpose is permitted.

Here at Stack Exchange, it often means someone who creates multiple accounts and uses these extra accounts to increase his or her reputation. These sock puppets can be used to upvote the questions and answers for the puppeteer, or to post questions where they accept the puppeteer's answer.
But do note that multiple accounts do not necessarily imply sock puppetry. As long as you are not using the extra account for evil deeds, such as vote fraud, you are fine. One commenter to this post has one account that he/she uses on untrusted connections.
From Wikipedia:

A sockpuppet is an online identity used for purposes of deception. The term, a reference to the manipulation of a simple hand puppet made from a sock, originally referred to a false identity assumed by a member of an Internet community who spoke to, or about, themselves while pretending to be another person.
The term now includes other misleading uses of online identities, such as those created to praise, defend or support a person or organization, to manipulate public opinion, or to circumvent a suspension or ban from a website. A significant difference between the use of a pseudonym and the creation of a sockpuppet is that the sockpuppet poses as an independent third-party unaffiliated with the puppeteer. Sockpuppets are unwelcome in many online communities and may be blocked.

From comment:

As an anecdotal example, I have 2 Stack Exchange accounts: A more professional one tied with my Uni email (wont last forever), & a more personal one tied with my permanent main email. At any time I may be logged in (through device/browser cookies) with either one. I may not wish to hassle switching accounts to interact with a post I already entered with the other account. For ex, I might prefer to create an edit with the current account & approve it at a later time on the original account. Is this allowed? Am I also not allowed to upvote my most important contribution (so it stands out)?

Upvoting your own posts for any reason is completely against the rules.
Any interaction whatsoever on posts you have interacted with with another account is, if not obviously forbidden, at least highly questionable.
When it comes to approval of your own edits, I'd say it's not ok. You could argue that it would not be misuse to approve your own edit because you could just have switched account. And while that is true, you could gain reputation and badges for your second account for doing so. And it could possibly be a lot of other factors that I cannot even think about right now. Also, bear in mind that you might get caught by bots while doing this, and resolving such situations would require manual intervention. And it is not really reasonable that the moderators should have to deal with this just because you don't want to switch account. So stay away from your own posts and actions completely.


Q: CSS clearfix hiding text in chrome / safari? I have an odd problem that I'm facing. I'm using a simple CSS clearfix hack as described on CSS-Tricks to clear floats. Code snippet:
*:after {
  content: "";
  display: table;
  clear: both;
}

However, adding the above code causes the text to be invisible in Chrome and Safari. I've tested it on several devices now and had the same results each time, but I can't figure out why this would be breaking anything. However, Firefox
You can view the working version here and the broken version here. If you inspect page source, the only difference is the above snippet being commented out.
Screenshot of the issue http://cl.ly/image/3h1s0Q31473Q
I've spent some time looking around, but I can't find any mention of this problem anywhere else. Everything renders fine in Firefox.
Thanks in advance,
-Zach


Q: How to check if there is a table on an excel sheet I have to make a VBA macro to check if there is a chart already present on an excel sheet. So, if there is any chart present, I have to delete it and if not, I have to put in a new chart.
I tried using:
Worksheets("Sheet.Name").ChartObjects.Delete directly, but if a chart was not present on a sheet, it gave an error.
i also tried using  ThisWorkbook.Charts.Count but it is always showing that I have 0 charts in my workbook even though there are 2 charts on the first sheet itself.
Please help. Thanks :)

A: Try looping through all ChartObjects in your worksheet, and delete each one of them (if exists).
Code:
Option Explicit

Sub CheckCharts()

Dim ChtObj As ChartObject

For Each ChtObj In Worksheets("Sheet1").ChartObjects '<-- modify "Sheet1" with your sheet's name
    ChtObj.Delete
Next ChtObj

End Sub


Q: Creating a dynamic Linq select clause from Expressions Let's say I have defined the following variables:
IQueryable<MyClass> myQueryable;
Dictionary<string, Expression<Func<MyClass, bool>>> extraFields;
// the dictionary is keyed by a field name

Now, I want to tack on some dynamic fields to the IQueryable, so that it returns an IQueryable<ExtendedMyClass>, where ExtendedMyClass is defined as:
class ExtendedMyClass
{
  public MyClass MyObject {get; set;}
  public IEnumerable<StringAndBool> ExtraFieldValues {get; set;}
}

class StringAndBool
{
  public string FieldName {get; set;}
  public bool IsTrue {get; set;}
}

In other words, for every value in extraFields, I want to have a value in ExtendedMyClass.ExtraFieldValues representing whether that expression evaluates to True or not for that row.
I have a feeling this should be doable in dynamic Linq and LinqKit, though I've never used that seriously before.  I'm also open to other suggestions, especially if this can be done in good ol' strong-typed Linq.
I am using Linq to Entities, so the query needs to translate to SQL.

A: So, we'll have a lot of steps here, but each individual step should be fairly short, self-contained, reusable, and relatively understandable.
The first thing we'll do is create a method that can combine expressions.  What it will do is take an expression that accepts some input and generates an intermediate value.  Then it will take a second expression that accepts, as input, the same input as the first, the type of the intermediate result, and then computes a new result.  It will return a new expression taking the input of the first, and returning the output of the second.
public static Expression<Func<TFirstParam, TResult>>
    Combine<TFirstParam, TIntermediate, TResult>(
    this Expression<Func<TFirstParam, TIntermediate>> first,
    Expression<Func<TFirstParam, TIntermediate, TResult>> second)
{
    var param = Expression.Parameter(typeof(TFirstParam), "param");

    var newFirst = first.Body.Replace(first.Parameters[0], param);
    var newSecond = second.Body.Replace(second.Parameters[0], param)
        .Replace(second.Parameters[1], newFirst);

    return Expression.Lambda<Func<TFirstParam, TResult>>(newSecond, param);
}

To do this we simply replace all instances of the second parameter in the second expression's body with the body of the first expression.  We also need to ensure both implementations use the same parameter instance for the main parameter.
This implementation requires having a method to replace all instances of one expression with another:
internal class ReplaceVisitor : ExpressionVisitor
{
    private readonly Expression from, to;
    public ReplaceVisitor(Expression from, Expression to)
    {
        this.from = from;
        this.to = to;
    }
    public override Expression Visit(Expression node)
    {
        return node == from ? to : base.Visit(node);
    }
}

public static Expression Replace(this Expression expression,
    Expression searchEx, Expression replaceEx)
{
    return new ReplaceVisitor(searchEx, replaceEx).Visit(expression);
}

Next we'll write a method that accepts a sequences of expressions that accept the same input and compute the same type of output.  It will transform this into a single expression that accepts the same input, but computes a sequence of the output as a result, in which each item in the sequence represents the result of each of the input expressions.
This implementation is fairly straightforward; we create a new array, use the body of each expression (replacing the parameters with a consistent one) as each item in the array.
public static Expression<Func<T, IEnumerable<TResult>>> AsSequence<T, TResult>(
    this IEnumerable<Expression<Func<T, TResult>>> expressions)
{
    var param = Expression.Parameter(typeof(T));
    var body = Expression.NewArrayInit(typeof(TResult),
        expressions.Select(selector =>
            selector.Body.Replace(selector.Parameters[0], param)));
    return Expression.Lambda<Func<T, IEnumerable<TResult>>>(body, param);
}

Now that we have all of these general purpose helper methods out of the way, we can start working on your specific situation.
The first step here is to turn your dictionary into a sequence of expressions, each accepting a MyClass and creating a StringAndBool that represents that pair.  To do this we'll use Combine on the value of the dictionary, and then use a lambda as the second expression to use it's intermediate result to compute a StringAndBool object, in addition to closing over the pair's key.
IEnumerable<Expression<Func<MyClass, StringAndBool>>> stringAndBools =
    extraFields.Select(pair => pair.Value.Combine((foo, isTrue) =>
        new StringAndBool()
        {
            FieldName = pair.Key,
            IsTrue = isTrue
        }));

Now we can use our AsSequence method to transform this from a sequence of selectors into a single selector that selects out a sequence:
Expression<Func<MyClass, IEnumerable<StringAndBool>>> extrafieldsSelector =
    stringAndBools.AsSequence();

Now we're almost done.  We now just need to use Combine on this expression to write out our lambda for selecting a MyClass into an ExtendedMyClass while using the previous generated selector for selecting out the extra fields:
var finalQuery = myQueryable.Select(
    extrafieldsSelector.Combine((foo, extraFieldValues) =>
        new ExtendedMyClass
        {
            MyObject = foo,
            ExtraFieldValues = extraFieldValues,
        }));

We can take this same code, remove the intermediate variable and rely on type inference to pull it down to a single statement, assuming you don't find it too unweidly:
var finalQuery = myQueryable.Select(extraFields
    .Select(pair => pair.Value.Combine((foo, isTrue) =>
        new StringAndBool()
        {
            FieldName = pair.Key,
            IsTrue = isTrue
        }))
    .AsSequence()
    .Combine((foo, extraFieldValues) =>
        new ExtendedMyClass
        {
            MyObject = foo,
            ExtraFieldValues = extraFieldValues,
        }));

It's worth noting that a key advantage of this general approach is that the use of the higher level Expression methods results in code that is at least reasonably understandable, but also that can be statically verified, at compile time, to be type safe.  There are a handful of general purpose, reusable, testable, verifiable, extension methods here that, once written, allows us to solve the problem purely through composition of methods and lambdas, and that doesn't require any actual expression manipulation, which is both complex, error prone, and removes all type safety.  Each of these extension methods is designed in such a way that the resulting expression will always be valid, so long as the input expressions are valid, and the input expressions here are all known to be valid as they are lambda expressions, which the compiler verifies for type safety.

A: I think it's helpful here to take an example extraFields, imagine how would the expression that you need look like and then figure out how to actually create it.
So, if you have:
var extraFields = new Dictionary<string, Expression<Func<MyClass, bool>>>
{
    { "Foo", x => x.Foo },
    { "Bar", x => x.Bar }
};

Then you want to generate something like:
myQueryable.Select(
    x => new ExtendedMyClass
    {
        MyObject = x,
        ExtraFieldValues =
            new[]
            {
                new StringAndBool { FieldName = "Foo", IsTrue = x.Foo },
                new StringAndBool { FieldName = "Bar", IsTrue = x.Bar }
            }
    });

Now you can use the expression trees API and LINQKit to create this expression:
public static IQueryable<ExtendedMyClass> Extend(
    IQueryable<MyClass> myQueryable,
    Dictionary<string, Expression<Func<MyClass, bool>>> extraFields)
{
    Func<Expression<Func<MyClass, bool>>, MyClass, bool> invoke =
        LinqKit.Extensions.Invoke;

    var parameter = Expression.Parameter(typeof(MyClass));

    var extraFieldsExpression =
        Expression.Lambda<Func<MyClass, StringAndBool[]>>(
            Expression.NewArrayInit(
                typeof(StringAndBool),
                extraFields.Select(
                    field => Expression.MemberInit(
                        Expression.New(typeof(StringAndBool)),
                        new MemberBinding[]
                        {
                            Expression.Bind(
                                typeof(StringAndBool).GetProperty("FieldName"),
                                Expression.Constant(field.Key)),
                            Expression.Bind(
                                typeof(StringAndBool).GetProperty("IsTrue"),
                                Expression.Call(
                                    invoke.Method,
                                    Expression.Constant(field.Value),
                                    parameter))
                        }))),
            parameter);

    Expression<Func<MyClass, ExtendedMyClass>> selectExpression =
        x => new ExtendedMyClass
        {
            MyObject = x,
            ExtraFieldValues = extraFieldsExpression.Invoke(x)
        };

    return myQueryable.Select(selectExpression.Expand());
}


Q: I have problems with opening file in C I assume I have a compilation problem, but I want to make sure that is not my fault.
I have compared my code with some other from a program that I made couple of days ago, and I literally couldn't find any difference.
FILE *f;
f = fopen("gps.txt","r");

if (f == NULL){
    printf("Couldn't open the file.");
    return 0;
}
int i= 0;
int n;
while(fscanf(f,"%c %d %d %d %c %d %d %d %d %d %d",&gps[i].sirina,&gps[i].stepen,&gps[i].min,&gps[i].sek,&gps[i].duzina,&gps[i].s1,&gps[i].m1,&gps[i].sek1,&gps[i].visina,&gps[i].brzina,&gps[i].sateliti)==11)
    i++;

n = i;
printf("%d",gps[1].sek);

File informations:(25 55 22 N 123 213 123 S 25 23 2
123 123 123 N 234 25 53 S 123 5 1
12 41 3 N 12 5 13 S 1 2 4)
Result of this code is always 0 (this is just to check if I can continue doing my program). There are informations written in the file, I double checked that I saved it every time but still my program outputs 0. On the same code I wrote couple of days ago, outputs are okay, including the fact the file is same.
I would be happy to know is there is compiling problem or if there is a mistake in my code. Thanks!

A: according to your input the string in the fscanf is wrong.
you use the following string:
%c %d %d %d %c %d %d %d %d %d %d"

this is example of input line:
25 55 22 N 123 213 123 S 25 23 2
you need the following string:
%d %d %d %[^A-Z] %c %d %d %d %[^A-Z] %c %d %d %d

based on the given example, you read 25,55,22 using %d.
then and you skipping spaces etc using %[^A-Z], and then you read N or S using %c.
space is also a character, you need to pay attention to it.


Q: How can i make my own template/programming engine in php Ive been working some time on own template engines but i alwais get stuck in strucktured documents like
<block : block1>

        <block : row>

                    {value}

                    {value2}

        </block>

</block>

I can get "block 1" with a regex but it will break at the first  (the one of "row")
But i want a smarter way (and not by using a function like DOM)
i was thinking about something like
while($i < strlen($code)){
    if(substr($code,$i,1)){
        //tag is opened
    }
}

A: Basically, you're constructing a programming language here (albeit simple, it's still a programming language). To interpret a programming language you need a compiler, which usually contains a lexer (which splits input stream into meaningful tokens) and a parser (which reads tokens one by one and takes whatever actions are needed). In your simplified example, the lexer would be probably regexp-based, and the parser can be a simple stack-based one.
(terms in italic should actually be wikipedia links).

A: I am not entirely sure about what your question is, but there has been a lot of debating about templating languages in PHP but I think a
general consensus reached by now was that it usually doesn't make much sense to roll
your own templating language. You might get instant nice result by e.g. using string replacement
and regular expressions, but eventually you will need more functionality like loops
or other expressions and then it will become quite tricky (ultimately ending in creating your own compiler).
The best suggestion usually is to either use PHP as your templating language directly
(that is what PHP was designed for in the first place and with strictly following the MVC pattern quite a good solution, too) or try one
of the existing templating engines. Only if you can't make any of them
fit your needs (most of them are extensible through a plugin mechanism)
you should start making your own.


Q: Can fragments of a packet be refragmented again? In IPv4, fragmentation is done by routers on way to the destination if DF(do not fragment) flag is not set in the IP packet.
Once a packet is fragmented, its fragments may take different paths (due to various reasons like topology changes) to the destination.
If, on some link again in the path to destination, one routers find that the link MTU is smaller than the frame size, then either the packet needs to be fragmented or dropped.
Can fragments of a packet be refragmented again? If yes, what will be the value of MF flag in the new individual fragments created by this?

A: Yes, they can be refragmented. Every refragment but the last will have the MF flag set. The last fragment will have the same MF flag as the original fragment. So it's just as if they had originally been fragmented that way.


Q: Using the python multiprocessing module for IO with pygame on Mac OS 10.7 I use pygame for running experiments in cognitive science, and often I have heavy I/O demands so I like to fork off these tasks to separate processes (when using a multi-core machine) to improve performance of my code. However, I encountered a scenario where some code works on my colleague's linux machine (Ubuntu LTS), but not on my mac. Below is code representing a minimal reproducible example. My mac is a 2011 Macbook Air running 10.7.2 and using the default python 2.7.1. I tried both pygame as installed via pre-built binary, and I also then tried after installing both SDL and pygame from source.
import pygame
import multiprocessing
pygame.init()

def f():
    while True:
        pygame.event.pump() #if this is replaced by pass, this code works

p = multiprocessing.Process(target=f)
p.start()

while True:
    pass

As noted in the code, it seems that the culprit is putting pygame.event.pump() in a separate process. When I run this on my mac, I first get the following printed repeatedly in terminal:
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

Then I get a crash report as copied to this gist.
Any suggestions for how to fix this?

A: Maybe you should initialize the pygame (which initialize SDL-> OpenGL) in each forked (child) process like in sample:
import multiprocessing

def f():
  import pygame
  pygame.init()

  while True:
    pygame.event.pump()

if __module__ == "__main__"
  p = multiprocessing.Process(target=f)
  p.start()

  import pygame
  pygame.init()

  while True:
    pygame.event.pump()

A: Try this link:
http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency#btnPrevious
It may help. The problem is that you are creating a process that never stops. This should be declared as a daemon:
p = multiprocessing.Process(target=f)
p.daemon = True
p.start()

Not sure if this will solve the problem, I'm just learning about the multiprocessing module as I'm posting this.

A: Have you tried using threads instead of processes? I've had issues before using the python multiprocessing module in OS X. http://docs.python.org/library/threading.html


Q: How do I put a SQL Server database under version control using Visual Studio Community 2015 RC? I would like to put my database schema and its data in my git repository and have it version controlled, just like my code.
I have SQL Server 2008 R2 and Visual Studio Community 2015 RC. I know that Visual Studio 2010 upwards, Database project templates have been introduced to do just this. Please see this article for example. But I don't find those templates in my Visual Studio Community Edition 2015 RC installation.

A: Sticking to RC isn't very viable in the long term. Especially now, when Visual Studio 2015 RTM has been released.
Unless you have some really strong incentive to stay on Release Candidate, I would recommend to:

*

*Get RTM Express Edition for free, whichever suits you best. SSDT 2015 is compatible with Web and Windows Desktop;

*Get SSDT 2015 (again, for free) and install on top of that.

AFAIR, that should give you SQL Server database projects and everything else you might need. The only catch is that, as usual, it will be a somewhat longer route if you have ever had any CTP / RC versions installed on the same Windows instance before. Then again, it's nothing new.


Q: If $t = \tan (x/2)$, find expressions for $\sin x, \cos x$ in terms of $t$. Hence, solve the equation $3\sin x - 4\cos x = 2$.
If $$t = \tan \frac{x}{2},$$ find expressions for $\sin x, \cos x$ in terms of $t$. Hence, solve the equation $$3\sin x - 4\cos x = 2.$$

Attempt:
I have been solving a lot of trig questions lately but this is different. I don't know how to approach this. I'm thinking of getting $\sin x$ and $\cos x$ from $\tan x$ and replacing in the equation but not sure how because of the $t$. Help please.

A: Indicated Solution
We can derive the Weierstrass Substitution:
Using the tangent double angle formula:
$$
\tan(x)=\frac{2t}{1-t^2}\tag{1}
$$
Then writing $\sec^2(x)$ in terms of $\tan^2(x)$
$$
\begin{align}
\sec^2(x)
&=1+\tan^2(x)\\
&=1+\frac{4t^2}{1-2t^2+t^4}\\
&=\frac{1+2t^2+t^4}{1-2t^2+t^4}\\
&=\left(\frac{1+t^2}{1-t^2}\right)^2\tag{2}
\end{align}
$$
Therefore, checking sign of $\cos(x)$ vs $\tan(x/2)$:
$$
\cos(x)=\frac{1-t^2}{1+t^2}\tag{3}
$$
Multiplying $(1)$ and $(3)$ gives
$$
\sin(x)=\frac{2t}{1+t^2}\tag{4}
$$
Then, as mentioned in comments, we simply need to solve for $t=\tan(x/2)$:
$$
3\,\overbrace{\frac{2t}{1+t^2}}^{\sin(x)}-4\,\overbrace{\frac{1-t^2}{1+t^2}}^{\cos(x)}=2\tag{5}
$$
which is simply a quadratic equation in $t$ giving
$$
\tan(x/2)=t=\frac{-3\pm\sqrt{21}}2\tag{6}
$$

Alternate Solution
Suppose $\theta$ is an angle so that $\sin(\theta)=\frac45$ and $\cos(\theta)=\frac35$; that is, $\theta=\sin^{-1}\!\left(\frac45\right)$.
Then,
$$
\begin{align}
\sin(x-\theta)
&=\cos(\theta)\sin(x)-\sin(\theta)\cos(x)\\[3pt]
&=\frac35\sin(x)-\frac45\cos(x)\\
&=\frac25
\end{align}
$$
which gives the two solutions
$$
x=\sin^{-1}\!\left(\frac25\right)+\sin^{-1}\!\left(\frac45\right)
\implies\tan(x/2)=\frac{-3+\sqrt{21}}2
$$
and
$$
x=\pi-\sin^{-1}\!\left(\frac25\right)+\sin^{-1}\!\left(\frac45\right)
\implies\tan(x/2)=\frac{-3-\sqrt{21}}2
$$

A: Hint Rearranging gives (for $\frac{x}{2}$ in the image $\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$ of $\arctan$) that $$x = 2 \arctan t$$ (this is the celebrated if perhaps misnamed Weierstraß substitution, which has the convenient property of transforming rational functions in trigonometric functions of $x$ into rational functions in $t$, and which is particularly useful in computing antiderivatives of the former).
With this in hand, we can exploit the double-angle identity $\sin 2 u = 2 \sin u \cos u$ to write, e.g., $\sin x$ in terms of $t$:
$$\sin x = \sin 2 \arctan t = 2 \sin \arctan t \cos \arctan t .$$
Appealing to a reference triangle (appropriately labeling a right triangle with legs $t$ and $1$ and acute angle $x$, computing the length of the remaining side, and using the definition of the trigonometric functions) gives us (algebraic) simplifications:
$$\left\{
\begin{array}{rcl}
\sin \arctan t &=& \frac{t}{\sqrt{1 + t^2}} \\
\cos \arctan t &=& \frac{1}{\sqrt{1 + t^2}}\end{array}
\right.$$
Substituting gives
$$\sin x = 2 \left(\frac{t}{\sqrt{1 + t^2}}\right) \left(\frac{1}{\sqrt{1 + t^2}}\right) = \frac{2t}{1 + t^2}.$$
One can similarly derive a rational expression in $t$ for $\cos x$ and hence write the given equation in $x$ as a rational equation in $t$.
(NB as hinted above, this only detects the solutions with $\frac{x}{2}$ in an appropriate range. To find all of the solutions, one must use these in conjunction with the usual symmetries of the trigonometric functions themselves.)

A: I am posting only because I don't see the most obvious approach:
Since $t=\tan(x/2)=\frac{\sin(x/2)}{\cos(x/2)}$ and $\sin^2(x/2)+\cos^2(x/2)=1,$ solve for $\sin(x/2)=\frac{t}{\sqrt{1+t^2}}$ and $\cos(x/2)=\frac{1}{\sqrt{1+t^2}}$ (here I am assuming that $x/2\in [0,\pi/2)$-the other cases are similar).
Now you can use the formulas that give you the $\sin$ and $\cos$ of double angles, and you are done.

A: Hint: $\sin x=\frac{2\tan\frac{x}{2}}{1+\tan^2\frac{x}{2}}$,
$\cos x=\frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}$

A: If you know the bisection formulas
$$
\left|\sin\frac{x}{2}\right|=\sqrt{\frac{1-\cos x}{2}}
\qquad
\left|\cos\frac{x}{2}\right|=\sqrt{\frac{1+\cos x}{2}}
$$
you can put them together finding
\begin{align}
\left|\tan\frac{x}{2}\right|=\sqrt{\frac{1-\cos x}{1+\cos x}}
&=\sqrt{\frac{1-\cos x}{1+\cos x}\frac{1-\cos x}{1-\cos x}}\\[6px]
&=\sqrt{\frac{(1-\cos x)^2}{\sin^2x}}\\[6px]
&=\biggl|\frac{1-\cos x}{\sin x}\biggr|\\[6px]
&=\frac{1-\cos x}{|\sin x|}
\end{align}
It's easy to check that $\tan(x/2)$ has the same sign as $\sin x$ for every $x$ where $\sin x\ne0$ (and so $\tan(x/2)$ is defined), which allows us to remove the absolute values:
$$
\tan\frac{x}{2}=\frac{1-\cos x}{\sin x}
$$
We can do similarly by using $1+\cos x$ in the second step instead of $1-\cos x$, which gives another neat formula:
$$
\tan\frac{x}{2}=\frac{\sin x}{1+\cos x}
$$
Setting, for simplicity, $t=\tan(x/2)$, $X=\cos x$ and $Y=\sin x$, we can rewrite the equations as
$$
\begin{cases}
X+tY=1\\[6px]
tX-Y=-1
\end{cases}
$$
If we solve this for $X$ and $Y$, we arrive at
$$
X=\cos x=\frac{1-t^2}{1+t^2},\qquad
Y=\sin x=\frac{2t}{1+t^2}
$$

If you apply these to your equation, you get
$$
\frac{6t}{1+t^2}-\frac{4-4t^2}{1+t^2}=2
$$
that becomes a quadratic by removing the denominators:
$$
6t-4+4t^2=2+2t^2
$$
or, simplifying,
$$
t^2+3t-3=0
$$
Note there's a small issue: you have to verify that the values of $x$ for which $\tan(x/2)$ is not defined are or are not solutions of the equations. The check is easily done: $\tan(x/2)$ is not defined for $x=k\pi$, but
$$
3\sin(k\pi)-4\cos(k\pi)=\pm4\ne2
$$
If the equation is $3\sin x-4\cos x=4$, you get a family of solutions not covered by the $t$-substitution.


Q: JavaScript Collections API? I've searched quite a while for a Collections API (list, set) for JS and surprisingly I could only this: http://www.coffeeblack.org/work/jscollections/
This is exactly what I was looking for, but I'm wondering why doesn't jQuery provide that? What am I missing on? Or, perhaps, how ineffective are my searching techniques?
I know that arrays support pop() and push(), but I need contains() for example.

A: You can try js_cols, a collections library for JavaScript.

A: Can't you use the jquery collection plugin.
http://plugins.jquery.com/project/Collection

A: jQuery's primary focus is the DOM. It doesn't and shouldn't try and be all things to all people, so it doesn't have much in the way of collections support.
For maps and sets, I'd like to shamelessly point you in the direction of my own implementations of these: http://code.google.com/p/jshashtable/
Regarding lists, Array provides much of what you need. Like most methods you might want for arrays, you can knock together a contains() method in a few lines (most of which are to deal with IE <= 8's lack of support for the indexOf() method):
Array.prototype.contains = Array.prototype.indexOf ?
    function(val) {
        return this.indexOf(val) > -1;
    } :
    function(val) {
        var i = this.length;
        while (i--) {
            if (this[i] === val) {
                return true;
            }
        }
        return false;
    };

["a", "b", "c"].contains("a"); // true

A: You can also try buckets, it has the most used collections.

A: Since javascript have both arrays [] and associative arrays {}, most needs for datstructures are already solved. The array solves the ordered list, fast access by numeric index whilst the associative array can be considered a unordered hashmap and solves the fast access by string keys.
For me that covers 95% of my data structure needs.

A: If you get some free time you can checkout.
https://github.com/somnathpanja/jscollection


Q: Font Awesome rendering wrong icons after updating lib to 6.1.1 We wanted to update all our used libs in our Node.js/Nuxt/Vue application.
And so we arrived at Font Awesome.
Before the update we used:
"@fortawesome/fontawesome-svg-core": "1.2.30",
"@fortawesome/free-brands-svg-icons": "5.14.0",
"@fortawesome/pro-regular-svg-icons": "5.14.0",

And we updated them to:
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-brands-svg-icons": "^6.1.1",
"@fortawesome/pro-regular-svg-icons": "^6.1.1",

I include here a screenshot of the before and after result of our left menu.

The encircled items should have unique icons like the left version.
However in some occasions it renders wrong icons, it looks likes it takes the icon from the item above.
In developer tools the HTML for one menu item with a wrong icon looks like the following:

You see the correct class in the icon element but the svg element somehow gets the class from the menu item above it. It should use the fa-cogs and not the fa-chart-line.
I want to point out that we did not change anything code wise.
Did anyone encounter something similar after updating the font awesome libs?
Or knows a solution to this problem?


Q: plupload submits OPTIONS instead of POST to a WebAPI Have an MVC application and a separate WebAPI.  Using plupload, when the url points to a method in the MVC controller, the files are POSTed.
Here's what Fiddler shows
POST /Home/HandleUpload/ HTTP/1.1
Host: localhost:50000
Connection: keep-alive
Content-Length: 38040
Origin: http://localhost:50000
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryT4glpqFi5sbmY2KL
Accept: */*
Referer: http://localhost:50000/Home/Index
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

When I change the url to point to the WebAPI, I get OPTIONS request instead of a POST, so the API method doesn't get hit.
OPTIONS /api/v1/Files/HandleUpload HTTP/1.1
Host: localhost:60000
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: http://localhost:50000
Access-Control-Request-Headers: content-type
Accept: */*
Referer: http://localhost:50000/Home/Index
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

The only thing I change on the plupload configuration is the url.
Here's my method.  It's the same in both projects.
[HttpPost]
public HttpResponseMessage HandleUpload(int? chunk, string name)
{
    var fileUpload = HttpContext.Current.Request.Files[0];
    var uploadPath = HttpContext.Current.Server.MapPath("~/App_Data");
    chunk = chunk ?? 0;

    //write chunk to disk.
    string uploadedFilePath = Path.Combine(uploadPath, name);
    using (var fs = new FileStream(uploadedFilePath, chunk == 0 ? FileMode.Create : FileMode.Append))
    {
        var buffer = new byte[fileUpload.InputStream.Length];
        fileUpload.InputStream.Read(buffer, 0, buffer.Length);
        fs.Write(buffer, 0, buffer.Length);
    }
}

A: I was able to do this but not sure if this is the best practice. filename is set in UI in the preinit function
preinit: {
                            UploadFile: function (up, file) {

                                // You can override settings before the file is uploaded
                                // up.settings.url = 'upload.php?id=' + file.id;
                                //up.settings.multipart_params = { type: $("#Type").val(), title: $("#Title").val() };
                                up.settings.multipart_params = {
                                    filename: file.name
                                };

                            }
                        },

Web api code
[HttpPost]
            public async Task<IHttpActionResult> UploadPropertyImage()
            {
                if (!Request.Content.IsMimeMultipartContent())
                    throw new Exception(); // divided by zero

                var provider = new MultipartMemoryStreamProvider();
                await Request.Content.ReadAsMultipartAsync(provider);

                var name = await provider.Contents.SingleOrDefault(p => p.Headers.ContentDisposition.Name == "\"name\"").ReadAsStringAsync();
                var chunk = await provider.Contents.SingleOrDefault(p => p.Headers.ContentDisposition.Name == "\"chunk\"").ReadAsStringAsync();
                var chunks = await provider.Contents.First(p => p.Headers.ContentDisposition.Name == "\"chunks\"").ReadAsStringAsync();
                var filename = await provider.Contents.First(p => p.Headers.ContentDisposition.Name == "\"filename\"").ReadAsStringAsync();
                var buffer = await provider.Contents.First(p => p.Headers.ContentDisposition.Name == "\"file\"").ReadAsByteArrayAsync();
                //var Id = await provider.Contents.First(p => p.Headers.ContentDisposition.Name == "\"Id\"").ReadAsByteArrayAsync();
                var Id = Guid.Empty;

                var uploadPath =  HostingEnvironment.MapPath(Path.Combine("~/app_data",Id.ToString()));

                if (!Directory.Exists(uploadPath))
                    Directory.CreateDirectory(uploadPath);

                using (var fs = new FileStream(Path.Combine(uploadPath,name), chunk == "0" ? FileMode.Create : FileMode.Append))
                      fs.Write(buffer, 0, buffer.Length);

                return Ok();
            }


Q: PHP sql database, inserting UNIQUE values Im working with sql database (phpMyadmin) and with programming language PHP.
I've got a table with data e.g:
T1:
145
138.8
110.6
1759.4
1400.9
1891.4
1755.4
1760.4
T2:
141.9
110.6
1400.9
1891.4
1758.4
My question >
Is there existing sql syntax, that is able to average values which are lying in ONE THRESHOLD (like > 1755.4,1760.4,1759.4 OR 145,138.8) and INSERT THEM  AS UNIQUE VALUES to another table ?
What I need is create T2(contain UNIQUE values) from T1, and INSERTING them only if they didn't exist in T2.
I was trying, to looping throw 2 arrays (1starray = T1 and 2ndarray = T2 ) too. And compare data in array1 and array2, and trying to insert values which can be unique.
for($z = 0; $z<$numberApp; $z++) {
while($j<$numberAbs-1){
     $Abs=$arrayabs[$j];
     $state_change = (abs($Abs - abs($previous_Abs)));
      if ($state_change>100){
        $instantChange = True;
        echo "
"." better than tolerance: " . $instantChange;
             }
     else  {
      $instantChange = False;
       echo "
"." lower than tolerance" . $instantChange;
     }

     //if($state_change = (abs($some_item - $previous_item)<= $tolerance)){
     if($Abs != $previous_Abs){
      echo "
" ."   some_item : "  .$Abs."   previous_item : "  .$previous_Abs;
     }

     //$lastAbs=$arrayabs[$j];
     //echo "  next_item : " .$lastAbs;

      if ($instantChange == True and $onChange == False){
      $Abs2 [] = $podiel;
      $finalPower = $podiel;
      }
     if ($instantChange){
        $D=0;
        echo "ABSOLUT >>> " .$lastAbs;
 $percentual1 = ($power_app[$z] * 0.9);
  $percentual2 = ($power_app[$z] * 1.1);

 if(($lastAbs<$percentual1 || $lastAbs>$percentual2)){
     $user = 'root';
      $pass = 'password';
      $db = 'vypis';
      //if($N>0){
$db = new mysqli('localhost', $user, $pass, $db) or die();
      $sql = "INSERT INTO vypis.nilm_app2(power) VALUES ('$lastAbs')";

       if(mysqli_query($db, $sql)){

    echo "Records added successfully.";

} else{

    echo "ERROR: Could not able to execute $sql. " . mysqli_error($db);

}
}
//$power_app[$z++];
      }

Thank you for everyone, who going to help, and sorry for my bad english.

A: The math here sounds complex enough that you're probably better off doing the complex stuff (averaging the values and determining whether a value is unique) in PHP, then finishing off with a couple simple MySQL statements.
This can probably be done in pure MySQL with a bit of trickery, but frequently it isn't worth the time and complexity it creates. (Imagine you'll have to debug that monster SQL query six months from now!)
By contrast, it's trivial to take a handful of values in PHP and average them; it's also trivial to run a quick MySQL query to determine whether a value is unique. So if you're unsure how to mash these together into one big SQL statement, start out by just handling them in the PHP code as separate steps! Then later on, if performance issues come up, you can think about how to combine them (but at least by that point you already have something that works).


Q: Is there a way to reverse the bit order in UInt64? I am building a chess engine in Swift based off a tutorial written in Java. In the tutorial, Java's signed 64 bit integer long has a static method called reverse(long i) that "Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified long value." It basically reverses the order of the binary bits so that, using 8-bit for simplicity's sake, 01000000 would become 00000010.
I am curious if there is a way to accomplish the same thing with Swift's UInt64. I understand that Java's long (signed, 2s complement) and Swift's UInt64 (unsigned) are different, but I imagine it wouldn't be hard to do this with UInt64.
I tried UInt64.byteSwapped, but this doesn't seem to be getting me the behavior I expect.

A: No, the Swift standard libraries do not provide a method to reverse the order of bits in an integer, see for example the discussion Bit reversal in the Swift forum.
One can use the C methods from Bit Twiddling Hacks, either by importing C code to Swift, or by translating it to Swift.
As an example, I have taken the loop-based variant
unsigned int s = sizeof(v) * CHAR_BIT; // bit size; must be power of 2
unsigned int mask = ~0;
while ((s >>= 1) > 0)
{
  mask ^= (mask << s);
  v = ((v >> s) & mask) | ((v << s) & ~mask);
}

because that is not restricted to a certain integer size. It can be translated to Swift as an extension to FixedWidthInteger so that it works with integers of all sizes:
extension FixedWidthInteger {
    var bitSwapped: Self {
        var v = self
        var s = Self(v.bitWidth)
        precondition(s.nonzeroBitCount == 1, "Bit width must be a power of two")
        var mask = ~Self(0)
        repeat  {
            s = s >> 1
            mask ^= mask << s
            v = ((v >> s) & mask) | ((v << s) & ~mask)
        } while s > 1
        return v
    }
}

Examples:
print(String(UInt64(1).bitSwapped, radix: 16))
// 8000000000000000
print(String(UInt64(0x8070605004030201).bitSwapped, radix: 16))
// 8040c0200a060e01
print(String(UInt16(0x1234).bitSwapped, radix: 16))
// 2c48

Another option would be to use byteSwapped to reverse the order of bytes first, and then reverse the order of the bits in each byte with a (precomputed) lookup table:
fileprivate let bitReverseTable256: [UInt8] = [
    0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,
    8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,
    4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244,
    12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,
    2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,
    10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250,
    6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246,
    14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254,
    1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241,
    9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249,
    5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245,
    13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253,
    3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243,
    11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251,
    7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247,
    15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255]

extension FixedWidthInteger {
    var bitSwapped: Self {
        var value = self.byteSwapped
        withUnsafeMutableBytes(of: &value) {
            let bytes = $0.bindMemory(to: UInt8.self)
            for i in 0..<bytes.count {
                bytes[i] = bitReverseTable256[Int(bytes[i])]
            }
        }
        return value
    }
}


Q: private data member in C++ OOP I am new to OOP in C++. I got a doubt. I know it may be a silly doubt.
In the code below in main function, commented line will give error as I can not access private data memebers directly. but in the member function complex add(complex &C) I created a object temp of class complex. How can I access the data member of object temp directly and modify them as those are private. Like in the main function, should it not throw error? Is there any rule that in the member function of class we can access private data of a object of same class directly.
using namespace std;

class complex{
  private:
  int real;
  int img;

  public:
  complex(int r = 0, int i = 0);
  complex add(complex &C);
};

complex :: complex(int r, int i){
  real = r;
  img = i;
}

complex complex :: add(complex &C){
  complex temp;
  temp.real = real + C.real;
  temp.img = img + C.img;
  return temp;
}

int main() {

  complex c1(3,4);
  complex c2(5,7);
  complex c3;
  // c3.real = 3;
  // c3.img = 5;
  c3 = c1.add(c2);

  return 0;
}

A: I try and stick to rule, keep your member variables private, if you need to change them or access them once the object is created, use a public get / set function.
e.g:
int complex::GetReal() const { return m_real; }

void complex::SetReal(const int i) { m_real = i; }


Q: Distance, time and speed Train $A$ leaves from station P to station Q, and at the same time train $B$ starts from station Q to station P on a parallel track. After meeting at point R, train $A$ takes $4$ hours and train $B$ takes $2$ hours to reach their respective destinations. Approximately, by what % is speed of train $B$ more than that of train $A$?

A: Assuming constant speed :
P --------- R --------------------------- Q
A -------->  <--------------------------- B
$v_a = RQ / 4$ (in km per hour for example)
$v_b = PR / 2$
But you also have that they covered the other distance in the same amount of time $\tau$ :
$v_a = PR / \tau$
$v_a = RQ / \tau$
Now if you divide $v_a$ with $v_b$ on the 2 different cases :
$v_a/v_b = PR / RQ$
$v_a/v_b = RQ / 2 PR$
This means $RQ^2 = 2 PR^2$. If you take the square root, you have that :
$$v_a/v_b = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2}$$
As for the correct answer in approximated %, you have :
$v_b = \sqrt{2} v_a$
Therefore, the train B goes approximately 41% faster than the train A (1.41 = 100% + 41%)


Q: Prove that G is an abelian group given $a^2b=b=ba^2$ Let G be a semigroup such that $\forall a,b \in$ G, $a^2b=b=ba^2$.  Prove that G is an abelian group.
My attempt at the problem.
Fix $a_0 \in G$, then for all $b \in G$, $a_0^2b=ba_0^2=b$.  We let $e =a_0^2$  (that is $\forall b \in G$, $eb=be=b$)
Now let $a \in G$, then $a^2e=e$, but we also have from above that $a^2e=a^2$.   Therefore $a^2=e$ for all $a \in G$.  Thus $e$ is the identity element of G.  Furthermore for any $a \in G$, we have $a^{-1}=a$ since $a^2=e$.  Hence G is a group.  To see that G is abelian, let $a,b \in G$.  Consider the following:
$ab =(ba)^2(ab)=(ba)(ba)(ab)=(ba)ba^2b=(ba)beb=(ba)b^2=(ba)e=ba$
Hence G is an abelian group.
Is this okay?  Thank you in advance.


Q: Diablo 3 Monster Curses
Possible Duplicate:
What are the special abilities the unique/champion monsters can have?

I have a Wizard, Witch Doctor and Demon Hunter, all of which are very early in Act I. Sometimes a small skull appears above my character. At other times (only with Odeg the Keywarden in the Fields of Misery?) my character is trapped inside a red column for a few seconds, or moves very slowly while a misty smoke moves around my feet. Are these curses from a monster? I've searched for a list or details of these, but I have not been able to find anything.

A: Sounds like you are being feared or snared by a Rare or Champion class enemy.
You can read on all the possible modifiers that these Rare/Champion enemies can have.
In your case you may have been fighting an enemy with the Jailer, Nightmarish, or Plagued modifiers.
Jailers would give you that red column around your character which will stop you from moving and attacking.
Nightmarish foes would make the skull appear above your character. When they 'fear' you, you lose control of your character and the skull appears signalling that you have been feared.
Plagued enemies seem to be closest to the 'mist' you describe so this may or not be it. The plague from these enemies is green and very noticeable. You should be able to tell if this is what you are talking about or not when this happens again.


Q: Why docker run can't find file which was copied during build Dockerfile
FROM centos

RUN mkdir /test

#its ensured that sample.sh exists where the dockerFile exists & being run

COPY ./sample.sh /test

CMD ["sh", "/test/sample.sh"]

Docker run cmd:
docker run -d -p 8081:8080 --name Test -v /home/Docker/Container_File_System:/test test:v1
Log output :
sh: /test/sample.sh: No such file or directory

There are 2 problems here.

*

*The output says sh: /test/sample.sh: No such file or directory

*as I have mapped a host folder to container folder, I was expecting the test folder & the sample.sh to be available at /home/Docker/Container_File_System post run, which did not happen

Any help is appreciated.

A: When you map a folder from the host to the container, the host files become available in the container. This means that if your host has file a.txt and the container has b.txt, when you run the container the file a.txt becomes available in the container and the file b.txt is no longer visible or accessible.
Additionally file b.txt is not available in the host at anytime.
In your case, since your host does not have sample.sh, the moment you mount the directory, sample.sh is no longer available in the container (which causes the error).
What you want to do is copy the sample.sh file to the correct directory in the host and then start the container.

A: The problem is in volume mapping. If I create a volume and map it subsequently it works fine, but directly mapping host folder to container folder does not work.
Below worked fine
docker volume create my-vol

docker run -d -p 8081:8080 --name Test -v my-vol:/test test:v1


Q: area under a curve and units If we introduce a unit of length like meter for $x$ and integrate the function $f(x)=x^2$ from $0$ to $2m$ we get $\dfrac{8}{3} m^3$. How can this be interpreted geometrically?
My initial thought was that $x^2$ gives the area of a square with edge length $x$, so maybe the area under the curve gives the volume of a cube with a base area equal to this square. But this is off by a factor of $\dfrac{1}{3}$.

A: When you do the integral you are doing $\int y \ dx$, so the units of $y$ should be meters as well.  One way to think of it is that $f(x)=ax^2$, where $a$ has units of $m^{-1}$.  This makes $f(x)$ have units of $m$ as it should.  It just turns out that when measuring in meters the numerical value of $a$ is $1$.  If you change to measuring in $cm$, you now have $\int_0^{200} \frac 1{100}x^2\ dx=\left. \frac 1{300}x^3\right|_0^{200}=\frac 83\cdot 10,000\  cm^2$ as it should.  As you can see, you need to update the value of $a$ because it is carrying a unit as well.

A: It all depends on your interpretation (setup).
If your goal is to compute the $2$-dimensional area under the curve $y = x^2$ then $y$ must also have the unit of metre ($m$), which gives an area in terms of square-metre ($m^2$), as you would expect.
If, however, you are aiming for a "natural" 3-dimensional geometric interpretation, then you can think of it like so: The $y$-value gives the enclosed area of a square of side $x$. So the integral you computed actually gives you the enclosed volume of a square pyramid. If you take cross-sections across such a shape, you will get squares of different sides ($x$) and different enclosed areas $(y = x^2)$. Naturally, the calculated volume will have units of cubic-metre $(m^3)$. If you start the $x$ value off at something other than zero, you will be computing the volume of a square-pyramidal frustum (truncated square pyramid).


Q: Prevent second half of an if statement when first half is null I have a statement in VB.net that I thought I wrote correctly to prevent the second half from being evaluated. It looks like this:

If ((myDataSet2 IsNot Nothing) Or myDataSet2.Tables("CurData").Rows.Count > 0)

However it does not skip the second expresion "myDataSet2.Tables("CurData").Rows.Count > 0" like I want it to.
What should I change?

A: Use the OrElse operator.
If myDataSet2 IsNot Nothing OrElse myDataSet2.Tables("CurData").Rows.Count > 0

EDIT:  See my comment on your original question.  You are PROBABLY looking for:
If myDataSet2 IsNot Nothing AndAlso myDataSet2.Tables("CurData").Rows.Count > 0

That will check if myDataSet2 isn't null.  Assuming that it's not, it will then check that there is at least one row.  If it is null, then the second condition won't be checked.

A: You need to put the second statement into the first if-clause.
Like this:
If(statement1) then
   If(statemtent2) then
   Else
   End if
Else
End If

As it is now both are evaluated and if one of them is true the content in your if-clause will be executed.


Q: Find a nonnegative vector orthogonal to a set of vectors I am trying to solve this problem:

Given a set of $m$ vectors in $\mathbb{R}^n$, where $m < n$, $$(a_i)_{1 \le i \le m}$$ for a fixed index $j$ can we compute a vector $u$ in polynomial time such that $u^Ta_i = 0$, $u \ge 0$ and $u_j = 1$?

I know that we can solve this problem with linear programming but to have an exact solution with polynomial time I don't know how.
It will be also good if I can model the problem with a graph problem.
Can any one help me ?


Q: Jenkins Pipeline as Code Groovy Error on Class Annotation Hi I am trying to use Jenkins pipeline as code (formally workflow). I am getting errors whenever I try to use Annotations on a class defined in the pipeline script.
Error
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during canonicalization: Unexpected variable type: null

java.lang.UnsupportedOperationException: Unexpected variable type: null

JenkinsFile
import groovy.transform.ToString;
import groovy.transform.EqualsAndHashCode;
@EqualsAndHashCode
@ToString
class BarDeploy {
    String barFile
    String app
    String integrationServer
}

Any ideas why I cannot do this?
Full Stack Trace
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during canonicalization: Unexpected variable type: null

java.lang.UnsupportedOperationException: Unexpected variable type: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
    at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
    at com.cloudbees.groovy.cps.CpsTransformer.visitVariableExpression(CpsTransformer.groovy:723)
    at org.codehaus.groovy.ast.expr.VariableExpression.visit(VariableExpression.java:70)
    at org.codehaus.groovy.ast.expr.VariableExpression$visit.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.ast.expr.BinaryExpression$visit.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:234)
    at sun.reflect.GeneratedMethodAccessor546.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBinaryExpression_closure25.doCall(CpsTransformer.groovy:553)
    at sun.reflect.GeneratedMethodAccessor569.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBinaryExpression_closure25.doCall(CpsTransformer.groovy)
    at sun.reflect.GeneratedMethodAccessor568.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.groovy:278)
    at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.groovy:253)
    at sun.reflect.GeneratedMethodAccessor544.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.cloudbees.groovy.cps.CpsTransformer.visitBinaryExpression(CpsTransformer.groovy:559)
    at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
    at org.codehaus.groovy.ast.expr.BinaryExpression$visit.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement$visit.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:234)
    at sun.reflect.GeneratedMethodAccessor546.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.visitExpressionStatement(CpsTransformer.groovy:395)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement$visit.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.ast.expr.StaticMethodCallExpression$visit.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:234)
    at sun.reflect.GeneratedMethodAccessor546.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:240)
    at sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBlockStatement_closure8.doCall(CpsTransformer.groovy:342)
    at sun.reflect.GeneratedMethodAccessor580.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBlockStatement_closure8.doCall(CpsTransformer.groovy)
    at sun.reflect.GeneratedMethodAccessor579.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.groovy:278)
    at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.groovy:253)
    at sun.reflect.GeneratedMethodAccessor544.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.cloudbees.groovy.cps.CpsTransformer.visitBlockStatement(CpsTransformer.groovy:341)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
    at org.codehaus.groovy.ast.stmt.BlockStatement$visit.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.ast.expr.VariableExpression$visit.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:234)
    at sun.reflect.GeneratedMethodAccessor546.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.visit(CpsTransformer.groovy:240)
    at sun.reflect.GeneratedMethodAccessor552.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBlockStatement_closure8.doCall(CpsTransformer.groovy:342)
    at sun.reflect.GeneratedMethodAccessor580.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_visitBlockStatement_closure8.doCall(CpsTransformer.groovy)
    at sun.reflect.GeneratedMethodAccessor579.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:54)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
    at com.cloudbees.groovy.cps.CpsTransformer.makeChildren(CpsTransformer.groovy:278)
    at sun.reflect.GeneratedMethodAccessor545.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:57)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer.makeNode(CpsTransformer.groovy:253)
    at sun.reflect.GeneratedMethodAccessor544.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
    at com.cloudbees.groovy.cps.CpsTransformer.visitBlockStatement(CpsTransformer.groovy:341)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
    at org.codehaus.groovy.ast.stmt.BlockStatement$visit.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsTransformer.visitMethod(CpsTransformer.groovy:166)
    at sun.reflect.GeneratedMethodAccessor606.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at com.cloudbees.groovy.cps.CpsTransformer$_call_closure1.doCall(CpsTransformer.groovy:95)
    at sun.reflect.GeneratedMethodAccessor605.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
    at groovy.lang.Closure.call(Closure.java:415)
    at groovy.lang.Closure.call(Closure.java:428)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1379)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1351)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods$each.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.DefaultGroovyMethods$each.call(Unknown Source)
    at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods.groovy:26)
    at sun.reflect.GeneratedMethodAccessor582.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)
    at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)
    at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:82)
    at com.cloudbees.groovy.cps.CpsTransformer.call(CpsTransformer.groovy:95)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:970)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:106)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:376)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:343)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:212)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:997)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
    at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:106)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:376)
    at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:343)
    at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:212)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE

A: This issue is known about, and still open, in Jenkins.  See https://issues.jenkins-ci.org/browse/JENKINS-40564