text:
Q: mule until-successful router: is objectStore mandatory? I am consuming a message from JMS queue and submitting it to a SOAP base web service. I want to make sure that I provide guaranteed delivery of the message to the web service where I am submitting the message.
I'm looking at two options
1. Use until-successful router (preferred) and if unable to transmit the message put it in Dead Letter Queue.
2. Use JMS transactions, and if the transmission of message to the web service fails rollback the transaction and the JMS message stays in the queue.
<jms:inbound-endpoint queue="ws.message"/>
<until-successful objectStore-ref="objectStore"
              dlqEndpoint-ref="dlqChannel"
              maxRetries="3"
              secondsBetweenRetries="10">
...
</until-successful>

I am more inclined towards using until–successful router but the concern that I have is it requires a mandatory ObjectStore. I do not want to store the message in database/object store, instead push it to some JMS queue/a dead letter queue and consume it from there.
Any helpful tips or suggestions to handle the situation are appreciated.

A: If you use until-successful, a reference to an objectStore is mandatory. Mule uses this object to store messages between retries. Also, you should use a persistent object store to avoid message loss in case of the Mule server or your application crashes.
Until-successful router should be the preferred method for this use case IMO. It will make the config easier to read and maintain vs using just jms queues.


text:
Q: PIL creating a fuzzy image I'm currently working on a little project in which I'm trying to generate a random image of a set size with a set palette. Everything generates fine and dandy, but zooming in on the image shows the pixels are interpolated in a way that doesn't look great. I would prefer if the pixels had hard edges, as with nearest neighbor interpolation. How would I go about doing that? See code below:

#!/usr/bin/env

import random
from PIL import Image

colors = ["#ffffff", "#898d90", "#000000", "#cf0530", "#2450a4", "#7eed56", "#ffd635", "#6134e1",
          "#ffa800", "#6d482f", "#ff3881", "#51e9f4", "#fff8b8", "#94b3ff", "#158d62", "#515252"  ]

def main():

    size = width, height = 128, 128
    image = Image.new( "RGB", size)
    fillRand(image, size)

    image.show()

    del image

def randColor():

    color = random.choice(colors)
    return color

def hex_to_rgb(hex):

  return tuple(int(hex.lstrip('#')[i:i+2], 16) for i in (0, 2, 4))

def fillRand(image, size):

    for x in range(size[0]):
        for y in range(size[1]):
            pixel_access_object = image.load()
            pixel_access_object[x,y] = (hex_to_rgb(randColor()))

if ( __name__ == "__main__"):
    main()

Thank you in advance!
P.S. - Python isn't my main language and I'm rusty in general, so apologies if my code is wack.

A: I think that's a problem with your image viewer. I used ImageGlass, and there the pixels have crisp edges. A possible solution would be to make your pixels bigger, so you color 16x16 pixels the same color, instead of one. Then the interpolation woulden't be as visible.

redpajama_set_name: RedPajamaStackExchange


text:
Q: ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24) I have a dataframe whose rows 34180 to 34221 look like this for column 'MYTIME'.
df_fl2['MYTIME'].iloc[34180:34221]
34180    2022-03-02 1900-10-22 23:00:00
34181    2022-03-02 1900-10-23 00:00:00
34182    2022-03-02 1900-10-23 01:00:00
34183    2022-03-02 1900-10-23 02:00:00
34184    2022-03-02 1900-10-23 03:00:00
34185    2022-03-02 1900-10-23 04:00:00
34186    2022-03-02 1900-10-23 05:00:00
34187    2022-03-02 1900-10-23 06:00:00
34188    2022-03-02 1900-10-23 07:00:00
34189    2022-03-02 1900-10-23 08:00:00
34190    2022-03-02 1900-10-23 09:00:00
34191    2022-03-02 1900-10-23 10:00:00
34192    2022-03-02 1900-10-23 11:00:00
34193    2022-03-02 1900-10-23 12:00:00
34194    2022-03-02 1900-10-23 13:00:00
34195    2022-03-02 1900-10-23 14:00:00
34196    2022-03-02 1900-10-23 15:00:00
34197    2022-03-02 1900-10-23 16:00:00
34198    2022-03-02 1900-10-23 17:00:00
34199    2022-03-02 1900-10-23 18:00:00
34200    2022-03-02 1900-10-23 19:00:00
34201    2022-03-02 1900-10-23 20:00:00
34202    2022-03-02 1900-10-23 21:00:00
34203    2022-03-02 1900-10-23 22:00:00
34204    2022-03-02 1900-10-23 23:00:00
34205    2022-03-02 1900-10-24 00:00:00
34206    2022-03-02 1900-10-24 01:00:00
34207    2022-03-02 1900-10-24 02:00:00
34208    2022-03-02 1900-10-24 03:00:00
34209    2022-03-02 1900-10-24 04:00:00
34210    2022-03-02 1900-10-24 05:00:00
34211    2022-03-02 1900-10-24 06:00:00
34212    2022-03-02 1900-10-24 07:00:00
34213    2022-03-02 1900-10-24 08:00:00
34214    2022-03-02 1900-10-24 09:00:00
34215    2022-03-02 1900-10-24 10:00:00
34216    2022-03-02 1900-10-24 11:00:00
34217    2022-03-02 1900-10-24 12:00:00
34218    2022-03-02 1900-10-24 13:00:00
34219    2022-03-02 1900-10-24 14:00:00
34220    2022-03-02 1900-10-24 15:00:00
Name: MYTIME, dtype: object

However, when trying to force a conversion to datetime.
pd.to_datetime(df_fl2['MYTIME'].iloc[34180:34221], errors='coerce')

This error shows:
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).

How could I ignore all the errors raised in the conversion? I thought errors='coerce' did always the trick.

A: strict parsing
Provide the expected format, everything that doesn't match will become NaT:
pd.to_datetime(df['MYTIME'], format='%Y-%m-%d %H:%M:%S', errors='coerce')

conversion
Assuming it is a mistake to have the 1900-... dates in the middle of the string, you could remove them:
pd.to_datetime(df['MYTIME'].str.replace(r' \S+ ', ' ', regex=True),
               errors='coerce')

output:
34180   2022-03-02 23:00:00
34181   2022-03-02 00:00:00
34182   2022-03-02 01:00:00
...
34219   2022-03-02 14:00:00
34220   2022-03-02 15:00:00
Name: MYTIME, dtype: datetime64[ns]

If you rather want to remove the 2022 dates:
pd.to_datetime(df['MYTIME'].str.replace('^\S+ ', ' ', regex=True),
               errors='coerce')


text:
Q: Compute Mean of off diagonal and mean diagonal elements for every 10 rows and 10 columns of matrix I have a matrix of 100r,100c and I need to calculate the mean of off-diagonal elements row 1:10, col 1:10 (upper and lower triangle) and the mean of diagonal elements (1:10). The rest of the data continue as the same pattern of 11:20, 21:30 and so on.
I anticipate the end result would become a 10x10 matrix.
a <- runif(100,0.0,1.0)
b <- matrix(a, 10,10)

dput(b[1:5,1:5])
structure(c(0.84062766819261, 0.147046645870432, 0.400851072976366,
0.413125045597553, 0.983001669868827, 0.875247176503763, 0.780131382867694,
0.135052096098661, 0.697219847934321, 0.124223494203761, 0.341172023210675,
0.0648272060789168, 0.495929004857317, 0.560068692779168, 0.427216225070879,
0.322575035970658, 0.380825364030898, 0.268939214758575, 0.308511241106316,
0.583480153232813, 0.220581432571635, 0.440520159434527, 0.281114168930799,
0.192230961984023, 0.468790194252506), dim = c(5L, 5L))

I've tried the below code, but it did not produce what I need, perhaps its lack of completeness. I hope there will be some simplistic approach to this.
group_number <-rep(1:(nrow(d_num)/10),each=10)
Mean_vals <- aggregate(d_num, by=list(group_number), mean)

Any suggestions please, thank you for your great help


text:
Q: PostgreSQL dynamic query comparing row from table to column name of another table I work with QGIS and PostgreSQL with PostGIS.  I need help with dynamic queries for PostgreSQL.
Information is structured in tables that contain votes for parties, and other types of information like geographic area or election date.
I need to work with "tidy" data in plotly for pie charts.  The desired end table must have one row per observation.
So for example for the given table "Election Results":

Country
PartyA
PartyB
PartyC

Argentina
100
10
20

Uruguay
3
5
1

Chile
40
200
50

Values for columns to be treated like parties, are stored in table "Parties":

Party

PartyA

PartyB

PartyC

PartyD

PartyE

I need to separate one observation of voting results per row as follows ("Ending Table"):

Country
Party
Votes

Argentina
PartyA
100

Argentina
PartyB
10

Argentina
PartyC
20

Uruguay
PartyA
3

Uruguay
PartyB
5

Uruguay
PartyC
1

Chile
PartyA
40

Chile
PartyB
200

Chile
PartyC
50

The query should work with any number of parties stored in the "Parties" table.  The "parties" table could include some rows not present in the election results table, but all parties in the election results table will exist in the "parties" table.
I understand it should be done iterating over the columns in the "Election results" table.  If the name of a column matches the value of a row in "party table", then we "untidy" data as in the "ending table".

A: You can "iterate" over the columns using Postgres's JSON functions:
Something like this:
select er."Country",
       pv.*
from election_results er
  cross join jsonb_each_text(to_jsonb(er) - 'Country') as pv(party, votes)
  join parties p on p.party = pv.party
;

Online example


text:
Q: Why do I need a delay before showing AlertDialog? Under some conditions, when my app starts, it displays an AlertDialog.  However, the alert never gets displayed.  I discovered that if I add a delay, it works (i.e. gets displayed).
More specifically: on app startup, it executes the main activity onCreate() which under a certain condition starts a 2nd activity.  In the 2nd activity, through a separate thread, it makes a check for some web server status.  If the Android device doesn't have Internet connectivity, HttpURLConnection returns an error instantly and my enclosing function executes a callback to the 2nd activity.  My code then uses post() to attempt to display an alert to the user (using post allows displaying the alert on the UI thread, which is required).
Apparently it tries to display the alert before any of the either activity's UI has been created.  If I use postDelayed() in the 2nd activity, the problem still persists.  However, if I use the following block of code in the main activity, the alert shows properly:
new Handler().postDelayed (new Runnable ()
{
  @Override public void run()
  {
    Intent intent = new Intent (app, MyClass.class);
    app.startActivityForResult (intent, requestCode);
  }
}, 3000);

