text:
Q: Application Insights Logs custom properties I want to have a shared app insights instance that will hold all logs from different microservices running.
For each of them I am adding
        services.AddLogging(
            loggingBuilder =>
            {
                loggingBuilder
                .SetMinimumLevel(settings.LogLevel)
                .AddApplicationInsights();
            }
        );

But then in the azure portal I want to be able to search for logs for individual applications, for example using query like "applicationName = 'MyAppName'".
Is it possible to setup loggingBuilder to add in this custom property applicationName to be MyAppName?
Logging itself is done like
public void MyMethod()
{
    try
    {
      //whatever
    }
    catch (Exception ex)
    {
      logger.LogError(ex, "Meaningful information");
    }
}

Or is it a bad idea in general to share app insights instance and have all logs and telemetry available in 1 pile?

A: You can use ITelemetryInitializer to set role name
    public class MyTelemetryInitializer : ITelemetryInitializer
    {
        public void Initialize(ITelemetry telemetry)
        {
            if (string.IsNullOrEmpty(telemetry.Context.Cloud.RoleName))
            {
                //set custom role name here
                telemetry.Context.Cloud.RoleName = "RoleName";
            }
        }
    }

Then if its .net core register it
  services.AddSingleton<ITelemetryInitializer>(new MyTelemetryInitializer ());


text:
Q: Is division by zero included in QF_NRA? Is division by zero included in QF_NRA?
The SMT-LIB standard is confusing in this matter. The paper where the standard is defined simply does not discuss this point, in fact NRA and QF_NRA do not appear anywhere in that document.  Some information is provided on the standard website.  Reals are defined as including:
- all terms of the form (/ m n) or (/ (- m) n) where
  - m is a numeral other than 0,
  - n is a numeral other than 0 and 1,
  - as integers, m and n have no common factors besides 1.

This explicitly excludes zero from the denominator when it comes to constant values. However, later, division is defined as:
- / as a total function that coincides with the real division function
  for all inputs x and y where y is non-zero,

This is followed up by a note:
Since in SMT-LIB logic all function symbols are interpreted as total
  functions, terms of the form (/ t 0) *are* meaningful in every
  instance of Reals. However, the declaration imposes no constraints
  on their value. This means in particular that
  - for every instance theory T and
  - for every closed terms t1 and t2 of sort Real,
  there is a model of T that satisfies (= t1 (/ t2 0)).

This is seemingly contradictory, because the first quote says that (/ m 0) is not a number in QV_NRA, but the latter quote says that / is a function such that (= t1 (/ t2 0)) is satisfiable for any t1 and t2.
The de-facto reality on the ground is that division by zero seems to be included in SMT-LIB, despite the statement that (/ m n) is only a Real number if n is nonzero.  This is related to a previous question of mine: y=1/x, x=0 satisfiable in the reals?

A:
the first quote says that (/ m 0) is not a number

No, but it does not say what number it is.

but the latter quote says that / is a function such that (= t1 (/ t2 0)) is satisfiable for any t1 and t2

This is correct.
You need to get away from the school mentality that says "division by zero is not allowed!". It is undefined. Undefined means that there is no axiom that specifies what values this is. (And this is true in school as well.)
What is f(1234)? It's undefined, so Z3 is allowed to pick any number at all. There is no difference between a / 0 and f(a) where f is some uninterpreted function. Z3 can fill in any function it likes.
Therefore, a / 0 == b is satisfiable and any a and b are OK. But (a / 0) == (a / 0) + 1 is false.
Mathematical operators are just functions. The standard partially specifies those functions.

redpajama_set_name: RedPajamaStackExchange


text:
Q: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet launching debug on pycharm I have a Django (version 1.9) application running with python 2.7.10 and I'm using Virtualenv.
Running the application with ./manage.py runserver I've no error, but when I try to run in debug I get django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
Here is the Pycharm debugging configuration:

Any idea why?
Here is the complete stack trace:
   /Users/matteobetti/Progetti/Enydros/enysoft/bin/python ./manage.py runserver
    Traceback (most recent call last):
      File "./manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
        utility.execute()
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 342, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 176, in fetch_command
        commands = get_commands()
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/utils/lru_cache.py", line 100, in wrapper
        result = user_function(*args, **kwds)
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/core/management/__init__.py", line 71, in get_commands
        for app_config in reversed(list(apps.get_app_configs())):
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 137, in get_app_configs
        self.check_apps_ready()
      File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
        raise AppRegistryNotReady("Apps aren't loaded yet.")
    django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

I add import django e django.setup before execute_from_command_line(sys.argvs)
and I get this stack trace:
Traceback (most recent call last):
  File "/Users/matteobetti/Progetti/Enydros/enysoft/manage.py", line 10, in <module>
    django.setup()
  File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/apps.py", line 2, in <module>
    from frontend.services.container import app_context
  File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/services/container.py", line 1, in <module>
    from frontend.services.enysoft_services import RService, FixedSizeDirectoryCache, TubeSectionService, CsvSanifier
  File "/Users/matteobetti/Progetti/Enydros/enysoft/frontend/services/enysoft_services.py", line 5, in <module>
    import rpy2.robjects as ro
  File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/rpy2/robjects/__init__.py", line 15, in <module>
    import rpy2.rinterface as rinterface
  File "/Users/matteobetti/Progetti/Enydros/enysoft/lib/python2.7/site-packages/rpy2/rinterface/__init__.py", line 16, in <module>
    tmp = subprocess.check_output(("R", "RHOME"), universal_newlines=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Another thing to say is that my colleagues with Linux have no problem with the same virtualenv configuration, the only one that has a problem is me, using MacOs.

A: Try to add you settings file to system PATH. In my projects settings are in the folder /project_name/project_name/settings/development.py (that is slightly different from standard way). And in my case Evironment variables string is
DJANGO_SETTINGS_MODULE=project_name.settings.development;PYTHONUNBUFFERED=1
So change it according to your parameters and then try to run server again. I hope this helps.


text:
Q: Field equal 1 display I am using SQL Server 2008 and I would like to only get the activityCode for the orderno when it equals 1 if there are duplicate orderno with the activityCode equals 0.
Also, if the record for orderno activityCode equals 0 then display those records also. But I would only like to display the orderno when the activityCode equals 0 if the same orderno activityCode does not equal 1 or the activityCode only equals 0. I hope this is clear and makes sense but let me know if I need to provide more details. Thanks
--create table
create table po_v
(
  orderno int,
  amount number,
  activityCode number
)

--insert values
insert into po_v values
(170268, 2774.31, 0),
(17001988, 288.82, 0),
(17001988, 433.23, 1),
(170271, 3786, 1),
(170271, 8476, 0),
(170055, 34567, 0)

--Results
170268    | 2774.31 | 0
17001988  | 433.23  | 1
170271    | 3786    | 1
170055    | 34567   | 0

*****Updated*****
I have inserted two new records and the results have been updated. The data in the actual table has other numbers besides 0 and 1. The select statement displays the correct orderno's but I would like the other records for the orderno to display also. The partition only populates one record per orderno. If possible I would like to see the records with the same activityCode.
--insert values
insert into po_v values
(170271, 3799, 1),
(172525, 44445, 2)

    --select statement
    SELECT Orderno,
    Amount,
    Activitycode
    FROM   (SELECT orderno,
           amount,
           activitycode,
           ROW_NUMBER()
             OVER(
               PARTITION BY orderno
               ORDER BY  activitycode DESC) AS dup
    FROM   Po_v)dt
    WHERE  dt.dup = 1
    ORDER  BY 1

--select statement results
170055    | 34567   | 0
170268    | 2774.31 | 0
170271    | 3786    | 1
172525    | 44445   | 2
17001988  | 433.23  | 1

--expected results
170055    | 34567   | 0
170268    | 2774.31 | 0
170271    | 3786    | 1
170271    | 3799    | 1
172525    | 44445   | 2
17001988  | 433.23  | 1

A: Not totally clear what you are trying to do here but this returns the output you are expecting.
select orderno
    , amount
    , activityCode
from
(
    select *
        , RowNum = ROW_NUMBER() over(partition by orderno order by activityCode desc)
    from po_v
) x
where x.RowNum = 1

---EDIT---
With the new details this is a very different question. As I understand it now you want all row for that share the max activity code for each orderno. You can do this pretty easily with a cte.
with MyGroups as
(
    select orderno
        , Activitycode = max(activitycode)
    from po_v
    group by orderno
)
select *
from po_v p
join MyGroups g on g.orderno = p.orderno
    and g.Activitycode = p.Activitycode

A: Try this
SELECT Orderno,
       Amount,
       Activitycode
FROM   (SELECT orderno,
               amount,
               activitycode,
               ROW_NUMBER()
                 OVER(
                   PARTITION BY orderno
                   ORDER BY  activitycode DESC) AS dup
        FROM   Po_v)dt
WHERE  dt.dup = 1
ORDER  BY 1

Result
Orderno     Amount      Activitycode
------------------------------------
170055      34567.00       0
170268      2774.31        0
170271      3786.00        1
17001988    433.23         1


text:
Q: Trigger in Google Form submit does not work properly I have a script that is running when a form is submitted. The script does not work when I use a function with the e parameter such as the code below.  I get a message returned: ReferenceError: 'e' is not defined. Any idea why?
function submitFormFunc(e) {
  var items = e.response.getResponses();
  var responses={};
  for(var i = 0; i< items.length; i++) {
   responses[items[i].getItem().getTitle()]=items[i].getResponse();
  }

  var responseTable = [];
  var responseIndex = ["Timestamp","ID","question 1","question 2"];
  responseTable.push(e.response.getTimestamp().toString());
  responseTable.push(e.response.getId());
  responseTable.push(responses["question 1"]);
  responseTable.push(responses["question 2"]);
  responseTable.push(FormApp.getActiveForm().getResponse(e.response.getId()).getEditResponseUrl());
  SpreadsheetApp.openById("your spreadsheetId").appendRow(responseTable);
}

A: You are receiving that error because the event object, e, isn't defined when you've called submitFormFunc(e). This is typical when you are debugging, and have invoked a parameterized function from the editor/debugger.
For your testing, simulate the event using the technique from How can I test a trigger function in GAS?


text:
Q: How can i create a custom shaped button using polygon in wpf using xaml custom style button
I want to create a custom-styled button that will have two labels and a text block as described in the image. Please help as I am new to WPF.


text:
Q: Query expression by linq I have a view model in my view page that contains a list property. I want to select first item of the property and work with it.
My problem is when I use the following query expression
@foreach (var item in Model)
{
    var query = item.EntityCommentModels;
    var child = query.ToList().First()
    ....
    ...
}

I receive this error

the sequence contains no element

but when I trace it through a foreach loop it works properly.
@foreach (var item in Model)
{
    @foreach (var child in item.EntityCommentModels.Take(1))
                    {............}
}

What it is the reason of this problem?


text:
Q: ggplot2 error when if statement added to a function I have the following function which runs correctly:
plot_agg <- function(df, group_type, x_label, y_axis) {

     ggplot(df, aes_string(x = colnames(df)[1], y = colnames(df)[4], group = colnames(df)[3], fill=colnames(df)[3])) +
                    geom_bar(stat = "identity", position = "dodge")
 }

}
When I enter an if statement, however, as follows:
plot_agg <- function(df, group_type, x_label, y_axis) {

     if (y_axis = "wins") {
            ggplot(df, aes_string(x = colnames(df)[1],
                                  y = colnames(df)[4],
                                  group = colnames(df)[3],
                                  fill=colnames(df)[3])) +
                    geom_bar(stat = "identity", position = "dodge")
     }
}

