Can I configure netflow on router other than Cisco

Question:
I am quite confused about netflow protocol. First thing I want to know is can I configure netflow on other router. We have Jflow for Juniper but what about other vendors.
Also, suppose if netflow and jflow are configured on two routers then can nfcad listen to both of them simultaneously ?
Answer: Netflow and jFlow have an interesting relationship. Cisco developed NetFlow specifically for their own product, then a standards body got together and developed sFlow. While sFlow is intended to be the vendor neutral implementation of NetFlow, during the process and intervening years, enough got changed so that while they both serve the same function the protocols are not compatible.
I can't really help you configure the flow exporting, although it's documented exceptionally well on the Internet and somewhat well in the nfdump documentation itself. I do, however, have some good experience with the flow collection itself.
The daemons sfcapd and nfcapd are shipped as part of the nfdump. They are used the same way and accept the same configuration parameters but where nfcapd is used for collecting and storing NetFlow logs sfcapd is used for collecting and storing sFlow logs. The Juniper jFlow is an offshoot of sFlow and is almost completely compatible with it, as such you can use the sfcapd process to collect those logs.
Since, you must use two separate daemons to collect the different log sources, you will also need to have them run on two different ports. This should be fairly easy to do since they are different processes with different executables.
Also keep in mind that both nfcapd and sfcapd assume they completely manage the directory structure under which the logs are stored. That means they create files and directories as needed as well as maintain their own built in log retention processor. So you define your retention schedule (in days, years, bytes, & of disk) and whenever the daemon closes out a log file it will automagically delete logs in accordance with your schedule. To do this the daemon also locks the entire directory. That is, if you tell nfcapd to save logs in /opt/netflows then a lock file gets dropped and sfcapd will not use that directory. So if you run both you must have them save into different locations.
Comment: Thanks man. Although, I asked this question about a month back, I am still alive at it. So, what I understand is sfcapd and nfcapd can help me cater to Cisco and Juniper routers respectively. Do we have any provision of netflow on other vendors ? Also am Important doubt I have is, wiki says cisco has defined netflow as unidirectional. I am confused here, does it mean that only request packets will be captured ? (I am where dst port is < 1024, can src port ever be a standard port. I assume it be be.)
Comment: @Ajit: Remember, sfcapd is for sFlow, so you can use it to collect exports from any vendor that implements that standard. If they do something weird you're kind of on your own. I only have experience with flow-tools, nfdump, and argus. The unidirectional thing is a bit of an annoyance. Any bidirectional connection, like say an HTTP GET, will show up in netflow as two records where the traffic from client to server is in one record and the traffic from server to client is in another.
Comment: I think that clears it out. Actually I have not yet got access to the routers and we are developing something related to it, hence so many doubts. Anyways it was nice explanation by you. Thanks.
Comment: @Ajit: No worries, I can certainly understand. I collect flows for monitoring and forensics but leave the actual network management and configuration to the network guys.
Answer:
I am quite confused about netflow protocol. First thing I want to know
  is can I configure netflow on other router. We have Jflow for Juniper
  but what about other vendors.

Netflow is developed by Cisco and it supports many platforms. You can refer to this to know what platform is supported.

Also, suppose if netflow and jflow are configured on two routers then
  can nfcad listen to both of them simultaneously ?

I have never done it before, but I think the answer is yes.
Comment: HI Gnouc, thanks for the link shared by you. It will certainly help me. I also think that nfcapd would listen to both of them I was not quite sure. Do have any info about the similarity between packets sent be nfcapd and jflow ?
Comment: One more thing I want to know is, what all details are provided in ifIndex. I mean can I come to know the exact link for which a packet is processed. I mean I want the router name and Interface IP (src,dst). Is it provided in IfIndex ?
Comment: If you use cisco netflow, try this: http://www.cisco.com/en/US/docs/switches/datacenter/nexus1000/sw/4_0/troubleshooting/configuration/guide/trouble_11netflow.html


docker error FATA[0000] Get http:///var/run/docker.sock/v1.18/images/search?term=node: dial unix /var/run/docker.sock: no such file or directory

Question: Ubuntu 15.04 64 bit, docker 1.6.1, user is in docker group.
After OS boot every docker command execution cause this error:
FATA[0000] Get http:///var/run/docker.sock/v1.18/images/search?term=node: dial unix /var/run/docker.sock: no such file or directory.

this problem can be fixed by execution this command:
service docker restart

but after reboot error appears again.
How to fix it?
Answer: set docker to start at boot
here are commands for centos6
sudo /sbin/chkconfig --add docker
sudo /sbin/chkconfig --list docker
sudo /sbin/chkconfig docker on
hope it helps
link to Ubuntu how to :
https://askubuntu.com/questions/58404/how-to-start-and-stop-a-service
Comment: Please read [code formatting help page](https://stackoverflow.com/help/formatting).


Passar inputs de innerHTML para form e acessar via PHP

Question: Tenho um formulário HTML, campos de input normais, botão de submit... Através de uma função JS, adiciono à uma DIV (com innerHTML), campos input adicionais.
var div = document.getElementById('produtos-adicionados');
div.innerHTML = '<input type='text' class='form-control' name='item' id='item' required='' />';

Quando der o submit no formulário, não consigo acessar esse novo input de name item, obviamente.
De que forma conseguiria enviar o formulário e obter o value do input no php? Além de, ao enviar o formulário, conseguir obter também os valores dos demais inputs, que estão no formulário mas não estão no innerHTML.
Comment: Todos inputs adicionais usam o `name=item`, de forma repetida?
Comment: esse comando `div.innerHTML = '...'` funciona com todas essas aspas simples?
Comment: Os names dos inputs gero dinâmicamente e com um contador vou incrementando. Exemplo: primeiro input terá o seguinte name: item0. O seguinte, se chamará item1, e assim sucessivamente. Mesma coisa para outros, onde tenho: quantidade0, quantidade1, etc...
Comment: div.innerHTML funciona com as aspas simples por que o comando uso com aspas duplas. Ex: div.innerHTML = ""
Comment: O elemento de `id="produtos-adicionados"` está dentro do ``?
Comment: Sim, está dentro do form.
Answer: Atente:

uso de aspas em volta do html
atributo required não necessita de atribuir valor

Atualização:
Usando o jQuery para mostrar que o input adicionado fazer parte do form.

var div = document.getElementById('produtos-adicionados');
div.innerHTML = "Apelido: <input type='text' class='form-control' name='item' id='item' required />"

$('#myform').submit(function(e) {
  e.preventDefault()
  alert(JSON.stringify(($('#myform').serializeArray())))
})

<form id="myform" action="/action_page.php">
  Nome: <input type="text" name="nome" required>

 substituir conteúdo

  <input type="submit">
</form>


Rebuilding the Management Studio Index in SQL Server 2005

Question: Does anyone know if using the SQL Server Management Studio Index Rebuild, rebuilds the index online or offline?
Reading the help documentation doesn't say anything on this (so I would assume it is offline) but I would like to know, as I prefer using the GUI over Transact SQL.
If the rebuild happens online, then how would I know how long it takes? The Index Rebuild window closes after a few seconds, so is it fair to assume that at this point the rebuild is complete, or is it still going on in the background? There's no indicator of any change
Comment: Note: I don't mean Maintenance Plans
Answer: If you do it thru context menu - it is offline
If thro index's properties window - then the behavior is controlled by checkbox "Allow online processing..." on the Options tab
Comment: You always can script the action from the properties window and change ONLINE=OFF to ONLINE=ON manually
Comment: Hmmm.. Using SQL 2005 Enterprise, and no "Allow online processing.." checkbox under Index Properties. Unless I check off "set Fill Factor" options - which gives me "Allow online processing of DML statements.."
Answer: It's offline unless you use the options tab to make it an online operation (if that's supported on your edition).
If the Window closes then the operation is complete.
Comment: Using SSMS 2008 R2 with SQL Server 2005 Enterprise (Which is okay for Online Rebuilds) but no such option for SSMS.. atleast not that I've discovered yet ;)
Comment: On the options page, where you check the box to rebuild, there's a check box that is grayed out which says "Allow online processing on DML statements while creating the index".  It appears to only be available when you want to change the fill factor setting.  If you use the DML directly this is an option you can set no matter what settings if any you change.
Answer: If you run Profiler why using the SSMS Index Rebuid you'll see ONLINE = OFF.


How to Create a proactive conversation in Teams channel?

Question: So I've been following this guide on how to send proactive messages, I've got that setup but it currently responds to the setup message. I would like it to create a whole new conversation, I've found some code that uses the CreateConversationAsync() function but I've only managed to get it to work with it dm-ing the user rather than within the channel. See below for code example.
I know I'm doing something wrong but I can't tell what at this point.
const string botAppId = "<MicrosoftApptId GUID>";
const string serviceUrl = "<my service URL>";
const string tenantId = "<my tenant ID>";
const string recipientId = "<recipient ID xy:GUID>";

var title = "test title";
var activity = Activity.CreateMessageActivity();
activity.Type = ActivityTypes.Message;
activity.Text = "test message";

await ((BotAdapter)_adapter).CreateConversationAsync(
    botAppId: botAppId,
    channelId: Microsoft.Bot.Connector.Channels.Msteams,
    serviceUrl: serviceUrl,
    audience: null,
    conversationParameters: new ConversationParameters
    {
        Activity = (Activity)activity,
        Bot = new ChannelAccount(botAppId),
        IsGroup = false,
        Members = new List<ChannelAccount> { new ChannelAccount(recipientId) },
        TopicName = title,
        TenantId = tenantId
    },
        callback: BotCallback,
        cancellationToken: default(CancellationToken));

Comment: Are you looking for this within the context of a 1-1 chat between the bot and user, or within a Channel inside a Team?
Comment: within a channel inside a team
Comment: ok thanks, that helps. See answer below.
Answer: You're using "recipient id", which is presumably something unique for that user, like the user's unique Azure AD ID, that might be why it's 'DM'ing' the user, so to speak. What you need to do is capture the 'conversationId' of the conversation the bot was added to, which is basically the conversationId for the channel.
Here's a more detailed answer I gave on this topic, together with links to a sample and a video covering proactive messaging, which should hopefully be useful in solving this: Sending proactive messages from an outside process to organizational users via Teams chat bot


SQL Server Query - Multiple Order By column and per Same Grouping

Question: Sample Table

I need to sort the record above by REMARKS in ascending order, and then by FIRSTDATE in descending order, and then by LASTDATE in descending order
I do this query
select * from tblRecord
order by Remarks, FirstDate desc, Lastdate desc