My solution is a hack that happens to work at the moment.  I don't mind having a little delay on start-up for this particular situation but I don't want a delay that's longer than necessary or one that may sometimes fail.
What is the proper solution?

A: Ok, here's a workaround.  First, I'll speculate that the problem is that the attempt to display the alert is happening before the looper for the UI thread has been started.  Just a speculation.
To work around the problem I added a recursive post which gets called from onResume(), like this:
private boolean paused = true;

@Override public void onResume ()
{
  super.onResume();
  paused = false;
  checkForAlert();
}

@Override public void onPause ()
{
  super.onPause();
  paused = true;
}

And here's the function that does the post:
private AlertInfo alertInfo = null;

private void checkForAlert()
{
  if (alertInfo != null)
  {
    ...code to build alert goes here...
    alertInfo = null;
  }

  if (!paused)
    contentView.postDelayed (new Runnable()
    {
      @Override public void run() { checkForAlert(); }
    }, 200);
}

AlertInfo is a simple class where the thread needing the alert can put the relevant info, e.g. title, message.
So, how does this work?  checkForAlert() gets called during onResume() and will continue to get called every 200ms until "paused" is false, which happens in onPause().  It's guaranteed to be recurring whenever the activity is displayed.  The alert will get built and displayed if alertInfo is not null.  In the secondary thread, I simply create an AlertInfo instance and then within 200ms the alert gets displayed.  200ms is short enough that most people won't notice the delay.  It could be shorter but then battery use goes up.
Why did I start checkForAlert() in onResume instead of onCreate()? Simply because there's no need for it to run unless the activity is currently "on top".  This also helps with battery life.


text:
Q: After click on datepicker make input stay active I'm trying to figure out a problem that arises when you click on the input where the bootstrap datepicker is displayed and after clicking on the day the input fills correctly but the label goes back to the bottom.
But after the second click on the input, the label stays up.
I don't know how to make this mistake.
Thank you all in advance for your help and answer.

$('.form-group').each((i, e) => {
  $('.form-control', e)
    .focus(function() {
      e.classList.add('not-empty');
    })
    .blur(function() {
      this.value === '' ? e.classList.remove('not-empty') : null;
    });
});
$('#sandbox-container input').datepicker({
  format: "dd.mm.yyyy",
  calendarWeeks: true,
  autoclose: true,
  todayHighlight: true
});
/* === Form Control === */

.form-group {
  position: relative;
  margin-bottom: 10px;
}

.form-group input {
  border-radius: 0;
  -webkit-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  -moz-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
}

.form-group input:focus {
  box-shadow: none;
}

.form-group>.lForm-label {
  font-size: 10px;
  color: #9C9AB3;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4);
  transform: scale(1.4);
  pointer-events: none;
  position: relative;
  z-index: 5;
}

.form-group input {
  width: 100%;
}

.form-group>.lForm-label {
  -webkit-transition: -webkit-transform 0.4s;
  transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  transition: transform 0.4s, -webkit-transform 0.4s;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4) translateY(20px);
  transform: scale(1.4) translateY(20px);
}

.form-group.not-empty>.lForm-label {
  -webkit-transform: none;
  transform: none;
}

.form-group input {
  border: 0;
  border-bottom: 1px solid #9C9AB3;
}

.form-group input::placeholder:hover {
  display: none !important;
}

.form-group input,
.form-group input:focus,
.form-group input:focus:hover {
  color: #9C9AB3;
  background: none;
  outline: none;
}

.form-group input:focus,
.form-group input:focus:hover {
  border-bottom: 1px solid #fdd365;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker3.min.css" rel="stylesheet" />

  Date of birth

    <input type="text" name="dateofbirth" id="birthDateId" class="form-control" value="">

A: I think it will be better if you handle add/remove Class by using datePicker Events
Check this example

$('#sandbox-container input').datepicker({
  format: "dd.mm.yyyy",
  calendarWeeks: true,
  autoclose: true,
  todayHighlight: true
}).on('show', function(e) {
  $(this).parents(".form-group").addClass('not-empty')
}).on('hide', function(e) {
  if(!$(this).val())
    $(this).parents(".form-group").removeClass('not-empty')
});
/* === Form Control === */

.form-group {
  position: relative;
  margin-bottom: 10px;
}

.form-group input {
  border-radius: 0;
  -webkit-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  -moz-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
}

.form-group input:focus {
  box-shadow: none;
}

.form-group>.lForm-label {
  font-size: 10px;
  color: #9C9AB3;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4);
  transform: scale(1.4);
  pointer-events: none;
  position: relative;
  z-index: 5;
}

.form-group input {
  width: 100%;
}

.form-group>.lForm-label {
  -webkit-transition: -webkit-transform 0.4s;
  transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  transition: transform 0.4s, -webkit-transform 0.4s;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4) translateY(20px);
  transform: scale(1.4) translateY(20px);
}

.form-group.not-empty>.lForm-label {
  -webkit-transform: none;
  transform: none;
}

.form-group input {
  border: 0;
  border-bottom: 1px solid #9C9AB3;
}

.form-group input::placeholder:hover {
  display: none !important;
}

.form-group input,
.form-group input:focus,
.form-group input:focus:hover {
  color: #9C9AB3;
  background: none;
  outline: none;
}