it does not even load and gives me the following error:
Error: ggplot2 doesn't know how to deal with data of class function.
Any thoughts on why an if statement would cause this?


text:
Q: Twitter Bootstrap and bigger than a standard icon in the button Everything is perfect when I use:
<button type="submit" class="btn btn-primary">
   text
</button>

I want my own icon. That's why I use:
<button type="submit" class="btn btn-primary">
   text
</button>

My icon is displayed in the button, but my icon is a bit higher (20px x 16px). So, it is displayed for 75%. How to fix it?
Changing height or padding doesn't help.
Thank you.

A: The best way is to extend the bootstrap icon sprite and add one more row on the css with the exact position of your new icon.
Search for one of the bootstrap icons and add your below.
I do always in this way also if my icon is bigger, just change the width / height of your only.

A: Create a icon-perso class
<button type="submit" class="btn btn-primary">
   text
</button>

Add the following css to override the default behaviour with:

*

*the url of your picture

*the width and height of the picture

*change the line-height to the picture height

*margins if required

.
.icon-perso {
  background-image: url("../img/glyphicons-perso.png");
  width: 20px;
  height: 16px
  line-height: 16px;
}

If you picture contain several icons like glyphicons-halflings.png you may have to change the background-position
.icon-school {
  background-position: 0px 0px;
}

You can have a look at bootstrap.css around from line 2143 if you are curious.


text:
Q: Spring Cloud Kafka - is there a way to know how many channels are there after startup I'm exploring spring cloud stream binder kafka and playing with it. is there a way to know the list of channels after startup, just by printing the values in logger may be?
i'm specifically looking for errorChannels and recordMetaData, i know that there is default channel for error.


text:
Q: Devexpress ChartControl to XtraReport I have 2 chartcontrols in a wizard.
Is it possible to copy this charts to a XtraReport without using a xrChart?
Chartcontrol 1 is a bar chart and chartcontrol 2 is a pie chart.
The data comes from a datatable.

A: Go through documentation section - Use Charts, Grids and Custom Controls
This will help you to know that how can you add chart control to the xtrareport with data binding..
How to: Create a Report with a Chart Containing Series Bound to Data
How to: Create a Report with a Chart Bound to Data Using Series Templates
Hope these help..


text:
Q: dpkg: warning: 'tar' not found in PATH or not executable I have installed my programs by "synaptic" previously, but now it shows errors and doesn't install any programs, for example, I want to install xserver-xorg-dev but synaptic shows below errors:
dpkg: warning: 'tar' not found in PATH or not executable.
dpkg: error: 1 expected program not found in PATH or not executable.
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)
A package failed to install.  Trying to recover:
dpkg: warning: 'tar' not found in PATH or not executable.
dpkg: error: 1 expected program not found in PATH or not executable.
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.

A: I just solved it. I don't know how sustainable my solution is.
I copied tar from another machine's /bin/tar, then i CHMOD'ed it to 755 on my destination machine's /bin/tar.
now reinstalling tar via apt-get works flawlessly:
root@devubuntu:/usr/bin# sudo chmod 755 /bin/tar
root@devubuntu:/usr/bin# sudo apt-get install --reinstall tar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  xfonts-encodings php-console-table xfonts-utils libmcrypt4 libxfont1 xfonts-base php5-mcrypt
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 7 not upgraded.
Need to get 0 B/218 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 335218 files and directories currently installed.)
Preparing to replace tar 1.26-4ubuntu1 (using .../tar_1.26-4ubuntu1_amd64.deb) ...
Unpacking replacement tar ...
Processing triggers for man-db ...
Setting up tar (1.26-4ubuntu1) ...

when i use virtualmins "Re-Check Configuration" I now get:

All commands needed to create and restore backups are installed.

The selected package management and update systems are installed OK.
.. your system is ready for use by Virtualmin.

please notice, that

Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.

is just a general information and NOT an actual error message! when I got this message, /usr/local/sbin, /usr/sbin and /sbin were already contained in my $PATH variable. so do not let it confuse you.


text:
Q: How to work around the mobile/phone keyboard in a website that resizes automatically based on window width/height I make web-apps that often resize themselves according to the window via (lately) CSS transforms.
For desktop PCs, it's not a big deal.. I just run my resize test code every 50ms, checking the window.innerWidth and window.innerHeight. (I don't use the 'resize' event here because when a user resizes the window, the event is run potentially too quickly/too many times..)
On phones, I use both a "resize" and "orientationchange" event. Resize events are sometimes need because of various Android (Chrome/webview)/iOS bugs. Works well.
The problem: as we all know, currently there is no way to explicitly detect a few different phone-only events, like the virtual keyboard popping in and out. Thus, when a keyboard pops up, this triggers the resize event, which triggers my resize routine and causes the app window to get really really small.

A: "Thus, when a keyboard pops up, this triggers the resize event, which triggers my resize routine and causes the app window to get really really small."
One way to fix this is to detect for blur and focus on text/password inputs.
Sub-problem: we also need to guard against the possibility that the user will re-orient their device while the keyboard is visible -- thus sending incorrect data to the resize routine. This can be handled by blurring the input when an orientationchange event occurs.
Example code:
if (gs.is_phone_or_tablet) {
 window.keyboard_is_visible = false
 $(document.body).on('focus', 'input[type="text"], input[type="password"]', function () {window.keyboard_is_visible = true})
 $(document.body).on('blur' , 'input[type="text"], input[type="password"]', function () {window.keyboard_is_visible = false})
 var hide_keyboard = function () {
  if (document.activeElement == document.body) return
  document.activeElement.blur ()
  window.keyboard_is_visible = false
 }
 //window.addEventListener('resize'           , hide_keyboard) // <-- for Webview <= 4.3 only..
 window.addEventListener('orientationchange', hide_keyboard)
}


text:
Q: Typescript interfaces, array of arrays of objects I am new to Typescript and I am struggling with creating an interface of the following result.
[
  [
    {
      "type": string,
      "what": string,
      "from": string,
      "to": string,
      "fee": string,
      "blockNumber": number,
      "transactionHash": string,
      "oracleRequestId": string
    },
    {
      type: string;
      what: string;
      transactionHash: string;
      blockNumber: number;
      oracleRequestId: string;
      output: string;
    }
  ],
  [
    {
      "type": string,
      "what": string,
      "from": string,
      "to": string,
      "fee": string,
      "blockNumber": number,
      "transactionHash": string,
      "oracleRequestId": string
    },
    {
      type: string;
      what: string;
      transactionHash: string;
      blockNumber: number;
      oracleRequestId: string;
      output: string;
    }
  ]
]

I did create two interfaces for the objects in the array and merge them so that I can use mergedInterfaces [][]. This seems to be fine.
The issue is that sometimes I do push a different object instead of the two above, the object is
{
    message: string,
    code: number
}