And gives me this output

It should be like this:

Updated:
Startdate and Enddate refer to the actual start date and last date operation of the tenants, What I want is to separate the sorting of tenant per remarks, when ceased, sorting should be based on firstdate in descending order, when started, should be per enddate in descending order.
Comment: What is `Firstdate` and `Lastdate`?
Comment: Well SQL Server does order descending and as you expected. Perhaps rephrase your question to be more specific and why order should be like that?
Comment: I'm thinking when the remark is ceased, then order them by startdate, last startdate first, if remark is started order them by enddate, first ended first? If this is the case then I've got it
Comment: Or order them by startdate descending when it's ceased and startdate ascending when it's started? I have that one to
Comment: When exactly do you have to order by enddate rather than startdate?
Comment: startdate and enddate perhaps?
Comment: I am sorry for the late reply, I was offline earlier, firsdate and lastdate actually refer to the first date and last date of the tenant's operation. What I want is to sort them per ceased and per started, if the tenant's remark is ceased then the sorting to be considered is the lastdate, on the other hand , when it is started, it should be the firstdate, I hope it is clearer now, i am sorry for the confusion
Comment: No, it us the other way around, when ceased, order should be startdate in desc, when started, enddate in desc order
Answer: This probably help you using CASE in ORDER BY
SELECT * FROM tblRecord
ORDER BY CASE Remarks WHEN 'started' THEN Lastdate
                      ELSE FirstDate END
DESC

Answer: Not sure what it is you are looking for seeing as you aren't responding for the moment, I have 2 situations in which I can get the result that you are looking for, 1 of these will deffinitely be wrong or both could be wrong but they both produce the result you are looking for with the test data you provided
Situation 1: You need to order by startdate descending when your remarks is ceased and by startdate ascending when remarks is started in which case you would get this code: SQLFIDDLE
select * from mytable
order by remarks,
CASE WHEN remarks = 'started'
THEN startdate END ASC,
CASE WHEN remarks ='ceased'
THEN startdate END DESC,
enddate DESC

Situation 2: when you have remark ceased you need to order the records by startdate and when remark is started you need to order by enddate, in which case the query would be: SQLFIDDLE
select * from mytable
order by remarks,
CASE WHEN remarks = 'started'
THEN enddate END DESC,
CASE WHEN remarks ='ceased'
THEN startdate END DESC;

Comment: Hi, this worked, case in order by is just what I need. Thanks
Comment: @rickyProgrammer no problem man, next time you ask a question though try to properly state what the case is in your question so people know exactly what you are trying to achieve
Comment: ok, I just wonder if you have an idea in crystal report? because this query is somehow connected to it
Comment: Sorry I have no idea, I've never worked with it, next time add crystal report as a tag on your question so people who know more about it will get to see the question (for me I just look at questions with tag 'sql' because I know a bit about writing queries)


Intellij IDEA + FTP?

Question: I'm running Intellij IDEA 10.5 and I've set up my default ftp server (File|Settings|Deployment),
but when I'm right-clicking on my project I still see Deployment option inactive (see below):

I'm new to IDEA, so I'm sure that it is not a bug, but my misunderstanding of
how one should enable ftp deployment in IDEA.
What should I do to enable it?

Please, give me a clue to solve this problem!
This is the only remaining thing that keeps me from
using IDEA instead of Eclipse in my development.
Comment: Do you run the latest IDEA version? Does it happen with IDEA 11 EAP as well?
Answer: I think you need to make sure that the path mappings are correctly entered in the "Mappings" tab of your deployment configuration.
If the mappings tab is not correctly filled out, a warning will be shown in that tab (e.g. "Deployment path is not specified").
The upload/compare/download menu entries for the deployment configuration will be greyed out as long as the mappings are not defined.
I had the same problem and it was resolved by entering the correct path mappings.
Answer: Deployment is only available in the paid ultimate edition:
http://www.jetbrains.com/idea/webhelp/deployment.html
I'll bet you're using the free community edition.
Comment: So does WebServices feature. As they are visible in the menu, @tsds is already using the Ultimate Edition.

Intellij IDEA + FTP?


Adding sliders to a Streamlit app to adjust model inputs

Question: Hi I am trying to create sliders for adjusting the values of a model using a dictionary.
The dataframe contains multiple columns of floats.
The index column are unique city names that are used to select a slice of the data.
The column names and index are object type.
df = pd.DataFrame({'city': ['London', 'Bedford'], 'Value_1': [0.256, 0.425], 'Value_2': [0.859, 0.956]})
df = df.set_index('city')

def display_sliders():
        sliders = {}
        for col in df.columns:
            min_val = df[col].min()
            max_val = df[col].max()
            val = df[col].loc[selected_city]
            sliders[col] = st.slider(col, min_value=min_val, max_value=max_val, value=val)
        return sliders

# Display the slider widgets
sliders = display_sliders()

When I run the code it returns an error:
KeyError: <class 'numpy.float64'>

The error points to the line:
sliders[col] = st.slider(col, min_value=min_val, max_value=max_val, value=val

Answer: After lots of head scratching I found the answer thanks to mathscatsand Streamlit moderator:
The solution is too cast the values as floats on the following line:
sliders[col] = st.slider(col, min_value=float(min_val), max_value=float(max_val), value=float(val))

Comment: The reason this error occurs is because the values are numpy.float64 and they need to be just python floats. By casting them directly it ensures they are python floats.


How necessary is a USB Audio Interface?

Question: I'm currently recording songs on my computer and the quality of my microphone is awful and the microphone is very quiet. That doesn't surprise me, because it's a 20$ karaoke microphone...
I got into a shop and wanted to look for a new microphone. The shop assistant suggested me to buy a USB Audio Interface first and he suggested me the "Roland Tri Capture" to start.
Because I'm very new to the world of recording and don't want to spend 150$ unnecessary I wanted to ask you guys how important such an interface is?
Is it worth the money or should I directly look for a better microphone?
Would such an Audio Interface even improve the sound of my 20$ microphone?
Answer: "Worth the money" is very subjective. Let's instead talk about the various factors you have to consider.
Fitting A into B
Good quality microphones usually have XLR connectors. These have three wires arranged so that any interference picked up in the cable is cancelled out.
Many USB audio interfaces have XLR sockets (but check that the one you choose does).
Your computer's microphone input will be a stereo 3.5mm socket. So if you don't buy a suitable audio interface, you have the issue of physically plugging stuff together.
You can get XLR to 3.5mm cables, such as this one.

These are not all that common, and I see anecdotes on the internet about many of them being incorrectly wired. However, it's potentially an $8 spend that would allow you to make-do without a USB interface.
Power
XLR doesn't only carry a sound signal. Condenser microphones need power, and usually the most convenient way to get power to the mic is phantom power, whereby a small current is carried on the signal lines of the cable.
You can expect the XLR sockets on USB audio interfaces to provide phantom power -- but check the specifications before buying.
Your PC's 3.5mm microphone socket won't provide phantom power. With many microphones, you can put in a battery instead - but it's an extra thing to worry about.
Audio quality
The input of the standard audio interface on a PC is not designed for connoisseurs. After all, most of them don't get used at all, and the rest get used for Skype-type chats. However, whether it's good enough for your needs is entirely subjective.
If you can record music from the line-in input to a quality you consider "good enough", then there's a chance the mic input will also be "good enough". The one extra step is the pre-amplifier in the PC which boosts the signal from mic level to line level - again, this may or may not be good enough for your needs.
You'll always be able to find an audiophile who will insist you need more expensive equipment.
If your built-in sound card does an acceptable job with line-level input, then one possible alternative to a USB audio interface, is to buy a microphone pre-amp:

Connecting it as: mic  (XLR)-> pre-amp (phone)-> PC line-in.
This would effectively be replacing the low quality pre-amp in your PC with a high quality pre-amp. A good pre-amp like this costs about a third of the price of a USB interface, though, and handles only one mic. The USB interface will contain a broadly equivalent pre-amp for each input it has.
Latency
Latency is the delay between a sound wave hitting the microphone, and the digital audio stream reaching your computer program. If you're monitoring live, add on the delay between the program writing its output stream to the device, and it reaching your speakers.
Non-music uses of a microphone don't need particularly low latency, so the designers of built-in inputs don't strive for low latency. However when you're layering tracks in a DAW, or listening to the computer's output as you play, it's very significant. Effects range from ragged timing on multitracked recordings, to complete befuddlement as you play!
Better audio interfaces have lower latency in general. They generally also have drivers designed for lower latency. Often the driver configuration includes sliders to affect the buffer length. Larger buffers tolerate overloaded CPUs better, but lead to higher latency.
Control and convenience
Your PC mic input is one socket.
USB audio interfaces like the one you've been recommended, have a number of sockets, each of which your software sees as a separate input. With the right software you can even record from two inputs at the same time (e.g. two singers; a singer and a guitar; two mics, one for the instrument, one for room ambience).
They also tend to have dedicated knobs, controls and displays. Some have built-in compression, to gracefully handle level clipping.
It's much more convenient to adjust input levels with a physical knob on the input device, than to fiddle with sliders in software.
It's much more convenient to have a guitar and a mic both plugged in, than to have to unplug, plug in, adjust levels, each time you switch.
The right microphone
Different microphones are good for different purposes. Make sure you know what you want to use your microphone for, before spending money on it.
What should I look for in a recording microphone for personal use?
Comment: USB microphones are available, which incorporate the mic and USB audio interface into one unit, and are probably the most convenient solution if you only need one channel. I think these range in quality from professional to awful, so check reviews before buying. Also another way to get multiple mic preamps is to buy a small mixer, which might be a more versatile piece of kit in future than a dedicated mic preamp.
Comment: Now, two months later I want to thank you again for your answer! It helped me a lot, and I learned a lot about recording lately, so I see how qualitative your answer actually is! I hope it will help a lot of rookies like me, nice work man! :)
Comment: An alternative to a mic preamp is to buy a small mixer, for example the Yamaha MG-06.  That way if you want to add other sources (guitar, keyboards, other microphones, etc.) you don't need to do anything with the computer.  (As an aside, the mixer can supply phantom power too.)
Comment: @Duston Pedantic mode on: a mixer isn't an alternative to a pre-amp. Many mixers *contain* mic pre-amps - and indeed the quality of those pre-amps is a selling point.
Comment: After reading your answer I think that such an Audio Interface would be very useful! I'll start putting money aside this month ^^
Thank you!
Comment: How does this cable work? Is it really XLR (mono AFAIK) on one end, and stereo jack on the other end?
Comment: Is 3.5 mm better than USB?
Answer: You really don't need an expensive USB audio interface. Invest in a good dynamic microphone like the SM58 or a condenser mic if really needed.
An audio interface also decreases audio latency. This helps when you want to monitor your vocals live with a headphone 'wet' as in with effects.
Comment: @MatthewRead You're not adding another processor. You're using a fast processor **instead of** the slower, cheaper built-in one.
Comment: A good microphone still needs to be connected to a suitable input, so some sort of preamp or interface is still necessary - but you're right it doesn't have to be expensive.
Comment: Adding another processor between the mic and the PC *decreases* latency?  How so?
Comment: Oh, so the sound card is completely bypassed?  Sounds great.
Answer: Nothing is necessary. However, a USB audio interface will dramatically increase the sound quality, even with a cheap microphone.
You don't have to invest in expensive devices. Even an entry-level interface will give you enough sound clarity to do a very decent job. Focusrite Scarlett models are the best sellers for amateurs because they are reasonably priced and have very good sound and build quality. Of course there are much better interfaces with exceptionally better sound, but they are intended for people who have great microphones, more experience, know what they're looking for, and they have the skills to fully utilize them.
A Focusrite Scarlett Solo is probably less than 100$. It has one microphone input, but I guess it will work for you. If you want to use two microphones at the same time, there's Scarlett 2i2. It depends on what you want, there are other models with 4+ mic inputs.
However, if even that is expensive for you, there's no reason to avoid even cheaper alternatives. Behringer is a brand that's talked about a lot. It's a budget brand that releases products that resemble reputable brands and models. It's usually trashed quite a lot by professional audio guys on various forums. Of course their build quality and their reliability are mediocre, but it's a great solution if you are a beginner and just want something to have to do your hobby.
There's also products that are a microphone and instead of XLR/Jack outputs, they have an internal USB interface. This is a possible solution, but it's not very flexible if you later want to add something else. I would generally advise you to get a cheap interface with one or two XLR inputs and record your music before you start worrying about what the "pros" say. Pair it with a cheap microphone (~50-80$) and you'll be good to go. Later, when you get a job or something, you can upgrade your mic to something better, and even later you might have more money to invest in a better preamp/interface.
For me, it is much preferred to be able to have something, even if it's not great, than not having anything at all and not being able to do what I'm passionate about. Music is a great thing, and doing it in any way is so much more important than waiting until you have money for the perfect mic/interface/guitar/amp.
Answer: If you want to record on computer with a Dynamic microfone, you need an Audio Interface because computer audio input is not designed for it. You can even mess up with the motherboard.
If you want to record without Dynamic mic, you can use those simple desktop mics or headset built-in mics, but again the quality is bad, worst than a mobile phone mic.
Most important, though, is a term in music production called Opportunity Time. With the time you use recording by yourself with good equipment at home, learning how and what to use, mixing etc, you could instead use this time focused on songwriting, networking, music business etc Don't worry about high quality at home recording. Do your songs and let a music producer with a good studio/equip/knowledge do the technological job for you