.form-group input:focus,
.form-group input:focus:hover {
  border-bottom: 1px solid #fdd365;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker3.min.css" rel="stylesheet" />

  Date of birth

    <input type="text" name="dateofbirth" id="birthDateId" class="form-control" value="">

A: You have a timing-problem. On-Blur the input-value is not set yet. Better use the hide-event provided by bootstrap-datepicker like so:

$('.form-group').each((i, e) => {
  $('.form-control', e)
    .focus(function() {
      e.classList.add('not-empty');
    })
    .blur(function() {

      //this.value === '' ? e.classList.remove('not-empty') : null;

    });
});
$('#sandbox-container input').datepicker({
  format: "dd.mm.yyyy",
  calendarWeeks: true,
  autoclose: true,
  todayHighlight: true
}).on('hide', function (ev) {
  if(ev.target.value === '')
    $(ev.target).parents('.form-group').removeClass('not-empty')
})
/* === Form Control === */

.form-group {
  position: relative;
  margin-bottom: 10px;
}

.form-group input {
  border-radius: 0;
  -webkit-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  -moz-box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
}

.form-group input:focus {
  box-shadow: none;
}

.form-group>.lForm-label {
  font-size: 10px;
  color: #9C9AB3;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4);
  transform: scale(1.4);
  pointer-events: none;
  position: relative;
  z-index: 5;
}

.form-group input {
  width: 100%;
}

.form-group>.lForm-label {
  -webkit-transition: -webkit-transform 0.4s;
  transition: -webkit-transform 0.4s;
  transition: transform 0.4s;
  transition: transform 0.4s, -webkit-transform 0.4s;
  -webkit-transform-origin: 0 0;
  transform-origin: 0 0;
  -webkit-transform: scale(1.4) translateY(20px);
  transform: scale(1.4) translateY(20px);
}

.form-group.not-empty>.lForm-label {
  -webkit-transform: none;
  transform: none;
}

.form-group input {
  border: 0;
  border-bottom: 1px solid #9C9AB3;
}

.form-group input::placeholder:hover {
  display: none !important;
}

.form-group input,
.form-group input:focus,
.form-group input:focus:hover {
  color: #9C9AB3;
  background: none;
  outline: none;
}

.form-group input:focus,
.form-group input:focus:hover {
  border-bottom: 1px solid #fdd365;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker3.min.css" rel="stylesheet" />

  Date of birth

    <input type="text" name="dateofbirth" id="birthDateId" class="form-control" value="">


text:
Q: Wrong image size in loadad SVG with fabric.js I am trying to load an SVG file in canvas using fabric.js:
svg_url2 = "http://localhost/fabric/bozza biglietto-03.svg";

canvas = new fabric.Canvas('canvas');
fabric.loadSVGFromURL(svg_url2, function(objects) {

canvas.add.apply(canvas, objects);
canvas.renderAll();

The SVG file has an inline image which is rescaled, but when it loads in canvas the image is rendered at its original size.
If I paste the same SVG in the kichensink demo, it's displayed with ist correct dimensions. Am I missing something?
The SVG:
SVG image

A: Try this:
fabric.loadSVGFromURL(svg_url2, function(objects, options) {
   var obj = fabric.util.groupSVGElements(objects, options);
   canvas.add(obj).renderAll();
});

I should work.


text:
Q: axios interceptor's error function is called multiple times I am using axios interceptors to log all the api errors to a backend server at one common place. The problem is, if one api call fails the logError function is called multiple times and multiple duplicate requests were sent for logging.
Here's my code
axios.interceptors.response.use(response => {
    return response;
},
error => {
    logError(error.message);
    return Promise.reject(error);
})

A: This might be issue that your interceptor code initialized multiple times, I was facing the same issue and when it initialized once, solved the issue.


text:
Q: Bootstrap tooltip for dynamically changing content I use Bootstrap tooltips to create beautiful HTML tooltips for items. I basically have a skill image in the form of a .png image

i define the image into a variable
let skillImage = document.getElementById('skill');

then i initiate the tooltip like this:
skillImage.title = '
' + iceBolt.name + '

' + iceBolt.description + '

' + iceBolt.setLevel() + '

' + iceBolt.setDamage() + '

' + iceBolt.setDuration() + '

' + iceBolt.setManaCost() + '

' + iceBolt.name + ' Receives Bonuses From:

 ' + iceBolt.description + '
';

Now when i click on the skill image, i fire up an onclick function which increments the iceBolt.level++; . This successfully does that ( i also log the iceBolt.level into the console so i confirm it's changing) but the bootstrap tooltip remains unchanged (doesn't reflect the iceBolt.level, even though i've set it up to display it)
Is my usage of the bootstrap tooltip bad or is it that the bootstrap tooltips won't handle something like this. I want to use them as they are responsive and easy to use.

A: UPDATE:
Code snipper shared, will help you update your tooltip title whenever some particular event occurs in your application.
The idea is: Setting my title dynamically  using a function call which returns the updated data.
 $("#skill").tooltip({
    placement: "right",
    title: userDetails, // userDetail() is a function which will return our updated data
    html: true,
  });

Function will look something like;
// Get user details for tooltip
function userDetails() {
  return tooltipText;
}

The event handler in which we update the content of tooltip.
 document.querySelector("button").addEventListener("click", () => {
  tooltipText += "Add"; // Updating my data
  userDetails();// Sending updated Title
})

FULL CODE:

$(document).ready(function () {
  // Add tooltip
  $("#skill").tooltip({
    placement: "right",
    title: userDetails,
    html: true,
  });
});
var tooltipText = "Hello";
// Get user details for tooltip
function userDetails() {
  return tooltipText;
}

document.querySelector("button").addEventListener("click", () => {
  tooltipText += "Add";
  userDetails();
});

    <title>Dashboard</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      rel="stylesheet"
      href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
    />
    <link
      rel="stylesheet"
      href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
    />
    <link rel="stylesheet" href="./style.css" />

    <button>Click Me</button>

YOU CAN USE THE SAME LOGIC TO PROCEED FORWARD IN YOU APPLICATION.

A: For anyone who is looking in the future. This solution is for Bootstrap - 5, using JQuery and Javascript.

*

*Init the Tooltip
var tootTipTitleText = 'True or False';

$(document).ready(function () {

    //Enable ToolTip
    $('[data-bs-toggle="tooltip"]').tooltip(
        {
            title: tootTipTitleText,
            html: true,
        }
    );
});

*Remove the Previous Tooltip on Button Click
$('[data-bs-toggle="tooltip"]').tooltip("dispose");

*

*Get the value to check.
if(checkBoxValue == true) {
    tootTipTitleText = 'true';
} else {
    tootTipTitleText = 'false';
}

*Init another tooltip
$('[data-bs-toggle="tooltip"]').tooltip(
    {
        title: tootTipTitleText,
        html: true,
    }
);

*Display The Tooltip
$('[data-bs-toggle="tooltip"]').tooltip("show");

*Sample HTML and JS Function

function changeToolTipTitle()
{
    $('[data-bs-toggle="tooltip"]').tooltip("dispose");

    var checkBoxValue = $("#toolTipCheckBox").is(":checked");

    if(checkBoxValue == true)
    {
        //title="Checked or Unchecked"
        tootTipTitleText = 'Checked';
    }
    else
    {
        tootTipTitleText = 'Unchecked';
    }

    $('[data-bs-toggle="tooltip"]').tooltip(
        {
            title: tootTipTitleText,
            html: true,
        }
    );

    $('[data-bs-toggle="tooltip"]').tooltip("show");
}

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

<input class="form-check-input" type="checkbox" id="toolTipCheckBox" value="true" onchange="changeToolTipTitle();" />
Check


text:
Q: How do I get the current position of my map? (leaflet.js) I'm using Leaflet.js and on a user interaction (which happens outside of the map div), I want to get the current position (lat, lng, zoom).
I could find zoom, but the field _lastCenter doesn't get me the actual position, instead I get the coordinates from the map initialisation.
How can I get the current coordinates?
this.getZoom = function () { return map._zoom }
this.getLat = function () { return map._lastCenter.lat }
this.getLon = function () { return map._lastCenter.lng  }


text:
Q: asp.net mvc 3 - set global user data How can I set global user data that retain some information like name, lastname, etc through pages? If I use session variable it expires before auth cookie
thanks!

A: You can store data for the time of auth session by utilising userdata field in auth cookie.
Code below is the LogOn action from AccountController in default MVC project:
 [HttpPost]
 public ActionResult LogOn(LogOnModel model, string returnUrl)
 {
    if (ModelState.IsValid)
    {
        if (Membership.ValidateUser(model.UserName, model.Password))
        {
            FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
            if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
                && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
            {
                return Redirect(returnUrl);
            }
            else
            {
                return RedirectToAction("Index", "Home");
            }
        }
        else
        {
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
        }
    }
    // If we got this far, something failed, redisplay form
    return View(model);
}

You can replace:
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);

with:
string fullName = "User full name";

FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(2, model.Email, DateTime.Now,
                DateTime.Now.AddDays(2), model.RememberMe, fullName);

string encTicket = FormsAuthentication.Encrypt(ticket);
Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket) { Expires = DateTime.Now.AddDays(2) });

If you want to store more data than you can pack in a normal string you will have to look into some sort of data serializer.
Then, you will have to implement something to parse serialized data when auth cookie is used.
Data is available through:
((FormsIdentity)User.Identity).Ticket.UserData;

Hope that helps
Edit:
Also change DateTime.Now.AddDays(2) to whatever you want your auth session to remain valid.

A: Session state may be configured in a variety of ways to address the issues above.  Specifically, if using in-process session state (wherein state is maintained within the same application domain/pool as the running application), simply increase the timeout to be equal-to or greater-than the form cookie timeout.  If you wish to store session out-of-process (on a remote system or in a database), configure accordingly.
Here are a few resources:

*

*Troubleshooting Expired ASPNET Session State

*Why would Asp.net mvc use session state

A: Storing it in your auth cookie can be forged, and it can expire as well.
How about this - if you can make your session and auth cookie expire at the same time, would that work? If so, I can provide that solution to you easily.
The code below checks if the session is not available, if so you are redirected to the login page.
Change login.aspx below to whatever your login is. Also upon login you MUST set Session["UniqueUserId"] to be some value (could be anything.. just needs to be set to something)

protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
        {
            //Only access session state if it is available
            if (Context.Handler is IRequiresSessionState || Context.Handler is IReadOnlySessionState)
            {
                //If we are authenticated AND we dont have a session here.. redirect to login page.
                HttpCookie authenticationCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
                if (authenticationCookie != null)
                {
                    FormsAuthenticationTicket authenticationTicket = FormsAuthentication.Decrypt(authenticationCookie.Value);
                    if (!authenticationTicket.Expired)
                    {
                        if (Session["UniqueUserId"] == null)
                        {
                            //This means for some reason the session expired before the authentication ticket. Force a login.
                            FormsAuthentication.SignOut();
                            Response.Redirect("Login.aspx", true);
                            return;
                        }
                    }
                }
            }
        }


text:
Q: iterating though files in extracted directories and running an exe against the file with parameters Ok, so here is what I am trying to do - I have a bunch of archives that are named:
newnslog.0.tar.gz
newnslog.1.tar.gz
newnslog.2.tar.gz
newnslog.3.tar.gz
newnslog.4.tar.gz
.
.
.

once each is extracted, I want to iterate through all the files in that directory and run an exe against the data in the file.
#extract:
tar -xzf newnslog.58.tar.gz
#cd:
cd newnslog.59 < yes the filename in the archive may be 1 more or less or the same as it is a continuation
#ls:
newnslog.ppe.0  newnslog.ppe.1  newnslog.ppe.2
#execute nsc2e with parameters against each file:
# ../nsc2e -c /netscaler/nsconmsg -K newnslog.ppe.0 -f ../nsc2e.conf

I am trying a for - do loop but I must be doing something wrong:
root@VPX-13# for f in *; do '../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf'; done
-bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory
-bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory
-bash: ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf: No such file or directory

I also know there must be a streamlined way to do everything including the extraction - something like:
find newnslog* -prune -type d | while IFS= read -r d; do
    cd "$d"
    for f in *; do '../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf'; done
done

A: Dropping the quotes around the command as per ilkkachu's comment:
for f in *; do ../nsc2e -c /netscaler/nsconmsg -K "$f" -f ../ns2ce.conf; done

... solved the issue.


text:
Q: Accessing an object inside an object I'm trying to access an object inside an object but i have trouble figure out how.
{
  id: "335f",
  symbol: "fr",
  name: "nom",
  categories: [
    "Langue"
  ],
  localization: {
    fr: "bonjour",
    en: "hello",
  },

I would like to access 'fr' inside of 'localization';
I managed to console log data.localization but i can't access only the fr (it log everything)
    const [data, setData] = useState({ coin: [] });

    useEffect(() => {
        const fetchData = async () => {
            const result = await axios(url);
            setData(result.data);
        };
        fetchData();
    }, []);

console.log(data.localization)

A: Just move console.log(data.localization) inside async context, so:
useEffect(() => {
    const fetchData = async () => {
        const result = await axios(url);
        setData(result.data);
        console.log(result.data.localization);
    };
    fetchData();
}, []);


text:
Q: Adding anchors to h2 in text using python and regexp I'm trying to add anchors to all h2's in my html, using python. This code will add those anchors, but I need to fill the name of the anchors too.
Any idea if the name can be the number of the match in the loop or a slugified version of the text between the h2 tags?
Here's the code so far:
regex = '(?P<name>
.*?
)'
text = re.sub(regex, ""+r"\g<name>", text)

A: You can take advantage of the fact that the second argument to re.sub can be a function to do pretty much anything you'd like.  Here's an example that will slugify the text inside the
 element:
regex = '(?P<name>
(.*?)
)' # Note the extra group inside the

def slugify(s):
    return s.replace(' ', '-') # bare-bones slugify

def anchorize(matchobj):
    return '%s' % (slugify(matchob.group(2)), matchobj.group(1))

text = re.sub(regex, anchorize, text)

(That slugify function could obviously use some work.)
You could also implement a counter with a version of anchorize that used a global counter or, better yet, a class that kept track of its own counter and implemented the special __call__ method.

A: Not sure if I understand correctly, but is placing the author as the name attribute sufficient?
Maybe you could use (as long as the author name doesn't contain invalid chars for an attribute):
regex = '(?P<name>
(.*?)
)'
print re.sub(regex, "<a name='\g<2>'/>"+r"\g<name>", text)

If you need a more advanced substitution method, parsing the author name or looking up some sort of related id, you could define a replacement function (see re substitute doc):
def name_substitution(matchobj):
    name = matchobj.group(2)
    # do some processing on name here ...
    name = name.replace(' ', '_')
    return "%s" % (name, matchobj.group(0))

print re.sub(regex, substitution, text)


text:
Q: How can I display a file selected from directory listview control with c# window forms? My code below displays the listview of a folder, which is selected by the folderBrowser control. After displaying the folders and files in a list view, I want to open the file which is clicked. I have written the following code using LISTVIEW_itemactivation. The problem is that I can't open the selected file. What am I doing wrong?
private void PopulateListView()
{
    listView1.Clear();
    //headers listview

    listView1.Columns.Add("File Name", 150);
    listView1.Columns.Add("Last Accessed", 110);
    listView1.Columns.Add("Size", 100);
    //listView1.ItemActivate += new System.EventHandler(listView1_ItemActivate);

    if (folderBrowser.ShowDialog() == DialogResult.OK)
    {

        string[] files = Directory.GetFiles(folderBrowser.SelectedPath);
        string[] folders = Directory.GetDirectories(folderBrowser.SelectedPath);
        foreach (string file in files)
        {
            long folderSize = 0;
            string fileName = Path.GetFileNameWithoutExtension(file);

            FileInfo finfo = new FileInfo(file);
            folderSize += finfo.Length;

            ListViewItem item = new ListViewItem(new[] { fileName, File.GetLastAccessTime(file).ToString(), finfo.Length.ToString() });

            images();
            item.ImageIndex = 1;
            listView1.Items.Add(item);

        }

        foreach (string file in folders)
        {
            string fileName = Path.GetFileNameWithoutExtension(file);
            ListViewItem item = new ListViewItem(new[] { fileName, File.GetLastAccessTime(file).ToString(), file.Length.ToString() });
            images();
            item.ImageIndex = 0;
            listView1.Items.Add(item);
        }
    }
}
private void button1_Click(object sender, EventArgs e)
{
    PopulateListView();
    textBox1.Text = folderBrowser.SelectedPath;
}
private void images(){
    try
    {
        imageList1.Images.Add(Bitmap.FromFile("./images/file.gif"));
        imageList1.Images.Add(Bitmap.FromFile("./images/Folder.gif"));
    }
    catch (FileNotFoundException) { }

}

private void listView1_DoubleClick(object sender, EventArgs e)
{

        ListViewItem item_clicked = listView1.SelectedItems[0];

}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
    listView1.View = View.LargeIcon;
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
    listView1.View = View.SmallIcon;
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
    listView1.View = View.Details;
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)
{
    listView1.View = View.List;
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)
{
    listView1.View = View.Tile;
}

