text:
Q: Not able to distinguish between hidden cells and others. Using POI 3.8 and xls/xlsx format Not able to distinguish between hidden cells and others. Using POI 3.8 and xls/xlsx format. baseRow.getZeroHeight(), baseCell.getCellStyle().getHidden(), baseSheetX.getColumnStyle(14).getHidden() all return false though entire column is hidden. Please guide.

A: If the entire column is hidden, Excel will just mark the column itself as hidden on the sheet.  It won't go through that particular column index in all rows and change the cell styling just to make all the cells hidden, and it won't go through the column cell style either.
Try the method Sheet#isColumnHidden(int).

Get the hidden state for a given column


text:
Q: Cannot run active file in visual studio when connected to linux server I'm currently on the steep part of the learning curve with a Linux server and running into a very frustrating issue.
Initially, I was running python scripts from the root user, then I learned that this was bad and created a new user and am working on migrating everything over to this new user. For some reason, when I set up the new user in exactly the same way that I set up the root I can no longer run the active file. From the root user, I can either click 'run active file' or the small play button in the top right corner but that disappears when I log in as the new user.
I receive the error message '''only files on disk can be run in the terminal'''
Any ideas on where I'm going wrong? Like I said still learning this stuff so if any more detail is needed please let me know.
Thanks!!

A: Well this was dumb, the Python extension was installed when running the root but had to separately install the extension for the additional user. Fixed the issue.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to change the StatusBar color of the splash screen? I'm using React Native for building my android application and I've followed this tutorial to set up my splash screen. Here is the result. My main problem is that the status bar color changes to black, I can't solve this by having <item name="colorPrimaryDark">@color/colorPrimaryDark</item> in my styles.xml file, and <color name="blue">#009CD7</color>, <color name="colorPrimaryDark">#009CD7</color> in my colors.xml file.
Bonus question: how to center the image without hardcoding a margin so that it stays in the center regardless of the device the app is running on?

A: If you see an error something like that -> "int can not be boolean"
Just add third parameter to MainActivity.java
SplashScreen.show(this, R.style.SplashTheme, true);

A: Add colorPrimaryDark one more item in your current splash theme or create a new one.
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:statusBarColor">@android:color/white</item>
    <item name="android:windowLightStatusBar">true</item>
    <item name="android:background">@drawable/background_splash</item>
    <item name="colorPrimaryDark">@android:color/white</item>
</style>

Then use it as a second parameter while showing SplashScreen.
public class MainActivity extends ReactActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        SplashScreen.show(this, R.style.SplashTheme, true);
        super.onCreate(savedInstanceState);
    }
}

A: Create a style definition for this in android/app/src/main/res/values/styles.xml:
<?xml version="1.0" encoding="utf-8"?>
    <resources>
         <style name="SplashTheme" parent="SplashScreen_SplashTheme">
             <item name="colorPrimaryDark">your_color</item>
         </style>
   </resources>

now you have change show method to include your custom style:
SplashScreen.show(this, R.style.SplashTheme);

you are donw now :)

A: If you wanna change the TaskBar color, just add the activity and the color that you desire in the output function.
fun setTaskBarColored(colored: Int,activity: Activity) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            activity.window!!.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
            activity.window!!.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
            activity.window!!.statusBarColor = ContextCompat.getColor(activity, colored)
        }
    }

And also the same applies for the NavigationBar
    fun setNavigationBarColored(colored: Int, activity: Activity){
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            activity.window!!.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
            activity.window!!.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
            activity.window!!.navigationBarColor =  ContextCompat.getColor(activity, colored)
        }
    }

A: You can simply add this JSX code to the root of your app instead of editing any native files.
<StatusBar backgroundColor="blue" barStyle="light-content" />

Also in order to center your image, wrap it with a view and add the styling "{justifyContent: 'center', alignItems: 'center'}".  If that doesn't work then add this style directly to your image component "alignSelf: 'center'"


text:
Q: Magento backend submit order is not working when merge javascript is yes Magento backend submit order functionality is not working when merge javascript script file is yes. If I disable submit order functionality it is working. I use magento CE 1.7

A: When you merge javascript then some thimes this problem caused. so instead of merge javascript you can use minify javascript or css.


text:
Q: Why allow only one singularity at $z =0$ when defining the local conformal algebra in 2D? The reference I'm using for this question is the review "Applied CFT" by Paul Ginsparg. In section 1.2 (Conformal algebra in 2 dimensions) he argues that if the metric is the Euclidean one $g_{\mu\nu}=\delta_{\mu\nu}$, then the equations for one infinitesimal conformal diffeomorphism read $$\partial_1\epsilon_1=\partial_2\epsilon_2,\quad\partial_1\epsilon_2=-\partial_2\epsilon_1.$$
He then remarks that these are just the Cauchy-Riemann equations and hence we might as well introduce holomorphic coordinates $(z,\bar{z})$ defined by $z = x^1+ix^2$ and $\bar{z}=x^1-ix^2$ and exchange $\epsilon^1,\epsilon^2$ by $\epsilon(z)$ and $\bar{\epsilon}(\bar{z})$ defined to be $$\epsilon(z)=\epsilon^1+i\epsilon^2,\quad \bar{\epsilon}(\bar{z})=\epsilon^1-i\epsilon ^2.$$
He briefly mentions that two-dimensional conformal transformations are then analytic transformations $$z\mapsto f(z),\quad \bar{z}\mapsto \bar{f}(\bar{z})\tag{1.5}.$$
He then says:

To calculate the commutation relations of the generators of the conformal algebra, i.e. infinitesimal conformal transformations of the form (1.5), we take for basis $$z\mapsto z'=z+\epsilon_n(z),\quad \bar{z}\mapsto \bar{z}'=\bar{z}+\bar{\epsilon}_n(\bar{z}),\quad n\in \mathbb{Z},$$ where $$\epsilon_n(z)=-z^{n+1},\quad \bar{\epsilon}_n(\bar{z})=-\bar{z}^{n+1}\tag{1.7}$$

I understand that the globally defined conformal transformations coincide with the globally defined analytic functions. So it seems we would like to look at the locally defined $f : U\subset \mathbb{C}\to V\subset \mathbb{C}$ (strictly speaking these ones do not form a group but that's not the point of this question).
Now such $f$ is locally defined for either one of two reasons: or because it is a restriction of a globally defined conformal map, or because it can't be further extended. The first situation gives nothing new, the second one does.
So in my understanding, if $f$ cannot be further extended is because it has a singularity somewhere.
It seems to me that Eq. (1.7) allows for the most general generator which has exactly one singularity at $z =0$.
Why one  makes this choice? I mean if we are looking at the whole algebra of generators of conformal transformations which can't be globally defined why not allow for singularities of various points $S\subset \mathbb{C}$ only subject to the restriction that $S$ be closed? This seems to be the most general thing that can't be globally defined.
Why take the local conformal algebra as simply the generators which are singular only at zero and analytic everywhere else?

A: Your claim that (1.7) only considers infinitesimal conformal transformations with singularity at zero is simply wrong:
The most general generator that you get from (1.7) is a linear combination of all the basic generators there, i.e. a Laurent series $\sum a_n z^n$. While the center of a Laurent series may be its only singularity, it need not be - it has an inner and outer convergence radius on which some divergences lie, and that's it.
So this treatment of local infinitesimal conformal transformations does allow for singularities other than at zero.


text:
Q: Seperate Object over multiple models or encode in JSON? sorry if the question sounds so weird, but I don' really know how else to put it.
Essentially, my application will a bunch of objects. Each objects has somekind of post/comment structure, the unique thing though is, that it is more or less static, so i figure out it would make no sense to put in every single post and comment into my database, because that would cause more database load? Instead of this, I was thinking about putting the JSON representation of the post with its comments, thus only causing one database access per object. I would then render the JSON object in the controller or view or something. Is this a valid solution?

A: No!
You loose all ability to query that data at no benefit unless you are at massive scale. The database's job is to pull that stuff out for you efficiently, and if you create the proper indexes and implement the proper caching strategies, you shouldn't have any issues with database load. You want to replace all the goodness of the Rails ORM with your own decidedly less useful version in the interest of a speed gain, waaay before you need it.
What if later you want to do a most popular comments sidebar widget? Or you want to page through the comments, regardless of the post they are associated with, in a table for moderation? What if you want your data to be searchable?
Don't sacrifice your ability to easily query and manipulate the data for premature optimization.

A: Though it sounds a good idea but I don't think that it will work in the long run thinking of what is going to happen when you have many comments on your posts. You will have to get the long string from the database and then add the new comment to it and then update it in the data. This will be very inefficient compared to just inserting one more comment in the table.
Also, just think what is going to happen, if at some point, you will have to give user the option to update the comment. Getting the particular comment from that long string and then update it will be a nightmare, don't you think?

A: In general you want to use JSON and the like as a bit of a last resort.  Storing JSON in the db makes sense if your information isn't necessarily known ahead of time.  It is not a substitute for proper data modelling and is not a win performance-wise.
To give you an idea where I am looking at using it in a project, in LedgerSMB we want to be able to have consultants track additional information on some db objects.  Because we don't know what it will be in advance JSON makes a lot of sense.  We don't expect to be searching on the data or support searches on the data but if we did that could be arranged using plv8js.


text:
Q: SFSC Web To Lead - create campaignmember and pass custom fields
We have a web-to-lead form that creates leads in SFSC and adds them to a campaign with status:
input name="Campaign_ID" value="xxxIDxxx" type="hidden"
input name="member_status" value="Opt-In" type="hidden"
We also have a custom text-field called Opt_In__c in the campaignmember object.
Is there a way to pass a value for this field directly in the web-to-lead form?
Sth. like
input name="Opt_In__c" value="clicked_via_mail" type="hidden" ?

I currently use a recursive call with UpdateSingleSalesforceObject but this creates problems with  runtime. Sometimes the lead is not yet created while the recursive call already creates a doublet
To be more clear:
-a cloudpage looks for an existing Lead (Ampscript, Retrievesalesforceobject, key: email Address)
-if found: CreateSalesforceObject or UpdateSingleSalesforceObject (campaignmember) with custom field
-if not: call web to lead with creation of campaignmember and status, retUrl this page
-should find the lead now and update the custom field (campaignmember)
Thanks!


text:
Q: dictionary values as column labels in matplotlib I have the following dict:
packetsNeeded = { u'hydrogen': 150,
                  u'helium': 143,
                  u'lithium': 122}

I am using matplotlib to plot a bar graph for each of the keys and the values of the dictionary above. I have managed to plot the bar chart using the following code:
import matplotlib.pyplot as pplot

pplot.bar(range(len(packetsNeeded)), packetsNeeded.values(),
         width = 0.75, align = 'center')
pplot.xticks(range(len(packetsNeeded)), packetsNeeded.keys())

pplot.xlabel("X label")
pplot.ylabel("Y label")
pplot.title("title here")
pplot.show()

I can show the X-Axis as the keys mentioned in the dictionary but I want the vertical bar chart to show the values of the dictionary on each bar.
I tried
pplot.yticks(range(len(packetsNeeded), packets.needed.values())

but the plot is as follows:

What is the right way to show the labels on columns for a dict
I tried the following:
for a, b in zip( key(), value()):
    pplot.text(a, b, str(b))

but I run into problems

A: Maybe you've meant something along the lines of
for key, x in zip(packetsNeeded.keys(), range(len(packetsNeeded))):
    pplot.text(x, packetsNeeded[key], packetsNeeded[key])


text:
Q: How to link tile of a sliding drawer to map activity extended as a fragment I am beginner in android and trying to link one tile of sliding drawer to map activity extended as fragment.
I tried it by creating a new Intent and starting it,but it is starting it as new activity and not in the drawer.
Any help is appreciated.
NavDrawer.java
public class NavDrawer extends ActionBarActivity
        implements NavigationDrawerFragment.NavigationDrawerCallbacks {

    /**
     * Fragment managing the behaviors, interactions and presentation of the navigation drawer.
     */
    private NavigationDrawerFragment mNavigationDrawerFragment;

    /**
     * Used to store the last screen title. For use in {@link #restoreActionBar()}.
     */
    private CharSequence mTitle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_nav_drawer);

        mNavigationDrawerFragment = (NavigationDrawerFragment)
                getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
        mTitle = getTitle();

        // Set up the drawer.
        mNavigationDrawerFragment.setUp(
                R.id.navigation_drawer,
                (DrawerLayout) findViewById(R.id.drawer_layout));
    }

    @Override
    public void onNavigationDrawerItemSelected(int position) {
        // update the main content by replacing fragments
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction()

                .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))
                .commit();
    }

    public void onSectionAttached(int number) {
        switch (number) {
            case 1:
                mTitle = getString(R.string.title_section1);
                break;
            case 2:
                mTitle = getString(R.string.title_section2);
                Intent intent = new Intent(this, MapsActivity.class);
                startActivity(intent);
                break;
            case 3:
                mTitle = getString(R.string.title_section3);
                break;
        }
    }

    public void restoreActionBar() {
        ActionBar actionBar = getSupportActionBar();
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(mTitle);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        if (!mNavigationDrawerFragment.isDrawerOpen()) {
            // Only show items in the action bar relevant to this screen
            // if the drawer is not showing. Otherwise, let the drawer
            // decide what to show in the action bar.
            getMenuInflater().inflate(R.menu.nav_drawer, menu);
            restoreActionBar();
            return true;
        }
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {
        /**
         * The fragment argument representing the section number for this
         * fragment.
         */
        private static final String ARG_SECTION_NUMBER = "section_number";

        /**
         * Returns a new instance of this fragment for the given section
         * number.
         */
        public static PlaceholderFragment newInstance(int sectionNumber) {
            PlaceholderFragment fragment = new PlaceholderFragment();
            Bundle args = new Bundle();
            args.putInt(ARG_SECTION_NUMBER, sectionNumber);
            fragment.setArguments(args);
            return fragment;
        }

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                 Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_nav_drawer, container, false);
            return rootView;
        }

        @Override
        public void onAttach(Activity activity) {
            super.onAttach(activity);
            ((NavDrawer) activity).onSectionAttached(
                    getArguments().getInt(ARG_SECTION_NUMBER));
        }
    }

}

