text:
Q: Outlook VBA, show meeting series expiring in the next 30 days I am trying to adapt an outlook vba script that shows if a named meeting series is expiring on that day.  I would like to make it look through all my meeting series, and show a reminder message for any when the end date is within the next 30 days.
Here is a start of what I currently have that will work if I supply the one meeting name (TestRecur):
Sub ExtendAppointmentSample()
 Dim myApptItem As Outlook.AppointmentItem
 Dim myRecurrPatt As Outlook.RecurrencePattern
 Dim myNamespace As Outlook.NameSpace
 Dim myFolder As Outlook.Folder
 Dim myItems As Outlook.Items
 Dim QuestionToMessageBox

 QuestionToMessageBox = "Appointment is about to expire, would you like to extend it?"

 Set myNamespace = Application.GetNamespace("MAPI")
 Set myFolder = myNamespace.GetDefaultFolder(olFolderCalendar)
 Set myItems = myFolder.Items
 ' specify the Item Object here but I would like it to cycle through all meeting series and look for those ending within 30 days
 Set myApptItem = myItems.Item("TestRecur")
 Set myRecurrPatt = myApptItem.GetRecurrencePattern

 If myRecurrPatt.PatternEndDate < DateAdd("d", 30, Date) Then
     YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbInformation, "Extend")
    'Next line does not work; not sure how to get each Meeting Title
     'MsgBox (MeetingTitle)

 End If
End Sub

A:
show meeting series expiring in the next 30 days

In that case you need to find all meetings that take place during these 30 days in the calendar. Then you can check their PatternEndDate property value when they ends. To get all calendar items for a specific time frame you can use the Find/FindNext or Restrict methods of the Items class. Read more about these methods in the articles that I wrote for the technical blog:

*

*How To: Retrieve Outlook calendar items using Find and FindNext methods

