text:
Q: A contradiction in the Babinet principle, an even more mysterious phase difference This is a continuation of a previous question I asked..
So, as we know the Babinet principle states that the superposition of the screen and its complement is the same as the unobstructed light.
This was all fine and dandy until Wikipedia also went on to say that the phase difference between the complementary systems are $\pi$ [Link].(https://en.wikipedia.org/wiki/Babinet%27s_principle#:~:text=In%20physics%2C%20Babinet's%20principle%20states,by%20French%20physicist%20Jacques%20Babinet.)
I initially understood the phase difference of $\pi$ as follows:
We have a pattern from screen $S$ and its complementary $S'$, when we superimpose both of them, we have complete darkness as it would be complete obstruction. However, when I thought more about this argument, more it felt absolutely bogus. We are superimposing the light, we cannot just superimpose obstacles, by that logic in YDSE. If one slit was covered and other was not and vice-versa, their superposition is that both are open, not both are closed. So, we should superimpose the un-obstructed part of the light, not the obstructed part.
Now, the Wikipedia article on Babinet is exactly contradictory to what i said

The explanation is relatively simple. Suppose that B is the original diffracting body and B' is its complement, i.e. a transparent body where B is opaque and opaque where B is transparent. The sum of the radiation patterns caused by B and B' must be equal to the radiation pattern of the unobstructed beam.

The above statement agrees with my logic that we care about the un-obstructed part, and so the super-position should be completely dark.
However it also said:

The radiation patterns produced by B and B' must therefore be opposite in phase, but equal in amplitude.

Doesn't that mean the superposition is completely dark? If that's the case then how is the statement that is below is correct, isn't it contradicting?

The sum of the radiation patterns caused by B and B' must be equal to the radiation pattern of the unobstructed beam.

For an obstructed wavefront, it will happily move without any issues, so how did it all of a sudden become dark?
The phase difference $\pi$ seemed a bit slimy and mysterious to me. I don't see a mistake in my argument that the superposition of complementary systems should be the case where there is no obstruction.

A: The sum of the patterns caused by B and B' is not complete darkness. It is, like the article says, the pattern caused by the unobstructed beam. If you shine a laser beam on a slit (object B) and its complement (object B') for example, the sum of the two patterns on the screen would be just the laser spot. Note that the screen will be dark outside of this central beam, meaning the sum of the patterns due to B and B' cancel except on this central beam. This is also what the article says, if you include the part you left out in your question:

In places where the undisturbed beam would not have reached, this means that the radiation patterns caused by B and B' must be opposite in phase, but equal in amplitude.


text:
Q: generate multiple pin in specific distance in MKMapView I have one view controller with MKMapview and one array of multiple latitude and longitude. I want to show pin in map with in 5 mile distance from user location. How do I implement it?

A: Put this code in viewdidLoad method and give distance filter where you want to update your location
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.distanceFilter = kCLDistanceFilterNone;
/* Pinpoint our location with the following accuracy:
 *
 *     kCLLocationAccuracyBestForNavigation  highest + sensor data
 *     kCLLocationAccuracyBest               highest
 *     kCLLocationAccuracyNearestTenMeters   10 meters
 *     kCLLocationAccuracyHundredMeters      100 meters
 *     kCLLocationAccuracyKilometer          1000 meters
 *     kCLLocationAccuracyThreeKilometers    3000 meters
 */
    [locationManager startUpdatingLocation];

Drop pin annotation.
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
    MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userLocation.coordinate, 800, 800);
    [self.mapView setRegion:[self.mapView regionThatFits:region] animated:YES];

    // Add an annotation
    MKPointAnnotation *point = [[MKPointAnnotation alloc] init];
    point.coordinate = userLocation.coordinate;
    point.title = @"Where am I?";
    point.subtitle = @"I'm here!!!";

    [self.mapView addAnnotation:point];
}

Hope this will help you...

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why Javascript Object value is changing incase of keys in object but not variables? I am new to JS , I am trying to execute the following code and log the out put
var name ="xyz";
var age =10;
var location ={office:"US",home:"CA"};

function callFn(name,age, location){
    name = "abc";
    age =20 ;
    location['office']="new office location";
}
callFn(name, age, location);
console.log(name, age, location['office']);

The output is "xyz", 10 , "new office location";
Why the name , age values are not chaning but key values inside object are changing ? IN other languges like java it will assign new values to name and age also


text:
Q: Remove multiple rows with specific string values I have a data frame with a few hundred columns. I would like to remove the rows for selected columns with the values "Item skipped" or "".
See below for example. Ideally I would like to remove all rows in which the columns 'animal' and 'Insurance' contain "Item skipped" or "", but do not want this to apply to other columns.
In my actual data frame there are about 34 columns where I want to remove the columns with these strings and 128 where I do not. Advice would be greatly appreciated.
dat <- data.frame(animal=c("dog","cat","Item skipped", ""), Insurance=c("Y", "N","Item skipped",""), condition = c("",
                  "Asthma","Item skipped",""), age = rep(c(6,10), each = 2))

A: You can use filter_at with selected columns or range of columns
library(dplyr)

dat %>%
  filter_at(vars(animal,Insurance), all_vars(!. %in% c("Item skipped", "")))

#  animal Insurance condition age
#1    dog         Y             6
#2    cat         N    Asthma   6

Or with base R you could use rowSums
cols <- c('animal', 'Insurance')
dat[rowSums(dat[cols] == "Item skipped" | dat[cols] == "") == 0, ]

