text:
Q: How to use weather API and Location Manager togethaer? i have code like this.
this is on create
 public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
            mgr=(LocationManager)getSystemService(Context.LOCATION_SERVICE);
    LocationListener ll=new mylocatoinlis();
    mgr.requestLocationUpdates(LocationManager.GPS_PROVIDER,3600l,0,ll);
          }

this is location listener class
protected class mylocatoinlis implements LocationListener {

        public void onLocationChanged(Location location) {
            // TODO Auto-generated method stub
            if(location!=null)
            {
                double plong=location.getLongitude();
                double plate=location.getLatitude();
                //Log.i("MyLocation",Double.toString(plate)+" "+Double.toString(plong));

                ingformation(plate,plong);

            }

        }

        public void onProviderDisabled(String provider) {
            // TODO Auto-generated method stub

        }

        public void onProviderEnabled(String provider) {
            // TODO Auto-generated method stub

        }

        public void onStatusChanged(String provider, int status, Bundle extras) {
            // TODO Auto-generated method stub

        }

    }

this is json wrapper function
public void ingformation(double plate, double plong) {
    // TODO Auto-generated method stub
     try
        {
            client=new DefaultHttpClient();
             StringBuilder url1=new StringBuilder(URL);
             url1.append(plate+","+plong+".json");
             HttpGet get=new HttpGet(url1.toString());
             HttpResponse r=client.execute(get);
             int status=r.getStatusLine().getStatusCode();
             if(status==200){
                 HttpEntity e=r.getEntity();
                String data=EntityUtils.toString(e);

                 obj= new JSONObject(data);

                 main=obj.getJSONObject("current_observation");
                 maintemp=main.getJSONObject("display_location");
                 tv1.setText(" "+maintemp.getString("city"));
                 tv3.setText(" "+main.getString("weather"));
                 tv2.setText(" "+main.getString("temp_c")+" C");
                 String imageName=main.getString("icon_url");
                 //String imageName1.append("nt_"+imageName);
                 //im.setImageURI(Uri.parse(url1.toString()+imageName));
                 if(imageName!="")
                 {
                     wv.setVisibility(View.VISIBLE);
                     wv.loadUrl(imageName);
                 }
                 else
                 {
                     wv.setVisibility(View.INVISIBLE);
                 }
                 //wv.loadUrl(imageName);

             }
        }catch(Exception e)
        {
            Log.e("JSON Parser", "Unable to connect" + e.toString());
        }

}

if i pass location through the DDMS it gives  error like NetworkOnMainThread Exception.
please help me i stuck b/w location and json.

A: You need to do your network operation (HTTPGet) in a separate Thread. Using an Async Task works best.
EDIT:
For example, add this inner class:
class MyTask extends AsyncTask<Double, Void, Void>
{

    MyCallback callback;

    public MyTask(Callback callback)
    {
        this.callback = callback;
    }

    @Override
    public Void doInBackground(Double... coordinates)
    {
        double plong = coordinates[0];
        double plat = coordinates[1];
        //...Complete task

        return null;
    }

    @Override
    public void onPostExecute()
    {
        callback.go();
    }

}

public interface Callback
{
    //override to handle actions after task completes
    public void go();
}

A: you need to use AsyncTask as from honeycomb you can't use network processes in your main thread(process) , search for async task


text:
Q: Beginner Question: Why is this inner for loop not incrementing in JS? Not sure if looking at code all day is making me blind, beside my natural ignorance, but I can't find out why I cannot get the inner look to throw its next item into  finalDataset. The intent is to generate a new array with some modifications. Appreciate any help.

const arr1 = [
  ["Header1", "Color", "Size"],
  ["Data1", "Blue", 16],
  ["Data2", "Red", 20],
  ["Data3", "Brown", 5],
]
const arr2 = [
  ["Name", "CorrectedColor", "Style"],
  ["Nike", "Black", "Rock"],
  ["Puma", "Purple", "Country"],
  ["ShingLing", "White", "Romantic"],
]

let finalDataset = [];
for (let a = 1; a < arr1.length; a++) {
  let newRow = arr1[a];
  for (let n = 1; n < arr2.length; n++) {
    newRow[0] = arr2[n][1];
    newRow[1] = arr2[n][2];
    newRow[2] = '-'
    console.log(newRow)
    finalDataset.push(newRow)
  }
}
console.log(finalDataset)

A: You're pushing references to the same array into finalDataset, so they all take the same value (and you're changing arr1 while you're at it - check with console.log(arr1) after your code completes). You can work around this by making copies of the arrays, e.g. using slice (you could also use e.g. [...newRow]):

const arr1 = [
  ["Header1", "Color", "Size"],
  ["Data1", "Blue", 16],
  ["Data2", "Red", 20],
  ["Data3", "Brown", 5],
]
const arr2 = [
  ["Name", "CorrectedColor", "Style"],
  ["Nike", "Black", "Rock"],
  ["Puma", "Purple", "Country"],
  ["ShingLing", "White", "Romantic"],
]

let finalDataset = [];
for (let a = 1; a < arr1.length; a++) {
  let newRow = arr1[a].slice(0);
  for (let n = 1; n < arr2.length; n++) {
    newRow[0] = arr2[n][1];
    newRow[1] = arr2[n][2];
    newRow[2] = '-'
    finalDataset.push(newRow.slice(0))
  }
}
console.log(finalDataset)

A: Notice that each time through the inner loop, it's modifying on the same newRow array, and then pushing that one array into finalDataset. In the end, finalDataset only has 4 distinct arrays in it, where each one is repeated 4 times (once per element of arr2). Also, you're inadvertently modifying the elements of arr1 through newRow.
As small change should give you something closer to what you're expecting, by creating a new array for newRow each time through the loop:

const arr1 = [
  ["Header1", "Color", "Size"],
  ["Data1", "Blue", 16],
  ["Data2", "Red", 20],
  ["Data3", "Brown", 5],
]
const arr2 = [
  ["Name", "CorrectedColor", "Style"],
  ["Nike", "Black", "Rock"],
  ["Puma", "Purple", "Country"],
  ["ShingLing", "White", "Romantic"],
]

let finalDataset = [];
for (let a = 1; a < arr1.length; a++) {
  for (let n = 1; n < arr2.length; n++) {
    let newRow = [arr2[n][1], arr2[n][2], '-'];
    finalDataset.push(newRow)
  }
}
console.log(finalDataset)

redpajama_set_name: RedPajamaStackExchange


text:
Q: get an accurate time with NTP, GPS and PPS as soon as possible Because I work with an astronomic application I need an accurate UTC time.
Now I use NTP with GPS with 1PPS over RS232 as refclock.
server 127.127.20.0 mode 18 minpoll 4 maxpoll 4 prefer
fudge 127.127.20.0 flag1 1 flag2 0 flag3 1 flag4 0 time2 0.475

I read that NTP is syncing the time by in- or decreasing the speed of hardware clock e.g. to avoid duplicate times if a step would be to large.
Because the computer is turned off from time to time NTP needs some time to get in sync. It depends how far the system clock was drifted away. If I'm wrong please correct me.
Is there a possibility to force the almost instant use of a prefered GPS time? Getting time sync even faster as usual would be also sufficient.
Actually, in an astronomic environment it's more important to have an accurate time asap than having a nice time shift algorithm which could be kind of slow.

A: When starting ntpd, the ntp deamon, there is an option q ( -q ) to cause ntp to immediately reset the time. The command "man ntpd" describes it and also the g option which you might want to use.
Most people prefer to do a quick time reset only on startup, by using the q option of ntpd (or the old way of doing it, ntpdate). Once the clock is set, you can use the standard startup command.
On many Linux systems, ntpd will be started at boot time, in which case the time will already be correct within 128 ms. If the computer is suspended or hibernated, the error could be greater though. A manual procedure to increase the accuracy would be:
sudo service ntp stop
sudo ntpd -q
sudo ntpd start


text:
Q: I want to export mount path as NFS share can any one suggest me the procedure?
below volume with btrfs filesystem shoulb be exported as NFS share
/dev/sdb on /btrfs type btrfs (rw,relatime,seclabel,space_cache)

A: You should read some howto e. g. https://help.ubuntu.com/community/SettingUpNFSHowTo, especially the section https://help.ubuntu.com/community/SettingUpNFSHowTo#Installation_and_Configuration
This should get you quite far already. Feel free to ask more specific questions if you are still having trouble setting up NFS shares.


text:
Q: Possible ways of installing Magento other than localhost server Currently I have tried Magento with XAMPP localhost. Eventually I'm experiencing a terrible slowness in loading up Magento. Hope anyone could help me out in finding a proper solution other than the localhost server.

A: either you can run magento into docker using virtual drive( but i have problem with that share data between that) or you can use AWS server, it is free for one year.
Hope it will help you.


text:
Q: How can I react to a riverpod FutureProvider by using ref.listen? final nextRouteProvider = FutureProvider<String>((ref) async {
  await Future.delayed(const Duration(seconds: 3));
  bool isAppFreshInstall = StorageManager.instance.isAppFreshInstall();
  if (isAppFreshInstall) {
    return AppRouter.onBoardingPath;
  } else {
    return AppRouter.loginPath;
  }
});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    ref.listen<Future<String>>(nextRouteProvider.future, (_, Future<String> path) async {
      context.go(await path);
    });

    return SplashScreen();
  }

The above logic is not working but it works well with StateNotifierProvider.
class RootViewNotifier extends StateNotifier<String> {
  RootViewNotifier() : super('/') {
    decideRootView();
  }

  void decideRootView() async {
    await Future.delayed(const Duration(seconds: 3));
    var storageManager = StorageManager.instance;
    if (storageManager.isAppFreshInstall()) {
      state = AppRouter.onBoardingPath;
    } else {
      state = AppRouter.loginPath;
    }
  }
}

final rootViewNotifierProvider =
    StateNotifierProvider<RootViewNotifier, String>(() => RootViewNotifier());

@override
  Widget build(BuildContext context, WidgetRef ref) {
    ref.listen<String>(rootViewNotifierProvider, (, String path) {
      context.go(path);
    });

   return SplashScreen();
 }

But the better way is to use FutureProvider which is not working in this case. So what's wrong with my code. How can I use FutureProvider with the same logic?

A: Listen to nextRouteProvider instead of nextRouteProvider.future
Like so:
ref.listen(
  nextRouteProvider,
  (AsyncValue<String>? _, AsyncValue<String> next) {
      context.go(next.asData!.value);
   },
);

A: The future provider is not intended to be used to notify changes. it is used only to notify when the data is  ready from an async source. Instead, to be notified, the only solution is the notifier provider, and to use it with async data:
Future<int> fetch() aynsc => 42;
class Whatever extends StateNotifier<AsyncValue<int>> {
    Whatever(): super(const AsyncValue.loading()) {
        _fetch();
    }
    Future<void> _fetch() async {
        state = const AsyncValue.loading();
        state = await AsyncValue.guard(() => fetch());
    }
}


text:
Q: Keeping a local copy of an objects member variable Is it worth keeping local variable of an objects member variable if I am going to use that variable multiple times? This would reduce the number of Getter calls, though I feel that might not be necessary.
Ex.
void Foo(Bar b){
  if(b.Dodos() == "skimpy")
    cout << "These Dodos are " << b.Dodos() << endl;
}