*How To: Use Restrict method in Outlook to get calendar items
For example, you may use the following code to find appointments for a specific time frame (VB.NET):
Private Sub FindActiveAppointments(folder As Outlook.MAPIFolder)
    Dim dateTimeStart As String = DateTime.Now.ToString("MM/dd/yyyy hh:mm tt")
    Dim dt As DateTime = New DateTime(DateTime.Now.Year, DateTime.Now.Month, _
                                      DateTime.Now.Day, 23, 59, 0, 0)
    Dim dateTimeEnd As String = dt.ToString("MM/dd/yyyy hh:mm tt")
    Dim searchCriteria As String = "[Start]<=""" + dateTimeEnd + """ AND [End]>=""" + _
                                                                dateTimeStart + """"
    Dim strBuilder As StringBuilder = Nothing
    Dim counter As Integer = 0
    Dim appItem As Outlook._AppointmentItem = Nothing
    Dim folderItems As Outlook.Items = Nothing
    Dim resultItem As Object = Nothing

        folderItems = folder.Items
        folderItems.IncludeRecurrences = True
        folderItems.Sort("[Start]")
        If (folderItems.Count > 0) Then
            resultItem = folderItems.Find(searchCriteria)
            If Not IsNothing(resultItem) Then
                strBuilder = New StringBuilder()
                Do
                    If (TypeOf (resultItem) Is Outlook._AppointmentItem) Then
                        counter += 1
                        appItem = resultItem
                        strBuilder.AppendLine("#" + counter.ToString() + _
                                              " Subbject: " + appItem.Subject + _
                                              " Organizer: " + appItem.Organizer + _
                                              " Location: " + appItem.Location)
                    End If

                    resultItem = folderItems.FindNext()
                Loop Until IsNothing(resultItem)
            End If
        End If
        If Not IsNothing(strBuilder) Then
            Debug.WriteLine(strBuilder.ToString())
        Else
            Debug.WriteLine("There is no match in the " + _
                               folder.Name + " folder.")
        End If
End Sub


text:
Q: iReport 5.0.0: Remove space betwen Y bar and plot for Timeseries chart I'm trying to create a Timeseries chart in iReport 5.0.0 and want to remove the space between the Y axis and the lines in the graph, how would i do that?
I already have a Customizer class and have tried to thinker whit some of the values in it but to no luck. Any help much appreciated.
Added a datescale to the y axis and it seems like my first date is at 2011-06-30 but my x-axis starts att 2011-05-01 for som reason.

A: In your chart customizer, cast your plot to an XYPlot (or just call chart.getXYPlot()) and then call setAxisOffset on it. This method sets the gap between the axes and the plot.
(javadoc here)
Removing the gap from the y-axis should be as simple as calling:
plot.setAxisOffset(new RectangleInsets(5.0, 0.0, 5.0, 5.0));

Removing all of the gaps can be done with:
plot.setAxisOffset(new RectangleInsets(0.0, 0.0, 0.0, 0.0));

or
plot.setAxisOffset(RectangleInsets.ZERO_INSETS);

Edit:
By default, the plot will begin slightly before the first data point. If you want the data to begin immediately at the edge of the plot, call setMinimumDate on your date axis, setting it to the same value as the first point in your dataset.

A: The axis now works. I did this:
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR,2011);
cal.set(Calendar.MONTH,05);
cal.set(Calendar.DAY_OF_MONTH,30);

java.util.Date d = cal.getTime();
domainAxis.setMinimumDate(d);

The above answer is resolved. I will also open up a new thread on how to get the first value in a series. But that will be a separate question.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Australian Mathematical Society journal rankings I apologize for a question that is not about mathematics, but I believe it is of interest to research mathematicians, and I believe there may be people on MathOverflow who can answer it objectively. If it is deemed unacceptable, I can survive.
For many years, I (and many others I know) have used a ranking of mathematics journals produced by the Australian Mathematical Society in 2009, formerly found here https://austms.org.au/Rankings/AustMS_final_ranked.html.
Without wishing to get into a debate on the usefulness or methodology of ranking journals, I found the list useful for judging what journals to submit papers to, and for justifying to deans or hiring committees the quality of journals that I or others (e.g. job, tenure applicants) have published in. I understand that it was getting out of date and I certainly did not agree with every grade there. But since it was made by mathematicians, rather than some trite formula, and since it used a simple A*/A/B/C grading scheme, it was solid and easy to reference and cite. For example, I planned to use it to help justify to deans an upcoming tenure decision.
It was also the top rated answer to this MO question about journal rankings. Unfortunately, the link above is now dead.

Question 1: Does anyone know if this ranking is permanently gone from the internet? If the society has "disavowed" it as incorrect or out of date? If they are revising it? Or if the link has simply changed?

I was able to find a "cached" version, so I still have access to the information. But I do not know how long this will be up, and it detracts from any semblance of authority if it is no longer hosted on a reputable website.
If this list is gone forever,

Question 2: Do people have suggestions for a replacement with similar features? (Made by a reputable institution, with input from mathematicians rather than a trite formula, and easy to explain to non-mathematicians.)

I understand that the second question has some overlap with the prior MO question linked above.

A: This should perhaps be a comment rather than an answer, but I thought I should post it so that others can offer corrections or further detail.
One of my colleagues has sometimes justified his opinions/suggestions to me with references to the Scimago journal rankings in mathematics:
https://www.scimagojr.com/journalrank.php?area=2600&type=j
Unfortunately I don't know if these rankings carry the appropriate "weight" in the eyes of deans and similar creatures. (I also don't know about accuracy, but your post suggests that this is not really the main issue which you want to address; the ranking puts JAMS at number 3 and Annals at number 4, for what it's worth.)
There's a lot of finer-grained detail one can extract from this database, by selecting a particular country or a particular area of mathematics.

Some information which may be of interest to readers other than the OP
For background on this ranking or system of metrics, see
https://www.scimagojr.com/aboutus.php
The SJR number is described in technical detail
https://www.scimagojr.com/files/SJR2.pdf
and it appears to be a metric based on a version of the Google PageRank algorithm: some "alt text" on the webpage claims tha the SJR number

... expresses the average number of weighted citations received in the selected year by the documents published in the journal in the last three years.

A: The system officially used in Finland is Jufo. It has four grades in the ranking, from 0 (lowest) to 3 (highest). The funding of Finnish universities partly depends on the amount of publications in those journals, with coefficients per publication being 0.1 - 1 - 3 - 4 (i.e., a publication in a level 3 journal is worth 4 publications in a level 1 journal, and 40 publications in a level 0 one.)
The ranks are re-allocated every 5 years by a committee based on suggestions from the academics; also there are some constraints (if one journal goes up, some other has to go down). This naturally creates some distortions, e. g., a new strong journal will lag in ranking, which means that nobody has incentive to publish there, which means nobody will be strongly pushing to move it up the ranking etc. For example, "Forum of mathematics, Pi" is only level 1. But other than that, the ranking is reasonable.

A: There are several sources online that rank math journals by impact factor (and, this comes from a professor's webpage) or journal citation reports. However, it is important to realize that impact factor is a highly unstable metric, as discussed here.
Thomson Reuters has a list ranking by JCR, which appears to now be behind a paywall called InCites (though you might be able to access it through your library). If I remember correctly there was also an option to rank by impact factor.
The Institute for Scientific Information (ISI) is another source that maintains a database. And there's Scimago mentioned by Yemon. And you can look up impact factors over the years at bioxbio.com.
Another ranking by impact factor was SciJournal.org, but their website also appears to be down. A general way to solve the issue of disappearing website is the WayBack machine. For SciJournal, here is a recent snapshot from 2020. For the Australian list, here is a July, 2020 snapshot. In the same spirit as the Australian list, I am aware of a Chilean list that breaks journals into categories such as "Muy Buena," "Buena," and "aceptable" (I'm not sure if this is actually the third category). I've heard that this breakdown is not super well-regarded.
Lastly, an alternative to impact factor, that I've read about but have not yet looked into, is scite.

A: I think all the other questions have been answered. The reason the link you posted is now dead is that the Australian Mathematical Society updated its (very old) website recently. Yes, you can find this link on web.archive.org. For what it's worth, your link is the 2008 list. The 2010 list, the final edition of the ERA rankings, can be found here http://www-users.math.umn.edu/~arnold//math-journal-ratings/ - this is "only" 10 years out of date rather than 12.


text:
Q: will 'printf' always do its job? printf("/*something else*/"); /*note that:without using \n in printf*/

I know printf() uses a buffer which prints whatever it contains when, in the line buffer, "\n" is seen by the buffer function.  So when we forget to use "\n" in printf(), rarely, line buffer will not be emptied. Therefore, printf() wont do its job.  Am I wrong?

A: The example you gave above is safe as there are no variable arguments to printf. However it is possible to specify a format string and supply variables that do not match up with the format, which can deliver unexpected (and unsafe) results. Some compilers are taking a more proactive approach with printf use case analysis, but even then one should be very, very careful when printf is used.

A: From my man page:

These functions return the number of characters printed (not including
  the trailing \0 used to end output to strings) or a negative value
  if an output error occurs, except for snprintf() and vsnprintf(), which
  return the number of characters that would have been printed if the n
  were unlimited (again, not including the final \0).

So, it sounds like the can fail with a negative error.

A: Yes, output to stdout in C (using printf) is normally line buffered. This means that printf() will collect output until either:

*

*the buffer is full, or

*the output contains a \n newline

If you want to force the output of the buffer, call fflush(stdout). This will work even if you have printed something without a newline.

A: Also printf and friends can fail.
Common implementations of C call malloc() in the printf family of the stdC library.
malloc can fail, so then will printf.  In UNIX the write() call can be interrupted by EINTR, so context switching in UNIX will trigger faults (EINTR).  Windows can and will do similar things.
And... Although you do not see it posted here often you should always check the return code from any system or library function that returns a value.

A: Like that, no.  It won't always work as you expect, especially if you're using user input as the format string.  If the first argument has %s or %d or other format specifiers in it, they will be parsed and replaced with values from the stack, which can easily break if it's expecting a pointer and gets an int instead.
This way tends to be a lot safer:
printf("%s", "....");

The output buffer will be flushed before exit, or before you get input, so the data will make it regardless of whether you send a \n.

A: printf could fail for any number of reasons. If you're deep in recursion, calling printf may blow your stack. The C and C++ standards have little to say on threading issues and calling printf while printf is executing in another thread may fail. It could fail because stdout is attached to a file and you just filled your filesystem, in which case the return value tells you there was a problem. If you call printf with a string that isn't zero terminated then bad things could happen. And printf can apparently fail if you're using buffered I/O and your buffer hasn't been flushed yet.


text:
Q: How do I pass the data from my View to the controller? I have a concierge application where the user will register an entry and exit of vehicles, to register an entry I work with two tables, the user consults the associate by the license plate and checks if he is registered, yes I allow him to enter one of his another table, but I can't find a way to pass this data to the controller and insert it into the database, that is, how do I get the data from my View? And how do I enter the data in the database? follows my code from the View that is displaying the form and the Controller...
public ActionResult Buscar(string texto)
    {
        VeiculosDB vb = new VeiculosDB();

        var placa = vb.VEICULOGERAL.Where(p => p.PLACA == texto);
        return View(placa);
    }

In a way in my plate variable I have the data that is being displayed, but how would I do an insert with this data ?
@model IEnumerable<Portaria.Models.VEICULOGERAL>

@{
ViewBag.title = "Chegada";
}

  @using (Html.BeginForm("Buscar", "Portarias", FormMethod.Get))
{
    <input type="text" class="form-control" name="texto" placeholder="Placa..." />

            <input type="submit" value="Buscar" class="btn btn-default" name="texto" style="background-color:aliceblue" />

}

            @Html.DisplayNameFor(model => model.TIPOVEICULO)

            @Html.DisplayNameFor(model => model.MARCA)

            @Html.DisplayNameFor(model => model.ANOMOD)

            @Html.DisplayNameFor(model => model.ANOFAB)

            @Html.DisplayNameFor(model => model.VEICULO)

            @Html.DisplayNameFor(model => model.COR)

            @Html.DisplayNameFor(model => model.UNIDADE)

            @Html.DisplayNameFor(model => model.ASSOCIADO)

            @Html.DisplayNameFor(model => model.CODMARCA)

            @Html.DisplayNameFor(model => model.CODVEICULO)

            @Html.DisplayNameFor(model => model.MATRICULA)

            @Html.DisplayNameFor(model => model.SITUACAO)

            @Html.DisplayNameFor(model => model.DATAINICIAL)

            @Html.DisplayNameFor(model => model.DATAFINAL)

            @Html.DisplayNameFor(model => model.STATUSPRI)

            @Html.DisplayNameFor(model => model.DESCSTATUSPRI)

            @Html.DisplayNameFor(model => model.STATUSSEC)

            @Html.DisplayNameFor(model => model.DESCSTATUSSEC)

            @Html.DisplayNameFor(model => model.DATAORDEM)

    @foreach (var item in Model)
    {

                @Html.DisplayFor(modelItem => item.TIPOVEICULO)

                @Html.DisplayFor(modelItem => item.MARCA)

                @Html.DisplayFor(modelItem => item.ANOMOD)

                @Html.DisplayFor(modelItem => item.ANOFAB)

                @Html.DisplayFor(modelItem => item.VEICULO)

                @Html.DisplayFor(modelItem => item.COR)

                @Html.DisplayFor(modelItem => item.UNIDADE)

                @Html.DisplayFor(modelItem => item.ASSOCIADO)

                @Html.DisplayFor(modelItem => item.CODMARCA)

                @Html.DisplayFor(modelItem => item.CODVEICULO)

                @Html.DisplayFor(modelItem => item.MATRICULA)

                @Html.DisplayFor(modelItem => item.SITUACAO)

                @Html.DisplayFor(modelItem => item.DATAINICIAL)

                @Html.DisplayFor(modelItem => item.DATAFINAL)

                @Html.DisplayFor(modelItem => item.STATUSPRI)

                @Html.DisplayFor(modelItem => item.DESCSTATUSPRI)

                @Html.DisplayFor(modelItem => item.STATUSSEC)

                @Html.DisplayFor(modelItem => item.DESCSTATUSSEC)

                @Html.DisplayFor(modelItem => item.DATAORDEM)

    }

A: You are using submit form mechanism with GET method. This isn't logical.
GET === retrieve something from server
POST/PUT === send something to server
So regarding your case just change
 using (Html.BeginForm("Buscar", "Portarias", FormMethod.Get))

to
 using (Html.BeginForm("Buscar", "Portarias", FormMethod.Post))

Since you're using this statement
@model IEnumerable<Portaria.Models.VEICULOGERAL>
your View will be populated based on the model's values above.

A: Split Buscar ActionResult to [HttpGet] and [HttpPost] methods.
With [HttpGet] you will retrieve data with controller from data to view.
with [HttpPost] action, you will retrieve data from view to database.
Firstly define your db object globally(outside from action methods):
VeiculosDB vb = new VeiculosDB();

In your view make your Form method "post" like this:
using (Html.BeginForm("Buscar", "Portarias", FormMethod.Post))

inside the beginForm you can use a button with submit type like this:
<button type="submit" class="btn btn-primary">Add</button>

It will automatically send data to [HttpPost] action.
Your [HttpPost] Action can be like this:
[HttpPost]
    public ActionResult Buscar(Vehicle v)
            {
                vb.Carname.Add(v); //vb from your global db object that I mentioned above.
                vb.SaveChanges();
                return RedirectToAction("index");
            }


text:
Q: How to properly center align text in titlepage? I am trying to properly center the phrase "Faculty of Engineering", but haven't been able. I really can't understand why it isn't properly centered since I have included everything in the \begin{center} environment. Could use some help here!
Here is the script with the preamble:
\documentclass[a4paper,12pt]{report}

\usepackage[LGR, T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[greek]{babel}
\usepackage{alphabeta}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx,ifthen}
\graphicspath{ {./figures/} }
\usepackage{floatrow}
%\floatsetup[figure]{capposition=top}
\usepackage{ragged2e}
\setlength{\parindent}{2em}
\setlength{\parskip}{1em}
\usepackage{amsmath}
\usepackage{afterpage}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{indentfirst}
\usepackage{biblatex}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\addbibresource{bibliography.bib}
\usepackage{tikz}
\usepackage{caption}
\usetikzlibrary{chains,
                arrows.meta,
                positioning,
                quotes,
                shapes,
                calc}
\tikzset{
block/.style={
  draw,
  fill=blue!20,
  rectangle,
  minimum height=3em,
  minimum width=4em,
  text centered,
  text width=2cm
  },
sum/.style={
  draw,
  fill=blue!20,
  circle,
  },
input/.style={coordinate},
output/.style={coordinate},
pinstyle/.style={
  pin edge={to-,thin,black}
  }
}

\begin{document}

    \begin{titlepage}

        \begin{center}

            \Large
            \textbf{Αριστοτέλειο Πανεπιστήμιο Θεσσαλονίκης}
            \newline
            \Large
            \textbf{\textlatin{Faculty of Engineering}}
            \newline
            \Large
            \textbf{Τμήμα Ηλεκτρολόγων Μηχανικών και Μηχανικών Ηλεκτρονικών Υπολογιστών}
            \newline
            \Large
            \textbf{Τομέας Ηλεκτρονικής και Υπολογιστών}

        \end{center}

    \end{titlepage}

    \end{document}

A: Like this --added common textbf and Large commands for title

\begin{titlepage}
                \begin{center}

            \Large\textbf{%<-------------------------------add % and textbf
            {Αριστοτέλειο Πανεπιστήμιο Θεσσαλονίκης}\\
            {\textlatin{Faculty of Engineering}}\\
            {Τομέας Ηλεκτρονικής και Υπολογιστών}
            }%<--------------------------------------------add%

        \end{center}

    \end{titlepage}


text:
Q: django delete post noReverseMatch Trying to delete a post, but somehow getting a NoReverseMatch
views.py
@login_required
def task_detail(request, slug):
    '''
    Detailed view of all tasks on given project
    '''
    context = {}
    checklist   = get_object_or_404(Checklist, slug=slug)
    context.update({'checklist':checklist})
    form        = NotesForm(request.POST or None)
    if request.method == "POST":
        if form.is_valid():
            print("\n\n for is valid")
            author = Profile.objects.get(user=request.user)
            new_note = form.save(commit=False)
            new_note.user = author
            new_note.checklist = checklist
            new_note.save()

            return redirect('task_detail', slug=slug)

    context.update({
        'form': form,
        'title': checklist,
    })

    return render(request, 'projects/checklist.html', context)

@login_required
def delete_notes(request, note_id = None):
    del_note = Note.objects.get(id = note_id)
    del_note.delete()

    return redirect('teams')

My urls.py
urlpatterns = [
    path('projects/', teams, name='teams'),
    path('projects/project/<slug>/', projects, name='projects'),
    path('projects/tasks/<slug>/', project_detail, name='project_detail'),
    path('projects/checklist/<slug>/', task_detail, name='task_detail'),
    path('projects/checklist/delete_notes/', delete_notes, name='delete_notes'),
]

in the html I have just a href with the url to delete
Delete

Getting; Reverse for 'delete_notes' with arguments '(14,)' not found. 1 pattern(s) tried: ['projects/checklist/delete_notes/\Z']
Not really sure what is missing, thought the slug from checklist was already passed?
Redirect Update
urlpatterns = [
    path('projects/', teams, name='teams'),
    path('projects/project/<slug>/', projects, name='projects'),
    path('projects/tasks/<slug>/', project_detail, name='project_detail'),
    path('projects/checklist/<slug>/', task_detail, name='task_detail'),
    path('projects/checklist/delete_notes/<int:note_id>/<slug:slug>/', delete_notes, name='delete_notes'),

@login_required
@require_http_methods(['post', 'delete'])
def delete_notes(request, note_id, slug):
    '''
    Delete given note
    '''
    del_note = Note.objects.filter(id=note_id).delete()
    return redirect('task_detail', slug=slug)

Updated with the slug
in html
<form method="POST" action="{% url 'delete_notes' notes.id title.slug %}">
     {% csrf_token %}

        <button type="submit"class="btn btn-danger">Delete</button>

</form>

A: You should specify a parameter where to put the notes.id parameter, for example:
path('projects/checklist/delete_notes/<int:note_id>/', delete_notes, name='delete_notes'),
Such view however should only be triggered with a POST or DELETE request, not with a GET request: a GET request should only be used to retrieve data, not to alter entities.
So you protect the view with:
from django.views.decorators.http import require_http_methods

@login_required
@require_http_methods(['POST', 'DELETE'])
def delete_notes(request, note_id):
    Note.objects.filter(id=note_id).delete()
    return redirect('teams')
and in the template you should work with a "mini-form":
<form method="post" action="{% url 'delete_notes' notes.id %}">
    {% csrf_token %}
    <button type="submit">Delete</button>
</form>
If you want to redirect to the task_detail of a given task, you can add an extra parameter:
path('projects/checklist/delete_notes/<int:note_id>/<slug:slug>/', delete_notes, name='delete_notes'),
and redirect with:
from django.views.decorators.http import require_http_methods

@login_required
@require_http_methods(['POST', 'DELETE'])
def delete_notes(request, note_id, slug):
    Note.objects.filter(id=note_id).delete()
    return redirect('task_detail', slug=slug)
then in the form you should pass the slug of the task:
<form method="post" action="{% url 'delete_notes' notes.id task.slug %}">
    {% csrf_token %}
    <button type="submit">Delete</button>
</form>


text:
Q: Zabbix is unable to set "Content-type: application/json" HTTP header I'm trying to make a web scenario that will test login page. I checked this using Fiddler and in POST which is sent is added to the "Content-type: application/json" HTTP header you can not do in a web scenario Zabbix 2.2.1 if anyone could me how to solve this problem., Or maybe there is some other mechanism or whether it is possible to implement this in zabbixie 2.2.1
Please give me some advice
Regards
Mick

A: Zabbix 2.4 introduces support for custom headers in Web scenarios (see What's new in Zabbix 2.4), so you might wish to upgrade your installation.


text:
Q: 2-Dimensional List in R I would like a "2-dimensional list" where entry (i, j) stores a vector/matrix of unknown size. Something like
my2Dlist[i,j] <- runif(k)

where k varies with i and j. What is the data structure I am looking for?
Thank you.

A: Self-Answer: The solution I found is as follows. If I want a 2x2 list, I write
my2Dlist <- as.list(1:4)
dim(my2Dlist) <- c(2,2)

One can then store anything in the components, for example
my2Dlist[[1,2]] <- c(1, 1, 2, 3, 5, 8)


text:
Q: db2 resource limitation error while using ibm-db I have a generic question (not an issue). I am trying to run a big query with (lot of join conditions connecting 15-20 tables). Do we have any limitations in ibm_db while running big queries ? The query has been running in our production environment for more than 15 years. I am able to run the query in a in-home .Net tool. However, while running it using ibm-db in pycharm I keep getting sqlcode -905 resource limitation error. Is there anything I am missing with ibm-db usage ?
Any insight will be helpful. Thank you for the help.

A: Most likely this -905 sqlcode has nothing to do with python or ibm_db.
Instead, it is more likely due to how the workload/resource management is configured at the Db2 server. Your question gave zero facts about the target Db2 environment, or about the difference(s) between the execution that works (.net) versus the execution that triggers the limitation.
One specific detail to eliminate is that the account (auth-id) used for the .net application might be different to the account you use when connecting from python. The Db2-server may be configured to allocate based on User-Id (auth-ID) , or other client side factor (depending on the Db2-server platform and version).
You can prove that the -905 symptom has nothing to do with python or ibm_db by temporary eliminating both, for example by submitting the same query from the db2cli tool (or db2 clp if your client workstation has it), or by submitting the query from jdbc (as long as you use the same account name for connecting as you do with python).
Contact your DBA team for details of the configuration of the WLM or RLF or whatever resource management tooling is deployed at the target Db2 subsystem. In addition, use python ibm_db to print out the full details of the exception (including the resource name, limit amount1/2, limit source, as they can also yield more information).


text:
Q: RadListView ItemCommand not firing I have a RadListView and also an event handler bound to lstGameWaypoints_ItemCommand as shown below. On First display of the grid clicking the delete button successfully triggers a postback and the ItemCommand firing.
Once the postback completes it appears that the event handlers are not being wired up again and clicking the delete button causes no action to occur.
Has anyone seen a similar issue before?
<telerik:RadListView runat="server" ID="RadListView1"
DataSourceID="ObjectDataSource1" AllowPaging="true"
OnDataBound="lstGameWaypoints_DataBound"
OnItemCreated="lstGameWaypoints_ItemCreated"
OnItemCommand="lstGameWaypoints_ItemCommand">
<EmptyDataTemplate>

<button class="AddWaypoint">Add Waypoint</button>

</EmptyDataTemplate>
<ItemTemplate>

                    Time:

                    <%# string.Format("{0:h:mm tt}", Eval("DateTime")) %>

                    Date:

                    <%# string.Format("{0:d}", Eval("DateTime")) %>

                    Chip Stack:

                    <%# string.Format("{0:C}", Eval("ChipStack")) %>

                    Notes:

                    <%# Eval("Notes") %>

                    <asp:Button runat="server" ID="btnDelete" CssClass="deleteButton"  CommandArgument='<%# Eval("WaypointID") %>' CommandName="Delete" Text="X" OnClientClick="return confirm('Are you sure you want to delete this waypoint?');" />

</ItemTemplate>
</telerik:RadListView>

protected void lstGameWaypoints_ItemCommand(object sender, Telerik.Web.UI.RadListViewCommandEventArgs e)
{
    if (e.CommandName == "Delete")
    {
        //Do stuff
    }
}

UPDATE:

It appears that this is a issue with the RadAjaxManager that I am using to host the panel for this control. If I disable ajax on the panel, everything works as expected.
This is a full code...
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="panGameWaypoints">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panGameWaypoints" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="panGameDetails">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panGameDetails" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="RequestEnd" />
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="60">

            <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/loading3.gif" AlternateText="loading" />

    </telerik:RadAjaxLoadingPanel>

<asp:Panel runat="server" ID="panGameWaypoints" CssClass="GameWaypoints">

            <telerik:RadListView runat="server" ID="lstGameWaypoints" AllowPaging="false"
                OnDataBound="lstGameWaypoints_DataBound"
                OnItemCreated="lstGameWaypoints_ItemCreated"
                OnNeedDataSource="lstGameWaypoints_NeedDataSource">

                <EmptyDataTemplate>

<button class="AddWaypoint">Add Waypoint</button>

                </EmptyDataTemplate>
                <ItemTemplate>

                                    Time:

                                    <%# string.Format("{0:h:mm tt}", Eval("DateTime")) %>

                                    Date:

                                    <%# string.Format("{0:d}", Eval("DateTime")) %>

                                    Chip Stack:

                                    <%# string.Format("{0:C}", Eval("ChipStack")) %>

                                    Notes:

                                    <%# Eval("Notes") %>

                                    <asp:Button runat="server" ID="btnDelete" CssClass="deleteButton" CommandArgument='<%# Eval("WaypointID") %>' CommandName="Delete" Text="X" OnClientClick="return confirm('Are you sure you want to delete this waypoint?');" />

                </ItemTemplate>
            </telerik:RadListView>

</asp:Panel>

A: I created a little test case (included below) to see if I could reproduce your issue, and there were three main differences between your implementation and mine:

*

*I didn't specify a RadAjaxLoadingPanel

*I didn't specify any ClientEvents (i.e. RequestStart, RequestEnd)

*I didn't use an OnClientClick confirm dialog

Solution #1
After going through and adding each of these to my test case, I discovered that there was an issue using a confirm dialog with the RadAjaxManager. A little research provided the following solution:
Change your OnClientClick code to the following:
OnClientClick="if(!confirm('Are you sure you want delete this?')) return false;"

Does this fix your issue?
Here's some documentation on the issue:
www.telerik.com/help/aspnet-ajax/ajax-confirmation.html

The above should fix your problem, but if not try temporarily removing the RequestStart and RequestEnd client events, and continue to peel "extras" until you find the problem.
Here is a test case that works as expected:
ASPX:
<telerik:RadAjaxManager ID="rda" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="pnlTest">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlTest" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<asp:Panel ID="pnlTest" runat="server">
    <telerik:RadListView ID="lst" runat="server" OnItemCommand="lst_Command" OnNeedDataSource="lst_NeedDataSource">
        <ItemTemplate>
            <%#Eval("Test")%>
            <asp:Button ID="btnDelete" runat="server" CommandArgument='<%#Eval("Test")%>' OnClientClick="if(!confirm('Are you sure you want delete this?')) return false;" CommandName="Delete" Text="Test" />
        </ItemTemplate>
    </telerik:RadListView>
    <asp:Label ID="lblCommandArg" runat="server"></asp:Label>
</asp:Panel>

Code-behind:
protected void lst_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
{
    DataTable table = new DataTable();
    table.Columns.Add("Test", typeof(string));

    DataRow row = table.NewRow();
    row.SetField<string>("Test", "Testing");
    table.Rows.Add(row);

    row = table.NewRow();
    row.SetField<string>("Test", "Testing again");
    table.Rows.Add(row);

    lst.DataSource = table;
}

protected void lst_Command(object sender, RadListViewCommandEventArgs e)
{
    lblCommandArg.Text = e.CommandArgument.ToString();
}

Using RadAjaxPanel instead of RadAjaxManager
Looking at your code, it looks like the easiest solution might be to use the RadAjaxPanel instead of the RadAjaxManager. I'm not sure if this is an option for you, but that's probably the easiest way to get your code working.
Use a RadAjaxPanel for panGameWaypoints instead of a regular Panel, which will ensure that everything contained within will use AJAX:
<telerik:RadAjaxPanel ID="panGameWaypoints" runat="server">
    <telerik:RadListView ID="RadListView1" runat="server" ... >
</telerik:RadAjaxPanel>

A: Did you try to add following code to Page_Init event ?
RadListView1.OnDataBound += new EventHandler(lstGameWaypoints_DataBound);
RadListView1.OnItemCreated += new EventHandler(lstGameWaypoints_ItemCreated);
RadListView1.OnItemCommand += new EventHandler(lstGameWaypoints_ItemCommand);

This should hook your events on each postback.

A: I think you need to tell RadAjaxManager to update the list from itself...? That makes no sense but try adding this to your RadAjaxManager:
<telerik:AjaxSetting AjaxControlID="lstGameWaypoints">
   <UpdatedControls>
      <telerik:AjaxUpdatedControl ControlID="lstGameWaypoints" LoadingPanelID="RadAjaxLoadingPanel1" />
   </UpdatedControls>
</telerik:AjaxSetting>

That way the RadListView will rewire it's events.

A: I don't thing you need  to add
<telerik:AjaxSetting AjaxControlID="panGameWaypoints">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="panGameWaypoints" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>

Use this instead of above
<telerik:AjaxSetting AjaxControlID="lstGameWaypoints">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="lstGameWaypoints" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>

and i don't see lstGameWaypoints ItemCommand event is wired and you also can use OnItemDeleting event insted of itemcommand.

A: I think the problem is on the OnClientClick event you attached on the btnDelete.
I tried to simulate your situation, and I've replaced the Button with a RadButton (you're in a Telerik environment, right?), that expose the event OnClientClicking. So I've created a js function:
function RadConfirm_Delete(sender, args)
{
    var callBackFunction = Function.createDelegate(sender, function (shouldSubmit)
    {
        if (shouldSubmit)
        {
            this.click();
        }
    });

    radconfirm("Are you sure you want to delete this waypoint?", callBackFunction, 350, 100, null, "Confirm delete");
    args.set_cancel(true);
}

and I've setted the RadButton like:
<telerik:RadButton runat="server" ID="btnDelete" CssClass="deleteButton" CommandArgument='<%# Eval("WaypointID") %>' CommandName="Delete" Text="X" OnClientClicking="RadConfirm_Delete" />

All seems to work right.
Let me know!


text:
Q: Should i enable zram and/or lower swappiness value? I use ubuntu 12.04 LTS. I have 2GB RAM. Now, that is split about 55-45 memory-swap. My CPU is almost flatlined!
Could I get faster leaner meaner more efficient performance if I lowered swappiness down to 10 and/or enabled ZRAM. Or should I leave well-enough alone? I am under the impression that zram is built into Ubuntu 12.04 and only needs to be enabled with a simple command. Should I do both together or should I do one but not the other?
Thanks

A: I think you should enable zram, but not in 12.04 as I still didn't test it. I'm testing zram with K/ubuntu 14.04 in a hp compaq 6710b with 1.5gb of ram and I have noticed a big improvement in the overall office work performance.
Before the swap to disk started to happen with few apps open, and it push down the performance. Now I open lot of apps with big memory in use and the computer work very well with zram activated.
In 14.04 LTS you just need to do it:
sudo apt-get install zram-config
and reboot after install
That's it.
Important notice: it's recommended only for desktop/tablet/laptop/phone. Not for server, as there is completely different scenario.


text:
Q: Android: ListView.getScrollY() - does it work? I am using it, but it always returns 0, even though I have scrolled till the end of the list.

A: It does work, it returns the top part of the scrolled portion of the view in pixels from the top of the visible view. See the getScrollY() documentation. Basically if your list is taking up the full view then you will always get 0, because the top of the scrolled portion of the list is always at the top of the screen.
What you want to do to see if you are at the end of a list is something like this:
public void onCreate(final Bundle bundle) {
     super.onCreate(bundle);
     setContentView(R.layout.main);
     // The list defined as field elswhere
     this.view = (ListView) findViewById(R.id.searchResults);
     this.view.setOnScrollListener(new OnScrollListener() {
          private int priorFirst = -1;
          @Override
          public void onScroll(final AbsListView view, final int first, final int visible, final int total) {
               // detect if last item is visible
               if (visible < total && (first + visible == total)) {
                    // see if we have more results
                    if (first != priorFirst) {
                         priorFirst = first;
                         //Do stuff here, last item is displayed, end of list reached
                    }
               }
          }
     });
}

The reason for the priorFirst counter is that sometimes scroll events can be generated multiple times, so you only need to react to the first time the end of the list is reached.
If you are trying to do an auto-growing list, I'd suggest this tutorial.

A: getScrollY() is actually a method on View, not ListView.  It is referring to the scroll amount of the entire view, so it will almost always be 0.
If you want to know how far the ListView's contents are scrolled, you can use listView.getFirstVisiblePosition();

A: You need two things to precisely define the scroll position of a listView:
To get current position:
int firstVisiblePosition = listView.getFirstVisiblePosition();
int topEdge=listView.getChildAt(0).getTop(); //This gives how much the top view has been scrolled.

To set the position:
listView.setSelectionFromTop(firstVisiblePosition,0);
// Note the '-' sign for scrollTo..
listView.scrollTo(0,-topEdge);


text:
Q: C# вызвать переменную из другого метода подскажите пожалуйста, мне нужно вызвать public class CallSKP из другого метода, чтоб использовать там значение переменной "text". как это сделать?
имеется вот такой код:
public class GR21 : SKP
        {
            public GR21(string name) : base(name) { }
        }

        public class CallSKP
        {
            public static void Main(WorkbookItem workbookItem)
            {
                var curBook = workbookItem;
                Info(new GR21(Common.ExtractText(curBook, "RAZ1S" + GR2 + "GRC")));
            }

            public static void Info(SKP namecode)
            {
                string text = namecode.Code;
                //Console.WriteLine(text);
            }
        }

так как тот метод я править не могу, и не могу там использовать WorkbookItem.


text:
Q: Django Admin - Any replacement css built by the community Looking to update the look and feel of my django admin interface, purely for aesthetic reasons.
Does anyone know of any available prepackaged css/javascript to replace the default admin UI?

A: Have you looked at Grappelli yet?


text:
Q: Is there a specific term for the short descriptions of a movie or TV episode present in TV guides? In TV guides, there are often short descriptions of movies or episodes of a TV series, like the one pictured here:

Is there a specific term for this kind of text?

A: This is the blurb.
Originally the term used for a brief description of a book printed on its back cover to entice browsers to purchase it.  The term is now widely used for short promotional descriptions of films, television programmes and other media.

A: It can also be called a log line. See this Wikipedia entry

A log line or logline is a brief (usually one-sentence) summary of a television program, film, or book that states the central conflict of the story, often providing both a synopsis of the story's plot, and an emotional "hook" to stimulate interest. A one-sentence program summary in TV Guide is a log line

A: The term many professional film critics and sub-editors use is capsule review.
From Wikipedia :

A capsule review is a form of criticism, usually associated with
journalism, that offers a relatively short critique of a specified
artistic work (movie, music album, restaurant, painting, etc.).
Capsule reviews generally appear in publications like newspapers and
magazines, and can range anywhere from just a few sentences up to
around 300 words. [...]

A: It could be called a synopsis
3 a brief summary of the plot of a novel, motion picture, play, etc.

A: A fancier term would be précis (from MW):

a concise summary of essential points, statements, or facts

A: This deadpan*, humorous synopsis of "The Wizard of Oz" was written by Rick Polito, "penned for the Marin Independent Journal [Marin County is in northern California, just across the Golden Gate Bridge from San Francisco] and named by the LA Times as TV Listing of the Week when it was written in 1998."
See: https://www.imdb.com/news/ni39278186
The article goes on to say:

"Polito jokes with Jim Romenesko in an interview, 'That line is going to follow me to the grave. It was just on Leno, it was a clue in a
  crossword puzzle, it showed up in Playboy, and people use it as their
  email sigs. Someday I'm going to walk down the street and see it on a T-shirt and punch the person who's wearing it.'"

The real question is, why are so many TV Guide and newspaper synopses also so deadpan and hilarious in their listings? At least we know Polito was intentionally trying to be funny, but what about all the others? Is the job of creating TV and movie listings so interminably boring that the writers have to throw in zingers like this in order not to lose their minds?
*A site called Educalingo includes this definition of deadpan:

Deadpan is a form of comic delivery in which humor is presented without a change in emotion or body language. It is usually spoken in a casual, monotone or cantankerous voice, and expresses a calm, sincere or grave demeanor, often in spite of the ridiculousness of the subject matter.

A: I would like to resurrect this thread to say that, while I am very grateful for the responses, I can't help but feel like I didn't find the answer I was looking for xD
My best guess is the word premise.
"What Is a Premise?
A story's premise is the foundational idea that expresses the plot in simple terms. A good premise will communicate your story's essence in a one-sentence or two-sentence statement."
https://www.masterclass.com/articles/how-to-ensure-your-story-has-a-strong-premise


text:
Q: Find the equation of the hyperbola. Given: vertical asymptote = $\frac{5}{4}$
Passes through points: (1,5) and $\left(\frac{-5}{2},\frac{11}{5}\right)$.
Because we are given vertical asymptote , we should have a rectangular hyperbola:
$y =\dfrac{a}{x-h} +k$
However I don't know how to find $a$ and $k$ (horizontal asymptote. Is it supposed to be $\frac{5}{4}$?).

A: Hint: vertical asymptote at $x=\frac{5}{4}$ means that your denominator becomes $0$ when you have $x=\frac{5}{4}$. Together with the two given points, you have three equations and three unknowns, solve them!


text:
Q: Listbox Selected property causes problems I have a listbox in a Diagram, when calling the function "drawDiagram" I want to get the selected Items of the listbox. Here is my code to do that:
Function DrawDiagram()
Dim x As Integer
Dim diaLst As ListBox
Set diaLst = ActiveSheet.ListBoxes("DiaList")

' find selected trends in List Box
For x = 0 To diaLst.ListCount - 1
    If diaLst.Selected(x) = True Then
        MsgBox x
    End If
Next x
End Function

diaLst.ListCount correctly returns the number of Items in the list. But diaLst.Selected(x) does not work at all.
The Error message is:
German: "Die Selected-Eigenschaft des ListBox-Objektes kann nicht zugeordent werden"
English: "The Selected Property of the ListBox Object cannot be assigned" (or similar)
Does anyone know, what I did wrong?
thanks
natasia

A: first off, you must be dealing with a "Form" control (not an "ActiveX" one) otherwise you couldn't get it via .ListBoxes property of Worksheet class
I tested it in my environment (W7-Pro and Excel 2013) and found that (quite strangely to me) the Selected() property array is 1-based.
This remained even with Option Base 0 at the beginning of the module
Make sure Microsoft Forms 2.0 Object Library reference is added to your project
Function DrawDiagram()
    Dim x As Long
    Dim diaLst As MSForms.ListBox

    Set diaLst = ActiveSheet.ListBoxes("DiaList")

    ' find selected trends in List Box
    For x = 1 To diaLst.ListCount
        If diaLst.Selected(x) = True Then
            MsgBox x
        End If
    Next x
End Function

A: By the way, this is the code I used to generate the list box in a chart sheet, in a separate function. At the moment when a button is clicked, the DrawDiagram function is called. The aim of the "DrawDiagram" function is to plot the selected items of the listbox in the diagram.
Set diaLst = ActiveSheet.ListBoxes.Add(ActiveChart.ChartArea.Width - 110, 5, 105, 150)
With diaLst
    .Name = "DiaList"
    .PrintObject = False
    .MultiSelect = xlSimple

    i = 2
    While wTD.Cells(rowVarNames, i) <> ""
        .AddItem wTD.Cells(rowVarNames, i)
        i = i + 1
    Wend
    .Selected(3) = True
End With

A: use Sheets("Sheet1").Shapes("List Box 1").OLEFormat.Object instead

A: I stumbled upon the same problem. The solution turned out to be simple, just had to tweak the code a litte bit and play around with the ListBox properites:
Function GetSelectedRowsFromListBox(lstbox As ListBox) As Collection

    Create the collection
    Dim coll As New Collection
    Dim lst_cnt As Variant
    lst_cnt = lstbox.ListCount
    Dim arr_selectedVal As Variant
    arr_selectedVal = lstbox.Selected
    ' Read through each item in the listbox
    Dim i As Long
    For i = 1 To lstbox.ListCount

        ' Check if item at position i is selected
        If arr_selectedVal(i) Then
            coll.Add i
        End If
    Next i

    Set GetSelectedRowsFromListBox = coll

End Function

.Selected property returns a 1-based array with True/False values coresponding to rows in your multiple choice Form Control ListBox.
From that you can get the list of each value.
This solution is an expanded version of what is mentioned here, however this also complies with Form Control ListBox, no just ActiveX ListBox (which are 2 same but different things ;) ):
https://excelmacromastery.com/vba-listbox/
Hope that helps in the future!


text:
Q: How to initialize an object using the assignment = operator? I am writing a class similar to as follows:
class FakeVector
{
private:
    int* contents = new int[4];
public:
    FakeVector()
    {
        // constructor code here.
    }
};

I want to initialize the class so that that the contents array is filled (similar to how the vector class is initialized) like this:
Fakevector fakevect {1,2,3,4}; // should result in contents = {1,2,3,4}

How do I do this? Do I have to overload the assignment operator or the constructor somehow?


text:
Q: [Bare][Web] Cannot run react native web I already have an expo bare workflow react native project running on IOS and Android fine. I am now trying to bootstrap the code to be able to run on web through react-native-web.
However, I am encountered with tons of errors like below when I try to run it (expo start:web):
./node_modules/react-native/Libraries/Pressability/HoverState.js:17:4
"export 'default' (imported as 'Platform') was not found in '../Utilities/Platform'
  15 | let isEnabled = false;
  16 |
> 17 | if (Platform.OS === 'web') {
     |    ^
  18 |   const canUseDOM = Boolean(
  19 |     typeof window !== 'undefined' &&
  20 |       window.document &&

./node_modules/react-native/Libraries/Components/Picker/RCTPickerNativeComponent.js:64:11
"export 'default' (imported as 'RCTPickerViewConfig') was not found in './RCTPickerViewConfig'
  62 | if (global.RN$Bridgeless) {
  63 |   ReactNativeViewConfigRegistry.register('RCTPicker', () => {
> 64 |     return RCTPickerViewConfig;
     |           ^
  65 |   });
  66 |   RCTPickerNativeComponent = 'RCTPicker';
  67 | } else {

./node_modules/react-native/Libraries/Components/ScrollView/ScrollView.js:719:7
"export 'default' (imported as 'ScrollResponder') was not found in '../ScrollResponder'
  717 |   state: State = {
  718 |     layoutHeight: null,
> 719 |     ...ScrollResponder.Mixin.scrollResponderMixinGetInitialState(),
      |       ^
  720 |   };
  721 |
  722 |   UNSAFE_componentWillMount() {

Here are my config files
webpack.config.js
const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function (env, argv) {
  const config = await createExpoWebpackConfigAsync(env, argv);
  // Customize the config before returning it.
  config.resolve = {
    extensions: ['.js', '.jsx', '.ts', '.tsx', '.ios.js'],
  };

  return config;
};

babel.config.js
module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin']
  };
};

index.js
import { registerRootComponent } from 'expo';

import App from './App';

registerRootComponent(App);

app.json
    "web": {
      "build": {
        "babel": {
          "include": ["@invertase/react-native-apple-authentication"]
        }
      }
    }

Any help would be greatly appreciated! Thank you!


text:
Q: How to get Primary and foreign Key details from MS Access database I need a query or C# code to get the primary key or foreign key details of each table in an MS Access database.

A: Try OleDBConnection.GetSchema
Additional information : Retrieving Database Schema Information (ADO.NET)

A:    1. SELECT * FROM ALL_CONS_COLUMNS A
      JOIN ALL_CONSTRAINTS C ON A.CONSTRAINT_NAME = C.CONSTRAINT_NAME
      WHERE C.TABLE_NAME = <your table> AND C.CONSTRAINT_TYPE = 'P'
   2.  SELECT * FROM ALL_CONS_COLUMNS A
       JOIN ALL_CONSTRAINTS C  ON A.CONSTRAINT_NAME = C.CONSTRAINT_NAME
       WHERE C.TABLE_NAME = <your table> AND C.CONSTRAINT_TYPE = 'R'

1st is for primary key & 2nd one is for foreign key..........I think this may help you.


text:
Q: Google Web App Multiple Google Accounts Error I am creating a web app using Google Apps Script, and have run into kind of a wall.
Sometimes the users using the web app use it while being logged in with multiple Google accounts. There is a known error that shows up when a user attempts to access a google web app while being logged in with multiple accounts: Can't log in to Google Apps Scripts
The known solutions are:

*

*Log out of all accounts and log in as just one.

*Use incognito mode, thus being logged in as just one user

*Use a separate browser for separate Google Accounts.

Unfortunately, none of these solutions are fitting for the current situation. I myself know how to deal with the error, but how do I programmatically inform the user of these solutions?
What I am trying to do is to intercept this error page, and put out my own error, that could instruct the user to log out of their other accounts. I am deploying the web app using Google Sites, but have not had any luck with it there.
Thanks for any help!

A: Check the Issue Tracker

Unexpected "authorization is required" error from google.script.run after installing Sheets add-on while logged into multiple gmail.com accounts

*

*Comment #114, has a workaround for add-ons

*Comment #117, has another workaround for add-ons

You haven't mentioned what you are trying to accomplish, but there may be a workaround there.
Another idea might be to make an intermediate page that will serve as a sort of "landing page" that can remind your users about this issue and then re-direct them to the Web App. If you use cookies or the local storage API, then you could have it redirect immediately if they have seen it within the last few days.
Current known status of the bug
I seem to remember seeing somewhere, though I can't find it now, that the Apps Script team were planning on starting work to fix this in 2021.


text:
Q: Solving a maze with only vision of a 15x15 grid around the current square (C++) So I'm writing a program that solves a maze in the fastest time possible but you're only given a small area around where you currently are to see the surrounding area. I had planned to make it so that it always steps in the order of right > forward > left > backward. To make it go faster I intended to add a function that checks a path to see if it results in a dead end. Whether or not you can go in a certain direction is represented by the last 4 digits. I tried using a breadth first search algorithm to find dead ends. The function works by checking to see if it steps outside of the given area and if it does it returns false, otherwise it returns true. I'm not entirely sure where it's going wrong but it definitely does not work. The function is passed an array that represents the visible area, the height and width of the area, the x,y  coordinates and the direction it is originally facing represented as a unsigned char. this is & with the last 4 bits to check if it's possible to move in that direction. Any help would be appreciated.
//WILL RETURN TRUE IF THERE IS A DEAD END, FALSE OTHERWISE
 bool ActualPlayer::deadEnd(const AdvancedMapTile* area, const uint width, const uint height, const uint x, const uint y, unsigned char dir)
{
//dynamic allocation
bool *marked = nullptr;
marked = new bool[height * width];
for(uint i = 0; i < (height * width) ; i++)
    marked[i] = false;
queue<cord> q;
bool deadEnd = true;
cord temp;

marked[x + y*width] = true;
temp.x = x;
temp.y = y;
q.push(temp);
//perform bfs
while(!q.empty())
{
    AdvancedMapTile loc = area[x + y*width];
    temp = q.front();
    q.pop();
    for(unsigned char i = 1; i < 9; i = i*2)//goes for 1, 2, 4, 8
    {
        uint tempx = temp.x;
        uint tempy = temp.y;
        changeXY(tempx, tempy, i, height, width);
        if(!marked[tempx + tempy*width] && (loc.exits & i) != 0)
        {
            q.push(temp);
            marked[tempx + tempy*width] = true;
            if(tempx < 0 || tempx == width || tempy < 0 || tempy == height)
                return false;
        }
    }
}

delete [] marked;
return deadEnd;

}


text:
Q: Is there a name for taking the pushforward (ie pushout) over the pullback? Given maps continuous maps $f:U \rightarrow X$ and $g:V \rightarrow X$ between topological spaces; then there is a unique map $f \sqcup g:U \sqcup V \rightarrow X$ whose restrictions to $U$ & $V$ are the original maps ie $(f \sqcup g)|U=f$ and $(f \sqcup g)|V=g$.
This is a categorical construction; take the pullback $f':U \times_X V \rightarrow U$, $g':U \times_X V \rightarrow V$; and then the pushout over that, and writing $U \sqcup V$ for this, we have by the unique mapping property of the pushout a unique map $f \sqcup g:U \sqcup V \rightarrow X$.
This works in any category with pullbacks and pushouts.
This generalises to more than two maps, I think, by using the wide pullback & pushout - Edit: I don't think it does.
Is there a standard name for this construction - taking the pushout over the pullback?


text:
Q: Monitoring status of Oozie jobs submitted through Python subprocess I'm triggering an Oozie workflow as a shell command executed via Python's subprocess module.
Popen("oozie job -config workflow.properties -run".split())

The execution of the remainder of my program depends on success or failure of various actions in this workflow. When triggering the Oozie job interactively, I get back a Oozie jobID which I can use to monitor the success/failure status of the job using
oozie job -info <jobId>

I want to access the status of various action nodes programmatically, through Python. Is there a way to accomplish this?
What I've tried so far:
An Oozie MapReduce action places a _SUCCESS file in the output folder upon successful job completion. I polled for the presence of this file every 2 seconds. However, I'm wondering if there is a direct API/Shell call to get status of action nodes.
Related(ish) questions
This post talks about the reverse problem: that of triggering Python jobs through Oozie and doesn't answer my question.

A: You have RESTAPI to access the Logs status.. and even to submit the Oozie job and monitor it!! WE can pass the RESTAPIs to the oozie-server we can able to take it out periodically!!BTW it can be applicable for all the jobs which we can submitted in the oozie.
for you ref : https://oozie.apache.org/docs/4.1.0/WebServicesAPI.html


text:
Q: JTable: get object location inside a cell I can't figure out how to solve this problem:
I have a JTable with a custom cell renderer. Inside a cell renderer I put a JLabel with a grid bag layout.
If I try to obtain the location of the JLabel inside the renderer, I always get 0, 0. I tried to revalidate the JLabel before but I'm not able to find a correct solution.
This is the code of the custom renderer:
public CustomRenderer() {
    // set the renderer layout to null
    setLayout(new GridBagLayout());
    // create the layouts label
    layoutsLbl = new JLabel("Layout");
    // create a grid bag constraints instance
    GridBagConstraints gbc = new GridBagConstraints();
    // first column
    gbc.gridx = 0;
    // first row
    gbc.gridy = 0;
    // maximum horizontal weight
    gbc.weightx = 1;
    // anchor to the top left corner
    gbc.anchor = GridBagConstraints.FIRST_LINE_START;
    // fill horizontally
    gbc.fill = GridBagConstraints.HORIZONTAL;
    // set the insets
    gbc.insets = new Insets(35, 0, 10, 0);
    // add the layouts label to the view
    add(layoutsLbl, gbc);
}

public String clickCheck() {
    // revalidate the layouts label
    layoutsLbl.revalidate();
    // get the layouts label location
    System.out.println("Label location: " + layoutsLbl.getLocation());
}

I know that in some cases I might be able to calculate the JLabel location because it is fixed, but I would like to have a general approach because I need it for a renderer where I have a lot of dinamically generated JLabel.
The final goal is to find the location of each JLabel to be able to identify which JLabel has been clicked with a MouseListener attached to the table. I'm able to find the clicked cell, the mouse location in the cell and therefore I need the JLabel location in the cell to test it against the mouse location.

A:
The final goal is to find the location of each JLabel to be able to identify
  Blockquote which JLabel has been clicked with a MouseListener attached to the table.

This Problem is pretty easy to solve. Just use this simple Code snippet to get the clicked Object.
this.addMouseListener(new MouseListener() {
        @Override
        public void mouseClicked(MouseEvent e) {

            Component clicked = getComponentAt(e.getPoint());
            if(clicked instanceof JLabel){
                JLabel myLabel = (JLabel) clicked;
                //obviously myLabel is the clicked JLabel
                System.out.println("Clicked Label: " + myLabel.getLocation());
            }

        }

        @Override
        public void mousePressed(MouseEvent e) {

        }

        @Override
        public void mouseReleased(MouseEvent e) {

        }

        @Override
        public void mouseEntered(MouseEvent e) {

        }

        @Override
        public void mouseExited(MouseEvent e) {

        }
    });

Using the getLocation() Method will now give you the real Location the JLabel has.

UPDATE: Here is the requested complete Example (Using JTable instead)

This is my Main:
public static void main(String[] args) {
    JFrame frame =  new JFrame();
    frame.setContentPane(new CostumTable());
    frame.getContentPane().addMouseListener(new MouseListener() {

        @Override
        public void mouseClicked(MouseEvent e) {

            Component clicked = frame.getContentPane().getComponentAt(e.getPoint());
            if(clicked instanceof JLabel){
                JLabel myLabel = (JLabel) clicked;
                //obviously myLabel is the clicked JLabel
                System.out.println("Text of clicked Label: " + myLabel.getText());
            }

        }
        @Override
        public void mousePressed(MouseEvent e) {

        }
        @Override
        public void mouseReleased(MouseEvent e) {

        }
        @Override
        public void mouseEntered(MouseEvent e) {

        }
        @Override
        public void mouseExited(MouseEvent e) {

        }

    });

    frame.setSize(200, 500);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.setVisible(true);
}

and this would be the CustomRenderer (now CostumTable):
    public CostumTable() {
    // set the renderer layout to GridBagLayout
    setLayout(new GridBagLayout());
    // create the layouts label
    layoutsLbl = new JLabel("Layout");
    // create a grid bag constraints instance
    GridBagConstraints gbc = new GridBagConstraints();
    // first column
    gbc.gridx = 0;
    // first row
    gbc.gridy = 0;
    // maximum horizontal weight
    gbc.weightx = 1;
    // anchor to the top left corner
    gbc.anchor = GridBagConstraints.FIRST_LINE_START;
    // fill horizontally
    gbc.fill = GridBagConstraints.HORIZONTAL;
    // set the insets
    gbc.insets = new Insets(35, 0, 10, 0);
    // add the layouts label to the view
    add(layoutsLbl, gbc);

    //Just here to test the MousListener
    List<JLabel> testLabel = new ArrayList<>();
    for(int i = 0; i < 3; i++) {
        testLabel.add(new JLabel("TestLabel number " + i));
        gbc.gridx = 0;
        gbc.gridy = i + 1;
        add(testLabel.get(i), gbc);
    }
    //
}

public String clickCheck() {
    // revalidate the layouts label
    layoutsLbl.revalidate();
    // get the layouts label location
    System.out.println("Label location: " + layoutsLbl.getLocation());
    return null; //I dont know what you want to return
}


text:
Q: Construct list of consecutive pairs from list of lists I have an input of the form:
[[41.0, 42.0], [42.0, 17.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]

How can I sort these pairs and keep just the consecutive ones (by consecutive I mean [a, b] where b is the next element, larger than a, but not necessarily in an increment of 1.).
EDIT: My attempt:
test_lst = [[41.0, 42.0], [42.0, 17.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]
new_lst = []
for elem in test_lst:
    if elem[1] > elem[0]:
        new_lst.append(elem)

where new_lst looks like:
[[41.0, 42.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]

Now, for example, for the groups [17.0, 46.0] and [17.0, 29.0], I want to keep just the second one in my list, so the one with the smallest difference between elem[1] and elem[0].
EDIT 2 :
test_lst = [[41.0, 42.0], [42.0, 17.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]

sorted_lst = sorted(test_lst, key = lambda x: int(x[0]))

which gives:
[[6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 46.0], [17.0, 29.0], [29.0, 30.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [41.0, 42.0], [42.0, 17.0], [46.0, 47.0]]

Now all I need to do is, in the case of repeating first element, keep the pair with the smallest second element. How can I do that?

A: Since there are floats involved you should take some precautions when checking for exact equality:
e = 0.0000001  # some epsilon value accounting for imprecision
sorted(x for x in lst if abs(x[1]-x[0]-1) <= e)
# [[6.0, 7.0], [29.0, 30.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [41.0, 42.0], [46.0, 47.0]]

A: Use list comprehension:
>>> [x for x in a if x[0] + 1 == x[1]]
[[41.0, 42.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [6.0, 7.0], [29.0, 30.0]]

Then sort it:
>>> sorted([x for x in a if x[0] + 1 == x[1]], key=lambda x: x[0])
[[6.0, 7.0], [29.0, 30.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [41.0, 42.0], [46.0, 47.0]]

A: outer_list = [[41.0, 42.0], [42.0, 17.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]
new_outer_list = []
for inner_list in outer_list:
    if inner_list[0]+1 == inner_list[1]:
        new_outer_list.append(inner_list)

A: You can do something like:
values = [[41.0, 42.0], [42.0, 17.0], [17.0, 46.0], [46.0, 47.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [36.0, 7.0], [36.0, 6.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]

sortedValues = []

for value in values:
    if value[1] > value[0]:
        sortedValues.append(value)

print(sortedValues)

A: You can pair the adjacent items in the list by zipping the list with itself but with one index apart, and since you apparently want the last item despite it not having a next item to compare to, you can manually add it to the list after reversing it so that it will always match. The following example assumes that your list is stored in variable lst:
[[a, b] for (a, b), (n, _) in zip(lst, lst[1:] + [lst[-1][::-1]]) if b == n and b > a]

This returns:
[[41.0, 42.0], [17.0, 46.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0]]

Note that the third item [46.0, 47.0] in your expected output is incorrect because it is actually followed by [33.0, 34.0] in your original list, whose first element is not 47.0.
And if you want to keep the items with the smallest second item when the first items duplicate, you can sort the list by the first item first, and the second item in reverse order, so that you can use the dict constructor to convert the list of two-item sublists into a dict to eliminate duplicates, and then convert the dict items to a list of sublists by mapping them to the list constructor:
list(map(list, dict(sorted([(a, b) for (a, b), (n, _) in zip(lst, lst[1:] + [lst[-1][::-1]]) if b == n and b > a], key=lambda t: (t[0], -t[1]))).items()))

This returns:
[[6.0, 7.0], [7.0, 12.0], [12.0, 17.0], [17.0, 29.0], [29.0, 30.0], [33.0, 34.0], [34.0, 35.0], [35.0, 36.0], [41.0, 42.0]]


text:
Q: Can iOS and Android apps (who store user data locally) be updated without losing pre-existing data? I've seen a number of similar questions posed but for the sake of specificity —  is possible to do an update to an existing app without losing the end users existing information?
The scope of the existing app is:
- Available on iOS and Android
- Stores user data in the app, locally
- The app does not require an internet connection at all
The changes to this app would be:
- Re-skinning
- Fixing technical debt/bugs
- Maybe adding some functionality (such as notifications)
If it can be possible to do an update without losing local data, would the original source code be required? (I'm assuming the answer is "DUH")
Unfortunately I can't share the name of this exact (client request).
Thanks!

A:
is possible to do an update to an existing app without losing the end users existing information?

If you are the developer of the original app, yes. Otherwise, no, at least on Android (and I assume that holds true for iOS as well), for obvious security reasons.

would the original source code be required?

Usually, though presumably you are welcome to reimplement the entire app from scratch if you prefer. The bigger thing — again, on Android at least — is that you need the signing key that was used to digitally sign the original application. You can only update the app if the signing key is the same.


text:
Q: Что нужно знать хакеру? Что нужно знать, чтобы вытворить такое: YouTube: Хакеры веселятся?
А именно, какие технологии, уровни OSI и т.п. нужно хорошо знать?
A: Самый главный совет для хакера - новичка -> хакнуть ресурс со своего домашнего компа. Начинайте экспериментировать, потом поделитесь впечатлениями.
A: Хм, почему за столько лет никто даже не упомянул, что одним из самых важных элементов( если уж и не самым важным ) является команда, единомышленники, люди, разделяющие интересы и одержимые общей идеей. Ведь от общения и ощущения своей целостности с ними и приходит тот самый энтузиазм, истинный хакерский дух, в которых заключена сила ;)

P.S И пускай видео - всего лишь подделка, зато через него можно явно видеть, как важна командная работа.
A: *

*Первое - бегать. Хорошо бегать, потому что как догонят, хорошо дадут.

*Второе - нужно разбираться в том, что теперь модно называть "умный дом" - когда свет, тепло и другие коммуникации управляются централизовано.
Понятно, что если свет включается только обычным включателем, то будь в десятом колене потомственным "хакером" - ничего не получится. Поэтому, очень хорошо изучить электронику и электротехнику, хотя бы на базовом уровне факультета типа РТФ. Уметь держать в руках паяльник - приветствуется.

*Третье - английский. Просто очень много литературы на нем и с ним будет заметно проще.

*Четвертое, учитывая последние тенденции - и китайский (что бы читать доки в оригинале).

*Пятое - тетрис/стрелялку уметь написать, потом вывести на экран уже не штука. Но уметь нужно. Желательно изучить с++/ассемблер. Другими языками брезговать также не стоит.

*И напоследок - куча свободного времени, желание учится и не сдаватся и немного везения.

A: Как стать хакером?
Стать хакером очень просто!
Достаточно выучить и понять: математические дисциплины (математический анализ, теория функций комплексного переменного, алгебра, геометрия, теория вероятностей, математическая статистика, математическая логика и дискретная математика), инженерные дисциплины (физика, аппаратные средства вычислительной техники, основы радиоэлектроники, сети связи и защита информации от технической разведки), дисциплины по программированию и вычислительной технике (информатика, языки программирования высокого уровня, методы программирования, язык ассемблера, операционные системы, СУБД и вычислительные сети), специальные дисциплины (криптография, и теоретические основы защиты компьютерных систем).
Это достаточно полный список. Но если вы хотите стать не простым хакером, а настоящим специалистом своего дела, то необходимо также знать:

*

*криптографические методы в системах защиты государственной, конфиденциальной и коммерческой информации;

*криптографические методы в системах защиты и дешифрования информации;

*математические модели процессов, возникающих при защите информации;

*методы решения вероятностных, статистических и алгоритмических задач криптографического анализа, синтеза шифросистем и криптографических протоколов;

*методы построения математических моделей защищаемой информации, шифров и шифросистем;

*методы преобразования информации в сетях различного типа;

*обеспечение надежности функционирования аппаратуры шифрования и тестирования программно-аппаратных реализаций криптографических алгоритмов;

*общая методология криптографического анализа и построения оценок криптографической стойкости шифросистем;

*определение каналов утечки информации методом измерения и расчета параметров опасных сигналов;

*основные положения теории электрических цепей;

*основные принципы организации систем и сетей связи, особенности современных сетевых архитектур;

*основные типы шифров, шифросистем, криптографических протоколов и систем защиты;

*особенности разработки и сопровождения ПО для рабочих групп и парапрограммирование.

(с)Б.Лаврентьев ( COMPUTERWORLD/КИЕВ )
A: Знать основы асемблера, и уметь не палить железо при помощи асемблера, а дальше оно само собой все будет делаться
A: Думаю, что для такого нужно знать хорошо программы для видео монтажа. Что у нас там сейчас самое популярное, Adobe Premiere, Sony Vegas? Потому что даже человек с базовыми знаниями физики, электротехники, логики поймет, что это монтаж и компьютерная графика. Перечислять все недочеты смысла не имеет, но картинка действительно выглядит далекой от жизни.
По поводу того, как можно взломать реальный умный дом, то могу процитировать моего преподавателя, который однажды сказал: "Если хотите научиться взламывать систему, вначале научитесь её защищать". В остальном, думаю другие посты уже раскрыли тему.


text:
Q: ASP.NET Core MVC Error - Edit Delete Not Working I reverse engineered a table from and exiting database. Then added a controller with all scaffolding for views and context. My table does not have a traditional primary key such as "Id" it has a complex key. However, I do have an Id column which is unique.
When the views got created, the set up was correct. I noticed that the out of the box "Edit, Details and Delete" had action links commented out. I removed the comments and pointed the Model items to the "Id" field.
My "Id" field is a guid but I don't think that is a problem. When I click the edit link on the view, I receive a page not found. Any help would be greatly appreciated.

Index

    Create New

                    @Html.DisplayNameFor(model => model.Id)

                    @Html.DisplayNameFor(model => model.Dark)

                    @Html.DisplayNameFor(model => model.Lit)

                    @Html.DisplayNameFor(model => model.Contra)

                    @Html.DisplayNameFor(model => model.CreateDate)

                    @Html.DisplayNameFor(model => model.CreateBy)

@foreach (var item in Model) {

                @Html.DisplayFor(modelItem => item.Id)

                @Html.DisplayFor(modelItem => item.Dark)

                @Html.DisplayFor(modelItem => item.Lit)

                @Html.DisplayFor(modelItem => item.Contra)

                @Html.DisplayFor(modelItem => item.CreateDate)

                @Html.DisplayFor(modelItem => item.CreateBy)

                @Html.ActionLink("Edit", "Edit", new {  id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id = item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.Id })

}

Here is my controller
public class RoutePartnersController : Controller

{
    private readonly TraderContext _context;

    public RoutePartnersController(TraderContext context)
    {
        _context = context;
    }

    // GET: RoutePartners
    public async Task<IActionResult> Index()
    {
        return View(await _context.RoutePartner.ToListAsync());
    }

    // GET: RoutePartners/Details/5
    public async Task<IActionResult> Details(Guid? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var routePartner = await _context.RoutePartner
            .SingleOrDefaultAsync(m => m.PartnerId == id);
        if (routePartner == null)
        {
            return NotFound();
        }

        return View(routePartner);
    }

    // GET: RoutePartners/Create
    public IActionResult Create()
    {
        return View();
    }

    // POST: RoutePartners/Create
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Create([Bind("Id,PartnerId,RouteCompany,RouteCode,Dark,Lit,Contra,CreateDate,CreateBy")] RoutePartner routePartner)
    {
        if (ModelState.IsValid)
        {
            routePartner.PartnerId = Guid.NewGuid();
            _context.Add(routePartner);
            await _context.SaveChangesAsync();
            return RedirectToAction("Index");
        }
        return View(routePartner);
    }

    // GET: RoutePartners/Edit/5
    public async Task<IActionResult> Edit(Guid? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var routePartner = await _context.RoutePartner.SingleOrDefaultAsync(m => m.PartnerId == id);
        if (routePartner == null)
        {
            return NotFound();
        }
        return View(routePartner);
    }

    // POST: RoutePartners/Edit/5
    // To protect from overposting attacks, please enable the specific properties you want to bind to, for
    // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
    [HttpPost]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> Edit(Guid id, [Bind("Id,PartnerId,RouteCompany,RouteCode,Dark,Lit,Contra,CreateDate,CreateBy")] RoutePartner routePartner)
    {
        if (id != routePartner.PartnerId)
        {
            return NotFound();
        }

        if (ModelState.IsValid)
        {
            try
            {
                _context.Update(routePartner);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoutePartnerExists(routePartner.PartnerId))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }
            return RedirectToAction("Index");
        }
        return View(routePartner);
    }

    // GET: RoutePartners/Delete/5
    public async Task<IActionResult> Delete(Guid? id)
    {
        if (id == null)
        {
            return NotFound();
        }

        var routePartner = await _context.RoutePartner
            .SingleOrDefaultAsync(m => m.PartnerId == id);
        if (routePartner == null)
        {
            return NotFound();
        }

        return View(routePartner);
    }

    // POST: RoutePartners/Delete/5
    [HttpPost, ActionName("Delete")]
    [ValidateAntiForgeryToken]
    public async Task<IActionResult> DeleteConfirmed(Guid id)
    {
        var routePartner = await _context.RoutePartner.SingleOrDefaultAsync(m => m.PartnerId == id);
        _context.RoutePartner.Remove(routePartner);
        await _context.SaveChangesAsync();
        return RedirectToAction("Index");
    }

    private bool RoutePartnerExists(Guid id)
    {
        return _context.RoutePartner.Any(e => e.PartnerId == id);
    }
}

A: Ok, I figured out what's wrong. I have a table with 7 columns. Column one is an "Id" column that we use to quickly identify a row. It is NOT the primary key. Columns 2, 3 and 4 are the primary key. Oddly when the scaffolding was generated, the primary key columns were NOT included in the view. This ultimately led to the views not working. Is this a VS 2017 bug?


text:
Q: Multiple conditions with OR || in 'if' statement JS I am trying to write multiple conditions in the one 'if' statement with OR.
sudo code I am trying to write:
if the status is empty navigate, if the status is 'completed' navigate, if the status is 'failed' navigate.
This is my code so far:
   if ((_.isEmpty($scope.status)) || ($scope.status != ('completed' || 'failed'))) {
        return frameworkService.navigateTo('giftcardWelcome');
    }

The _.isEmpty check works, the checking if status is 'completed' works, but when checking the || for 'failed' it is not executing this.
Can someone explain to me why and how to write it correctly please? I know I could write a widened out if statement but wanted a clean refactored way.

A: ('completed' || 'failed') === 'completed' - because that's how javascript works - you need to check equality individually ...
You'll need
|| ($scope.status != 'completed' &&  $scope.status != 'failed')

note && not || ... because $scope.status != 'completed' || $scope.status != 'failed' will ALWAYS be true - because of logic

A: $scope.status != ('completed' || 'failed')

This does not do what you think it does. In JavaScript A || B returns A if it is truthy, otherwise B; since 'completed' is truthy, this is equivalent to
$scope.status != 'completed'

In order to check whether $scope.status is one of the two values, you need to either check both are different explicitly (note &&, not ||):
$scope.status != 'completed' && $scope.status != 'failed')

or test that it is not in a set (or another container):
let endSet = new Set(['completed', 'failed']);
// ...

endSet.has($scope.status)

A: The expression $scope.status != ('completed' || 'failed') really works as it looks, it does a logical OR between 'completed' and 'failed', and then compares the result of that expression against $scope.status.
The result of 'completed' || 'failed' will be 'completed', so that means your condition is really equivalent to $scope.status != 'completed'.
If you want to make sure that $scope.status is not equal to either string, you need to compare against each string explicitly: ($scope.status != 'completed' && $scope.status != 'failed').


text:
Q: Gradle configurations integration I've found this code at work in build.gradle
configurations {
    all {
        resolutionStrategy {
            cacheDynamicVersionsFor 0, 'seconds'
        }
    }
    integration
}

I can't find anywhere what integration keyword stands for. Can you explain to me?

A: In this example, the build is declaring a new configuration called integration. And a configuration can for the most part be thought of as a bucket or collection of dependencies. If a plugin or the Gradle core new about a particular configuration, there would usually be no need to declare it as it would already exist to begin with.
Let's assume that 'integration' is short for 'integration test'. Then what's going on here is that your build is saying: "Hey, I need a bunch of dependencies for running my integration test, but I don't want to pollute the classpath for the other kinds of runtime environments. So please make me a bucket of dependencies to isolate the integration test".
Later in the build file (which you didn't show), you will then find a dependencies block where the integration configuration is populated with the modules needed for running the test. And lastly, some task that actually uses it, presumably for setting the classpath.
It could be used for a number of other things of cause. But whatever it is, it is probably something custom and you could rename it (and all references to it) to 'aCollectionOfAwesomeDependenciesUsedForRunningOurIntegrationTest' if you like.


text:
Q: Images in dynamically generated HTML elements are still cached, even after Ctrl-F5 After refreshing a page with Ctrl+F5 in IE or Ctrl+Shift+R in Chrome, most of the images also refresh, but a few that are referenced from dynamically generated HTML elements (via AJAX/jQuery) are NOT.  The images that are fetched after dynamic DOM updates seem to always hit the cache, even though the page was hard-refreshed.
Example fiddle:  http://jsfiddle.net/dhDju/4/
(and use "Network" tab in Chrome / IE developer tools.)
This is consistent in Chrome and IE - Chrome will show the image request "from cache" and IE will not show it at all.  It seems like the hard-refresh doesn't apply to subsequent DOM modifications on the page.
So changes to those images don't take effect unless I explicitly clear my cache.
I've occasionally seen this with scripts as well, when using requires.js - in that case the <script> tag is also generated dynamically.
Any idea why this happens, or how to fix it?
The cache-control/max-age headers don't seem to matter for the dynamic elements.  My QA servers have no cache-control or expires headers and I still have this issue with dynamic elements.  The main difference I see is that, without cache headers, "normal" <img> resources will also refresh with conditional GET/304 not modified responses on a soft reload with F5 or Ctrl+R.
I'm familiar with the idea of renaming files after releases - not ideal because this also impacts development and QA servers on each build.  It's also annoying to have to tell testers to clear their cache after every build.  So I'm wondering if there's a way to address at root cause.
Thanks!

A: I'll often append a website version value to CSS, JS, and image files. Then after an update I can increment the version and browsers will load the latest files. For example:
<img src="picture.jpg?v=1.1">


text:
Q: hiding maya python plugin files I'm developing a maya scripted plugin that contains multiple nodes. For convenience I have split each node into a separate file like so
plug-ins
   |----- main_plugin.py
   |----- plugin_node_1.py
   |----- plugin_node_2.py

Currently I have set the plugin up so you just enable main_plugin.py and the others are then loaded automatically. This is ok but un-tidy as all the other plugins are paying about cluttering the plugin manager.
Other than rolling all the plugin files into one file whats the best way to clean this up a bit. Is there a way to mask some plugins from the plugin manager?

A: I worked out that all you need for the main_plugin.py file is an initializePlugin(obj) and an uninitializePlugin(obj) function definition. Then you can call import and initialise any other plugin files from anywhere in the python PATH like so:
def initializePlugin(obj):
    try:
        import plugin_node_1
        plugin_node_1.initializePlugin(obj)

        import plugin_node_2
        plugin_node_2.initializePlugin(obj)

    except:
        print 'Failed to register plug-in'

    ms_menu.createMenu()
    ms_menu.buildMenu()

def uninitializePlugin(obj):
    try:
        import plugin_node_1
        plugin_node_1.uninitializePlugin(obj)

        import plugin_node_2
        plugin_node_2.uninitializePlugin(obj)

    except:
        print 'Failed to deregister plug-in'

    ms_menu.deleteMenu()


text:
Q: Adding test details to a VSTS / TFS test summary I'm running automated Selenium tests and need to record some of the test details (username that was created, password etc) - how do I add these details to a VSTS / TFS test summary?
It seems like the Details section would be the ideal place, but I can't find a way to add data in there... I looked at using TestContext, but that didn't seem to provide this functionality.
VSTS test summary

A: There isn't any way to do this. "Details" section is used to show the detailed information about the test step for Manual Run:

A: I would suggest to create a file during the of the details and add it as an attachment in the
"Attachments" section
you can do it using the REST API as explained in https://learn.microsoft.com/en-us/vsts/integrate/previous-apis/test/attachments?view=vsts


text:
Q: NameVirtualHost *:80 and 443 has no VirtualHosts on centos Since I added IPs to my server, I have a lot of issues when starting apache.
I always have these errors below:
[warn] NameVirtualHost *:443 has no VirtualHosts
[warn] NameVirtualHost *:80 has no VirtualHosts

Sometimes it prevents apache to start, and sometimes not
My conf:

OS : CentOS 6.6
Apache : 2.2.15

My httpd.conf:
NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
    ServerName www.domain.com
    ....
</VirtualHost>
#more than 500 others <VirtualHost *:80> for each domain

A: Your config can work for some times, but mostly it unworkable. Working config look like:
NameVirtualHost *:80

<VirtualHost *:80>
   ServerName www.domain.com
   ....
</VirtualHost>

NameVirtualHost *:443

<VirtualHost *:443>
      ServerName www.domain.com
      ....
<VirtualHost *:443>

Or made separate file for vhosts.conf (In centos your path for file will be /etc/httpd/conf.d/vhosts.conf). If you need separate tls certificate for every virtual host you need some additional changes.


text:
Q: C++ operator overloading for complex number operations I have an assignment in C++ and I'm having trouble getting started. The goal is to "design a class that uses the following overloaded operators for complex numbers: >>  << + - * / "
My question isn't about the syntax of this, but more about the logic. I could use some help brain storming.
Input Sample:
2.5 -2.2
1.0 1.0
OutPut Sample:
A = (2.5) + (-2.2)i
B = (1.0) + (1.0)i

A + B = (3.5) + (-1.2)i
A - B = ..............
A * B = ..............
A / B = ..............
So how do I start this? The class "Complex" overloads these operators, so does that mean that I can only use these operators in the class (i.e. inside public functions)? If so would I want to do it this way? Or would I want to do it in my client/driver code?
Second, is it just adding i to the second value of each line? That seems too easy. Any direction would be much appreciated. (Just for the record, I'm not looking for anybody to do my homework for me... could just use some input)

A: It seems to me that the point is to demonstrate class operation overloading, so I think the idea is for you to make a class Complex which holds information about the real number and the imaginary number (the i means it's imaginary).  Handle various operations between complex numbers in operator overrides you do yourself.
Once you have that and you see that it works (make a static test method which does various operations and prints the results to the screen), then worry about using that class to work with input since parsing input will be another task in of itself.  Sometimes it's just simpler to divide problems into smaller problems than to attempt to do both at the same time.
Hope that helps.  Good luck!

A: They like pairs of values:
A = N1 + I1i
B = N2 + I2i

A + B = (N1 + I1i) + (N2 + I2i)
      = N1 + I1i + N2 + I2i
      = (N1 + N2) + (I1i + I2i)
      = (N1 + N2) + (I1 + I2)i
A - B = (N1 + I1i) - (N2 + I2i)
      = N1 + I1i - N2 - I2i
      = (N1 - N2) + (I1i - I2i)
      = (N1 - N2) + (I1 - I2)i

// N1, N2, I1, I2 are all just normal numbers.
// You can multiply them like normal. You just have to keep track of the `i`
// Also not that i = sqrt(-1)
// Therefore  i * i = sqrt(-1) * sqrt(-1)
//                  = sqrt(-1)^2
//                  = -1
A * B = (N1 + I1i) * (N2 + I2i)
      = (N1 * N2) + (N1 * I2i) + (I1i * N2) + (I1i * I2i)
      = (N1 * N2) + (N1 * I2)i + (N2 * I1)i + (i * i * I1 * I2)
      = (N1 * N2) + i((N1 * I2) + (N2 * I1)) + (-1 * I1 * I2)

      // Simplest form
      = ((N1 * N2) - (I1 * I2)) + ((N1 * I2) + (N2 * I1))i

A / B = Repeat as above.

A: You need to design a class called Complex that includes at least:

*

*a constructor allowing you to construct a Complex object from real and imaginary component values e.g. Complex(1, 5)

*overrides the + operator so that you can add two Complex objects, returning a new Complex object e.g. Complex(1, 5) + Complex(3, 7) is Complex(4, 12)

*similarly for other operators
But first you need to understand the basic math behind complex numbers so that you can write the operator overload methods.

A: There are a few things you have to do to accomplish this task:
Define a class (e.g. Complex) that can hold the data for the real and imaginary part of a complex number.
Overload the respective operators (e.g.):
class Complex
{
public:
    // other declarations here
    Complex operator+ (const Complex& rhs) const;
    // other stuff here
};

Implement the respective operators to actually perform the mathematical operation (e.g.):
Complex Complex::operator+ (const Complex& rhs) const
{
    Complex result = *this;
    result.Real += rhs.Real;
    result.Imaginary += rhs.Imaginary;
    return result;
}

A: Hope you are done with homework now :) Here is my solution if anyone still needs help.
#include <string>
#include <sstream>
#include <iostream>

using namespace std;

class Complex {
    float real_, imaginary_;
  public:
    Complex (float, float);
    Complex operator= (const Complex& rhs);
    Complex operator+ (const Complex& rhs) const;
    Complex operator- (const Complex& rhs) const;
    Complex operator* (const Complex& rhs) const;
    string toString() const;
};

Complex::Complex (float r, float i){
  real_ = r;
  imaginary_ = i;
}

Complex Complex::operator= (const Complex& rhs){
    real_ = rhs.real_;
    imaginary_ = rhs.imaginary_;
    return *this;
}

Complex Complex::operator+ (const Complex& rhs) const{
    Complex result = *this;
    result.real_ += rhs.real_;
    result.imaginary_ += rhs.imaginary_;
    return result;
}

Complex Complex::operator- (const Complex& rhs) const{
    Complex result = *this;
    result.real_ -= rhs.real_;
    result.imaginary_ -= rhs.imaginary_;
    return result;
}

Complex Complex::operator* (const Complex& rhs) const{
    Complex result = *this; // this-> == *this == (*this)
    result.real_ = real_ * rhs.real_ - imaginary_ * rhs.imaginary_;
    //cout << result.real_ << "R " << result.imaginary_ << "I "<< "|" << rhs.real_ << "R " << rhs.imaginary_ << "I\n";
    result.imaginary_ = (real_ * rhs.imaginary_) + (rhs.real_ * imaginary_);
    //cout << result.real_ << "R " << result.imaginary_ << "I "<< "|" << rhs.real_ << "R " << rhs.imaginary_ << "I\n";
    return result;
}

string Complex::toString() const {
  stringstream ss;
  if (imaginary_ > 0){
    ss << real_ << " + " << imaginary_ << "i";
  }
  else {
    ss << real_ << " " << imaginary_ << "i";
  }
  return ss.str();
}

int main () {
  Complex a(5, 6);
  Complex b(1, 4);

  Complex sum = a + b;
  Complex dif = a - b;
  Complex pro = a * b;

  cout << "sum: " << sum.toString() << "\n";
  cout << "difference: " << dif.toString() << "\n";
  cout << "product: " << pro.toString() << "\n";

  return 0;
}