text:
Q: "No hurries. No worries" - could we say "No hurries nor worries"? I was recently commenting some answers in Stack Overflow when one person said something to which I replied:

No hurries. No worries.

I have seen both "no hurries" and "no worries" many times, but I doubted on what was the best way to use them together: would it be correct to say as follows?

No hurries nor worries

I would say this as a way to contract the "neither you have to hurry neither to worry".

A: Neither hurries nor worries doesn't to my ear have the sort of rhythm you want in a catchphrase. And although worry is commonly used as a count noun—you may have many worries weighing on your mind—this is very rare with hurry: it's almost always a quality ascribed to persons or activities rather than an instance of hurrying.†
No hurry, no worry sounds better to me. It might have two meanings, depending on the context:

*

*There is no need for your hearer either to hurry or to worry—you don't need immediate response or action. In other words, "Don't hurry, and don't worry".

*Your hearer should avoid hurrying, because that will avoid future problems. In other words, "If you don't hurry, you won't worry".

† Except in US football jargon, where a hurry is an instance of transitive hurrying: rushing the quarterback so aggressively you compel him to pass the ball before his receivers are in good position to catch it.


text:
Q: Handling N/As which are not missing values in a classification model I am facing a problem of N/As in classification model and haven't found similar problems.
My dataset contains data on scores of students sitting an entrance examination. The exam contains $8$ subjects, and each student can sit $n$ subjects where $3 \le n \le 8$.
These $8$ subjects are divided into $5$ groups, each group containing $3$ subjects.
The total scores of any groups of subjects will be submitted for the screening.
By some way, someone has been detected correcting scores of some students to help them pass the exam: he raised the scores of 1 or 2 group(s) of subjects, and lower the scores of any subjects outside these groups (so that the average score is not so suspicious).
The data is labelled so that we know which students being corrected scores as well as actual scores of those students. Now I would like to run a classification model to detect fraud (logistic regression/decision tree...) but am facing one problem: how to handle N/As in the model. Because the number of subjects each students taking are different (can be any ranging from 3 to 8), there are many N/As values. I don't think I can treat them as kind of "missing value", because the N/As themselves here can somewhat reflect the way of fraud (for example, some students aim for natural science so they don't sit in so many social science subjects, and the fraud technique is to lower scores in some social science subjects and raising scores in natural science). I cannot treat N/As here as 0 or average values as usual because it does not make sense.
Is there any way to include N/As in the model in this case?

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can we bind selected row (or any property [for example Id column] from that row) to a property from ViewModel? We are using MVVM Light Silverlight project for WCF Ria Service based project. After some research we decided to use DevExpress DataGrid with RiaInstantFeedbackDataSource. Everything works great until we wanted to bind grid's focused row to a ModelView property. Here is our XAML,
<UserControl x:Class="OurProject.Silverlight.Views.Personnel.List"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
         xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" mc:Ignorable="d"
         DataContext="{Binding Personnel, Source={StaticResource Locator}}"
         d:DesignWidth="640" d:DesignHeight="480">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition Height="30" />
    </Grid.RowDefinitions>

    <dx:RiaInstantFeedbackDataSource x:Name="DataSource" QueryName="{Binding Path=QueryName}" KeyExpression="{Binding Path=KeyExpression}"
                                     DomainContext="{Binding Path=Context}" />

    <dxg:GridControl Name="grid" ItemsSource="{Binding ElementName=DataSource, Path=Data}" Grid.Row="0" AutoPopulateColumns="True" >
        <dxg:GridControl.View>
            <dxg:TableView x:Name="view" FocusedRow="{Binding Selected}" />
        </dxg:GridControl.View>
    </dxg:GridControl>
    <Button Grid.Row="1" Height="30" VerticalAlignment="Bottom" Content="Edit" Command="{Binding Edit}" />
</Grid>

When we debug this code (breakpoint after Edit command executed) we realized that type of FocusedRow is object[]. We tried RowPropertyValueConverter but we can't find any document on how to use it.
How can we bind selected row (or any property [for example Id column] from that row) to a property from ViewModel?
P.S: We checked this link, it does not work for RiaInstantDataSource.
Thanks in advance.

A: OK, we solved this issue with

AreSourceRowsThreadSafe="True"

addition to our code.
<dx:RiaInstantFeedbackDataSource x:Name="DataSource" QueryName="{Binding Path=QueryName}" KeyExpression="{Binding Path=KeyExpression}" AreSourceRowsThreadSafe="True" DomainContext="{Binding Path=Context}" />

We will trace the impacts of this with multi-threading and will write here back any important foundings.


text:
Q: working navigation but toggle does not open After nearly a week I am still struggling with toggle on navigation.
This is my current CSS, what I need to do now, is simply get the toggle to open, it did open before so something minor is stopping it now but I cant work it out. I do not really know much about CSS as I keep forgetting it, but I do not know javascript or jquery

  .nav {
  background-color: #3333FF;
  width: 100%;
}

.menu label,
#hamburger {
  display: none;
}

.menu ul {
  font-family: Monserrat, sans-serif;
  font-size: 18px;
  color: white;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.menu ul li {
  text-align: center;
  display: inline-block;
  padding: 10px;
  width: 11.11%;
}

.menu ul li a {
  color: #fff;
  text-decoration: none;
}

.menu li:visited {
  background: #0000EE;
  color: #fff;
}

.menu li:active,
.active {
  background: #0000EE;
  color: #fff;
}

.menu li:hover {
  background: #0000EE;
  color: #fff;
}

label {
  margin: 0 20px 0 0;
  font-size: 20px;
  line-height: 44px;
  display: none;
}

#toggle {
  display: none;
}

/* Show Hamburger */