Assuming the code is complicated and b.Dodos() is called multiple times, does it make much of a difference to keep a local variable? i.e string bd = b.Dodos()? Especially if one can reasonably assume/know that the getter is just returning a member variable?
(Assume this has asked many times, but I can't find answer)

A: If the member function is just returning a member variable, then you likely won't get any benefit from assigning the result to a local variable, especially if you use inlining.  If the member function does a lot of work, then keeping a local copy of it can give you a huge performance improvement.  However, this only works correctly if the function is pure.  That is, if it always returns the same value when called with the same arguments.  If the function is both pure and expensive and is called in more than one other function, you might also consider trying the memoization technique.  This ensures that if the function is ever called with the same parameters, subsequent calls will involve just a lookup instead of the expensive calculation.
Besides efficiency, you should consider which strategy best follows the DRY principle, or if assigning to a variable will help reveal your intentions to the next person who reads the code (which may be you in the future).  For example, if you are calling the function with the same arguments multiple times, you should ask yourself if it's a coincidence that the arguments were the same.  If there was a change required, would that change affect all the calls in the same way, or could they affect the calls differently?  If the calls would all change together, then assigning to a variable will help with maintenance, but if they would change independently, then the variable would make maintenance more difficult.


text:
Q: how can i extract features from a document i have a document for which i want to extract features which are important .on that the selection should be such that each category has different columns or (descriptions).suppose if a category has 5 different selections . how will i know which is the important one ??
How can i select the features based upon some specific rules so that when any other document is fed into the model ,it should pick the most important categories and their selections even if same category might have different selections as well?


text:
Q: xcode identity not working I saw this page: No identities are available for signing Xcode 5
I created an identity and I downloaded it. It can't be imported to xcode in the organiser-archives page. When I try to import it, it is greyed out. When I double click the profile, it opens up to the devices page in the organiser window but does nothing. When I click download identities from developer center it refreshes the "No identities are available" pages and does nothing. Does anyone have any ideas? Thanks

A: Restart Xcode and do a Clean. Also cross check the certificate that you have created( Distribution / Ad-hoc)

A: Goto Xcode-> Preferences-> Accounts-> View Details, Refresh the Window. The Added profiles from Developer portal will get reflect on Xcode.


text:
Q: Retrieving unique results from a relationship I am developing a page where I want to display unique results from a relation and the entire result.
The entrie result I retreive it as follows:
$media = Media::whereHas('block', function ($query) {
            $query->where('identifier', "page");
        })->with(["texts" => function ($query) use ($language) {
            $query->where("language_id", $language->id);
        }])->get();

In the texts relation is a title field where I want to get only the unique results from.
I tried to do another query for it but it didn't work
$media = Media::whereHas('block', function ($query) use ($blockId) {
            $query->where('identifier', "page");
        })->with(["texts" => function ($query) use ($language) {
            $query->where("language_id", $language->id);
        }])->distinct("texts.title")->get();

How can I achieve that? and can I do it from the same result ( not another query )
edit:
what I want is a list of unique titles

A: Relationship queries are performed separately from the main query, any logic in retrieving relationships must go in the with function:
$media = Media::whereHas('block', function ($query) use ($blockId) {
            $query->where('identifier', $blockId);
        })->with(["mediaTexts" => function ($query) use ($language) {
            $query->where("language_id", $language->id)
                  ->select('title')
                  ->distinct();
        }])->get();

Here each Media object retrieved should have distinct titles in the mediaTexts relationship. If you want the entire relationship data things will get more complicated.
To get distinct titles of media texts among all Media objects after you've retrieved them you can do:
$media = Media::whereHas('block', function ($query) use ($blockId) {
            $query->where('identifier', $blockId);
        })->with("mediaTexts")->get();
$titles = $media->pluck('mediaTexts.title')->unique();


text:
Q: php xdebug: How to profile forked process I am running a PHP daemon to be profiled.
The started php process loads all required data, forks itself to distribute workload over all cores, waits for the forked children to finish, and collects the results generated by the children.
Since I am sharing CLI environment with other users, I need to start xdebug profiling by injecting php.ini values into the shell call.
 $ php -d xdebug.profiler_enable=1 -d xdebug.profiler_output_dir="/home/xxx" daemon.php

The generated cachegrind-file, how ever, profiles the parent and hence shows 90% sleep.
Is there a way to profile the workers without building a driver to load them directly?
Thanks

A: I ran into the same issue and solved without XDebug. Unfortunately I couldn't find a way with XDebug. It's like somehow it does not care about any forked process.
I solved by using Xhprof to profile and Xhgui to inspect the logs. Xhprof is a great tool internally developed by Facebook and then released afterwards open-source.
The cool thing is that you can decide exactly when to start profiling and when to stop. This gives you the ability to work around our issue.
So first of all let's get it installed!
sudo pecl install xhprof-beta

If you're using a debian based distro make sure you got also graphviz installed.
sudo apt-get install graphviz

Now let's take a look at the code.
$children = [];

do {
    if (count($children) < $maxConsumers) {
        $pid = pcntl_fork();
        $children[] = $pid;

        if ($pid == -1) {
            throw new \RuntimeException('Could not fork process');
        } else if ($pid === 0) {
            // we are the child

            if ($verbose) {
                $output->writeln(sprintf('Child here (PID = %s)', posix_getpid()));
            }

            if ($xhProf) {
                // here we enable xhprof thus the profiling starts
                xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
            }

            // DO YOUR MAGIC HERE!

            if ($xhProf) {
                // and here we call the xhgui header file that will
                // stop xhprof and write all the gathered data into
                // mongo or into a dedicated file
                require_once('/var/www/xhgui/external/header.php');
            }

            exit;
        } else {
            // we are the parent
            if ($verbose) {
                $output->writeln(sprintf('Parent here (PID = %s) spawned a new child (PID = %s)', posix_getpid(), $pid));
            }
        }
    } else {
        if ($verbose) {
            $output->writeln(sprintf("Parent - spawned enough children, let's wait them..."));
        }

        $deadPID = pcntl_wait($status);
        $children = array_diff($children, [$deadPID]);
} while (true);

// Waits for all remaining children
while (($pid = pcntl_waitpid(0, $status)) != -1) {
    if ($verbose) {
        $status = pcntl_wexitstatus($status);
        $output->writeln(sprintf("Child (PID %d) terminated. Status is %s.", $pid, $status));
    }
}

In order to inspect your logs you also need to configure Xhgui properly. You'll probably need a virtual host as well.
For all the needed configuration and for reference:

*

*xhprof github page

*xhprof php page

*xhgui github page

*tutorial by Davey Shafik part 1

*tutorial by Davey Shafik part 2

*tutorial by Davey Shafik part 3


text:
Q: Bootstrap Carousel is jumping because height of text is not equal to corresponding card I am haveing some trouble with the carousel class in bootstrap. I copied most of this code directly from w3 schools and then have modified a bit to fit my needs. The issue I am having is that when the second slide is of a different height than the section title the screen will jump.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">

Section title

Section Title

info

 some more info

 asdf

 asdf asdf a fasdf asfd fas df

asdf afsd f asd fasfd fasfasdfas

 asdf asf f as sfd f

I'm assuming that if the heights are the same the screen will not jump. The issue lies in the fact that it's text vs a card. Does anybody know how to set the height of the text div to be the same as it's corresponding card? Or is there some other solution I have not been able to find?
Note: My CSS file does not touch the functionality of any object within this bit of code.


text:
Q: Trying to update a google visualization using jquery I'm relatively inexperienced, so please bear with me.
I'm developing a simple dashboard using the Google visualization API.  I'm developing in vb.net.  I have the Annotated Timeline, the Intensity Map, and a set of tables on my apsx.
What I am trying to do is update the Intensity Map and tables based on the date range the user selects using the Annotated Timeline tool.
I was hoping to update only these visualizations without doing a full page load.  Apparently, a great way to do this is to separate the visualizations into self-contained aspx pages and use jQuery to "load" them into a div.
I say apparently, as this is not working.  When I try to update an aspx containing a Google visualization using jQuery, I get the message "Loading data from www.google.com..." in the browser and it just runs continuously and never returns.  I ran this by an experienced developer and he was stumped, but thought must be a conflict between the google API and jQuery.
Any tips, advice, alternative solutions are greatly appreciated!

A: just coded something that can help you. Tested for BarChart, ColumnChart, LineChart and AreaChart, for me works well (by design wouldn't work correctly for PieCharts).
Main constructor code:
function Charts (options){
    var self = this;
    self.chart = [];
    self.dataTable = new google.visualization.DataTable();
    self.settings = $.extend({
        colors:['#98D8F4','#E85500','#B3CF2F', '#FEB800', '#FFA1C5', '#D984FF', '#DD9D75'],
        width: 960, height: 600,
    }, options);
    self.add = function(type, element){
        self.chart.push({
            element: $(element),
            o: new google.visualization[type]($(element)[0]),
            draw: function(dataTable, options){
                this.element.html('');
                this.o.draw(dataTable, options);
            }
        });
    };
    self.draw = function(options){
        var settings = $.extend({}, this.settings, options);
        $.each(self.chart, function(i, chart){
            chart.draw(self.dataTable, settings)
        })
    };
    self.parseData = function(labels, legends, data){
        var countRows = data[0].length;
        self.dataTable.addColumn('string', 'Name');
        $.each(legends, function(i, legend){
            self.dataTable.addColumn('number', legend);
        })
        self.dataTable.addRows(countRows);
        $.each(labels, function(i, label){
            self.dataTable.setValue(i, 0, label);
            $.each(data, function(k, entry){
                self.dataTable.setValue(i, k+1, data[k][i]);
            })
        })
        return self.dataTable;
    };
}

You can simply pass data as array to construct charts (you must always parse data before call draw method)
var labels = [ "Kaspersky","Symantec","G-Data","Avira" ],
    legends = [ "Antivirensoftware (kostenpflichtig)","Antivirensoftware (kostenlos)","Internetsecurity (kostenpflichtig)","Internetsecurity (kostenlos)","Sonstiges, keine Angabe","Beta-Test KIS 2010", "Something Else" ],
    data = [ [46,4,7,33],[3,1,2,38],[42,12,14,7],[2,0,1,1],[43,8,14,18],[4,3,0,1],[1,2,4,2]];

besides that script is a little complicated, you can draw charts easily.
var charts = new Charts();
charts.parseData(labels, legends, data);
charts.add('ColumnChart', '#column-chart');
charts.add('BarChart', '#bar-chart');
charts.draw({title: 'Antivirus Comparison Chart', titleY:'Points'});

and refresh easily
charts.parseData(otherLabels, otherLegends, otherData);
charts.draw({title: 'Antivirus Comparison Chart with Other Data', titleY:'Points'});

hope it'll help you :)
Oh, and don't forget load libraries and include this script inside document ready function, e.g.
google.load("jquery", "1.3.2");
google.load('visualization', '1', {'packages':['piechart','barchart','columnchart']});
google.setOnLoadCallback(function() {

/* script here */

});


text:
Q: wordpress the_post method in custom category page not showing top viewed post I have Most viewed posts(in Customer Category), in home page I have added this widget and it works perfect, in detail page also it works perfect but in category page the same widget behaves strangely
$r = new WP_Query( array( 'tax_query' =>
                    array(
                        'relation' => 'OR',
                        array(
                            'taxonomy' => 'custcategory',
                            'field' => 'term_id',
                            'terms' => array(10)),
                        ),
                        'category__in'=>array(10),
                        'post_type'=> $post_type ,
                        'posts_per_page' => $number,
                        'meta_key' => 'post_views_count',
                        'orderby' => 'meta_value_num',
                        'order' => 'DESC'  ) );

if ($r->have_posts()) :
    // Enters this block in home page and detail page
    while ( $r->have_posts() ) : $r->the_post();
else:
    // Enters this block in category page

Anyone know why this strange behavior is?

A: Maybe you have some filter that is affecting categories page, add this to your query args:
'suppress_filters' => true

You can also try adding wp_reset_query() after your main query, but this should not be necessary because you are declaring a new WP_Query.

A: I just realize that your query args are wrong. You have set a relation, but you only have one taxonomy array. Also you don't need the 'category__in'=>array(10) argument, it is only for the default taxonomy "category" and you want only posts from your custom taxonomy "custcategory", isn't it?
Your query should be:
$r = new WP_Query( array(
    'tax_query' => array(
        array(
            'taxonomy' => 'custcategory',
            'field' => 'term_id',
            'terms' => array(10)
        ),
    ),
    'post_type'=> $post_type ,
    'posts_per_page' => $number,
    'meta_key' => 'post_views_count',
    'orderby' => 'meta_value_num',
    'order' => 'DESC'
));


text:
Q: Modify data.frames differently named through loop I have an excell file with 4 sheets. I am planning on making a script allowing me to modify them throught loop because some modification will apply to all sheets and some of them not.
I started with loading data and naming each of data.frame with a name of a sheet.
## Parameters ##
var_data_name <- "Random data.xlsx"
var_number_of_data <- 4
var_data_names <- c("Tim", "Jack", "Tom", "Jerry")

for(i in 1:var_number_of_data){
  assign(paste("MS_data", var_data_names[i], sep = "_"), MS_data <- read.xlsx(var_data_name, sheetIndex = i))
}

I do it within a loop because number of sheets/data.frames may change and I would like to set it at the begining.
Then my problem starts. I would like to start modyfing them and I have no idea how to "call" them "refer" to them. No idea even how to say it in english. For example in each of formed data frames I would like to remove first and last column. Next, I have some specific modifications for each of data frame, like lets crop/take only first 10 rows from data.frame1 and 11-20 rows from data.frame2, 21-30 rows from data.frame3, etc.
I think that I will manage it as soon as I realize how to refer to all of formed data frames or how to refer to a specific one.
Lets assume that all of sheets have the same content just different names to avoid dputing all of them.
> dput(MS_data_Jack)
structure(list(NA. = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72), Sample.Name = c(1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72), Sample.ID = c(NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA), Sample.Type = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = "Unknown", class = "factor"), File.Name = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Data", class = "factor"),
    Intensity = c(7520, 7770, 11300, 3400, 1750, 2230, 1270,
    1830, 1400, 773, 308, 858, 1430, 672, 801, 501, 486, 300,
    243, 215, 415, 243, 186, 243, 329, 415, 401, 415, 286, 486,
    787, 558, 544, 258, 215, 300, 343, 258, 300, 358, 229, 315,
    300, 222, 186, 236, 300, 687, 858, 272, 544, 315, 401, 343,
    386, 243, 558, 215, 429, 458, 1570, 1950, 2370, 601, 644,
    615, 615, 272, 272, 286, 200, 415), Height = c(2210, 1720,
    3080, 1030, 802, 360, 477, 401, 372, 361, 130, 490, 291,
    225, 320, 187, 236, 125, 100, 105, 140, 209, 260, 262, 221,
    261, 203, 340, 181, 381, 460, 301, 142, 260, 142, 262, 201,
    151, 120, 300, 101, 141, 144, 105, 107, 176, 201, 241, 285,
    262, 144, 160, 241, 263, 123, 206, 221, 142, 140, 280, 822,
    454, 621, 201, 220, 454, 300, 185, 161, 120, 141, 211), Random = structure(c(1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "N/A", class = "factor"),
    Standard = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L), .Label = "N/A", class = "factor"), Record = c(NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
    NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), Modify = c(0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Count = c(0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), Data = structure(c(1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "N/A", class = "factor")), class = "data.frame", row.names = c(NA,
-72L))


text:
Q: C# Excessive Garbage Collection - Large Strings, G2 pressure? I'm writing a high-ish volume web service in C# running in 64-bit IIS on Win 2k8 (.NET 4.5) that works with XML payloads and does a variety of operations on small and large objects (where the large objects are mainly strings, some over 85k (so going onto the LOH)).  Requests are stateless, and memory usage remains steady over time.  Lots of memory is being allocated and released per request, no memory appears to be being leaked.
Operating at a maximum of 25 transactions per second, with an average call lasting 5s, it's spending 40-60% of it's time in GC according to two profiling tools, and perfmon shows a steady 20 G0 and G1 collections over 5 seconds, and 15 G2 collections over 5 seconds - meaning lots of (we think) premature promtion into G2 for data that we'd expect to stay in G0.  Everything I read indicates this is very excessive.  We expect that the system should be able to perform at a higher throughput than 25 tps and assume the GC activity is preventing this.
The machines serving the requests have lots of memory - 16GB - and the application, under load, consumes at most 1GB when under load for an hour.  I understand that a bigger heap won't necessarily make things better, but there is spare memory.
I appreciate this is light on specifics (will try to recreate the conditions with a trivial application if time permits) - but can anyone explain why we see so much G2 GC activity?  Should I be focusing on the LOH?  People keep telling me that the CLR's GC "adapts" to your load, but it's not changing it's behavior in this case and, unlike other runtimes, there seems to be little I can do to tune it (have tried workstation GC, but there is very little observable difference).

A: Microsoft decided to design the String class so that all strings are stored in memory as a monolithic sequence of characters.  While this works well for some usage patterns, it works dreadfully for others.
One thing I've found very helpful is to avoid creating instances of String whenever possible.  If a method will often be used to operate on part of a supplied string, and will in turn ask other methods to operate on parts of it, the methods should accept arguments specifying the range of the String upon which they should operate.  This will avoid the need for callers of the first method to use Subst to construct a new String for the method to act upon, and will avoid the need to have the method call Subst to feed portions of the string to its callers.  In some cases where I have used this technique, the creation of thousands of String instances--some quite large--could be replaced with zero.

A:
CLR's GC "adapts" to your load

It can't know how much memory you are willing to tolerate as overhead. Here, you probably want to give the app like 5GB of heap so that collections are much rarer. The GC has no built-in tuning knobs for that (subjective note: that's a pitty).
You can force bigger heap sizes by using one of the low latency modes for short durations. That should cause the GC to try hard to avoid G2 collections. Monitor the RAM usage and disable low latency mode when consumption reaches 5GB.
This is a risky strategy but it's the best I think you can do.
I would not do it. You can maximally gain 2x throughput. Your CPU is maxed out, right? Workstation GC does not scale to multiple cores and leaves CPUs unused.


text:
Q: Over Current/Short Circuit Protection Using op-amp and MOSFET I wanted a circuit to limit the current to say 4A, and found this but it doesn't work in the Proteus simulator. What's wrong with this circuit? anyways to improve it?
here is my expectation of the circuit:
when the inverting input is higher then the non-inverting one, the MOSFET turns off and now non-inverting input is higher so roughly Vcc appears on gate of MOSFET and turns it on again, is it true?  if this happens we have pulses of full current passing through the FET and load... shouldn't it go and stay off until the short-circuit disappears?

A: Where did you find this circuit?  Please post a link.
When you say it doesn't work, what does that mean?  What does it do / not do?
What is the purpose of R4?
A minor problem is that the output stage of an LM358 cannot swing all the way down to GND.  It can get close, but whether or not this is enough to turn off Q1 when VR1 is dialed all the way down depends on the FET's datasheet.
4 A through 1 ohm (R1) will generate 16 W, so you will need something larger than a 2 W part.  Also, at 4 A the voltage drop across R1 will be 4 V.  You don't say what Vcc is, but whatever load this is driving will not see the full Vcc across it.
To your question:  Given that we have almost zero information to work with, my guess is that R4 is creating positive feedback and is causing U1 (the opamp) to saturate.  Does this sound like a fit for the symptoms you are seeing?


text:
Q: Take some values from xml in SQL Server 2008 I want get the values (Created, RecordLocator) from my xml under the <TicketHeader> element, but I can't
My xml is:
<Main>
  <Export>
    <Date>2015-07-06</Date>
    <Time>11:57:39</Time>
    <FromDate>2015-07-06</FromDate>
    <ToDate>2015-07-06</ToDate>
  </Export>
  <Tickets>
    <Ticket No="831-9275972480" Status="Issued" Type="Electron" SignInBooking="3OSWS" SignInTicketing="72" ReissueNo="">
      <TicketHeader>
        <History Ticketing="2015-07-06" Void="" Refund="" Reissue="" />
        <Created>2015-07-06 11:29:00</Created>
        <Modified />
        <ModifiedBy />
        <ClientCompanyName />
        <ClientNumber />
        <DistrubutorName />
        <DistributorNumber />
        <RecordLocator>RK3HDW</RecordLocator>
        <Subagent />
        <Interline>N</Interline>
        <TicketStatus>OK</TicketStatus>
        <TKTcoupons />
        <GlobalCouponStatus />
        <TermID>BDB7F9</TermID>
        <MIRdev>FED02B</MIRdev>
        <TransBeforeTKT>016</TransBeforeTKT>
        <AutoPrice>N</AutoPrice>
        <BookedDirectly>N</BookedDirectly>
        <FrequentFlyer />
        <FareCalc>ZAG OU DBV 92.00OU ZAG 92.00 HRK184.00END XT 125.00ZS110.00YQ</FareCalc>
        <Routing>ZAG-DBV-ZAG</Routing>
        <ItineraryIndicator>D</ItineraryIndicator>
        <PNRCreationDate>2015-07-03</PNRCreationDate>
        <OfficeID Booking="3OS " TR="" Ticketing="3OS " />
        <Contacts>ZAGN*385915885134__ZAGT*00385 1 6329-100 AVIOKARTE.HR-IP__ZAGE*AVIOKARTE//AVIOKARTE.HR</Contacts>
        <TktAgentTitle />
        <TktOfficeTitle>3OS</TktOfficeTitle>
        <BookingOfficeTitle>3OS</BookingOfficeTitle>
        <IATA>75321164</IATA>
        <ValidAirlineName>CROATIA AIRLINES</ValidAirlineName>

and my sql code goes like tihs:
CREATE TABLE _GoLink_Xml
(
      RecordId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
      XmlData XML NOT NULL
)
GO

INSERT INTO _GoLink_Xml(XmlData)
SELECT *
FROM OPENROWSET(
   BULK 'C:\golink_0607.xml', SINGLE_BLOB)
AS ImportSource
GO

SELECT
   ExportDate = ColExport.value('(Date)[1]', 'date') ,
   ExportTime = ColExport.value('(Time)[1]', 'time'),
   ExportFromDate = ColExport.value('(FromDate)[1]', 'date'),
   ExportToDate = ColExport.value('(ToDate)[1]', 'date'),
   -- use the @Status to get the XML attribute (not element!) for "Status"
   TicketNo=ColTicketNo.value('@No','varchar(50)'),
   TicketStatus = ColTicketStatus.value('@Status','varchar(50)') ,
   TicketType = ColTicketType.value('@Type','varchar(50)') ,
   TicketSignInBooking = ColTicketSignInBooking.value('@SignInBooking','varchar(6)'),
   TicketReissueNo = ColTicketReissueNo.value('@ReissueNo','varchar(6)'),
   TicketHeaderTicketing = ColHeaderTicketing.value('@Ticketing','date'),
   TicketHeaderVoid = ColHeaderTicktVoid.value('@Void','varchar(50)'),
   TicketHeaderCreated = ColHeaderCreated.value('(Created/text())[1]','datetime'),
   TicketHeaderRecordLocator = ColHeaderRecordLocator.value('@RecordLocator','varchar(6)'),
   TicketHeaderBooking = ColHeaderTicktBooking.value('@Booking','varchar(50)'),
   TicketHeaderTicketing = ColHeaderTicktTicketing.value('@Ticketing','varchar(50)'),
   TicketHeaderContacts = ColHeaderContacts.value('(Contacts)[1]','varchar(max)'),
   Currency = Currency.value('@Currency','varchar(5)'),
   Value = Value.value('@Value','decimal(18,2)'),
   RateHRK = RateHrk.value('(Rate)[1]','decimal(18,2)')

  -- TicketHeaderRecordLocator = ColHeaderRecordLocator.value('(RecordLocator)[1]','varchar(6)')
FROM
   _GoLink_Xml
    CROSS APPLY
   -- the nodes <Main>/<Export> have some base data
   XmlData.nodes('Main/Export') AS XT1(ColExport)
    CROSS APPLY
   -- the nodes <Main>/<Tickets>/<Ticket> have ticket-related data
   XmlData.nodes('Main/Tickets/Ticket') AS XT2(ColTicketStatus)
   CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT3(ColTicketNo)
   CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT4(ColTicketType)
    CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT5(ColTicketSignInBooking)
    CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT6(ColTicketReissueNo)
    CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket/TicketHeader/History') AS XT7(ColHeaderTicketing)
   CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/History') AS XT8(ColHeaderTicktVoid)
    CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Created') AS XT9(ColHeaderCreated)
    CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/RecordLocator') AS XT10(ColHeaderRecordLocator)
    CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/OfficeID') AS XT11(ColHeaderTicktBooking)
    CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/OfficeID') AS XT12(ColHeaderTicktTicketing)
    CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Contacts') AS XT13(ColHeaderContacts)
       CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Rate') AS XT14(Currency)
       CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Rate') AS XT15(Value)
   CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/RateHRK') AS XT16(RateHrk)

but without results, can anyone help for resolve this?
Thanks

Now i read whole XML and my query goes like:
SELECT
   ExportDate = ColExport.value('(Date)[1]', 'date') ,
   ExportTime = ColExport.value('(Time)[1]', 'char(10)'),
   ExportFromDate = ColExport.value('(FromDate)[1]', 'date'),
   ExportToDate = ColExport.value('(ToDate)[1]', 'date'),
   -- use the @Status to get the XML attribute (not element!) for "Status"
   TicketNo=ColTicketHeader.value('@No','varchar(50)'),
   TicketStatus = ColTicketHeader.value('@Status','varchar(50)') ,
   TicketType = ColTicketHeader.value('@Type','varchar(50)') ,
   TicketSignInBooking = ColTicketHeader.value('@SignInBooking','varchar(6)'),
   TicketReissueNo = ColTicketHeader.value('@ReissueNo','varchar(6)'),
   TicketHeaderTicketing = ColHisotry.value('@Ticketing','date'),
   TicketHeaderVoid = ColHisotry.value('@Void','varchar(50)'),
   TicketHeaderCreated = ColTicketHeaderr.value('(Created)[1]','datetime'),
   TicketHeaderRecordLocator = ColTicketHeaderr.value('(RecordLocator)[1]', 'varchar(25)'),
   TicketStatus = ColTicketHeaderr.value('(TicketStatus)[1]', 'varchar(25)'),
   TermiID = ColTicketHeaderr.value('(TermID)[1]', 'varchar(25)'),
   PNRCreationDate = ColTicketHeaderr.value('(PNRCreationDate)[1]', 'date'),
   BookingOffice = ColOfficeID.value('@Booking','varchar(50)'),
   TicketingOffice = ColOfficeID.value('@Ticketing','varchar(50)'),
   Routing = ColTicketHeaderr.value('(Routing)[1]', 'varchar(100)'),
   AirlineName = ColTicketHeaderr.value('(ValidAirlineName)[1]', 'varchar(100)'),
   AirlineCode = ColTicketHeaderr.value('(ValidatingCarrier)[1]', 'varchar(5)'),
   Currency = ColRate.value('@Currency','varchar(5)'),
   Value = ColRate.value('@Value','decimal(18,2)'),
   RateHRK = ColTicketHeaderr.value('(RateHRK)[1]', 'decimal(18,2)'),
   ConvertationRate = ColTicketHeaderr.value('(ConvertationRate)[1]', 'decimal(18,4)'),
   Comission = ColTicketHeaderr.value('(Comission)[1]', 'varchar(50)'),
   FOP = ColTicketHeaderr.value('(FP)[1]', 'varchar(50)'),
   ServiceFee = ColSFee.value('@Main','decimal(18,2)'),
   Discount = ColTicketHeaderr.value('(Discount)[1]', 'decimal(18,2)'),
   AirlinePayTotal = ColTicketHeaderr.value('(AirlinePayTotal)[1]', 'varchar(20)'),
   TaxCurr = ColTax.value('@Curr','varchar(5)'),
   TaxValue = ColTax.value('@Value','decimal(18,2)'),
   OrderNo= ColPax.value('@No','int'),
   OrderLastName= ColPax.value('@LastName','varchar(100)'),
   OrderFirstName= ColPax.value('@FirstName','varchar(100)'),
   [No]= ColAirSegment.value('@No','int'),
   BookingClass= ColAirSegment.value('@Class','varchar(5)'),
   FlightNO = ColAirSegment.value('(FlightNo)[1]', 'varchar(20)'),
   FlightDurationTime = ColAirSegment.value('(FlightDurationTime)[1]', 'varchar(20)'),
   GeographicalMileage = ColAirSegment.value('(GeographicalMileage)[1]', 'varchar(20)'),
   Meal = ColAirSegment.value('(Meal)[1]', 'varchar(5)'),
   DepartureDate = ColDeparture.value('@Date','date'),
   DepartureTime = ColDeparture.value('@Time','char(10)'),
   ArrivalDate = ColArrival.value('@Date','date'),
   ArrivalTime = ColArrival.value('@Time','char(10)'),
   BoardCity = ColBoard.value('@City','varchar(50)'),
   BoardCityCode = ColBoard.value('@Point','varchar(50)'),
   OffCity = ColOff.value('@City','varchar(50)'),
   OffCityCode = ColOff.value('@Point','varchar(50)'),
   BaggageAllowance= ColAirSegment.value('(BaggageAllowance)[1]', 'varchar(20)')

FROM
   _GoLink_Xml
    CROSS APPLY

   XmlData.nodes('Main/Export') AS XT1(ColExport)
    CROSS APPLY

    XmlData.nodes('Main/Tickets/Ticket') AS XT2(ColTicketHeader)
        CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/History') AS XT3(ColHisotry)
         CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader') AS XT4(ColTicketHeaderr)
     CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/OfficeID') AS XT5(ColOfficeID)
      CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Rate') AS XT6(ColRate)
      CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/ServiceFee') AS XT7(ColSFee)
      CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/TicketHeader/Taxes') AS XT8(ColTax)
      CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/NE') AS XT9(ColPax)
         CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/AirSegments/AirSegment') AS XT10(ColAirSegment)
        CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/AirSegments/AirSegment/Departure') AS XT11(ColDeparture)
        CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/AirSegments/AirSegment/Arrival') AS XT12(ColArrival)
           CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/AirSegments/AirSegment/Board') AS XT13(ColBoard)
         CROSS APPLY
    XmlData.nodes('Main/Tickets/Ticket/AirSegments/AirSegment/Off') AS XT14(ColOff)

for XML
<Main>
  <Export>
    <Date>2015-07-06</Date>
    <Time>11:57:39</Time>
    <FromDate>2015-07-06</FromDate>
    <ToDate>2015-07-06</ToDate>
  </Export>
  <Tickets>
    <Ticket No="831-9275972480" Status="Issued" Type="Electron" SignInBooking="3OSWS" SignInTicketing="72" ReissueNo="">
      <TicketHeader>
        <History Ticketing="2015-07-06" Void="" Refund="" Reissue="" />
        <Created>2015-07-06 11:29:00</Created>
        <Modified />
        <ModifiedBy />
        <ClientCompanyName />
        <ClientNumber />
        <DistrubutorName />
        <DistributorNumber />
        <RecordLocator>RK3HDW</RecordLocator>
        <Subagent />
        <Interline>N</Interline>
        <TicketStatus>OK</TicketStatus>
        <TKTcoupons />
        <GlobalCouponStatus />
        <TermID>BDB7F9</TermID>
        <MIRdev>FED02B</MIRdev>
        <TransBeforeTKT>016</TransBeforeTKT>
        <AutoPrice>N</AutoPrice>
        <BookedDirectly>N</BookedDirectly>
        <FrequentFlyer />
        <FareCalc>ZAG OU DBV 92.00OU ZAG 92.00 HRK184.00END XT 125.00ZS110.00YQ</FareCalc>
        <Routing>ZAG-DBV-ZAG</Routing>
        <ItineraryIndicator>D</ItineraryIndicator>
        <PNRCreationDate>2015-07-03</PNRCreationDate>
        <OfficeID Booking="3OS " TR="" Ticketing="3OS " />
        <Contacts>ZAGN*385915885134__ZAGT*00385 1 6329-100 AVIOKARTE.HR-IP__ZAGE*AVIOKARTE//AVIOKARTE.HR</Contacts>
        <TktAgentTitle />
        <TktOfficeTitle>3OS</TktOfficeTitle>
        <BookingOfficeTitle>3OS</BookingOfficeTitle>
        <IATA>75321164</IATA>
        <ValidAirlineName>CROATIA AIRLINES</ValidAirlineName>
        <ValidatingCarrier>OU</ValidatingCarrier>
        <Rate Currency="HRK" Value="184.00" />
        <RateHRK>0.00</RateHRK>
        <ConvertationRate>0.0000</ConvertationRate>
        <TourCode />
        <Comission>0.00A</Comission>
        <CommisAmt Curr="HRK" Value="0.00" />
        <FP>INVOICE</FP>
        <CreditCard />
        <AirRecLoc>1A-8FDQTV</AirRecLoc>
        <Endorsement>OU ONLY/ /REFUND NOT PERMITTED/ </Endorsement>
        <Amount>635.00</Amount>
        <ServiceFee Main="0.00" VAT="0.00" />
        <Discount>0.00</Discount>
        <ClientToPay>0.00</ClientToPay>
        <AirlinePayTotal>635,00</AirlinePayTotal>
        <NetEarnedExclTaxes>0,00</NetEarnedExclTaxes>
        <AgentCountry>HR </AgentCountry>
        <Remarks>from

          <Remark />
          <Remark1 />
          <Remark2>DI.FA2: DI.FA3: IGOR DI.FA4: JURISIC DI.FA5: OGRIZOVICEVA 34 DI.FA6: 10000 DI.FA7: ZAGREB DI.FA8: HR DI.FA9: BT DI.FA10: 03072015 DI.FA13: 385915885134 DI.FA20: DI.FA21: HRK 368 902 40 DI.FA30: UHR </Remark2>
          <Remark3 />
        </Remarks>
        <Taxes Curr="HRK" Value="451.00">
          <Tax Curr="HRK" Value="206.00" TC="HR" NC="" />
          <Tax Curr="HRK" Value="10.00" TC="MI" NC="" />
          <Tax Curr="HRK" Value="110.00" TC="YQ" NC="" />
          <Tax Curr="HRK" Value="125.00" TC="ZS" NC="" />
        </Taxes>
        <CarrierTKTFees />
      </TicketHeader>
      <NE No="1" LastName="JURISIC" FirstName="IGORMR" Title="" text="ADT" />
      <AirSegments>
        <AirSegment No="01" Class="U">
          <ServicingCarrier>OU</ServicingCarrier>
          <ServicingCarrierName>CROATIA AIRLINES</ServicingCarrierName>
          <OpratingCarrierName />
          <FlightNo>660</FlightNo>
          <SeatNumber />
          <FlightDurationTime>0055</FlightDurationTime>
          <GeographicalMileage>00245</GeographicalMileage>
          <Meal>N</Meal>
          <MealSSR />
          <AirClass>U</AirClass>
          <Departure Date="2015-10-02" Time="05:50:00" />
          <Arrival Date="2015-10-02" Time="06:45:00" />
          <Board City="ZAGREB" Point="ZAG" Terminal="" />
          <Off City="DUBROVNIK" Point="DBV" Terminal="" />
          <FareBasis>UPROM</FareBasis>
          <BaggageAllowance>1PC</BaggageAllowance>
          <Equipment>319</Equipment>
          <WCHR />
          <ACRecLoc />
        </AirSegment>
        <AirSegment No="02" Class="U">
          <ServicingCarrier>OU</ServicingCarrier>
          <ServicingCarrierName>CROATIA AIRLINES</ServicingCarrierName>
          <OpratingCarrierName />
          <FlightNo>669</FlightNo>
          <SeatNumber />
          <FlightDurationTime>0055</FlightDurationTime>
          <GeographicalMileage>00245</GeographicalMileage>
          <Meal>N</Meal>
          <MealSSR />
          <AirClass>U</AirClass>
          <Departure Date="2015-10-06" Time="21:20:00" />
          <Arrival Date="2015-10-06" Time="22:15:00" />
          <Board City="DUBROVNIK" Point="DBV" Terminal="" />
          <Off City="ZAGREB" Point="ZAG" Terminal="" />
          <FareBasis>UPROM</FareBasis>
          <BaggageAllowance>1PC</BaggageAllowance>
          <Equipment>319</Equipment>
          <WCHR />
          <ACRecLoc />
        </AirSegment>
      </AirSegments>
    </Ticket>
  </Tickets>
</Main>

I got 32 records, some record are multiple, i need to put some distinct.
Also plan is put some information in additional table...
Maybe you have answer?
Thank you

A: Should be pretty straightforward (if you have valid XML - what you posted isn't valid).
Try something like this:
SELECT
    ColTicketHeader.value('(RecordLocator)[1]', 'varchar(25)'),
    ColTicketHeader.value('(Created)[1]', 'datetime')
FROM
   _GoLink_Xml
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket/TicketHeader') AS XT7(ColTicketHeader)

Also: why on earth are you cross applying the same XPath multiple times??
CROSS APPLY
   -- the nodes <Main>/<Tickets>/<Ticket> have ticket-related data
   XmlData.nodes('Main/Tickets/Ticket') AS XT2(ColTicketStatus)
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT3(ColTicketNo)
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT4(ColTicketType)
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT5(ColTicketSignInBooking)
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT6(ColTicketReissueNo)

That makes no sense at all - just use
CROSS APPLY
   XmlData.nodes('Main/Tickets/Ticket') AS XT2(ColTicket)

and then let all the details you need from <Ticket> refer to this one, single XT2(ColTicket) pseudo table/column - will make your T-SQL much simpler and easier to understand!


text:
Q: To what extent does the $(\mathfrak{g},K_{\infty})$ module determines the automorphic representation? In this question, we will follow the notations and definitions from the book "Automorphic Representations and L-Functions for the General Linear Group" by Goldfeld and Hundley. For simplicity, let's focus of $GL_2$. The definition of an (cuspidal) automorphic representation with central character $\omega$ is given in Definition 5.1.12, (5.1.14), where $\omega$ is a unitary Hecke character
$$\omega: \mathbb{Q}^{\times} \backslash \mathbb{A}_{\mathbb{Q}}^{\times} \rightarrow \mathbb{C}^{\times}$$
i.e. it is a smooth $(\mathfrak{g},K_{\infty}) \times GL(2,\mathbb{A}_{\text{finite}})$-module which is also isomorphic to a subquotient of the complex vector space of adelic (cusp) automorphic forms. As I literally know nothing about the theory of automorphic representations, I have two questions to bother the community.

*

*Suppose we have two cuspidal automorphic representations with the same central character $\omega$, and if they are isomorphic as $(\mathfrak{g},K_{\infty}) $ modules, are they isomorphic as automorphic representations? If not, do the two automorphic representations have any relations?

*Given a $(\mathfrak{g},K_{\infty}) $ module, how to check whether there exists a cuspidal automorphic representation whose local representation at $\infty$ is just this module? E.g. in order for this to be true, are there restrictions on this module? On the other hand, if there exists such a cuspidal automorphic representation, is it unique?
Any references are welcomed!

A: 1) No, two distinct cuspidal automorphic representations can have the same underlying $(\mathfrak{g},K)$-module. In particular, if the $(\mathfrak{g},K)$-module is a weight $k$ discrete series, then the cuspidal automorphic representations corresponds to a holomorphic newform of weight $k$, and there are plenty of these. On the other hand, if the $(\mathfrak{g},K)$-module is a principal series representation, then there conjecturally are very few cuspidal automorphic representations that share the same $(\mathfrak{g},K)$-module, though they do exist: the known ones are quadratic twists. See my recent paper for further discussion on this problem.
2) For weight $k$ discrete series, there are formulae for the dimensions of spaces of holomorphic cusp forms of weight $k$, so this is easily done. For principal series, this is a very hard question. These correspond to Maass cusp forms, so you are asking whether given a positive real number $\lambda$, there exists a Maass cusp form with Laplacian eigenvalue $\lambda$. We only explicitly know a very thin sequence of such Laplacian eigenvalues, namely those corresponding to Hecke Größencharaktere, whose Laplacian eigenvalues are related to logarithms of fundamental units of real quadratic fields.