How necessary is a USB Audio Interface?


The "dictionary_term" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition()

Question: I followed How to create a custom entity in Drupal 8 to create a module. When I installed it, I got the following error.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "dictionary_term" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 150 of /var/www/html/core/lib/Drupal/Core/Entity/EntityTypeManager.php).

What do I need to change in the following code?
dictionary/Entity/Term.php
/**
 * @file
 * Contains \Drupal\content_entity_example\Entity\ContentEntityExample.
 */

namespace Drupal\dictionary\Entity;

use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\user\UserInterface;
use Drupal\Core\Entity\EntityChangedTrait;

/**
 * Defines the ContentEntityExample entity.
 *
 * @ingroup dictionary
 *
 *
 * @ContentEntityType(
 * id = "dictionary_term",
 * label = @Translation("Dictionary Term entity"),
 * handlers = {
 * "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
 * "list_builder" = "Drupal\dictionary\Entity\Controller\TermListBuilder",
 * "form" = {
 * "add" = "Drupal\dictionary\Form\TermForm",
 * "edit" = "Drupal\dictionary\Form\TermForm",
 * "delete" = "Drupal\dictionary\Form\TermDeleteForm",
 * },
 * "access" = "Drupal\dictionary\TermAccessControlHandler",
 * },
 * list_cache_contexts = { "user" },
 * base_table = "dictionary_term",
 * admin_permission = "administer dictionary_term entity",
 * entity_keys = {
 * "id" = "id",
 * "uuid" = "uuid",
 * "user_id" = "user_id",
 * "created" = "created",
 * "changed" = "changed",
 * "pl" = "pl",
 * "en" = "en",
 * },
 * links = {
 * "canonical" = "/dictionary_term/{dictionary_term}",
 * "edit-form" = "/dictionary_term/{dictionary_term}/edit",
 * "delete-form" = "/dictionary_term/{dictionary_term}/delete",
 * "collection" = "/dictionary_term/list"
 * },
 * field_ui_base_route = "entity.dictionary.term_settings",
 * )
 */
class Term extends ContentEntityBase {

  use EntityChangedTrait;