MapsActivity.java
public class MapsActivity extends FragmentActivity


text:
Q: How can I use this function?I take it from other project I am new to php language. I just copy a database connection function from another sample project. The code is below.
public function getRows($conditions = array()){
    $sql = 'SELECT ';
    $sql .= array_key_exists("select",$conditions)?$conditions['select']:'*';
    $sql .= ' FROM '.$this->table;
    if(array_key_exists("where",$conditions)){
        $sql .= ' WHERE ';
        $i = 0;
        foreach($conditions['where'] as $key => $value){
            $pre = ($i > 0)?' AND ':'';
            $sql .= $pre.$key." = '".$value."'";
            $i++;
        }
    }

    if(array_key_exists("order_by",$conditions)){
        $sql .= ' ORDER BY '.$conditions['order_by'];
    }

    if(array_key_exists("start",$conditions) && array_key_exists("limit",$conditions)){
        $sql .= ' LIMIT '.$conditions['start'].','.$conditions['limit'];
    }elseif(!array_key_exists("start",$conditions) && array_key_exists("limit",$conditions)){
        $sql .= ' LIMIT '.$conditions['limit'];
    }

    $query = $this->db->prepare($sql);
    $query->execute();

    if(array_key_exists("return_type",$conditions) && $conditions['return_type'] != 'all'){
        switch($conditions['return_type']){
            case 'count':
                $data = $query->rowCount();
                break;
            case 'single':
                $data = $query->fetch(PDO::FETCH_ASSOC);
                break;
            default:
                $data = '';
        }
    }else{
        if($query->rowCount() > 0){
            $data = $query->fetchAll();
        }
    }
    return !empty($data)?$data:false;
}

Can anyone show me example how to use this function?I want to use WHERE,LIMIT,GROUP_BY and SELECT clauses. When I put in an array like this, I got error message " Invalid argument supplied for foreach()"
$conditions = array('where' => "user_name = '$username'");
$data = $userMo -> getRows($conditions);

A: you are making a mistake, as its said Invalid argument supplied for foreach()
that means its not getting an array, and think if there are multiple WHERE then??
so try this
$conditions = array('where' => array('user_name' => $username));


text:
Q: Bootstrap Sidebar Expanding Subcategories Using this as a my starting template. I am attempting to integrate the bootstrap way of having expanding subcategories as seen on the sidebar of the getting started page of getbootstrap.
However, I am having an issue where I am scrolling through the page and if I get to the category or its sub-category it highlights all parts of the category in the sidebar (instead of just the subcategory).
Here is the snippet of my sidebar HTML:

        User Guide

                Introduction

        Searching

                Search Results
                Understanding Search Results

        User Profile

                Viewing a Profile

        Event Graph

                Graph Display
                Graph Interaction

        Information Panel

                Panel Display

and the CSS:
body {
    padding-top:50px;
}

#masthead {
    min-height:250px;
}

#masthead h1 {
    font-size: 30px;
    line-height: 1;
    padding-top:20px;
}

#masthead .well {
    margin-top:8%;
}

@media screen and (min-width: 768px) {
    #masthead h1 {
        font-size: 50px;
    }
}

.navbar-bright {
    background-color:#111155;
    color:#fff;
}

.affix-top,.affix{
    position: static;
}

@media (min-width: 979px) {
    #sidebar.affix-top {
        position: static;
        margin-top:30px;
        width:228px;
    }

    #sidebar.affix {
        position: fixed;
        top:70px;
        width:228px;
    }
}

#sidebar li.active {
    font-weight: bold;
    border:0 #CC0000 solid;
    border-right-width:5px;
}

/* Nav: second level */
#sidebar .nav {
    display: none;
}

#sidebar > li.active .nav {
    display: block;
}

#sidebar .nav {
    margin-bottom: 8px;
}

#sidebar .nav > li > a {
    padding-top: 3px;
    padding-bottom: 3px;
    padding-left: 30px;
    font-size: 90%;
}

I have also included the JSFiddle to show what I am seeing: http://jsfiddle.net/HsZ9q/8/
Please note, in the JSFiddle you have to expand the window to as big as possible till you see the sidebar due to responsiveness.

A: I think that your css add a border to the
 element when it's :active you should do it to the  element. Also on the submenu each element has to be on a

Hope it helps
http://jsfiddle.net/HsZ9q/12/
#sidebar li.active > a{
    font-weight: bold;
    border:0 #CC0000 solid;
    border-right-width:5px;
}

            User Guide

                    Introduction

            Searching

                    Search Results

                    Understanding Search Results

            User Profile

                    Viewing a Profile

            Event Graph

                    Graph Display

                    Graph Interaction

            Information Panel

                    Panel Display


text:
Q: can't run react native with npm start hi i'm very beginner in react native i create react native app using expo init
and after that i go an on this folder and run npm start its give me an error
mohit@mohit-PC:~/Desktop/this is not for you/rn$ cd fp/

mohit@mohit-PC:~/Desktop/this is not for you/rn/fp$ npm start

fp@1.0.0 start
expo start

Starting project at /home/mohit/Desktop/this is not for you/rn/fp
RangeError [ERR_SOCKET_BAD_PORT]: options.port should be >= 0 and < 65536. Received 65536.
at new NodeError (node:internal/errors:371:5)
at validatePort (node:internal/validators:216:11)
at Server.listen (node:net:1461:5)
at /usr/local/lib/node_modules/expo-cli/node_modules/freeport-async/index.js:8:12
at new Promise ()
at testPortAsync (/usr/local/lib/node_modules/expo-cli/node_modules/freeport-async/index.js:6:10)
at availableAsync (/usr/local/lib/node_modules/expo-cli/node_modules/freeport-async/index.js:24:17)
at /usr/local/lib/node_modules/expo-cli/node_modules/freeport-async/index.js:37:23
at new Promise ()
at freePortRangeAsync (/usr/local/lib/node_modules/expo-cli/node_modules/freeport-async/index.js:33:10)