text:
Q: Why does FxCop think initializing fields to the default value is bad?  When assigning a default default-value to a field (here false to a bool), FxCop says:
Resolution   : "'Bar.Bar()' initializes field 'Bar.foo'
               of type 'bool' to false. Remove this initialization
               because it will be done automatically by the runtime."

Now, I know that code as int a = 0 or bool ok = false is introducing some redundancy, but to me it seems a very, very good code-practice, one that my teachers insisted on righteously in my opinion.
Not only is the performance penalty very little, more importantly: relying on the default is relying on the knowledge of each programmer ever to use a piece of code, on every datatype that comes with a default. (DateTime?)
Seriously, I think this is very strange: the very program that should protect you from making all too obvious mistakes, is suggesting here to make one, only for some increased performance?  (we're talking about initialization code here, only executed once!  Programmers who care that much, can of course omit the initialization (and should probably use C or assembler :-) ).
Is FxCop making an obvious mistake here, or is there more to it?

Two updates :

*

*This is not just my opinion, but what I have been taught at university
(Belgium). Not that I like to use an
argumentum ad verecundiam, but
just to show that it isn't just my
opinion. And concerning that:

*My apologies, I just found this one:
Should I always/ever/never initialize object fields to default values?

A: Reed Copsey said specifying default values for fields impacts performance, and he refers to a test from 2005.
public class A
{
    // Use CLR's default value
    private int varA;
    private string varB;
    private DataSet varC;
}

public class B
{
    // Specify default value explicitly
    private int varA = 0;
    private string varB = null;
    private DataSet varC = null;
}

Now eight years and four versions of C# and .NET later I decided to repeat that test under .NET Framework 4.5 and C# 5, compiled as Release with default optimizations using Visual Studio 2012. I was surprised to see that there is still a performance difference between explicitly initializing fields with their default values and not specifying a default value. I would have expected the later C# compilers to optimize those constant assignments away by now.

No init: 512,75    Init on Def: 536,96    Init in Const: 720,50
Method No init: 140,11    Method Init on Def: 166,86

(the rest)
So I peeked inside the constructors of classes A and B in this test, and both are empty:
.method public hidebysig specialname rtspecialname
    instance void .ctor () cil managed
{
    // Code size 7 (0x7)
    .maxstack 8

    IL_0000: ldarg.0
    IL_0001: call instance void [mscorlib]System.Object::.ctor()
    IL_0006: ret
} // end of method .ctor

I could not find a reason in the IL why explicitly assigning default constant values to fields would consume more time. Apparently the C# compiler does optimize the constants away, and I suspect it always did.
So, then the test must be wrong... I swapped the contents of classes A and B, swapped the numbers in the result string, and reran the tests. And lo and behold now suddenly specifying default values is faster.

No init: 474,75    Init on Def: 464,42    Init in Const: 715,49
Method No init: 141,60    Method Init on Def: 171,78

(the rest)
Therefore I conclude that the C# compiler correctly optimizes for the case where you assign default values to fields. It makes no performance difference!

Now we know performance is really not an issue. And I disagree with Reed Copsey's statement "The 'extra' code, even if it was harmless, suggests that it is there for a reason, which reduces maintainability." and agree with Anders Hansson on this:

Think long term maintenance.

*

*Keep the code as explicit as possible.

*Don't rely on language specific ways to initialize if you don't have to. Maybe a newer version of the language will work differently?

*Future programmers will thank you.

*Management will thank you.

*Why obfuscate things even the slightest?

  Future maintainers may come from a different background. It really isn't about what is "right" it is more what will be easiest in the long run.

A: FxCop has to provide rules for everyone, so if this rule doesn't appeal to you, just exclude it.
Now, I would suggest that if you want to explicitly declare a default value, use a constant (or static readonly variable) to do it.  It will be even clearer than initializing with a value, and FXCop won't complain.
private const int DEFAULT_AGE = 0;

private int age = 0; // FXCop complains
private int age = DEFAULT_AGE; // FXCop is happy

private static readonly DateTime DEFAULT_BIRTH_DATE = default(DateTime);

private DateTime birthDate = default(DateTime); // FXCop doesn't complain, but it isn't as readable as below
private DateTime birthDate = DEFAULT_BIRTH_DATE; // Everyone's happy

A: FX Cop sees it as adding unnecessary code and unnecessary code is bad.  I agree with you, I like to see what it's set to, I think it makes it easier to read.
A similar problem we encounter is, for documentation reasons we may create an empty constructor like this
/// <summary>
/// a test class
/// </summary>
/// <remarks>Documented on 4/8/2009  by richard</remarks>
public class TestClass
{
    /// <summary>
    /// Initializes a new instance of the <see cref="TestClass"/> class.
    /// </summary>
    /// <remarks>Documented on 4/8/2009  by Bob</remarks>
    public TestClass()
    {
        //empty constructor
    }
}

The compiler creates this constructor automatically, so FX cop complains but our sandcastle documentation rules require all public methods to be documented, so we just told fx cop not to complain about it.

A: It's relies not on every programmer knowing some locally defined "corporate standard" which might change between at any time, but on something formally defined in the Standard. You might as well say "don't using x++ because that relies on the knowledge of every programmer.

A: You have to remember that FxCop rules are only guidelines, they are not unbreakable.  It even says so on the page for the description of the rule you mentioned (http://msdn.microsoft.com/en-us/library/ms182274(VS.80).aspx, emphasis mine):
When to Exclude Warnings:
Exclude a warning from this rule if the constructor calls another constructor in the same or base class that initializes the field to a non-default value. It is also safe to exclude a warning from this rule, or disable the rule entirely, if performance and code maintenance are not priorities.
Now, the rule isn't entirely incorrect, but like it says, this is not a priority for you, so just disable the rule.

A: There can be significant performance benefits from this, in some cases.  For details, see this CodeProject article.
The main issue is that it is unnecessary in C#.  In C++, things are different, so many professors teach that you should always initialize.  The way the objects are initialized has changed in .NET.
In .NET, objects are always initialized when constructed.  If you add an initializer, it's possible (typical) that you cause a double initialization of your variables.  This happens whether you initialize them in the constructor or inline.
In addition, since initialization is unnecessary in .NET (it always happens, even if you don't explicitly say to initialize to the default), adding an initializer suggests, from a readability standpoint, that you are trying to add code that has a function.  Every piece of code should have a purpose, or be removed if unnecessary.  The "extra" code, even if it was harmless, suggests that it is there for a reason, which reduces maintainability.


text:
Q: In Google Cloud Logging, why are log messages shown out of order? I have a Java program running in a pod in the Google Kubernetes Environment. In GCP, there is a default logging router that routes stdout and stderr to the GCP Logging app. We have added one exclusion filter to this default router.
What I see is that sometimes (not always but regularly) log messages from a single Java process and from the same thread are listed in reverse order when their timestamp is the same (meaning that they were produced within the same millisecond).
Is there something that I can change to my Java program to prevent this from happening? Is there a field that GCP Logging uses to order messages that have the same timestamp that I am perhaps not populating?


text:
Q: Hilbert polynomial Twisted cubic Let $C$ the twisted cubic in $\mathbb{P}^3$ defined as $V(XZ-Y^2, YW-Z^2,XW-YZ)$. I have to calculate Hilbert polynomial of $C$, that I denote $P_C(n)$. In order to calculate Hilber polynomials in general, I consider the exact twisted sequence
$$ 0 \to \mathcal{I}_C(n) \to \mathcal{O}_{\mathbb{P}^3}(n) \to \mathcal{O}_C(n) \to 0 .$$
If $C=V(F)$, where $deg(F)=m$ I use the isomophism $\mathcal{I}_C \simeq \mathcal{O}_{\mathbb{P}^3}(n-m)$ given by the multiplication for $C$. In this situation I don't know how to use this way in order to calculate Hilbert polynomial of the twisted cubic.

A: As I explained it here one way is to first find the Hilbert function $h_C(d)$ and see what polynomial it is when $d \gg 0.$
Let $H=\{w=0\} \subset \mathbb{P}^3$ and consider $X=C \cap H=V(w,xz-y^2,z^2,yz).$ Then the homogeneous coordinate ring of $X$ is (isomorphic to) $S(X)=k[x,y,z]/(xz-y^2,z^2,yz).$
Exercise: Show that its degree $d$ part, $S(X)^{(d)},$ is generated by $x^d,x^{d-1}y, x^{d-1}z$ as a vector space over $k,$ and conclude that $h_X(d)=\dim_k S(X)^{(d)}=3,$ so is $p_X(d)=3.$
Now the question is, how to relate $C$ and $X?$
The answer is the following SES
$$0\longrightarrow k[x,y,z,w]/I \stackrel{.w}{\longrightarrow} k[x,y,z,w]/I \longrightarrow k[x,y,z,w]/(I+(w)) \longrightarrow 0$$
where $I=(y^2-xz,z^2-yw,xw-yz).$ (It would be easy to run the cohomological approach if you like, using this SES.)
Take the $d$ graded pieces of the SES to get $h_C(d)=h_C(d-1)+h_X(d)$ and note that $h_C(0)=1,$ since $S(C)^{(0)}=k.$ Finally, prove that $h_C(d)=3d+1$ which is a polynomial, thus $p_C(d)=3d+1.$
In general, the degree of the Hilbert polynomial of a projective subscheme $X$ of $\mathbb{P}^n$ coincides with the dimension of $X$, so there should be no surprise that why in this case is a degree one polynomial.
Moreover, the degree of $X$ is defined to be $(\dim X)! \times \text{leading coefficient of} \; p_X(d),$ which in our case is $3.$

A: When $n$ is large, the value of the Hilbert polynomial is just the dimension of $H^0(C,\mathcal O_C(n) ).$
By definition $C$ is a copy of $\mathbb P^1$, embedded with degree $3$, and so $\mathcal O_C(1)$ is a degree $3$ line bundle on $C$.  Thus $\mathcal O_C(n)$ has degree $3n$, and the dimension of global sections of a degree $3n$ line bundle on $\mathbb P^1$ is $3n + 1$.  (Just the number of polys. in one variable of degree at most $3n$.)
So the Hilbert poly. is equal to $3n + 1$.

In general, a degree $d$ curve of genus $g$ (in any projective space) will have
Hilbert poly. equal to $d n + 1 - g$.


text:
Q: Meteor Cordova input field white band above soft keyboard I am using ionic sign in and sign up screens from http://useraccounts.meteor.com/
When I am testing it on my nexus 5 I see a big white band above the onscreen keyboard as shown below
Without Keyboard

With Keyboard

A: Found solution at https://github.com/meteoric/meteor-ionic/issues/89
problem is with ionic-keyboard intended for ios
TL;DR
add the following code to css
.content.overflow-scroll {
bottom: 0px !important;
}


text: Q: Is there a Roadmap for ASP.NET Framework Is there a roadmap for ASP.NET Framework edition? If so, where can I find it? I though I heard, at one point, that, even though most development is happening on ASP.NET Core, that some features would be back-ported to Framework or Standard.


text:
Q: How to Delete Strings from Strings in Python I am currently trying out Python. I was trying to print out an upside-down pyramid. I'm making the pyramid out of *s and in each line, I have to delete a certain amount of *s from the line. This is my
space = ""
astr3 = "**********"
placeholder2 = 1
while placeholder2 < 10:
    print (space, astr3, "\n")
    space += " "
    astr3 = "*********" #this is supposed to be subtraction
    placeholder2 += 1

Please tell if there is any way to delete strings from strings.

A: Initialize placeholder2 with 0 to get the pyramid from the original string to 1 length string. Since your requirements were to remove the string 1 by per line. To do it set the condition astr3[:-1] and put it to the same variable.
space = ""
astr3 = "**********"
placeholder2 = 0
while placeholder2 < 10:
    print(space, astr3)
    space += " "
    astr3 = astr3[:-1]
    placeholder2 += 1

Output
 **********
  *********
   ********
    *******
     ******
      *****
       ****
        ***
         **
          *

A: You can use list slicing to slice Strings/Lists. Check it out. You don't need \n in the print statement as it adds a newline. To make a pyramid using your logic, you can delete two * from the string and then print. Remember, it's always better to use intuitive names for the variables. Eg: you can use, idx for index instead of placeholder2.
# Program to print an upside down pyramid
space = ""
astr3 = "**********"
num_stars = len(astr3) # len(astr3) gives number of * in the astr3 string
placeholder2 = 1
while placeholder2 < num_stars // 2:
    display_str = space + astr3 # Adding strings is called concatnation.
    print(display_str) #  This will not add additional space between spaces and astr3
    space += " "
    astr3 = astr3[:-1] # deleting the last element from the list. Called list slicing
    astr3 = astr3[1:] # deleting the first element from the list. Called list slicing
    placeholder2 += 1

The above code outputs the following:
**********
 ********
  ******
   ****
    **

TIP: It's better to share the expected output in the question so that the community can help.

A: Thank you guys for all the help! I took what you guys said and made the pyramid :D (although my code is very very dumbed down). Here is the code:
space1 = ""
astr4 = "**********"
placeholder3 = 1
while placeholder3 < 7:
    if placeholder3 == 6:
        print (space1, "*")
    print(space1, astr4)
    astr4 = astr4[1:]
    astr4 = astr4[:-1]
    space1 += " "
    placeholder3 += 1


text:
Q: Ionic 6 android app with iframe only will get approved? I have created ionic 6 app with iframe only which will show responsive version of website.
I need to help to confirm if i submit it on play store so they will approve ?
Thanks in advance!


text:
Q: Losing string reference inside function What I need to do is receive a list of strings and transform this in a list of functions that checks if a given key contains those respective strings. What I'm trying:
var words = ['f', 'b', 'b']; //I never know how this list is
for(i in words){
    var str = words[i];
    words[i] = function(key){
        return key.indexOf(str) > -1;
    }
}

After runnning this script, I was expecting to words to become this:
[
    function(key){
        return key.indexOf('f') > -1;
    },
    function(key){
        return key.indexOf('b') > -1;
    },
    function(key){
        return key.indexOf('b') > -1;
    }
]

But when I try words[0]('foo'), It's returning me false. What I'm doing wrong?


text:
Q: Reconciling regex behaviors I am trying a regex ((?:I\d-?)*I3(?:-?I\d)*) here:
Out of the string A-B-C-I1-I2-D-E-F-I1-I3-D-D-D-D-I1-I1-I3-I1-I1-I3-I2-L-K-I3-P-F-I2-I2 I get the following matches I1-I3, I1-I1-I3-I1-I1-I3-I2, and I3 - this is the desired behavior. However, in R:
x <- "A-B-C-I1-I2-D-E-F-I1-I3-D-D-D-D-I1-I1-I3-I1-I1-I3-I2-L-K-I3-P-F-I2-I2"
strsplit(x, "(?:I\d-?)*I3(?:-?I\d)*")

this returns an error:
Error: '\d' is an unrecognized escape in character string starting ""(?:I\d"

I have tried perl=TRUE, but it doesn't make a difference.
I have also tried to modify the regex to read: (?:I\\d-?)*I3(?:-?I\\d)*, however this does not give the correct result, rather it matches A-B-C-I1-I2-D-E-F-, -D-D-D-D-, -L-K-, and -P-F-I2-I2.
`
How can I replicate the desired behavior in R?

A: If we need to split the string and get the substring based on the pattern showed, we may be use that as the pattern to be skipped ((*SKIP)(*F)) and split the string with the rest of the characters.
 v1 <- strsplit(x, '(?:I\\d-?)*I3(?:-?I\\d)*(*SKIP)(*F)|.', perl=TRUE)[[1]]

The blank/empty elements can be removed using nzchar to return a logical vector of TRUE/FALSE depending on whether there the string is not blank or is blank.
 v1[nzchar(v1)]
 #[1] "I1-I3"                "I1-I1-I3-I1-I1-I3-I2" "I3"

Or as we are interested more in extracting the pattern, str_extract would be useful.
 library(stringr)
 str_extract_all(x, '(?:I\\d-?)*I3(?:-?I\\d)*')[[1]]
 #[1] "I1-I3"                "I1-I1-I3-I1-I1-I3-I2" "I3"


text:
Q: True/ False differential equation Are the statements in Problems 46-54 true or false?

*

*If $F(x)$ is an antiderivative of $f(x)$, then $y=F(x)$ is a solution to the differential equation $\frac{dy}{dx}=f(x)$.

*If $y=F(x)$ is a solution to the differential equation $\frac{dy}{dx}=f(x)$, then $F(x)$ is an antiderivative of $f(x)$.

*There is only one solution $y(t)$ to the initial value problem
$\frac{dy}{dx} = 3t^2, y(1) = \pi$
My answer:
The first two questions seems to be both true, I am 100% that the 2nd is true but the first makes me not sure.
The third question I would say yes, why? because I solved for C
$$ y=t^3+C $$
$$ \pi=1^3+C $$
$$ C=\pi-1 $$
Therefore, I would say it has only one solution. Am I right ?

A: For questions 1 and 2, I would think your answers are correct.  In order to be doubly sure, check your textbook for the definition of an anti-derivative.
For your last question, your answer is right; there is indeed a unique solution to the initial value problem.
However, strictly speaking, the reasoning you've provided is insufficient.  You've shown that there is an answer, but not that the answer you've provided is the only answer.  You should have some statement in the textbook that initial value problems such as these have a unique solution.
Sometimes this result is bunched in with the Picard-Lindelöf theorem.  In order to be strictly correct, check your textbook, and cite the relevant result.

A: Your answers are all correct.

1) If F(x) is an antiderivative of f(x), then y=F(x) is a solution to the differential equation dy/dx=f(x).

True because:
$$ \frac{dy}{dx} = f(x) \rightarrow dy = f(x)dx \rightarrow \int dy = \int f(x)dx \Rightarrow y = \int f(x)dx$$
$$\text{Since they've told us }F(x) = \int f(x) \text{, we can substitute } F(x) \text{ for } \int f(x)dx \text{,}$$
$$ \text{ which leaves: } y = F(x) $$

2) If y=F(x) is a solution to the differential equation dy/dx=f(x), then F(x) is an antiderivative of f(x).

True because we can also work backwards from above. When we solve for $y$ in the differential equation $\frac{dy}{dx} = f(x)$ we get $y = \int f(x)$, since we already know that $ y = F(x) $ based on the given information, we can say $y = y$ and $F(x) = \int f(x)$.

3) There is only one solution y(t) to the initial value problem dy dt = 3t2 , y(1) = π.

True. The authors were trying to lead you to this solution with the previous two questions. If we set the problem up:
$$  \frac{dy}{dt} = 3t^2 $$
$$ dy = 3t^2dt $$
$$ \int dy = \int 3t^2dt $$
$$ y = t^3 + C $$
We know that $y(1) = \pi$, so we can solve for C as you did.
$$ \pi = (1)^3 + C \rightarrow C = \pi - 1 \Rightarrow y = t^3 + \pi - 1$$
This means there's only one solution for any $t$ in the function $y(t)$.


text:
Q: Translation from Spanish "Cuenta" with "it has" or "It counts" This is a translation question
From the Spanish:

Cuenta con 14 campos de cultivo en los estados de Michoacán, Baja California Norte y Jalisco.

Which one would be a better translation?

It counts with 14 cultivation fields in the states of Michoacán, Baja California Norte and Jalisco.

It has 14 cultivation fields in the states of Michoacán, Baja California Norte and Jalisco.

Can I translate "cuenta con" with "Counts with"?

A: I think the meaning here is closest to a tally, a counting of items.

*verb
  If you tally numbers, items, or totals, you count them.

In your example,

Company X has 14 cultivation fields in the states of Michoacán, Baja California Norte and Jalisco.

means that someone counted the fields and the total was 14. But the statement itself does not do any counting. So I would use has or some other word reflecting the resulting total.


text:
Q: How to mix strings in Python I am trying to write a function to mix strings in python but I am getting stuck at the end. So for this example, I have 2 words, mix and pod. I would like to create a function that returns: pox mid
My code only returns pox mix
Code:
def mix_up(a, b):
    if len(a and b)>1:
        b=str.replace(b,b[2],a[2:3])
        a=str.replace(a,a[2],b[2])
        print b,"",a
    return
mix_up('mix','pod')

I am seeking to do this for multiple words. So another example:
if I used dog,dinner
The output should return dig donner
Thanks!

A: Little play on string slicing
def mix_up(first, second):
    new_first = second[:2] + first[2:]
    new_second = first[:2] + second[2:]
    return " ".join((new_first, new_second))

assert mix_up('mix','pod') == 'pox mid'
assert mix_up('dog','dinner') == 'dig donner'

A: If you simply wanted to put the 2nd word before the first word all the time:
def mix_up(a,b):
    return " ".join([b,a])   # Should return pod mix

Give that you aimed for pox mix suggests that you probably wanted to:
1) Replace the last character of word b with x
2) Place b before a.
In that case, the function would be:
 def mix_up(a,b):
    b = b.replace(b[len(b)-1], 'x') # 'x' could be any other character
    return " ".join([b,a])   # Should return pox mix

you can simply swap b with a in order to change the position of the words.
If you didn't want the space in metween:
return "".join([b,a])

UPDATE
to "swap" the second letter between b and a, I simply correct your function like the following:
def mix_up(a, b):
    if len(a and b)>1:
        temp = b[1] # Store it in a temp
        b=str.replace(b,b[2],a[2:3])
        a=str.replace(a,a[2],b[2])
        print (b,"",a)
    return
mix_up('mix','pod')

Your only problem was once you replaced b, you were using the new b to chose the 2nd letter and replace into a.

A:

def mix_up(a, b):
  if len(a) < 2 or len(b) < 2: return
  return (b[:2] + a[2:] + " " + a[:2] + b[2:])


text:
Q: Combinatorics question involving distributing 9 different candies to three different kids Nine different chocolate bars are to be distributed to 3 different kids.
a) In how many ways can this be done if there are no restrictions?
b) In how many ways can this be done if the child A receives exactly four chocolate bars?
c) In how many ways can this be done if each kid gets at least one chocolate bar?
I'm pretty confident with the first two parts (a and b)
Here is my work:
a) Since there are no restrictions we can assign the kids to the chocolate bars in $3^9$ ways.
b) Since the first child must get four candies we can assign the candies to him in ${9\choose 4}$ ways. Then we can assign the rest of the candies using the same logic from part a in $2^5$ ways. So there are $2^5$${9\choose 4}$ ways.
c) I'm confused here because I did this problem in two distinct methods and did not obtain the same answer in the slightest...
$\textbf{Method 1:}$ Assign 3 candies to three kids: This can be done in 9×8×7 ways but we also have to consider that there are 3! arrangements of the kids. Then we need to assign the remaining candies to the kids, which can be done in $3^6$ ways. So in this first method I obtained $3^6$×3!×(9×8×7) ways = 2,204,496 ways.
$\textbf{Method 2:}$ I then tried using the inclusion exclusion principle. First I saw that there were $3^9$ ways to assign the kids to the candies in total. And then I took the cases in which one of the three kids received no candies. For each of the three kids this would be $2^9$ and thus would be $3×2^9$ for the kids collectively. However, we would have to add back the case in which none of the three kids received a candy, which would be 3. Thus the answer would be $3^9 - 3×2^9 + 3$ ways.
I'm really not sure which of part c or if either are correct at all...but could someone also check my answers for part a and part b?

A: Your answers to the first two questions are correct, as is your second method for the third problem.
Your first method for the third problem over counts.  To see this, suppose the candy bars the children receive are $A, B, C, D, E, F, G, H, I$.  You count each distribution multiple times.  For instance, if we give $A, B$ to the first child, $C, D, E$ to the second child, and $F, G, H, I$ to the third child, your method counts this case $2 \cdot 3 \cdot 4 = 24$ times, once for each of the two ways of designating one of the candy bars the first child receives as the candy bar reserved for that child, once for each of the three ways of designating one of the three candy bars received by the second child as the candy bar reserved for that child, and once for each of the four ways of designating one of the four candy bars the third child receives as the one reserved for that child.  To illustrate a few ways you count this distribution, consider the following table.
\begin{array}{c | c |c | c | c | c}
R_1 & R_2 & R_3 & A_1 & A_2 & A_3\\ \hline
A & C & F & B & D, E & G, H, I\\
B & C & F & A & D, E & G, H, I\\
A & D & F & B & C, E & G, H, I\\
B & D & F & A & C, E & G, H, I\\
A & E & F & B & C, D & G, H, I\\
B & E & F & A & C, D & G, H, I
\end{array}
where $R_i$, $1 \leq i \leq 3$, denotes the candy bar reserved for the $i$th child, and $A_i$, $1 \leq i \leq 3$, represents the additional candy bars received by the $i$th child.

A: a) the species formula is $E(X).E(X).E(X)$; the $egf = exp(x)^3$ and the coefficient of $x^9 = 19683$
b) the species formula is $E_4(X).E(X).E(X)$; the $egf = {x^4 \over 4!}*exp(x)^2$ and the coefficient of $x^9 = 4032$
c) the species formula is $E^+(X).E^+(X).E^+(X)$; the $egf = (exp(x)-1)^3$ and the coefficient of $x^9 = 18150$
If we want to obtain the three numbers above in a more "terrestrial" way, we will have to consider the generating functions :
a) $GF = (1+x+x^2+...+x^9)^3$ and the coefficient of $x^9 = 55$
b) $GF = x^4(1+x+x^2+...+x^9)^2$ and the coefficient of $x^9 = 6$
c) $GF = (x+x^2+...+x^9)^3$ and the coefficient of $x^9 = 28$
The number shows types of distribution. For example, that there are $55$ ways to express $9$ as a sum of three terms
$9=0+0+9, \ \ 9 = 0+1+8, \dots$, order matters.
For each of the 55 types we have to compute the distribution, eg. for 9 = 2+3+4 we have to take into account $\binom {2+3+4}{2,3,4}$
Then we sum all the 55 (or 6, or 28) numbers.

A: Your method $1$ with restrictions far exceeds $3^9$ with no restrictions.
Your method $2$ is close. You didn't consider the case where $2$ children  receive no candy and also, there isn't a case where all $3$ receive no candy (that wouldn't be a valid distribution of the candy).
Like you said, there are $3$ ways for one child to receive no candy and for each of those there are $2^9$ ways for the other $2$ children to receive the candy.
There are $3$ ways for $2$ children to have zero candy and for each of those there is only one way for the other child to have all $9$ candies.
c) $3^9 - 3\cdot 2^9 - 3 = 18144$


text:
Q: List of numbers giving a particular sum For the list {1, 9, 3, 7, 8}, I want to find pairs whose sum is $10$. I would like the results shown as {{1, 9}, {9, 1}, {3, 7}, {7, 3}}. However, when I use:
IntegerPartitions[10, 2, {1, 9, 3, 7, 8}]

I get only {{7, 3}, {9, 1}}.
How can I get {{1, 9}, {9, 1}, {3, 7}, {7, 3}}?

A: As suggested by @JM, you can use Permutations.
list = Permutations[{1, 9, 3, 7, 8}, {2}];
Select[list, Total@# == 10 &]

Or
Pick[#, Unitize[10 - Total /@ #], 0] &@list

{{1, 9}, {9, 1}, {3, 7}, {7, 3}}

A: I wonder if the OP has an interest in obtaining precisely the ordering indicated in the question, i.e. {{1, 9}, {9, 1}, {3, 7}, {7, 3}}. In that case, one would do best to feed the components to IntegerPartitions in reverse order:
IntegerPartitions[10, 2, Reverse@{1, 9, 3, 7, 8}];
Flatten[Permutations /@ %, 1]

(* Out: {{1, 9}, {9, 1}, {3, 7}, {7, 3}} *)

A: I do not know how much you want to generalise, but the following seems to work. For numbers 1 to 10 (Range[10]),
ted = Partition[Range[10], 2]
bill = Reverse /@ Partition[Range[10], 2]
Riffle[ted, bill]

{{1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}}
{{2, 1}, {4, 3}, {6, 5}, {8, 7}, {10, 9}}
{{1, 2}, {2, 1}, {3, 4}, {4, 3}, {5, 6}, {6, 5}, {7, 8}, {8, 7}, {9,
    10}, {10, 9}}

If I am missing something, please let me know.
Edit. Beaten by 39 seconds, well...

A: A generalized solution might go something like this:
startingList = {1, 9, 3, 7, 8};
allowedSums = {2}; (* to get pairs only *)
desiredSum = 10;
(* trim duplicates created by IntegerPartitions *)

okMinimumSolution =
   Select[minimumSolution, DeleteDuplicates[#] == # &];
maximalSolution = Flatten[Permutations[#] & /@ okMinimumSolution, 1];

The reason I say a generalized solution is imagine we have this:
startingList = {1, 9, 3, 7, 8, 12, 15};
allowedSums = {2, 3};(*to get solutions between 2 & 3 values*)
desiredSum = 17;

Running the code above on this new startingList and allowedSums gives this:
(* {{8, 9}, {9, 8}, {7, 9, 1}, {7, 1, 9}, {9, 7, 1}, {9, 1, 7}, {1, 7, 9}, {1, 9, 7}} *)

Now the point of this being generalized is clear.  My assumption is that the initial list had no duplicates and that we have to "fix up" the result of IntegerPartitions since it may choose multiples of the given set and I said we don't want this.
Hope this is helpful to someone.  It was fun to think of how to generalize the solution.


text:
Q: T-SQL date ranges using dynamic variables in loop I have a table with transactions, timestamps and users.
CREATE TABLE [dbo].[Transactions]
(
    [transaction_ts] [datetime] NULL,
    [user_id] [bigint] NULL,
    [transaction_id] [bigint] NULL,
    [item] [varchar](50) NULL
)

For each user_id, I need to select all transactions they made between their first transaction and 72 hours later.
--get first and last timestamps for range
DROP TABLE IF EXISTS #first;

SELECT mt.transaction_ts as first_trans,mt.user_id
INTO #first
FROM Transactions mt
INNER JOIN
    (SELECT user_id, MIN(transaction_ts) MinDate
     FROM Transactions
     GROUP BY user_id) t ON mt.user_id = t.user_id AND mt.transaction_ts = t.MinDate;

ALTER TABLE #first
ADD first_trans_plus_72 datetime;

UPDATE #first
SET first_trans_plus_72 = DATEADD(hour, 72, first_trans)

--loop through user_id and select ranges using variables
DECLARE @Table TABLE (user_id bigint, Id int identity(1,1));

INSERT INTO @Table
    SELECT DISTINCT user_id
    FROM #first;

DECLARE @max int;
DECLARE @SQL VARCHAR(MAX);
DECLARE @user_id VARCHAR(max);
DECLARE @first VARCHAR(max);
DECLARE @first_trans_plus_72 VARCHAR(max);
DECLARE @id int = 1;

SELECT @max = MAX(Id) FROM@Table;

WHILE (@id <= @max)
BEGIN
    SELECT @user_id = user_id FROM @Table WHERE Id = @id
    SELECT @first = first_trans FROM #First WHERE user_id = @user_id
    SELECT @first_trans_plus_72 = first_trans_plus_72 FROM #First WHERE user_id = @user_id
    SET @SQL = 'select * from Transactions
                where transaction_ts between ' + @first + ' and ' + @first_trans_plus_72 + '
                and user_id = ' + @user_id + ';'
    PRINT(@SQL)
    EXEC(@SQL)
    SET @id = @id +1
END

This produces the right logical sql but the datetime variables are strings so the query errors out. I tried setting the datetime variables (@first and @first_trans_plus_72 as datetime but this resulted in a conversion error.
Is there a simpler way to do this?

A: Why would you use a loop for this when you can use a simple query?
select t.*
from (select t.*, min(transaction_ts) over (partition by user_id) as min_tts
      from transactions t
     ) t
where t.transaction_ts <= dateadd(hour, 72, min_tts);

In general, it is better to write code using set-based operations.  It is simpler and performs much, much better.
You can incorporate this into an update, but I don't think that is necessary.  The above selects the transactions.  You can use group by user_id to summarize them -- say to count them or to sum the values.


text:
Q: How to check current branch head compare to default branch in GitLab GitHub web shows where is the selected branch compare to default branch. For example here dev is the default branch and I have selected qa branch. It shows that qa branch is 1 commit behind dev.

Does GitLab have the same kind functionality in UI.?

A: Sure!
Navigate to Repositories > Branches, the list of branches has an indicator (before status icon and Merge Request button)
once you hover above, it explains "N commits behind ... M commits ahead"

Clicking on Compare brings detailed diff in commits and files


text:
Q: Force.com IDE installation error The version of Eclipse I'm running is : 3.8.1
I'm trying to install the force.com IDE for eclipse. I've seen many threads on this issue, and to be honest I'm so new to ubuntu and eclipse that I'm unable to get this resolved.
I have downloaded the eclipse marketplace as per these instructions https://help.salesforce.com/apex/HTViewSolution?id=000181372&language=en_US . The IDE does not show up in the list when searched for. I can find it when I go to http://marketplace.eclipse.org/search/site/%2522force.com%2520ide%2522 but when I drag the 'install' icon to eclipse I get the following error:
Cannot complete the install because of a conflicting dependency.
  Software being installed: Force.com IDE 36.0.0.201601221512 (com.salesforce.ide.feature.feature.group 36.0.0.201601221512)
  Software currently installed: Eclipse Platform 3.7.0.debbuild (org.eclipse.platform.ide 3.7.0.debbuild)
  Only one of the following can be installed at once:
    Eclipse UI 3.103.0.v20120705-114351 (org.eclipse.ui 3.103.0.v20120705-114351)
    Eclipse UI 3.8.0.dist (org.eclipse.ui 3.8.0.dist)
    Eclipse UI 3.8.0.v20120523-1546 (org.eclipse.ui 3.8.0.v20120523-1546)
    Eclipse UI 3.104.0.v20121024-145224 (org.eclipse.ui 3.104.0.v20121024-145224)
    Eclipse UI 3.8.2.v20121018-234953 (org.eclipse.ui 3.8.2.v20121018-234953)
    Eclipse UI 3.7.0.I20110602-0100 (org.eclipse.ui 3.7.0.I20110602-0100)
    Eclipse UI 3.103.0.v20120521-2329 (org.eclipse.ui 3.103.0.v20120521-2329)
    Eclipse UI 3.7.0.v20110928-1505 (org.eclipse.ui 3.7.0.v20110928-1505)
  Cannot satisfy dependency:
    From: Force.com IDE 36.0.0.201601221512 (com.salesforce.ide 36.0.0.201601221512)
    To: bundle org.eclipse.ui 3.103.0
  Cannot satisfy dependency:
    From: Force.com IDE 36.0.0.201601221512 (com.salesforce.ide.feature.feature.group 36.0.0.201601221512)
    To: com.salesforce.ide [36.0.0.201601221512]
  Cannot satisfy dependency:
    From: Eclipse Platform 3.8.1.dist-A8F8_IVSG4WGSImg7oLZb9p1HecSFyJZcMPL9 (org.eclipse.platform.feature.group 3.8.1.dist-A8F8_IVSG4WGSImg7oLZb9p1HecSFyJZcMPL9)
    To: org.eclipse.rcp.feature.group [3.8.1.dist-92A7GODFSNQBG]
  Cannot satisfy dependency:
    From: Eclipse Platform 3.7.0.debbuild (org.eclipse.platform.ide 3.7.0.debbuild)
    To: org.eclipse.platform.feature.group [3.8.1.dist-A8F8_IVSG4WGSImg7oLZb9p1HecSFyJZcMPL9]
  Cannot satisfy dependency:
    From: Eclipse RCP 3.8.1.dist-92A7GODFSNQBG (org.eclipse.rcp.feature.group 3.8.1.dist-92A7GODFSNQBG)
    To: org.eclipse.ui [3.8.0.dist]

A: See this: Force.com_IDE_Installation
Problem
Attempting to install the Force.com IDE generates the following error:

Cannot complete the install because of a conflicting dependency.
  Software being installed: Force.com IDE...

Solution
Move Eclipse to a folder other than Program Files. See this thread for more details.


text:
Q: Is there a HTML character that is blank (including no whitespace) on all browsers? Is there a HTML character that, on all (major) browsers (plus IE8 sadly) displays nothing and doesn't add any extra space?
So, an alternative to   but which doesn't add whitespace to the page, and which won't ever show up as an ugly "unrecognised character" marker or ?.

Why: in my case, I'm trying to work around a problem on an old, proprietary CMS that is removing empty but necessary HTML elements that are required because other parts of the system will fill them dynamically.
Imagine something like (simplified trivial example)  which is populated with a user's username if a user is logged in - but this old-school CMS sees it as being empty and removes it.

A: There seem to be two options that mostly fit the bill. They seem to reliably not show anything when in a , but they (particularly the second option) might have a minor effect on copy/paste and word breaking in some cases.
Zero-width space
 aka  which behaves the same as the (now in HTML5) <wbr> - used to make words break at certain points without changing the display of the words.

This text is full of spans with characters that affect word breaking but don't show up

Especially in das superdoupercrazylongworden.

Seems to work fine on modern browsers and IE7+ (not tested on IE6).

Soft hyphen
 - like a zero-width space but (in theory) adds a hyphen when it breaks a word across a line.

This text is full of spans with characters that affect word breaking but don't show up

Especially in das superdoupercrazylongworden.

Example where das superdoupercrazylongword contains no spans.

Fine on modern browsers and IE7+ (not tested on IE6), though as some comments note there are issues with these turning into regular hyphens when copied and pasted, for example, here's how it pastes from Chrome to Notepad, on Windows 8.1:

Within a span, it seems to never add a hyphen (but still better to use zero-width spaces if possible).

Edit: I found an older SO answer discussing these as a solution to a different problem which suggests these are robust except for possible copy/paste quirks.
The only other issue with these I could find in research is that apparently some search engines may treat words containing these as being split (e.g. awesome might match searches for awe and some instead of awesome).

A: There are two characters that are graphic characters but defined to be zero width: U+200B ZERO WIDTH SPACE and U+FEFF ZERO WIDTH NO-BREAK SPACE. The former acts like a space character, so that it is a separator between words and allows line breaking in formatting, whereas the latter explicitly forbids line breaks. It depends on the purpose and context which one you should use. The can be represented in HTML as  and .
There characters work well in most browsing situations. However, in IE 6, they tend to be rendered as small rectangles, since IE 6 does not know these characters and tries to render them as if they were graphic characters (which lack glyphs).
There are also control characters that are allowed in HTML, such as U+200E LEFT-TO-RIGHT MARK and U+200D ZERO WIDTH JOINER. They have no rendering as such, though they may affect rendering of graphic characters, e.g. by setting writing direction, affecting ligature behavior, etc. Due to the possibility of such effects, it might be risky to use them as "dummy" characters.


text:
Q: Best practice for Database migration in test , production server in asp.net core 2.0 + app I am working on a new project which is in asp.net 2.1 web API
here I am using Code first migration in local DB
so to deploy my app to test environment I need to know
best and safe practice for database migration because this is a new project and in the future daily base there will be a lot of changes may occur

A: Well it sounds like you are mixing migration with deployment.
Migration with Code First means making changes in your Data model.
Deploying your code or database to Production is something different.
I assume you are referring to deployment in your question.
Best way of deployment for both applications and databases is to automate it.
Jenkins, TFS, Teamcity , Octopus are some of the popular CD tools.
To automate the database deployment you need to write custom libraries.
In one of the companies I worked we check in the DDL script to source code and automated build library drops all the stored procs, functions . Runs the ddl script and re-creates all the stored procs,functions.
This way we can be 100% sure all the Environments(QA,Staging, Prod)  are in sync .

A: Best practices are actually provided by Microsoft here
Apart from that, this repository provides a good enterprise-level example of how .NET Core Web App/API projects should be written and describes the following practices that help the project scale reliably as the project size grows. It is also updated regularly.

*

*Full architecture with responsibility separation concerns, SOLID and
Clean Code

*Domain Driven Design (Layers and Domain Model Pattern)

*Domain Events

*Domain Notification

*CQRS (Command Query Responsibility Segregation)

*Event Sourcing

*Unit of Work Repository and Generic Repository