  /**
   * {@inheritdoc}
   *
   * When a new entity instance is added, set the user_id entity reference to
   * the current user as the creator of the instance.
   */
  public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
    parent::preCreate($storage_controller, $values);
// Default author to current user.
    $values += array(
      'user_id' => \Drupal::currentUser()->id(),
    );
  }

  /**
   * {@inheritdoc}
   *
   * Define the field properties here.
   *
   * Field name, type and size determine the table structure.
   *
   * In addition, we can define how the field and its content can be manipulated
   * in the GUI. The behaviour of the widgets used can be determined here.
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {

// Standard field, used as unique if primary index.
    $fields['id'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('ID'))
      ->setDescription(t('The ID of the Term entity.'))
      ->setReadOnly(TRUE);

// Standard field, unique outside of the scope of the current project.
    $fields['uuid'] = BaseFieldDefinition::create('uuid')
      ->setLabel(t('UUID'))
      ->setDescription(t('The UUID of the Contact entity.'))
      ->setReadOnly(TRUE);

// Name field for the contact.
// We set display options for the view as well as the form.
// Users with correct privileges can change the view and edit configuration.
    $fields['pl'] = BaseFieldDefinition::create('string')
      ->setLabel(t('Polish'))
      ->setDescription(t('Polish version.'))
      ->setSettings(array(
        'default_value' => '',
        'max_length' => 255,
        'text_processing' => 0,
      ))
      ->setDisplayOptions('view', array(
        'label' => 'above',
        'type' => 'string',
        'weight' => -6,
      ))
      ->setDisplayOptions('form', array(
        'type' => 'string_textfield',
        'weight' => -6,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

    $fields['en'] = BaseFieldDefinition::create('string')
      ->setLabel(t('English'))
      ->setDescription(t('English version.'))
      ->setSettings(array(
        'default_value' => '',
        'max_length' => 255,
        'text_processing' => 0,
      ))
      ->setDisplayOptions('view', array(
        'label' => 'above',
        'type' => 'string',
        'weight' => -4,
      ))
      ->setDisplayOptions('form', array(
        'type' => 'string_textfield',
        'weight' => -4,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

// Owner field of the contact.
// Entity reference field, holds the reference to the user object.
// The view shows the user name field of the user.
// The form presents a auto complete field for the user name.
    $fields['user_id'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('User Name'))
      ->setDescription(t('The Name of the associated user.'))
      ->setSetting('target_type', 'user')
      ->setSetting('handler', 'default')
      ->setDisplayOptions('view', array(
        'label' => 'above',
        'type' => 'author',
        'weight' => -3,
      ))
      ->setDisplayOptions('form', array(
        'type' => 'entity_reference_autocomplete',
        'settings' => array(
          'match_operator' => 'CONTAINS',
          'size' => 60,
          'placeholder' => '',
        ),
        'weight' => -3,
      ))
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE);

    $fields['created'] = BaseFieldDefinition::create('created')
      ->setLabel(t('Created'))
      ->setDescription(t('The time that the entity was created.'));

    $fields['changed'] = BaseFieldDefinition::create('changed')
      ->setLabel(t('Changed'))
      ->setDescription(t('The time that the entity was last edited.'));

    return $fields;
  }

}

Answer: Drupal doesn't find the entity class because the file containing its implementation has been put in the wrong directory. If dictionary is the directory containing the module, the Term.php file for that entity must be in dictionary/src/Entity/Term.php, not dictionary/Entity/Term.php. That is what PSR-4 namespaces require, in Drupal 8, as described in PSR-4 namespaces and autoloading in Drupal 8.

Each module has a namespace that corresponds to its module name.
Here: Drupal\vegetable\

The module's namespace is mapped to the ./src/ folder in the module directory.
Here: Drupal\vegetable\ → modules/vegetable/src/

Note that the example in that page doesn't mean you have to create a modules directory inside the directory containing the module. It just shows the parent directory of the directory containing the module (which in the example is vegetable). It doesn't even mean the parent directory of the directory containing the module must necessarily be modules.
To have a confirm of the correct directory, it's sufficient to see where Drupal core places the files for its entity classes.

User => core/modules/user/src/Entity/User.php
Node => core/modules/node/src/Entity/Node.php
Term => core/modules/taxonomy/src/Entity/Term.php

Leaving out core/modules, which is where all Drupal core modules are places, it's clear that, for example, the file containing the Node class is placed in the src/Entity directory inside the directory containing the node.module file.


Windows 2003 server: can't join domain

Question: I originally tried to rejoin a computer to a network which led to a "cannot find domain" error.  The username/password box don't even come up.
Some tests I ran:
I can ping the server name.
I can't ping the server's FQD.N
I can't ping the domain name domain1.local.
nslookup can't find the domain.

So I go to the DNS and run netdiag.exe and gives me this error:
DNS test . . . . . . . . . . . . . : Failed
          [WARNING] Cannot find a primary authoritative DNS server for the name
            'stmartinsrv.stmartin.local.'. [RCODE_SERVER_FAILURE]
            The name 'srv.domain1.local.' may not be registered in DNS.

    [WARNING] The DNS entries for this DC are not registered correctly on DNS se
rver '220.127.116.11'. Please wait for 30 minutes for DNS server replication.
    [WARNING] The DNS entries for this DC are not registered correctly on DNS se
rver '18.104.22.168'. Please wait for 30 minutes for DNS server replication.
    [FATAL] No DNS servers have the DNS records for this DC registered.

Redir and Browser test . . . . . . : Passed
    List of NetBt transports currently bound to the Redir
        NetBT_Tcpip_{04BB0F6B-06AE-4D60-80C8-2A7A24C1D87B}
    The redir is bound to 1 NetBt transport.

    List of NetBt transports currently bound to the browser
        NetBT_Tcpip_{04BB0F6B-06AE-4D60-80C8-2A7A24C1D87B}
    The browser is bound to 1 NetBt transport.

Then running dcdiag,
C:\Program Files\Support Tools>dcdiag

Domain Controller Diagnosis

Performing initial setup:
   Done gathering initial info.

Doing initial required tests

   Testing server: Default-First-Site-Name\SRV
      Starting test: Connectivity
         The host 1c99f63c-49ec-40db-b3d3-6265c00fbd3e._msdcs.domain1.local cou
ld not be resolved to an
         IP address.  Check the DNS server, DHCP, server name, etc
         Although the Guid DNS name
         (1c99f63c-49ec-40db-b3d3-6265c00fbd3e._msdcs.domain1.local) couldn't
         be resolved, the server name (srv.domain1.local) resolved to
         the IP address (192.168.1.21) and was pingable.  Check that the IP
         address is registered correctly with the DNS server.
         ......................... SRV failed test Connectivity

Doing primary tests

       Testing server: Default-First-Site-Name\SRV
          Skipping all tests, because server SRV is
          not responding to directory service requests

       Running partition tests on : ForestDnsZones
          Starting test: CrossRefValidation
             ......................... ForestDnsZones passed test CrossRefValidation

          Starting test: CheckSDRefDom
             ......................... ForestDnsZones passed test CheckSDRefDom

       Running partition tests on : DomainDnsZones
          Starting test: CrossRefValidation
             ......................... DomainDnsZones passed test CrossRefValidation

          Starting test: CheckSDRefDom
             ......................... DomainDnsZones passed test CheckSDRefDom

       Running partition tests on : Schema
          Starting test: CrossRefValidation
             ......................... Schema passed test CrossRefValidation
          Starting test: CheckSDRefDom
             ......................... Schema passed test CheckSDRefDom

       Running partition tests on : Configuration
          Starting test: CrossRefValidation
             ......................... Configuration passed test CrossRefValidation
          Starting test: CheckSDRefDom
             ......................... Configuration passed test CheckSDRefDom

       Running partition tests on : domain1
          Starting test: CrossRefValidation
             ......................... domain1 passed test CrossRefValidation
          Starting test: CheckSDRefDom
             ......................... domain1 passed test CheckSDRefDom

       Running enterprise tests on : domain1.local
          Starting test: Intersite
             ......................... domain1.local passed test Intersite
          Starting test: FsmoCheck
             ......................... domain1.local passed test FsmoCheck

From previous postings, I've tried adding the domain suffix to the NIC IP properties to both the client machine and the domain controller server which didn't help.
Note: there is only one NIC on the server.
Any ideas?
UPDATE: I partially fixed the problem by removing the ISP DNS IP addresses from the local NIC card and just added the SRV server IP address (192.168.x.x) to the DNS tab of the IP properties of the NIC card.  Now when I run nslookup on SRV, it resolves to the domain name locally.
When I run nslookup on domain1.local, it resolves to the domain to the server IP address locally on the server.  However when I try to do the same thing on the client machine, I still receive an unknown host response when I attempt to run nslookup domain1.local and the FQDN.
UPDATE 2: I also manually set the DNS IP address on the client's NIC IP settings in the DNS tab which didn't work either. Yet I can still ping domain controller/DNS server
On the client when I run ipconfig and nslookup:
C:\Documents and Settings\Administrator>ping domain1.local
Ping request could not find host domain1.local. Please check the name and try a
gain.

C:\Documents and Settings\Administrator>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : CLIENT02
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : domain1.local

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : domain1.local
        Description . . . . . . . . . . . : Intel(R) 82562V-2 10/100 Network Con
nection
        Physical Address. . . . . . . . . : 00-1A-A0-8B-94-87
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.1.107
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 192.168.1.21
                                            192.168.0.1
        Lease Obtained. . . . . . . . . . : Sunday, April 11, 2010 8:45:15 PM
        Lease Expires . . . . . . . . . . : Sunday, April 18, 2010 7:24:15 PM

C:\Documents and Settings\Administrator>nslookup
DNS request timed out.
    timeout was 2 seconds.
*** Can't find server name for address 192.168.1.21: Timed out
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Default Server:  UnKnown
Address:  192.168.1.21

> server 192.168.1.21
DNS request timed out.
    timeout was 2 seconds.
Default Server:  [192.168.1.21]
Address:  192.168.1.21

>
C:\Documents and Settings\Administrator>nslookup
DNS request timed out.
    timeout was 2 seconds.
*** Can't find server name for address 192.168.1.21: Timed out
*** Can't find server name for address 192.168.0.1: Non-existent domain
*** Default servers are not available
Default Server:  UnKnown
Address:  192.168.1.21

> ls domain1.local
ls: connect: No error
*** Can't list domain domain1.local: Unspecified error
>

and then I ran netdiag /d:domain1.local
...................................

    Computer Name: CLIENT02
    DNS Host Name: CLIENT02
    System info : Windows 2000 Professional (Build 2600)
    Processor : x86 Family 6 Model 15 Stepping 2, GenuineIntel
    List of installed hotfixes :
        KB835221WXP
        KB888111WXPSP2
        KB893803v2
        Q147222

Netcard queries test . . . . . . . : Passed
    GetStats failed for 'Intel(R) 82562V-2 10/100 Network Connection - AGN Filter Interface'. [ERROR_GEN_FAILURE]

Per interface results:

    Adapter : Local Area Connection

        Netcard queries test . . . : Passed

        Host Name. . . . . . . . . : CLIENT02.domain1.local
        IP Address . . . . . . . . : 192.168.1.107
        Subnet Mask. . . . . . . . : 255.255.255.0
        Default Gateway. . . . . . : 192.168.1.1
        Dns Servers. . . . . . . . : 192.168.1.21
                                     192.168.0.1

        AutoConfiguration results. . . . . . : Passed

        Default gateway test . . . : Passed

        NetBT name test. . . . . . : Passed
        [WARNING] At least one of the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names is missing.

        WINS service test. . . . . : Skipped
            There are no WINS servers configured for this interface.

        Ipx configration
            Network Number . . . . : 00000000
            Node . . . . . . . . . : 001aa08b9487
            Frame type . . . . . . : 802.2

    Adapter : IPX Internal Interface

        Netcard queries test . . . : Passed

        Ipx configration
            Network Number . . . . : 00000000
            Node . . . . . . . . . : 000000000001
            Frame type . . . . . . : Ethernet II

    Adapter : IpxLoopbackAdapter

        Netcard queries test . . . : Passed

        Ipx configration
            Network Number . . . . : 1234cdef
            Node . . . . . . . . . : 000000000002
            Frame type . . . . . . : 802.2

    Adapter : NDISWANIPX

        Netcard queries test . . . : Passed

        Ipx configration
            Network Number . . . . : 00000000
            Node . . . . . . . . . : f6f220524153
            Frame type . . . . . . : Ethernet II

Global results:

Domain membership test . . . . . . : Passed
    Dns domain name is not specified.
    Dns forest name is not specified.

NetBT transports test. . . . . . . : Passed
    List of NetBt transports currently configured:
        NetBT_Tcpip_{3DF46308-913D-4B62-8F6A-AC1E076E3864}
    1 NetBt transport currently configured.

Autonet address test . . . . . . . : Passed

IP loopback ping test. . . . . . . : Passed

Default gateway test . . . . . . . : Passed

NetBT name test. . . . . . . . . . : Passed
    [WARNING] You don't have a single interface with the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names defined.

Winsock test . . . . . . . . . . . : Passed

DNS test . . . . . . . . . . . . . : Passed

Redir and Browser test . . . . . . : Passed
    List of NetBt transports currently bound to the Redir
        NetBT_Tcpip_{3DF46308-913D-4B62-8F6A-AC1E076E3864}
    The redir is bound to 1 NetBt transport.

    List of NetBt transports currently bound to the browser
        NetBT_Tcpip_{3DF46308-913D-4B62-8F6A-AC1E076E3864}
    The browser is bound to 1 NetBt transport.

DC discovery test. . . . . . . . . : Failed

 This computer cannot be joined to the [domain1.local] domain because of one of the
following reasons.

1. The DNS SRV record for [domain1.local] is not registered in DNS; or

2. A zone from the following list of DNS zones does not include delegation
to its child zone.

Such zones can include [_ldap._tcp.dc._msdcs.domain1.local], and root zone.

Ask your network/DNS administrator to perform the following actions: To
find out why the SRV record for [domain1.local, local] is not registered in the DNS,
run the dcdiag command prompt tool with the command RegisterInDNS on the
domain controller that did not perform the registration.
        [FATAL] Cannot find DC in domain 'domain1.local'. [ERROR_NO_SUCH_DOMAIN]

DC list test . . . . . . . . . . . : Failed
        'domain1.local': Cannot find DC to get DC list from [test skipped].

Trust relationship test. . . . . . : Skipped

Kerberos test. . . . . . . . . . . : Skipped

LDAP test. . . . . . . . . . . . . : Failed
    Cannot find DC to run LDAP tests on. The error occurred was: The specified domain either does not exist or could not be contacted.

 This computer cannot be joined to the [domain1.local] domain because of one of the
following reasons.

1. The DNS SRV record for [domain1.local] is not registered in DNS; or

2. A zone from the following list of DNS zones does not include delegation
to its child zone.

Such zones can include [_ldap._tcp.dc._msdcs.domain1.local], and root zone.

Ask your network/DNS administrator to perform the following actions: To
find out why the SRV record for [domain1.local, local] is not registered in the DNS,
run the dcdiag command prompt tool with the command RegisterInDNS on the
domain controller that did not perform the registration.
        [WARNING] Cannot find DC in domain 'domain1.local'. [ERROR_NO_SUCH_DOMAIN]

Bindings test. . . . . . . . . . . : Passed

WAN configuration test . . . . . . : Skipped
    No active remote access connections.

Modem diagnostics test . . . . . . : Passed

Netware configuration
    You are not logged in to your preferred server .
    Netware User Name. . . . . . . :
    Netware Server Name. . . . . . :
    Netware Tree Name. . . . . . . :
    Netware Workstation Context. . :

IP Security test . . . . . . . . . : Passed
    Service status  is: Started
    Service startup is: Automatic
    IPSec service is available, but no policy is assigned or active
    Note: run "ipseccmd /?" for more detailed information

The command completed successfully

On the server SRV
C:\Documents and Settings\Administrator>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection 2:

   Connection-specific DNS Suffix  . :
   IP Address. . . . . . . . . . . . : 192.168.1.21
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

C:\Documents and Settings\Administrator>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : srv
   Primary Dns Suffix  . . . . . . . : domain1.local
   Node Type . . . . . . . . . . . . : Unknown
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : domain1.local

Ethernet adapter Local Area Connection 2:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : NVIDIA nForce Networking Controller
   Physical Address. . . . . . . . . : 00-21-70-16-F5-6E
   DHCP Enabled. . . . . . . . . . . : No
   IP Address. . . . . . . . . . . . : 192.168.1.21
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1
   DNS Servers . . . . . . . . . . . : 192.168.1.21

C:\Documents and Settings\Administrator>nslookup domain1.local
Server:  srv.domain1.local
Address:  192.168.1.21

Name:    domain1.local
Address:  192.168.1.21

C:\Documents and Settings\Administrator>nslookup
Default Server:  srv.domain1.local
Address:  192.168.1.21

> server 192.168.1.21
Default Server:  srv.domain1.local
Address:  192.168.1.21

> ls domain1.local
[srv.domain1.local]
*** Can't list domain domain1.local: Query refused
The DNS server refused to transfer the zone domain1.local to your computer. If
this
is incorrect, check the zone transfer security settings for domain1.local on th
e DNS
server at IP address 192.168.1.21.
> ^C
C:\Documents and Settings\Administrator>ping domain1.local

Pinging domain1.local [192.168.1.21] with 32 bytes of data:

Reply from 192.168.1.21: bytes=32 time<1ms TTL=128
Reply from 192.168.1.21: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.21:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
^C
C:\Documents and Settings\Administrator>

Then running dcdiag.exe:
Domain Controller Diagnosis
Performing initial setup:
   Done gathering initial info.
Doing initial required tests
Testing server: Default-First-Site-Name\SRV
      Starting test: Connectivity
         ......................... SRV passed test Connectivity
Doing primary tests
   Testing server: Default-First-Site-Name\SRV
      Starting test: Replications
         ......................... SRV passed test Replications
      Starting test: NCSecDesc
         ......................... SRV passed test NCSecDesc
      Starting test: NetLogons
         ......................... SRV passed test NetLogons
      Starting test: Advertising
         ......................... SRV passed test Advertising
      Starting test: KnowsOfRoleHolders
         ......................... SRV passed test KnowsOfRoleHolders
      Starting test: RidManager
         ......................... SRV passed test RidManager
      Starting test: MachineAccount
         ......................... SRV passed test MachineAccount
      Starting test: Services
         ......................... SRV passed test Services
      Starting test: ObjectsReplicated
         ......................... SRV passed test ObjectsReplicated
      Starting test: frssysvol
         ......................... SRV passed test frssysvol
      Starting test: frsevent
         There are warning or error events within the last 24 hours after the          SYSVOL has been shared.  Failing SYSVOL replication problems may cause          Group Policy problems.
         ......................... SRV failed test frsevent
      Starting test: kccevent
         ......................... SRV passed test kccevent
      Starting test: systemlog
         An Error Event occured.  EventID: 0xC0002715
            Time Generated: 04/12/2010   13:35:18
            (Event String could not be retrieved)
         An Error Event occured.  EventID: 0xC0001B7A
            Time Generated: 04/12/2010   13:45:27
            (Event String could not be retrieved)
         ......................... SRV failed test systemlog
      Starting test: VerifyReferences
         ......................... SRV passed test VerifyReferences

   Running partition tests on : ForestDnsZones
      Starting test: CrossRefValidation
         ......................... ForestDnsZones passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... ForestDnsZones passed test CheckSDRefDom

   Running partition tests on : DomainDnsZones
      Starting test: CrossRefValidation
         ......................... DomainDnsZones passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... DomainDnsZones passed test CheckSDRefDom

   Running partition tests on : Schema
      Starting test: CrossRefValidation
         ......................... Schema passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... Schema passed test CheckSDRefDom

   Running partition tests on : Configuration
      Starting test: CrossRefValidation
         ......................... Configuration passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... Configuration passed test CheckSDRefDom

   Running partition tests on : stmartin
      Starting test: CrossRefValidation
         ......................... stmartin passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... stmartin passed test CheckSDRefDom

   Running enterprise tests on : domain1.local
      Starting test: Intersite
         ......................... domain1.local passed test Intersite
      Starting test: FsmoCheck
         ......................... domain1.local passed test FsmoCheck

and then netdiag /d:domain1.local:
....................................

    Computer Name: SRV
    DNS Host Name: SRV.domain1.local
    System info : Microsoft Windows Server 2003 (Build 3790)
    Processor : x86 Family 15 Model 127 Stepping 2, AuthenticAMD
    List of installed hotfixes :
        KB923561
        KB924667-v2
        KB925398_WMP64
        KB925902-v2
        KB927891
        KB929123
        KB930178
        KB932168
        KB933854
        KB938127
        KB941569
        KB943055
        KB943460
        KB944338-v2
        KB944653
        KB945553
        KB946026
        KB948496
        KB950762
        KB950974
        KB951066
        KB951748
        KB952004
        KB952069
        KB952954
        KB953298
        KB954155
        KB954550-v5
        KB955069
        KB955759
        KB956572
        KB956802
        KB956803
        KB956844
        KB957097
        KB958469
        KB958644
        KB958687
        KB958869
        KB959426
        KB960225
        KB960803
        KB960859
        KB961063
        KB961118
        KB961501
        KB967715
        KB967723
        KB968389
        KB968816
        KB969059
        KB969947
        KB970238
        KB970430
        KB971032
        KB971486
        KB971557
        KB971633
        KB971657
        KB971737
        KB971961
        KB972270
        KB973037
        KB973354
        KB973507
        KB973525
        KB973540
        KB973687
        KB973815
        KB973869
        KB973904
        KB974112
        KB974318
        KB974392
        KB974571
        KB975025
        KB975467
        KB976098-v2
        KB976325
        KB978207
        Q147222

Netcard queries test . . . . . . . : Passed
    [WARNING] The net card 'RAS Async Adapter' may not be working because it has not received any packets.

Per interface results:

    Adapter : Local Area Connection 2

        Netcard queries test . . . : Passed

        Host Name. . . . . . . . . : SRV
        IP Address . . . . . . . . : 192.168.1.21
        Subnet Mask. . . . . . . . : 255.255.255.0
        Default Gateway. . . . . . : 192.168.1.1
        Dns Servers. . . . . . . . : 192.168.1.21

        AutoConfiguration results. . . . . . : Passed

        Default gateway test . . . : Passed

        NetBT name test. . . . . . : Passed
        [WARNING] At least one of the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names is missing.
            No remote names have been found.

        WINS service test. . . . . : Skipped
            There are no WINS servers configured for this interface.

Global results:

Domain membership test . . . . . . : Passed

NetBT transports test. . . . . . . : Passed
    List of NetBt transports currently configured:
        NetBT_Tcpip_{04BB0F6B-06AE-4D60-80C8-2A7A24C1D87B}
    1 NetBt transport currently configured.

Autonet address test . . . . . . . : Passed

IP loopback ping test. . . . . . . : Passed

Default gateway test . . . . . . . : Passed

NetBT name test. . . . . . . . . . : Passed
    [WARNING] You don't have a single interface with the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names defined.

Winsock test . . . . . . . . . . . : Passed

DNS test . . . . . . . . . . . . . : Passed
    PASS - All the DNS entries for DC are registered on DNS server '192.168.1.21' and other DCs also have some of the names registered.

Redir and Browser test . . . . . . : Passed
    List of NetBt transports currently bound to the Redir
        NetBT_Tcpip_{04BB0F6B-06AE-4D60-80C8-2A7A24C1D87B}
    The redir is bound to 1 NetBt transport.

    List of NetBt transports currently bound to the browser
        NetBT_Tcpip_{04BB0F6B-06AE-4D60-80C8-2A7A24C1D87B}
    The browser is bound to 1 NetBt transport.

DC discovery test. . . . . . . . . : Passed

DC list test . . . . . . . . . . . : Passed

Trust relationship test. . . . . . : Skipped

Kerberos test. . . . . . . . . . . : Passed

LDAP test. . . . . . . . . . . . . : Passed

Bindings test. . . . . . . . . . . : Passed

WAN configuration test . . . . . . : Skipped
    No active remote access connections.

Modem diagnostics test . . . . . . : Passed

IP Security test . . . . . . . . . : Skipped

    Note: run "netsh ipsec dynamic show /?" for more detailed information

The command completed successfully

Answer: I think you'll find the key may lie here:
[WARNING] The DNS entries for this DC are not registered correctly on DNS server '184.108.40.206'. Please wait for 30 minutes for DNS server replication.
Is that your public ISP DNS server? If so, then this is the wrong DNS server to be using.

There should be a DNS server somewhere in your AD (It's usually on your Domain Controller if you only have one)
The Domain Controller should have its DNS pointing to itself
The client machines should have their DNS pointing to the IP address of your internal DNS server (e.g. your domain controller)

Your ISP's DNS server will not be used inside a normal AD network.
Edit: I just saw your update. You must have posted it while I was writing my answer. Ensure that Step 3 has been implemented as well.
Comment: I set the client's dns ip address located in the nic ip settings and the same result occurred.  unable to find fqdn and pinging domain1.local didn't work as well.  It was able to surf the web though.
Comment: @phill - When you run `nslookup` it should give you a `default server` and `address` - do these match your **internal** DNS server?
Comment: it does give me the default server ip address when i run nslookup.. thanks
Comment: @Phill, I'm not sure what you mean by "default server ip address" - do you mean that it IS pointing to your internal DNS (e.g. `192.168.0.1`), or it is pointing elsewhere?
Comment: sorry about that, the network only has one DC with the DNS/AD on it and it returns 192.168.1.21 however it doesn't return its corresponding hostname
Comment: Not returning the hostname isn't always a bad thing, it just means that the DNS server does not have a PTR record for the IP address, which should not affect this functionality in any way. If the nslookup on the client is displaying the internal DNS, but it can't lookup your domain name, then I'd say there's much bigger issues at play. Can the DNS on the client machine resolve ANYTHING with `nslookup`?
Comment: it is unable to resolve anything locally, however the machine is able to browse the internet.
Comment: Is this just a single machine, no one else is having these problems? Some malware can play tricks with the dns client...
Comment: the other clients are unable to resolve the dns hostname and domain name as well. I didn't want to risk trying to disjoin the other workstations from the network.
Comment: Do you have any errors in the event logs on your DC? Do you allow unsecure DNS updates on your AD zone?
Comment: It is set to "secure only" updates.  I will post any error messages above.
Answer: You said 'rejoin' the machine. Are the old DNS records for the system still in the zone? Do the current domain controllers only have their own IP's listed for their DNS servers? Did you remove the old computer account before you attempted to rejoin? Is the name of the server the same as it was before you unjoined? You may have some stale information in AD if so. Check all the SRV records in DNS, make sure they resolve to what they should resolve to. If you see any 'Unknown Accounts' on the ACL's for any of those records, delete them and run 'ipconfig /registerdns' from the machine that should hold them.
Comment: I have deleted all entires in the dns as well as in active directory under the computers object.  This didn't seem to help either.  I also went to the client and ran 'ipconfig /registerdns' and still got the same result.
Answer: Figured it out.  The firewall on the nic got turned on for some reason.  Once it was disabled, everything worked just fine.  Go figure.

Windows 2003 server: can't join domain


Why is 'Narrative Music' not considered 'complete/absolute'?

Question: I have recently become obsessed with HECTOR BERLIOZ. His Symphonie Fantastique is tremendous. This made me research him further when I was disturbed to find out the following:

Only 'absolute music' is the most profound music. Programme music, narrative music is of lesser quality

Now, the question I am asking is I fear, too broad, but I cannot think of people better to share it with, than you.
What do we mean by this? The Gentleman in the clip says, "we often hear statements...", perhaps I have not looked into Musical Form very much but I certainly haven't heard this. More to the point, didn't the whole Romantic era consist of motifs and themes that often attempted to describe the feelings and thoughts of the composer? This could easily be described as their narrative? BERLIOZ aside, composers, like literary writers, wrote about what they knew. Didn't Pathétique Symphony No.6 by Tchaikovsky teach us this? If you think of the whole Romantic era, it was huge, many composers often attempted to try and convey their very thoughts. Isn't this what the Principal Conductor Esa-Pekka Salonen is saying. How bizarre it is that people feel Programme music is not 'complete'?
I am about to ridicule myself terribly but music is music, no? If it's great, it is great. Why should we let musical form get in the way of this?  There is no way we should - is there? So how does he have a point here?
Comment: The guy in the video seems to agree with you - he says he finds the distinction "idiotic". Do you have a link to someone coherently defending the position that narrative music is of lesser quality?
Comment: @topoReinstateMonica I'm afraid I don't, I do take your point, however, but why would he have said it? That's what I'm asking, like my last sentence. How does he have a point?
Answer: Esa-Pekka Salonen is  setting up a 'straw man' argument, so that he can defeat it.
When Berlioz was new kid on the block, doubtless his innovations were criticised simply because they WERE innovations.   Innovations generally are!   And there may be people even today who feel the Symphony reached its height with Beethoven, and subsequent use of the term for less firmly structured music was sacrilege.   (Though they might have to admit the first cracks appeared with the programmatic elements in Beethoven's own 6th Symphony.)
But it's not a widely-enough held opinion to be worth worrying about, other than as a rhetorical device - and that's all that Salonen really uses it as.
Comment: Don't you think Renaissance madrigals and Monteverdi's Operas have been programmatic too?
Comment: Certainly.  But they didn't claim 'Symphony' status.
Comment: Sorry to come back to this @LaurencePayne but you say "it is not a widely enough held opinion to worry about". In his video, however, he does say "you often hear people say.." What *kind* of people would say this?
Comment: Ignorant people?  Musical snobs?
Answer:
What do we mean by this?

We don't mean anything by this, because this is just an opinion of certain idealistic authorities. It is rather a philosophical claim which nobody can proof.
You could extend this thesis that music is not absolute if you can see the musicians or the conductor.
I could claim that absolute music is only the idea, the invention of motifs and themes, only the notation. As soon that it is performed music is narrative, as the performers and the conductor always will tell us more than the written text.
And also the audience, every listener has his own associations and imaginations!
So, shortly, the assumption that program music has less value than absolute music - in my opinion - is nonsense.

Is Beethovens Pastorale less  precious than his Symphony No. 5?

Many people have a better approach to music by the help of a story of a play: Die Zauberflöte, Peter and the Wulf, Pictures of an Exhibition, even Handel's Messiah, Bachs Passions of St. Mathew and St. John have a plot. But the  music with or without text remains the same.

The perception is different: If someone listens to narrative music
without knowing the background story this music is absolute. But if
you have the lyrics of a song, the libretto of an Opera, or a great
performance, a perfect transmission ... the music will be complete!

Mind that music is always performed in a social context and all these variables like audience, artists, conductor, room,   (concert hall, church, open air) are changing and influencing the perception of music.
Answer: For further research the standard terms may be useful: Program music vs Absolute music. Program music, which is probably what you mean by "narrative music" is music that tries to describe something besides the music, and absolute music is just the opposite in that it is music that it doesn't aim to portray any story.
Given that all songs, oratorios and operas belong to the former, this can be hardly considered as niche repertoire.
I see there's no difference of quality, but your mileage may vary.
Answer: Children are always told to do a painting of something. If, as adults, they then come across an abstract painting they may ask, 'But what is it a painting of?'
When children are first introduced to classical music (if they ever are nowadays) they are often played recordings of Rameau's La Poule, Berlioz's March to the Scaffold or Smetana's Vltava: music which is ABOUT something. You can picture the hen, the guillotine or the river. And for most people, even as adults, that's what they want: a picture or a story. They buy The Four Seasons and picture the snow. Vaughan-Williams's tedious Lark Ascending was recently voted the UK's favourite classical piece. (I've re-worked it for violin, orchestra and shotgun, but sadly it has yet to be performed.)
But as well as pictures and stories, composers have always been interested in form and in the development of the material. Bach's music is often technically mind-blowing. It is profound in the sense that if you look into it deeply you can see how wonderfully it is made. There are poems that are 'profound' in exactly the same way. "Do not go gentle into that good night", for example.
No-one needs to look into it deeply. Most people don't.
Form alone can't make a piece of music attractive. I've never liked Bruckner's symphonies. Although there's a great deal of formal innovation going on it doesn't make up for the tedious melodies and orchestration.
Most composers and painters enjoy playing with colours as much as children do, and the twentieth century was full of wild, colourful music. A programme was never a prerequisite.
Btw(1), I was a bit obsessed with Berlioz too for a while. He writes great letters. I'd like to have known him.
Btw(2), I think describing the music of Romantic era composers as their narratives may be a misapplication of a modern concept.
Comment: I was only first introduced to "March to the Scaffold" and "Vltava" in *music history class* when I was in my teens. I have no memory of bring introduced to "La Poule" at all, and I wouldn't recognize that piece if I listened to it. I was exposed to the absolute-music "Eine Kleine Nachtmusik" and Bach's inventions first, as a child. I don't believe your statement that "When children are first introduced to classical music...they are often played recordings of...La Poule...March to the Scaffold or...Vltava"--those sound like pieces first exposed to children by chance on radio stations at best.
Answer:
Why is 'Narrative Music' not considered 'complete/absolute'?

To answer your title question, program music, which is probably what you mean by narrative music, is not considered absolute music because that is essentially how the terms are defined. Program music is music that tries to describe something and absolute music doesn't.
Regarding the term "complete", that seems to be entirely a value judgement and not an specific musical term. In that case, I can't say, other than that it's some people's opinion, and I am not those people.
Comment: Searching for the term "complete music" in my search engine just gives the name of an album. So I was trying to say that "complete music" is not a specific musical term unlike absolute music.
Comment: @cmp - Like awe lotta, I'd like a source for the term "complete music" being similar to the term "absolute music". Even entering '"complete music" -album definition' into Google returned no results displaying the definition of "complete music" on its first page for me.
Comment: Complete and absolute are very closely related. Check it. I'm afraid your answer has hot helped comprehend his tough and difficult proposition.
Comment: Complete and absolute, those words are very closely related. Nonetheless, thanks for your contribution.
Comment: @Dekkadeci I'm saying music aside (ironic I know) the two words Absolute and Complete are very closely related.
Comment: @cmp the relationship between the words "complete" and "absolute" is not particularly relevant.  There is a term "absolute music" which denotes, by definition, music with no programmatic (i.e. narrative) content.  This answer simply points out that the question misinterprets the phrase "absolute music" by substituting "complete" for "absolute."  If you want to ask why the word "absolute" is was chosen to denote music with no programmatic content, by all means do so, but don't ask why program music is considered incomplete, because it isn't.
Answer: This is a very old and rather huge debate, so let me try to hit on some important historical context.
Aesthetics, as the modern philosophical discipline we now understand, was developed in the late 18th and early 19th centuries, particularly among a group of German philosophers.  At that time, vocal music -- which had specific meaning ascribed through words -- was generally perceived of as the best music.  Instrumental music (like symphonies and concertos) was often deemed inferior, as it lacked meaning.  See, for example, Immanuel Kant's Critique of Judgment (an important early philosophical treatise on aesthetics), where Kant classifies various types of art into categories about how beautiful they can be, whether they can express "sublime" elements, etc.   Kant places instrumental music on par with wallpaper in his classification, which is insightful given the time he was writing: a classical symphony was often something to almost be enjoyed as background music at a palace function, with the orchestra playing while nobles chatted.  It wasn't the sort of "high art" where everyone always sat down quietly and in rapt attention to listen as we do at classical concerts today.
Another useful bit of background information is Kant's distinction between two words of ideas -- the phenomenal (accessible to our senses) and the noumenal (the realm of pure ideas, from the Greek word nous which means mind/spirit).  The ideal version of knowledge -- and by extension aesthetic appreciation -- was to understand the noumenal world, as philosophers seek to do, to not see the particular physical manifestations of "beauty," but rather to understand "beauty itself" as a higher abstraction.
This is relevant because the view of instrumental music began to shift around the time of Beethoven, when several philosophers began to argue that the very lack of words or specific verbal ideas in Beethoven's instrumental music meant they could tap into an even more sublime and more profound meaning.  Today, the most well-known article in that regard is E.T.A. Hoffman's review of Beethoven's Fifth Symphony.  As Hoffman writes:

Thus [Beethoven] is a purely romantic composer, and if he has had less
success with vocal music, is this because vocal music excludes the
character of indefinite longing and represents the emotions, which
come from the realm of the infinite, only by the definite affects of
words?

In other words, Beethoven's symphony is "pure" Romanticism, able to portray depths of ideas that tap into the "realm of the infinite" (sort of like Kant's noumenal realm of pure ideas).  When Beethoven tries to write vocal music, he doesn't have as much success, as the "definite aspects of words" are just a simple particular manifestation of ideas, not the eternal, "infinite" pure world of aesthetic appreciation created by absolute instrumental music.
Many philosophers and music critics of the early 1800s, particularly in Germanic lands, came to view music in this fashion.  One very notable figure in the debate was music critic Eduard Hanslick who wrote a prominent philosophical pamphlet called On the Musically Beautiful in 1854.  Hanslick took earlier ideas to a more extreme degree, arguing for what is usually called formalism in music aesthetics -- that is, that the power of music comes purely from the form of the sounds and their interactions, not from any verbal meaning (in vocal music) or any supposed "narrative" (whether in actual vocal text or implied in representation, as in the question's Berlioz example).  Famously, Hanslick and Wagner were enemies, because Wagner believed in the power of Leitmotifs to represent specific people, things, places, and ideas in his operas, even when performed only by instruments without text.  Hanslick thought that perspective was absurd and that pure "absolute" music, like those Beethoven symphonies, achieved the highest form of musical art by being divorced from text and a narrative meaning.
This argument has gone on ever since, with many composers taking firm stances on one side or the other.  For example, Stravinsky notoriously changed his perspective on Rite of Spring -- a work originally composed to go with a specific narrative and accompanied by a rather novel ballet with very rustic choreography (to put it mildly).  But later in life, Stravinsky distanced himself from programs and argued that the beauty of Rite of Spring should be best understood in a pure concert form, only instrumental, without the ballet and really not even meant to be a specific representation of the narrative.
The question is right to note that another part of Romanticist aesthetics was about the power of narrative expression.  And people like Wagner embraced that to an extreme degree.  The formalists, on the other hand, thought that the greatest aesthetic power in music could only be achieved through abstraction.
There are relatively few adherents of the formalist school these days, who would strongly argue that only pure instrumental music without any text or narrative is the highest form of art.  But the idea of absolute music has a very long and important place in the history of aesthetics, which is what is being alluded to in the video in the question.


Prove that four points lie on a circle.

Question: Let $ABC$ be a triangle such that $2AB=AC+BC$. Show that the incentre, the circumcircle, midpoint of $AC$ and midpoint of $BC$ lie on a circle.
I reduced the question to prove that both midpoints, incentre and vertex $C$ lie on a circle. So we have to prove that $\angle{MIN}=180-\angle{C}$. But I am not getting this.
Comment: You must have meant circumcenter, I hope?
Answer: Let the midpoints of $CB$ and $CA$ be $A'$ and $B'$. Now we place a point on $D$ on $AB$ such that  $AD=AB'$.  And as $2c=a+b$, we also have $BD=BA'$.
Thus, by SAS congruence, $\triangle BIA'\cong \triangle BID$ and $\triangle AIB'\cong \triangle AID$. Thus, $\angle BDI= \angle IA'B$ and $\angle ADI =\angle IB'A$. Hence, $\angle IB'A=180^{\circ}-\angle IA'B=\angle IA'C$.
Thus, $C$, $B'$, $A'$ and $I$ lie on a circle.

Prove that four points lie on a circle.


How should I interpret this sampler?

Question: Assuming $\theta$ and $d$ are given and the following proportionality exists,
$$P(\psi)\propto\prod_{i=0}^{100} \theta^{\psi_{i}}\times id^{1-\psi_{i}}\Rightarrow$$
one can assume that $\psi $ is Bernoulli distributed with the following form,
$$\psi_i\sim Bernoulli(\frac{\theta}{\theta+id})$$
but then how should I sample $\psi$? Should I sample a $\psi$ for each $i$? Then how would I get to the final sample for $\psi$?
Comment: This is how I understand it... Could you provide reference for it and/or full quote describing it?
Comment: eq 36 and 37 of this http://www.stats.ox.ac.uk/~teh/research/compling/hpylm.pdf
Answer: If I understand your equations correctly, it translates to the following procedure (as coded in R):
u <- runif(101)                                # draw from uniform distribution
phi_i <- as.numeric(u < theta/(theta + 0:100)) # Bernoulli draw
phi <- prod(theta^phi_i * (d*(0:100))^(1-phi_i))

So you draw each phi_i from Bernoulli distribution with different probabilities depending on theta and i and then follow the deterministic procedure to calculate your outcome.
You can notice that Bernoulli random variable serves here as a shorthand to say "take $\theta$ with probability $\tfrac{\theta}{\theta+id}$ or $id$ with probability $1 - \tfrac{\theta}{\theta+id}$" since it has only $\{0,1\}$ values, so everything to their power will be either $1$ or it's own value.

How should I interpret this sampler?


Understanding generics in Java

Question: Can someone explain to me what this code is doing, I am new to java.
Queue <TreeNode> queue = new LinkedList<TreeNode>();

I believe this code creates a Queue with the variable name queue that is of type TreeNode, what does the right side mean? Is it assigning the Queue to be a Linked List of type TreeNode?
Comment: @Nemus that hardly applies here.
Comment: Possible duplicate of [How to create a generic array in Java?](http://stackoverflow.com/questions/529085/how-to-create-a-generic-array-in-java)
Comment: You have multiple things happening here.  Generics is one of them.  The left hand type `Queue` is an _interface_, or a pattern of behavior which classes implement.  The RHS type `LinkedList` is an _implementation_ of a queue.
Comment: Yes. A `LinkedList` is a queue. [java.util.LinkedList](https://docs.oracle.com/javase/7/docs/api/java/util/LinkedList.html)
Comment: ah gotcha thank you @TimBiegeleisen
Comment: Yes, that sounds right.  Since you defined your list to use `TreeNode` then if later in the code you try to stuff some other type into it, you will get a compiler error.  Type safety is one things which generics are there for.
Comment: Possible duplicate of [What are Generics in Java?](https://stackoverflow.com/questions/7815528/what-are-generics-in-java)
Answer: Class java.util.Queue uses type parameters to assure that you won't add type other than it was created with.
If you create Queue like:
Queue <TreeNode> queue = new LinkedList<TreeNode>();

It means queue can store only TreeNode objects. This is used for type checking in methods add,offer,remove,poll.
Answer: A Generic allows you to specify what type of reference a DataStructure will store. In your example the List will variables of type TreeNode.
But you can store any type, including your own user defined types such as classes.
Comment: A list doesn't contain variables, it contains references.
Comment: The reference of the type it stores
Answer: The link below describes what a generic is in Java and why they are used.
https://docs.oracle.com/javase/tutorial/java/generics/why.html
By Using generics we make sure the type safety of our objects.
In your question
Queue <TreeNode> queue = new LinkedList<TreeNode>();

you have created queue with generic type "TreeNode". So it'll allow only those objects which will instanceOf "TreeNode" class.
Answer: Yes to understand this you must have at least little understanding of generics in java. The generics are very important feature of java and java collection framework use this feature in full form. Let me describe your statement given below.
Queue <TreeNode> queue = new LinkedList<TreeNode>();

Here First thing to be notice is that almost all collection classes and interface are generic in nature. That means they can store any type of data in them. See the below example.
List list = new ArrayList();

    String sObj = "stringObj";
    Integer iObj = 1;
    MainTest classObj = new MainTest();

    list.add(sObj); //Storing string
    list.add(iObj); // Stroing int
    list.add(classObj); //Storing class object

Here you can see that i have created a ArrayList and referenced it through a List reference variable. Here you can notice this i have not metioned any class here so by default it will store all object types of objects. Now if we come to your code that means you are restricting the collection to store only one type of objects which is TreeaNode .So that any other type of object will be added in this collection any more. In you statement in left side you are Creating a reference variable with name queue whose data type is Queue of TreeNode while on right side you are assigning a object of LinkedList which can store only TreeNode objects int to you queue reference variable.That means you queue will not be allowed to add any object in it excluding TreeNode. This assignment is possible both classes Queue and LinkedList implements Collection interface.

Understanding generics in Java


Counting Radio Button Not Working

Question: I'm writing an app with over 100 Q/A Flashcards and have added traffic light buttons to allow user to reflect on how well they understand each question/answer.
<form>
<fieldset data-role="controlgroup" data-theme="b" data-type="horizontal" data-mini="true">
    <legend>Rate your understanding</legend>
    <input type="radio" name="traffic-lights" class="red" id="red" value="on" checked="checked">

    <input type="radio" name="traffic-lights" class= "orange" id="orange" value="off">

    <input type="radio" name="traffic-lights" class="green" id="green" value="other">

</fieldset>

The script is:
 $(document).ready(function () {
$(".red,.orange,.green").change(function () {
    $('.red_results').text($('.red:checked').length);
    $('.orange_results').text($('.orange:checked').length);
    $('.green_results').text($('.green:checked').length);
});

});
To finish off I'd like to record the number of red/orange/green button clicks.

0  0  0

I've based it on a number of similar examples on stack overflow, mainly Counting Checked Radio Buttons with jQuery.
I've got it working perfectly on jsfiddle, http://jsfiddle.net/ginneswatsonkelso/k1u2f56o/1/ but doesn't work within my app.
The js I'm using are jquery-1.6.4.min.js, jquery.mobile-1.0.min.js and jquery-1.11.3.js and it works with all 3 on jsfiddle.
Presumably, I've done something wrong but I just can't see it.
The rest of my  is

Comment: Sorry, I posted the wrong link. Should have been http://jsfiddle.net/ginneswatsonkelso/k1u2f56o/1/
Comment: Uhh, it's working for me when I open your JSFiddle link.
Comment: Thanks NealC, but that's the problem. It works perfectly on JSFiddle and I can't understand why it will not still work within my app page.
Comment: Ah, my bad. Can we see more HTML? Unless Lyndsey solved your problem already. Like `` for example?
Comment: Could you edit your question and change the link there, please? Are you using the same version of jQuery in the app as on the fiddle?
Comment: Wrong link corrected. Tried it with all 3 jQuery versions listed originally and it worked each time. Also tried with script in head and in body of html and again it worked each time on jsfiddle. As may be obvious, I'm very far from an expert and am quite likely making some basic mistake.
Comment:  is
Comment: don't post code in comments..update question itself. Do elements exist when code is run or are they part of ajax import? If import use `delegate()` to bind to ancestor that exists at run time
Comment: Thanks charlietfl - very new to this. I'd looked at examples using ajax but was well out of my depth. As far as I can tell, the example I'm basing my example on doesn't use ajax.
Comment: any errors thrown in browser console?
Comment: Console in Safari says no errors. Bizarrely, Firefox comes up with "Use of getPreventDefault() is deprecated.  Use defaultPrevented instead."However, according to Dreamweaver, I don't have this anywhere, though it rings a bell from a previous discarded attempt.
Comment: Some progress. If I remove jQuery 1.6.4 then it works fine, but everything else is screwed up.
Comment: Then you're probably messing something up with some jquery calls in your code. And if this code still works (which requires jquery) you're probably loading multuple libraries/versions of jquery. Have you tried stepping through your function and seeing if it calls/where it breaks?
Comment: Thanks Jan. You're right in that I'm loading jquery-1.6.4.min.js, jquery.mobile-1.0.min.js and jquery-1.11.3.js. I'll have to try and simplify things.
Answer: The jQuery on() event was brought in with jQuery version 1.7.
The version of jQuery you are running does not support the on() method. Previous versions of jQuery required .live() or .delegate(), with the latter being the preferred method for event delegation.
If you are able to, you should look into updating your version of jQuery to use more up-to-date features.
Comment: Thanks LyndseyB. Not sure where the on() event is appearing in my code. Also it seems to work fine on jsfiddle with jQuery 1.6.4.
Comment: I referred to the JsFiddle you linked to: http://jsfiddle.net/A8tZd/ which uses the on() method. I can now see that you've posted a link to the relevant example.

Counting Radio Button Not Working


Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension

Question: 20-BED8-37C2EE174CFE/Runner.app/Frameworks/OneSignalExtension.framework/OneSignalExtension' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/OneSignalExtension.framework/OneSignalExtension' (no such file)
Library not loaded: @rpath/OneSignalExtension.framework/OneSignalExtension
Answer: I had the same issue in my Flutter project version 2.10.3. I solved it by upgrading the project to version 3.3.10. I hope this information may be helpful to you.
Answer: Under Targets, click your app name. Include OneSignalExtension.xcframework in Framework, Library and Embedded Content.
Answer: Works fine with 'OneSignalXCFramework', '3.4.0'


Equivalence of two definitions of probability?

Question: Consider the probability space $(\Omega,\mathcal{F},\mathbb{P})$, where $\mathbb{P}$ is defined as : $\mathbb{P}:\mathcal{F} \rightarrow [0,1]$ satisfies
$$ (D1)\\~\mathbb{P}(\Omega)=1 \\~ \text{if}~ A_n\in \mathcal{F}, A_i \cap A_j=\phi, i \neq j ~\text{then}~ \mathbb{P} \left( \cup A_n \right)=\sum \mathbb{P}(A_n) $$
I found another definition of $\mathbb{P}$ satisfying the axioms :
$$(D2)\\\mathbb{P}(\Omega)=1 \\\mathbb{P} \left(A_1 \cup A_2 \right)=\mathbb{P}(A_1)+\mathbb{P}(A_2), A_1,A_2 \in \mathcal{F}, A_1 \cap A_2 =\phi
 \\ \text{If}~A_n ~\text{is decreasing}~ \mathbb{P} \left(\cup A_n\right)= \lim \mathbb{P}(A_n)$$
How these two definitions are equivalent? i.e $(D1) \iff (D2)$ ?
Comment: There seems to be a mistake in your D2.  Either "decreasing" should be "increasing", or else $\cup$ should be $\cap$.
Comment: But with that correction, yes, they are equivalent.  Please tell us what you tried in attempting to prove this.
Comment: @NateEldredge i was thinking of taking a family of disjoint sets $\{B_i : i \ge 1 \}$ i.e $B_1=A_11, B_2=A_2 \setminus A_1, B_3=A_3 \setminus A_1 \cup A_2 ...$ then taking union over them and use and set equality condition, then im unable to proceed
Answer: Hints:
(i) $\underset{n\in \mathbb{N}}{\cup}A_n= \underset{N\rightarrow \infty}{\lim}\Big( \underset{n=1}{\overset{N}{\bigcup}}A_n \Big)$
(ii) $\mathbb{P}\Bigg(  \underset{n=1}{\overset{N}{\bigcup}}A_n\Bigg)= \sum \limits_{n=1}^N\mathbb{P}(B_n)$ in both definitions, given your what you wrote as $B_n$ in the comments
(iii) $ \underset{n=1}{\overset{N}{\bigcup}}A_n$ is an increasing event for any sequence of events $\{ A_n\} $


Utilizar Datepart como parâmetro de Query

Question: Estou desenvolvendo um sistema e estou esbarrando em uma consulta SQL que consiste em o usuário pesquisar por Data e terá a opção de escolher se a consulta será feita adicionando Final de Semana a essas datas, excluindo o final de semana ou só consultando o Final de Semana.
No caso, tenho uma View que será usada para esta aplicação. O problema é que ela não tem um campo específico para o dia da semana, então tive que fazer um DatePart.
O problema é que quando eu utilizo com outros elementos da consulta, da erro nela.
Já tentei dentro da Query, com Join, com Union, com Having, criando um Banco auxiliar para comparar e nada. Alguém poderia me explicar de como isso poderia ser feito?
Segue abaixo o código das duas tabelas.
SELECT [DT_ABERT_OPER], DATEPART(weekday, [DT_ABERT_OPER]) AS
DIA_DA_SEMANA
FROM [dbo].[reavw001_ocorrencias_xxxxx] WHERE [DT_ABERT_OPER]
BETWEEN '2017-11-03' AND '2017-11-05'

No Caso, fiz essa consulta teste para retornar o DatePart dos dias 03 ao 05. Retornou 6 para as ocorrências do dia 03(Sexta), 7 para as do dia 4(Sábado) e 1 para o Domingo, o problema é que a consulta final será uma média destas ocorrências e o total de horas que ela ficou fora. E nisso, o dia da semana não está se encaixando.
Segue abaixo a consulta final que preciso encaixar a escolha de Final de Semana.
SELECT GITEC,   SUM (DATEDIFF (minute,INICIO,DH_ULTIMA_CATEGORIZACAO))
as Soma_tempo,
AVG (DATEDIFF (minute,INICIO,DH_ULTIMA_CATEGORIZACAO)) as Media_tempo
FROM [readb004].[dbo].[reavw001_ocorrencias_xxxxxx] WHERE
([DT_ABERT_OPER]
BETWEEN '2017-11-03' AND '2017-11-06 23:59:59') GROUP BY GITEC order
by GITEC DESC

O que poderá ser feito para solucionara isso? Uma procedure ou tem algum outro jeito?
Answer: Como você quer buscar utilizando os dias da semana, pode tratar o DATEPART como um inteiro.
No caso da busca para dias da semana:
SELECT *
  FROM view v
 WHERE DATEPART(WEEKDAY, v.data) NOT IN (7, 1) -- Qualquer dia que não seja Sábado ou Domingo

Caso queira apenas os fins de semana:
SELECT *
  FROM view v
 WHERE DATEPART(WEEKDAY, v.data) IN (7, 1) -- Qualquer dia que seja Sábado ou Domingo

Se quiser trabalhar com variáveis:
DECLARE @opcao INT;

SET @opcao = 1; -- Use 1 para dias da semana, 2 para fins de semana e 3 para todos os dias

SELECT *
FROM view v
WHERE @opcao = 3
  OR (@opcao = 1 AND DATEPART(WEEKDAY, v.data) NOT IN (7, 1))
  OR (@opcao = 2 AND DATEPART(WEEKDAY, v.data) IN (7, 1))

Caso queira adicionar o intervalo de data na consulta acima:
DECLARE @opcao INT;

SET @opcao = 1; -- Use 1 para dias da semana, 2 para fins de semana e 3 para todos os dias

SELECT *
FROM view v
WHERE v.data BETWEEN '2017-11-03' AND '2017-11-06 23:59:59'
 AND (@opcao = 3
  OR (@opcao = 1 AND DATEPART(WEEKDAY, v.data) NOT IN (7, 1))
  OR (@opcao = 2 AND DATEPART(WEEKDAY, v.data) IN (7, 1)))

Comment: O valor retornado por DATEPART(weekday, ...) não é constante para um mesmo dia da semana, pois varia de acordo com a configuração de DATEFIRST. Aliás, isto consta na documentação: "When datepart is week (wk, ww) or weekday (dw), the return value depends on the value that is set by using SET DATEFIRST".
Comment: @JoséDiz sim, e se você ler a pergunta vai ver qual a configuração para caso dele. Mais uma vez, acho que falta a leitura do `downvote` para você, mas se quiser continuar prejudicando todas as respostas que dou, inclusive as de linguagens que você não tem domínio e nem competência para avaliar vou procurar a moderação.
Comment: Deu certo. funcionou perfeitamente


Must declare the scalar variable @Name

Question: I am new to the forum and can usually find answers to problems by looking at other peoples posts  but I seem to be struggling with this one.
SELECT
    PageId, SubjectLink
FROM
    dbo.a_training_page
WHERE
    (NOT EXISTS (SELECT PageId, Name
                 FROM dbo.a_training
                 WHERE (dbo.a_training_page.PageId = dbo.a_training.PageId)
                   AND (Name = @Name)))

I get an error:

Must declare the scalar variable @Name

Any help would be gratefully received
Comment: I mean.....you need to declare the variable `@Name`  that you are using in: `AND (Name = @Name)`. Don't know what else to say, the error message is quite clear
Comment: You need to declare the variable.  I'm assuming it's a varchar, so you'll need something like this: `DECLARE @Name VARCHAR (50) = 'Bob'`
Comment: Not sure what is not clear about the error message here.
Answer: As the error message very clearly states - you must declare any variable (with a leading @) in T-SQL before using it - either just in T-SQL code, or as a parameter for a stored procedure or function.
Try this (and lose quite a few of all those unnecessary parenthesis in your WHERE clause):
DECLARE @Name VARCHAR(100) = 'Brian';

SELECT
    PageId, SubjectLink
FROM
    dbo.a_training_page
WHERE
    NOT EXISTS (SELECT *
                FROM dbo.a_training
                WHERE dbo.a_training_page.PageId = dbo.a_training.PageId
                  AND Name = @Name)

Must declare the scalar variable @Name