text:
Q: Why the radius equals $2$ in the Wigner semicircle law? I'm using the notations of the Erdős-Yau book. On page 11:
Let $H$ be an $N \times N$ real symmetric or complex Hermitian Wigner matrix, where the upper triangle entries of $H$ are independent, the entries are centered $\mathbb{E}h_{ij}=0$, and the variances are $\mathbb{E}|h_{ij}|^2=N^{-1}$. Let $\lambda_1\leq\dots\leq\lambda_N$ denote the eigenvalues of $H$. The Wigner semicircle law states that for any fixed $a\leq b$ real numbers, we have
$$
\lim_{N\to\infty}\frac{\#\{i: \lambda_i \in [a,b]\}}{N} = \frac{1}{2\pi}\int_a^b \sqrt{(4-x^2)_+},
$$
where $(\alpha)_+ := \max\{0,\alpha\}$ denotes the positive part of a number $\alpha$.
This implies that as $N$ goes to infinity, all the eigenvalues are in the interval $[-2,2]$. There are two proofs in the above linked book for this statement. The first uses the moment method, and the second uses the Stieltjes transform method, but from these proofs it is not clear for me, how $4$ appears in the integrand above. I'm pretty sure that there is a probabilstic reasoning for this, and it would not be surprising if it is because of some basic properties of moments for example, but I just can't figure it out.

Why the radius of the semicircle equals $2$ in the Wigner semicircle law?


text:
Q: Linked server - connection fail from remote computer (using ssms) I'm facing issue with linked server on Microsoft SQL Server 2012 (SP4).
When I remotely connect to SQL server (where linked server is created) with ssms and try to use/test linked server connection (e.g. Test Connection), I get the error

Msg 18456, Level 14, State 1, Line 14, Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

But, when I log locally to SQL server I can access linked server with no problems. I'm using windows authentication.
Here is my configuration:
A (my workstation, ssms client)
B middle SQL server (linked server definition, pointing to C)
C target SQL server
So, the problem only appears when I'm connecting from A (ssms) to B and from here try to access SQL server on C via linked server. Locally, on B, the linked server is accessible corrrectly.
It seems like I'm facing double hop problem, but since my knowledge on this topic is (yet) not deep enough, I would like to ask for some help with diagnosing the issue.
Any help would be really appreciated!
Regards,
Domen
The linked server is configured as follows:
Connections are made using login's current context.
EXEC master.dbo.sp_addlinkedserver @server = N'linkedservername', @srvproduct=N'SQL_SERVER', @provider=N'SQLNCLI11', @datasrc=N'MY_SERVER_C'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'linkedservername',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'collation compatible', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'data access', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'dist', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'pub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'rpc', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'rpc out', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'sub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'connect timeout', @optvalue=N'0'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'collation name', @optvalue=NULL
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'lazy schema validation', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'query timeout', @optvalue=N'0'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'use remote collation', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'linkedservername', @optname=N'remote proc transaction promotion', @optvalue=N'true'

A: It is as you guessed a double hop issue.
Recreating the issue, trying to connect from my local SSMS, to the source server, and then connecting to a second destination server via a Linked Server "connection test" that is configured as "be made using the current security context".

Workaround #1
Implement kerberos authentication
The kerberos configuration manager is much easier than manually creating the commands
Download Link
More information on implementing kerberos Here
Also check out step 11 of This link:

*How do I set up Kerberos for linked servers?

  Set up SPNs for both instances. Set delegation to Trust this user for
  delegation to any service on the service account being used on the
  instance where the linked server is set up. Basically, the server that
  must pass the ticket along must be set up for delegation.

Workaround #2
Using a SQL Login to map to the windows login.
Step 1: Create the Login on the destination server and give it the needed rights

Step 2: Change Linked server mapping

Note: if you are adding an other account than the one you are currently creating the linked server with, then it will still throw an error.
Step 3: Test the connection again:

A: I have checked SPN settings and I got Status "Good" for all SPNs. Also Delegation shows me "Full" delegation type. So, from kerberos point of view everything seems to be OK, but the connection still doesn't work. Additionally, I have noticed that the linked server connection works fine for some of my co-workers from their workstations (win 10 Enterprise), but for some it fails like in my case. We all use domain account to connect to middle server. So, I believe that is another indication it's not Kerberos issue. Any suggestions?


text:
Q: Can I store user information to local storage using c# I am working on one website and currently I am using a cookie to store necessary information used by the consoles, whenever the user log in.
I would like to store the user information from the login not ONLY to the cookie but in a local storage key as well when user logs in and logs out using c#.
Currently I am using javascript to store information in local storage. But same approach is possible with c#?
Please suggest me some way to do so. Thanks.

A: C# executes on server while local storage is on the client side. So it is not possible to access local storage using C# directly. This could be done through JavaScript only.
Although you can write custom HtmlHelper (C# code) that generates JavaScript for accessing local storage.


text:
Q: How to call a function in another function in order to change something in the 1. function i am trying to make a program in which you have a list of workers,where you can add new workers and delete workers.
I made a function which contained 5 names. i then want to make a second function to add 2 new names to the 1. function.
public static void Zaposlenici()
        {
            List<string> imena = new List<string> { "Marko","Ivan","Miljenko","Josip","Luka"};
            foreach (var ime in imena)
            {
                Console.WriteLine(ime);

            }
        }

        public static void Izbornik()
        {
            Console.WriteLine("1. Zaposlenici u firmi");
            Console.WriteLine("2. Dodaj novog zaposlenika");
            Console.WriteLine("3. Izbrisite zaposlenika");
            Console.WriteLine("0. Izlaz");
            Console.WriteLine("--------------------");
            Console.WriteLine("");
            Console.WriteLine("Odaberite opciju: ");
        }
        public static void DodajZaposlenika()
        {

            List<string> NovaImena = new List<string> { "Francis", "Matea" };

        }
        public static void Opcije()
        {
            int opcija= Int32.Parse(Console.ReadLine());
            switch (opcija)
            {
                case 1:
                    Zaposlenici();
                    break;

                default:
                    break;
            }
        }

        static void Main(string[] args)
        {
            Console.WriteLine("Pozdrav!");
            Console.WriteLine("---------------");
            Izbornik();
            Opcije();
        }
    }

I simply tried using the 1. function in the 2. so i thought i could just change it but i cant seem to be able to use the contents from the 1. function

A: You can easily modify your function's list, passing the list in argument :
public class yourWindow : Window
{
    public void yourFunction1()
    {
        List<string> imena = new List<string> { "Marko","Ivan","Miljenko","Josip","Luka"};
        yourFunction2(imena);
    }
    public void yourFunction2(List<string> imena)
    {
        imena.Add("Aleksey");
    }

This will then add it to your list.
Edit : you also can create a list (public or private) that will be available from any function :
public class YourMainWindow : Window //you have something like that
            private imena{get;set;}=new List<string>();
            public static void Zaposlenici()
            {
                this.imena = new List<string> { "Marko","Ivan","Miljenko","Josip","Luka"};
                foreach (var ime in imena)
                {
                    Console.WriteLine(ime);

                }
            }

            public static void Izbornik()
            {
                Console.WriteLine("1. Zaposlenici u firmi");
                Console.WriteLine("2. Dodaj novog zaposlenika");
                Console.WriteLine("3. Izbrisite zaposlenika");
                Console.WriteLine("0. Izlaz");
                Console.WriteLine("--------------------");
                Console.WriteLine("");
                Console.WriteLine("Odaberite opciju: ");
            }
            public static void DodajZaposlenika()
            {

                this.imena.AddRange(new List<string> { "Francis", "Matea" });

            }
            public static void Opcije()
            {
                int opcija= Int32.Parse(Console.ReadLine());
                switch (opcija)
                {
                    case 1:
                        Zaposlenici();
                        break;

                    default:
                        break;
                }
            }

            static void Main(string[] args)
            {
                Console.WriteLine("Pozdrav!");
                Console.WriteLine("---------------");
                Izbornik();
                Opcije();
            }
        }
    }

A: While you can easily modify your function's list. You should not though. No really don't mutate object parameter. It is not a good practice. Here is a solution which did not mutate the list:
Demo
public static void Main()
{
    yourFunction1();
}

public static void yourFunction1()
{
    var imena = new List<string>{"Marko", "Ivan", "Miljenko", "Josip", "Luka"};
    var imena2 = yourFunction2(imena);
    Console.WriteLine(string.Join("\n", imena2));
}

public static IEnumerable<string> yourFunction2(IEnumerable<string> imena)
{
    return imena.Append("Francis").Append("Matea");
}

another solution would be to use yield return and concat:
Demo
public static void yourFunction1()
{
    var imena = new List<string>{"Marko", "Ivan", "Miljenko", "Josip", "Luka"};
    var imena2 = imena.Concat(yourFunction2());
    Console.WriteLine(string.Join("\n", imena2));
}

public static IEnumerable<string> yourFunction2()
{
    yield return "Francis";
    yield return "Matea";
}


text:
Q: DocuSign Payment Field Template I have a DocuSign template
i have payment field there and i am using formula (i had to set there currency because is mandatory but i want to change it using API call)
I am using PHP and docusign-php-client to integrate
I am successfully manage to update the formula but i want to change payment_details  currency and i am not able to do this
$client->setTabs((new Tabs)
            ->setNumberTabs([(new Number())->setTabLabel('TOTAL_PRICE')->setValue(1000)])
            ->setFormulaTabs([(new FormulaTab())
                ->setRequired(true)
                ->setFormula('([TOTAL_PRICE]) * 3')
                ->setRoundDecimalPlaces(2)
                ->setTabLabel('PAYMENT_PRICE')
                ->setPaymentDetails((new PaymentDetails())
                    ->setCurrencyCode('USD')
                    ->setLineItems([
                        (new PaymentLineItem())
                            ->setName('TOTAL_PRICE')
                            ->setAmountReference('TOTAL_PRICE')
                    ])
                    ->setGatewayAccountId('xxxx-xxxxx-xxxx-xxxx')
                )
                ->setXPosition(482)   // i was testing if i can add dynamic field but i cannot
                ->setYPosition(798)
            ])
        );

Formula is updated when document is creating
Questions:

*