private void listView1_ItemActivate(object sender, EventArgs e)
{

        try
        {
    string sPath = listView1.SelectedItems.ToString();
    string sFileName = listView1.FocusedItem.Text;

    Process.Start(sPath + "\\" + sFileName);
}
catch(Exception Exc)    {   MessageBox.Show(Exc.ToString());    }
}

A: Well, based on how you're populating the list, this modified code should work.
private void listView1_ItemActivate(object sender, EventArgs e)
{
    try
    {
        string sPath = listView1.SelectedItem.SubItems[0].Text;
        Process.Start(sPath);
    }
    catch(Exception Exc)
    {
        MessageBox.Show(Exc.ToString());
    }
}

But you'll also need to get rid of this line because you'll never be able to load the file without knowing it's extension.
string fileName = Path.GetFileNameWithoutExtension(file);

See, when you load a ListViewItem like you are it's loading all of the SubItems with that array. Further, the array returned by Directory.GetFiles(folderBrowser.SelectedPath); returns an array of files with a full path to them, so, if you pick up the first SubItem that's going to be the full path to that file and thus issuing Process.Start on that file path will cause the shell to open the file in its default program.


text:
Q: array([....])is not a callable object. What does this mean in python? I am writing a python code to create a curve fit o a circle and plot it along with the original data. I followed examples here:https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
but cannot understand why this error is coming up in my code, saying the array is not callable. What does it mean? The last block of code after the comment "curvefit" is where the error occurs.
The error is as follows: (the array here is the result of calcCircleFunction() )
runfile('/untitled25.py', wdir='C:/XYZsara/testing/testing stj file')
r= 5
[10.          9.53518102  7.69656593  8.85865225 11.77599647 14.26300842
 16.59986154 18.86270235 21.08280172 23.27574271 25.45026401 27.6116804
 29.76342361 31.90781435 34.04648108 36.18060165 38.31104984 40.43848797
 42.56342747 44.68626971]
Traceback (most recent call last):

  File "\untitled25.py", line 46, in <module>
    popt = curve_fit(circle, xTraj,yTraj)   #array of curve fit version of circles

  File "\anaconda3\lib\site-packages\scipy\optimize\minpack.py", line 686, in curve_fit
    args, varargs, varkw, defaults = _getargspec(f)

  File "\anaconda3\lib\site-packages\scipy\_lib\_util.py", line 298, in getargspec_no_self
    sig = inspect.signature(func)

  File "\anaconda3\lib\inspect.py", line 3083, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)

  File "\anaconda3\lib\inspect.py", line 2833, in from_callable
    follow_wrapper_chains=follow_wrapped)

  File "\anaconda3\lib\inspect.py", line 2208, in _signature_from_callable
    raise TypeError('{!r} is not a callable object'.format(obj))

TypeError: array([10.        ,  9.53518102,  7.69656593,  8.85865225, 11.77599647,
       14.26300842, 16.59986154, 18.86270235, 21.08280172, 23.27574271,
       25.45026401, 27.6116804 , 29.76342361, 31.90781435, 34.04648108,
       36.18060165, 38.31104984, 40.43848797, 42.56342747, 44.68626971]) is not a callable object

from random import random
from scipy.optimize import fsolve, curve_fit
import numpy as np
import matplotlib.pyplot as plt

xi = 0
xf = 40
yi = 0
radius = 5
numPoints = 20
xdata = np.linspace(xi,xf,numPoints)

def calcCircleFunction(x):  #calculate the function of circle in 2D
    [a,b] = calcCenters(vars)
    print("r=",radius)
    circle = np.sqrt(abs((x-a)**2-radius**2)) + b
    return circle

def calcCenters(vars):
    a, b = fsolve(solve_ab, [1,1])
    return [a,b]

def solve_ab(vars):
    a,b = vars
    f1 = (xi-a)**2 + (yi-b)**2 - radius**2
    f2 = (xi-a)**2 + ((yi+2*radius)-b)**2 - radius**2
    f = [f1,f2]
    return f

circle = calcCircleFunction(xdata)
print(circle)

"""curvefit"""
xTraj = np.linspace(xi,xf,numPoints)
yTraj = circle + 0.01*random()   #with noise
#print(yTraj)
popt = curve_fit(circle, xTraj,yTraj)   #array of curve fit version of circles
plt.plot(xTraj, yTraj, 'b-')   #plots the originral trajecory
plt.plot(xdata, calcCircleFunction(xdata, *popt), 'r-')
plt.show()

A: Well, curve_fit's first argument requires a function, not array or list.


text:
Q: How do I assign click events and IDs to multiple buttons in twitter bootstrap? I currently have multiple drop down buttons for several table rows that need to be tied to an onClick event.  The problem I'm having is capturing the information from each button. Here is what my test code looks like:

       User

 Edit

 Delete

       User

 Edit

 Delete

current javascript:
$('.btn').click(function(e) {
    e.preventDefault();
    ???
});

How do I capture and process each click event from multiple buttons? I'm assuming I need to add a unique ID to each button but how can I capture an onclick event for each button item?

A: inside the function you can use this to reffer to the object in cause.
     $(".btn").click(function () {
     //here you can check which button did it
              if ($(this).attr('class')=='icon-pencil')
                //do sth
              else
      //do sth else
    });

Check the jquery docs.


text:
Q: Sorting with spring and querydsl I'm trying to get sorting working in a @RepositoryRestResource where I'm creating a custom query a couple of querydsl interfaces but I seem to be missing something. The paging works but you can't sort on fields that have more than one word (shippedQty). Sorting on other fields works fine. Is this a PagingAndSortingRepository bug or do I have to do something else or multi-word fields?
@RepositoryRestResource(path = "/report", collectionResourceRel = "report", itemResourceRel = "report")
public interface ReportRepository extends PagingAndSortingRepository<Report, Long>, QueryDslPredicateExecutor<Report>,
        QuerydslBinderCustomizer<QReport> {

    @Override
    default void customize(QuerydslBindings bindings, QReport report) {
        bindings.including(
                report.description,
                report.item,
                report.program,
                report.shippedQty,
        );
        bindings.excludeUnlistedProperties(true);

        SingleValueBinding<NumberPath<Integer>, Integer> numberPathContains = (path, value) -> path.stringValue().contains(value.toString());

        bindings.bind(firstFill.description).first(StringPath::containsIgnoreCase);
        bindings.bind(firstFill.item).first(StringPath::containsIgnoreCase);
        bindings.bind(firstFill.program).first(StringPath::containsIgnoreCase);
        bindings.bind(firstFill.shippedQty).as("shipped_qty").first(numberPathContains);

 }
}

This sorts correctly:
http://localhost:8080/api/v1/report?page=0&size=5&sort=description,asc

This does not:
http://localhost:8080/api/v1/report?page=0&size=5&sort=shipped_qty,asc

A: I just ran into this problem myself. It turns out that Sort does not use the QueryDSL repository binding aliases, but instead uses the names of the "Q" entity pathes.


text:
Q: how to use javascript to handle a large html checkbox? So I have something like this inside a form
<input type="checkbox" name="arr" value="A" />A
<input type="checkbox" name="arr" value="B" />B
<input type="checkbox" name="arr" value="C" />C
<input type="checkbox" name="arr" value="D" />D
<input type="checkbox" name="arr" value="E" />E
...
<more checkboxes here>
...