This one trows errors.
In my code:
let result: MergedInterfaces [][] | ??? = [];
Any idea how to declare this one?
Thanks a lot

A: For that multi-dimensional object, you could declare like this:
 type Data = {
   type: string;
   what: string;
   from?: string;
   to?: string;
   fee?: string;
   blockNumber?: number;
   transactionHash?: string;
   oracleRequestId?: string;
   output?: string;
 }[][];

Playground Link

A: Can you please try this:
type CommonFields = {type: string, what: string, blockNumber: number, transactionHash: string, oracleRequestId: string}
type FromTo = {from: string, to: string, fee: string} & CommonFields
type Output = {output: string} & CommonFields
type ArrayOfData = [FromTo, Output][]

In this way, you can generalize types and reuse them. Think of better naming ofc.
Playground


text:
Q: What console command(s) will allow completion of the College of Winterhold quests? I have done the College of Winterhold quests before and just wanted to use console commands to finish it again on a different character. What are the console command(s) to allow setting the quests as finished? Thanks!

A: Console: setstage <insert quest ID here> 200
e.g. "College Objective Quest: Visit the College of Winterhold" = setstage MG01Pointer 200
Find the quest ID in the UESP wiki.

If the last stage of the quest is more than 200 you can see it in the bottom of the quest page on UESP.