*Why setPaymentDetails is ignored (i've set in template currency: EUR and I want to change it to USD using API call)?

*Is this possible to add field dynamically to existing template?
EDIT: I figured out point 2:
i needed to add
                ->setDocumentId(1)
                ->setPageNumber(1)

to make it dynamic

A: From what I can see, setPaymentDetails takes JSON, like this:
    $payment_details = new \DocuSign\eSign\Model\PaymentDetails([
        'gateway_account_id' => $args['gateway_account_id'],
        'currency_code' => "USD",
        'gateway_name' => $args['gateway_name'],
        'line_items' => [$payment_line_iteml1, $payment_line_iteml2]]);

So, I'm not sure about the way you're making separate calls for each argument.
See code example here:
https://github.com/docusign/eg-03-php-auth-code-grant/blob/master/src/EG014CollectPayment.php


text:
Q: Case statement for optional parameters not expanding some variable Based on this answer I wrote some simple optional argument parser
#!/bin/bash
TEST_PATH=pluto
if [ $# -eq 0 ]; then
    echo "Usage:"
    echo "./run.sh [--valgrind|-v] [--test|-t] <mesh.dat> <csv_points_file>"
else
    . config.sh
    while [[ "$#" -gt 0 ]]; do
        case $1 in
            -v|--valgrind) VALGRIND="valgrind --track-origins=yes"; shift ;;
            -t|--test) TEST="mickey goofy" shift ;;
            *) ARGS+=($1) shift ;;
        esac
        shift
        echo $TEST
    done
    echo ${VALGRIND} ${TEST_PATH} "${ARGS[*]:-$TEST}"
fi

Except when executing ./somescript.sh -v the output is correct, while with the -t argument nothing except the correct value of TEST_PATH
The expected behavior was meant to be
$./somescript.sh -t
pluto mickey goofy

$./somescript.sh daffy duck
pluto daffy duck

What am I doing wrong?

A: Take out the extra shifts.
That is:
        case $1 in
            -v|--valgrind) VALGRIND="valgrind --track-origins=yes";;
            -t|--test) TEST="mickey goofy";;
            *) ARGS+=( "$1" );;
        esac

You should only do an extra shift inside your individual cases when the option you're processing takes an option-argument, and you need to remove that option-argument from the argument vector before processing can continue.


text:
Q: Object-Oriented Programming: Why "Oriented"? I am most of the way through my games programming degree.  This is not a computer science degree, so a lot of the theory is eschewed in favour of practical portfolio building and what I see as JIT learning, which is apparently more important in the games industry.  The first subject was "Introduction to Object-Oriented Programming".
That phrase didn't bother me until I learned about the different programming paradigms (I'm getting this list from https://en.wikipedia.org/wiki/Comparison_of_programming_paradigms):

*

*Imperative

*Functional

*Procedural

*Structured

*Event-Driven

*Object-Oriented

*Declarative

*Automata-Based

I get that this is not an exhaustive list, and that not all of these concepts are equal, and most of them aren't even exclusive, but I don't understand why most of them get just one word - imperative; functional; declarative - but when we talk about programming with objects, we have to clarify that we are oriented around those objects.  Can't we just use objects?  Can't we just have objects?  Why must they orient us, as our guiding star?
Looking here (https://en.wikipedia.org/wiki/Object-oriented_programming), nowhere is the use of the term "oriented" addressed as its own term.  Only "object" is explained.
Also, I can see for practical reasons why Event-Driven is used, because Event Programming is already a thing that you do when you're running a conference, and Automata Programming makes it sound like you're setting up a robotic production line, so it helps to have additional clarifying words there.
What makes Object Programming, as a phrase, not enough to describe what we do when we use objects in our programming?
Obviously from my tone I'm not too fond of the word "oriented".  It reminds me of my time as a court reporter, listening to lawyer after lawyer use the phrase "in relation to" as a kind of verbal tick.  It didn't mean anything; it was just a term that they used to fill the air while they tried to think of what to say next.  However, I'm not trying to advocate a change of language, I'm just asking why it is the way it is.  If someone knows why it came to be known that way for purely historical, vestigial reasons, then that's the answer.  It will be ammunition if I ever decide to waste my time advocating for a change of language.
On the other hand, if there is actually a useful reason for why a language or piece of code must point towards objects, to the exclusion of all other directions, as opposed to merely having them in its toolbelt, as tools, I would really be interested to learn about it.  I like learning useful things.

A: I believe you're reading way too much into a simple grammatical construct. Take a look at your list of paradigms, sorted differently for a reason we will get to shortly:

*

*Imperative

*Functional

*Procedural

*Structured

*Declarative

*Event-Driven

*Automata-Based

*Object-Oriented

What do the words all have in common? They're all adjectives because they're intended to modify the word "programming". Furthermore, with the exception of "imperative" they're all not "natural" adjectives, but "adjectified" nouns - nouns that actually describe the core of the paradigm: function, structure, automata, and object.
And there are two different ways in which the nouns are adjectified: through a suffix like -al or -ed, or through creating a composite word using a hyphen. Now, as Doc Brown has pointed out, the suffixes that could be used to adjectify "object" result in a different meaning. Which leaves composition.
And I submit that it is pure coincidence or taste that Alan Kay chose to use "oriented" for his composite adjective "object-oriented". It could just as well have been "object-driven", or "object-based", and you might read too much into those as well. Doesn't "driven" sound like some sort of unhealthy obsession?

A: Calling it that helps to explain that objects are a very important part of the paradigm.
Object-Oriented programming has its roots in Simula, which was essentially ALGOL plus some new object-programming features.  And in keeping with that history, even today it's entirely possible in many languages (even the "pure OO languages") to code something that is essentially just a procedural program with some objects in it.  But this is considered bad style by more experienced developers.
Actually doing something "the object-oriented way" is very different from "the procedural way."  The most important concept is the use of inheritance and polymorphism.  When you truly understand and internalize the way classes and virtual methods work, it's an eye-opening experience that changes the way you write code in a lot of cases, a true paradigm shift.  (Assuming, of course, that you started out writing procedural code first.  A lot of students these days go straight to Java or C# as a first language, and IMO they miss out on really understanding the benefits of OO by doing so.)
We call it object-oriented programming because a program written in OO style does not just contain objects; the structure of the whole program is based around them and around the way they work.

A:
but when we talk about programming with objects, we have to clarify that we are oriented around those objects. Can't we just use objects? Can't we just have objects?

Frankly, it's a holdover of history. Functional programming is really function-oriented programming, declarative programming is really declaration-oriented programming... after all don't we just use functions? Can't we just have functions?
"Object oriented" rolls off the tongue better, and is historically ingrained.
The 'orientation' comes because we're not talking about programming but design. Just because we use objects, or use functions, or use events does not mean that our design methodology is done by modelling all three. By specifying the orientation of the design methodology, it helps communicate to programmers how they should interpret and extend that design - how the modelling focus colors the implementation.


text:
Q: keep 2 pictures open for a while in memory game in java hi there i am working on a project(card matching game) and it is almost finished but the things is when i clicked on second button to open the picture if it not same with first it suddenly closed. well nothings is wrong but user must see the picture for a while(maybe 2 second). so i used Thread.sleep(2000) but i doesnt work properly. it sets icon null and then start to wait 2 seconds. here is my code a tried to make a SSCCE,
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Menu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Random;
import java.util.Vector;

import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.UIManager;
import javax.swing.border.*;

public class ConcentrationGame3 extends JFrame {

    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private int buttoncounter=0;
    private int counter = 0;
    private JFrame frame;
    private JPanel mainPanel;
    private JPanel buttonPanel;
    private JMenuBar menuBar;
    private JMenu menu;
    private JMenuItem menuItem;
    private int[] arr = new int[16];
    private int i,j;
    private int random;
    private int size = 4;
    private Icon hidden;
    private GameButton buttonFirst;
    private GameButton buttonSecond;
    int k=0;

    private Icon img[] = {UIManager.getIcon("OptionPane.errorIcon"),
            UIManager.getIcon("OptionPane.informationIcon"),
            UIManager.getIcon("OptionPane.warningIcon")};

    private Icon iconList[] = new ImageIcon[size];

    public ConcentrationGame3(){

        createArray();
        initComponents();

    }

    private void initComponents(){

        frame = new JFrame("Concentration Game");

        menuBar = new JMenuBar();
        menu = new JMenu("Menu");

        frame.setJMenuBar(menuBar);

        menuBar.add(menu);

        menuItem = new JMenuItem("New Game");
        menu.add(menuItem);

        menuItem = new JMenuItem("Solve");
        menu.add(menuItem);

        menuItem = new JMenuItem("Exit");
        menu.add(menuItem);

        mainPanel = new JPanel(new BorderLayout(5, 5));
        mainPanel.setBorder(new EmptyBorder(4,4,4,4));

        frame.setContentPane(mainPanel);

        buttonPanel = new JPanel(new GridLayout(4,4,5,5));
        buttonPanel.setBackground(Color.green);

        for(i=0; i<4; i++){

            final GameButton button = new GameButton(new JToggleButton(),iconList[i]);
            button.addItemListener(new ItemListener(){
                public void itemStateChanged(ItemEvent e){

                    button.setState();
                }
            });

            button.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent e){

                        try {
                            buttonActionPerformed(e,button);
                        } catch (InterruptedException e1) {
                            // TODO Auto-generated catch block
                            e1.printStackTrace();
                        }
                }
            });
            buttonPanel.add(button);
        }

        mainPanel.add(buttonPanel, BorderLayout.CENTER);

        frame.setSize(300, 300);
        //frame.pack();
        frame.setLocation(300, 300);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

    class GameButton extends JToggleButton{

        private static final long serialVersionUID = 1L;
        private JToggleButton gameButton;
        private Icon icon;

        public GameButton(JToggleButton gameButton,Icon icon){

            this.gameButton = gameButton;
            this.icon = icon;
        }

         public void setState() {
                if (this.isSelected() || !this.isEnabled()) {
                    this.setIcon(icon);
                } else {
                    this.setIcon(hidden);
                }
            }
        }

    private void buttonActionPerformed(ActionEvent e, GameButton button) throws InterruptedException {
        if(button.isSelected()){
            buttoncounter++;

            if(buttoncounter==1){
                buttonFirst = (GameButton) e.getSource();
            }
            else if(buttoncounter==2){
                buttonSecond = (GameButton) e.getSource();
                buttoncounter=0;

                    if( checkPairs(buttonFirst,buttonSecond) ) {
                        retirePair(buttonFirst,buttonSecond);
                    }

                    else{
                            Thread.sleep(2000);
                            buttonFirst.setIcon(hidden);
                            buttonFirst.setSelected(false);
                            buttonSecond.setIcon(hidden);
                            buttonSecond.setSelected(false);

                    }

            }
        }
    }

    private void retirePair(GameButton a, GameButton b){
        a.setSelected(true);
        a.setEnabled(false);
        b.setSelected(true);
        b.setEnabled(false);
    }

    private boolean checkPairs(GameButton first, GameButton second){

        if(first.getIcon().equals(second.getIcon()))
            return true;
        else
            return false;

    }

    private void createArray(){

        Random rnd = new Random();

        while(i<4){

            random = rnd.nextInt(3)+1;

            if(!includes(random)){
                arr[i]=random;
                iconList[i] = img[random-1];
                i++;
            }
        }
    }

    public boolean includes(int rnd){

        counter=0;

        for(j=0; j<arr.length; j++){

            if(arr[j] == rnd){
                counter++;
                if(counter>1)
                    return true;
            }
        }

        return false;
    }

    /**
     * @param args
     */
    public static void main(String[] args) {

        new ConcentrationGame3();

    }

}