In my Javascript I want to create an array that consists the values of boxes that are checked. So if B and D are checked it should be [B, D].
thanks
EDIT: My bad for not including a jQuery tag, but the guy who deleted his answer gave me a nice and short working solution using jQuery:
var valueArray = $('input[type="checkbox"][name="arr"]:checked').map(function() {
    return this.value;
}).get();

A: Depending on what you're using it for, it may be enough to just use name="arr[]". When the form is submitted, the server-side will automatically convert the selected checkbox values to an array.
However, if you're trying to get this array purely in the client-side JavaScript, it's a little more involved. Try this:
function getCheckedBoxes(name) {
    if( document.querySelectorAll) {
        var qsa = document.querySelectorAll("input[type=checkbox][name='"+name+"']"),
            l = qsa.length, i, out = [];
        for( i=0; i<l; i++) if( qsa[i].checked) out.push(qsa[i].value);
    }
    else {
        var qsa = document.getElementsByTagName('input'), l = qsa.length, i, out = [];
        for( i=0; i<l; i++) {
            if( qsa[i].type == 'checkbox' && qsa[i].name == name && qsa[i].checked)
                out.push(qsa[i].value);
        }
    }
    return out;
};

A: you could use jquery like this:
$("input[type=checkbox][name=arr][checked]").each(
    function() {
       // collect the values
    }
);


text:
Q: Como puedo crear una Cookie en Django Quiero crear una cookie para guardar ciertos datos cuando el usuario inicia sesion. Se leer las cookies que existen con request.COOKIES['cookie_name'] pero no soy capaz de crear una.
Muchas gracias!

A: Según la Documentación de Django
 lo que debes hacer para enviar una cookie en la respuesta es precisamente, tomar la respuesta, y ayudarte del método set_cookie, el cual tiene los siguientes parámetros key, value='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False y debes usarlo de la siguiente forma:
#  cuando estes enviando tu respuesta
...
response = HttpResponse(content_type='text/html')
response.set_cookie('llave', 'valor')

Y lo recuperas tal como ya sabes hacerlo.


text:
Q: How to read xml from url C# I can't read xml string from http://158.58.185.214/Applications/Operator/Files/Data/Bus/CityList.xml and i think the encoding is the problem please help to solve it.
my code is:
        string url = "http://158.58.185.214/Applications/Operator/Files/Data/Bus/CityList.xml";
        WebClient client = new WebClient();
        string xml = client.DownloadString(url);

but the xml string is:
‹      í½`I–%&/mÊ{JõJ×àt¡€`$Ø@ìÁˆÍæ'ìiG#....

A: your problem can be solve like this
using System.Xml;
String URLString = " http://localhost/books.xml";
XmlTextReader reader = new XmlTextReader (URLString);

    while (reader.Read())
    {
    // Do some work here on the data.
     Console.WriteLine(reader.Name);
    }
Console.ReadLine();

refer this:https://support.microsoft.com/kb/307643/en-us


text:
Q: DbFit Connection for Remote Oracle Server via SSH Please help me connecting to remote Oracle Server.
Oracle 11g is hosted on a Unix Server, which we access

*

*Creating a SSH session . See Attachment 'Remote Host Connection.jpg'

*Creating a SSH tunnel.. See attachment 'Tunneling.jpg'
After the tunnel is established (2nd method), I though we should be able to establish connection from DbFit to DB server, but its not working. Connection timeout error is show.
Please help me to get the connection established

*

*Either directly creating a SSH tunnel from DbFit if possible.

*Or connect to DB server using the SSH tunnel created.