text:
Q: D2009 problems with array of char - how can I `elegantly` fix my code? Going through some of my older Delphi projects and upgrading them to D2009, as I find this version a great improvement (Generics.Collections - wow! ;)) to all previous releases, I encounter various problems. This one I managed to solve but the solution does not seem half as elegant as I believe it could be. (Note, I haven't written Delphi code for about three years now and even back then it was rather amateurish hacking than in-depth understanding of what's going on).
My code would have a TFileStream and read from it. The files were written previously by my older Delphi app in a way that the first three characters in the file would be CTR to recognise the file type as valid. The reader would read in the first three bytes into an array of chars (and here's the problem, now that sizeof(char) is 2 bytes) and then treat this array as string to see if it reads 'CTR'.
var ...
buffer: array[0..2] of char;
begin
...
InStream.read(buffer, 3);
if buffer <>'CTR' then begin ShowMessage('Not a valid file!'); exit; end;
...

This will compile and it used to work but now buffer is practically 6 bytes long and therefore does not equal 'CTR' ever.
I fixed this by changing the buffer to array[0..2] of byte and I introduced some more local variables to do the following:
for b in buffer do s := s + chr(b); //notice the for..in loop now available in D2009
if s<>'CTR'...

So basically I turn the individual bytes to a string and then do the compare, but there must be a more straightforward way to do this. Can you please shed some light on this issue?

A: You can set your buffer to
var
  buffer: array[0..2] of AnsiChar;

and you'll read in the exact same thing as before.


text:
Q: The called batch script not returning to the calling batch script I am calling a batch script (say B.bat) from within another batch script (A.bat). However, once B.bat finishes execution, the execution doesnt seem to return to A.bat, as the batch file remains in the 'Executing' stage after that.
Please see the code below:
Code:
Set Scanners_Folder=%CD%
echo %Scanners_Folder%
cd "D:\XYZ\bin"
B.bat && echo B.bat succeeded!!
echo DEF

Output:
<Current_directory>
<logs from B.bat>
startup.bat succeeded!!

After this it does not seem go to the next line of the code in A.bat, which in this case is "echo DEF".
Could anyone help me out with this issue?

A: use call:
Set Scanners_Folder=%CD%
echo %Scanners_Folder%
cd "D:\XYZ\bin"
( call B.bat ) && echo B.bat succeeded!!
echo DEF


text:
Q: StreamBuilder hangs when listening to Firestore snapshot Steps to Reproduce
I am trying to use the bloc pattern with firebase and having hard time since there is not good tutorial out there which uses firebase and bloc pattern.
I've faced strange thing while doing this and worked hard to find out the problem but couldn't.
I've created UserBloc and tried to set UserModel after listening to Firestore snapshot.
class UserBloc extends Object {
    final _user = StreamController<UserModel>.broadcast();
    final _uid = StreamController<String>.broadcast();

    Stream<UserModel> get user => _user.stream;
    Stream<String> get uid => _uid.stream;

    Function(UserModel) get setUser => _user.sink.add;
    Function(String) get setUID => _uid.sink.add;

    Stream<DocumentSnapshot> userStream;

    UserBloc() {
        uid.listen((uid) {
            print('user : $uid');
            if (uid != null) {
                fromUID(uid);
            }
        });
    }

    fromUID(String uid) {
        print('fromUID');
        userStream = Firestore.instance.collection('users').document(uid).snapshots();

        /// works ok when I delete below subscription
        userStream.listen((data) {
        });
    }

    dispose() {
        _user.close();
        _uid.close();
    }
}

Then I used the StreamBuilder inside my widget like below.
StreamBuilder(
    stream: userBloc.userStream,
    builder: (context, snapshot) {
        print(snapshot.connectionState);
        print(snapshot.data);
        return Text('testing');
    },
);

The problem is the snapshot.connectionState** is always **waiting. However, when I delete the subscription code which is userStream.listen((data) {, I was able to get this working. All the example do the listen and set the data in the constructor of bloc. I have no idea why this is happening.

A: I think you must delete listen-sentence for stream controller in Bloc when you are using Streambuilder. Because Streambuilder is listening stream controller in Bloc, there is a duplication problem between Streambuilder and listen-sentence in Bloc.

A: The problem is, that .snapshot() returns a BroadcastStream.
https://www.dartlang.org/articles/libraries/broadcast-streams
After the first subscription (.listen in constructor) the stream is active and the onData callback is called when data is available/changed.
When the UI subscribes to the stream, the stream is already active (the read operation is done), so the ConnectionState will always return waiting till next document update.
Try to modify your code like this, to reproduce:
/// works ok when I delete below subscription
userStream.listen((data) => print(data));

Future.delayed(Duration(seconds: 5),
        () => userStream.listen((onData) => print(onData))
);

The second callback will NOT fire.
To avoid this behavior, you have to do some caching.
Add rxdart to your dependencies
https://pub.dev/packages/rxdart
Modify your code like this
userStream = Observable(Firestore.instance.collection('users').document(uid).snapshots())
.shareReplay(maxSize: 1);

It will replay the emitted values to any new listener, up to a given
  [maxSize].


text:
Q: How to fix React 15.5.3 PropTypes deprecated warning when using create-react-app I'm using create-react-app to start React project.
At latest React 15.5.3 package, it appears following warnings:

Warning: Accessing PropTypes via the main React package is deprecated.
  Use the prop-types package from npm instead.

I have already follow the blog:
npm install prop-types and import PropTypes from 'prop-types';
but it doesn't work.
I don't use any PropTypes or props in code:
import React, { Component } from 'react';
import PropTypes from 'prop-types';

class App extends Component {
    constructor() {
        super();
        this.state = {
            videoVisible: true,
        };
    }

    ......
}

How to fix that?
Thanks.

A: Pulled from Reacts blog - npm install prop-types, then use new code. Also it said you can get this error message if a nested component is not using prop-types but the parent is - so you need to check other components.
// Before (15.4 and below)
import React from 'react';

class Component extends React.Component {
  render() {
    return
{this.props.text}
;
  }
}

Component.propTypes = {
  text: React.PropTypes.string.isRequired,
}

// After (15.5)
import React from 'react';
import PropTypes from 'prop-types';

class Component extends React.Component {
  render() {
    return
{this.props.text}
;
  }
}

Component.propTypes = {
  text: PropTypes.string.isRequired,
};

A: React v15.5.x adds new warnings check here
Downgrading React v15.5.3 to 15.4.x works for me
npm install --save react@15.4.0 react-dom@15.4.0


text:
Q: How can set symbol in \itemize How can I set a symbol/icon from fontawesome package as an itemize \item point.
Like, I want to set the frown-o or heart-o icon as an itemize symbol.
I am on mobile that's why I can not make a figure or code for it.

A: See if the following MWE works for you:
\documentclass{article}
\usepackage{fontawesome}

\begin{document}
\begin{itemize}
    \item[\faFrownO] some text
    \item[\faHeart] some text
    \item[\faHeartO] some text
\end{itemize}
\end{document}


text:
Q: Checking if a string matches "END", and exit if it does I have the following code below:
int main ()
    {
    char string[80];
    bool Restart;

Restart = true;

while (Restart)
    {
    cout << "Enter a string\n" << endl;
    cin.getline(string, 80);
    cout << "\nYou entered: ";
    printf(string, 80);
    cout << endl;

    int len=strlen(string);

    bool flag = true;

    for (int c=0; c!=len/2; c++)
        {
        if (flag)
            {
            if(string[c] != string[len-c-1])
                {
                flag = false;
                }
            }
            else
                {
                break;
                }
            }

if (flag)
    {
    cout <<"\nThis is a Palindrome\n" << endl;
    Restart = true;
    continue;
    }
else
    {
    cout << "\nThis is not a palindrome\n" << endl;
    Restart = true;
    continue;
    }
cin.get();

    }
    }

I need to figure out a way to check if what the user entered is "END" in all caps, and if so, exit the program. I'm sure i can handle the exiting part, but I'm having trouble getting something that will check if the string entered is "END" in all caps.

A: Here is a solution that will terminate the while loop if "END" is entered.  Create a helper method to do the parsing for END.  Note this is very specific to the problem and not very reusable.  It also is more difficult to maintain unlike Beta's solution, but you don't need to worry about maintenance until you start writing bigger programs.
bool Terminate(char* string, int len)
{
    bool retval = false;
    char* c = string;

    if( 3 == len )  // "END\0"
    {
        if('E' == string[0])
        {
            if('N' == string [1])
            {
                if('D' == string[2])
                {
                    retval = true;
                }
            }
        }
    }

    return retval;
}

Then use it after int len=strlen(string); like so:
if(Terminate(string, len))
{
    break;  // Exit while loop
}

Make sure you declare Terminate before your main function

A: Is this enough of a hint?
#include <iostream>

int main()
{
  char A[] = "END";
  char B[10];

  std::cin >> B;

  std::cout << strcmp(A,B) << std::endl;

  return(0);
}


text:
Q: Not able to connect to a running SSH Agent I'm trying to use SSH Agent for a git authentication. My environment is Ubuntu Linux in Docker on ECS. I'm starting the SSH Agent when the container starts with a command:
runuser -l user -c 'ssh-agent -d'

That starts agent using user user with debug. Right after that, I wrote SSH_AUTH_SOCK and SSH_AGENT_PID into /home/user/.profile to make possible to connect to agent for the user.
When I log in as a user, I can see that my env variables are ok:
[user]$ echo $SSH_AUTH_SOCK && echo $SSH_AGENT_PID
/tmp/ssh-z5omIr4XkN49/agent.65
65

And the agent is running:
[user]$ ps -efal | grep ssh-agent
4 S root        62    59  0  80   0 - 37521 -      14:32 ?        00:00:00 /usr/bin/qemu-x86_64 /usr/sbin/runuser -l user -c ssh-agent -d
4 S user        65    62  0  80   0 - 37672 -      14:32 ?        00:00:00 /usr/bin/qemu-x86_64 /usr/bin/ssh-agent -d

And socket permissions are fine:
[user]$ ls -lh /tmp/ssh-FMgHCgorQ36E/agent.65
srw------- 1 user root 0 Mar 12 14:32 /tmp/ssh-FMgHCgorQ36E/agent.65

But when I'm trying to use the ssd-add command, I'm getting a connection error:
[user]$ ssh-add -l
Could not open a connection to your authentication agent.

What am I doing wrong?

I checked out this answer (Could not open a connection to your authentication agent) but it does not work for me because I have to start SSH Agent in my script, without forcing the user to do that.
--
UPDATE
I guess that ssh-add does not read env variables for some reason.
The SSH_AUTH_SOCK is set:
[user]$ echo $SSH_AUTH_SOCK
/tmp/ssh-FN4YayNM6fJ1/agent.65

But:
[user]$ ssh-add -l
Could not open a connection to your authentication agent.

But this works:
[user]$ SSH_AUTH_SOCK=/tmp/ssh-FN4YayNM6fJ1/agent.65 ssh-add -l
4096 SHA256:xvtWid6fm7C9LgyhosVOULo9HZQchve4rUVUgUO2zqE (stdin) (RSA)

A: Your SSH_AGENT_PID (59) is not right, you should use 65.

A: My bad. I was confused about the echo $SSH_AUTH_SOCK result.
I missed the export keyword when updating the .profile file by my script.
SSH_AUTH_SOCK=/tmp/ssh-Y3YbbJ4ZTGyp/agent.59
SSH_AGENT_PID=59

should be:
export SSH_AUTH_SOCK=/tmp/ssh-Y3YbbJ4ZTGyp/agent.59
export SSH_AGENT_PID=59


text:
Q: Преобразование GET запроса Проблема в том что на выходе я хочу получить json ответ не в строковом значении, как решить данную проблему?
import datetime
import http
import http.client
import time
import random

from jose import jws
from jose.constants import ALGORITHMS

# secret user key
key = {
    # Ваш ключ
    "kty": "EC",
    "alg": "ES256",
    "crv": "P-256",
    "x": "pSH0jvbtVZiseTpJZk0_yfudEIv86uwjeH_gr1qmOGA",
    "y": "eGdC9EIGmhCheM_T8vhS4Qwk7RfaPRBxF3W5omgBc_M",
    "d": "DuSjR5eZBp5S-9HNKA8kRQFA_3Akkept-dTbwFoq_3w"
}

def main():
    dt = datetime.datetime.now()
    ts = time.mktime(dt.timetuple())
    claims = {
        # user identificator
        "email": "ВАШ ЕМАИЛ",
        # leave as is
        "aud": "usr",
        # token issue time
        "iat": int(ts),
        # unique token identificator
        "jti": hex(random.getrandbits(64))
    }
    print(claims)
    # make token with claims from secret user key
    token = jws.sign(claims, key, headers={"kid": "КИД"}, algorithm=ALGORITHMS.ES256)

    conn = http.client.HTTPSConnection("bitzlato.com", 443)

    # make  request against api endpoint with Authorization: Bearer <token> header
    conn.request("GET", "/api/p2p/exchange/dsa/?cryptocurrency=BTC&currency=RUB&paymethod=3547&type=purchase"
                        "&limit=200", headers={
        "Authorization": "Bearer " + token
    })
    r1 = conn.getresponse()
    print(r1.status, r1.reason, r1.read())

if __name__ == '__main__':
    main()

На выходе получаем
200 OK b'{"total":87,"data":[{"id":458832,"type":"selling","cryptocurrency":"BTC","currency":"RUB","rate":"3447314","limitCurrency":....

Запрос указал не полностью, так как очень громоздкий.

A: В место r1.read() попробуйте использовать r1.json()


text:
Q: Rename "Add Media" Button To "Add Images" I would like to rename the "Add Media" button (just above the post editor interface) to be "Add Images". I can't seem to find the appropriate filter for this. There seems to be a filter that has now been deprecated but I can't figure out what the new method is. The legacy filter was media_buttons_context.

A: The button text being a translatable string, you can make use of the gettext filter:
function wpse95025_rename_media_button( $translation, $text ) {
    if( is_admin() && 'Add Media' === $text ) {
        return 'Add Images';
    }
    return $translation;
}
add_filter( 'gettext', wpse95025_rename_media_button, 10, 2 );

For the sake of completeness:
Of course, you can also keep the new string translatable.
function wpse95025_rename_media_button( $translation, $text ) {
    if( is_admin() && 'Add Media' === $text ) {
        return __( 'Add Images', 'your-text-domain' );
    }
    return $translation;
}
add_filter( 'gettext', wpse95025_rename_media_button, 10, 2 );


text:
Q: how to insert this array into my table mysql php? I have a problem to insert the following array into my mysql table. I want to insert the array value (abdominal pain,back pain, pain, abd) into my table, but I have no idea to do that on this complicate array. Appreciate.

<?php
$data = array(
  array("table"=>"abdominal pain"),
  array("table"=>"back pain"),
  array("table"=>"pain"),
  array("table"=>"abd")
);

$add_word = $wpdb->query( $wpdb->prepare(
 "
  INSERT INTO $word_table
  ( word )
  VALUES ( %s )
 ",
 $data
) );
?>

A: You can serialize() the value and insert it as a string. Then when you retrieve it, unserialize() it and it will be an array again.
More on http://php.net/manual/en/function.serialize.php


text:
Q: In a game with imperfect information, can there be no subgame-perfect equilibrium? In our Game Theory class, we learned that games can have multiple Nash equilibria and multiple subgame-perfect Nash equilibria ($SPNE$). In one of our example problems, however, we came across a game with imperfect information and apparently no $SPNE$s whatsoever.
Our teacher wasn't sure how to explain this, and while we found a site that said games with perfect information always have at least one $SPNE$, we couldn't find anything that said whether or not games with imperfect information always have $SPNE$s as well.
Is it possible for a game with imperfect information to have no $SPNE$s? If not, can you help us determine the $SPNE$ of this particularly vexing problem?
The problem itself is depicted in the picture below.

This is a picture of our progress so far with a possible SPNE $\{DA,Rlx\}$ listed on the right. Apologies for the quality of the picture.

A: Nash's existence theorem states that if we allow mixed strategies, then every game with a finite number of players in which each player can choose from finitely many pure strategies has at least one Nash equilibrium (NE). (This means if there is no pure strategy NE of such a game then then there must be a mixed strategy NE.)
It follows that there must be a SPNE (possibly involving some randomization) for your game. This is because any subgame of your game has a finite number of strategies and so has a Nash equilibrium (and an SPNE is defined as a strategy profile where players are playing a NE in every subgame).
If there is no SPNE in pure strategies (I haven't checked), then there must be one involving mixing. It turns out there are actually three SPNE, one of which is in pure strategies.
I will label the actions of player 2 in the bottom right subgame as $X$ and $Y$.

*

*The subgame in the bottom left after history $(U,L)$:
Unique SPNE strategies $(A,(l,y))$ with outcome $(A,L)$ payoffs $(2,1)$

*The subgame in the bottom right after history $(D,R)$: Three Nash equilibria. Two pure strategy NE with strategy profiles $(a,X)$ and $(b,Y)$ with corresponding payoffs $(2,1)$ and $(1,2)$. One mixed strategy NE where player $1$ plays $a$ with probability $2/3$ and player $2$ plays $X$ with probability $1/3$, and expected payoffs are $(2/3,2/3)$.
Thus we are left with three possible payoffs when player $1$ plays $D$ and player $2$ plays $R$.
Suppose they play $(a,X)$ with payoffs $(2,1)$ after history $(D,R)$. Then payoffs are:
          2
       L           R
  U   2,  1      3/2, 0
1
  D   3/2, 0     2, 1
This has two pure strategy NE. They are (U,L) and (D,R). It also has a mixed strategy NE where each plays each of the actions with probability $1/2$. The expected payoffs in this SPNE are $(7/4,1/2)$.
Now suppose they play $(b,Y)$ with payoffs $(1,2)$ after history $(D,R)$. Then payoffs are:
          2
       L           R
  U   2,  1      3/2, 0
1
  D   3/2, 0     1, 2
Here there is a pure strategy NE: $(U,L)$. The payoffs in the corresponding SPNE are $(2,1)$.
Finally, if they play the mixed strategy NE with expected payoffs $(2/3,2/3)$ after history $(D,R)$ we get the game:
          2
       L           R
  U   2,  1      3/2, 0
1
  D   3/2, 0     2/3, 2/3
The Nash equilibrium of this game is (player $1$ has dominant strategy $U$) $(U,L)$. The corresponding SPNE has payoffs $(2,1)$.
Note that I have not written down the SPNE strategies in each case (they are a bit messy), but just look back at the previous steps of working to see what they are. For example, in the second case the SPNE strategy profile is $((U,A,b), (L,l,y,Y))$


text:
Q: WPF KeyBinding with multiple chars I would like to create a KeyBinding in code behind using this combo: Ctrl+Shift+Right+Left, so I did:
    KeyBinding b = new KeyBinding()
    {
        Command = SpvCommands.ChangeUser,
        Key = Key.LeftCtrl,
        //Gesture = new KeyGesture(Key.LeftShiftKey);
    };
    InputBindings.Add(b);

How to create the gestuyre with multiple combination?


text:
Q: React onClick event working on twice clicks when clicking again I am using react with typescript. I created one button and now I want to change it to invert its text on onClick event for that I am using useState to change the text of the button, for text inversion, I create one boolean flag.
If I click the button first it works perfectly and when I click again it. It won't work on first click.
const Panel = () => {
    let flag: boolean = false;
    const [btnText, setBtnText] = useState("hello!");

    const changeBtnText = () => {
        if(!playButtonFlag){
            setBtnText("How are you!");
            flag = true;
        }
        else{
            setBtnText("hello!");
            flag = false;
        }
    }
  return

      <Button name={btnText} onClick={changeBtnText}/>

;
};

A: The error can be in the variable you are using to check i.e playButtonFlag. It is better to use it via state: React does not re-render when a common variable's value is changed.
A little help for you using an example below:

import React, {useState} from "react";

export default function App() {
  const [btnText, setBtnText] = useState("hello!");
  const [flag, setFlag] = useState(false);

  const changeBtnText = () => {
      if(!flag)
          setBtnText("How are you!");
      else
          setBtnText("hello!");

      setFlag(!flag);
  }
return

    <button value={btnText} onClick={changeBtnText}>{btnText}</button>

;
}

A: You can do it with object in a simple way
import { useState } from "react";
import "./styles.css";

const BUTTON_TEXT = {
  "hello!": "How are you!",
  "How are you!": "hello!"
};

const Panel = () => {
  const [btnText, setBtnText] = useState("hello!");

  const changeBtnText = () => {
    setBtnText(BUTTON_TEXT[btnText]);
  };

  return (

      <button name={btnText} onClick={changeBtnText}>
        {btnText}
      </button>

  );
};

export default function App() {
  return (

      <Panel />

  );
}

A: Your  flag let flag: boolean = false; variable will be re-initialized with false after re-render. There is a possible chance that playButtonFlag might be the problem. It is better to maintain a state, if you really want that flag to render changes.
const Panel = () => {
  const [btnText, setBtnText] = useState("hello!");
  const [flag,setFlag] = useState(false);

  const changeBtnText = () => {
      setBtnText(!flag ? "How are you!" : "hello!");
      setFlag(currentFlag => !currentFlag)
    }

  return (

      <Button name={btnText} onClick={changeBtnText} />

  );
};

or you can set the button text based on the current text of the button
const Panel = () => {
  const [btnText, setBtnText] = useState("hello!");

  const changeBtnText = () => {
      setBtnText(btnText === "hello!" ? "How are you!" : "hello!");
    }

  return (

      <Button name={btnText} onClick={changeBtnText} />

  );
};


text:
Q: total probability theorem The problem is defined as: We got a machine part that can be produced in series of 20 . 3 Machines produce that part. Some of the parts way be invalid.
The First machine produced 15 out of 20 valid parts.
The Second machine produced 18 out of 20 valid parts.
The Third machine produced 16 out of 20 valid parts.
Randomly a series of products is chosen ( I , II, III ) and a part is taken out. The part that's taken out its valid. The same part it's returned into the series that it has came from and a draw for one more part is done from the chosen series. What's the probability that in the second draw the part that's taken out its a valid part?
I got tried to solve this problem. Here is what I've got so far:
Hypothesis:
A- A valid part is chosen
H1- We draw from first series
H2- We draw from second series
H3- We draw from third series
P(H1)=P(H2)=P(H3)=1/3
P(A|H1)=15/20
P(A|H2)=18/20
P(A|H3)=16/20
P(A)= P(H1)*P(A|H1)+P(H2)*P(A|H2)+P(H3)P(A|H3)
Is this the way to solve this problem or I am missing something?

A: Let $A_1, A_2$ represent the events for the two parts drawn being valid, when drawn with replacement from a series of 20 items produced by one of three machines.   Let $H_{\rm I},H_{\rm II},H_{\rm III}$ be the event that the series originates in the respective machine.
Given that the first sample drawn was valid, updating the probability for the series originating from factory#$\rm I$ is an application for Bayes' Rule.
$$\mathsf P(H_{\rm I}\mid A_1) ~{= \dfrac{\mathsf P(A_1\mid H_{\rm I})\mathsf P(H_{\rm I})}{\mathsf P(A_1\mid H_{\rm I})\mathsf P(H_{\rm I})+\mathsf P(A_1\mid H_{\rm II})\mathsf P(H_{\rm II})+\mathsf P(A_1\mid H_{\rm III})\mathsf P(H_{\rm III})} \\ = \dfrac {15}{15+18+16}\quad=\dfrac{15}{49}}$$
Because when drawing with replacement from the series there is $1/20$ probability for picking the known valid part, and a $19/20$ probability for drawing another part from $H_{\rm I}$ (which are valid with probability $15/20$).
$$\mathsf P(A_2\mid H_{\rm I}, A_1) =\dfrac 1{20}+\dfrac{19}{20}\dfrac{15}{20}$$
And so forth for the other factories.   Now apply the law of total (conditional) probability:
$$\mathsf P(A_2\mid A_1)~=~ \sum\limits_{m\in\{{\rm I},{\rm II},{\rm III}\}}\mathsf P(A_2\mid H_m, A_1)\,\mathsf P(H_m\mid A_1)$$


text: Q: How to receive server side events similar to Facebook notifications I am wondering on how to implement user notifications just like facebook does on its site. At the moment I am calling a php script using angular timer which tells me if any notification is available in the database. Is there any technique that I can use to push notifications to angular code?


text:
Q: Show Rails error message in Ajax alert Using Rails 3.2. I wonder how can we push the error from Rails to show in the Ajax alert. Here is my code:
# posts_controller.rb
def update
  @post = Post.find(params[:id])

  if @post.update_attributes(params[:name] => params[:value])
    render :nothing => true
  else
    render :text => @post.errors.full_messages[0], :status => :unprocessable_entity
  end
end

# _form.html.erb
$("#status_buttons button").click(function() {
  $.ajax({
    type: 'POST',
    url: "<%= post_path(@trip) %>",
    data: { _method: 'PUT', name: this.name, value: this.value },
    error: function() {
      alert(" *****************Rails error message here**********************");
    }
  });
});

The conventional validation error message should appear in the alert(). Any idea?
Thanks.

A: one way to determine is to pass at least 3 arguments to the callback function and checking the console (or an alert) for whatever argument passes the error.
error: function(a,b,c) {
  alert('a contains ' + a);
  alert('b contains ' + b);
  alert('c contains ' + c);
}

one of them should contain the error message :) Good luck!

A: error: function( jqXHR, textStatus, errorThrown ) { ...


text:
Q: DllImport in my web application I made a web application that use a DllImport to use a specific printer in my application. The printer DLL are in my System32. If I put myweb application in my web server, this DllImport will search for this Dll in my server or in the client ?
If the answer is in the client, how can I made to search this Dll in the client ?

A: The DLL will be searched for on the Server, not the client.
You should also know that anything printed through the .NET code will be printed on the Server side as that's where all of the .NET code executes.


text:
Q: Processing each N rows in for loop, print list of processed items Following reproducible script is intended to process each two rows in a dataframe with length 5. For each two processed rows, I like to print a list of items that have been processed.
import pandas as pd
import itertools

my_dict = {
'name' : ['a', 'b', 'c', 'd', 'e'],
'age' : [10, 20, 30, 40, 50]
}

df = pd.DataFrame(my_dict)

for index, row in itertools.islice(df.iterrows(), 2):
    rowlist = (row.name)
    print('Processed two rows {}'.format(rowlist))

Output:
a
b

I'm looking for a way to get following desired output:
[a,b]
[c,d]
[e]

Tried:
print(df.groupby(df.index//2)['name'].agg(list))
Out:
0    [a, b]
1    [c, d]
2       [e]
Name: name, dtype: object
0    [a, b]
1    [c, d]
2       [e]
Name: name, dtype: object

Thanks for your help!


text:
Q: Install RSClientPrint for Reporting Services 2012 using .bat file and still be able to use 2005 I have a Reporting Services 2005 server that when users accessed it and tried to print reports would get a message asking them to install the print control, which they could not do because of lack of permission.  A work around I had found at the time was to copy the .dll and .rll files to their computer on startup via group policy and then register it.  Now we are upgrading to Reporting Services 2012 and the print control has changed and I need to do this again.
I have 3 questions.
I can't locate the .dll and .rll files on my computer to put in a share.  Where should I look for them.
I have a mix of 32 bit and 64 bit machines.  Will this make a difference in what files I need?
Will the script below otherwise still work?
if not exist %windir%\system32\rsver3.txt goto ADD

GOTO END

:ADD
regsvr32.exe /u /s rsclientprint.dll
copy \\server\share\RSClientPrint.dll %windir%\system32
copy \\server\share\RSClientPrint_1028.rll %windir%\system32
copy \\server\share\RSClientPrint_1031.rll %windir%\system32
copy \\server\share\RSClientPrint_1033.rll %windir%\system32
copy \\server\share\RSClientPrint_1036.rll %windir%\system32
copy \\server\share\RSClientPrint_1040.rll %windir%\system32
copy \\server\share\RSClientPrint_1041.rll %windir%\system32
copy \\server\share\RSClientPrint_1042.rll %windir%\system32
copy \\server\share\RSClientPrint_1043.rll %windir%\system32
copy \\server\share\RSClientPrint_1046.rll %windir%\system32
copy \\server\share\RSClientPrint_1053.rll %windir%\system32
copy \\server\share\RSClientPrint_2052.rll %windir%\system32
copy \\server\share\RSClientPrint_3082.rll %windir%\system32
copy \\server\share\gdiplus.dll %windir%\system32
copy \\server\share\rsver3.txt %windir%\system32
regsvr32.exe /s  %windir%\system32\rsclientprint.dll
:END

Update
I modified the above script to the following and placed the x86 and 64 files in different folders.
These files were extracted from the c:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\RSClientPrint-x64.cab and c:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\RSClientPrint-x86.cab and placed in the appropriate folders
and it appears to work on 32 bit and 64 bit systems, however, it no longer allows you to print from Reporting Services 2005 on the 32 bit machines.  It prompts to install the print control.  The 64 bit machines can print from both Reporting Services 2005 and 2012 after running this script.
if exist %windir%\SysWOW64\nul goto X64
GOTO X86

:X86
if not exist %windir%\system32\rsver5.txt goto ADD86

GOTO END

:ADD86

regsvr32.exe /u /s %windir%\system32\rsclientprint.dll
copy /Y \\server\share\x86\RSClientPrint.dll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1028.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1031.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1033.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1036.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1040.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1041.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1042.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1046.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_1049.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_2052.rll %windir%\system32
copy /Y \\server\share\x86\RSClientPrint_3082.rll %windir%\system32
copy /Y \\server\share\gdiplus.dll %windir%\system32
copy /Y \\server\share\rsver5.txt %windir%\system32
regsvr32.exe /s %windir%\system32\rsclientprint.dll

GOTO FINISH

:X64

if not exist %systemroot%\SysWoW64\rsver5.txt goto ADD64

GOTO END

:ADD64

 %systemroot%\SysWoW64\regsvr32.exe /u /s %systemroot%\SysWoW64\rsclientprint64.dll
 %systemroot%\SysWoW64\regsvr32.exe /u /s %systemroot%\SysWoW64\rsclientprint.dll

copy /Y \\server\share\64\RSClientPrint64.dll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1028.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1031.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1033.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1036.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1040.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1041.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1042.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1046.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_1049.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_2052.rll %systemroot%\SysWoW64
copy /Y \\server\share\64\RSClientPrint64_3082.rll %systemroot%\SysWoW64

copy /Y \\server\share\x86\RSClientPrint.dll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1028.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1031.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1033.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1036.rll%systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1040.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1041.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1042.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1046.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_1049.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_2052.rll %systemroot%\SysWoW64
copy /Y \\server\share\x86\RSClientPrint_3082.rll %systemroot%\SysWoW64

copy /Y \\server\share\gdiplus.dll %systemroot%\SysWoW64
copy /Y \\server\share\rsver5.txt %systemroot%\SysWoW64

%systemroot%\SysWoW64\regsvr32.exe  /s %systemroot%\SysWoW64\rsclientprint64.dll
%systemroot%\SysWoW64\regsvr32.exe  /s %systemroot%\SysWoW64\rsclientprint.dll

GOTO FINISH

:FINISH

:END

A: Hey just for future reference you got this the wrong way around. the 32bit DLL files should go to SysWOW64 and the 64bit should go in system32.
Confusing but that is the way it works with DLL's is SysWOW64 contains the 32bit emulated DLL files and system32 contains the native 64 bit ones.
Hope this helps someone.

A: The Rsclientprint.inf file is missing.


text:
Q: zabbix agent return powershell value i try to monitor cpu server with zabbix agent, my item key is not supported on zabbix, i tried this item key :
#system.run["powershell.exe -NoProfile -ExecutionPolicy ByPass -File C:\zabbix\conf\CPU_%.ps1"]

#system.run["C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\zabbix\conf\CPU_%.ps1",]

i want to know which item key in zabbix is supported ?
thanks for any response

A: Add the line to zabbix_agentd.conf or zabbix_agent2.conf:

UserParameter=CPU[*], powershell -File "C:\zabbix\conf\CPU_%.ps1"

Add element Zabbix Agent (Active) with key CPU[]


text:
Q: Random variable of a store The weekly profit in thousands of dollars of Miller's Office Supply Store is random variable X whose cdf is given as follows: $F(x)=0$ for $x<0$; $F(x)=(3/32)(2x^2-x^3/3)$ for $0 \leq x \leq 4$; $F(x)=1$ for $4<x$.

(i) Find the probability of a weekly profit of at most 2000 dollars. That is, find $P(x \leq 2$).

My attempt:
I thought you would solve it using integrals like this:
$P(x \leq 2)=(3/32)$
$\int_0^2 x\ dx= (3/32)$ $[2*(x^3/9)-(x^4/12)]$
but I can not seem to get the answer. The answer is $.5$. Can someone please help me with this?

(ii) Find the probability of a weekly profit of at least 3000 dollars.

My thoughts:
For this problem, I think we can do it the same way as in (i)? If so, can someone show me? Can we also do it $P(A)=$ $1-P(x \leq 2)$. If so, how to.

(iii)Determine expressions for the pdf, $f(x)$.

I this it will be be $f(x)=0$ for $x<0$ and $x>0$. I am not sure about the other intervals.
I just started doing problems like these because I am trying to go ahead of what I already know. Can some please explain to me how would you solve the parts to this problem?

A: I think you need to work on obtaining a more solid, introductory understanding of the definitions of these objects you're working with.
For example, the CDF of a random variable $X$ evaluated at the number $x$ is precisely defined as the probability $$Pr(X \leq  x)$$ With that in mind (i) should become a lot easier.
Note also that notation really is important, at least when first learning introductory probability theory. For example, when one speaks of the random variable $X$ one must avoid confusing $X$ with its realization, $x$.
Your subtraction idea for (ii) is exactly on the right track, but you should make sure you can justify why such a formula ($Pr(X\geq 2) = 1 - Pr(X < 2)$) actually makes sense. Hint: it has to do with adding the probability of the union of mutually exclusive events.
Again, for (iii) review the definition of the PDF and its connection to the CDF (they are related by summation/integration for discrete/continuous random variables respectively.


text: Q: curator connect VIP network Zookeeper Zookeeper Cluster deployment,We connect to the cluster VIP:2181,When the timeout client reconnects,curator watch /Zookeeper/config node,The internal IP address is connected,The connection failed. Procedure


text:
Q: How to remove inline style from font awesome I have:
`(font awesome).

I want to get rid of style="visibility: visible;.

A: If you only want to remove the specific style property visibility, you can use the jQuery .css() function and assign it a new empty value. That will result in it being removed as stated in the jQuery documentation.

Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied...

In your case, you could do something like
$('i.clearing').css("visibility","");

A: You can set the property visibility to null to rid it :

JavaScript :
document.getElementById('myTag').style.visibility = null;

PS: I added an id to your tag i to find it with getElementById


text:
Q: how to retrieve continuous updated location data from the GeoFire and put it on Google map? I'm working on a kids location tracking app..here i'm sending the kid's location on database using geoFire which updates after a certain amount of time . But problem is that, in the parents activity the location marker doesn't change depending on the updated location of the kid...So, How can I retrieve the continuous location updates form the database and move the marker according with the location??

A: It depends on what information you are trying to display.
In the following code examples, I have left the implementation of the ParentModel, ChildModel, LocationModel and CheckInModel classes up to you to develop. The code below also doesn't deal with initialising activities, Firebase or the GoogleMaps object.
It goes without saying that you must take the utmost care to secure this sensitive data.
Scenario 1: Show/store only the last known location.
In this scenario, the database only ever holds a single location for each child. There is no concept of location history on the server.
This can be achieved by listening to updates to the data stored in the database at a single location (see Listen for Value Events). In the below code, I have also added an optional Polyline showing recent location updates stored on the client device while the map is open. Each time the data is updated on the server, the listener will be executed and update the local copy of the map.
private DatabaseReference mDatabase;
private DatabaseReference mTrackedLocationRef;
private ParentModel mParent;
private ChildModel mSelectedChild;
private GoogleMap mMap;
private Polyline mCurrentLine;
private Marker mLastKnownLocationMarker;

// ...
mDatabase = FirebaseDatabase.getInstance().getReference();

// initialize a tracking line
mCurrentLine = mMap.addPolyline((new PolylineOptions())
                .clickable(true);

// TODO: download parent's user profile to mParent
mSelectedChild = mParent.children[0]; // select first child

mTrackedLocationRef = mDatabase.child("locations").child(mSelectedChild.uid).child("lastKnownLocation");

ValueEventListener locationUpdateListener = new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {
        // location was updated
        LocationModel locModel = dataSnapshot.getValue(LocationModel.class);

        LatLng pos = locModel.getLatLng(); // getLatLng() returns a LatLng object.

        // if enabled, add position to traced line
        if (mCurrentLine != null) {
          mCurrentLine.add(pos);
        }

        // update/create marker for last detected location
        if (mLastKnownLocationMarker != null) {
          mLastKnownLocationMarker.setPosition(pos);
        } else {
          mLastKnownLocationMarker = mMap.addMarker(new MarkerOptions().position(pos)
                .title(mSelectedChild.firstName + "'s current location"));
        }

        // move camera to new position
        googleMap.moveCamera(CameraUpdateFactory.newLatLng(pos));
    }

    @Override
    public void onCancelled(DatabaseError databaseError) {
        // Getting location update failed, log a message
        Log.w(TAG, "locUpdate:onCancelled", databaseError.toException());
        Toast.makeText(mContext, "Failed to load last known location.",
                Toast.LENGTH_SHORT).show();
    }
};
mTrackedLocationRef.addValueEventListener(locationUpdateListener);

Scenario 2: Show the last 5 locations.
In this scenario, a history of location "check-ins" is kept on the database that were uploaded to the server using push() operations. The listener in this case will only update the map with the 5 most recent location updates. Each time a new location is added to the server, the new location will be added to the map and the oldest of the 5 locations will be removed.
private DatabaseReference mDatabase;
private DatabaseReference mTrackedLocationRef;
private ParentModel mParent;
private ChildModel mSelectedChild;
private GoogleMap mMap;
private Polyline mCurrentLine;
private final Map<String, Marker> mMarkers = new ConcurrentHashMap<String, Marker>();

// initialize a tracking line
mCurrentLine = mMap.addPolyline((new PolylineOptions())
                .clickable(true);

// TODO: download parent's user profile to mParent
mSelectedChild = mParent.children[0]; // select first child

mTrackedLocationRef = mDatabase.child("locations").child(mSelectedChild.uid).child("checkins").limitToLast(5);

ChildEventListener locationUpdateListener = new ChildEventListener() {
    @Override
    public void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {
        // this location update is one of the five most-recent entries
        String keyName = dataSnapshot.getKey();
        Log.d(TAG, "onChildAdded:" + keyName);

        CheckInModel checkin = dataSnapshot.getValue(CheckInModel.class);

        LatLng pos = checkin.getLatLng(); // getLatLng() returns a LatLng object.

        // remove title of previous marker
        mMarkers.get(previousChildName).setTitle("");

        // add new marker
        Marker marker = mMap.addMarker(new MarkerOptions().position(pos)
                .title(mSelectedChild.firstName + "'s current location"));

        marker.setTag(keyName); // store key name in marker's metadata

        // store marker by its key name for easy removal
        mMarkers.put(keyName, marker);
    }

    @Override
    public void onChildChanged(DataSnapshot dataSnapshot, String previousChildName) {
        Log.d(TAG, "onChildChanged:" + dataSnapshot.getKey());

        // todo: handle edited data?
    }

    @Override
    public void onChildRemoved(DataSnapshot dataSnapshot) {
        // this location update is no longer one of the five most-recent entries
        Log.d(TAG, "onChildRemoved:" + dataSnapshot.getKey());

        // find and remove existing marker
        mMarkers.get(dataSnapshot.getKey()).remove();
    }

    @Override
    public void onChildMoved(DataSnapshot dataSnapshot, String previousChildName) {
        Log.d(TAG, "onChildMoved:" + dataSnapshot.getKey());

        // todo: handle reordered data?
    }

    @Override
    public void onCancelled(DatabaseError databaseError) {
        Log.w(TAG, "locUpdate:onCancelled", databaseError.toException());
        Toast.makeText(mContext, "Failed to load location history.",
                Toast.LENGTH_SHORT).show();
    }
};
mTrackedLocationRef.addChildEventListener(locationUpdateListener);

As this data is sensitive in nature, ensure that you also have processes to completely delete all data concerning a parent and their children in a fast and simple manner.


text:
Q: Solve $\arg\left (\frac{z-1}{1+i}\right) > \frac{ \pi}{2}$ I want to solve $$\arg \left(\frac{z-1}{1+i}\right) > \frac{ \pi}{2}$$
It should be fairly simple but I'm having difficulties.
What I tried:
\begin{align}\arg \left(\frac{z-1}{1+i}\right) &= \arg \left(\frac{(z-1)(1-i)}{2}\right) \\
&= \arg \left(\frac{z-iz -1 + i}{2}\right) \\
&= \arg \left(\frac{x+iy-ix+y-1+i}{2}\right) \\
&= \arg \left(\frac{x+y-1}{2} + i\frac{y-x+1}{2}\right) \\
&= \tan^{-1}\left(\frac{\frac{y-x+1}{2}}{\frac{x+y-1}{2}}\right) \\
&= \tan^{-1}\left(\frac{-x+y+1}{x+y-1}\right)\end{align}
And so we must have that $$\tan^{-1}\left(\frac{-x+y+1}{x+y-1}\right) > \frac{\pi}{2}$$
But that is not possible... Where is my mistake and how do we solve this?

A: If $z=x+iy$ where $x,y$ are real
$$\dfrac{x-1+iy}{1+i}=\dfrac{(x-1+iy)(1-i)}{1^2-i^2}=\dfrac{x-1+y+i(y+1-x)}2$$
Using the definition of atan$2$, we need  $$x-1+y<0\iff x<1-y;$$
$$y+1-x\ge0\iff x\le y+1$$


text:
Q: In a DialogFragment, what should onCreate do? I am currently messing around with DialogFragment to learn to use it. I assumed that compared to onCreateView(), onCreate() can do this:
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    testTextView.setText("SUCCESS!"); //ERROR HERE
}

But I am wrong. Not sure why its not working. The error goes away when I comment out testTextView.setText("Success!");
The error is a NullPointerException, and then it just flags line 39 which is where the offending line of code is. Any clarifications much appreciated.
EDIT:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
    View testView = (View)inflater.inflate(R.layout.test_dialog_file, container, false);
    //instantiated testTextView globally
    testTextView = (TextView)testView.findViewById(R.id.set_text);
    testTextView.setText("SUCCESS!");
    return testView;
}

A: testTextView is NOT pointing to any object so try something like
testTextView = (TextView) findViewById(R.id.testTextView);

EDIT:
If you see the lifecycle of a fragment, it says that onCreateView is called after onCreate hence your onCreate doesn't have any reference to your object, that is textview in your layout

A: You haven't used setContentView yet, so you are getting a NPE for the TextView.
onCreate happens before onCreateView.  If you want to access something from the layout there, you need to setContentView... which is not a good idea for a DialogFragment.
Move that bit of code to onCreateView after you setContentView and you'll be ok.
For your reference, here's the Fragment Lifecycle:

A: Did you initialize the testTextView in onCreateView? You have to use a LayoutInflater in onCreateView to get the Layout and then you have to access the TextView via findViewById.


text:
Q: jquery slideout button Below source for jquery slideout
jQuery(function($)
{
        $('#slideClick').toggle(function() {
            $(this).parent().animate({left:'0px'}, {queue:false, duration: 500});
        }, function() {
            $(this).parent().animate({left:'-290px'}, {queue:false, duration: 500});
        });
    });

I'm trying to do, after submit the button, I try to show send successfully and back to empty text box window.
how to fix enquiry form fix same position, not going to up and down when I scroll the page. thanks
Fiddle: http://jsfiddle.net/bala2024/Zv79N/

A: this question should be marked as CSS question not javascript.
anyway this is the fiddle
a little fixed was needed, except of adding positioning to the id="slideClick" you should add fixed positioning to the parent, so the parent (id="slideOut") will be fixed (so the id="slideClick" will be fixed')
#slideOut {
    position:fixed;
    width:310px;
    height:80px;
    top:45%;
    left:-290px;
}
was all you need


text:
Q: WebView with scrolling bar at the top I have to create an app which UI is quite similar to Chrome. In other words, I have to create a WebView, and a bar at top of it, which:

*

*disappears as user scrolls the page down (the bar scrolls with the page),

*reappears when user scrolls the page up,

*when the user scrolls the page so only half of the bar is visible, then it just disappear.

The important (probably) thing is that I cannot modify the HTML displayed. What I've already figured out is that I should create my own class that extends the WebView and override the onScrollChanged() in it. This is what I managed to write:
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
    super.onScrollChanged(l, t, oldl, oldt);

    if (flag) {
        flag = false;
        return;
    }
    View bar = getRootView().findViewById(R.id.bar);
    if (bar != null) {
        int difft = oldt - t;
        float oldY = bar.getTranslationY();
        float newY = Math.max(-bar.getHeight(), Math.min(0, bar.getTranslationY() + difft));
        bar.setTranslationY(newY);
        View layout = getRootView().findViewById(R.id.layout);
        layout.setTranslationY(bar.getHeight() + newY);

        flag = true;
        if ((int) (newY - oldY) != 0) {
            scrollBy(0, difft);
        }
    }
}

(layout is the container the WebView is in, and bar is the top bar. I placed both Views in RelativeLayout)
And well, it almost works. Almost, because it causes some flickering, and I don't know what's the problem. Also, it does not solve problem #3 (and I don't actually know how to solve it by the simpliest way, with some sort of animation, like in Chrome - a smooth move to the up).


text:
Q: How is the term "test run" typically used? Is the term "test run" used like the word "test" or is it more specific? I feel "test run" would be used in situations where products are being tested, but what about ideas, arguments?

I did a few test runs of my debate arguments on a few audiences and
  the reception was largely positive.

A: Test run can be used in the same way as one noun sense of test, but it does have a more specific meaning.
The sense of test in question is that in "run some tests", as opposed to "I had a science test at school". But not every instance of test in that sense can be replaced.
A test run is a run of some process, or some equipment or whatever, for the purpose of testing. So you can have "test runs" of debate arguments - it means you run through the arguments in front of a test audience. It means using something to test it out.
So there is no "test run", as a noun phrase, if you go to hospital and they run tests on you. Those are tests being run on you.
So a speech might have a test run, a piece of software might have a test run. There's potential for confusing "running tests" with "having a test run". If you're familiar with the phrase trial run, that is broadly the same as test run.
In the case of software, you would "run tests" on software while it is being written, to make sure that individual components behave as intended, and then you would have "a test run" of the prototype once it is complete and you can try it out.
The only problem with the example you used is that it should be "a few test runs of my debate arguments".

A: The meaning is slightly different, but I would rather say

I did a few tests on my debate arguments on a few audiences and the reception was largely positive.

Or:

I did a few test runs of my debate arguments on a few audiences and the reception was largely positive.


text:
Q: PhpStorm fails with git When I try to git fetch or any other command I get errors.
10:35:18.905: [DocGen] git -c core.quotepath=false pull --progress --no-stat -v --progress origin master
Permission denied, please try again.
Permission denied, please try again.
git@xxxx.githost.io: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

The problem is PhpStorm don't ask me the id_rsa key password.
If I do this in the command line it works:
C:\work_dev\Project (master)
λ git -c core.quotepath=false pull --progress --no-stat -v --progress origin master
Enter passphrase for key '/c/Users/Username/.ssh/id_rsa':
From xxxx.githost.io:certification/DocGen
 * branch            master     -> FETCH_HEAD
 = [up to date]      master     -> origin/master
Already up-to-date.

This was working before I update PhpStorm, also when I tried to revert to using the old version know it doesn't work too.


text:
Q: Error Attribute 'Computed' is not allowed to appear in element 'column' I am trying to create oracle table with virtual column as below
in liquibase
    create table MY_TABLE
    ( entry_datetime DATE not null,
      entry_date     DATE AS (TRUNC(entry_datetime)))
As per the documentation I tried to use ValueComputed attribute as below
<changeSet author="base_script" id="idx_31710" context="btr_rem" dbms = "oracle">
</changeSet>
<changeSet author="my_scripts" id="t11" dbms="oracle">
<createTable
          remarks= ""
          tableName= "my_table1">
<column name="entry_datetime" type="date" >
          <constraints nullable="false"/>
</column>
<column name="entry_date" type="DATE"  ValueComputed="TRUNC(entry_datetime)"></column>
</createTable>
</changeSet>

How ever when I am running it is giving error as below
cvc-complex-type.3.2.2: Attribute 'ValueComputed' is not allowed to appear in element 'column'.
I tried using computed attribute as

but its giving error
cvc-complex-type.3.2.2: Attribute 'Computed' is not allowed to appear in element 'column'.

A: You are creating a new table, not assigning the value to a column.
This requires a defaultValueComputed attribute.
E.g.:
<column name="entry_date" type="DATE" defaultValueComputed="TRUNC(entry_datetime)"></column>


text:
Q: Sort nvarchar column in SQL Server which consists of alphanumeric Can anyone suggest how to sort a nvarchar column with this sample data:
Month     ExpectedResult
------    ----------------
Aug15      Aug15
Nov15      Oct15
Oct15      Nov15
Sept16     Sept16

A: You can use order by CONVERT(datetime,'01'+Mon).
It is working fine for me, I have used the below query:
select Mon from (select 'Aug15' Mon
union
select 'Nov15'
union
select 'Oct15'
union
select 'Sep16')as a order by CONVERT(datetime,'01'+Mon);


text:
Q: How do i check that the textboxes and checkbox has been filled and checked before user can submit the form? Below shown my JS code and part of the HTML that i wish to create the form. I can't find the reason of why i CAN still submit it when there are fields that are not filled. It should pop up a dialog box according to which fields the user has not fill.

Start Date:

            <input id="sdate" type="date" name="startdate">

End Date:

            <input id="edate" type="date" name="enddate">

By checking this box I agree that I have satisfied all requirements.

            <input id="agree" type="checkbox" name="checkbox" class="tick-att">

             <input type="submit" class="button" name="submit" value="submit" onclick="validation()" >

A: check box validation was wrong . Iis is(':checked')  .And apply the input validation simple with !input value its validate null,empty,undefined ..trim() remove the unwanted empty spaces .
if you have from tag try with onsubmit="return validation()"  instead of onclick="validation" submit button. return false its stop the function execution when the input fails

function validation() {
  if (!$('#sdate').val().trim()) {
    alert('Please fill in start date field');
    return false // if you have a form tag
  }
  if (!$('#edate').val().trim()) {
    alert('Please fill in end date field');
        return false // if you have a form tag
  }
  if (!$('#agree').is(':checked')) {
    alert('Please indicate that you have satisfied all the requirements');
        return false // if you have a form tag
  }
  else{
  console.log('ok')
  }
}

<form onsubmit="return validation()">

Start Date:

      <input id="sdate" type="date" name="startdate">

End Date:

      <input id="edate" type="date" name="enddate">

By checking this box I agree that I have satisfied all requirements.

      <input id="agree" type="checkbox" name="checkbox" class="tick-att">

      <input type="submit" class="button" name="submit" value="submit" >

</from>

A: Try this, It will help you,

$("#btn").click(function()
{
        if( $('#sdate').val() == null ||  $('#sdate').val() == undefined || $('#sdate').val() == "" ){
            alert( 'Please fill in start date field');
            return false;
        }
        if( $('#edate').val() == null || $('#edate').val() == undefined ||  $('#edate').val() == "" ){
           alert( 'Please fill in end date field');
           return false;
        }
       if(!document.getElementById('agree').checked) {
            alert( 'Please indicate that you have satisfied all the requirements');
            return false;
        }
});

Start Date:

            <input id="sdate" type="date" name="startdate">

End Date:

            <input id="edate" type="date" name="enddate">

By checking this box I agree that I have satisfied all requirements.

            <input id="agree" type="checkbox"  name="checkbox" class="tick-att">

             <input type="submit" id="btn" class="button" name="submit" value="submit" onClientClick="validation()" />

You need to add return false after every alert. then It will prevent submit event and also it will show the alert message of appropriate field which is first position in the form. If it is not filled immediately the submit event is prevent rest of the alert messages are not shown even the field is empty.

A: you need to catch the form submit event. The return false statement in the if conditions will stop the event. If everything goes fine, no return false statement will be executed and the form will be submitted.
var validation = function() {
        if( $('#sdate').val() == null ||  $('#sdate').val() == undefined || $('#sdate').val() == "" ){
            alert( 'Please fill in start date field');
            return false;
        }
        if( $('#edate').val() == null || $('#edate').val() == undefined ||  $('#edate').val() == "" ){
           alert( 'Please fill in end date field');
           return false;
        }
        if( !$('#agree').is(':checked') ){
            alert( 'Please indicate that you have satisfied all the requirements');
            return false;
        }
    }

$("form").submit(function(){
  validation();
});