@media screen and (max-width: 768px) {
  .nav {
    background-color: #3333FF;
    width: 100%;
  }
  ``` .menu label {
    display: inline-block;
    color: #fff;
    background-color: #3333FF;
    padding-bottom: 8px;
  }
  .menu ul {
    display: none;
  }
  .menu ul li {
    display: block;
    border-top: 1px solid #333;
  }
  .menu ul li:active {
    display: block;
  }
  .menu label {
    cursor: pointer;
    margin: 0 20px 0 0;
    font-size: 20px;
    font-weight: bold;
    line-height: 44px;
    display: block;
  }
  #toggle:checked+.menu {
    display: block;
  }

    ☰<input type="checkbox" id="toggle">

Home

News

Contacts

Policies

Members

Volunteer

Links

A: Just change your selector from:
#toggle:checked+.menu {
    display: block;
}

to:
#toggle:checked+ ul {
   display: block;
}

See snippets below:

.nav {
  background-color: #3333FF;
  width: 100%;
}

.menu label,
#hamburger {
  display: none;
}

.menu ul {
  font-family: Monserrat, sans-serif;
  font-size: 18px;
  color: white;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.menu ul li {
  text-align: center;
  display: inline-block;
  padding: 10px;
  width: 11.11%;
}

.menu ul li a {
  color: #fff;
  text-decoration: none;
}

.menu li:visited {
  background: #0000EE;
  color: #fff;
}

.menu li:active,
.active {
  background: #0000EE;
  color: #fff;
}

.menu li:hover {
  background: #0000EE;
  color: #fff;
}

label {
  margin: 0 20px 0 0;
  font-size: 20px;
  line-height: 44px;
  display: none;
}

#toggle {
  display: none;
}

/* Show Hamburger */

@media screen and (max-width: 768px) {
  .nav {
    background-color: #3333FF;
    width: 100%;
  }
  .menu label {
    display: inline-block;
    color: #fff;
    background-color: #3333FF;
    padding-bottom: 8px;
  }
  .menu ul {
    display: none;
  }
  .menu ul li {
    display: block;
    border-top: 1px solid #333;
  }
  .menu ul li:active {
    display: block;
  }
  .menu label {
    cursor: pointer;
    margin: 0 20px 0 0;
    font-size: 20px;
    font-weight: bold;
    line-height: 44px;
    display: block;
  }
  #toggle:checked+ul {
    display: block;
  }

    ☰<input type="checkbox" id="toggle">

Home

News

Contacts

Policies

Members

Volunteer

Links

A: Here is an example for this. You can try this code. It is fully tested. I hope it will help you. You can change colors and backgrounds as per needed in this code.

nav ul ul {
  display: none;
}
nav ul ul li {
  float: none;
}
nav li {
  float: left;
  list-style-type: none;
}
nav li a {
  text-decoration: none;
  display: inline-block;
  margin: 10px 20px 5px 0;
  padding: 8px 10px;
}
nav li a:link, nav li a:visited {
  color: #646565;
  background: #e8e9eb;
}
nav li a:link:hover, nav li a:visited:hover {
  color: black;
}
nav li:hover ul {
  display: block;
  position: absolute;
}

input.toggle,
label.toggle {
  display: none;
}

label.toggle {
  font-weight: 900;
  font-size: 1.2em;
  padding: 10px 20px;
}

@media (max-width: 960px) {
nav {
  display: none;
}
input.toggle, .toggle span {
  display: none;
}
input[type=checkbox]:checked ~ nav, label.toggle {
  display: block;
  cursor: pointer;
}
nav li {
  float: none;
}
nav li:hover ul {
  display: block;
  position: relative;
}
nav li ul {
  display: block;
}
nav li ul li {
  margin-left: 20px;
}
nav li a {
  display: block;
  margin-left: 20px;
}
}

        ☰ Menue
        <input class="toggle" id="toggle" type="checkbox">

Home

News

Contacts

Policies

Members

Volunteer

Links


text:
Q: using a SUM IF formula in Access I am trying to sum "Order Qty" from a table in my Access database where "Material group name" equals "Generic Rx" through a Sum if formula
I am using:
Gen Ordered: SUM(IIF([Material group Name]=(Generic Rx).[Order Qty],0)

but I am getting an invalid syntax error at the Generic Rx expression
"Generic Rx" is value within the "Material group name" column
what is the best way to go about this? Thanks

A: SUM(IIF([Material group Name]=(Generic Rx).[Order Qty],0)
                              |           |              |
                              1           2              3

*

*Use quotes instead of parentheses to delimit literal text values.

*Use commas between IIf arguments.

*Every open parenthesis must be balanced by a close parenthesis.

This should be closer ...
SUM(IIF([Material group Name]="Generic Rx",[Order Qty],0))

A: Your question is unclear as you don't explain us what the different elements are. If we assume that Generic Rx is a query parameter and Order Qty is a table column then your expression must be
Gen Ordered:     Sum( IIF([Material group Name] = [Generic Rx], [Order Qty],    0) )
'                                                                  |            |
'Name of                  |<-------------- condition ------->|   true-part  false part
'result column
'                     IIF( <condition>, <result if true>, <result if false>)

Meaning: If Material group Name equals Generic Rx Then the result will be Order Qty else it will be 0.


text:
Q: Cancel an asynchronous call (IAsyncResult) I am programming in .net WPF.
I have a (third party) API which implements the Begin/End asynchronous call pattern. The BeginWork() function returns an IAsyncResult.
However, there is no apparent method to cancel/abort the call, once done.
Is there a way to have such a job stopped? If this requires the library author to provide explicitly for a cancel method, what is a way to kill this job, even ungracefully? I really need to be able to stop it somehow, as a single job may take hours to complete!
Thanks!

A: If the implementation does not include specific code allowing for cancellation, then it is quite likely that you can't cancel it. Not everything can be logically cancelled cleanly, especially if it involves external resources. But also if the code to cancel it simply hasn't been written.
.you could try randomly killing threads, but this will doom your process - basically this would be the same as deciding to kill the entire process half way through. It will stop the work, but it could leave things in a complete mess if it isn't transactional.
If I was you I would (one of):

*

*ask the 3rd party for a supported cancellation API

*don't start it unless you are sure


text:
Q: Node.js: Pass variables to a file I am sending a .XML file using res.sendfile 'xml/foo.xml'. How can I pass variables to the foo.xml file and change the .XML content accordingly?
Thanks

A: Instead of using res.sendfile 'xml/foo.xml', you'll have to use a template file and pass your variables into a library that will parse the template and give you the XML for each request. While there are many templating engines for Node.js, the two that Express supports by default are EJS and Jade. Jade is Haml-like, which is cool, but if you're working with existing XML, then you should probably stick to EJS. EJS lets you just take ordinary HTML or XML and embed JavaScript in it.
So, you'd rename xml/foo.xml to views/foo.ejs and, instead of res.sendfile, you'd write something like
res.contentType 'text/xml'
res.render 'foo.ejs', obj

where obj contains all of the variables that you want to make available to the template.
Check the Express guide on "View Rendering" for more information.


text:
Q: Database update weirdness I am developing a game in Django in which the quantity of rebels updates after a turn change. Rebels are represented as integers from 0 to 100 in the (MySQL) database.
When I save, this happens:
print world.rebels
>>> 0

rebstab = 0
world.rebels += rebstab
world.save()

print world.rebels
>>> 0

However, when I use F() expressions (as I gather I should to prevent race conditions), this happens:
print world.rebels
>>> 0

rebstab = 0
world.rebels = F('rebels') + rebstab
world.save()

print world.rebels
>>> 100

What's going on?

A: I don't have any experience with using F() objects like this so this answer may not be useful, but having a look at the documentation it mentions:

In order to access the new value that has been saved in this way, the object will need to be reloaded:
reporter = Reporters.objects.get(pk=reporter.pk)

so you may have to actually query the DB again to see the updated value:
print world.rebels
>>> 0

rebstab = 0
world.rebels = F('rebels') + rebstab
world.save()

print World.objects.get(pk=world.pk)
>>> 100

Edit: Also look [at the example where you don't need to pull the objects into memory and can do everythign at the DB level:
World.objects.get(pk=...).update(rebels=F('rebels) + 1)

A: I just figured out the reason had nothing to do with the F() object itself but rather a conflict with a custom save method. See Django F() objects and custom saves weirdness for a more indepth explanation.


text:
Q: If YOU were starting out now, what PIC16F-compatible IDE and compiler would you choose, and why? This is going to be a bit long as I wanted to cover all the obvious questions before they arise, give a rationale to some of my thinking, and prove I've done my groundwork! If time is short, skip down to the tl;dr section to get to the meat. The banner above also says this looks like a subjective post, so I'm going to expand the post a bit to narrow down exactly what it is I want to achieve.
I've had a really good look around stackexchange and there are similar-ish questions to mine, and I found the question Starting out PIC Programming useful but most were asked and answered before the new release of MPLAB X which is now based around the open source NetBeans IDE which is quite a change, so might tilt the balance.
Background: I bought an Arduino recently and having never done MCU fiddling before, and my programming knowledge limited to PHP, I was quite pleased with the results.
There's a few "fun" things I want to do to start with to get going before the "proper" stuff...

*

*Make a kitchen countdown timer that rings a little handbell for a few seconds.

*Make a chicken door opener.

Eventually I want to....

*

*Build a data logger which will intercept and log the NIBE heat pump status and running time data from the external F2015 unit to the SMO 05 controller which runs on a CAT5 cable (once I've found out the data protocol!).

*Interface with the IR interface "eye" of my electricity meter and log hourly readings of the actual energy usage (as opposed to the highly inaccurate but cheap clamp-the-wire monitors).
Looks like I have some choices here:
Arduino/Freeduino: Incredibly fast start - I had it speaking the words "ready", then "button up" or "button down" (depending on state) using the PCM library, loudspeaker and the Uno within a few hours of opening the box and with 30 lines of code. But for each and every concurrent project, you need an Arduino.
**The Picaxe **- uses PicBasic and special pre-bootloaded PIC chips. The system is incredibly cheap and fast to get learning, allows the programmed chip to be taken out and used standalone in a breadboard, but at some point I'm going to need to expand beyond PICBasic.
Even I could cope with these first two options. Mainly because each has one high-level simplified language to learn, and one simple all-in-on IDE/compiler/programmer.
Standalone PIC: Then there's the bog-standard £2 PIC chip and super-cheap K150 programmer allowing the programmed chip to be taken out and used standalone in a breadboard.
So when a K150, cable, CD with hex flashing software and a couple of PIC16F690 chips arrived yesterday morning, I was starting with a blank sheet. I can write php and understand the basics of object oriented languages, and did a little C at college, enough to get me started quicker on the Arduino than if I'd done none. But I also understand that Arduino's 'Wiring' is an extremely simplified superset of C, so I'm going to have to get more down and dirty for programming the K150 of course. Maybe assembler one day, but for opening a chicken run door when it gets light, I'm fairly sure C will suffice to start!
The problem I have is.... so many options!
I hope I have proved to have done my homework with this 12 sheet spreadsheet with over 200 listings and links to different types of projects, reference and help sites etc. According to Chrome I looked at 118 related sites on the day I got the K150, and over 330 relevant sites in the last 4 days. So I've definitely done some groundwork!
Yes, I know I should buy the PicKit3 and that somehow having bought the K150 makes me the spawn of
satan according to the replies other K150 owners have got on forums. One day I'm sure I'll buy it, but right now I'm just getting going as a hobby. I've bought an official Arduino so I've salved my soul that way!
tl;dr -  enough waffle, what's the question?!
As I understand it, as long as I can compile hex, I can program a PIC chip with the K150 or pretty much any compatible programmer.
Unless I'm mistaken, I have the following choices:
MPLAB X and PIKlab are both free IDEs compatible with most Microchips PIC chips.
Hi-Tech C Compiler, Sourceboost, Codeblocks and SDCC are all Microchips compatible compilers, some free like SDCC, some free with limited functionality, some only free for one specific chip.
Then there's PicBasic Pro, £99 for the full suite or £30 for the student edition of the compiler alone.
Right now, £99 is a fairly high amount for "having a play" - anything to recommend Picbasic over C?
I've also been watching some of the official and unofficial training videos for some of the above.
At this point in time, my intention is not world domination or the next RaspberryPI, it's to be able to blink an LED, maybe take keypad input, maybe even make a Charlieplexed LEDcube for Christmas.
I'm getting on in my years and am of limited brain and time; the obvious thing would be to have the time to try all of the above and see which suited me. Not really practical.
I need to pick one, learn it, and stick with it. Yes, Google has been my friend, but a lot of the reviews of these IDEs and compilers refer to quit old versions. I've even found links to sites at Demon Internet and Geocities - 1994-1996 seems to be the peak bubble of activity for discussion on burning your own PIC code. And a lot changes in 8 years.
So my question would be:
If YOU were starting out now, what IDE and compiler would you choose, and why?
Thanks, and sorry this was such a long post!

A: If you really want to learn about microcontrollers, then ditching the arduino and all its layers that hide the details from you is necessary.  A PIC 16 is certainly one bare microcontroller.
You definitaly want to use MPLAB, at least for debugging.  Using anything else makes no sense, as MPLAB is free and officially supported by the manufacturer.  Microchip now also has a full line of compilers that are free, with the only difference from the full versions in that some optimizations are turned off.  That should be of no consequence for someone learning and experimenting, and you get to use the same compilers most other people are using and that therefore have the most eyes catching bugs.
However, if your aim is to really learn something, you should do a few projects in assembler.  This will force you to learn the lower levels and open your eyes to what really goes on at the hardware and instruction level.  That insight is very useful even when writing higher level code, and you won't be reluctant to implement a key module here and there in assembler as it may be appropriate.

A: I see no reason to ditch the Arduino IDE.  It is simple and fast, and as you said, a simpler set of c + there are so many contribs to the thing that it makes work just too easy.  I completed a huge two processor project using the Arduino IDE in less than 2 months, and it works flawlessly.
But of course, if anybody knew what I used it I would be flamed for not using one of the more conventional ide's.  The whole idea is to get machine code generated as fast as possible to get a working product.
Why complicate things?
The arduino/atmel lineup is infinitely easier than any other embedded product design studio anywhere, especially if you need fast results, and a super short learning curve.  Just don't tell the boss.


text:
Q: Python color map but with all zero values mapped to black I have a square array of elements which correspond to lattice sites. Some of the elements are zero and the rest vary between 1 and about 2700. Using imshow and the OrRd colour map, I want all lattice sites greater than 0 to display the corresponding colour but importantly, all sites with value 0 to be displayed as black. I have tried defining a new color map as follows:
colors = [(0,0,0)] + [(pylab.cm.OrRd(i)) for i in range(1,256)]
new_map = matplotlib.colors.LinearSegmentedColormap.from_list('new_map', colors, N=256)

but the range of values in my array is too large and so a lot of non-zero values get displayed as black.
Many thanks.

A: The colormaps of Matplotlib have a set_bad and set_under property which can be used for this. This example shows how to use the set_bad
import matplotlib.pyplot as plt
import numpy as np

# make some data
a = np.random.randn(10,10)

# mask some 'bad' data, in your case you would have: data == 0
a = np.ma.masked_where(a < 0.05, a)

# cmap = plt.cm.OrRd

# for mpl 3.3 and higher use
cmap = mpl.cm.get_cmap("OrRd").copy()

cmap.set_bad(color='black')

im = plt.imshow(a, interpolation='none', cmap=cmap)

To use the set_under variant you have to add the vmin keyword to the plotting command and setting is slightly above zero (but below any other valid value):
cmap.set_under(color='black')
im = plt.imshow(a, interpolation='none', cmap=cmap, vmin=0.0000001)


text:
Q: Hosting a discord.py bot on AWS EB i'm trying to deploy a python discord bot to AWS ElasticBeanstalk.
The EB deploy phase ends succesfully and my bot responds in the discord channel :

But i still have errors in the AWS logs with the healthchecker :

I'm not specialized in AWS management, i'm learning, does anyone have an idea ?
Any help will be appreciated.


text:
Q: Machine.config alternative in Azure I have a webservice which connects to a database on DEV / Production environments.
I'm managing both environments connection strings in the machine.config file of the servers.
For example, the machine.config in the production server will contain something like this:
<add key="MyDatabase" value="productsConnString..." />

and the dev server machine.config will have this settings:
<add key="MyDatabase" value="devConnString..." />

Naturally, when i connection to the database in code, i'm calling ConfigurationManager.AppSettings["MyDatabase"] and the correct connection string is loaded.
Is there i way i can achieve same abstraction level in Azure environment?
I read some articles which explain about Config transformations but if i use this i would need to Copy&Paste the connection strings to each Application (incase i have more than just that WebService).
Is there any alternative to machine.config in Azure? Maybe a subscription level Configuration file of some sort?
Thanks!!

A: I would seriously consider using the cloud service configuration file (assuming this is a PaaS solution). It not only allows you to separate the application deployment package from the configuration settings (like you're doing), but also gives you the ability to adjust those changes "on the fly" to accommodate things like failover. If you take the extra step of creating your own configuration provider, it also gives you some simple ways to support both models.

A: Concur with Brent - use the Cloud Service configuration file and get the setting with CloudConfigurationManager.GetSetting("settingsKey") - this uses the Cloud Service config if you are in Azure or the Emulator first, if the key isn't found there it also looks in the web.config file in appSettings.


text:
Q: Tensorflow - building LSTM model - need for tf.keras.layers.Dense() Python 3.7 tensorflow
I am experimenting Time series forecasting w Tensorflow
I understand the second line creates a LSTM RNN i.e. a Recurrent Neural Network of type Long Short Term Memory.
Why do we need to add a Dense(1) layer in the end?
single_step_model = tf.keras.models.Sequential()
single_step_model.add(tf.keras.layers.LSTM(32, input_shape=x_train_single.shape[-2:]))
single_step_model.add(tf.keras.layers.Dense(1))

Tutorial for Dense() says

Dense implements the operation: output = activation(dot(input, kernel) + bias) where activation is the element-wise activation function passed as the activation argument, kernel is a weights matrix created by the layer, and bias is a bias vector created by the layer (only applicable if use_bias is True).

would you like to rephrase or elaborate on need for Dense() here ?

A: The following line
single_step_model.add(tf.keras.layers.LSTM(32, input_shape=x_train_single.shape[-2:]))

creates an LSTM layer which transforms each input step of size #features into a latent representation of size 32. You want to predict a single value so you need to convert this latent representation of size 32 into a single value. Hence, you add the following line
single_step_model.add(tf.keras.layers.Dense(1))

which adds a Dense Layer (Fully-Connected Neural Network) with one neuron in the output which, obviously, produces a single value. Look at it as a way to transform an intermediate result of higher dimensionality into the final result.

A: Well in the tutorial you are following Time series forecasting, they are trying to forecast temperature (6 hrs ahead). For which they are using an LSTM followed by a Dense layer.
single_step_model = tf.keras.models.Sequential()
single_step_model.add(tf.keras.layers.LSTM(32, input_shape=x_train_single.shape[-2:]))
single_step_model.add(tf.keras.layers.Dense(1))

Dense layer is nothing but a regular fully-connected NN layer. In this case you are bringing down the output dimensionality to 1, which should represent some proportionality (need not be linear) to the temperature you are trying to predict. There are other layers you could use as well. Check out, Keras Layers.
If you are confused about the input and output shape of LSTM, check out
I/O Shape.


text:
Q: Field Calculator Runs In IDLE (2.6.5) but not ArcGIS 10 SP3 just wondering if anyone else is having issues with the field calculator in ArcGIS 10 SP3. In the following code I do a pretty simple field calculation with a variable (an array) as one of the parameters in the expression.
exp1 = "Feature = 16"
rows = arcpy.SearchCursor("ObservationMaster", exp1)
li = []
for row in rows:
    ObsID = int(row.getValue("ObsID"))
    li.insert(len(li), ObsID)
if li != []:
    codeblock = """def chStat(stat, ID, li):
    if int(ID) in li:
        return 5
    else:
        return int(stat)"""

exp = """chStat(str(!ManagementStatus!), str(!ObsID!), li)"""

arcpy.CalculateField_management("ObservationDetail", "ManagementStatus", exp, "PYTHON", codeblock)

When I run it through IDLE (Python 2.6.5), there are no problems and it runs successfully. However, if I create a script in a toolbox in ArcCatalog/ArcMap using this same code, I get the following error:
<class 'arcgisscripting.ExecuteError'>: ERROR 000539: Error running expression: chStat(str(1), str(1), li) <type 'exceptions.NameError'>: name 'li' is not defined
Failed to execute (CalculateField).

I know this is because it is not treating "li" as a variable, but it does when I run it in IDLE. Has anyone had this same problem and does anyone know a solution to get this working. I really need this script to run via ArcMap.
Thanks in advance

A: Found a solution and just thought I would answer my own question, just incase other people come across this same issue and thread.
To solve it, I simply moved all the code inside the "codeblock" as follows:
codeblock = """exp1 = "Feature = 16"
rows = arcpy.SearchCursor("ObservationMaster", exp1)
li = []
for row in rows:
    ObsID = int(row.getValue("ObsID"))
    li.insert(len(li), ObsID)

def chStat(stat, ID, li):
    if int(ID) in li:
        return 5
    else:
        return int(stat)"""

exp = """chStat(str(!ManagementStatus!), str(!ObsID!), li)"""

arcpy.CalculateField_management("ObservationDetail", "ManagementStatus", exp, "PYTHON", codeblock)

The code now works successfully in IDLE and as a script in ArcMap. The first part of the codeblock (before the def) only runs once (though it looks like it would run on every row that the field calculator is used on), which makes the script efficient as well.


text:
Q: If $I$ and $J$ are bounded intervals, then the intersection $I\cap J$ is also a bounded interval. If $I$ and $J$ are bounded intervals, then the intersection $I\cap J$ is also a bounded interval.
MY ATTEMPT
Since $I$ and $J$ are bounded, we conclude that $I\subseteq[-M,M]$ and $J\subseteq[-N,N]$.
Without loss of generality, we may assume that $M > N$. Therefore $I\cap J\subseteq[-M,M]$.
Now it remains to prove that $I\cap J$ is an interval. There are three possibilities:
(a) $|I\cap J| = 0$
(b) $|I\cap J| = 1$
(c) $|I\cap J| > 1$.
In the first case, $I\cap J$ is the empty set, which is an interval.
In the second case, $I\cap J = \{a\}$, which is an interval as well.
In the third case, there are at least two points in $I\cap J$ (in fact, there are infinitely many).
If $x\in I\cap J$ and $y\in I\cap J$ such that $x < y$, we conclude that $x\in I$ and $y\in I$. Since $I$ is an interval, it results that $[x,y]\subseteq I$. Similar reasoning leads to the conclusion $[x,y]\subseteq J$. Hence $[x,y]\subseteq I\cap J$, and the result follows.
Can someone please double-check my reasoning?


text:
Q: C# Azure DevOps Git: Unable to push new directories I'm trying to work with Azure DevOps Git API for C# .Net, and for the most part I've figured it out. However I'm having issues with pushing a new directory to the repository.
Below is the relevant code snippets I have so far;
Create the Commit
        GitCommitRef commit = new GitCommitRef()
        {
            Comment = "Add a sample file",
            Changes = new GitChange[]
            {
                new GitChange()
                {
                    ChangeType = VersionControlChangeType.Add,
                    Item = new GitItem() { Path = "/TESTFOLDER", GitObjectType = GitObjectType.Tree, IsFolder = true },
                    NewContent = null
                    //NewContent = new ItemContent()
                    //{
                    //    Content = Utilities.ReadFile(fileNamePath),
                    //    ContentType = ItemContentType.RawText
                    //}
                 },

                new GitChange()
                {
                    ChangeType = VersionControlChangeType.Add,
                    Item = new GitItem() {Path = "/TESTFOLDER/" + fileName, GitObjectType = GitObjectType.Blob, IsFolder = false },
                    NewContent = new ItemContent()
                    {
                        Content = Utilities.ReadFile(fileNamePath),
                        ContentType = ItemContentType.RawText
                    }

                }

Create the Push
        GitPush toPush = new GitPush()
        {
            RefUpdates = new GitRefUpdate[] { newBranch },
            Commits = new GitCommitRef[] { commit }
        };

        // Create the push with the new branch and commit
        GitPush push = gitClient.CreatePushAsync(toPush, repo.Id).Result;

WHen it executes the Push with that commit, it errors saying "The parameters supplied are not valid. Parameter name: newPush".
I have had trouble finding anything in the documentation that could help me figure out how to place the "fileName" file, inside a directory created at the same time?

A: The error seems to be caused by the GitChange object for the TESTFOLDER directory in GitChanges.
You donot need to specify a new GitChange object for the TESTFOLDER directory. As @StriplingWarrior commented empty directory is not allowed in git.
You can just specify a new GitChange object for the file only. If the directory which the file resides doesnot exist. It will be automatically created.
See below:
GitCommitRef commit = new GitCommitRef()
        {
            Comment = "Add a sample file",
            Changes = new GitChange[]
            {
                new GitChange()
                {
                    ChangeType = VersionControlChangeType.Add,
                    Item = new GitItem() {Path = "/TESTFOLDER/" + fileName, GitObjectType = GitObjectType.Blob, IsFolder = false },
                    NewContent = new ItemContent()
                    {
                        Content = Utilities.ReadFile(fileNamePath),
                        ContentType = ItemContentType.RawText
                    }

                }

See below screen from my test: The directory was automatically created.


text:
Q: When does :$\sigma(\sigma(2n))=\sigma(\sigma(n))$ and $\sigma(n)$ is sum divisors of the positive integer $n$? Is there someone who can show me When does: $$\sigma(\sigma(2n))=\sigma(\sigma(n))$$ where : $\sigma(n)$ denotes the sum of divisors of the positive integer $n$ ?
Note (1) : I came across this problem when I read some papers  about
"Iterating of the sum divisors of sigma function ".
Note(2) :${\sigma}^{0}(n)=n$ and ${\sigma}^{m}(n)=\sigma({\sigma}^{m-1}(n))$ and $m \geq 1$
Thank you for any help!

A: This is not a complete solution, but only a partial answer to the question.
Without loss of generality, let $n = {2^k}m$ where $k \geq 0$ and $\gcd(2,m)=1$.
Then we have:
$$\sigma(2n) = \sigma(2^{k+1})\sigma(m) = (2^{k+2} - 1)\sigma(m)$$
$$\sigma(\sigma(2n)) = \sigma((2^{k+2} - 1)\sigma(m))$$
$$\sigma(n) = \sigma(2^k)\sigma(m) = (2^{k+1} - 1)\sigma(m)$$
$$\sigma(\sigma(n)) = \sigma((2^{k+1} - 1)\sigma(m)).$$
Therefore, the equality
$$\sigma(\sigma(2n)) = \sigma(\sigma(n))$$
holds when there exist $k \geq 0$ and an odd $m$ such that
$$\sigma((2^{k+2} - 1)\sigma(m)) = \sigma((2^{k+1} - 1)\sigma(m)).$$
Lastly, using the inequalities
$$a\sigma(b) \leq \sigma(ab) \leq \sigma(a)\sigma(b)$$
we get
$$(2^{k+2} - 1)\sigma(\sigma(m)) \leq \sigma((2^{k+2} - 1)\sigma(m)) = \sigma((2^{k+1} - 1)\sigma(m)) \leq \sigma(\sigma(2^k))\sigma(\sigma(m)).$$
Hence,
$$2^{k+2} - 1 \leq \sigma(\sigma(2^k)).$$
We are therefore sure that
$$\sigma(2^k) = 2^{k+1} - 1$$
is not a (Mersenne) prime.
Additionally, we have the lower bound
$$3 < 4 - \frac{1}{2^k} \leq \frac{\sigma(\sigma(2^k))}{2^k},$$
so that $2^k$ is not an (even) superperfect number.  This agrees with our earlier finding that $2^{k+1} - 1$ is not prime.

A: $\sigma(2n)=3\times\sigma(n)$
if $m=\sigma(n)$
we should find $\sigma(3 m)=\sigma(m)$
$\sigma(3m)=4\times\sigma(m)$
then  $4\sigma(m)=\sigma(m)$
contradiction so there is no solution.


text:
Q: Prove that function $f$ is identical equal to $0$ Function $f$ is continuos on interval $[0, 1]$ and derivative on interval $(0, 1)$. Also apply $f(0) = 0$ and
$|f'(x)|\le |f(x)|$ for every $x\in (0,1)$.
Prove that $f$ identical equal to $0$.
Any help for this exercise, I do not know how to prove it.

A: Hint: Let $x_0$ be such that $|f(x)|$ is maximized at $x = x_0$ and use the mean value theorem on $[0,x_0]$.


text:
Q: Django, Celery with Recursion and Twitter API I'm working with Django 1.4 and Celery 3.0 (rabbitmq) to build an assemblage of tasks for sourcing and caching queries to Twitter API 1.1. One thing I am trying to implement is chain of tasks, the last of which makes a recursive call to the task two nodes back, based on responses so far and response data in most recently retrieved response.  Concretely, this allows the app to traverse a user timeline (up to 3200 tweets), taking into account that any given request can only yield at most 200 tweets (limitation on Twitter API).
Key components of my tasks.py can be seen here, but before pasting, I'll show the chain i'm calling from my Python shell (but that will ultimately be launched via user inputs in the final web app). Given:
>>request(twitter_user_id='#1010101010101#,
  total_requested=1000,
  max_id = random.getrandbits(128) #e.g. arbitrarily large number)

I call:
>> res = (twitter_getter.s(request) |
        pre_get_tweets_for_user_id.s() |
        get_tweets_for_user_id.s() |
        timeline_recursor.s()).apply_async()

The critical thing is that timeline_recursor can initiate a variable number of get_tweets_for_user_id subtasks. When timeline_recursor is in its base case, it should return a response dict as defined here:
@task(rate_limit=None)
def timeline_recursor(request):
    previous_tweets=request.get('previous_tweets', None) #If it's the first time through, this will be None
    if not previous_tweets:
        previous_tweets = [] #so we initiate to empty array
    tweets = request.get('tweets', None)

    twitter_user_id=request['twitter_user_id']
    previous_max_id=request['previous_max_id']
    total_requested=request['total_requested']
    pulled_in=request['pulled_in']

    remaining_requested = total_requested - pulled_in
    if previous_max_id:
        remaining_requested += 1 #this is because cursored results will always have one overlapping id

    else:
        previous_max_id = random.getrandbits(128) # for first time through loop

    new_max_id = min([tweet['id'] for tweet in tweets])
    test = lambda x, y: x<y

    if remaining_requested < 0:  #because we overshoot by requesting batches of 200
        remaining_requested = 0

    if tweets:
        previous_tweets.extend(tweets)

    if tweets and remaining_requested and (pulled_in > 1) and test(new_max_id, previous_max_id):

        request = dict(user_pk=user_pk,
                    twitter_user_id=twitter_user_id,
                    max_id = new_max_id,
                    total_requested = remaining_requested,
                    tweets=previous_tweets)

        #problem happens in this part of the logic???

        response = (twitter_getter_config.s(request) | get_tweets_for_user_id.s() | timeline_recursor.s()).apply_async()

    else: #if in base case, combine all tweets pulled in thus far and send back as "tweets" -- to be
          #saved in db or otherwise consumed
        response = dict(
                    twitter_user_id=twitter_user_id,
                    total_requested = total_requested,
                    tweets=previous_tweets)
    return response

My expected response for res.result is therefore a dictionary comprised of a twitter user id, a requested number of tweets, and the set of tweets pulled in across successive calls.
However, all is not well in recursive task land. When i run the chain identified above, if I enter res.status right after initiating chain, it indicates "SUCCESS", even though in the log  view of my celery worker, I can see that chained recursive calls to the twitter api are being made as expected, with the correct parameters. I can also immediately run result.result even as chained tasks are being executed.  res.result yields an AsyncResponse instance id.  Even after recursively chained tasks have finished running, res.result remains an AsyncResult id.
On the other hand, I can access my set of full tweets by going to res.result.result.result.result['tweets'].  I can deduce that each of the chained chained subtasks is indeed occuring, I just don't understand why res.result doesn't have the expected result. The recursive returns that should be happening when timeline_recursor gets its base case don't appear to be propagating as expected.
Any thoughts on what can be done?  Recursion in Celery can get quite powerful, but to me at least, it's not totally apparent how we should be thinking of recursion and recursive functions that utilize Celery and how this affects the logic of return statements in chained tasks.
Happy to clarify as needed, and thanks in advance for any advice.

A: what does apply_async return ( as in type of object )?
i don't know celery, but in Twisted and many other async frameworks... a call to something like that would immediately return ( usually True or perhaps an object that can track state ) as the tasks are deferred into the queue.
again, Not knowing celery , i would guess that this is happening:
you are: defining response immediately as the async deferred task, but then trying to act on it as if results have come in
you want to be: defining a callback routine to run on the results and return a value, once the task has been completed
looking at the celery docs, apply_async accepts callbacks via link - and i couldn't find any example of someone trying to capture a return value from it.


text:
Q: Using datepicker for chrome extension I'm writing a chrome extension that uses datepicker, and I'm running into a lot of issues. The calendar opens, but it's not clickable--I can't actually select a date. I've been looking around and I haven't found much about datepicker for chrome extensions online, so I'm just wondering if anyone has had similar issues?
I'm using jquery 1.9.1 and bootstrap#~3.2.0
Here is my code to trigger the datepicker:
 j(document).on('click', '.datepicker-input', function(){
  j(this).datepicker();
});

and
<input class="datepicker-input" data-date-format="mm/dd/yyyy">


text:
Q: Query and show data from database all in view .net core I'm wondering it is possible to show data from database (write the query and looping the data) in view (cshtml file), like in php, you can create query and show the data inside foreach loop all in view, code example below (Codeigniter):

<?php
$records = $this->db->get("tbl_detail_penjualan a")->result();
foreach ($records as $record):
?>

<?php echo $record->jumbel ?>
<?php echo $record->total_harga ?>
<?php echo $pelanggan['nama_pelanggan'] ?>
<?php echo $record->tanggal ?>
<?php echo $ot['nama_outlet'] ?>

<?php
endforeach;
?>


text:
Q: Primefaces FileUpload not working in Spring Boot I'm running my JSF project launching it with Spring Boot and taking advantage of the whole Spring environment. The configuration is: Mojarra 2.2.8 + Primefaces 5.1 + Spring Boot 1.1.9. That's how my POM.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.1.9.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>${jsf.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>${jsf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.1</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces.themes</groupId>
            <artifactId>all-themes</artifactId>
            <version>1.0.10</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>el-impl</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <start-class>com.tesicnor.workplace.monitor.Application</start-class>
        <java.version>1.7</java.version>
        <tomcat.version>7.0.57</tomcat.version>
        <jsf.version>2.2.8</jsf.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

As it's specified above, I'm configuring the project to run in a tomcat 7.0.57 (Servlet 3.0 compatible) launcher. All the JSF functions are properly working, but the problem is I can't get the Primefaces p:fileUpload component work, neither the basic or the advanced versions. The file upload listener doesn't get invoked and no error thrown.
That's my bean's code:
@ManagedBean
@javax.faces.bean.ViewScoped
public class Bean {

    public void handleFileUpload(FileUploadEvent event) {
        FacesMessage message = new FacesMessage("Succesful", event.getFile()
                .getFileName() + " is uploaded.");
        FacesContext.getCurrentInstance().addMessage(null, message);
        System.out.println("Uploaded!");
    }

}

And that's how my xhtml file looks like, under a template:
<ui:composition template="/WEB-INF/template.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:define name="content">
        <h:form>
            <p:fileUpload fileUploadListener="#{bean.handleFileUpload}" />
        </h:form>
    </ui:define>
</ui:composition>

Nothing special about the code at all, it must be a server configuration issue. When I drop the file and click on upload, the FacesServlet gets hit. So the request is performed and no javascript errors shown. But when I perform a debugging into the InvokeApplicationPhase class, where my method should be invoked, I find no events to be processed. So the FileUploadEvent is not being attached to the cycle.
Furthermore, that's the debugging stack of another project that properly performs the file upload with Tomcat 7 and that JSF version:

Here the NativeFileUploadDecoder is being called. However that's not happening in my Spring boot project and no method below FileUpload#visitTree is invoked.
I tried other choices and found out that when I use some <h:form enctype="multipart/form-data"> none of the action methods for components inside are invoked, even when I place a plain h:commandButton.

A: Finally, I got it working using the Apache Commons library. Similarly that what we might do in a standard web.xml file, that's my context initializer:
@Bean
public ServletContextInitializer initializer() {
    return new ServletContextInitializer() {
        @Override
        public void onStartup(ServletContext servletContext)
                throws ServletException {
            servletContext.setInitParameter("primefaces.THEME", "bluesky");
            servletContext.setInitParameter(
                    "javax.faces.FACELETS_SKIP_COMMENTS", "true");
            servletContext.setInitParameter(
                    "com.sun.faces.expressionFactory",
                    "com.sun.el.ExpressionFactoryImpl");
            servletContext.setInitParameter("primefaces.UPLOADER",
                    "commons");
        }
    };
}

I explicitly tell Primefaces to use the commons uploader, like said in docs (the other choice is to use native, which is not working).
Then, just adding this two dependencies to the project, we're ready to go:
<dependency>
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>
    <version>1.3</version>
</dependency>
<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.2</version>
</dependency>

I keep the thread opened for some response based in the native mode.
See also:

*

*How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null

A: It could be also necessary to transfer xml filter configuration to Java-based Config :
<filter-mapping>
    <filter-name>PrimeFaces FileUpload Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

to your @Configuration
@Bean
public FilterRegistrationBean FileUploadFilter() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new org.primefaces.webapp.filter.FileUploadFilter());
    registration.setName("PrimeFaces FileUpload Filter");
    return registration;
}

in combination with the above answer it work for me

A: Just to put my two cents, with Spring boot 1.4.2.RELEASE, Primefaces 6.0, OCP Soft rewrite 2.0.12.Final, JSF 2.1.29-08 and application deployed on Tomcat 8, I also need to disable spring hiddenHttpMethodFilter.
@Bean
public FilterRegistrationBean hiddenHttpMethodFilterDisabled(
        @Qualifier("hiddenHttpMethodFilter") HiddenHttpMethodFilter filter) {
    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(filter);
    filterRegistrationBean.setEnabled(false);
    return filterRegistrationBean;
}

I have spent with this issue almost two days and as last thing I have tried to disable spring filters one by one, so I hope it will help someone.


text:
Q: How do I visually design my database with Entity Framework Core? I am wondering myself, how I should design my database scheme (in terms of efficiency and visuality).
I am developing a ASP.NET Core application with Angular 2 and I am using Entity Framework Core ("Microsoft.EntityFrameworkCore": "1.0.0"), since its my favourite ORM. I definitely prefer the SQL Server 2012, but if there are better options for designing my scheme available for other database management systems, I could switch to something else like PostgreSQL.
EntityFrameworkCore however doesn't support designing the DataContext (with all its POCO classes) with the EDMX designer anymore.
Can you give me any advice how I can design my database visually and automatically generate my POCO classes (and maybe also my TypeScript classes)?
Can you recommend me a good tool for designing my scheme? (At least more convenient than SQL Server Management Studio. I liked the EDMX designer)
EDIT 2019-03-28
Since the latest changelog (18.0 Preview 7) of SQL Server Management Studio announced, that Database Diagrams are deprecated, I am really in need of an alternative to visualize my databases, as soon as possible.
EDIT 2019-04-03
Since someone might stumble upon this question and no one provided an answer for my question, yet... Here you go: VS Extension: Entity Developer ORM Designer for LINQ to SQL
EDIT 2019-07-15
From the SSMS 19.1 Changelog:

Database diagrams were added back into SSMS.

A: If you prefer to start with the database, you can use whatever design tools you find most useful for whichever database platform you prefer to create the database, and then use EF commands to scaffold your model and context from the database. You can execute commands from the Package Manager Console just as with migrations in previous versions of EF:
Scaffold-DbContext "Server=yourServer;Database=yourDb;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

The official documentation covers reverse engineering a model from an existing database

A: You can scaffold DbContext with enities using dotnet ef dbcontext scaffold command from terminal (console). So you can design DB in whatever way you want and then run scaffold command and you'll get your generated DbContext and classes.
Here's documentation on command:
https://docs.efproject.net/en/latest/miscellaneous/cli/dotnet.html#dotnet-ef-dbcontext-scaffold


text:
Q: Troubles with .gitlab-ci.yml triggers configuration How should I set up my .gitlab-ci.yml manifest to run builds ONLY on:

*

*Merge Request;

*Push to branch with opened merge request from it (I mean when the merge request from branch Y to branch X is already opened and some new changes are pushed to branch Y);

*Push to master;
I've tried to solve it with a setting like this:
  job:
    only:
    - triggers
    - /merge-requests/
    - master
    except:
    - branches

Regarding on the documentation here: https://docs.gitlab.com/ce/ci/yaml/README.html#only-and-except-simplified
Suddenly the error occurred on my MR page:

Could not connect to the CI server. Please check your settings and try again.

When I removed only/except restrictions from my manifest, the error was gone.
What am I doing wrong here?
My Gitlab version is: GitLab Community Edition 10.8.1

A: You want to run a job only on:

*

*merge request: I don't understand what you want here

*Push to branch with opened merge request from it: you have to set a special job that call the Gitlab API to control that the current branch has a MR
A job executed only on new pushed branch:
  image: alpine:latest
  script:
  - # <-- add here the script that call Gitlab API
  only:
  - branches

*Push to master:

A job executed only on master:
  image: alpine:latest
  script:
  - echo "Hello world!"
  only:
  - master


text:
Q: Akka Actor Testing using Play framework in scala
Possible Duplicate:
akka actor testing using play

I am newbie in using Scala Akka and Play framework,
I just want to ask some help on how to test my code.
I am using org.specs2.mutable.Specification
Please Help.


text:
Q: How to use youtube-dl from python & use postprocessor_args option Im trying to figure out how to use youtube-dl using a python script, I want to download mp3 only & can't figure out how to use "postprocessor_args" option. Does it take a string or a dict of options & what options are available ?
I tried reading the source code but could not find where or how the "postprocessor_args" is to be used
import youtube_dl
options = {'outtmpl': '%(id)s%(ext)s'
'postprocessor_args': "What to add here? dict or string?"
}
ydl = youtube_dl.YoutubeDL(options)
with ydl:
    result = ydl.extract_info(
    'http://www.youtube.com/watch?v=xxxxxx',
    download=False # We just want to extract the info
)


text:
Q: What is the purpose of java.awt.Color.blue and java.awt.Color.BLUE Why there are two Color constants defined in java.awt.Color class? For instance
public static final Color blue;
public static final Color BLUE;

This is obviously redundant. Is there some specific usage scenario - like a best practice where upper case Color is preferred over lower case Color or vice-versa ?

A: It's a naming convention thing.

Java originally defined a few color constant names in lowercase, which
  violated the naming rule of using uppercase for constants. These are
  best to use since they are available in all versions of Java:
  Color.black, Color.darkGray, Color.gray, Color.lightGray, Color.white,
  Color.magenta, Color.red, Color.pink, Color.orange, Color.yellow,
  Color.green, Color.cyan, Color.blue
Java 1.4 added the proper uppercase names for constants: Color.BLACK,
  Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY, Color.WHITE,
  Color.MAGENTA, Color.RED, Color.PINK, Color.ORANGE, Color.YELLOW,
  Color.GREEN, Color.CYAN, Color.BLUE

Source

A: They are synonymous. The upper-case names were introduced in Java 1.4 to conform to Sun's naming conventions (see Section 9) for constants.


text:
Q: Finding by Keyword part of string, select all cells (whole rows), copy the range to another sheet and print it I'm new to VBA and have already found few similar questions previously answered here, both similar but also quite different as I'd like to make the search comfortable for people not experienced with excel or the relatively long product catalogue (~1500 different products) the company I work for offers.
The workbook has 3 sheets, where Sheet 1 contains only a greeting incl. a description of the search function. I inserted a text box (active x) which is linked to a cell (in my case D24) and a search button (command button) called "Search". In Sheet 3 I have the list of products in columns B:E called "product_category", "sub_category", "product_number", "Product_name" and "product_specification" (column A is called "Sequent_Number" and is not relevant in this case).
In Sheet 2 I have a title row with all column headers from Sheet3 and I use it to paste results (cleaning first 200 rows as in some categories there are slightly over 100 products) and print.
There are 2 problems to solve:

*

*How I can I, expand the search range to all columns,

*How I can search in part of the string (not only exact match) as current.
The current code is:
Sub Search_ProductName_by_Keyword()
Dim ProductName As String
Dim Finalrow As String
Dim i As Integer
ProductName= Sheet1.Range("D24").Value
Sheet2.Range("B6: E200").ClearContents
Sheet3.Select
Finalrow = Cells(Rows.count, 1).End(xlUp).Row
For i = 2 To finalrow
If Cells(i, 5) = ProductName Then
Range(Cells(i, 4), Cells(i, 7)).Copy
Sheet2.Select
Range("B200").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Sheet3.Select
End If
Next i
Sheet1.Select
Range("d24").Select
End Sub

I'm open for any ideas or suggestions.
Thanks in advance!

A: Sub test()

Dim r As Range
Dim strProductName As String

strProductName = "DEF"

For i = 2 To 10

Set r = Range(Cells(i, 5), Cells(i, 10)).Find(What:=strProductName, After:=Cells(i, 5), _
    LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns, _
    SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

If Not r Is Nothing Then Debug.Print i

Next i

End Sub

You'll need to change the search range

A: you may want to use AutoFilter():
Option Explicit

Sub main()
    Dim ProductName As String

    ProductName = Sheet1.Range("D24").Value
    Sheet2.Range("B5: E200").ClearContents '<--| clear headers too, since they will be readded from AutoFilter selected cells

    With Sheet3
        With .Range("E1", .Cells(.Rows.count, "E").End(xlUp)) '<--| reference its columns E cells from row 1 down to last not empty cell
            .AutoFilter Field:=1, Criteria1:="*" & ProductName & "*"  '<--| filter it on its 1st (and only) column with "*'ProductName'* values
            If Application.WorksheetFunction.Subtotal(103, .Resize(, 1)) > 1 Then '<--| if any filtered cells other than headers
                Intersect(.Parent.Range("B:E"), .SpecialCells(xlCellTypeVisible).EntireRow).Copy '<-- copy filtered cells, headers included
                Sheet2.Range("B5").PasteSpecial xlPasteValues '<--| paste values only from Sheet2 cell "B5"
            End If
        End With
        .AutoFilterMode = False '<--| remove AutoFilter and show all rows back
    End With

End Sub


text:
Q: DB connectivity using angular, php, mysql Hi I am having some trouble with a small project. It's my first time using mySQL and PHP so I'm just trying to get connectivity for now. I have followed some tutorials and I cannot connect to the database, I am getting the "Sorry! Data Couldnt be inserted!" error from my php script at the bottom of index.html.
I also have a password on the database for the root user however even when i type this in the php file it still wont work.
Any help is much appreciated guys.
index.html:

 <!DOCTYPE html>

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

            Email
            <input type ="text" name="email" ng-model="email" class="form-control"/>

             Password
            <input type ="text" name="password" ng-model="password" class="form-control"/>

            <input type="submit" name="btnInsert" ng-click="insertData()" value="ADD"/>

and my insert.php:

<?php
//insert.php

$data = json_decode(file_get_contents("php://input"));

    $email =  $data->email;
    $password = $data->password;

    mysql_connect("localhost","root","");
    mysql_select_db("test");

    mysql_query ("INSERT INTO 'test_user'('email', 'password') VALUES ('".$email."','".$password."')") or die(mysql_error());

    echo $email. " " .$password;

/*
    if(mysqli_query($connect, $query)){
        echo "User inserted...";
    }
    else{
        echo "User not inserted...";
    }
*/

#mysqli_real_escape_string($connect,
#mysqli_real_escape_string($connect,
?>

A:
It's my first time using mySQL and PHP

But you seem to be using a very old version of PHP (the mysql_ extension is deprecated).
I'm not familiar with Angular but it looks like your code relies on Angular to determine if the PHP script ran as intended. Angular can't base that decision on the content sent by your script, therefore it must be basing its decision on the HTTP status returned by your script (which has no debugging in it). I expecting your PHP code is crashing and burning before it gets to run the insert.
I suggest you:
1) build a test rig using a textare and NO javascript to fire a request at your insert.php script
2) amend your PHP script so that it
  - captures more information about the processing
  - uses appropriate error reporting and ensure your error logging is working
  - presents the (appropriate) details of the actions it took in a parseable format (i.e. JSON)
3) read your log files - for both PHP and MySQL (you might want to do this before going to the trouble of changing/verifying your logging as described above)
4) read up on SQL injection


text:
Q: SSIS Package - Looping through folder to check if files exists Can anyone help:
Required: SSIS Package to loop through a folder (containing 100 files) and check whether required files (which are 5/6) are present in that folder.
Does anyone already has code for this - where we are checking for multiple files existence in the destination folder
Regards

A: *

*Add a Foreach loop container to your Control Flow

*Double click it and select Collection. On Enumerator, select Foreach
File Enumerator

*Select your folder and the type of file

*Select the return type when a file is found. The options are the
whole filename including extension and path, the name and extension
or simply the name of the file found

*Select the checkbox if you want the subfolders

*Click on the variables option on the left and then new variable or
select an existing variable.

At this point you have each file name on the folder. To prove it, add a script component, double click it, and your variable on the read Only Variable and click on Edit Script. Make your Main like this:
public void Main()
{
    System.Windows.Forms.MessageBox.Show(Dts.Variables["FileName"].Value.ToString());
    Dts.TaskResult = (int)ScriptResults.Success;
}

now, the comparison you can do several ways. I dont know where do you have the "required files" list, but assuming it is on a database, you can add a data flow task and inside of it send the filename to the DB to do the comparisson.


text:
Q: How can I improve this Ajax script? I've written a combination of PHP and javascript for admins to seamlessly give points to users without a page reload. This is my first real go at using Ajax so I'd like some tips on improving the code. How can I go about making it more secure/efficient? Btw, this code is visible in the html source.
P.S: If there are best practises with respect to this sort of thing, please let me know and post any links you have on the topic.
// First pass: add the points
function addBonus()
{
  document.getElementById('response').innerHTML = ''; // Show that process is taking place
  var xmlHttp = getXMLHttp();

  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      verifyPoints(); // Check if points have actually been given
    }
  }
 // Generated by templating system
 // Triggers call to PHP page that gives bonus points to user
   var url="page.php?id=2&a=bonus";

  xmlHttp.open("GET", url, true);
  xmlHttp.send(null);
}

// Second pass: check the points have been given
function verifyPoints(){
  var xmlHttp = getXMLHttp();

  xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText );
    }
  }

  url="GetPoints.php?i=2"; // Generated by templating system

  xmlHttp.open("GET", url, true);
  xmlHttp.send(null);
}

function HandleResponse( response )
{
    var oldPoints = parseInt(document.getElementById('numPoints').innerHTML);
    var currentPoints = parseInt(response);

    if( currentPoints == (oldPoints + 150) ){
        document.getElementById('response').innerHTML = ''; // Bonus points added: show tick icon
    } else {
        document.getElementById('response').innerHTML = ''; // Bonus points not added: show red cross icon
    }

    document.getElementById('numPoints').innerHTML = currentPoints; // Update points display
}

A: How does page.php?id=2&a=bonus know that a real admin is the one giving the bonus points?
Have you thought about XSRF?  In other words, can a user put something on their site so that if an admin visits it, while logged in, a request gets sent with the admin's cookies that inadvertently racks up points.
You shouldn't use GET requests for changing things, like assigning points.
From http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Implementors should be aware that the software represents the user in their interactions over the Internet, and should be careful to allow the user to be aware of any actions they might take which may have an unexpected significance to themselves or others.
In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe". This allows user agents to represent other methods, such as POST, PUT and DELETE, in a special way, so that the user is made aware of the fact that a possibly unsafe action is being requested.

Anything that causes server state change should use one of the non-idempotent HTTP methods.  Probably POST.  Btw, an idempotent operation is one that, when re-applied to its output yields the same thing.  So f is idempotent if f(x) == f(f(x)) == f(f(f(x)), etc.
And finally
url="GetPoints.php?i=2"

is setting a global variable.  You probably want a var in front.


text:
Q: Can ASP.NET themes be used per user session Can ASP.NET themes be used per user session ? Ex : For one user,User theme called "Green" and for another user Use the theme called "Red". Or themes are for the enire web app ?

A: Themes are defined for entire web application but usage of theme is defined per request. You can set theme used for current request in PreInit event handler of the Page instance. If you want to allow users to switch theme you should use Profile instead of Session because profile is persisted so the user will have the same theme next time he visits the site.


text:
Q: add dates to jQuery datepicker I have a date taken as a url parameter and I need to use that date to set another date in a another field. What I need to do exactly is take the url parameter, add 1 month and 2 weeks to it, display the new date in a text field. I am doing this in a jsp page.
my url parameter:- 13-10-2014
new field :-
<input type="text" id="newDate" value="">

I followed this thread, but I cannot figure out how to do it with a String value(The url parameter).
How to do this.
Thank you!

A: I can't understant what you really want any way try this, this may help you,
suppose your url is something like this
http://test.test.php?fromdate=13-10-2014
then access fromdate as a get URL parameter.
var initialDate = "13-10-2014";
var dateArray = initialDate.split("-");
var dateObj = new Date(dateArray[2],parseInt(dateArray[1]-1),dateArray[0]);
dateObj.setMonth(dateObj.getMonth()+1);
dateObj.setDate(dateObj.getDate()+14);
alert(dateObj);
alert(dateObj.getDate()+"-"+parseInt(dateObj.getMonth()+1)+"-"+dateObj.getFullYear());

actually you have to consider browser locale before set final date string. i.e date should be formatted as browser locale otherwise date picker plugin may not work

A: You can try this for Date picker.
<!doctype html>

    <meta charset="utf-8">
    <title>jQuery UI Datepicker - Default functionality</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">

    <link rel="stylesheet" href="/resources/demos/style.css">

Date: <input type="text" id="newDate" value="">


text:
Q: Nested Loop in VBA not working, because of different for loops? So I thought I had gotten close to this, the code goes through a column of unrefined addresses, generates a google search url in another, and then pulls the address google has an writes it to the 3rd column.
Before I could only get it to work if I specified the cell location, I want it to work by going down every URL in a column and writing the address one by one.
So i thought "let's put the getElementsByClassName in another loop"
Needless to say it doesn't work, I get automation error on the IE.Navigate line.
Private Sub CommandButton1_Click()
Dim IE As Object

' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")

' You can uncoment Next line To see form results
IE.Visible = False

'START LOOP
' URL to get data from
For r = 2 To 3
    IE.navigate Sheets("Sheet1").Cells(r, "A").Value

    Do While IE.Busy
    Application.Wait DateAdd("s", 1, Now)
    Loop

    Dim dd As String, c
    ' Runs loops to look for the value within the classname, if classname alternates it will change the element, if null it will exit.
        For Each c In Array("vk_sh vk_bk", "_Xbe")
            On Error Resume Next
            dd = IE.document.getElementsByClassName(c)(0).innerText
            On Error GoTo 0
            If Len(dd) > 0 Then Exit For
        ' Gives a confirmation message and writes the result to a cell
        Cells(r, "C").Value = dd
        Next
Next r

' /LOOP

' Show IE
IE.Visible = False

' Clean up
Set IE = Nothing

End Sub

Notes:
From 2 to 3 is correct, the list is pretty long so i want to test it out with just 2 addresses first.
Can someone more proficient in VBA tell me where I am going wrong?
UPDATED: Changed range to cells

A: No offence, but your code (and coding style) is a mine field.
This part Sheets("Sheet1").Range(r, "A").Value will throw error 1004, Range cant take two params as Row and Columns, Cells can. Change it to : Sheets("Sheet1").Cells(r, "A").Value
Second, if Cells(r, "A").Value is blank/empty Navigate will throw error 5. Check for a non empty value before navigating.
Same range issue, error 1004 for Range(r, "C").Value
Not writing address: It will not write anything in column C because of your ill constructed inner for loop. When a condition is met, you are jumping out of the loop before writing the value in cells.
Here
 If Len(dd) > 0 Then Exit For
      'Gives a confirmation message and writes the result to a cell
      ws.Cells(r,"C").Value = dd

if  length of dd is > 0 it will never reach the statement, ws.Cells(r,"C").Value = dd
Change it to:
 If Len(dd) > 0 Then
        'Gives a confirmation message and writes the result to a cell
         ws.Cells(r,"C").Value= dd
        Exit For
      End If

Bonus: Learn and start using F8

A: One issue that will definitely give you an error is how you are using range.
When using range for your code you would need to use the following:
IE.navigate Sheets("Sheet1").Range("A" & r).Value
Then of course you would need to print out the same way
Range("C" & r).Value = dd
now a couple of hints that you can place in your code to make it more efficient,
Private Sub CommandButton1_Click()

  Dim IE As Object, r as integer
  Dim wb as Workbook, ws as Worksheet
  Dim dd as String, c as Variant, found as Boolean

  'Create InternetExplorer Object
  Set IE = CreateObject("InternetExplorer.Application")
  'create other objects
  Set wb = ThisWorkbook
  Set ws = wb.Worksheets("Sheet1")

  ' You can uncoment Next line To see form results
  IE.Visible = False

  'START LOOP
  ' URL to get data from
  For r = 2 To 3
    debug.print ws.Range("A" & r).Value 'see what the url is
    IE.navigate ws.Range("A" & r).Value
    Do while IE.ReadyState <> 4: DoEvents: Loop
    'page loaded.
    ' Runs loops to look for the value within the classname, if classname alternates it will change the element, if null it will exit
    found = false
    For each c in Array("vk_sh vk_bk", "_Xbe")
      On Error Resume Next
      dd = IE.document.getElementsByClassName(c)(0).innerText
      On Error GoTo 0
      If Len(dd) > 0 Then
        found = true
      End If
      If found Then
        ws.Range("C" & r).Value = dd
        dd = ""  'need to set to nothing or it will retain the value.
        Exit For
      End If
    Next c
  Next r

  IE.Quit

'Clean up
Set IE = Nothing

End Sub

There are definitely more ways to do what you are after but fix up those 2 things.  If you need more help post your workbook.
Thanks
EDIT:  I made some changes to the above code.  It looks like you may have been exiting your loop too quickly.  I was able to get the URLs you provided to work using this.

A: There seems to be 2 issues with your code. I have not tried, but looking at your code

*

*Range is defined as cell1, cell2. Cell Address is "A2", "A3" etc. so in your code you might need to do Range("A" & r) to concatenate the row with the column.

*Even after that you will have an issue. When you Navigate to a URL, You need to wait until the document is loaded. You have to either do some event driven code or loop until the document state is ready or something. Otherwise you will not be able to parse and read the contents of the loaded document.

A: Including the other issues raised in the comments, the below worked for me at run time (i.e. not just while going through with F8)
Private Sub CommandButton1_Click()
Dim IE      As Object
Dim LngRow  As Long
Dim Wksht   As Worksheet
Dim dd      As String
Dim c       As Variant

On Error Resume Next

Set Wksht = ThisWorkbook.Worksheets("Sheet1")
    Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = False
        'The below will process the all rows in column A
        For LngRow = 2 To Wksht.Range("A" & Wksht.Rows.Count).End(xlUp).Row
            If Wksht.Cells(LngRow, 1) <> "" Then
                IE.Navigate Wksht.Cells(LngRow, 1)

                'This loops waits for IE to be ready
                Do Until (IE.Document.ReadyState = "complete") And (Not IE.busy)
                    DoEvents
                Loop

                For Each c In Array("vk_sh vk_bk", "_Xbe")
                    dd = ""
                    dd = IE.Document.getElementsByClassName(c)(0).innerText
                    If Len(dd) > 0 Then
                        Wksht.Cells(LngRow, 3) = dd
                        Exit For
                    End If
                Next

            End If
        Next
        IE.Quit
    Set IE = Nothing
Set Wksht = Nothing

End Sub


text:
Q: I keep getting zeros when I call a procedure that should be calling data I know exists I'm trying to write a stored procedure in MySQL and then call it back, and I have to submit a screenshot of the procedure returning a correct response. The code for storing the procedure seems to work fine (no errors, at least), but when I run the CALL function it returns 0.00 no matter which number I put in for @column3. My instructor thinks the issue is stating the OUT as AmountDue before I define the variable at the very top, but I couldn't figure out another way to have an input for @column3 in the CALL function without the IN/OUT constraints. I'm very new at this, obviously, so forgive me if I'm missing something obvious...Anyone got any ideas?
Also, I don't need any help with building the database, adding tables, anything like that. The database exists and functions appropriately. Only need help on storing the procedure and calling it back. Thanks.
delimiter //

DROP PROCEDURE IF EXISTS GetAmountDue;

CREATE PROCEDURE GetAmountDue(IN order_num INT, OUT AmountDue DECIMAL(10,2))
BEGIN
DECLARE AmountDue DECIMAL(10,2) DEFAULT 0;

SELECT COST
INTO @AmountDue
FROM cake_shape
INNER JOIN ll_cakery.order
ON cake_shape.shape_id=order.shape_id
WHERE order_num=@order_num;

SELECT AmountDue;
END//

delimiter ;

CALL GetAmountDue('113',@AmountDue);

*

*order_num is a column with individual 3-character integer data values

*cost is a column with individual decimal(10,2) data values

*cake_shape is a table

*ll_cakery.order is a table (that doesn't work quite right because
mysql has a command ORDER so I have to give the schema name)

*shape_id is a column, only used in the procedure for the join

*in the CALL function, @order_num=113

A: You are passinf a string not an int
You don't compare column 3 with column1
Last you have to set the output variable with the data ou get from the select
Last never name variables like columns name, that brings only problems

CREATE tABLE table1 ( COST DECIMAL(19,2),column2 int, column3 int)

INSERT INTO table1 VALUES (10.2,1,1),(10.2,1,1)

CREATE TABLE table2 (column2 int)

INSERT INTO table2 VALUES (1)

CREATE PROCEDURE GetAmountDue(IN _column1 INT, OUT _AmountDue DECIMAL(10,2))
BEGIN

SELECT SUM(COST)
INTO @AmountDue
FROM table1
INNER JOIN table2
ON table1.column2=table2.column2
WHERE column3=_column1;

SET _AmountDue := @AmountDue;
END

CALL GetAmountDue(1,@AmountDue);

SELECT @AmountDue

| @AmountDue |
| ---------: |
|      20.40 |

db<>fiddle here


text:
Q: Weakest Hypothesis Needed for Axiom of Replacement A typical formal statement of the Axiom of Replacement is (leaving out some technical details about extra "parameter variables" that $\phi$ sometimes takes.)
$[\forall x,y,z\ (\phi(x,y) \wedge \phi(x,z) \implies y=z)] \implies [\forall X \exists Y \forall y\ (y \in Y \iff (\exists x \in X)\ \phi(x,y))]$.
The hypothesis "$\forall x,y,z\ (\phi(x,y) \wedge \phi(x,z) \implies y=z)$" states that the relation $\phi$ defines a function: to each $x$ that is related with some $y$, it is related with only one $y$.  One tempting revision to express that hypothesis more succinctly is as $\forall x \exists ! y\ \phi(x,y)$.  However, this implies something stronger about $\phi$, namely, that it relates every $x$ to some (unique) $y$, whereas the first formulation allows that for some $x$ and all $y$, $\phi(x,y)$ is false.
Can one safely replace the original hypothesis by the revised one, using the following argument?  Suppose $\phi$ is not defined for some values of $x$.  Then pick some "dummy" $y'$ (such as $\emptyset$) and let $\phi(x,y')$ be true.  Then apply the revised axiom to conclude the original version of the axiom, with some technicalities to handle the fact that $Y$ might now include an extra element $y'$.  I don't really do set theory, so it's not clear to me exactly what technicalities would pop up and whether they can be handled, possibly using the other axioms.
I've read a lot about different ways to define the Axiom of Replacement, and the related Axiom of Collection, but no one ever seems to state the hypothesis in exactly this way, so I'm wondering if something goes wrong if you try to use this formulation of the axiom.
(Update: question after here answered in comments) For that matter, is the uniqueness of $y$ even required, or could the axiom be revised to $[\forall x \exists y\ \phi(x,y)] \implies [\forall X \exists Y \forall y\ (y \in Y \iff (\exists x \in X)\ \phi(x,y))]$?

A: Basically, if one is trying axiomatize ZFC, then all these versions of replacement are equivalent modulo the other ZFC axioms, and there is really nothing going on here. The axiom is quite robust and is invariant under these kind of changes. There aren't really any hidden technicalities that cannot be easily overcome. Replacement is equivalent to collection, and for collection, it suffices to say merely, of every $\phi$, that for every set $A$, there is a set $B$ such that for every $a\in A$, if there is a $b$ with $\phi(a,b)$, then there is a $b\in B$ with $\phi(a,b)$. Thus, $\phi$ need neither be total nor functional.
Meanwhile, however, if one is working in a weaker theory, such as ZFC-, meaning ZFC without the power set, then the strength of the axiom becomes sensitive to how it is formulated. For example, without the power set axiom, the replacement axiom scheme and collection are no longer equivalent. This is due to Andrej Zarach, and you can find a proof in my paper What is the theory ZFC without power set? with Gitman and Johnstone. Without the power set axiom, the situation is that replacement is much weaker than you expect. For example, in the version of ZFC- formulated with replacement, one cannot prove that $\omega_1$ is regular, or the Los theorem on ultrapowers and many other things that are provable if one uses collection instead of replacement. Our summary conclusion is that ZFC- is properly formulated with collection instead of replacement, in order for it to prove the things usually desired in this theory.


text:
Q: Why there is no do while loop in python Why doesn't Python have a 'do while' loop like many other programming language, such as C?
Example : In the C we have do while loop as below :
do {
   statement(s);
} while( condition );

A: Because everyone is looking at it wrong. You don't want DO ... WHILE you want DO ... UNTIL.
If the intitial condition is true, a WHILE loop is probably what you want. The alternative is not a REPEAT ... WHILE loop, it's a REPEAT ... UNTIL loop. The initial condition starts out false, and then the loop repeats until it's true.
The obvious syntax would be
repeat until (false condition):
  code
  code

But for some reason this flies over everyone's heads.

A: There is no do...while loop because there is no nice way to define one that fits in the statement: indented block pattern used by every other Python compound statement. As such proposals to add such syntax have never reached agreement.
Nor is there really any need to have such a construct, not when you can just do:
while True:
    # statement(s)
    if not condition:
        break

and have the exact same effect as a C do { .. } while condition loop.
See PEP 315 -- Enhanced While Loop:

Rejected [...] because no syntax emerged that could
      compete with the following form:
    while True:
        <setup code>
        if not <condition>:
            break
        <loop body>

A syntax alternative to the one proposed in the PEP was found for
     a basic do-while loop but it gained little support because the
     condition was at the top:
    do ... while <cond>:
        <loop body>

or, as Guido van Rossum put it:

Please reject the PEP. More variations along these lines won't make the
  language more elegant or easier to learn. They'd just save a few hasty
  folks some typing while making others who have to read/maintain their code
  wonder what it means.


text:
Q: Analog and digital grounds on a DAC I've read at several places (1,2) that ICs such as DACs have both analog and digital ground pins, both should be tied to AGND at the chip.
However, the specific part I'm planning to use (MAX5104) does not claim so in the datasheet, showing instead that the DGND pin be connected to the board's digital ground plane. Why exactly is that?

A: In general, your analog signals should stay in the analog section of the board and your digital signals should stay in the digital section of the board. You should have separate ground planes for each. However, these ground planes must connect to provide a consistent reference point to both sections.
Ideally, the analog sections and the digital sections should connect at a single point. The "star" connection mentioned in your links and by MoJo. Though sometimes this is not possible. But basically what you want is a small "bridge" to connect the two sections. Any signals that must cross between the sections should be routed over this bridge.
The reason for doing this is to prevent or minimize any noise from switching signals on the digital section from disturbing or corrupting any analog signals that you are trying to generate or measure. The split prevents digital currents from flowing into the analog ground plane. While the "bridge" connects the two ground planes so the ground reference is at a consistent level in both sections.
A good reference for why and how to ground mixed signal systems is Henry Ott's Grounding of Mixed Signal PCBs. Some diagrams from that page will help to explain some best practices:

As for the power supplies, they can come from the same source. Usually the bypass capacitors specified in the datasheets are sufficient to decouple the power between the sections. However, if the noise on the board is particularly bad, sometimes additional filter circuitry is necessary. For instance the one seen here:

Or, you could have a separate regulator to provide clean, stable power to any of your analog devices. This will most likely provide the best accuracy but at extra expense, board area, and circuit complexity.

A: The grounds need to be connected together, the question is where do you connect them. If you use the same ground plane for both the IC will work, but you will get digital switching noise on the analogue signals. The most common solution is to use a separate ground plane for analogue and digital, with them connected together at a "star" point very close to the power supply connector. That way any noise from the digital side will be isolated from the analogue side as current flows back to the power supply connector, not past the analogue ground pins.


text:
Q: In Apache maven, how do you override the scope of all transitive dependencies of a library? E.g. If I have a project that depends on a library: "org.apache.hive:hive-common:jar:2.1.1-cdh6.3.4", with a provided scope. Now if I want to declare all its transitive dependencies as "provided", is it possible?
Not doing so will cause maven to fundamentally fail on resolving some of their scope properly:
[INFO] |  +- org.apache.hive:hive-common:jar:2.1.1-cdh6.3.4:provided
[INFO] |  |  +- org.apache.hive:hive-classification:jar:2.1.1-cdh6.3.4:compile
[INFO] |  |  +- org.apache.hive:hive-storage-api:jar:2.1.1-cdh6.3.4:provided
[INFO] |  |  +- org.apache.hive:hive-orc:jar:2.1.1-cdh6.3.4:provided
[INFO] |  |  |  +- org.apache.hadoop:hadoop-hdfs:jar:3.0.0-cdh6.3.4:provided
[INFO] |  |  |  |  +- org.eclipse.jetty:jetty-util-ajax:jar:9.3.25.v20180904:runtime
[INFO] |  |  |  |  +- com.sun.jersey:jersey-core:jar:1.19:runtime
[INFO] |  |  |  |  |  \- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] |  |  |  |  +- com.sun.jersey:jersey-server:jar:1.19:runtime
[INFO] |  |  |  |  \- commons-daemon:commons-daemon:jar:1.0.13:provided
[INFO] |  |  |  \- org.iq80.snappy:snappy:jar:0.2:provided
[INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.3:compile
[INFO] |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-rewrite:jar:9.3.25.v20180904:provided
[INFO] |  |  |  \- org.eclipse.jetty:jetty-client:jar:9.3.25.v20180904:provided
[INFO] |  |  +- org.eclipse.jetty:jetty-server:jar:9.3.25.v20180904:compile
[INFO] |  |  |  +- org.eclipse.jetty:jetty-http:jar:9.3.25.v20180904:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-io:jar:9.3.25.v20180904:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-servlet:jar:9.3.25.v20180904:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-security:jar:9.3.25.v20180904:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-webapp:jar:9.3.25.v20180904:compile
[INFO] |  |  |  \- org.eclipse.jetty:jetty-xml:jar:9.3.25.v20180904:compile
[INFO] |  |  +- org.apache.logging.log4j:log4j-1.2-api:jar:2.8.2:provided
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-api:jar:2.8.2:compile
[INFO] |  |  |  \- org.apache.logging.log4j:log4j-core:jar:2.8.2:provided
[INFO] |  |  +- org.apache.logging.log4j:log4j-web:jar:2.8.2:provided
[INFO] |  |  +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.8.2:compile

The last line in the output of dependency:tree:
org.apache.logging.log4j:log4j-slf4j-impl:jar:2.8.2:compile

Is clearly wrong: it cannot be found anywhere else, thus due to the rule in https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html. It's scope should be provided.
Is it possible to do it in maven? Or I'll have to switch to gradle?

A: Please check answers to the following question: Maven transitive dependency has scope compile while when dependency has provided scope
In short, it appears that you might be using <dependencyManagement> with some of  org.apache.hive:hive-common dependencies which in the end is causing them to change their scope.


text:
Q: How To Add SelfSigned Certificate to Chrome / Mozilla First of all please ignore this question if its too simple or useless.
I am new to TLS and am trying to implement the SSL for my secure data transmission between my client and server. My backend is in Springboot and my front end is in Angular 4.
For Springboot i have used the below this to makes it https:
server.port=8443
server.ssl.key-alias=secure-server
server.ssl.key-store-password=secret
server.ssl.key-store=classpath:server-keystore.jks
server.ssl.key-store-provider=SUN
server.ssl.key-store-type=JKS
server.ssl.trust-store= classpath:server-truststore.jks
server.ssl.trust-store-password: secret
server.ssl.enabled= true

And, for angular 4 i have created ssl folder inside project and place two files i.e:

*

*ssl/server-public.cer

*ssl/server.key

and configured this command inside package.json inside scripts,
scripts: {
"start": "ng serve --ssl true --ssl-cert 'ssl/server-public.cer' --ssl-key 'ssl/server.key' --live-reload false",
}

Now after doing all these my fronted and my backed is https enabled,
But, when i try to open the UI in browser and put the credientials to login to my application i am getting below error in mozilla
An error occurred during a connection to localhost:8443.

SSL peer cannot verify your certificate.

Error code: SSL_ERROR_BAD_CERT_ALERT

Also , the below error in chrome,
Request URL: https://localhost:8443/url
Referrer Policy: no-referrer-when-downgrade
Provisional headers are shown
Access-Control-Request-Headers: authorization
Access-Control-Request-Method: GET
Origin: https://localhost:4200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

So, as an quick fix what i did ??

*

*I open chrome browser.

*Then i put my backed url in chrome browser and i asked me to add exception for the untrusted certificate.

*After this i opened my UI and try to login its calling the backed apis without any issue.

*But, still problem exists in mozilla.

NOTE: I am using self signed certificate.


text:
Q: Is there a way to take the citations from my bibtex file and move them into my tex file without having to change the formatting? I have a large number of citations in the format
Dadrichetal2015,
Author = {Dadrich, M. and Nicolay, N.H. and Flechsig, P. and  Bickelhaupt, S. and
Hoeltgen, L. and Roeder, F. and Hauser, K. and Tietz, A. and Jenne, J. and Lopez, R.
and Roehrich, M. and Wirkner, U. and Lahn, M. and Huber, P.E.},
Title = {Combined inhibition of TGF$\beta$ and PDGF signaling attenuates radiation-
induced pulmonary fibrosis.},
Journal = {Oncoimmunology},
Volume = {5},
Year = {2015},
note = {https://www.ncbi.nlm.nih.gov/pubmed/?term=dadrich+M\%2C+Oncoimmunology}}

In a .bib file. I am having enormous trouble making the .bib file work, and have decide to just do it manually. Is there a way for me to move the citations from the .bib to the .tex, have them display properly without having to basically rewrite all my citations?

A: (too long for a comment, hence posted as an answer)
You asked,

Is there a way to take the [bibliographic entries] from my bibtex file and move them into my tex file without having to change the formatting?

The short answer is, "No".
The long answer is, "Unless you want to do the equivalent of reinventing the wheel, the answer is No."
You haven't stated what exactly "doesn't work" about the bib entry. The following setup, though, works fine. The main creative act you'll have to perform is pick a suitable bibliography style; abbrvnat is just one of many, many possible choices.
Note that I

*

*added some pairs of curly braces in the author field to prevent BibTeX from
lowercasing some words,

*replaced \beta with \upbeta,

*changed the note field to url, and

*replaced the URL string with information provided by the journal directly.

The code also loads the xurl and hyperref packages. To compile this document, be sure to run LaTeX, BibTeX, and LaTeX twice more on it.

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@article{Dadrichetal2015,
Author = {Monika Dadrich and Nils H. Nicolay and
          Paul Flechsig and Sebastian Bickelhaupt and
          Line Hoeltgen and Falk Roeder and Kai Hauser
          and Alexandra Tietz and Jürgen Jenne and
          Ramon Lopez and Manuel Roehrich and
          Ute Wirkner and Michael Lahn and
          Peter E. Huber},
Title  = {Combined inhibition of {TGF$\upbeta$}
          and {PDGF} signaling attenuates
          radiation-induced pulmonary fibrosis},
Journal= {Oncoimmunology},
Volume = 5,
Number = 5,
Pages  = {e1123366},
Year   = 2015,
url    = {https://doi.org/10.1080/2162402X.2015.1123366},
doi    = {10.1080/2162402X.2015.1123366},
}
\end{filecontents}

\documentclass{article}
\usepackage[numbers]{natbib} % citation management package
\bibliographystyle{abbrvnat} % choose a suitable bib style
\hyphenation{onco-immu-no-logy}
\usepackage{upgreek}  % for "\upbeta" macro
\usepackage{xurl}  % allow line breaks anywhere in a URL string
\usepackage[colorlinks,allcolors=blue]{hyperref}

\begin{document}
\cite{Dadrichetal2015}
\bibliography{mybib}
\end{document}