i appreciated if you can help me. and thanks anyway :)

A: You don't want to use Thread.sleep on the Swing thread, since as I'm sure you've read if you've done any searching, what this does is put Swing to sleep, sleep meaning all drawing is frozen, and all user interaction (like response to buttons) is frozen. Instead use a Swing Timer which will allow you to pause your application without preventing Swing from drawing your second image and showing both for 2 or 3 seconds.  The logic will be: show both images, start the timer, and when the timer "ticks" after 2 or 3 seconds (or whatever you set the delay to be), hide the images inside of the timer's ActionListener.
Also: make sure that you set the timer as non-repeating (there's a boolean method of Swing Timer that does this). Also, you'll want to make all of your JToggleButtons unresponsive (or enabled == false) while the  the two images are shown, and then you want the Timer to set all the non-paired buttons to a responsive state when it "ticks".


text:
Q: LaunchedEffect not called on Box while UI testing in Jetpack Compose I am running a simple Test on LaunchedEffect:
@Test
fun testSomeState() {
    composeTestRule.setContent {
        SomeComposable {
            println("click $it")
        }
    }
    composeTestRule.onNodeWithTag("Zivi")
        .performClick()
        .assertExists()
}

@Composable
fun SomeComposable(onClick: (Int) -> Unit) {
    var someState by remember { mutableStateOf(0) }

    Button(modifier = Modifier.testTag("Zivi").pointerInteropFilter {
        someState = when (it.action) {
            MotionEvent.ACTION_DOWN -> { 1 }
            MotionEvent.ACTION_UP -> { 2 }
            else -> { someState  }
        }
        true

    }, onClick = { }) {}

    LaunchedEffect(someState) {
        println("LaunchedEffect someState $someState") // prints "LaunchedEffect someState 0"
                                                       // and then "LaunchedEffect someState 2"
        if (someState == 2) { onClick(someState) }
    }
}

This works well, however, if i change Button to a Box, like this:
@Composable
fun SomeComposable(onClick: (Int) -> Unit) {
    var someState by remember { mutableStateOf(0) }

    Box(modifier = Modifier.testTag("Zivi").pointerInteropFilter {
        someState = when (it.action) {
            MotionEvent.ACTION_DOWN -> { 1 }
            MotionEvent.ACTION_UP -> { 2 }
            else -> { someState  }
        }
        true

    }) {}

    LaunchedEffect(someState) {
        println("LaunchedEffect someState $someState") // prints "LaunchedEffect someState 0"
        if (someState == 2) { onClick(someState) }
    }
}

Then the LaunchedEffect is not called on performClick, can anyone help me understand why?

A: The box composable by default doesn't have any size so technically, when the user clicks on any portion of the screen, the event doesn't get consumed by the Box.
You can verify this by adding a background(color = Color.Green) modifier to your box and observe that no section of the screen gets colored green as expected.
You can fix this by  setting a size modifier for your Box.
You can change your box implementation to this and it should work. I am using fillMaxSize here
@Composable
fun SomeComposable(onClick: (Int) -> Unit) {
    var someState by remember { mutableStateOf(0) }

    Box(modifier = Modifier
        .fillMaxSize()
        .testTag("Zivi")
        .pointerInteropFilter {
            someState = when (it.action) {
                MotionEvent.ACTION_DOWN -> {
                    1
                }
                MotionEvent.ACTION_UP -> {
                    2
                }
                else -> {
                    someState
                }
            }
            true

        }) {}

    LaunchedEffect(someState) {
        println("LaunchedEffect someState $someState") // prints "LaunchedEffect someState 0"
        // and then "LaunchedEffect someState 2"
        if (someState == 2) {
            onClick(someState)
        }
    }
}


text:
Q: Spark program on Windows cluster fails with error CreateProcess error=5, Access is denied I am trying to execute a program on a Spark v2.0.0 Cluster on my Windows 10 laptop. There is a master node on port 31080 and slave node on 32080. The cluster is using the Standalone manager and am using JDK 1.8, with a custom work directory for the slave.
When the program is submitted via spark-submit or through Eclipse > Run program, I get the below error, and the executor goes in a loop (a new executor is created, and fails continuously). Please guide.

Executor updated: app-20160906203653-0001/0 is now RUNNING
Executor updated: app-20160906203653-0001/0 is now FAILED (java.io.IOException: Cannot run program ""D:\jdk1.8.0_101"\bin\java"
(in directory "D:\spark-work\app-20160906203653-0001\0"):
CreateProcess error=5, Access is denied)
Executor app-20160906203653-0001/0 removed: java.io.IOException: Cannot run program ""D:\jdk1.8.0_101"\bin\java" (in directory
"D:\spark-work\app-20160906203653-0001\0"): CreateProcess error=5,
Access is denied
Removal of executor 0 requested

A: Got the answer.. I was starting my master and slaves through windows batch scripts. These were invoking an env script which was setting JAVA_HOME, SCALA_HOME and SPARK_HOME. The paths were enclosed in double quotes. Hence the issue. Removing the double quotes fixed the issue... no Admin priviliges or changes needed.


text:
Q: boot-repair is asking for a repo to install grub-efi-amd64-signed ...but I've no idea what repo it needs.
I'm running boot-repair from the Ubuntu 20.04 live USB stick, have successfully installed boot-repair and see this every time I run it:
Please enable a repository containing the [grub-efi-amd64-signed] packages in the software sources of Ubuntu 20.04.2 LTS (mapper/vgubuntu-root). Then try again.
I'm not clear on a couple of points here (and would very much appreciate help). 1. Where do I find such a repository? and, 2. If this grub package is essential to boot-install, why isn't it included in the boot-install live USB (which I've also tried, with the same result)?
The first question is practical; the second more philosophical. If somebody can put my mind to rest over either or both of these I'd be very grateful.  And if more information is needed I'll be happy to follow up here.
Meanwhile, current boot details here: https://paste.ubuntu.com/p/MtfxvwwV6W/
LATER
I've also tried installing grub-efi-amd64 independently of boot-repair, using the Synaptic Package Manager. This doesn't seem to impress boot-repair in the least---it still insists on running the install itself from a repo whose location it teasingly refuses to reveal.
--
Chris


text:
Q: ZK how to close popup window automatically without clicking any button? I am showing some notifications in a popup window and I want to close that window after few seconds automatically. Is there any way to close that window without clicking any button?
Thanks in advance!!

A: In your zul
<window id="main" apply="MyComposer">
<timer id="close" delay="1000" repeats="false"/>
<window id="popup" visible="false">
....

in java
class MyComposer extents SelectorComposer {

@Wire
Window popup
@Wire
Timer close

public void openPopup {
  popup.setVisible(true);
  popup.doPopup();
  Timer.start();
}

@Listen("onTimer #close")
public void close(Event event) {
  popup.detach();
}

}


text:
Q: Can ASP.NET be configured to run as an administrator when UAC is enabled? I can't seem to find any information that indicates whether ASP.NET can be configured (through web.config or maybe machine.config) to run as a real administrator on a machine with UAC enabled.
By this I mean, even if you set it to impersonate an Administrator account, UAC will disable that account's ability to act as an Administrator by returning a token set that hides the administrator role. For any checks such as IsInRole, the running account is effectively not an administrator at all.
So ... Let's say I want to ignore all good advice and just go ahead and run a web app on Vista with administrator permissions.  Is it even possible?
Alternatives welcome.  (Core reason for needing administrator privileges: to stop or start services that are running on that machine.)

A: An alternate suggestion for Core Reason:
Use a message queue or similar concept to shuttle the information about services to start/stop back and forth between different security contexts instead of trying to hardwire those things together under ASP.NET.
For example,

*

*Under your ASP.NET non-administrator account, write some values to file or registry (a log of some kind) that contain information about what services to stop or start.

*Your controller service running as a true admin polls the written data location and when it sees info, follows those commands to start and stop the appropriate services.
You get around the problem with a workaround instead of a security hack, or instead of disabling UAC altogether.
Update for monitoring:

*

*Same idea as above but somewhat reversed - the main/controller service for this scenario that runs  on the system writes to a log file. It's the service that writes about other services.

*Put an auto-refresh on the web page. Each time your webpage refreshes it watches that log for changes = info about services that have stopped or started (can keep its own scratch file for change detection). The refresh might be a META Refresh tag, or an AJAX callback to the server (more subtle).

*Web page issues instructions as before.

The problem is if that main/controller service stops and nothing gets reported (logs/messages stop being passed). Make a special case for that one service, if you can, by telling Windows to restart it if it stops, or to reboot the machine if it can't start that service ...
.. By the way, have you looked into Windows tools to automatically watch services and restart them on failure, instead of using a web page monitor, or is that not feasible for your requirements?


text:
Q: Big Data convert to "transactions" from arules package The arules package in R uses the class 'transactions'. So in order to use the function apriori() I need to convert my existing data. I've got a Matrix with 2 columns and roughly 1.6mm rows and tried to convert the data like this:
transaction_data <- as(split(original_data[,"id"], original_data[,"type"]), "transactions")

where original_data is my data matrix. Because of the amount of data I used the largest AWS Amazon machine with 64gb RAM. After a while I get

resulting vector exceeds vector length limit in 'AnswerType'

The Memory Usage of the machine was still 'only' at 60%. Is this a R-based limitation? Is there any way to work around this other than using sampling? When only using 1/4 of the data the transformation worked fine.
Edit: As pointed out, one of the variables was a factor instead of character. After changing the transformation was processed quickly and correct.

A: I suspect that your problem is arising because one of the functions uses integers (rather than, say, floats) to index values.  In any case, the size isn't too big, so this is surprising.  Maybe the data has some other issue, such as characters as factors?
In general, though, I'd really recommend using memory mapped files, via bigmemory, which you can also split and process via bigsplit or mwhich.  If offloading the data works for you, then you can also use a much smaller instance size and save $$.  :)


text:
Q: Archives and Categories in Custom Menu What is the easiest way to place the Archives and Categories lists within my menu under a parent tab. I'd like both of the lists, such as "Archives" leading to the "archives" sub-menu, and the same for Categories. I'm looking for a non-programmatic (admin-panel only) solution for this.

A: The new 3.0 menu will do this for categories, just create a custom link as the 'parent' tab and give it a url of http://# and then add our categories as sub items but it doesn't AFAIK give you a option for dealing with date based archives.

A: use wp_list_categories and wp_get_archives.


text:
Q: usage of SNMP protocol Is SNMP used to show a machine what software it must be running?
I heard that SNMP is used for monitoring, so I am curious whether SNMP is used in this way.

A: Simple Network Management Protocol (SNMP)
http://en.wikipedia.org/wiki/Snmp
SNMP can provide vital information about a node on a network. Usually used to monitor devices.
If you want to see SNMP information there are many free tools available. You will need to set a community name on your devices to be able to interogate them (or if you're lucky, they will be set with the default "public").
If you want your computer to serve SNMP information, most operating systems including Windows support this. Usually you will need to enable this as a feature of the operating system.

A: Yes, depending on vendor implementation, SNMP can be used to specify the name of a new software image, a server where it can be retrieved, and then to set a flag to tell the device to begin the upgrade process.  This is how cable modems are upgraded, for instance.  You would have to check the specific device's SNMP documentation to see if that feature is possible for what you wish to use it for.


text:
Q: ggplot donut chart percentage labels I'm trying to add percentage labels to a donut chart but have been unsuccessful in plotting a clear representation of percentage values (rounded and not overlapping)
## my data
library(ggplot2)
col <- c("white", "black", "transparent", "grey", "blue", "yellow", "green", "red", "pink", "orange", "brown")
freq <- c(101, 68, 34, 18, 14, 5, 5, 3, 2, 1, 1)
## create data frame
colour.df <- data.frame(col, freq)
colour.df

## calculate percentage
colour.df$percentage = colour.df$freq / sum(colour.df$freq)* 100
colour.df = colour.df[rev(order(colour.df$percentage)), ]
colour.df$ymax = cumsum(colour.df$percentage)
colour.df$ymin = c(0, head(colour.df$ymax, n = -1))
colour.df

## reorder colour levels
colour.df$col <- reorder(colour.df$col,
                             new.order = c(10, 1, 9, 5, 2, 11, 4, 8, 7, 6, 3))

All prepared for plotting. I may have done this a idiosyncratic way as I have to produce multiple donuts for other categories that involve colour, but I cant get my head round that (facets?).
## DONUNT ##
donut = ggplot(colour.df, aes(fill = col, ymax = ymax, ymin = ymin, xmax = 100, xmin = 80)) +
geom_rect(colour = "black") +
coord_polar(theta = "y") +
xlim(c(0, 100)) +
geom_label(aes(label = paste(percentage,"%"), x = 100, y = (ymin + ymax)/2),
         inherit.aes = F, show.legend = F, size = 5) +
theme(legend.title = element_text(colour = "black", size = 16, face = "bold"),
    legend.text = element_text(colour = "black", size = 15),
    panel.grid = element_blank(),
    axis.text = element_blank(),
    axis.title = element_blank(),
    axis.ticks = element_blank()) +
annotate("text", x = 0, y = 0, size = 15, label = "Micro")
donut

I have played around with the following code:
colour.df$percentage = colour.df$freq / sum(colour.df$freq)* 100
## to this
colour.df$percentage = round(colour.df$freq / sum(colour.df$freq)* 100, digits = 1)

But it it knocks up the ymax to 100.1. Taking it to 3 decimal points helps, but doesn't sort the overlapping.
I've also been bumping heads with the geom_label & geom_text ggplot2: How to add percentage labels to a donut chart & Rounding % Labels on bar chart in ggplot2
Anyway long story short. Any tips to help shape the above ^ code so I get rounded percentage labels next to my donut chart, without overlapping?
Thank you
donutchart

A: For rounding we could replace percentage with round(percentage,2) and for the overlap we could use geom_label_repel from the ggrepel package
library(ggrepel)
donut = ggplot(colour.df, aes(fill = col, ymax = ymax, ymin = ymin, xmax = 100, xmin = 80)) +
    geom_rect(colour = "black") +
    coord_polar(theta = "y") +
    xlim(c(0, 100)) +
    geom_label_repel(aes(label = paste(round(percentage,2),"%"), x = 100, y = (ymin + ymax)/2),inherit.aes = F, show.legend = F, size = 5)+
    theme(legend.title = element_text(colour = "black", size = 16, face = "bold"),
        legend.text = element_text(colour = "black", size = 15),
        panel.grid = element_blank(),
        axis.text = element_blank(),
        axis.title = element_blank(),
        axis.ticks = element_blank()) +
    annotate("text", x = 0, y = 0, size = 15, label = "Micro")
    donut

Note that there are warnings produced with ggrepel (Also I skipped the reorder colour levels step, feel free to correct/comment):
In min(x) : no non-missing arguments to min; returning Inf
In max(x) : no non-missing arguments to max; returning -Inf


text:
Q: How can I create a multiline split inside of a radical inside of an array environment? I have an align like this:
\begin{align*}
\sigma &= \sqrt{\sum_x \left[ (x-\mu_x)^2\mathbf{f}(x) \right] } = \sqrt{\frac{1}{10}\sum_x (x-\mu_x)^2 } \\
 &= \sqrt{\frac{1}{10}(
    (0-.45)^2 + (1-.45)^2 + (2-.45)^2 + (3-.45)^2 + (4-.45)^2 +
     (5-.45)^2 + (6-.45)^2 + (7-.45)^2 + (8-.45)^2 + (9-.45)^2 } \\
 &= \sqrt{24.6525}
\end{align*}

However, this goes off the edge of the page. I wanted to create a multiline inside the middle square root symbol, so I tried this:
\begin{align*}
\sigma &= \sqrt{\sum_x \left[ (x-\mu_x)^2\mathbf{f}(x) \right] } = \sqrt{\frac{1}{10}\sum_x (x-\mu_x)^2 } \\
 &= \sqrt{\frac{1}{10}(
    \begin{split} (0-.45)^2 + (1-.45)^2 + (2-.45)^2 + (3-.45)^2 + (4-.45)^2 + \\
     (5-.45)^2 + (6-.45)^2 + (7-.45)^2 + (8-.45)^2 + (9-.45)^2 } \end{split} \\
 &= \sqrt{24.6525}
\end{align*}

but this gives me errors about mismatched curly braces.
Ideally, I would have something exactly like \frac, except which did not draw the horizontal line between it's operands.

A: You can use something like:
\sqrt{\frac{1}{10}
\begin{aligned}
  ( & (0-.45)^2 + (1-.45)^2 + (2-.45)^2 + (3-.45)^2 + (4-.45)^2 +\\
   & (5-.45)^2 + (6-.45)^2 + (7-.45)^2 + (8-.45)^2 + (9-.45)^2 )
\end{aligned}
}

This works just like align but is only usable inside math mode.
There's also gathered which works like gather.


text:
Q: Meteor creating dynamic checkboxes So i want to create a certain number of check boxes based on the "timesPerWeek" value. The issue I'm having is that when trying to createElement I get Cannot read property 'createElement' of null. Pretty sure it is because the JS renders Before the HTML but i can't figure out what needs to be done to make it so that I can call my function to make the check boxes. This code currently doesn't depend on timesPerweek because I just trying to get a checkbox to show up first.
JS
'pie':function()
    {
    var progress = document.getElementById('progress');

        var stuff= progress.createElement('input');
        //var stuff = progress.createElement('input');
        stuff.type = "checkbox";
        stuff.name = "1";
        stuff.value = "set1";
        stuff.id = "stuff";

        var label = progress.createElement('label');
        label.htmlFor = "stuff";
        label.appendChild(document.createTextNode('pie'));

        progress.appendChild(stuff);
        progress.appendChild(label);

    }

HTML

                progress: {{timesPerWeek}}

                {{pie}}

I should be able to create elements under progress but it just dies with the error stated above.

A: The correct way to do this in Meteor is to use an #each helper:

  {{#each timesPerWeek}}
    <input type="checkbox" name="checkbox{{@index}}">
  {{/each}}

That should get you several checkboxes to show up.


text:
Q: Angular 6 delay the loop I have a question about angular loops. I would like to delay the rendering process on a ng-for. For example,

  <app-my-component [data]="data"></app-my-component>

Delay 10ms for each render. The "items" array comes from another component that I can't change it. Also, the "items" array size can be increased and decreased. Maybe, I can redirect it with observable struct. I have tried observable with async but I can't achieve. Can someone show me an example ?

A: Actually this is interesting question and couldn't found exact question on the SO.
This is my solution, I wrote helper methods for easier understanding and future code reuse:
My solution on Live StackBlitz editor Link
import { from, timer, Observable } from 'rxjs';
import {
  scan,
  map,
  concatMap,
  share,
} from 'rxjs/operators';

const timeOf = (interval: number) => <T>(val: T) =>
  timer(interval).pipe(map(x => val));

const timed = (interval: number) => <T>(source: Observable<T>) =>
  source.pipe(
    concatMap(timeOf(1000)),
    map(x => [x]),
    scan((acc, val) => [...acc, ...val]),
  )

And the usage is:
  arr = [1, 2, 3, 4, 5]

  arr$ = from(this.arr)
    .pipe(
      timed(1000),
    )

As for HTML will be:

    {{ i }}

As for explanation:
from(this.arr) will emit each of the array items separately and then I am using concatMap() for each emitted item to the timer(1000), which is essentialy delaying each emitted item for 1 second. Finally, I am using scan() operator to combine each emitted item back in the final accumulated array.

A: You can make use of async pipe to load an observable
//define your delay observable
this.delayItems=of(items).pipe(delay(1000))

in your template

  <app-my-component [data]="data"></app-my-component>

Update

import { Component } from '@angular/core';
import { from, timer, Observable } from 'rxjs';
@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  arr = [1, 2, 3, 4, 5]
  arr$:Observable<any[]>
  constructor() {
    this.arr$=from(this.arr).pipe(
    concatMap(item=>timer(1000).pipe(mapTo(item))),
    scan((acc,curr:number)=>acc.concat(curr),[])
  )

  }
}

html

    {{ i }}


text:
Q: Using an parameter variable from an advice Aspectj I am making an address book application and I am brand new to aspectj and I am trying to use a variable int inside the aspect but eclipse is saying it "Cannot be resolved to a variable".
What do I need to do to use the variable? Thanks for any help you can give me.
Aspect
before(): execution(* *.deleteAddress(int <--PARAMETER I WANT TO USE))
    {
        fileServices.addXMLToFile(fileServices.makeXML(FileServices.map.get(WHERE I WANT TO PUT THE PARAMETER)), FileServices.ProductionFileName);
    }

Here is the code if that will help
public void deleteAddress(int keyNumber) throws Exception
{
    Address oldAddress = map.get(keyNumber);
    map.remove(keyNumber);
    addXMLToFile(makeXML(oldAddress), BackupFileName);

}

A: You need to use args() in order to bind positional parameters to advice method arguments.

*

*The Spring manual explains that for Spring AOP (which is technically different, but shares a subset of syntax with AspectJ), but they syntax which is rather unusual for beginners, referring to pointcuts defined in in a different class.

*Better read the AspectJ manual which also explains it. I just noticed you use native AspectJ syntax anyway, which means Spring AOP is not your topic. Let me just leave the reference in my answer for Spring AOP users.

In your case the answer - now in native AspectJ syntax again - would be (untested, just texting freestyle):
before(int keyNumber) : execution(* *.deleteAddress(int)) && args(keyNumber) {
  fileServices.addXMLToFile(
    fileServices.makeXML(
      FileServices.map.get(keyNumber)
    ),
    FileServices.ProductionFileName
  );
}


text:
Q: plotting points in 3d surface using x,y,z coordinates I need to plot some points in 3d surface based on x,y,z coordiantes values in a file named as test.dat
test.dat file contains

    At-No                     X           Y           Z
 6                   3.532210   -2.171743    0.921140
 7                   1.164869   -1.418981    0.782133
 1                   2.454732    2.332989   -0.907213
 6                  -3.246376   -1.047325   -0.602590
 6                  -2.620684    0.053348   -0.013310
 6                  -4.569969   -1.249720   -0.617858
 6                  -3.436335    1.003953    0.597094
 1                  -5.328079   -0.323336   -0.025131

First value indicates At-no(Atomic number) , second value indicates x coordinates value, 3rd value indicate y coordinates values and finally 4th value indicate z coordinate value.
I tried Gnuplot
splot "test.dat" u 1:2:3 ps variable pt 7

but it give a blank screen .
I want to display points on 3d surface.... Points with At-no 6 display in red color and 7 with blue and 1 with green.
Is it possible to display points like this
Thanks in Advance................

A: You can use conditional plotting.
splot 'data.txt' u ($1==6 ? $2:1/0):3:4 title 'At-no 6' w points pt 7, \
      'data.txt' u ($1==7 ? $2:1/0):3:4 title 'At-no 7' w points pt 7, \
      'data.txt' u ($1==1 ? $2:1/0):3:4 title 'At-no 1' w points pt

This creates


text:
Q: As opposed to full backups, what files should I backup on Windows Server? I am partly responsible for the uptime of a Windows Server at work. We have only been assigned a small amount of space for backups (50gb or so). This is no way near enough space for backing up .VHDs of the actual server. Instead, the sysadmin says we should just back up important files. I am not sure if he means important system or user files, but either way, this is not really a robust backup strategy. No strategy in terms of media rotation, etc, nothing. I see no value in this - at all.
The server is AD/DNS server, so it has some special considerations. Also, how should I backup AD when there is also a secondary AD on a VM on ESX?
Note: I am a developer but for various reasons (skills gaps, politics), I have the majority of responsibility for doing these sysadmin tasks. I don't mind as I learn a lot, but I have very little support from other people (the sysadmins are very unapproachable so I rely on SE and my trusty books). I am like a semi-professinal system admin and I am an experienced developer. Because I run HyperV at home, this gives me some basic grounding in system administration for Windows Server, thus I am the favourite for all of this.
Thanks
Thanks

A: It sounds like you are doing the backups to some small part of a hard drive, possibly a shared drive. That's not a backup, it's a disaster waiting to bite you where it hurts.
You really should be looking at a proper backup system. i.e. Something that will backup everything you need and allow you to take that away from the thing being backed up, with my preference always being tape. If the company can't or won't pay for such a system at least try to convince them to let you buy a couple of external hard drives for the purpose (rotating them and not relying on any one copy). While I abhor hard drives for backup they are a whole lot better than nothing and if they are external you can at least meet the requirement to separate them from the source.
Above all else, test your backups, regardless of what method to choose to do them.

A: Is the server in question a production server? Is it in fact one of the AD\DNS servers for the company? If so, I find it highly irregular that the sysadmins would have so little concern for it. If that's the case then I have to say that personally, I find it shameful that you're in the position they've left you in.
At the very least, if you have no other recourse, find a way to perform a daily System State backup.
All that being said, if your AD DNS zone(s) are AD integrated and if both servers are also GC's, and this server is not the single point of failure for any other service or application, then technically you could tolerate the failure of this server. You could simply sieze the FSMO roles if neccessary, build a new DC, and be happily on your way.


text:
Q: Render as HTML the line_item.properties data who has HTML values in it on Shopify Admin Orders Hi so I'm wondering If it is possible to render these custom line_items.properties value as HTML in my orders? in shopify, as of now it appears like this when the order is viewed. The object value is not rendering those HTML tags.

I'm using the format below to submit the order onto my Shopify account and I was kinda hoping it will display a View Image link.
properties: {
   sample_image: "View Image"
}

A: I solved it, so what I didn't know by then is that shopify already handle this kind of data. If the lineItem.properties has a value of URL or any kind of link, shopify will automatically add an anchor tag  to it.
So instead of adding an anchor tag  to the lineItem.properties, just use the ordinary link/url and that'll do the job.


text:
Q: Keyboard Problem with Debian testing and gdm3 I'm driving a Debian testing machine that is running fine. But since testing includes Linux Kernel 3 I have the following problem:
While booting all is working (I mean especially the keyboard) - controlled by switching NumLock state. The moment gdm3 starts (from init) the keyboard dies... It can only be reanimated by killing gdm3 (I do this via ssh). Running startx from console behaves fine, thus the "xorg.conf" seems to be fine.
The output from startx reads as
X.Org X Server 1.10.3
Release Date: 2011-07-08
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.0.0-rc6-amd64 x86_64 Debian
Current Operating System: Linux sobolev 3.0.0-1-amd64 #1 SMP Sun Jul 24 02:24:44 UTC 2011 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.0.0-1-amd64 root=UUID=7d005ab3-c823-4cc9-b70a-9316a5eab8d6 ro quiet
Build Date: 07 August 2011  06:45:11PM
xorg-server 2:1.10.3-1 (Cyril Brulebois <kibi@debian.org>)
Current version of pixman: 0.22.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Aug 26 09:19:48 2011
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) [KMS] Kernel modesetting enabled.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
>                   Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server

Any ideas? I'm using a PS/2 keyboard and USB mouse. The mouse is alive under gdm3.

A: This happens typically when you upgrade your Xorg server without upgrading/re-installing the xorg keyboard drivers afterwards. This is contained in a separate package - on Gentoo it is xf86-input-keyboard, on Debian (according to Gilles' comment below) the name should be xserver-xorg-input-kbd . Try upgrading/re-installing it.

Edit : Merged the package name information from Gilles' comment.


text:
Q: Evolution in the interpretation of the Dirac equation As I understand, Dirac equation was first interpreted as a wave equation following the ideas of non relativistic quantum mechanics, but this lead to different problems.
The equation was then reinterpreted as a field equation and it is now a crucial part of quantum field theory.
My question is: could you provide me a reference (paper, book) that explains this evolution, including the different historical steps, etc. ?
I have a good knowledge of QM and I studying field theories, but I would like to have a clearer view on this historical evolution.

A: For the details of the physics involved in the two ways of interpreting the Dirac wave equation I recommend chapters XI and XII of Dirac's "Principles of Quantum Mechanics" 4th edition, and chapters XX and XXI of Messiah's "Quantum Mechanics", vol. II. For the more historical details I recommend chapters 5 and 6 of Crease and Mann's "The Second Creation", chapters 13 and 15 of Pais' "Inward Bound" and the first chapter of Schweber's "QED And The Men Who Made It".

A: I think that the first volume of the series "The Quantum Theory of Fields", by Steven Weinberg, is a good text to understand the origin of Dirac equation, QFT, and all these kind of topics.
Maybe Weinberg's books are not the best for a first course in QFT (or in General Relativity, he has also a great book on this topic), but his great coverage and unique point of view make them very worth reading.

A: @Cedric: It's true that the notion of "fields" (as we have today in QFT) is something that wasn't completely developed at that time. But i never heard that Dirac's Eq was understood as a "wave equation": he was trying to explicitly describe particles (electrons) — besides, the notion that "particles" and "waves" were connected already existed at that time, in the form of von Neumann's "transformation theory" (read: Fourier Transform + distributions). On to of that, people knew that "Matrix Mechanics" (à la Heisenberg) and "Wave Mechanics" (à la Schrödinger) were two sides of the same coin (one being particle-like and the other one being wave-like).
So, before anything else, it'd be nice to corroborate this story of yours. ;-)
In any case, let me give you a couple of references that may shed some light:

*

*An Interpretive Introduction to Quantum Field Theory;

*From the Rise of the Group Concept to the Stormy Onset of Group Theory in the New Quantum Mechanics (PDF, 739Kb).

Hope this helps.

A: If you are interested in the origins, I think you must start the history with Sommerfeld. It is Sommerfeld who gets the fine structure levels, via an amazing cancellation of two mistakes (Bohr-Sommerfeld quantisation and lack of spin). So Dirac is sailing with a clear goal: his results must agree with Sommerfeld in some way. And of course Sommerfeld orbits are already the relativistic correction to Bohr orbits.
If you are more worried about the evolution towards field theory, I'd add Sakurai books to the Bjorken-Drell lot. Also Mandl.

A: I recommend J.D. Bjorken, S.D. Drell, Relativistic Quantum Mechanics.
I think this book can provide smooth introduction into Dirac equation - the book is almost dedicated to it. At the same time I discourage starting with Quantum Field Theory before learning Dirac equation - the conceptual step may be way to difficult.

A: In my opinion, a good introductory text for  Relativistic Quantum Mechanics is Quantum Field theory- by Itzykson and Zubor. Another text is Relativistic quantum mechanics of string fields by - Greiner and Muller

A: Although not directly relevant to your question, it is helpful to compare the different editions of Dirac's Principia.  He revised his treatment of QED every time, and such an evolution must shed light on the evolution of the Dirac eq. from a one-particle eq. to its current status as a QFT equation.  I cannot quite recommend any of Greiner's books, although i myself consult them all the time, I have the distinct impression ..... there is a kind of vagueness about his style which contrasts badly with the styles of the other texts that the posters here have recommended. I fear that that is a symptom of something.


text:
Q: SQLAlchemy ORM: modify the columns returned from a query If I've got an SQLAlchemy ORM query:
admin_users = Session.query(User).filter_by(is_admin=True)

Is it possible to modify the columns returned by that query?
For example, so that I could select only the User.id column, and use that in a sub query:
admin_email_addresses = Session.query(EmailAddress)\
    .filter(EmailAddress.user_id.in_(admin_users.select_columns(User.id))

Note: the .values() method will not work, as it executes the query and returns an iterable of results (so, ex, EmailAddress.user_id.in_(admin_users.values(User.id)) will perform two queries, not one).
I know that I could modify the first query to be Session.query(User.id), but I'm specifically wondering how I could modify the columns returned by a query.

A: Assuming that your Address.user_id defines a ForeignKey, the query below will do the job more efficiently compared to IN operator:
admin_email_addresses = session.query(EmailAddress).\
    join(User).filter(User.is_admin==True)

If you do not have a ForeignKey (although you should), you can specify the join condition explicitely:
admin_email_addresses = session.query(EmailAddress).\
    join(User, User.id==EmailAddress.user_id).filter(User.is_admin==True)

But if you really would like to do it with in_ operator, here you go (note the subquery):
subq = session.query(User.id).filter(User.is_admin==True).subquery()
admin_email_addresses = session.query(EmailAddress).\
       filter(EmailAddress.user_id.in_(subq))

A: I feel your pain on the values() thing.   In 0.6.5 I added with_entities() which is just like values() except doesn't iterate:
q = q.with_entities(User.id)


text:
Q: How Do I add the distinct statement to my query? This is my code:
$statusTable = $dbHelper->getTableName("mp_os_statuses");

        $this
            ->getSelect()
            ->joinInner(array('status'=>$statusTable), "status.value = main_table.status")
            ->order("status.position ASC")
            ;

I actived the sql logs I executed the latest query and I saw that I have 2 entity_ids with the same value. As a result I get the error message:
 with the same id "27" already exist

So I search over the internet that I should add a distinct statement to my query. How can I do that ? thx
UPDATE  This is the query from the log:
SELECT `main_table`.*, `status`.* FROM `mp_os_state_status` AS `main_table`
 INNER JOIN `mp_os_statuses` AS `status` ON status.value = main_table.status WHERE (main_table.state = 'payment_review') ORDER BY `status`.`position` ASC

A: I should added the group by condition, not distinct:
        $this
            ->getSelect()
            ->joinLeft(array('status'=>$statusTable), "status.value = main_table.status")
            ->group('entity_id')
            ->order("status.position ASC")
            ;


text:
Q: Django: too many values to unpack (expected 2) I am new in Django.
In my Django view.py, I have following get method: customer_list = Customer.objects.filter(CustId = '1001') and it returns result.
When I substitute with a String like following:
getQueryString = "CustId = '1001'"
customer_list = Customer.objects.filter(getQueryString)

I get the following error:

too many values to unpack (expected 2)

Any help really appreciated.

A: Hi @Deysgroup if you want send like that you can use getQueryString={'CustId': '1001'} and then call the function using customer_list = Customer.objects.filter(**getQueryString), I hope that this answer helps you.

A: Have you tried using a dict?
Take a look at this question, perhaps it can help you understand your problem.
getQueryString = {'CustId': '1001'}
customer_list = Customer.objects.filter(**getQueryString)


text:
Q: "Substring" a Numeric Value In C#, what is the best way to "substring" (for lack of a better word) a long value.
I need to calculate a sum of account numbers for a trailer record but only need the 16 least significant characters.
I am able to this by converting the value to string but wondered if there is a better way in which it can be done.
long number = 1234567890123456789L;
const long _MAX_LENGTH = 9999999999999999L;

if (number > _MAX_LENGTH)
{
  string strNumber = number.ToString();
  number = Convert.ToInt64(strNumber.Substring(strNumber.Length - 16));
}

This will return the value 4567890123456789.

A: You could do:
long number = 1234567890123456789L;
long countSignificant = 16;
long leastSignificant = number % (long) Math.Pow(10, countSignificant);

How does this work? Well, if you divide by 10, you drop off the last digit, right? And the remainder will be that last digit? The same goes for 100, 1000 and Math.Pow(1, n).
Let's just look at the least significant digit, because we can do this in our head:

1234 divided by 10 is 123 remainder 4

In c#, that would be:
1234 / 10 == 123;
1234 % 10 == 4;

So, the next step is to figure out how to get the last n significant digits. It turns out, that that is the same as dividing by 10 to the power of n. Since c# doesn't have an exponent operator (like ** in python), we use a library function:
Math.Pow(10, 4) == 1000.0; // oops: a float!

We need to cast that back to a long:
(long) Math.Pow(10, 4) == 1000;

I think now you have all the pieces to create a nice function of your own ;)

A: You could use modulo (the % operator in C#). For example:
123456 % 100000 = 23456

or
123456 % 1000 = 456

As a quick guide I keep remembering that you get as many digits as there are zeros in the divisor. Or, vice versa, the divisor needs as many zeros as you want to keep digits.
So in your case you'd need:
long number = 1234567890123456789L;
long divisor = 10000000000000000L;
long result = number % divisor;

A: Complete Code, use modulo operator:
long number = 1234567890123456789L;
const long _MAX_LENGTH = 9999999999999999L;

number = number % (_MAX_LENGTH + 1);

Console.WriteLine (number);

Live test: http://ideone.com/pKB6w

Until you are enlightened with modulo approach, you can opt for this one instead for the meantime:
long number = 1234567890123456789L;
const long _MAX_LENGTH = 9999999999999999L;

if (number > _MAX_LENGTH) {
    long minus = number / (_MAX_LENGTH +  1) * (_MAX_LENGTH +  1);
    number = number - minus;
}

Console.WriteLine(number);

Live test: http://ideone.com/oAkcy

Note:
Strongly recommended, use modulo approach, don't use subtraction. Modulo approach is the best, no corner case, i.e. no need to use if statement.


text:
Q: Android WIFI_STATE_CHANGE and STATE_CHANGE fire many times I have a BroadcastReceiver, I use it to know if the phone is connected to Internet via WiFi.
I use it this way
<receiver android:name=".InternetReceiver" >
   <intent-filter android:priority="0">
       <action android:name="android.net.wifi.WIFI_STATE_CHANGED"/>
       <action android:name="android.net.wifi.STATE_CHANGE"/>
   </intent-filter>
</receiver>

In the InternetReceiver class, I have the code
@Override
public void onReceive(Context context, Intent intent) {
    this.context = context;
    this.intent = intent;

    ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);

    if (mWifi != null && mWifi.isAvailable())
    {
        if (mWifi.isConnected())
        {
            Handler h = new Handler()
            {
                @Override
                public void handleMessage(Message msg)
                {
                    if (msg.what == 1)
                    {
                        getData(1);
                    }
                    else
                    {
                        Log.e("Spygen", "No Internet connection");
                    }
                }
            };

            new InternetChecker().isNetworkAvailable(h, 3000);
        }
    }
}

Until now, all seems to be perfectly working. Except that, the method getData(1) is fired 3 times simultaneously. In other words, the BroadcastReceiver gets the wifi state changes 3 times.
I passed all day trying to solve it, I tried to use SharedPreferences, but it's not working, since every time the Receiver gets the event, it starts a new AsyncTask, which makes changing SharedPreferences impossible, until all background tasks are done.
What I really want, is firing getData(1) once. Is that anyway to stop receiving after the first call?
Any ideas will be very appreciated
Thank you

A: i think it is better to confirm what state you want to fire getData. Not just rely on the broadcast. As enabling, disabling and any small changes will fire the broadcast. For eg, getWifiState() == WIFI_STATE_ENABLED.


text:
Q: Selenium Framework If an interviewer asks, "Explain about Selenium Framework," What points do we need to focus on?
Do we need to explain about JUNIT or testNG (whichever we are using on our project) or the process we are following in our test automation?

A: Selenium is an automation tool. This is different to a testing tool, though automation tools are commonly used for testing purposes.
If I were interviewing you, I would probably want to know about:

*

*difficulties you'd encountered in setting up your tests using
Selenium and how you overcame them;

*whether you recorded tests using
the IDE or wrote them using WebDriver or a mixture of the two, and
why you made that decision;

*how you structured your tests to keep
them maintainable and easy to understand;

*whether you used automated tests to engage the business and get developers, testers and analysts talking

*your thoughts on the difference between Selenium and its other competitors like QTP.

Selenium tests usually focus on the full system rather than units of code, so you're more likely to get questions about BDD tools like JBehave or Cucumber than lower-level unit testing tools like JUnit or TestNG. Having said that, there's no reason why you can't use unit-testing tools with a DSL to run scenarios, so be prepared to answer questions on whichever approach you've taken or would recommend.


text:
Q: Texmaker: Is there a way to compile main.tex eventhough some child-texfile is opened in the editor? The main.tex file in my project is the one to be opened in editor view in order to successfully compile the pdf-document. It has several child-files like e.g. content.tex where I write the actual thesis text.
Every time I want to compile the document in order to view the changes I have to change the editor-file to main.tex. Otherwise the process ends with errors.
I already tried the Ctrl+0 base file setting, but it did not show any changes.
The LaTeX project is based on a template provided by my university and though has to stay untouched in regards of the project structure itself (why so ever...).

A: I managed to do as I strived to. Don't know whether I'd just been too clumsy or if it relates to the problems I faced during the \input{...} integration, but if anyone wonders how to do so too:
It in fact has been the way I already tried - set the main-document to master-document.
Nevertheless I switched to use TexStudio meanwhile.
Thank you for your response @Gowachin