Below is the code used for testing
!path lib/*.jar
!|dbfit.OracleTest|

!|Connect|localhost:5000|<DB user name>|<password>|dbfit|

!|Query|select 'test' as x|
|x                        |
|test                     |

Please find attached screenshot with error displayed.

A: The issue was resolved.
It was problem with tunneling to the DB server and not with FitNesse.
Regards,
Kabilan


text:
Q: Closed subset with derived set non closed I'm looking for a topologic space $X$ and a $A\subset X$ closed such that $A'$ is not closed. Where $A'$ is the derived set of $A$. I'm trying with a $T_0$ space, like Sierpinski topology but I couldn't find the example.
If you can help me with any ideas it would be of great help.

A: You can't find an example because the derived set of a closed set is always closed. You can find the proof in the answer to this question.


text:
Q: using Inheritance with generics suppose that i have a base class
class Document
{
//some properties
}

and
two derived classes:
public class Order:Document
    {
    //some properties
    }
public class Request:Document
{
    //some properties
}

now i want make a layered application that have a service layer. also i want have a base service layer interface such as:
public interface IBaseService<T> where T:Document
{
    IList<T> GetAll();
}

that my layer service classes implement it:
public SaleService:IBaseService<Document>;

So i must define IList<Document> GetAll() to implement base service, but i want my SaleService has IList<Order> GetAll() and IList<Request> GetAll() methods, instead IList<Document> GetAll().
how can i do it?

A: You will need to implement IBaseService<T> explicitly with the different generic parameters:
public class SalesService : IBaseService<Order>, IBaseService<Request>
{
    IList<Order> IBaseService<Order>.GetAll()
    {
        //return orders
    }

    IList<Request> IBaseService<Request>.GetAll()
    {
        //return requests
    }
}

The implemented methods are only visible through the interface, so you'll have to cast to call them e.g.
IBaseService<Request> service = new SalesService();
IList<Request> request = service.GetAll();

Your client code should only depend on the IBaseService<T> interface, so you shouldn't need to do this very often.


text:
Q: C# deserialize datetime from xml I have to deserialize xml with date looking like this:
<date>2015/10/16 00:00:00.000000000</date>

My class contains this field:
[XmlAttribute("date")]
public DateTime StartDate { get; set; }

But I always receive default date. Is it possible to parse this format of datetime?
Edit:
When I change XmlAttribute to XmlElement, I get exception:
There is an error in XML document

So I think DateTime can's parse this format.

A: One way to handle this is to decorate the DateTime member with
    [System.Xml.Serialization.XmlIgnore]
This tells the serializer to not serialize or de-serialize it at all.
Then, add an additional property to the class, called, for example DateString.  It might be defined as
public string DateString {
    set { ... }
    get { ... }
}

Then you can serialize and de-ser the DateString in the get/set  logic:
public string DateString {
    set {
    // parse value here - de-ser from your chosen format
    // use constructor, eg, Timestamp= new System.DateTime(....);
    // or use one of the static Parse() overloads of System.DateTime()
    }
    get {
        return Timestamp.ToString("yyyy.MM.dd");  // serialize to whatever format you want.
    }
}

Within the get and set you are manipulating the value of the Date member, but you are doing it with custom logic.   The serialized property need not be a string of course, but that is a simple way to do it.     You could also ser/de-ser using an int, as with the unix epoch, for example
by Dino Chiesa


text:
Q: PDF Page Drawing issue with iPhone sdk I herewith a problem that i am facing while implementing PDF file in iPhone.
What I want is simply display PDF files. and also Giving few Facilities like Zoom-in and Zoom-Out, Next Page navigation, Previous Page Navigation etc.
I am very clear with Reading PDF Documents using url, i also get the number of pages and other property, But When i try to display it in View or WebView, i mean to say when i try to draw a pdf page, I am not getting page, just get simply blank View.
To Display page, I tried 5 different approaches, but none of them leads me to Success.  Hence i have to approach You Guys.
I have attached here snippet of Code with 5 different approach i used.
Kindly go through it and guide me!! Your Suggestions are welcomed.
////////////////////////////
- (void)viewDidLoad {
    [super viewDidLoad];

 const char *file = @"Pdf_first.pdf";

 CGPDFDocumentRef myDocument;
 CGPDFPageRef page;
 CGRect mediaBox;
  CFStringRef path;
 size_t noOfPages;
    CFURLRef url;
 CGContextRef pdfContext;

//////// Code to get Path and Url for the dictionary where our PDF file currently stored. /////////

 NSFileManager *FileManager = [NSFileManager defaultManager];
 NSArray *paths1 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
 NSString *documentsDirectory = [paths1 objectAtIndex:0];
 documentsDirectory = [documentsDirectory stringByAppendingPathComponent:@"Pdf_first.pdf"];

 path = documentsDirectory;

    url = CFURLCreateWithFileSystemPath (NULL, path,kCFURLPOSIXPathStyle, 0);
 myDocument = CGPDFDocumentCreateWithURL(url);
 myDocument = CGPDFDocumentRetain(myDocument);

 CFMutableDictionaryRef myDictionary = NULL;
 myDictionary = CFDictionaryCreateMutable(NULL, 0,&kCFTypeDictionaryKeyCallBacks,&kCFTypeDictionaryValueCallBacks);
 CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
 CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));

 page = CGPDFDocumentGetPage(myDocument, 1);
 noOfPages = CGPDFDocumentGetNumberOfPages(myDocument);
 pdfContext = CGPDFContextCreateWithURL(url, NULL, myDictionary);
 CGRect pageMediaBox = CGPDFPageGetBoxRect(page, kCGPDFMediaBox);

//////// Code to get Path and Url for the dictionary where our PDF file currently stored. /////////

Every Thing is fine here!! i am Getting all Values from Functions. Now Bellow i have added 5 different ways Those
    i Follow for Displaying or Drawing a Page That i can see in iphone.
////////////////////////// Way 1 ///////////////////////

 CGContextTranslateCTM(pdfContext, 0.0, [webView bounds].size.height);
 CGContextScaleCTM(pdfContext, 1.0, -1.0);
 CGContextConcatCTM(pdfContext, CGPDFPageGetDrawingTransform(page, kCGPDFCropBox,[webView bounds], 0, true));
 CGContextDrawPDFPage(pdfContext, page);
 CGContextRestoreGState(pdfContext);

 ////////////////////////// Way 1 ///////////////////////

////////////////////////// Way 2 ///////////////////////

 CGRect bounds = CGRectMake(10, 10, 300, 300);

 CGContextSaveGState(pdfContext);
 CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, bounds, 0, true);
 CGContextConcatCTM(pdfContext, pdfTransform);
 CGContextDrawPDFPage(pdfContext, page);
 CGContextRestoreGState(pdfContext);

 ////////////////////////// Way 2 ///////////////////////

///////////////////////////////////// Way 3 ////////////////////

    for(int i = 1; i <= noOfPages; ++i) {

        CGPDFPageRef pdfPage =  CGPDFDocumentGetPage(myDocument, i);

        CGRect pageMediaBox = CGPDFPageGetBoxRect(pdfPage, kCGPDFMediaBox);

        CGContextBeginPage (pdfContext, &pageMediaBox);

  CGContextStrokeRect(pdfContext, CGRectMake(50, 50, 500,700));
  CGContextShowTextAtPoint (pdfContext, 60, 699, text, strlen(text));

  CGContextDrawPDFPage(pdfContext, pdfPage);

        CGContextEndPage (pdfContext);

    }

  ///////////////////////////////////// Way 3 ////////////////////

 /////////////////////////////// Way 4 ////////////////////////////////

 //mediaBox = CGPDFDocumentGetMediaBox(document, 1);

 CGPDFBox mediaBox = CGPDFDocumentGetMediaBox(document, 1);

 //mediaBox = CGRectMake(10,10,300,300);
 // int rotationAngle = CGPDFDocumentGetRotationAngle(document, 1);

 int rotationAngle = 30;

 //CGContextDrawPDFDocument(UIGraphicsGetCurrentContext(), CGRectMake(25,25,250,250), document, 1);

 //CGPDFPageGetDrawingTransform(<#CGPDFPageRef page#>, <#CGPDFBox box#>, <#CGRect rect#>, <#int rotate#>, <#_Bool preserveAspectRatio#>)

 CGAffineTransform transform = CGPDFPageGetDrawingTransform(page, mediaBox, CGRectMake(25, 25, 250,250), rotationAngle, TRUE);

   /////////////////////////////// Way 4 ////////////////////////////////

///////////////////////// Way 5 /////////////////////////////

 CGContextTranslateCTM(pdfContext, 0.0, 320);

 CGContextScaleCTM(pdfContext, 1.0, -1.0);

 CGContextSaveGState(pdfContext);

 CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, CGRectMake(0, 0, 280, 320), 0, true);

 CGContextConcatCTM(pdfContext, pdfTransform);

 CGContextDrawPDFPage(pdfContext, page);

 CGContextRestoreGState(pdfContext);

    ///////////////////////// Way 5 /////////////////////////////

Among above 5 diffent way not single one lead me to Result.

A: You can't draw your view in -viewDidLoad. There's no CGContext at this point. All your drawing code needs to go into -drawRect. You want to read the Drawing Guide.


text:
Q: Combine Rows and Count Values I have a dataframe similar to this:
OrderNum Product Quantity

1 Gum 2

1 Candy 4

2 Chocolate 8

3 Gum 3

3 Soda 1

4 Chocolate 2

5 Gum 2

5 Soda 2

For each product ordered I would like to find out what other products and how many of each were ordered with it, based on the order number's being identical.
I'd like to see something like this:
Gum 7 Candy 4 Soda 3

Candy 4 Gum 2

Chocolate 10

etc.

Thank you for the help!
Connor

A: It sounds like what you want to do is find the associations between each element.  If two (or more) orders have "Candy", how many of each other Product do they contain.
This is the best I could come up with.  First, group by each Product in order to find all orders that have that Product.  Then, take that subset from the original dataframe, and get the sum of the Quantity of each product.
# group by the products
products = df.groupby("Product")

# each groupby element is a tuple
# the first entry is the value (in this case, the Product)
# the second is a dataframe
# iterate through each of these groups
for p in products:
  sub_select = df[df["OrderNum"].isin(p[1]['OrderNum'])]
  quantities = sub_select.groupby("Product").Quantity.sum()

  # print the name of the product that we grouped by
  # and convert the sums to a dictionary for easier reading
  print(p[0], quantities.to_dict())
  # Candy :  {'Candy': 4, 'Gum': 2}
  # Chocolate :  {'Chocolate': 10}
  # Gum :  {'Candy': 4, 'Soda': 3, 'Gum': 7}
  # Soda :  {'Soda': 3, 'Gum': 5}

sub_select will be a subset of our original dataframe. For example, it will contain all rows for all orders that had Candy.  quantities then groups all of those orders together by the Product in order to get the sum of the Quantity for each product across all matching orders.


text:
Q: iPad centering activity indicator I am writing an iPad app that has a UIWebView and an activity indicator when the pages are loading in the webview.  I think this is a stupid question but how can I make sure the activity indicator is centered at all times? if i have it vertical, it is centered, but if I turn the iPad horizontally, the activity indicator is now somewhere in the lower left quadrant rather than the center.
Thanks in advance!

A: UIActivityIndicatorView *progress_ind = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
progress_ind.center = CGPointMake (self.view.bounds.size.width * 0.5F, self.view.bounds.size.height * 0.5F);
[progress_ind startAnimating];
progress_ind.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);

[self.view addSubview:progress_ind];


text:
Q: Eclipse and JavaFX? is it just me? I'm looking at learning JavaFX.
I've tried setting Eclipse to develop a small app and I've downloaded the Eclipse plugin.
Eclipse JavaFX plugin
BUT... it just seems, well, flakey.
So I have 3 questions...
1: Is there a better plugin?
2: Or is there some great set of tutorials out there that I'm missing?
3: finally, is it meant to be easy to call Java code from FX? I'm stuggling, it there a good example somewhere?
On questions 1 & 2, Eclipse underlines code in red that just shouln't be. For example..
see this image... alt text http://www.qenet.co.uk/fx.jpg
Why does it underline bit of imports in red?
I know this is little of an open ended question. So I guess my main question is this...
Is my experiance of JavaFX and Eclipse the best I can hope for? Or am I missing something ?
(and I'm not looking for a Yes/No response) :-)
Just looking for a discussion on how best to learn/develop JavaFx.

A: This kind of thing is not unusual.  A lot of Eclipse plugin editors have problems dealing with error tags and the like.  For example,

*

*I find that the XML and HTML file editors often fail to clear error and warning markers, and the only way to get rid of the markers it is close and reopen the file.

*Even the Java viewer gets it wrong in some circumstances, though the problem goes away when the relevant files are saved.

*When you update a spelling dictionary, the spelling checker is not rerun and the spelling error markers are not updated.  In fact, you have to restart Eclipse for this to happen.
I suggest that you try saving files, and closing/reopening editors to see if that makes the bogus error markers go away.  Then decide whether Eclipse is the right IDE for this task.
I've never used NetBeans (at all), but you would expect that it would do a better job supporting JavaFX.  After all NetBeans and JavaFX are both high profile Sun products at the moment.

A: Netbeans is really the only way to go at the moment for JavaFX development. They are both Sun products and Sun has made sure the two work very well together. Before long Eclipse and others will catch up but for the moment that's how it is.

A: There is another JavaFX plug-in for Eclipse from Exadel. You can download it here: http://exadel.org/javafxplugin. Give it a try.

A: I have similar problems but funnily only under Linux, not Windows. Hope they change that soon.

A: To me this has happened when I wronlgy installed javafx sdk 1.2.3....This plugin works only with 1.2.1... :/


text:
Q: jquery listview link cutting off body text I built a listview using jquery mobile.  However, I would like to have a little more body text than what fits on a typical mobile screen.

Barracks

Fearless fighters weilding with shield and sword

Mage Quarters

Where magical folk live

It takes the

 tag and abbreviates it automatically.  Is there a way to instead simply jump down a line? There appears to be a lot of space left over in the  block.
Heres an example:

As you can see in the yellow area, it cuts off the string and adds 'grant you...' rather than going to the next line.

A: Use this css:
.ui-li-desc {
    white-space: normal !important;
}

Here's an example: http://jsfiddle.net/Gajotres/3ZVeN/


text:
Q: registering sip as protocol in Ubuntu 18 to use TbDialout with Thunderbird and Ekiga Using Ubuntu 18 with Gnome, i would like to to connect Thundebird addressbook with ekiga, using a SIP provider for phonecalls.
Ekiga works fine standanlone.
TBDialout (Version 1.8.0pre1, for thunderbird 68.7.0) is configured with a userdefined url with this form:
sip:%NUM%@sip.finotel.com

Pushing the call-Button out of the thunderbird addressbook leads to an error: sip is not a registered protocol or not allowed in this context.
Following the TBDialout-Wiki, i registered SIP protocol
https://www.oak-wood.co.uk/faq/content/5/14/en/how-do-i-register-a-url-handler-for-the-sip-protocol-in-gnome-_-ubuntu.html
gconftool-2 -s /desktop/gnome/url-handlers/sip/command '/usr/bin/ekiga -c %s' --type String

I am not shure, whether this is the proper way to register an uri protocol in ubuntu 18/gnome.
And i am not shure, wether this is the reason for the error message.
But it nevertheless still runs into the same error message.
Any suggestions would be great ...

A: Solved. You still configure TBDialout with a userdefined url as written above.
But the method described above how to register SIP protocol as an url-handler is outdated.
Now you do this this way:
Create a file ~/.local/share/applications/sipurl.desktop and put this in it:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/ekiga -c %u
Name=sip-url
Comment=sip-url handler
Icon=
Categories=Application;Network;
MimeType=x-scheme-handler/sip;

Then run
xdg-settings set default-url-scheme-handler sip sipurl.desktop

Credits go to Chris Hastie, author of TbDialout.
https://github.com/tipichris/TBDialOut/issues/12


text:
Q: How to determine the creator of an object in the Finalizer queue Recently I often encounter situations where the CPU reaches 100%, So I checked the CPU situation:

It seems that the memory is full, so I dumped heap, and try to analyze it using MAT.
I first noticed that the memory of Finalizer is very abnormal, used more than 2G of memory.

For comparison, it is about 500MB under normal circumstances.
I initially thought it was because the Finalizer thread was blocked, But Java thread dump: BLOCKED thread without "waiting to lock ..." seems to mean that this is not the source of the problem

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f83c008c000 nid=0x1c190 waiting for monitor entry [0x00007f83a1bba000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at java.util.zip.Deflater.deflateBytes(Native Method)
    at java.util.zip.Deflater.deflate(Deflater.java:444)
    - locked <0x00000006d1b327a0> (a java.util.zip.ZStreamRef)
    at java.util.zip.Deflater.deflate(Deflater.java:366)
    at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:251)
    at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:211)
    at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:145)
    - locked <0x00000006d1b32748> (a java.util.zip.GZIPOutputStream)
    at org.apache.coyote.http11.filters.GzipOutputFilter.doWrite(GzipOutputFilter.java:72)
    at org.apache.coyote.http11.Http11OutputBuffer.doWrite(Http11OutputBuffer.java:199)
    at org.apache.coyote.Response.doWrite(Response.java:538)
    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:328)
    at org.apache.catalina.connector.OutputBuffer.flushByteBuffer(OutputBuffer.java:748)
    at org.apache.catalina.connector.OutputBuffer.realWriteChars(OutputBuffer.java:433)
    at org.apache.catalina.connector.OutputBuffer.flushCharBuffer(OutputBuffer.java:753)
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:284)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:261)
    at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:118)
    at javax.imageio.stream..close(FileCacheImageOutputStream.java:238)
    at javax.imageio.stream.ImageFileCacheImageOutputStreamInputStreamImpl.finalize(ImageInputStreamImpl.java:874)
    at java.lang.System$2.invokeFinalize(System.java:1270)
    at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
    at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)

Following all the way, I think I found the object that takes up memory:

So it seems that URLJarFile creates a lot of unused buffers, but I don't know how to continue to find the source of the problem after I get here. Maybe I need to monitor the stack calling here?
Add: I think I found some useful information, most of which are loaded with jstl-1.2.jar


text:
Q: Trouble proving that $\cup \{x\}=x$? I am trying to solve the following problem:

The definition of union is given as:

I am a bit confused: Looking at the definition, I think $\mathcal{F}=\{x\}$, then we take $A\in \mathcal{F}$ and then, we have only one possibility $A=x$ then we take $t\in A =x$ but this doesn't seems to yield $x$.
On the other hand, if we consider $\mathcal{F}=\{\{x\}\}$, then we take $A\in \mathcal{F}$ and then we have $A=\{x\}$ then we take $t\in A =\{x\}$ and now we have $t=x$ and hence the ouput $\{x\}$ which is also not what is pointed in the question.
What am I missing?

A: $u\in \bigcup \{x\} \text{ iff } \exists t\in \{x\} \text{ and } u\in t \text{ iff } t=x \text{ and } u\in t \text{ iff } u\in x$, so $\bigcup \{x\}=x$.

A: You're correct that the only possibility for $A$ is $x$. Then $\displaystyle{\bigcup\{x\}}$ is the union of the elements of $x$, which is just $x$. Recall that $x$ is a set, so it is a thing where we have notions like "the union of its elements."
Colloquially, $\displaystyle{\bigcup x}$ is the set of elements inside of elements of $x$. Say that $x$ is a singleton $\{y\}$. Then $\displaystyle{\bigcup x=y}$ from the first part, so $\displaystyle{\left\{\bigcup x\right\}=\{y\}=x}$. Furthermore, if $x$ is not a singleton, then since $\displaystyle{\left\{\bigcup x\right\}}$ is a singleton it cannot be equal to $x$.


text:
Q: Counting function points I am performing a function point analysis (FPA) for a project. I am completely new to this process and have started with only the login and authentication modules to validate the results I get.
I think I have understood data function well and my count of internal logic files and external interface files is correct. I need some guidance on calculating transaction function (EI, EO and EQ).
Here is the process specification:

*

*New users registers and then logs in

*Existing user logs in directly

*On registration user data collected and stored.

*On login usual validation checks: errors on invalid credential, otherwise successful login

*Session details maintained for logged in users.

*User suspended temporarily after more than n invalid logins.

*Session terminated automatically on idle timeout.

*Update email/password settings using either forgot password or update settings

I am counting very essential part of this process as EI/EO/ILF:
External Inputs: 4

*

*Login

*Logout

*Register

*Update settings

External Outputs: 3

*

*Incomplete/invalid registration form

*Invalid login, or user throttled after unsuccessful attempts

*Session timeout

Internal Logical files: 2

*

*User data

*Session data

No External Queries or External Interface Files.
Despite weighing the above counts with low complexity, I get 38 UFPs = 2014 SLOC (for Java: 53 SLOC per FP), which turns into a suprisingly high effort estimate when using COCOMO II even with the lowest coefficients.
My doubt is not related to FP count or complexity, I am more concerned about whether I am choosing the right things as EI or EO. As far as I understand the FPA technique, any data/control information entering the boundary of application is counted as EI, so logically login, logout, sign up, update settings, forgot password are all inputs. Similarly Invalid login, successful login, any invalid data related error message, timeout information etc are all outputs. So I have even more EI and EOs than I counted above but then output FP count goes high unrealistically.
Am I doing the FPA correctly, or did I misunderstand something?

A: You are generally doing the Function Point Analysis correctly, and the results look sensible. However:

*

*You are wrongly classifying some outputs.

*You are surprised by the COCOMO II estimate for the effort.

*This analysis ignores the reality of modern web development: the web framework probably already implements session management.

What is an External Input and External Output?
For a graphical user interface, it is best to think of EIs and EOs as screens, widgets, or forms. Therefore, your login form is one external input. You are classifying validation errors as a separate external output. I would not do that, since the validation (and rate limiting etc.) is part of the login functionality. Instead, I would weigh the login functionality with a higher complexity if it has to do special error handling.
I would classify your items as:

*

*Login form: External Input, medium complexity. (justified through extra rate limiting logic and other security considerations)

*Registration form: External Input, simple.

*Logout and session timeout: External Input, simple.

*Update settings: External Input, simple.

*Forgot password: External Input, high complexity. (looks simple, but requires careful security design)

*Session storage: Internal Logical File, simple.

*User details storage: Internal Logical File, simple.

That's right, there are no External Outputs here! But to be fair, this application doesn't really do anything yet and just provides a login. If you had a separate screen for viewing the settings versus updating the settings, I'd count that as a separate simple EO. I also assume the various points where login credentials are entered by the user share some common code, so the complexity of handling passwords is fairly simple on average.
Using complexity weights 3× for simple EIs, 4× for medium EIs, 6× for complex EIs, 4× for simple ILFs, I arrive at a function point count of C = 27. This is noticeably less than your estimate, but still in the same ballpark. If you use the adjustment factors Fi, this might shift further up or down.
What does the COCOMO II estimate tell us?
The estimate does not just describe the time spent coding for that functionality. It is an estimate for the whole project duration, and includes some amount of analysis, design and testing. According to a lecture I heard on the topic, only about 30% of the estimated effort would be for development tasks! So if the 27 FPs correspond to an effort of about 3.5 person-months, roughly 1 person-month of that would be development time.
The estimates you get out of COCOMO tend to sound unbelievably long, but when you put that in context – large organizations, differing skill level, unexpected complications and bugs, all the work necessary for software development that isn't just coding – they are a good reminder to not be too optimistic. Of course it's possible to be faster, but you shouldn't bet on it. When the function point analysis is done meticulously, and when it is applied to a project where FPA is a good fit, then the numbers tend to be in a realistic order of magnitude.
Function points and web development.
Web development is a bit different.
First of all, there are many mature web frameworks and libraries that make it easier to create a solid website quickly (as long as you already know that framework). A single experienced person could probably implement your requirements within a day to a week – login is so important and basic that the web framework might actually teach you how to do this as a "hello world" application.
Secondly, web development tends to involve far more lines of code, but those are not necessary as difficult. If you create the login form by hand, you have to write the form in HTML, style it with CSS, perhaps do client-side checks with JavaScript, create an URL where the login form can POST to, and then create the actual backend code that checks the password. That might well be 400 lines of code in total, but that doesn't mean this would take a whole month.[1] I'm therefore wary of applying COCOMO to web development, since much code is boilerplate that is written very quickly.
[1]: Of course a login form can take month to create, e.g. when it needs considerable design effort, or special security features. I'm sure many large websites have spent far more effort than that into that small text field.


text:
Q: Can I run a command before the setup.msi? I have a desktop application and its installer project produces two files in the Release folder: let's call them setup.exe and setup.msi.
In the post build event I sign the setup.msi with a self signed certificate. Then my final installation batch is composed of three steps

*

*Adding user store certificate with a start.cmd (or start.exe)

*Running the setup.exe. Notice that the important thing is that it shows a user account control for a verified author with my name and surname.

*Removing (with a stop.cmd or stop.exe) the certificate at point 1 for security reasons/best practices since it is self signed

Now I'm perfectly fine with this solution, I only wished to include the commands 1 and 3 inside the setup.exe if it was possible in a standard way.
What I have tried to do is to define the start.exe and stop.exe as custom actions. In that case I only have the two files setup.exe and setup.msi but unfortunately I get an unkown publisher. I guess it is obviously because the custom actions go inside the .msi and not in the setup.exe. But I'm not an expert of installer projects so someone might suggest a better and standard solution.
Alternative approach
Is that something that I could much more easily do by switching to Inno Setup and maybe as suggested in this comment?
References

*

*How do I create a self-signed certificate for code signing on
Windows? - Original Answer

*Answer about certmgr.msc - Will a self signed code-signing
certificate get rid of "Unknown Publisher" warnings?

*Sign tools downloadable from github

A: Updated answer
Sorry, I've tested my original answer below and it is "wrong" in a sense:
actually I get a single click installer but then the Windows operating system anticipates the user account control before such single click installer and it shows an unknown publisher, which defeats the purpose of point 1 (and 3).
So, short, updated answer: it is impossible(*) to do that in a standard single-click exe, like the ones produced by the SFX module mention below.
(Note *): though it is doable by compiling a custom C# code and by adding files to the Resources.resx, for example _7zr.exe, etc... like in this example:
using System.IO;
using System.Diagnostics;
namespace selfextractinstaller
{
    class Program
    {
        static void Main(string[] args)
        {
            string file_path_7zr = @"_7zr.exe";
            using (FileStream fs = new FileStream(file_path_7zr, FileMode.Create))
            {
                byte[] pgm_bytes = Properties.Resources._7zr;
                fs.Write(pgm_bytes, 0, (int)pgm_bytes.Length);
            }
            string file_path_config = @"config.txt";
            using (StreamWriter sw = new StreamWriter(file_path_config, false))
            {
                sw.Write(Properties.Resources.config);
            }
            string file_path_7zSD = @"_7zSD.sfx";
            using (FileStream fs = new FileStream(file_path_7zSD, FileMode.Create))
            {
                byte[] pgm_bytes = Properties.Resources._7zSD;
                fs.Write(pgm_bytes, 0, (int)pgm_bytes.Length);
            }
            Process.Start(file_path_7zr, "b");
        }
    }
}

A similar code can be actually used as a self extracting installer that is not elevated and does not require the UAC!
Further Readings

*

*How does Windows decide whether to display the UAC prompt?

*How do I add a manifest to an executable using mt.exe?
Original answer
In absence of other answers, I'll proceed with a SFX module for installers, by packaging all the three .exe at points 1-3 (plus an install_all.bat running them in sequence) into a self extracting installer, that will automatically extract all the needed files (certificate included) and finally run the install_all.bat


text:
Q: Is this possible? transparent png over slide revolution (clickable) I want two slide revolutions (or at least one), but with this skin over it:

The overlay image would be on top of the images, so clicking the gallery would be impossible (and the bullets to change image inside of it). I know about map coordinates, but it's a slider revolution, so it will not work in this case I think.
Is there any way to achieve this?

My HTML & CSS so far: (JSFiddle)

HEY' IM CLICKABLE

.thePNG {
    background-image: url(my-overlay-image.png);
    width: 787px;
    height: 610px;
    background-size: cover;
    z-index: 2;
    position: relative;
}
.theSLIDERS{
    margin-top: -600px;
    z-index: 1;
}
.fakeSLIDER1{
    background-color: red;
    width: 700px;
    height: 300px;
    text-align: center;
    margin: 0 auto 0 auto;
}
.fakeSLIDER2{
    background-color: green;
    width: 700px;
    height: 300px;
}

A: I found my own answer!
its easy:
CSS:
"pointer-events: none;"
!


text:
Q: Equivalence of isolated point in metric space and singleton open set in topological space
In mathematics, a point $x$ is called an isolated point of a subset $S$
  (in a topological space $X$) if $x$ is an element of $S$ but there exists a
  neighborhood of $x$ which does not contain any other points of $S$. This
  is equivalent to saying that the singleton $\{x\}$ is an open set in the
  topological space $S$ (considered as a subspace of $X$).

I found this here, but i really could not understand the equivalence of the two concepts. Some good explanation would be a great help as I am new to topological spaces.

A: Suppose that $\{x\}$ is a neighborhood of $x$. Then there is an open set $O$ such that $x\in O$ and that $O\subset\{x\}$. But then $O=\{x\}$ and therefore $\{x\}$ is open.
On the other hand, if $\{x\}$ is open, then $\{x\}$ is a neighborood of $x$ which has $x$ as its only element.

A: We have a subset $S$ of a topological space $X$. We want to prove that $x\in S$ is isolated in $S$ if and only if $\{x\}$ is open in $S$ with the subspace topology.
Recall that a set $A\subset S$ is open in the subspace topology means that $A=A'\cap S$ where $A'\subset X$ is open.
For the forward direction, if $x$ is isolated, then there is a neighborhood $A'\subset X$ of $x$ which is open such that $x$ is the only point in $S$ also contained in $X$. This means that $A=A'\cap S$ is open in the subspace topology on $S$, but $A'\cap S=\{x\}$, so $\{x\}$ is open.
For the backward direction, if $\{x\}$ is open in the subspace topology on $S$, that means that $\{x\}=A'\cap S$ for some open subset $A'$ of $X$. This means that $A'$ is a neighborhood of $x$ which does not contain any other points of $S$, so $x$ is isolated.


text:
Q: A question about pinned Gaussian processes Let $H$ be a real separable Hilbert space. An isonormal Gaussian process over $H$ is a centered Gaussian family $W = \{W(h):h \in H\}$ such that $$\mathbb{E}[W(h), W(h^\prime)] = \langle h, h^\prime\rangle_H\ \forall\ h, h^\prime \in H.$$ Let $\tilde{H}$ be a proper real Hilbert subspace of $H$. The $\tilde{H}$-pinned process associated with $W$ is the centered Gaussian family $\{W(\operatorname{proj}(h \mid \tilde{H}^\bot)): h \in H\}$.
How can I prove that $A = \sigma(W(h):h \in \tilde{H})$ and $B = \sigma(W(h):h \in \tilde{H}^\bot)$ are independent and deduce from this that $\mathbb{E}[W(h) \mid B] = W(\operatorname{proj}(h \mid \tilde{H}^\bot))\ \forall\ h \in H$?

A: You need to prove that $W(h)$ and $W(h')$ are independent, for each pair $h\in\bar{H}$ and $h'\in\bar{H}^\perp$. For such a pair, from the very definition you can deduce that $\mathbb{E}[W(h)\cdot W(h')]=0$. Therefore, $W(h)$ and $W(h')$ are uncorrelated r.v.'s and since their joint distribution is Gaussian it follows their independence.


text:
Q: WELD-00143 Pseudo scoped bean has circular dependencies Using WeldJUnit4Runner and getting error message:

Exception 0 : org.jboss.weld.exceptions.DeploymentException:
  WELD-001443: Pseudo scoped bean has circular dependencies. Dependency
  path:
    - Managed Bean [class com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestService]
  with qualifiers [@Any @Default],

Any known solution for this problem in Weld?

More error message: java.lang.ExceptionInInitializerError
                  at com.my.own.WeldJUnit4Runner.createTest(WeldJUnit4Runner.java:18)
                  at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244)
                  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
                  at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:241)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
                  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
                  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
                  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
                  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
                  at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
                  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
                  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
                  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  Caused by: org.jboss.weld.exceptions.DeploymentException: Exception
  List with 102 exceptions: Exception 0 :
  org.jboss.weld.exceptions.DeploymentException: WELD-001443: Pseudo
  scoped bean has circular dependencies. Dependency path:
    - Managed Bean [class com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestService]
  with qualifiers [@Any @Default],
    - [BackedAnnotatedField] @Inject private com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestService.listener,
    - Managed Bean [class com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestListener]
  with qualifiers [@Any @Default],
    - [BackedAnnotatedField] @Inject private com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestListener.clientCommPriorizedAcceptRequestRepository,
    - Managed Bean [class com.my.own.bounded_contexts.client.repositories.ClientCommPriorizedAcceptRequestRepository]
  with qualifiers [@Any @Default],
    - [BackedAnnotatedField] @Inject @ClientCommPriorizedAcceptRequestCache private
  com.my.own.bounded_contexts.client.repositories.ClientCommPriorizedAcceptRequestRepository.clientCallPriorizedAcceptRequestCache,
    - Producer Method [RemoteCache] with qualifiers
  [@ClientCommPriorizedAcceptRequestCache @Any] declared as
  [[BackedAnnotatedMethod] @Produces
  @ClientCommPriorizedAcceptRequestCache public
  com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestService.getClientCommPriorizedAcceptRequestRemoteCache()],
    - Managed Bean [class com.my.own.bounded_contexts.client.cache.cacheClientCommPriorizedAcceptRequestService]
  with qualifiers [@Any @Default]
                  at org.jboss.weld.bootstrap.Validator.reallyValidatePseudoScopedBean(Validator.java:897)

A: Weld complies with the specification in this respect.
From the CDI spec, section 5:

The container is required to support circularities in the bean
  dependency graph where at least one bean participating in every
  circular chain of dependencies has a normal scope, as defined in
  Normal scopes and pseudo-scopes. The container is not required to
  support circular chains of dependencies where every bean participating
  in the chain has a pseudo-scope.

Try to get rid of the dependency cycle in your application, or at least give a normal scope to one of the beans involved.


text:
Q: Jenkins | Cocoapods | Swift | error: no such module 'RealmSwift' error: no such module 'RealmSwift'
import RealmSwift
While building a project from Xcode, it's working fine. Building it from Jenkins,gives me the above mentioned error.
** BUILD FAILED **
The following build commands failed:
CompileSwift normal arm64
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

(2 failures)
Build step 'Xcode' marked build as failure
Finished: FAILURE
My Pod file looks like below
target 'MyProject' do
use_frameworks!
# Pods for MyProject
pod 'Google/Analytics'
pod 'GoogleTagManager','~> 3.15.0'
pod 'RealmSwift','~> 2.1'

target 'MyProjectTests' do
# Pods for testing
end

target 'MyProjectUITests' do
# Pods for testing
end
end

A: You may not have versioned your Pods directory.
You can either remove Pods from your .gitignore, or add a pod install command inside each jenkins script.


text:
Q: bash built in function bash source code How to find source of a built in bash function?
I know that it is a function:
$type -t MY_APP
function

I see it's code:
type MY_APP
code

The questions are:

*

*Where is it stored?

*How can I modify it?

A: You can do it like this:
# Turn on debug
$ shopt -s extdebug

# Print out the function's name, line number and file where it was sourced from
$ declare -F my_function
my_function 46 /home/dogbane/.bash/.bash_functions

# Turn off debug
shopt -u extdebug

To edit the function, open the file containing the function definition (that you found from above). Edit the function and save the file. Then source it into your shell, like this:
$ . /path/to/function_file

A: Functions are typically stored in the .bashrc file (or in /etc/bash.bashrc, which also exists as just /etc/bashrc on some systems). This answer from SuperUser has some good details on what a .bashrc file is. Similarly, this question on the Unix & Linux site details when it's best to alias, when to script, and when to write a function.