A: In base R without a for loop:
dat[!rownames(dat) %in% which(dat$animal %in% c("Item skipped", "") | dat$Insurance %in% c("Item skipped", "")), ]`

A: You could always do this with a for loop, especially since your dataset is smallish.
> remove_cols <- c('animal', 'Insurance') # vector of names of all columns you'll use to drop rows
> remove_vals <- c('', 'Item skipped') # values which indicate a row that should be dropped
>
> for(col in remove_cols){
+   dat <- dat[!dat[[col]] %in% remove_vals, ]
+ }
>
> head(dat)
  animal Insurance condition age
1    dog         Y             6
2    cat         N    Asthma   6

A: Using R base without need of applying more packages:
# Find rows that match content of 2 column cell values.
rows_to_delete <- which(dat$animal == "Item skipped" & dat$Insurance == "Item skipped")

# Delete row.
# Add result in new dataframe [dat2].
# Keep old dataframe for comparison [dat].
dat2 <- dat[-rows_to_delete, ]


text:
Q: C++ using static array in base class, declaring in derived class I'm trying to create a few classes which all are derived classes from an abstract class (lets call it) BaseClass. In BaseClass I want to operate on static variables (arrays) declared in derived classes. Is there a clever way in C++ to let the compiler know that static variable will be declared in derivered class? Or should I,  for instance, in my derived classes' constructors pass a reference to a static variable to base class construct? This is my idea:
class BaseClass
{
   std::vector<float> &vector;

public:
   BaseClass(std::vector<float> &dVector):vector(dVector){};

   void vectorOperation()
   {
       vector.doSomething();
   }
   ...
}

class DerivedClass : public BaseClass
{
   static std::vector<float> sVector;
   DerivedClass():BaseClass(sVector){};
   ...
}

Is my solution correct? Is there any better way to do this?

A: You could use the CRTP pattern but I am not convinced it is better than what you have.
template <typename Derived>
class BaseClass
{
   std::vector<float> &vector;

public:
   BaseClass(): vector(Derived::getVector()){};

};

class DerivedClass : public BaseClass<DerivedClass>
{
   public:

   static std::vector<float>& getVector()
   {
      static std::vector<float> v;
      return v;
   }

   DerivedClass() {};
};

A:
In BaseClass I want to operate on static variables (arrays) declared in derived classes.

A virtual instance member function can delegate the work to an override from a derived class, which could do the access for you. There is no way of doing it in the static context (it does not look like you are trying to do it, though).

should I, for instance, in my derived classes' constructors pass a reference to a static variable to base class constructor?

This can be a solution as well. However, all instances of the derived class would be accessing the same static data region, and need to store a reference to it.
A solution based on a virtual function does not require an additional storage for a reference to the vector:
class BaseClass
{
protected:
   virtual std::vector<float>& vector() = 0;

public:
   void vectorOperation()
   {
       vector().doSomething();
   }
   ...
};

class DerivedClass : public BaseClass
{
   static std::vector<float> sVector;
protected:
    std::vector<float>& vector() { return sVector; }
   ...
};


text:
Q: XSLT2 - Get text of all nodes except certain ones I'm trying to get the text of a whole HTML looking document but I would like to exclude certain nodes from the retrieval.
XML

some text

some text <alt>alt title</alt>

some text

Context
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xsl:template match="/">

         <xsl:for-each select="collection(...)">
           <xsl:variable name="text" select="string(//body)" />

                 <xsl:value-of select="$text"/>

          </xsl:for-each>

  </xsl:template>
</stylesheet>

Expected result
I want everything but the alt element so some text*3 = 29 in this example.
I am doing this operation from a for-each on a collection of file.
So right now I just do a string(/body) to get everything in each of my file.
I was thinking of a recursive call:
 <xsl:function name="lp:gettext">
    <xsl:param name="n" />
    <xsl:choose>
      <xsl:when test="$n/child::node()">
        <xsl:value-of select="concat(text(),lp:gettext($n/child::node()))" />
      </xsl:when>
      <xsl:when test="$n/name()='alt'" />
      <xsl:otherwise>
        <xsl:value-of select="text()" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:function>

But I can't seem to use child:: in a function it seems, or not like I do.
How can I achieve what I want to do?

A: Applying the following stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:template match="alt"/>

</xsl:stylesheet>

to your input (after closing the img tag!) returns:
<?xml version="1.0" encoding="UTF-8"?>
some textsome text some text

This is because the built-in template rules copy all text nodes to the output - so all you need to do is override the default behaviour for the nodes you don't want to be copied.

Added:
Based on the stylesheet you have added to your question, I believe the following should do what you want (I cannot test it):
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>

<xsl:template match="/">

                        <xsl:apply-templates select="collection(...)"/>

</xsl:template>

<xsl:template match="alt"/>

</xsl:stylesheet>

A: Ok, i just found this remove-elements-deep function that seems to do exactly what I want.


text:
Q: Create FK relationship during migration On migration I need to create a relationship between activity and organisation where organisation has not been created. Below is what I have so far. I now need so somehow set the default= to the new organisation created? i.e.
field=models.ForeignKey(related_name='activities', to='orss.Organisation' default=temp_org_just_created

Is this possible? If so how?

A: There are two types of migrations, schema and data migrations. You'll need to run your schema migration first, and the data migration afterwards.
Documentation


text:
Q: What is the best practice or storing constants in SAPUI5? I wonder what's the best practice is for storing costants (strings, numbers or URIs) in SAPUI5. I guess it's not recommended to just put them in the views or controllers.  I'm thinking about to go with the i18n. or to create a viewmodel. or to create a new .json file. if it should be best practice to create a .json model for it, then would be the next question, where to put this .json file in the standard folder structure of a SAPUI5 project.

A: SAPUI5 is based off the Asynchronous Module Definition so we can simply create a module definition that houses all of our constants, much like similiar patterns we see in other scaffolds like CRA and angular-cli.
So we could create a file called Constants.js in our webapp folder and then add our URLs and other constants as such:
// webapp/Constants.js
sap.ui.define([],
function() {
    'use strict';

    var constants = {
        BASE_URL: 'http://localhost:8080',
        SOME_API_PATH: '/api/some',
        REQUEST_HEADERS: {
            'X-XSRF-TOKEN': 'something-else'
        },
        ANOTHER_CONSTANT: 'something'
    };

    return constants;
});

We then can import the constants wherever we need to by adding it to the dependency array:
// SomeController.js
sap.ui.define([
    '<PROJECT_NAME>/Constants'
], function(Constants) {
  console.info(Constants.BASE_URL);
});

.env Files would also be an option for environmental based constants, however, that's outside the scope of your question I think.

A: currently I use a local sap.ui.model.json.JSONModel to store static URLs.
folder structure
webapp
--controller
--i18n
--localService
--model
--test
--util // into the util folder goes the url.json
----url.json
--view

url.json
[{
  "my_url_name": "my_url"
},
{
  "my_other_url_name": "my_other_url"
}]

View.controller.js
...
onInit: function(oEvent) {
  ...

  // set model to view
  var sPath = jQuery.sap.getModulePath("myAppNameSpace.util", "/url.json");
  var oModel = new JSONModel(sPath);
  this.getView().setModel(oModel, "url");

  // use model
  var sMyUrl = this.getView().getModel("url").getProperty("/my_url_name");

  ...
}
...


text:
Q: Сan you explain why I get an error globalizing a variable? Hey!
This relates to problem 18 from Euler's project (https://projecteuler.net/problem=18)
This code solved it, but I got an error (4th line):
Undefined variable: 'ans'Python(undefined-variable)

So, I want to understand why this happened
Also, let me know, if there are any flaws in my code
Thanks in advance
def brute(i, j, sum):
    global ans
    if i > len(l) - 1:
        if sum > ans:
            ans = sum
        return None
    brute(i + 1, j, sum + l[i][j])
    brute(i + 1, j + 1, sum + l[i][j])

l = [
    [75],
    [95, 64],
    [17, 47, 82],
    [18, 35, 87, 10],
    [20, 4, 82, 47, 65],
    [19, 1, 23, 75, 3, 34],
    [88, 2, 77, 73, 7, 63, 67],
    [99, 65, 4, 28, 6, 16, 70, 92],
    [41, 41, 26, 56, 83, 40, 80, 70, 33],
    [41, 48, 72, 33, 47, 32, 37, 16, 94, 29],
    [53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14],
    [70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57],
    [91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48],
    [63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31],
    [4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23],
]
ans = 0
brute(0, 0, 0)
print(ans)

A: IMHO this is not a good use-case for globals, would be better to refactor the code like so:
def brute(i, j):
    if i > len(l) - 1:
        return 0
    return l[i][j]+max(brute(i + 1, j), brute(i + 1, j + 1))

I've flipped the logic around to accomplish though, the code works by picking the maximum sum from its subtree
You ideally want to save usage of global variables for system-wide settings and such


text:
Q: Using Microsoft.CrmSdk.XrmTooling.CoreAssembly in .netstandard1.6 class library Are Dynamics CRM SDK assemblies compatible with the new .netstandard1.6 or older standards? I'm trying to use the Microsoft.CrmSdk.XrmTooling.CoreAssembly nuget package in a .netstandard class library. Are there any plans to make those libraries compatible with .netstandard 1.6 or 2.0 in future. Could not find the answer anywhere.

A: Currently no they only support .net 4.5. They may support .netstandard at some point in the future, but that would be speculation.
An easy way to tell currently is by looking at the NuGet package page and checking dependencies. For example another package CSVHelper supports .netstandard

While the SDK tooling package does not


text:
Q: Multiple subsequent writes to sysfs cause invalid module behavior. How to workaround? my team is writing software interacting with a Linux kernel module. We write to sysfs to manage the module. Recently, we've been battling a problem in which the module occasionally does not behave as expected.
One of my colleagues noticed that if we put a sleep between
subsequent writes to sysfs, the problem does not occur. This probably means that after the first write the module needs some time to do some additional processing, and our code should wait until it's done before performing the second write.
I really don't want to put a random sleep in the code. However, we have virtually no experience with kernel space. Is there a way to detect that the kernel module is busy doing the additional processing? To track activity of the module? Especially a programmatic way, that we could use instead of sleep-ing some predefined interval?
Unfortunately, my NDA prevents me from going into details about which module and which sysfs files we interact with.


text:
Q: Laravel - Has Relationship Through Let's say I have three tables:
1. Server
-------
id
name

2. Player
-------
id
name
ServerId

3. Activity
-------
id
PlayerId
action
time

How would I use Laravel's hasManyThrough to able to get a list of activity from a server's players like so $system->activity?

A: You can use it as follows:
// this should be inside your Server model.
public function activities()
{
    return $this->hasManyThrough(
        Player::class,
        Activity::class,
        'PlayerId', // Foreign key on activities table...
        'ServerId', // Foreign key on players table...
        'id', // Local key on servers table...
        'id' // Local key on activities table...
    );
}

This will give you all the server activities through the player.


text:
Q: Ping remote computer from another remote computer and get result back I'm trying to get a batch script to work whereby I get computer A on which my script is running to get computer B to ping computer C and get back an errorlevel that I can output.
At the moment i'm trying to do this by using PSEXEC to access command line on computer B and getting it to ping C. the issue of course is that the errorlevel always comes back as "0" since the command is successfully executing on B. but it is the result from C that I need.
SET /P ALTTERM=Please specify another terminal to test from [0**]?
ECHO.
ECHO Running internal ping test from terminal %ALTTERM%...
PSEXEC \\%HOSTNAME%-%ALTTERM% PING %HOSTNAME%-%TERMINAL%
IF ERRORLEVEL 0 SET INTERNALPING=PASS
IF ERRORLEVEL 1 SET INTERNALPING=FAIL
ECHO.
ECHO Internal ping test %INTERNALPING%

The details for the hostname and terminal as set earlier in the script.
It's also important that the script not display the workings only show the echo lines and result. I have used

/f >nul 2>&1

elsewhere in the script to suppress output

A: According to Windows IT Pro (referred in Microsoft TechNet):

PsExec displays the process's exit code and returns the exit code as
  its own exit code.

So, your batch should work.
Put ECHO ErrorLevel=%ERRORLEVEL% after PSEXEC ... just to get sure.
To disable outputing, append >NUL 2>NUL or >NUL 2>&1 to PSEXEC ... command-line. Without /f as you used (where did you get it???)


text:
Q: How to add underline for EditText? How to customize the underline of EditText as shown below?

A: You can do something like this
    <EditText
            android:id="@+id/editRemarks"
            android:layout_below="@+id/addNoteRemarks"
            android:gravity="left"
            android:layout_centerHorizontal="true"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@drawable/edit_text_shape"/>

and below is the drawable file  "edit_text_shape"
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
    <shape android:shape="rectangle">
        <!-- Draw a 2dp width border around shape -->
        <stroke
            android:color="@color/viewfinder_laser"
            android:width="2dp"
            />
    </shape>
</item>
<!-- Overlap the left, top and right border using background color  -->
<item
    android:bottom="2dp"
    >
    <shape android:shape="rectangle">
        <solid android:color="@color/white"/>
    </shape>
</item>


text:
Q: JDK Logger Vs Log4j I have used Log4j and JDK Logger both for logging purpose, so i find it same as implementation. But now,  i have to write a logging framework, which will help logging.
I think that JDK Logger is faster than Log4j, but Log4j is more flexible than JDK Logger. I am very confused which one to use.
My requirement, to log at multiple levels depending upon the user credentials, business logic complexity and database access layers, and service levels. Intimate the admin for any exception occurred. and much many more requirements.
Thanks.
UPDATE:
I just read in the log4j documentation, that log4j is capable of sending emails, whenever there is an error and/or exception. So, how to configure that.

A: The most important performance difference will be what device(s) you write to.  The framework is likely to irrelevant.  I suggest you use the built in Logger unless you need the features provide by log4j.
If you are writing specialised application level logging, why not write straight to a file or database or JMS as appropriate?


text:
Q: How to bind a GridColumn to the index value of an ObservableCollection? I have a DevExpress GridControl that uses an ObservableCollection of type Student as its ItemsSource.
My GridControl has four columns
Name
ID
Favorite Subject
GPA

Name, Favorite Subject, and GPA are properties of a Student, so they are accurately binding.
The issue is, I do not want to have a property for ID for a Student. I want to set the ID to be  1 + the index of the Student instance in the ObservableCollection of Students hosting the GridControl.
So if I had three Students the ID column will read as
1
2
3

I suspect I will need an ObservableCollection of type Ints in my View Model but I am unable to use a different ItemsSource for the ID Column. I can only reference the Parent ItemsSource of the GridControl. Since the ItemsSource is an ObservableCollection of type Student and ID is not a property of Student, I can't seem to set the column to the appropriate values (mentioned above).
<dxg:GridControl Style="{StaticResource StudentsGridControl}"
                                 ItemsSource="{Binding StudentsCollection}" SelectedItem="{Binding SelectedStudent}">
                    <dxg:GridControl.Columns>
                        <dxg:GridColumn Width="200" HorizontalHeaderContentAlignment="Center" Binding="{Binding Name, UpdateSourceTrigger=PropertyChanged}">
                            <dxg:GridColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="Student Name" Style="{StaticResource BaseColumnHeaderStyle}"/>
                                </DataTemplate>
                            </dxg:GridColumn.HeaderTemplate>
                            <dxg:GridColumn.HeaderStyle>
                                <Style TargetType="Control">
                                    <Setter Property="Background" Value="#22322"/>
                                </Style>
                            </dxg:GridColumn.HeaderStyle>
                        </dxg:GridColumn>
                        <dxg:GridColumn Width="50" HorizontalHeaderContentAlignment="Center"
Binding= // This is the ID Column
                       <dxg:GridColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="ID" Style="{StaticResource BaseColumnHeaderStyle}"/>
                                </DataTemplate>
                            </dxg:GridColumn.HeaderTemplate>
                            <dxg:GridColumn.HeaderStyle>
                                <Style TargetType="Control">
                                    <Setter Property="Background" Value="#123453"/>
                                </Style>
                            </dxg:GridColumn.HeaderStyle>
                        </dxg:GridColumn>
                        <dxg:GridColumn Width="230" HorizontalHeaderContentAlignment="Center" Binding="{Binding FavoriteSubject, UpdateSourceTrigger=PropertyChanged}">
                            <dxg:GridColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="Favorite Subject" Style="{StaticResource BaseColumnHeaderStyle}"/>
                                </DataTemplate>
                            </dxg:GridColumn.HeaderTemplate>
                            <dxg:GridColumn.HeaderStyle>
                                <Style TargetType="Control">
                                    <Setter Property="Background" Value="#52648F"/>
                                </Style>
                            </dxg:GridColumn.HeaderStyle>
                        </dxg:GridColumn>
                        <dxg:GridColumn Width="50" HorizontalHeaderContentAlignment="Center" Binding="{Binding GPA, UpdateSourceTrigger=PropertyChanged}">
                            <dxg:GridColumn.HeaderTemplate>
                                <DataTemplate>
                                    <TextBlock Text="GPA"Style="{StaticResource BaseColumnHeaderStyle}"/>
                                </DataTemplate>
                            </dxg:GridColumn.HeaderTemplate>
                            <dxg:GridColumn.HeaderStyle>
                                <Style TargetType="Control">
                                    <Setter Property="Background" Value="#52658F"/>
                                </Style>
                            </dxg:GridColumn.HeaderStyle>
                        </dxg:GridColumn>
                    </dxg:GridControl.Columns>
                    <dxg:GridControl.View>
                        <dxg:TableView Style="{StaticResource StudensTable}"/>
                    </dxg:GridControl.View>
                   </dxg:GridControl>

A: As one of solutions you can use MultiBinding for it and find an index or what ever you want in a MultiValueConverter:
public class MValConv : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                if(values[0] == DependencyProperty.UnsetValue || values[1] == DependencyProperty.UnsetValue)
                return -1;
                if (values.Length == 2 && values[0] is ObservableCollection<Student> ocol && values[1] is Student st)
                {
                    return (ocol.IndexOf(st) + 1).ToString();
                }
            }
            catch (Exception)
            {
            }
            return Binding.DoNothing;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException("one way only");
        }
    }

<Window.Resources>
    <local:MValConv x:Key="MValCnv"/>
</Window.Resources>

<dxg:GridColumn.Binding>
    <MultiBinding Converter="{StaticResource MValCnv}">
        <Binding Path="DataContext.StudentsCollection" RelativeSource="{RelativeSource AncestorType=dxg:GridControl}"/>
        <Binding/>
    </MultiBinding>
</dxg:GridColumn.Binding>

Hmm, if it is bug by DevExpress, then you could may be try to use regular binding + ValueConverter with a dependency property for the collection.

A: Just create a StudentViewModel for your Student class, don't forget to change your StudentsCollection to be an ObservableCollection<StudentViewModel>. ViewModels are used to avoid binding Models directly to the View, it also allows you to declare other properties without affecting your Model, like an ID in this case.
Let's pretend this is your Student class :
public class Student
{
    public string Name { get; set; }
    public string FavoriteSubject { get; set; }
    public string GPA { get; set; }
}

Your StudentViewModel could be something like this :
public class StudentViewModel
{
    private Student _student;

    public StudentViewModel(Student student, int id)
    {
        _student = student;
        ID = id;
    }

    public int ID { get; set; }

    public string Name
    {
        get { return _student.Name; }
        set { _student.Name = value; }
    }

    public string FavoriteSubject
    {
        get { return _student.FavoriteSubject; }
        set { _student.FavoriteSubject = value; }
    }

    public string GPA
    {
        get { return _student.GPA; }
        set { _student.GPA = value; }
    }
}


text:
Q: What good open source programs exist for fuzzing popular image file types? I am looking for a free, open source, portable fuzzing tool for popular image file types that is written in either Java, Python, or Jython.
Ideally, it would accept specifications for the fuzzable fields using some kind of declarative constraints.  Non-procedural grammar for specifying constraints are greatly preferred. Otherwise, might as well write them all in Python or whatever.
Just specifying ranges of valid values or expressions for them.  Ideally, it would support some kind of generative programming to export the fuzzer into various programming languages to suit cases where more customization was required.
If it supported a direct-manipulation GUI for controlling parameter values and ranges, that would be nice too.
The file formats that should be supported are:

*

*GIF

*JPEG

*PNG

So basically, it should be sort of a toolkit consisting of ready-to-run utility, a framework or library, and be capable of generating the fuzzed files directly as well as from programs it generates.  It needs to be simple so that test images can be created quickly.  It should have a batch capability for creating a series of images.  Creating just one at a time would be too painful.
I do not want a hacking tool, just a QA tool.  Basically, I just want to address concerns that it is taking too long to get commonplace image rendering/parsing libraries stable and trustworthy.

A: Peach has a file fuzzing module. Here is an excellent quick start tutorial for using the file fuzzing module to attack mplayer using a sound file: http://peachfuzzer.com/TutorialFileFuzzing
I recommend focusing on the file's header.

A: Not exactly what you are asking for, but for getting quick up and running some fuzz tests for file formats, you should check out Radamsa from OUSPG, Oulu University Secure Programming Group.
Radamsa can take bunch of files, for example jpeg files, and turn those into fuzzed images. It can also learn some structure from multiple files, so it's not just random bit flipping of bits and bytes.
It's also really cool that Radamsa can listen on TCP socket. That way you can use a script to connect to Radamsa to receive one fuzzed file per connection.

A: Okay, I don't think it has a ready-to-run utility, but people use PIL (Python Imaging Library) to generate captchas all the time, so it can probably fuzz images. (At least, assuming that my definition of "fuzz" is correct and that what you mean is adding random noise to an image for some purpose.)
Of course, all your talking about ready-to-run utilities and generating programs to fuzz images is confusing me. What I'm wondering is, why is all that necessary? What use-case do you have for wanting a program that can make programs to fuzz images when most practical concerns could be solved by simply writing a script that loads an image and does the fuzzing using PIL?

A: You might want to consider 'bringing in the Gimp!' [ to paraphrase Pulp Fiction there...]
http://www.gimp.org/docs/python/index.html


text:
Q: $_FILES['image']['type'] not filtering properly My english not so good, sorry.
I am working with PHP language and am having problem with profile image upload
My code filters images based on type yet on server I have files that are not of accepted types, always from same IP.
I think it is because of my type checking but am not sure. Please help!
$bild = array('jpg', 'jpeg', 'png', 'gif');
if (in_array($_FILES['image']['type'], $bild) {
    mysqli_laden($_FILES);
}

A: I assume that mysqli_laden is a custom function that uploads to server. Be careful when using $_FILES["image"]["type"] as it gets its information from the browser rather than the file itself. You should use the far more reliable finfo_open function which will verify the MIME type of a file. Check it out here: http://www.php.net/manual/en/function.finfo-open.php
Your code would look something like this
$bild = array('image/jpg', 'image/jpeg', 'image/png', 'image/gif');
$image = $_FILES['image']['type'];
$finfo = new finfo(FILEINFO_MIME);
$image_inf = $finfo->file($image);

if (in_array($image_inf, $bild) {
    mysqli_laden($_FILES);
}

Hope this helps


text:
Q: How to detect in real time if you are connected to wifi in an appwidget I would like to retrieve the state of the connection if it is in wifi or mobile data and this in real time, that is to say that if I desactivate the wifi or it is reactivated, I must be alerted in my widget .
I have made this code which works but is not practical at all or I have to test the connexion every second, it will reduce the battery life which is not possible.
 static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
                            int appWidgetId) {

    // Instruct the widget manager to update the widget
    Handler connexion = new Handler();
    int connexiondelay = 1000; //milliseconds

    connexion.postDelayed(new Runnable(){
        public void run(){

            ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
            if (activeNetwork != null) {
                // connected to the internet
                if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
                    if (conn==1){

                    }else if (conn!=1){

                        conn=1;
                        test1.setTextViewText(R.id.con,conn+"");
                        appWidgetManager.updateAppWidget(appWidgetId, test1);
                    }

                } else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
                    if (conn==2){

                    }else{
                        conn=2;
                        test1.setTextViewText(R.id.con,conn+"");
                        appWidgetManager.updateAppWidget(appWidgetId, test1);

                    }

                }
            }
            connexion.postDelayed(this, connexiondelay);
        }
    }, connexiondelay);

I have read that it would be necessary to use broadcast but unfortunately for a week that I have been trying I can't do it, I haven't found a solution either or it doesn't work.
Thanks for your help


text:
Q: Plot specific date range with ggplot2 I am trying to plot data within a specific date range for individuals. I've pasted example code below that has worked before, but I don't wall all the data, just what happens after 11/30/2016. I've tried the solution shown here (Select Data After Specific Date), but I get "Error: Invalid input: date_trans works with objects of class Date only." Any ideas?
 mydf<- data.frame(Date = as.Date(Subject$date, format = "%m/%d/%Y"),
                   variable1 = (Subject$var1),
                   variable2 = (Subject$var2),
                   variable3 = (Subject$var3),
                   variable4 = (Subject$var4))

ggplot(mydf, aes(Date > "2016-11-30", variable1)) +
  geom_point() +
  stat_smooth(color = "blue", fill = "lightskyblue") +
  theme(axis.title.x = element_blank()) +
  ylab("") + xlab("")+
  ggtitle("Variable 1 units") +
  scale_x_date(date_breaks = "months",
               date_labels = "%b%y") +
  theme_hc()

A: Try subsetting the dataframe while feeding it to ggplot like this:
ggplot(data=mydf[which(mydf$Date>"2016-11-30"),],
       aes(x=Date, y=variable1)) +
       geom_point() +
       stat_smooth(color = "blue", fill = "lightskyblue") +
       theme(axis.title.x = element_blank()) +
       ylab("") + xlab("")+
       ggtitle("Variable 1 units") +
       scale_x_date(date_breaks = "months",
                    date_labels = "%b%y") +
       theme_hc()

A: It may be simpler and more duplicable to create a second subset dataframe. Converting class(mydf$Date) to POSIXct and assuming the "format="%Y-%m-%d" as earlier commenters mentioned:
mydf$Date <- as.POSIXct(mydf$Date, format="%Y-%m-%d")
after1130 <- subset(mydf, Date > "2016-11-30")
ggplot(data=after1130, +
   aes(x=Date, y=variable1)) +
   geom_point() +
   stat_smooth(color = "blue", fill = "lightskyblue") +
   theme(axis.title.x = element_blank()) +
   ylab("") + xlab("")+
   ggtitle("Variable 1 units") +
   scale_x_date(date_breaks = "months",
                date_labels = "%b%y") +
   theme_hc()

This method allows you to easily call the subset in the future for statistics and/or more plotting.


text:
Q: Accessing Private Web Services from iPhone app We have our website hosted on external data center and it interacts with various asp.net web services hosted on in-house servers. For security reasons, we have blocked public access to these web services and only external data center where website is hosted has access.
Now we are creating a iPhone app for the website and I'm wondering how we can access these private web services from the app which are downloaded to users' phones. Do we need to create a middle ware layer to accommodate the communication between iPhone app and the private web services? Or is there a better solution.

A: Phoenix,
Unfortunately for this type of application you need to create an intermediary layer. To do this you can create APIs with .Net to respond the calls required, resulting in an XML file and / or JSON that is perfectly interpreted by iOS frameworks. I thing that it is the best way.
Good Lucky


text:
Q: Azure Function successfully published but missing from Azure Portal My Function app is not showing up in the Portal though it publishes successfully from local machine.
Example:
Success!:

Failure:

Tried:

*

*Visiting https:myapp.azurewebsites.net

*Visiting https://myapp.scm.azurewebsites.net/api/deployments

*

*Last deployment looks good:

{
        "id": "<redacted>",
        "status": 4,
        "status_text": "",
        "author_email": "N/A",
        "author": "<redacted>",
        "deployer": "Push-Deployer",
        "message": "Created via a push deployment",
        "progress": "",
        "received_time": "2020-10-23T20:38:47.1069702Z",
        "start_time": "2020-10-23T20:38:47.3075338Z",
        "end_time": "2020-10-23T20:39:19.3128742Z",
        "last_success_end_time": "2020-10-23T20:39:19.3128742Z",
        "complete": true,
        "active": true,
        "is_temp": false,
        "is_readonly": true,
        "url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f",
        "log_url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log",
        "site_name": "myapp"
    }

*

*Visiting https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log

*

*Steps looks good:

[
    {
        "log_time": "2020-10-23T20:38:47.2134775Z",
        "id": "a9bfd9e3-dee2-4bfc-9e82-9b003d3df991",
        "message": "Updating submodules.",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:38:47.2820867Z",
        "id": "e980bad8-ee6a-467f-98ea-c78135e29eeb",
        "message": "Preparing deployment for commit id '5e446e26fc'.",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:38:47.4606839Z",
        "id": "961ce7eb-2388-4a36-9646-32a7455fce10",
        "message": "Repository path is /tmp/zipdeploy/extracted",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:38:47.5141536Z",
        "id": "1f1ad9b0-d5bf-41f0-ad77-537c2da9a010",
        "message": "Running oryx build...",
        "type": 1,
        "details_url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log/1f1ad9b0-d5bf-41f0-ad77-537c2da9a010"
    },
    {
        "log_time": "2020-10-23T20:39:14.3176646Z",
        "id": "45fc756f-4873-469c-8adf-7b8968ceec95",
        "message": "Writing the artifacts to a Zip file",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:39:18.8047683Z",
        "id": "3f9b3434-dcbc-496e-8480-d3bff123159e",
        "message": "Running post deployment command(s)...",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:39:18.9330242Z",
        "id": "11e6d453-3aa0-4afd-a20e-7edc6369d774",
        "message": "Triggering recycle (preview mode disabled).",
        "type": 0,
        "details_url": null
    },
    {
        "log_time": "2020-10-23T20:39:19.0915157Z",
        "id": "43df8884-3066-434b-91ed-6b2bbfac6236",
        "message": "Deployment successful.",
        "type": 0,
        "details_url": null
    }
]

*

*I even created a whole new Function App (in the same resource group, using the same App Service Plan) and tried publishing the Function to it... no go.

*I have 6 or 7 python Functions in prod, this is not my first deployment.

Is this a known issue that is being worked on? How do I get the Function to be visible in Portal?

A: I was able to determine the issue. It was my fault.

*

*SSH into Function app via https://myFunctionName.scm.azurewebsites.net/webssh/host

*ls /home/site/wwwroot/myFunctionName

*The main python filename had a space " " in the filename

*Was: __init__ .py

*Should have been: __init__.py

*Fixed this and republished


text:
Q: How do I use EBS volume with ECS container I created an EBS volume, attached and mounted it to my Container Instance. In the task definition volumes I set the volume Source Path with the mounted directory.
The container data is not beeing created in the mounted directory, all other directories out of the mounted EBS works properly.
The purpose is to save the data out of the container and with this another volume backup it.
Is there a way to use this attached volume with my container? or is a better way to work with volumes and backups.
EDIT: It was tested with a random docker image running it specifying the volume and I faced the same problem. I manage to make it work restarting the Docker service but I'm still looking for a solution without restart Docker.
Inspecting a container with a volume directory that is the mounted EBS
"HostConfig": {
  "Binds": [
  "/mnt/data:/data"
],
...
"Mounts": [
  {
    "Source": "/mnt/data",
    "Destination": "/data",
    "Mode": "",
    "RW": true,
    "Propagation": "rprivate"
  }
],

the directory displays:
$ ls /mnt/data/
lost+found

Inspecting a container with a volume directory that is not the mounted EBS
"HostConfig": {
  "Binds": [
    "/home/ec2-user/data:/data"
  ],
...
"Mounts": [
  {
    "Source": "/home/ec2-user/data",
    "Destination": "/data",
    "Mode": "",
    "RW": true,
    "Propagation": "rprivate"
  }
]

the directory displays:
$ ls /home/ec2-user/data
databases dbms

A: It sounds like what you potentially want to do is make use of the AWS EC2 Launch Configurations. Using Launch Configurations, you can specify EBS volumes be created and attached to your instance at launch. This happens prior to the docker agent and subsequent tasks being started.
As part of your launch configuration, you'll want to also update the User data under Configure details with something along the lines of:
mkdir /data;
mkfs -t ext4 /dev/xvdb;
mount /dev/xvdb /data;
echo '/dev/xvdb /data ext4 defaults,nofail 0 2' >> /etc/fstab;

Then, so long as your container is setup to access /data on the host, everything will just work the first go.
Bonus: If you're using ECS clusters, I presume you're already making use of Launch Configurations to get your instances joined to the cluster. If not, you can add new instances automatically as well, using something like:
#!/bin/bash
docker pull amazon/amazon-ecs-agent
docker run --name ecs-agent --detach=true --restart=on-failure:10 --volume=/var/run/docker.sock:/var/run/docker.sock --volume=/var/log/ecs/:/log --volume=/var/lib/ecs/data:/data --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro   --volume=/var/run/docker/execdriver/native:/var/lib/docker/execdriver/native:ro --publish=127.0.0.1:51678:51678 --env=ECS_LOGFILE=/log/ecs-agent.log --env=ECS_AVAILABLE_LOGGING_DRIVERS=[\"json-file\",\"syslog\",\"gelf\"] --env=ECS_LOGLEVEL=info --env=ECS_DATADIR=/data --env=ECS_CLUSTER=your-cluster-here amazon/amazon-ecs-agent:latest

Specifically in that bit, you'll want to edit this part:  --env=ECS_CLUSTER=your-cluster-here
Hope this helps.

A: The current documentation on Using Data Volumes in Tasks seems to address this problem:

Prior to the release of the Amazon ECS-optimized AMI version 2017.03.a, only file systems that were available when the Docker daemon was started are available to Docker containers. You can use the latest Amazon ECS-optimized AMI to avoid this limitation, or you can upgrade the docker package to the latest version and restart Docker.


text:
Q: Is it possible to assign hosts for Spark tasks with regex Spark on yarn mode, the cluster has nodes like nodeA-xx and nodeB-xx, is there any configurations to launch tasks run on hosts named nodeA-*

A: If you're using Capacity Scheduler you need to enable the feature called Node labels. YARN Node Labels won't allow you to specify a regex.  Instead you would have to label the nodes then specify this label as a resource for a queue and then finally run the job against a specific queue.


text:
Q: Can I use multiple gradients in one Drawable XML? Currently I have 3 drawable XML files defining 3 separate gradients. these gradients are dynamically set as the background color of an imageView in my code (which is working fine).
example: drawable\morningsky.xml
<?xml version="1.0" encoding="utf-8"?>
<item android:bottom="4dp">
  <shape>
     <gradient
        android:startColor="@color/blue"
        android:endColor="@color/dark_blue"
        android:angle="270" />
  </shape>

example: drawable\eveningsky.xml
<?xml version="1.0" encoding="utf-8"?>
<item android:bottom="4dp">
  <shape>
     <gradient
        android:startColor="@color/orange"
        android:endColor="@color/yellow"
        android:angle="270" />
  </shape>

I am setting the backgrounds in my imageView this way:
iv.setBackgroundResource(R.drawable.morningsky);

All is good, but do I really need to use multiple different drawable resource files for each gradient? Is there any way I can define all gradients in one single drawable file and then load that gradient from my code?

A: you can use something like this

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">
            <gradient
                android:type="radial"
                android:gradientRadius="300"
                android:startColor="@android:color/white"
                android:endColor="@android:color/transparent"
                android:centerX="0.25"
                android:centerY="0.5"/>
        </shape>
    </item>
    <item>
        <shape android:shape="rectangle">
            <gradient
                android:type="radial"
                android:gradientRadius="300"
                android:startColor="@android:color/white"
                android:endColor="@android:color/transparent"
                android:centerX="0.75"
                android:centerY="0.5"/>
        </shape>
    </item>
</layer-list>

A: You can do it programatically :
public void setShadeBackground(View v){
    ShapeDrawable.ShaderFactory shaderFactory = new ShapeDrawable.ShaderFactory() {
        @Override
        public Shader resize(int width, int height) {
            LinearGradient linearGradient = new LinearGradient(0, 0, width, height,
                    new int[] {
                            0xFF2583ED,
                            0xFF8220C9,
                            0xFFBC0BCC,
                            0xFFD625ED ,
                            0xFFD407AE ,
                            0xFFF2115C }, //substitute the correct colors for these
                    new float[] {
                            0, 0.30f,0.50f, 0.60f,0.70f, 1 },
                    Shader.TileMode.REPEAT);
            return linearGradient;
        }
    };
    PaintDrawable paint = new PaintDrawable();
    paint.setShape(new RectShape());
    paint.setShaderFactory(shaderFactory);
    v.setBackgroundDrawable((Drawable)paint);

}

A: You can use the selector
   <selector xmlns:android="http://schemas.android.com/apk/res/android">
      <item android:state_pressed="true" android:drawable="@drawable\eveningsky.xml"/>
      <item android:state_selected="true" android:drawable="@drawable\morningsky.xml"/>
      <item android:drawable="@drawable\morningsky.xml"/>
   </selector>


text:
Q: Hibernate Spring repository inheritance add more details to an Entity I'm using hibernate and spring repository. I have 2 classes Person and PersonDetails which contains more details about the person.
@Entity
@Table(name = "person")
@Inheritance(strategy = InheritanceType.JOINED)
public class Person{
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected Long id;
    //name,birthdate ...

}
@Entity
@Table(name = "person_details")
@PrimaryKeyJoinColumn(name="id")
public class PersonDetails extends Person{
// private details accessible only for authorized user
}

When I create a Person I can't associate a PersonDetails it creates automatically a new instance of PersonDetails and add a new line in Person table.
Here's my repositories.
@NoRepositoryBean
public interface PersonBaseRepository<T extends Person> extends JpaRepository<T, Long> {
T findByNameAndFirstname(String name,String firstname);
}
@Transactional
public interface PersonRepository extends PersonBaseRepository<Person> {
}
@Transactional
public interface PersonDetailsRepository extends PersonBaseRepository<PersonDetails > {
}

To solve this I could instanciate my Entities only with PersonDetails but in some cases PersonDetails fields will be empty.
When I call  findByNameAndFirstname from PersonDetailsRepository  and the person isn't in person_details table but only in person I want to return the person matches in PersonDetails object.
Does anyone have a workable solution ? Thanks for your help.


text:
Q: Sublime Key Binding "TAB" to exit parenthesis, quotes etc, EXCEPT when it is the first character on the line I'm trying to get "TAB" to exit parenthesis, quotes, etc. but only when it is NOT the only character on the line. If | represents the cursor:
Exit here:
function(e|) {}

But not here:
function() {
  return;
|}

To do so I'm trying to set the context to check for that condition without any success. Here is what I have so far:
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
    { "key": "following_text", "operator": "regex_contains", "operand": "^[)'}\"\\]]", "match_all": true },
    { "key": "preceding_text", "operator": "not_regex_match", "operand": "\\n", "match_all":true },
    { "key": "auto_complete_visible", "operator": "equal", "operand": false }
]
}

The second line of the context is what I can't get right. Any help would be greatly appreciated!
Best,
Michael

A: Since you want to match until the line start you should use ^. The regex match is only per line, hence you can use ^ for the begin and $ for the end of the line.
Change it to ^\\s* if you also want to disable it for lines with indent, e.g. to press the tab multiple times to indent the bracket.


text:
Q: When connecting to a server farm in sharepoint foundation 2013, we are getting cannot create new farm error: One or more types failed to load When trying to create a new server farm in the sharepoint foundation 2013 we get a following error :
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
    PS C:\Users\Administrator> New-SPConfigurationDatabase

    cmdlet New-SPConfigurationDatabase at command pipeline position 1
    Supply values for the following parameters:
    DatabaseName: SharePoint_Config
    DatabaseServer: PC78\SQLEXPRESS,25111
    FarmCredentials
    Passphrase: *********
    New-SPConfigurationDatabase : One or more types failed to load. Please refer
    to the upgrade log for more details.
    At line:1 char:1
    + New-SPConfigurationDatabase
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (Microsoft.Share...urationDatabase:
       SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], SPUpgra
      deException
        + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPCon
       figurationDatabase

And the error log is shown below :
    Microsoft.SharePoint.Upgrade.SPUpgradeException: One or more types failed to load.
Please refer to the upgrade log for more details.
at Microsoft.SharePoint.Upgrade.SPActionSequence.LoadUpgradeActions()
at Microsoft.SharePoint.Upgrade.SPActionSequence.get_ActionsInternal()
at Microsoft.SharePoint.Upgrade.SPUtility.GetLatestTargetSchemaVersionByMajorVersion(Type typeActionSequence, Int32 majorVer)
at Microsoft.SharePoint.Upgrade.SPUtility.get_CurrentSPSiteWssTargetSchemaVersion()
at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPContentDatabase database, SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, Int32 compatibilityLevel, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, Strin... b712a522-fa85-49eb-b59c-dedf55295504
        ...g secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, String quotaTemplate, String sscRootWebUrl, Boolean useHostHeaderAsSiteName, Boolean overrideCompatibilityRestriction)
at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, Int32 compatibilityLevel, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, Boolean useHostHeaderAsSiteName)
at Microsoft.SharePoint.Administration.SPAdministrationWebApplication.CreateDefaultInstance(SqlConnectionStringBuilder administrationContentDatabase, SPWebService adminService, IdentityType identityType, ... b712a522-fa85-49eb-b59c-dedf55295504
     ...String farmUser, SecureString farmPassword)
at Microsoft.SharePoint.Administration.SPFarm.CreateAdministrationWebService(SqlConnectionStringBuilder administrationContentDatabase, IdentityType identityType, String farmUser, SecureString farmPassword)
at Microsoft.SharePoint.Administration.SPFarm.CreateBasicServices(SqlConnectionStringBuilder administrationContentDatabase, IdentityType identityType, String farmUser, SecureString farmPassword)
at Microsoft.SharePoint.Administration.SPFarm.Create(SqlConnectionStringBuilder configurationDatabase, SqlConnectionStringBuilder administrationContentDatabase, IdentityType identityType, String farmUser, SecureString farmPassword, SecureString masterPassphrase)
at Microsoft.SharePoint.Administration.SPFarm.Create(SqlConnectionStringBuil... b712a522-fa85-49eb-b59c-dedf55295504
            ...der configurationDatabase, SqlConnectionStringBuilder administrationContentDatabase, String farmUser, SecureString farmPassword, SecureString masterPassphrase)
at Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase.InternalProcessRecord()
at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() b712a522-fa85-49eb-b59c-dedf55295504
Error Category: InvalidData    Target Object  Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase  Details  NULL  RecommendedAction NULL b712a522-fa85-49eb-b59c-dedf55295504
 Leaving ProcessRecord Method of New-SPConfigurationDatabase.   e9ae5ba6-c499-0000-d35c-aee999c4cf01
 Entering EndProcessing Method of New-SPConfigurationDatabase.  e9ae5ba6-c499-0000-d35c-aee999c4cf01
 Leaving EndProcessing Method of New-SPConfigurationDatabase.   e9ae5ba6-c499-0000-d35c-aee999c4cf01
 Event 3759 (SharePoint Foundation) of severity 'Error' occurred 1 more time(s) and was suppressed in the event log


text:
Q: Show that the monoid surface is birational to affine space.
Given a irreducible polynomial $f_{n}+f_{n-1}$, where $f_{n}$ and $f_{n-1}$ are homogeneous polynomial of degree $n$ and $n-1$ , respectively.
  Then $f_{n}+f_{n-1}$ define a hypersurface $\mathit{S}\,$ in $\mathbb{A}^n$. Show that $\mathit{S}\,$ is birational to $\mathbb{A}^{n-1}$

I want to show that the map $$F:\mathbb{A}^{n-1} \to\mathit{S}\,$$ defined by
$$(a_{1},a_{2},...,a_{n-1})\mapsto(\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1)a_{1},\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1)a_{2},...,\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1))$$
is the required map.
But i had a problem to show that the image of $\mathbb{A}^{n-1}$ is dense in $\mathit{S}\,$.
That is, to show that the induced map from $k[\mathit{S}]\,$to $k[\mathbb{A}^{n-1}]=k[a_{1},a_{2},...,a_{n-1}]\,$is injective .
But how to show that there is no non-trivial polynomial $p$ not in $<f_{n}+f_{n-1}>$ such that $p((\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1)a_{1},\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1)a_{2},...,\frac{-f_{n-1}}{f_{n}}(a_{1},a_{2},...,a_{n-1},1))=0$ ?
The surface defined above is named monoid surface.

A: Consider the projection from the origin(that is,solving the equation $t^{n}f_{n}+t^{n-1}f_{n-1}=0$ )map $F$ map $\mathbb{A}^{n-1}$  onto the complement of $V(f_{n-1})$ (or a smaller nonempty open set contain in it) in $S$ , that is , the image of $\mathbb{A}^{n-1} $ is dense in $S$.


text:
Q: Recursively Define & Prove Through Strong Induction hopefully you guys will be able to help me.
I need to recursively define $a_n = 6a_{n-1}-9a_{n-2}$, and prove $a_n=(5-n)\cdot3^n$ $a_0 = 5$ and  $a_1 = 12$
I've already done the basis case for this induction problem, but I am stuck on the second induction step. I know the following though:
$a_k(rec)=a_k(exp)$, for all $i = 0,1,2,3,\ldots,k$.
Prove $a_{k+1}(rec)=a_{k+1}(exp)$
asub(k+1) = (5-(k+1))3^(k+1) = 6(5-k)3^k - 9(5-(k+1)3^(k-1)
I don't even know if I did this correct, but this problem seems a lot harder than the other recursion problems that I have done.

A: You're close, but you're using information in the wrong order.
$a_{k+1} = 6a_k - 9a_{k-1}$ because of the recursive definition.
Your assumption gives you formulas for $a_k$ and $a_{k-1}$ but not for $a_{k+1}$. However, you can substitute these formulas, to get
$a_{k+1} = 6(5-k)\cdot 3^k - 9\cdot (5-(k-1))\cdot 3^{k-1}$. (This is what I think is meant by $rec$).
Now do some algebra and make the right-hand side look like $(5-(k+1))\cdot3^{k+1}$, (which is what I think you mean by $exp$).

A: $$a_n-3a_{n-1}=3(a_{n-1}-3a_{n-2})=\cdots=3^{n-1}(a_1-3a_0)$$
$$a_n-3a_{n-1}=3^{n-1}(a_1-3a_0)$$
$$3a_{n-1}-3^2a_{n-2}=3\cdot3^{n-2}(a_1-3a_0)$$
$$\cdots$$
$$3^{n-1}a_1-3^na_0=3^{n-1}\cdot3^0(a_1-3a_0)$$
Adding side by side,
$$a_n-3^na_0=n\cdot3^{n-1}(a_1-3a_0)$$
$$a_n=n\cdot3^{n-1}a_1-(n-1)\cdot3^na_0$$


text:
Q: Mschart Add custom Textbox Is it possible to add a custom textbox to a mschart?
Example I have a graph, the axislabels, the legend to the right.
I want to add a custom text(box) to the chartarea with a textbox with an explaning text about the graph. The reason is because its so easy to save an image of the chart so I want the explanation to be integrated in the picture.
Regards
//JH

A: As suggested by @rockyashkumar, you could use chart title to explain the figure.
You can do that using chart.Titles property, either through visual studio designer or programmatically e.g.:
var title = this.chart1.Titles.Add("The title text");
// set other properties of the title (if necessary)
title.Alignment = ContentAlignment.MiddleCenter;
...

A:     Chart = CreateChartTemplate();
    Title area1Title = new Title(chartTitle, Docking.Top, new Font("Verdana", 12), Color.Black);
    area1Title.IsDockedInsideChartArea = false;
    area1Title.Docking = Docking.Top;
    Chart.Titles.Add(area1Title);

You can use this to set a title on top of the graph outside of the plotted area, you can also change options if you would like it inside chart area.
area1Title.DockedToChartArea

this will allow you to specify an area of the chart to fix it to. i.e top left right etc.


text:
Q: Android: cannot get camera instance I have a simple test class
public class MainActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    Camera a = Camera.open();
}

}
and manifest file

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="16" />

    <uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.cameratest.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

After application running i have exception
01-31 10:05:46.033: E/AndroidRuntime(17154): FATAL EXCEPTION: main
01-31 10:05:46.033: E/AndroidRuntime(17154): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cameratest/com.example.cameratest.MainActivity}: java.lang.RuntimeException: Fail to connect to camera service
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread.access$600(ActivityThread.java:128)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.os.Handler.dispatchMessage(Handler.java:99)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.os.Looper.loop(Looper.java:137)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread.main(ActivityThread.java:4514)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at java.lang.reflect.Method.invokeNative(Native Method)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at java.lang.reflect.Method.invoke(Method.java:511)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at dalvik.system.NativeStart.main(Native Method)
01-31 10:05:46.033: E/AndroidRuntime(17154): Caused by: java.lang.RuntimeException: Fail to connect to camera service
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.hardware.Camera.native_setup(Native Method)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.hardware.Camera.<init>(Camera.java:349)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.hardware.Camera.open(Camera.java:326)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at com.example.cameratest.MainActivity.onCreate(MainActivity.java:17)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.Activity.performCreate(Activity.java:4465)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
01-31 10:05:46.033: E/AndroidRuntime(17154):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
01-31 10:05:46.033: E/AndroidRuntime(17154):    ... 11 more

What I do wrong ? My device definitely has a camera and its works on other apps...


text:
Q: How can I mirror a project hosted on launchpad on github? I want to contribute actively to a project that is hosted on Launchpad.
I'm much more comfortable with GitHub, and would like to continue to use it if possible.
Would I be able to mirror the bzr repository on github?
If it's possible, how could I set this up?

A: You could try some kind of git-bzr bridge like this git-bzr git-bzr script:

This script allows you to add bazaar repositories as git branches in your git repository.
  After that, you can fetch the Bazaar repo, make some changes, and push it back into Bazaar.

The reverse is possible, meaning you can clone a bzr repo and push to your GitHub repo with bzr-git.

A: Beware: trunk bzr-fastimport is broken and may corrupt your 'marks' file..
https://code.launchpad.net/~xrg/bzr-fastimport/re-tailor
A detailed implementation here:
http://git.hellug.gr/?p=xrg/openerp-rebzr;a=shortlog;h=refs/heads/fast-only

A: I have just written a detailed how-to for mirroring a Launchpad Bazaar repo to Github (note that it focuses on Mac users).
A minimal version of this how-to:

*

*Install bazaar and a plugin to make it work with git

brew install bazaar
brew tap gdubicki/tap
brew install gdubicki/tap/bzr-git

*Clone the Bazaar repository

# for example:
bzr branch lp:update-motd

*Create the Git repository

You'll need is the URL to the repo, in my case:
git+ssh://git@github.com/gdubicki/update-motd-for-non-ubuntu.git

*Push the clone to the remote

cd update-motd # or whatever is the name of the Bazaar branch
PYTHONPATH="/usr/local/lib/python2.7/site-packages" bzr dpush -v git+ssh://git@github.com/gdubicki/update-motd-for-non-ubuntu.git,branch=master


text:
Q: Trying to code jQuery HTML5 chat box program with mouse click event response I am having issues coding a chat box program for a school project. I am having 3 problems with the program. First, my chat message does not post properly in my chat box. Secondly, I want to be able to click exit and have it close to window but am not completely sure how to do it. Lastly, I would like the chat to echo the message or to have ahard coded response at the least. I'm researching how to do that I'm not quite sure how to do this. I have a style sheet and html. Here is my html:
<!DOCTYPE html>

  <meta charset="utf-8">

<link rel="stylesheet" type="text/css" href="jQuery.css">

//my issues seem to be in my Javascript between here************************************

//and here*****************************************************************************

Welcome

//Possible issue here*******************************************************************

Exit Chat

Here's our chat data

    <form name="message" action="">
        <input name="usermsg" type="text" id="usermsg" size="63" />
        <input name="submitmsg" type="submit"  id="submitmsg" value="Send" />
    </form>

Here is my css:
body {
font:12px arial;
color: #222;
text-align:center;
padding:35px; }

form, p, span {
    margin:0;
    padding:0; }

input {
    font:12px arial; }

a {
    color:#0000FF;
    text-decoration:none; }

a:hover {
    text-decoration:underline; }

#wrapper, #loginform {
    margin:0 auto;
    padding-bottom:25px;
    background:#EBF4FB;
    width:75%;
    border:1px solid #ACD8F0; }

#loginform {
    padding-top:18px; }

#loginform p {
    margin: 5px; }

#chatbox {
    text-align:left;
    margin:0 auto;
    margin-bottom:25px;
    padding:10px;
    background:#fff;
    height:270px;
    width:430px;
    border:1px solid #ACD8F0;
    overflow:auto; }

#chatbox p {
    padding:1em;
    margin:1em;
    background:#E6E6E6;
    border:1px solid #BDBDBD;
    -moz-border-radius:4px;
}

#usermsg {
    width:395px;
    border:1px solid #ACD8F0; }

#submit {
    width: 60px; }

.welcome {
    float:left; }

.logout {
    float:right; }

.msgln {
    margin:0 0 2px 0; }

Some of the css is unnecessary I'm pretty sure but when I tried taking some out it caused issues. Any help is greatly appreciated.

A: one problem is that you are using a form that then posts to the same page - reloading it.
I copied your code into a testpage (called chatTest.html) and got the following url after hitting the send button:
chatTest.html?usermsg=test+message&submitmsg=Send

your message does get posted into the chat section but is then removed when the page reloads. and because you are not specifying a method - it is treating it as a get form and posting the message as a querystring appended to the url.
if you are planning on saving the comments to a database, then you should change the action of the form to a different php page, process the results and return the saved content into the chat section- perhaps using Ajax so that you don;t have to reload the page on every chat submission.

A: try copying the following - i put the styling into the head, moved the javascript to the end, and swapped the input for a button. This is ties to the onclick and appends the new comment into the chat window. It works, but could be done better, also I have not addressed the issue of closing the window, but this does post the new comment into the chat region.
<!DOCTYPE html>

  <meta charset="utf-8">

Welcome

Exit Chat

Here's our chat data

    <form name="message">
        <input name="usermsg" type="text" id="usermsg" size="63" />
        <button type="button" id="submitmsg" value="send">Send</button>
    </form>


text:
Q: How can I call Speech Recognition multiple times in 1 function? I am relatively new to JavaScript and currently working a project a beginner probably shouldn't start on. I have been coding for some time in python and decided to give it a shot. I am trying to make a personal assistant, or as I like to call it, Jarvis (from IRON MAN). It currently can listen for commands and perform them just fine, however, I am trying to make a send email command that requires multiple input from a user all in one function. This send email function is technically in parseCommand() where I pass an identifier, known as i. I will eventually add more commands to parseCommand() and the identifier will help in knowing what command to perform. When I say, "jarvis send an email", parseCommand("email") is called. It is a promise because once it is done, I want to call annyang (command listener) again.
When "jarvis send an email" is triggered ->
"jarvis send an email" : async function(){
  annyang.abort(); // stop listening
  await parseCommand("email").then(annyang.start()); // Start listening for another command when done
}

parseCommand:
parseCommand(i){
    return new Promise(async (resolve) => {
        recognition.stop();

        if(i == "email"){
            var SUBJECT;
            var TEXT;
            var TO;

            console.log("Running: send an email")
            await this.promptListen("Who shall I send it to?").then( async (email) =>{
                TO = email;
                console.log("got TO", TO)

                await this.promptListen("What shall the subject be?").then( async (subject) => {
                    SUBJECT = subject;
                    console.log("got SUBJECT", SUBJECT)

                    await this.promptListen("What would you like to say?").then((text) => {
                        TEXT = text;
                        console.log("got TEXT", TEXT)
                        resolve()
                        })
                    })
                });
            }
        })
    }

promptListen command:
promptListen(prompt){
        return new Promise((resolve, reject) => {
            socket.emit("speak", prompt);
            setTimeout(1000);

            promptRecognition.stop(); // NOTE #1

            promptRecognition.start();

            promptRecognition.onresult = function(event){
                console.log(event)
                promptRecognition.stop();
                resolve(event.results[0][0].transcript);
            }
            promptRecognition.onnomatch = function() {
                promptRecognition.stop();
                reject(promptListen(prompt));
            }
        })

    }

The issue with the current functionality is that it doesn't work at all. I am prompted for the "Who shall I send it to?" and Jarvis listens. I get the TO console output, however, after that I get an error:
responses.js:63 Uncaught (in promise) DOMException: Failed to execute 'start' on 'SpeechRecognition': recognition has already started.
    at Promise (http://localhost:3000/scripts/responses.js:63:31)
    at new Promise (<anonymous>)
    at Respond.promptListen (http://localhost:3000/scripts/responses.js:57:16)
    at promptListen.then (http://localhost:3000/scripts/responses.js:41:28)

The error suggests that I am running SpeechRecognition already, however, I stop it at the start of promptListen() every time just in case. I do not know what is going on at all. The desired outcome would be that each call to promptListen() will allow me to prompt the user, listen to the response, store the response in a variable: for each variable needed in order to send the email (recipient, subject, and body). I am not familiar with JavaScript, promises, async, or await. I have tried every single variation possible as well as took a look at documentation to no avail. If I do not use promises, the promptListen() function is called at the same time for the recipient, subject, and body prompts. This is why I decided to try to resolve the issue with promises. Any help appreciated - Thank you!

A: My code works theoretically. The issue, or at least I think it is, is that when I call then promptRecoginition.stop() needs time to stop. I immediately call .start() again for the next prompt, once I resolve the recent promptListen(), therefore promptRecognition doesn't have time to .stop(). The solution that I have found to work is:
setTimeout( async () => {
    await this.promptListen("What shall the subject be").then( (subject) => {
        SUBJECT = subject;
        // Add another setTimeout here
    }
}, 1000);

Using the setTimeout function, I give promptRecognition time to .stop() and continue on without any errors.


text:
Q: TensorFlow - decode_csv: Expect 3 fields but have 5 in record 0, when given 5 defaults throws: Expect 5 fields but have 3 in record 0 I'm trying to run the example from https://www.tensorflow.org/programmers_guide/reading_data
with my custom data that looks like:
example_data.txt
DESC|manner|How did serfdom develop in and then leave Russia ?
ENTY|cremat|What films featured the character Popeye Doyle ?
DESC|manner|How can I find a list of celebrities ' real names ?
ENTY|animal|What fowl grabs the spotlight after the Chinese Year of the Monkey ?
                                      more...

TensorFlow code:
import numpy as np
import tensorflow as tf

filename_queue = tf.train.string_input_producer(["example_data.txt"])
reader = tf.TextLineReader()
key, value = reader.read(filename_queue)

record_defaults = [['hello'], ['hello'], ['hello']]
col1, col2, col3 = tf.decode_csv(
    value, record_defaults=record_defaults, field_delim="|")
features = tf.stack([col1, col2, col3])

print(features)

with tf.Session() as sess:
  # Start populating the filename queue.
  coord = tf.train.Coordinator()
  threads = tf.train.start_queue_runners(coord=coord)

  for i in range(1200):
    # Retrieve a single instance:
    example, label = sess.run([features, col2])

  coord.request_stop()
  coord.join(threads)

This throws an error:
Expect 3 fields but have 5 in record 0
but if I change:
record_defaults = [['hello'], ['hello'], ['hello'], ['hello'], ['hello']]
    col1, col2, col3, col4, col5 = tf.decode_csv(
        value, record_defaults=record_defaults, field_delim="|")

This throws an error:
Expect 5 fields but have 3 in record 0
What is happening? is this a bug in TensorFlow?

A: When using tf.decode_csv with tf.TextLineReader, the mere presence of a blank line at the end of the file caused a similar error 'Expect 5 fields but have 0 in record 0'.
Similarly, you might want to check out your data file to see if there is any wrong with it, even if it is as trivial as "a blank line".


text:
Q: azure data factory dependencies I have two activities in my azure data factory.
Activity A1 = a stored proc on a sql db. Input=none, output = DB (output1). The stored proc targets the output dataset.
Activity A2 = an azure copy activity ("type": "Copy") which copies from blob to same sql db. Input = blob, Output = DB (output2)
i need to run activity A1 before A2 and i cant for the world figure out what dependencies to put between them.
i tried to mark A2 as having two inputs - the blob + the DB (output1). if i do this, the copy activity doesn't throw error, but it does NOT copy the blob to db (i think it silently uses the DB as the source of copy, instead of blob as source of copy and somehow does nothing).
if i remove the DB input (output1) on A2 it can successfully copy blob to DB but i no longer have the dependency chain that A1 needs to run before A2
thanks!

A: I figured this out - I was able to keep two dependencies on A2, but just needed to make sure of the ordering of the 2 inputs. Weird. Looks like the Copy activity just acts on the FIRST input - so when i moved the blob as the first input it worked! :) (earlier i had the DB output1 as first input and it silently did nothing)
 "activities": [
        {
            "type": "Copy",
            "typeProperties": {
                "source": {
                    "type": "BlobSource"
                },
                "sink": {
                    "type": "SqlSink",
                    "writeBatchSize": 0,
                    "writeBatchTimeout": "00:00:00"
                }
            },
            "inputs": [
                {
                    "name": "MyBlobInput"
                },
                {
                    "name": "MyDBOutput1"
                }
            ],
            "outputs": [
                {
                    "name": "MyDBOutput2"
                }
            ],
            "policy": {
                "timeout": "01:00:00",
                "concurrency": 3,
                "retry": 3
            },
            "scheduler": {
                "frequency": "Day",
                "interval": 1
            },
            "name": "AzureBlobtoSQL",
            "description": "Copy Activity"
        }
    ],


text:
Q: Google map ignoring marker size for retina icons I have a Google map driven by Advanced Custom Fields. I have created an iconType to dictate which icon is used as the marker depending on the custom field.
My marker images are 80px square but I want to force them to 40px square for retina reasons. I have tried lots of variations of code I've found via google etc but nothing works and the size gets ignored showing my markers at the larger 80px. My guess is because I have the 2 icons depending on iconType?
Can anyone help me force the size of these markers to 40px square please...
function add_marker( $marker, map ) {

// var
var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng'));
var iconType = $marker.attr('data-icon');
var iconBase = '<?php echo get_template_directory_uri(); ?>/assets/';
var size = new google.maps.Size(40, 40);

if (iconType === 'Costa') {
    iconName = 'costa@2x.png';
} else {
    iconName = 'starbucks@2x.png';
}

// create marker
var marker = new google.maps.Marker({
    position    : latlng,
    map         : map,
    clickable: false,
    animation: google.maps.Animation.DROP,

    icon: iconBase + iconName,
});

// add to array
map.markers.push( marker );

// if marker contains HTML, add it to an infoWindow
if( $marker.html() )
{
    // create info window
    var infowindow = new google.maps.InfoWindow({
        content     : $marker.html()
    });
}

}

A: I did something like this recently, and I believe you'll need to use the new Icon object to specify your custom Icon properties, and use the size and scaledSize properties.  I fixed my issues following this guide:
How to add retina ready pin marker to your Google maps?


text:
Q: Wordpress Website Choppy/Jittery/Laggy Scrolling I have been working on my website for a month. I was busy designing some pages and yesterday I tried taking a tour of what I have created. The homepage of my website exhibits choppy scrolling on Chrome and Opera…but it works fine on Firefox and IE/Edge.
I tried to deactivate all the plugins excluding Brizy Pro as the website was designed on that. But there was still the "choppy scrolling" issue coming up.
I am using Blocksy theme. What I have realised that as soon as I select the Brizy template while editing Homepage, the header and footer goes away and the homepage scrolling becomes smooth again.
I have read numerous answers to similar problems but none of them worked for me. I can't afford to change the theme now as I have nearly completed the whole website. Also, the issue is just on Chrome and Opera for some reason.
My website is http://hhfa.in
I am a novice and have near to zero knowledge of coding. But I can follow instructions very well. Please help!
Points to remember:

*

*Only Chrome and Opera Browsers exhibiting this issue.

*On Mobile, the scrolling seems to be fine but the "Anchor link" taking user to the footer (for contact info) is still creating Choppy issue.

*This problem was initially not there. It suddenly started a couple of days back.

*I have tried to deactivate every plugin accept Brizy builder and the problem still remains.

*When I change template to Brizy template (instead of the main theme), the problem goes away.

Other pages seem to be fine but even though they have a very very low choppiness at the top of the page.
I can't change the theme. An intensive online search suggested that the issue can be either STICKY HEADER, or a Javascript conflict, or a wrong CSS.
Please help!

A: I have experienced this on some of my websites built with Brizy on Blocksy theme. For my case, it was due to some bugs from Brizy relating to the Fixed\Animated parallax scrolling. Try changing it to None and see if it's better. Consider updating to their latest plugin version.


text:
Q: Ways to develop an online multiplayer game? I developed a little 2D game in Java recently without any external package.
However, I am interested in a new project that would require online multiplayer for Android (and possibly Linux/Windows as well).
First of all, I have no knowledge yet in Android development, nor in network development. I have no idea where to start looking at so this is why I ask about this.
So far, I've read about using libGDX for multiplatform advantages. I'm planning to learn how to use it but I've yet to understand how developing an online game differs from developing a local multiplayer game. So here are my questions:

*

*Can I develop a local multiplayer game using libGDX and add online multiplayer easily ? Or should I rather start developing it with online in mind from scratch?

*Is there any recommended guide I could read about developing multiplayer games?

*Can I develop my libGDX game without worrying about Android, and then add touch inputs when I port it?

A: I can answer all your questions positively. My friends and I have developed an application with libgdx and we have also published it on the play store. For the moment it is only on Android, but it has multiplatform advantages that we will use shortly. We are adding online multiplayer and it is not complicated. If you want to see it, the name is "Cetriolino".

A:
Can I develop a local multiplayer game using libGDX and add online
  multiplayer easily ? Or should I rather start developing it with
  online in mind from scratch?

Designing multiplayer first is the way to go, since the game engine you are making require a different kind of logic to support multiplayer. Going single player first and then multiplayer risk requiring a major refactoring.

Is there any recommended guide I could read about developing
  multiplayer games?

Yes there are many, but which one depends on the kind of game, search amazon / google.

Can I develop my libGDX game without worrying about Android, and then add touch inputs when I port it?

Yes, but the porting will be easier if you only use such inputs that are available on both platforms, such as click / drag / zoom.


text:
Q: Can't connect SSLSocket to server even with the right certificates I'm trying to connect using a SSLSocket using TLS to a server that should have the right certificates already. But the client keep crashing.
This is the SSL Checker on the website:

While this is the code (hostname and port are corrected):
val SSLSocketFactory = SSLSocketFactory.getDefault() as SSLSocketFactory
val socket: SSLSocket = factory.createSocket(address, port) as SSLSocket
socket.startHandshake()

When the code arrives at the handshake it crashes with this error:
java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Any idea why this may happen? Another HTTPS call I do to the server using TLS works perfectly, so I don't think the issue is in the server (and all the answers I have seen have that type of reply).

A: The problem was that I needed to pin the certificate in the client that opens the SSL socket connection.
For a more generic guide, see this guide about SSL pinning on Android. Although that guide is for HTTPS connections, not Socket.
For the socket, I've done the following:
fun run() {
    val trustGodaddyCertificate = loadTrustManagers()

    val sslContext = SSLContext.getInstance("SSL")
    sslContext.init(null, trustGodaddyCertificate, SecureRandom())

    val socket = sslContext.socketFactory.createSocket(address, port)

    // use the socket
}

private fun loadTrustManagers(): Array<out TrustManager>? {
    val certificateFactory: CertificateFactory = CertificateFactory.getInstance("X.509")
    val caInput: InputStream = BufferedInputStream(resources.openRawResource(R.raw.server_godaddy_certificate))
    caInput.use {
        val certificate = certificateFactory.generateCertificate(caInput)

        val keyStoreType: String = KeyStore.getDefaultType()
        val keyStore: KeyStore = KeyStore.getInstance(keyStoreType)
        keyStore.load(null, null)
        keyStore.setCertificateEntry("ca", certificate)

        val tmfAlgorithm: String = TrustManagerFactory.getDefaultAlgorithm()
        val trustManagerFactory: TrustManagerFactory = TrustManagerFactory.getInstance(tmfAlgorithm)
        trustManagerFactory.init(keyStore)

        return trustManagerFactory.trustManagers
    }
}

In short, I've saved the .crt certificate of GoDaddy in the raw foulder of resources. I've loaded it and create a TrustManager that uses it. And I've put it in the certificate allowed by the client. That make everything work.


text:
Q: Ubuntu 14.04LTS Black Screen (Already purged NVIDIA) What's happening:
Black screen instead of desktop. I see the purple screen with the Ubuntu logo before it goes to black. My monitors are plugged into my motherboard (just like they were before I purged NVIDIA). I can also open terminal through CTRL+ALT+T.
What I've done:
I was getting some weird errors and screen tearing, so in an attempt to just have my integrated graphics I did this:
sudo apt-get remove --purge nvidia-*
sudo apt-get remove --purge xserver-xorg-video-nouveau xserver-xorg-video-nv
sudo apt-get install nvidia-common
sudo apt-get install --reinstall xserver-xorg-video-intel
sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg

But that does nothing still. (I followed this by the way)
I also tried copying my backed up "xorg.conf", but that has no effect. I have gone through the Xorg log, but it shows no errors. I don't know how to post it, because I have no browser access on Ubuntu.
I have started and restarted lightdm, but it doesn't do anything either.
I booted into the failsafe graphics mode (or w/e it's called), and when it gives me an option to reconfigure it doesn't actually do anything -- just sends me back through the menus. At the beginning it says that the configuration couldn't be loaded, or couldn't be found, and that it needs to be reconfigured.
My best guess is that I ruined the OpenGL drivers, but I don't know how to fix it. Help? :(

A: Try to rebuild your kernel image:
$ sudo update-initramfs -u

Sometimes it usefull.
Is there also old kernel on your installation to boot? Please try to boot with old kernel version and image.


text:
Q: Environment for questions/exercises with solution at the end + hyperlink from questions to solutions and vice versa I would like to write an overleaf document with exercises (divided by sections and maybe even subsections) and, at a section at the end, their solutions. Like for example, as it is done in a book.
I would like my code to have the following structure (this is not mandatory, but I would like it to be well structured, and this seems one good option):
\section{About you}
\begin{ex}
How tall are you?
\begin{sol}
I am 6'5.
\end{sol}
\end{ex}

\begin{ex}
How are you?
\begin{sol}
I am fine thanks.
\end{sol}
\end{ex}

\clearpage
\section{Computations}

\begin{ex}
1+1?
\begin{sol}
That's easy, it is 2.
\end{sol}
\end{ex}

\begin{ex}
How about 6+3?
\begin{sol}
Hmm, 9.
\end{sol}
\end{ex}

\begin{ex}
17x3?
\begin{sol}
51.
\end{sol}
\end{ex}

\begin{ex}
Last one, 64+46?
\begin{sol}
110.
\end{sol}
\end{ex}

\clearpage
\section{Solutions}
\printsolutions

And it should produce something like:
1. About you
1.1 How tall are you?
1.2 How are you?
2. Computations
2.1 1+1?
2.2 How about 6+3?
2.3 17x3?
2.3 Last one, 64+46?
3. Solutions

*

*About you

1.1 I am 6'5
1.2 I am fine thanks

*Computations

2.1 That's easy, it is 2.
2.2 Hmm, 9.
2.3 51.
2.4 110.
Finally, I would like to put an hyperlink in every question to its solution and one in the solution to the question (for example, if I click question 1.1, I go to solution 1.1 and vice-versa), if possible without labelling every question and every solution.

A: May be like this?
\documentclass[12pt,a4paper]{book}
\usepackage{amsthm,amsfonts,amssymb,amsmath}
\usepackage{answers}

\newif\ifsolutions
\solutionstrue % hide or show solution

\theoremstyle{definition}
\newtheorem{ex}{%
    \hyperlink{ex:\theex}{Exercise}\hypertarget{sol:\theex}{}}[chapter]
\Newassociation{sol}{Soln}{ans}
\renewenvironment{Soln}[1]{\par\bigskip\noindent{\bfseries \hypertarget{ex:#1}{}\hyperlink{sol:#1}{ #1}}\quad}
\theoremstyle{definition}
\usepackage[linkcolor=blue,colorlinks=true,unicode,bookmarksnumbered]{hyperref}
\begin{document}
    \chapter{Try}
    \Opensolutionfile{ans}[ans1]
    \section{About you}
\begin{ex}
How tall are you?
\begin{sol}
I am 6'5.
\end{sol}
\end{ex}

\begin{ex}
How are you?
\begin{sol}
I am fine thanks.
\end{sol}
\end{ex}

\clearpage
\section{Computations}

\begin{ex}
1+1?
\begin{sol}
That's easy, it is 2.
\end{sol}
\end{ex}

\begin{ex}
How about 6+3?
\begin{sol}
Hmm, 9.
\end{sol}
\end{ex}

\begin{ex}
17x3?
\begin{sol}
51.
\end{sol}
\end{ex}

\begin{ex}
Last one, 64+46?
\begin{sol}
110.
\end{sol}
\end{ex}

    \Closesolutionfile{ans}
    \ifsolutions
    \section{Solutions}
    \input{ans1}
    \fi
\end{document}


text:
Q: PureScript Error: Could not match kind Type -> Type with kind Type I'm a newbie at PureScript trying out some code at this link.  I've pasted the code here:
module Main where

import Prelude

import Data.Foldable (fold)
import Data.Tuple
import Data.Map as Map
import Data.List
import Effect (Effect)
import Effect.Console (log)
import TryPureScript

data Item a = Left a

toplevelDecisions :: Map.Map (String) (Item String)
toplevelDecisions = Map.fromFoldable [ Tuple "Notify Individuals" (Left "omitted"), Tuple "Assessment" (Left "omitted") ]

getTheFirstInTuple :: (List -> Tuple) -> List
getTheFirstInTuple a = fst <<< unzip a

main = render =<< withConsole do
  log $ getTheFirstInTuple toplevelDecisions

I encountered this error: Could not match kind Type -> Type with kind Type.  Does anyone know how to resolve this problem?  What I'm trying to do is to convert a List of Tuples into a Tuple of 2 Lists, and then extracting just the first List.

A: The specific error you have here is from the type (List -> Tuple) -> List - both the List and Tuple types take arguments indicating the type of values they carry.
The "kind" is "the type of a type", so Type -> Type means it's a type that accepts one argument. Given that, it seems this specific error will be referring to the List usage, as if it was complaining about the Tuple, the kind would be Type -> Type -> Type.
Omitting the type signature in this case would also work, the compiler will warn about any top level declarations that are missing type annotations, telling you what it inferred for them. This doesn't always work, when fancier type system features get involved, but for this function it would be absolutely fine.
However... there are further problems in the code after you fix that, I'm afraid to say basically none of it works just now! But hopefully that will set you in approximately the right direction, and you can ask further questions if you get stuck again.
You might want to try asking on the PureScript discord for a more interactive conversation in figuring it out.

A: When you write List, you mean a list of what? A list of numbers, a list of strings, or of what? This has to be specified in the type. For example, a list of integer numbers would be List Int, a list of strings would be List String, and so on.
This is what the compiler means complaining about "kind Type -> Type". An argument is missing for the type List. The syntax is borrowed from functions: if a function takes an Int parameter and returns a String result, we write its type as Int -> String. Same works with types: if a type takes a Type as parameter and the result of that is also Type, we write its kind as Type -> Type. Functions have types, and types have kinds. Same idea, just a on a different level.
Similarly with Tuple: a tuple of what? It could be Tuple Int Int or Tuple String Boolean, but it can't be just Tuple. Not enough information.
If you wanted, as you say, convert a list of tuples to a list of just those tuples' first elements, then the signature might be something like:
getTheFirstInTuple :: List (Tuple String Int) -> List String

Or, if you wanted your function to work not just for String and Int, but for all types, you can make it generic:
getTheFirstInTuple :: forall a b. List (Tuple a b) -> List a

Here a and b stand for some types, but your function doesn't care what they are exactly. It will work "for all possible a and b" - that's what the forall keyword means.

But after you fix the type signature, I'm afraid your function won't work anyway, because its body doesn't make sense either. Honestly, to me it looks like you're trying to guess the right syntax without understanding what it means.
And the way you're calling your function getTheFirstInTuple toplevelDecisions also won't work, because toplevelDecisions is not a List, but a Map. Look: you wrote its type yourself.
Finally I'd like to note, just in case you didn't know, that in PureScript a construct with square brackets, like [1, 2, 3], is actually an Array, not a List