text:
Q: How can I open form after closing it ? (with refresh) I'm trying to make a close button and an open button, after form closing I want to open back the form with the new properties that i changed in my settings form. Can you help me? thank you in advance, have a nice day. Kaiiso
Browser browserForm = new Browser();

private void setBrowser(string activate)
{

        if (activate == "true")
        {
            browserForm.Show();
        }
        else if (activate == "false")
        {
            browserForm.Close();
        }
}

I know that is actually not working but it's a simple exemple :)

A: Hide() is your friend.
If you want only to hide it and after show in the same state as it was hidden. That's the way.
The other way it's to destroy the form and create a new form and show it.
Obviously you'll have to call some method that updates the UI with the new values, or bind properties, or something.


text:
Q: jcarousel thumbnail scrolling I have a slideshow with scrolling thumbnails that was created using jCarousel. The thumbnails scroll downwards (forward) as expected. But scrolling backwards has a quirk that I cannot find a solution to. When the last thumbnail has been selected, the scrollbar will only scroll backwards by 8 thumbnails when in reality there are 22. I have tried playing around with the wrap, scroll, itemFallbackDimension & initCallback parameters without any change in the backwards (or in this case, upwards) scroll.
The files are here: http://ers-dev.com/Novartis/Flashcards/Clinical_Trials/index.html. But hurry and take a look, because I will have to take them down next week.

A: The solution is not to have a scrollbar at all. That simply confuses the app because it loses its place. The solution is to use forward and back buttons. this way the carousel iterates through the slides one by one and it can keep track of where it is.
There are built in classes to take care of this. .connected-carousels .prev-navigation and
.connected-carousels .next-navigation

redpajama_set_name: RedPajamaStackExchange


text:
Q: how do I optimized query having order by clause which takes too much time to execute I have below query:
  SELECT image_hashid_pk,dcthd,mhhd FROM (
 SELECT image_hashid_pk,
 BIT_COUNT(BINARY '1010000110010011000111001100000011110001011110001111111110000101' ^ BINARY dct_binary) AS dcthd,
BIT_COUNT(BINARY '011010011011000111001000111111000011010000111010000101101111000101011001111110110000110010010100101100110101001111011000000011100101110010110100110010110111100100111011000000011011111110000011011001011000011010000011010010010101100101110101101010001001101010000011011101010110101101011011001001001101000011111000010100101001010010000101101000001011101010001111000011110010010010011010011001100100100010011110110100110110100100101101000001110000110011010010111110000111101101111000111111010110111001100110111000000111000000111000000111000010111000000111000000111000000111000000' ^ BINARY mh_binary)/576 AS mhhd
FROM image_hashtest
 )AS t
WHERE dcthd=0 OR mhhd<=0.05
ORDER BY mhhd,image_hashid_pk ASC;

I write it as like below also
  SELECT image_hashid_pk,
   BIT_COUNT(BINARY '1010000110010011000111001100000011110001011110001111111110000101' ^ BINARY dct_binary) AS dcthd,
BIT_COUNT(BINARY '011010011011000111001000111111000011010000111010000101101111000101011001111110110000110010010100101100110101001111011000000011100101110010110100110010110111100100111011000000011011111110000011011001011000011010000011010010010101100101110101101010001001101010000011011101010110101101011011001001001101000011111000010100101001010010000101101000001011101010001111000011110010010010011010011001100100100010011110110100110110100100101101000001110000110011010010111110000111101101111000111111010110111001100110111000000111000000111000000111000010111000000111000000111000000111000000' ^ BINARY mh_binary)/576 AS mhhd
FROM image_hashtest HAVING dcthd=0 OR mhhd<=0.05
 ORDER BY mhhd,image_hashid_pk ASC LIMIT 1;

In above query without ordering it takes less time but when I used order by clause on 'mhhd' column it takes too much time .
Can I create index on mhhd or whats the other way to optimized above query please suggest.


text:
Q: What happened to Facebook Video Call to action API? Our service gives our users the possibility to upload videos to various social media networks, including Facebook Pages. We added to option to include call to actions at the end of their videos, which I'm pretty positive was available via the API and was listed as one of the fields of the video object in Page context.
The structure of the CTA JSON field we send is shown below:
{"call_to_action" : { "value" : {"type" : {CTA_TYPE}, "link" : {CTA_URL}}}

Now, I don't see this structure in the API description at all (https://developers.facebook.com/docs/graph-api/reference/page/videos/). The API changed recently to version 2.7. We followed 2.6 but the fields are gone there as well.
We haven't gotten any alerts on the Facebook Developers dashboard and I can't seem to find any information on the CTAs anywhere. However, it seems that the CTAs are now only available for ad videos and can't be added to ordinary ones. The option is also no longer available in Facebook itself, i.e. when I upload the video manually.
Is this official? Have CTAs been removed from Facebook Videos?

A:
Have CTAs been removed from Facebook Videos?

Yes, it looks like they have:

"After considering a number of factors, we have removed the option to add a CTA to the end of native video," said a spokeswoman for the social network.

http://www.bbc.com/news/technology-36586021


text:
Q: Formatting Text Files Generated by PHP I'm building a super simple PHP CMS, and have a question about formatting text...
I'm storing my news files in .txt files (should be SQL, I know), and would like to know how to format the text that gets saved in the text file. This is the code that stores the lines that I want to format:
$newsTitle = isset($_POST["title"]) ? $_POST["title"] : "Untitled";
$submitDate = date("m/d/y g:iA");

I want to wrap the first line in an
 and the second line in an
, but I have no idea how. I tried just wrapping the m/d/y g:iA bit in the second line with a
 but that generated some really weird code in the .txt file.
Thanks!

A: $newsTitle = isset($_POST["title"]) ? $_POST["title"] : "Untitled";
$submitDate = date("m/d/y g:iA");
$saveString = "
$newsTitle
\n
$submitDate
";
file_put_contents("filename.txt",$saveString);

Read up a little on php strings and how you can use variables with them. Good luck!

A: $newsTitle = isset($_POST["title"]) ? "
".$_POST["title"]."
" : "Untitled";
$submitDate = "
".date("m/d/y g:iA")."
";


text:
Q: Running applescript in new terminal tab and do file logging I need to do the following thing but I'm unable to find it in the forum. If any link exists kindly redirect me to it.
I need to invoke an applescript from a running terminal window . How do I make sure that the applescript is running in a new tab and not in a new window. Also, I'm supposed to watch some exceptions in this new tab but is it possible to simultaneously view in terminal and log the exception details in a separate file with some time stamp?
Thanks in advance !

A: You cannot run an AppleScript in the Terminal, but you can run an AppleScript from the Terminal. Using the osascript command, you can run an AppleScript from file or run a statement using AppleScript.
osascript "file path here" [arguments] # runs an AppleScript from a file with optional arguments

osascript -e 'AppleScript statement' # runs one line of AppleScript code from Terminal

Note: the -e flag can be used as many times as you like to make a fully functional AppleScript (line by line) from Terminal. Just add another flag after a line of code and continue coding.
If you want to log or print something from AppleScript in the Terminal window, you can use  log "hello world" in your AppleScript code.


text:
Q: Reset an Elm select dropdown value I basically have a little select dropdown like this:
viewDropdown : Model -> Html Msg
viewDropdown model =
    let
        options =
            [ ( "", "-- Select --" )
            , ( "not_available", "Unavailable" )
            , ( "available", "Available" )
            ]

        buildOption ( k, v ) =
            option [ value k, selected (k == model.isAvailable) ] [ text v ]

        viewOptions =
            options
                |> List.map
                    (\( k, v ) ->
                        buildOption ( k, v )
                    )
    in
    div [ class "styled-select" ]
        [ select
            [ on "change" (Decode.map (UpdateAvailability) targetValue)
            ]
            viewOptions
        ]

If the user selects "Available", a modal pops up and they are prompted to confirm. If they hit "Cancel", I want the Select dropdown's value to reset to the value of "". This is not the case and although my model reflects the a Nothing val, the dropdown selection option is still on "Available". Any idea on what I can do to reset the DOM state?

A: While this doesn't answer why your code doesn't work, it seems that if you add the step of confirming the selection, then code will work:
Ellie example, with full code below: https://ellie-app.com/3P5TTM9YqVWa1
module Main exposing (main)

import Browser
import Html exposing (Html, button, div, text, option, select)
import Html.Events exposing (onClick, on, targetValue)
import Html.Attributes exposing (value, selected, class)
import Json.Decode as Decode
import Task

type alias Model =
    { isAvailable : String , showConfirm: Bool }

init : Model
init =
    { isAvailable = "-", showConfirm = False }

type Msg
    = UpdateAvailability String
    | ConfirmYes
    | Reset

update : Msg -> Model -> Model
update msg model =
    case msg of
        UpdateAvailability v ->
            { model | isAvailable = v, showConfirm = (v == "available") }

        ConfirmYes ->
            { model | showConfirm = False }

        Reset ->
            { model | isAvailable = "-", showConfirm = False }

viewDropdown : Model -> Html Msg
viewDropdown model =
    let
        options =
            [ ( "-", "-- Select --" )
            , ( "not_available", "Unavailable" )
            , ( "available", "Available" )
            ]

        buildOption ( k, v ) =
            option [ value k, selected (k == model.isAvailable) ] [ text v ]

        viewOptions = List.map buildOption options
    in
    div []
        [ select
            [ on "change" (Decode.map (UpdateAvailability) targetValue) ]
            viewOptions
        ]

viewConfirm model =
    if model.showConfirm then
        div []
            [ text "Really available?"
            , button [ onClick ConfirmYes ] [ text "Yes" ]
            , button [ onClick Reset ] [ text "No" ]
            ]
    else
        div [] []

view : Model -> Html Msg
view model =
    div []
        [ viewDropdown model
        , viewConfirm model
        , button [ onClick Reset ] [ text "Reset" ]
        ]

main : Program () Model Msg
main =
    Browser.sandbox
        { init = init
        , view = view
        , update = update
        }

A: Are you setting model.isAvailable to "" when hitting the close button? Your code should work as is https://ellie-app.com/3NYRvgwkHWPa1

A: Turns out, adding a value attribute to the select html will override the option selected state, so this is pretty important if you need your select input to be in sync with model state.
https://ellie-app.com/3NZgYQYKv2Fa1


text:
Q: BizTalk 2010 parsing data within a string using only functoids I am getting data in an inbound EDI file and one of the fields has measurements which I need to parse out of a single string. An example of this field is:
11.75x21.25x41.37x
I need to take all the values in front of the first X and push them to a destination field (say length), all the values between the 1st and 2nd X and push those to the destination field "width", and all the data between the 2nd and 3rd x and send that to the destination field "height".
Here's the challenge: can this be done using only functoids, no C# code? It is preferred because managing C# code should the client modify the format of the data between the X's (as they may well do) is easier to maintain if no code needs to be modified, vetted, stored and pushed to the server.
I tried using the string trimming and string exact functoids but it didn't work; there is no fixed number of digits between the X's and I cannot even be guaranteed there will always be decimals--another feature I originally wanted to key on. The only constant will be the X's.

A: Yes, you can do this using only functoids - but if you artificially stipulate that you not use C# (in a scripting functoid), then you make life much harder and don't solve the problem you think you're solving.
You'd have to use multiple String Find functoids to pick out the various pieces of the field - and this will work only assuming you know the number of xes that can occur ahead of time.  Have the first input be the node, and the second input be x for string find, then connect that to a String Extract functoid.  To get the second one you'll have to stack the String Find functoids, and life gets ugly.  You're effectively trying to build out recursion manually using BizTalk functoids.
The bottom line is: no matter how you achieve this, if the client changes the format of the string you'll have to change the parsing logic to get it out.  That logic will be vastly easier to manage by writing a custom functoid (or just an external Assembly method) which, at its core, does this:
public string StringPartAt(string s, string sep, int idx)
{
    string[] splits = s.Split(sep[0]);
    if (splits.Length > idx)
      return splits[idx];
    return "";
}

This will be much easier to maintain and understand.  You could set that in a Scripting functoid and pass in your node, x, and a zero-based index to get your string out, and just use that for as many times as you need to split things up.  You could even add error handling/logging ("Warning: Tried to extract value that was out of range of input" in the EventLog might be appreciated).  If you're worried about the Client's facility with C#, you could also write this in VB or JavaScript.  Even in custom XSLT it would be easier (use substring-before() a few times over, or build a recursive template), it'll be better than trying to hack together a bunch of stock functoids to complete this task.
Pictures of how this works (using inline C# to demo - you'd probably want this in an external assembly or a custom functoid for reusability; note that char can't actually be used, you have to use string as shown above):

A: It turns out we had to use a different script for each value (height, width and length) to extract those  values from the string. Putting each in the scripting functiod using the following C# scripts worked for my map:
Length:
   public decimal getLength(string weights)
    {
        string[] wgt;
        wgt = weights.Split('x');
        decimal len = Convert.ToDecimal(wgt[0]);
        decimal wid = Convert.ToDecimal(wgt[1]);
        decimal hgt = Convert.ToDecimal(wgt[2]);

        return len;
    }

Width:
    public decimal getWidth(string weights)
    {
        string[] wgt;
        wgt = weights.Split('x');
        decimal len = Convert.ToDecimal(wgt[0]);
        decimal wid = Convert.ToDecimal(wgt[1]);
        decimal hgt = Convert.ToDecimal(wgt[2]);

        return wid;
    }

Height:
    public decimal getHeight(string weights)
    {
        string[] wgt;
        wgt = weights.Split('x');
        decimal len = Convert.ToDecimal(wgt[0]);
        decimal wid = Convert.ToDecimal(wgt[1]);
        decimal hgt = Convert.ToDecimal(wgt[2]);

        return hgt;
    }


text:
Q: Simple memory issue exercise I'm working mostly in high-level programming languages, but so yesterday a friend asked me to help him solve a simple C++ exercise and while I was working on it I wrote this piece of code:
for (int x = 0; x < 10; x++){
    int a, b, c;
    a = x;
    b = x*2;
    c = x+5;
}

My question here is: will this cause a memory leak making a, b, c always be created in different locations of memory, or will they always be overwritten with every loop?

A: a, b and c will be allocated on the stack. Automatic variables can never cause a memory leak unless the types themselves cause a leak through their constructor and/or destructor.
Regarding the question of whether they will overwrite each loop: I strongly suspect that every single compiler on Earth will do it that way but, in principle, this is not guaranteed. If you look at the assembly output you will discover that either (a) all the variables are in registers or (b) they retrieved as fixed offsets from the stack pointer. Since the same assembly is being executed each time through the loop they will, indeed, be overwriting.

A: You ask three questions:

this will cause a memory leak

No, there is no memory leak here. A memory leak, as that term is commonly used, requires a new without a delete, a new[] without a delete[], or a malloc() without a free().

a, b, c always be created in different locations of memory

They might be. They might not be. This is an implementation detail of which you program need not be aware. All you need to know is that the objects are created at the line that defines them, and destroyed at the closing brace of that scope.

they will be always overwritten with every loop?

They might be. They might not be. This is an implementation detail of which your program need not be aware. Regardless of whether they are overwritten, they are destroyed each time around the loop.

A: Memory leak can happen only if you have dynamically allocated variables(by calling new or new [] or malloc or calloc). There are none in your code so NO.
What you have are local or automatic variables. As the name says automatic variables are implicitly deallocated when the scope {} in which they are created ends.

A: The same place in memory will be used to store the values in a, b and c in every iteration of the loop.

A: if you create a variable like this
int i = 5;

The compiler will put them on the stack, you don't have to deallocate the int.
however if you create a int on the heap,
int* i = new int; /*C++ style*/
int* j= (int*) malloc(sizeof(int)); /*C style*/

You do have deallocate the memory like this:
delete i; /*C++ style*/
free(j); /*C style*/

otherwise you'll have a memory leak.
most importantly you don't want to mix the c- and c++-style of memory handling.


text:
Q: How do I print rows of a csv file that have a specific keyword in them I'm trying to open two csv files, one with data (minidata.csv) and one with keywords (minikeys.csv), and search through the first one for keywords from the second one, and then print out the lines from the first one that include the keywords from the second one. Hope that makes sense.
I've tried opening the keywords file (minikeys.csv) as a list and searching from there, but I've come the closest to success by opening it into a dictionary for some reason.
with open('minidata.csv', 'r') as f:
    text = f.read()
    csvFileArray = []

    with open('minikeys.csv', 'r') as inf:
        reader = csv.reader(inf)
        mydict = {rows[0] for rows in reader}

    for key in mydict:
        for row in text:
            if key in text:
                print(row)

This will get it to print out every line in the minidata.csv file, not the matching ones, but it also prints out each character as many times as there is a character in the minikeys. So it'll give me output like:
aaaa,,,,bbbb,,,,cccc,,,,dddd...
instead of printing out the lines that match.
What should I do instead to get this to work?

A: Instead of
text = f.read()

do
text = f.readlines()

The issue here is that you're reading it as one big long string with the newlines included - whereas you want to be reading as a list of lines. In essence, f.readlines() is roughly equivalent to f.read().split('\n') (not entirely, but similar enough for this particular comparison). Hence, why you see the output you do - you're iterating per character, not per line.
Changing text so that it ends up as a list of strings rather than just one string should fix your issue.

Also, minor terminology thing. You said mydict = {rows[0] for rows in reader} is a dict. It's not - it's a set. dicts are specifically for key-value pairs, whereas sets are just keys. They're both implemented as hashtables.


text:
Q: Move multiple files in different directories into a new folder I am facing a problem moving multiple files from different folders to one single folder.
All my files are ending with .las and are located in a path like this : e:\LiDAR\%%%%\LIDAR*\, where %%%% is a serie of 4 numbers like 0950, and where LiDAR* is the beggining of all the different folder names containing the .las files.
Here's an exemple of path of one of the .las file :
E:\LiDAR\0950\LIDARHD_1-0_LAZ_PK-0950_6535-2021\Semis_2021_0950_6535_LA93_IGN69.las

I want to move all those files to a folder I created, here is its path :
E:\LiDAR\Las_files

Here's the command line I tried but it's not working :
E:\>move e:\LiDAR\%%%%\LIDAR*\*.las e:\LiDAR\Las_files\

I would be happy if someone can help me : )

A: Try this in Powershell:
Get-ChildItem -Path "E:\LiDAR" -Filter *.las -Recurse | Move-Item -Destination "E:\LiDAR\Las_files" -Whatif

This should move every .las file from all sub-folders into the las_files folder.

A: Your attempt would have worked in Bash, but Cmd.exe has no "generic" wildcard processing (it's done on a case-by-case basis, with move and del doing it differently), so instead you'll need to use for and loop through each directory:
for /d %x in (e:\lidar\####\lidar*) do move %x\*.las e:\lidar\las_files\

(Note that if you put this in a .bat/.cmd script, the %x must be written as %%x.)
If you need to loop through numbered directories, you'll need a second (outer) for loop for that.


text:
Q: Accessing file in restricted directory As an experiment I tried, and failed, to print a file in another user's Documents directory. The accessing user (admin) has read permission on the file however they have no permissions on its parent directory (the 'Documents' directory of the other user).
~ wsee$ ls -le
drwx------@ 32 wsee  staff       1024 10 Feb 11:51 Documents
 0: group:everyone deny delete
....
~ wsee$ cd Documents
Documents wsee$ ls -le
-rw-r--r--   1 wsee  staff         12 10 Feb 11:00 test

~ admin$ cat /Users/wsee/Documents/test
cat: /Users/wsee/Documents/test: Permission denied

I wondered whether I might be able to access the file because I knew its path, please could someone explain why this wasn't the case and what stopped me from accessing it.

A: To access a file, you need permission to access every part of its path: that is, every directory the file is contained in, and the file itself. Simply granting access to the file is not enough if you're not allowed to access one of its parent directories. This behavior is the same across all UNIXes (as far as I know).

A: Permission was denied to access the Documents directory. You could have entered the command below and received the same results.
~ admin$ cat /Users/wsee/Documents/does_not_exist
cat: /Users/wsee/Documents/does_not_exist: Permission denied

Adding sudo would allow access to the Documents directory and would then change the error message, as shown below.
~ admin$ sudo cat /Users/wsee/Documents/does_not_exist
Password:
cat: /Users/wsee/Documents/does_not_exist: No such file or directory

Where as the command below would print the test file.
~ admin$ sudo cat /Users/wsee/Documents/test


text:
Q: C++ how to run 2 boost:asio: io_context at the same time I have 2 boost::asio::io_context variables, one for the connection between my Raspberry Pi and my arduino and the other one for the connection between the Raspberry Pi and the client through a tcp server.
I have tested both connections separately and they work perfectly fine. However, when I try to join them, it doesn't work. I understand that by making two io.run, the second will never be entered as the program will be stuck in the first one, so how can I insert the io.run inside the io_context.run()?
My main is the following:
boost::asio::io_context io_context;
boost::asio::io_context io;
int main{
  //create a server object to accept incoming client connections
  tcp_server server(io_context);

  open_port_arduino();

  start = std::chrono::high_resolution_clock::now(); //time_init
  //writes to arduino with intervals of 2 seconds
  tim.expires_after(boost::asio::chrono::seconds {2});
  tim.async_wait(timer_handler);
  //reads from arduino
  start_read_arduino();

  io.run();
  io_context.run();
}

A: To reply to your comment: you do not need a second io_context.
However, you can (see also Do we need  multiple io_service per thread for threaded boost::asio server with a single acceptor and https://theboostcpplibraries.com/boost.asio-scalability).
One benefit could be thread isolation: if you run separate contexts on separate threads, there is implicit task serialization. (Contrast with a single context on multiple threads, where tasks might require manual serialization e.g. using strands).
The most straight forward thing I'd imagine for you to "fix" it is to simply pass a reference to the same io_service to all parties:
Live On Coliru
static io_context io;

struct tcp_server {
    tcp_server(io_context& ctx) : _ctx(ctx) {}
  private:
    io_context& _ctx; // REFERENCE
};

int main() {
    tcp_server server(io);

    // ...

(The live demo prints "Timer callback: success" as expected)
Multi-Thread
If some of your IO tasks block for significant amounts of time you will want to run several threads. In that case I'd switch the approach to passing an executor to your classes, and make sure they wrap it in strands:
boost::asio::thread_pool io(2); // two threads
using boost::asio::any_io_executor;

struct tcp_server {
    tcp_server(any_io_executor ex) : _ex(make_strand(ex)) {}
  private:
    any_io_executor _ex;
};

And then
int main() {
    //create a server object to accept incoming client connections
    tcp_server server(io.get_executor());

Again, the Live demo prints "Timer callback: Success" as expected.


text:
Q: what happens when we type cast from lower datatype to higher datatype Will the accessibility of memory space get changed or just informing the compiler take the variable of mentioned type?
Example:
int main()
{
    char a;
    a = 123456789;
    printf("ans is %d\n",(int)a);
}

Output:
overflow in implicit constant conversion a= 123456789.
ans is 21.

Here I know why it's causing overflow. But I want to know how memory is accessed when an overflow occurs.

A: This is kind of simple: Since char typically only holds one byte, only a single byte of 123456789 will be copied to a. Exactly how depends on if char is signed or unsigned (it's implementation-specific which one it is). For the exact details see e.g. this integer conversion reference.
What typically happens (I haven't seen any compiler do any different) is that the last byte of the value is copied, unmodified, into a.
For 123456789, if you view the hexadecimal representation of the value it will be 0x75bcd15. Here you can easily see that the last byte is 0x15 which is 21 in decimal.
What happens with the casting to int when you print the value is actually nothing that wouldn't happen anyway... When using variable-argument functions like printf values of a smaller type than int will be promoted to an int. Your printf call is exactly equal to
printf("ans is %d\n",a);


text:
Q: How can I hide certain Elements when taking a Screenshot In my project I've got a gameCamera which is used to diplay the things inside my level and a uiCamera which displays the ui-elements.
I'm trying to take a screenshot which only consists of the level-elements and not the ui.
My attempt was to hide the uiCamera which works but it also briefly hides the ui for the user and it doesn't look very nice.
This was the code:
// hide the camera
this->getUiCamera()->setVisible(false);

utils::captureScreen([](bool captureBool, std::string path) {
    // do something to make UI visible again, left this out because its not really relevant
}, "level_screenshot.png");

I also tampered around with renderTexture but that didn't work out well probably because of the parallax effect I use in the level.
Is there any way I can take a screenshot while hiding the uiCamera? Is it possible to take a Screenshot of only the gameCamera itself, maybe by using renderTexture?
My cocos version is 3.9

A: You can do it by adding all the Nodes(which should not be present in the screenshot) in an Array, disable the visibility of all nodes just before taking the screen shot. Enable the visibility after the screen shot taken.


text:
Q: Append string to matching columns (with various data types) in the same Pandas dataframe I am looking for a way to turn this set of data
 columns0    columns1 columns2
 row1         bill    bill
 row2         $0.00   $0.00
 row3         Free    $1.25
 row4         $1.50   $1.25

into this ...
 columns0     columns2        columns3
 row1         bill( match)    bill(match)
 row2         $0.00(match)   $0.00(match)
 row3         Free            $1.25
 row4         $1.50           $1.25

when I use this df.loc[(df['columns1'] == df['columns2  ']), :] += ' (Match)'
 columns0          columns1         columns2
 row1**(match)**   bill( match)    bill( match)
 row2**(match)**   $0.00(match)   $0.00(match)
 row3              Free            $1.25
 row4              $1.50           $1.25

I am getting a match on the columns0 as well.I would only like "match" to be on only columns1 and columns2.
I need some way to match the similarity across rows or even columns to find the match.
If anyone has a better way to go about this then or has resources that could help me figure out this issue in python + pandas issue, please comment.

A: You can use .loc accessor for this, assuming your data is stored as strings.
df.loc[df['columns1'] == df['columns2'], :] += ' (match)'

If your data is not stored as strings, you would have to convert them beforehand:
df.loc[:] = df.loc[:].astype(str)

Result:
           columns1       columns2
row1   bill (match)   bill (match)
row2  $0.00 (match)  $0.00 (match)
row3           Free          $1.25
row4          $1.50          $1.25

If you only wish to check index row1 for a match:
df.loc[(df['columns1'] == df['columns2']) & (df.index == 'row1'), :] += ' (match)'

#           columns1      columns2
# row1  bill (match)  bill (match)
# row2         $0.00         $0.00
# row3          Free         $1.25
# row4         $1.50         $1.25

Update: The solution still works when the index is promoted to a column. You just have to select columns to update:
df.loc[df['columns1'] == df['columns2'], ['columns1', 'columns2']] += ' (match)'

#   columns0       columns1       columns2
# 0     row1   bill (match)   bill (match)
# 1     row2  $0.00 (match)  $0.00 (match)
# 2     row3           Free          $1.25
# 3     row4          $1.50          $1.25


text:
Q: Parse cookie by domain in NGINX I have two cookies with same name userId on client. They differ only by domain set. One is tradernet.com and another one is .tradernet.com
If I use $cookie_userId, nginx catches first one and it's not always th same one.
How do I catch cookie with exact domain in nginx?

A: You can't because the domain is not part of the cookie header content sent by clients. Here's the relevant excerpt of RFC 6265 about how Cookie header value is built :

The user agent MUST use an algorithm equivalent to the following
     algorithm to compute the "cookie-string" from a cookie store and a
     request-uri:

*

*Let cookie-list be the set of cookies from the cookie store that
     meets all of the following requirements : [...]

*The user agent SHOULD sort the cookie-list in the following
     order : [...]

*Update the last-access-time of each cookie in the cookie-list to
     the current date and time.

*Serialize the cookie-list into a cookie-string by processing each
    cookie in the cookie-list in order:

*

*Output the cookie's name, the %x3D ("=") character, and the
cookie's value.

*If there is an unprocessed cookie in the cookie-list, output
    the characters %x3B and %x20 ("; ").


text:
Q: printing character from char pointer #include <stdio.h>

int main()
{
 char *arr = "This is to test";
 printf("\n%c %c ",*(arr++), *(arr++));
 return 0;
}

This program outputs h T rather than outputting h h. Why is it so?

A: Using two increment operators in one statement that are independent from each other leads to undefined behaviour because the compiler is free to choose which increment to do first (or rather you didn't give the compiler any hint which one to do first).
Anyway, if you're expecting h h, it's also wrong to write *(arr++) twice, because they will be executed both, incrementing arr twice - and so there will be two different characters printed (arr[0] and arr[1]).
Another error is using post-increment which will lead to arr being incremented after the character was fetched, so it will output T, not h.
So a possible solution is this code, using an additional variable:
#include <stdio.h>

int main()
{
 char *arr = "This is to test";
 char c = *(++arr);
 printf("\n%c %c ", c, c);
 return 0;
}

In this code, arr will only be incremented once and the character fetched at this position can be used later.

A: arr++ is equivalent to arr += 1. You are actually incrementing arr. This is what is happening in your situation.
printf("\n%c %c ",*(arr++), *(arr++));
//                  ^         ^Evaluates to 0 therefore prints T then increments by 1
//                  ^Evaluates to 1 therefore prints h and then increments by 1
//Now if where to prinf %s arr it should print "is is to test"

What you want to do is
printf("\n%c %c ",*(arr+1), *(arr+1));

Note: As others have pointed out multiple pre/postfix ++/-- produce undefined behavior (order of evaluation) and should be avoided, although I understand in your situation you were not trying to modify the original array.

A: Basically because both ++'es move the pointer forward one step after printing, and with the code generated by most compilers today the rightmost one will be done first. and then it will move left.
This is because the unary operator arr++ will cause arr = arr + 1; and since it is using a postfix operator it will print before assigning the result to arr.
So the steps that are executed are:

*

*Print T

*move pointer to h

*Print h

*move pointer to i

If you had three in the same line you would get i h T as that would cause it to move a third time.
What I believe you are trying to do is something to the effect of:
printf("\n%c %c ",*(arr+1), *(arr+1));

A: if u r supposed to get output h h.
then u have to write
printf("\n%c  %c",*(arr+1),*(arr+1));

but here in your code you updated arr and this increment is post increment so first it assign the value to the function argument then variable will increment.
in function
printf("\n%c %c ",*(arr++), *(arr++));

values assigned from left to right on stack so u can imagine like following statement:
printf("\n%c %c ",'h', 'T');

and argument "\n%c %c " will print the output from left to right and u got the output h T.


text:
Q: Pyspark to flatten an array and explode a struct to get the desired output I have a data with below Schema: index attribute is Struct --> with array --> each array element inside struct
root
 |-- id_num: string (nullable = true)
 |-- indexes: struct (nullable = true)
 |    |-- customer_rating: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- data_sufficiency_indicator: boolean (nullable = true)
 |    |    |    |-- value: double (nullable = true)
 |    |    |    |-- version: string (nullable = true)
 |    |-- reputation: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- data_sufficiency_indicator: boolean (nullable = true)
 |    |    |    |-- low_value_reason: array (nullable = true)
 |    |    |    |    |-- element: string (containsNull = true)
 |    |    |    |-- value: double (nullable = true)
 |    |    |    |-- version: string (nullable = true)
 |    |-- visibility: array (nullable = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- data_sufficiency_indicator: boolean (nullable = true)
 |    |    |    |-- low_value_reason: array (nullable = true)
 |    |    |    |    |-- element: string (containsNull = true)
 |    |    |    |-- value: double (nullable = true)
 |    |    |    |-- version: string (nullable = true)

I want to translate the schema into below format and get the data values into corresponding columns
root
 |-- id_num: string (nullable = true)
 |-- indexes_type: string (nullable = true)    --> this field hold indexes struct elements as a row
 |-- data_sufficiency_indicator: boolean (nullable = true)
 |-- value: double (nullable = true)
 |-- version: string (nullable = true)
 |-- low_value_reason: string (nullable = true)  --> each element in the array becomes a new row

Here is the sample input data in json format:
{"id_num":"1234","indexes":{"visibility":[{"version":"2.0","data_sufficiency_indicator":true,"value":2.16,"low_value_reason":["low scores from reviews_and_visits","low scores from online_presence"]}],"customer_rating":[{"version":"2.0","data_sufficiency_indicator":false}],"reputation":[{"version":"2.0","data_sufficiency_indicator":false}]}}
{"data_id":"5678","indexes":{"visibility":[{"version":"2.0","data_sufficiency_indicator":true,"value":2.71,"low_value_reason":["low scores from reviews_and_visits","low scores from online_presence"]}],"customer_rating":[{"version":"2.0","data_sufficiency_indicator":false}]}}
{"data_id":"9876","indexes":{"visibility":[{"version":"2.0","data_sufficiency_indicator":true,"value":3.06}],"customer_rating":[{"version":"2.0","data_sufficiency_indicator":false}],"reputation":[{"version":"2.0","data_sufficiency_indicator":false}]}}

Expected Output
id_num  |   indexes_type    |   version |   data_sufficiency_indicator | value  |   low_value_reason
==============================================================================================================
9999        visibility          2.0             true                    2.16        low scores from reviews_and_visits
9999        visibility          2.0             true                    2.16        low scores from online_presence
9999        customer_rating     2.0             false
9999        reputation          2.0             false
8888        visibility          2.0             true                    2.71        low scores from reviews_and_visits
8888        visibility          2.0             true                    2.71        low scores from online_presence
8888        customer_rating     2.0             false
7898        visibility          2.0             true                    3.06
7898        customer_rating     2.0             false
7898        reputation          2.0             false

Any help on this usecase is much appreciated. Also is it possible to get the output without hardcoding the struct values in the code, since they can extend beyond what is in the example.

A: You can set the column indexes as MapType instead of StructType by explicitly specifying the schema when loading the dataframe with spark.read.json(), see below:
schema = "id_num string,indexes map<string,array<struct<data_sufficiency_indicator:boolean,low_value_reason:array<string>,value:double,version:string>>>"

df = spark.read.json("/path/to/jsons", schema=schema)

df.printSchema()
root
 |-- id_num: string (nullable = true)
 |-- indexes: map (nullable = true)
 |    |-- key: string
 |    |-- value: array (valueContainsNull = true)
 |    |    |-- element: struct (containsNull = true)
 |    |    |    |-- data_sufficiency_indicator: boolean (nullable = true)
 |    |    |    |-- low_value_reason: array (nullable = true)
 |    |    |    |    |-- element: string (containsNull = true)
 |    |    |    |-- value: double (nullable = true)
 |    |    |    |-- version: string (nullable = true)

and then do select and explode_outer/inline_outer multiple times to get the desired result:
df_new = df.selectExpr("id_num", "explode_outer(indexes) as (indexes_type, vals)") \
    .selectExpr("*", "inline_outer(vals)") \
    .selectExpr(
        "id_num",
        "indexes_type",
        "version",
        "data_sufficiency_indicator",
        "value",
        "explode_outer(low_value_reason) as low_value_reason"
    )

df_new.show(truncate=False)
+------+---------------+-------+--------------------------+-----+----------------------------------+
|id_num|indexes_type   |version|data_sufficiency_indicator|value|low_value_reason                  |
+------+---------------+-------+--------------------------+-----+----------------------------------+
|1234  |visibility     |2.0    |true                      |2.16 |low scores from reviews_and_visits|
|1234  |visibility     |2.0    |true                      |2.16 |low scores from online_presence   |
|1234  |customer_rating|2.0    |false                     |null |null                              |
|1234  |reputation     |2.0    |false                     |null |null                              |
|5678  |visibility     |2.0    |true                      |2.71 |low scores from reviews_and_visits|
|5678  |visibility     |2.0    |true                      |2.71 |low scores from online_presence   |
|5678  |customer_rating|2.0    |false                     |null |null                              |
|9876  |visibility     |2.0    |true                      |3.06 |null                              |
|9876  |customer_rating|2.0    |false                     |null |null                              |
|9876  |reputation     |2.0    |false                     |null |null                              |
+------+---------------+-------+--------------------------+-----+----------------------------------+

BTW. I changed data_id to id_num in your sample JSON which I supposed is your typo. if not, just add data_id string into schema and then use coalesce(id_num,data_id) to get the final id_num column.
On the other hand, you can also try using from_json/to_json function after loading the dataframe without specifying schema, see a similar example here.


text:
Q: Using multiple array elements to produce multiple lines for the same symbols (Pine Script) Based on this solution from Bjorn to include more array elements in the code while using float I am trying to plot several lines for the same symbol, but it seems that only the first set of array elements is processed. Is there a way to produce more lines for the same symbols (up to the number of occurrences of the symbol in the array)? The example arrays are included below. QQQ would have 3 lines, AMZN 2 lines, and MSFT just 1 line.
//@version=4
study("Lines", "LI", true)

x1_date = timestamp(2020, 10, 30, 9, 30)
x2_date = timestamp(2021, 2, 16, 9, 30)

var string[]    a_ticker            = array.new_string()
var int[]       a_x1                = array.new_int()
var int[]       a_x2                = array.new_int()
var float[]     a_y1                = array.new_float()
var float[]     a_y2                = array.new_float()
var string[]    a_str               = array.new_string()
var string[]    a_digits_str        = array.new_string()
var int[]       a_digits_int        = array.new_int()
var line        myLine              = line.new(x1_date, na, x2_date, na, extend=extend.both, color = color.yellow, xloc = xloc.bar_time)

var string[]    a_str_set_ticker    = array.new_string()
var string[]    a_str_set_x1        = array.new_string()
var string[]    a_str_set_x2        = array.new_string()
var string[]    a_str_set_y1        = array.new_string()
var string[]    a_str_set_y2        = array.new_string()

// Initializes the a_digits_int array
f_init_digits_int() =>
    for x = 0 to 9
        array.push(a_digits_str, tostring(x))
        array.push(a_digits_int, x)

// Converts a string containing a digit, to an integer
f_digitstr2int(_dstr) =>
    array.get(a_digits_int, array.indexof(a_digits_str, _dstr))

// Converts a string containing an integer, to an integer
f_str2int(_s) =>
    int multiplier = 1
    int number = 0

    // Initialize the a_digits_int array in case it hasn't been done yet.
    if not array.size(a_digits_int)
        f_init_digits_int()

    a = str.split(_s,"")
    array.reverse(a)

    for x = 0 to array.size(a)-1
        digit_str = array.get(a,x)
        number := number + multiplier * f_digitstr2int(digit_str)
        multiplier := multiplier * 10

    number

// Converts a string containing a float, to a float
f_str2float(_s) =>
    float   number          = na
    string  s_absolute      = str.replace_all(_s,"-","")
    bool    is_negative     = str.length(s_absolute) != str.length(_s)

    a_split = str.split(s_absolute,".")
    if array.size(a_split) > 1 // _s has a decimal separator
        number := f_str2int(array.get(a_split,0)) + f_str2int(array.get(a_split,1)) / pow(10,str.length(array.get(a_split,1)))
    else // _s does not have a decimal separator, so it's an integer
        number := f_str2int(_s)

    number * (is_negative ? -1 : 1)

// Initialize the data
f_init_data() =>
    // 4000 tickers, broken down into 5 sets, because a string has a max size of 4096 characters.
    // 800 tickers, set 1
    array.push(a_str_set_ticker, "QQQ,QQQ,QQQ,AMZN,AMZN,MSFT")
    array.push(a_str_set_y1, "267,300,222,3000,2000,237")
    array.push(a_str_set_y2, "338.2,200,111,2500,1000,222")

if barstate.islast
    // Initialization
    f_init_data()

    // Process the data
    for z = 0 to array.size(a_str_set_ticker)-1
        a_ticker := array.concat(str.split(array.get(a_str_set_ticker, z),","), a_ticker)

        a_str := str.split(array.get(a_str_set_y1, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_y1,f_str2float(array.get(a_str,i)))

        a_str := str.split(array.get(a_str_set_y2, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_y2,f_str2float(array.get(a_str,i)))

    // Draw line 1
    if array.includes(a_ticker, syminfo.ticker)
        idx = array.indexof(a_ticker, syminfo.ticker)
        y1  = array.get(a_y1, idx)
        y2  = array.get(a_y2, idx)
        line.set_y1(myLine, y1)
        line.set_y2(myLine, y2)

Edit 1:
Using the solution from Bjorn with example array SET 1 and SET 2 does not produce expected results. SET 2 has the same elements as SET 1, but they are split into two array groups (important to use groups as strings are limited to 4096 characters). While SET 1 plots all lines correctly, SET 2 plots the same lines incorrectly for all symbols. This is especially visible when looking at SPY. Not clear why this is the case as the code looks correct. Is there a bug?
Set 1 for SPY

Set 2 for SPY

Following arrays were used with the 2 sets:
//SET 1

// array.push(a_str_set_ticker, "TSLA,TSLA,TSLA,SPY,SPY,SPY,SPY,AAPL,AAPL,AAPL")
// array.push(a_str_set_x1, "2,2,2,2,2,2,2,2,2,2")
// array.push(a_str_set_x2, "1,1,1,1,1,1,1,1,1,1")
// array.push(a_str_set_y1, "872.94,874.37,643.0,392.01,391.88,378.81,374.8,130.65,131.07,120.1")
// array.push(a_str_set_y2, "872.47,873.18,659.51,391.8,391.52,378.23,375.16,129.89,130.36,121.2")

//SET 2

array.push(a_str_set_ticker, "TSLA,TSLA,TSLA,SPY")
array.push(a_str_set_x1, "2,2,2,2")
array.push(a_str_set_x2, "1,1,1,1")
array.push(a_str_set_y1, "872.94,874.37,643.0,392.01")
array.push(a_str_set_y2, "872.47,873.18,659.51,391.8")

array.push(a_str_set_ticker, "SPY,SPY,SPY,AAPL,AAPL,AAPL")
array.push(a_str_set_x1, "2,2,2,2,2,2")
array.push(a_str_set_x2, "1,1,1,1,1,1")
array.push(a_str_set_y1, "391.88,378.81,374.8,130.65,131.07,120.1")
array.push(a_str_set_y2, "391.52,378.23,375.16,129.89,130.36,121.2")

Edit 2
Bjorn's revised solution works correctly for array groups, but when using this approach for many elements, Pine Script now produces the error "Loop takes too long to execute (> 200ms)" Below is a theoretical example for 1316 coordinates groups. The original code allowed for 4000+ coordinates and it worked for more before the fix. Is there a way around this?
array.push(a_str_set_ticker, "SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SP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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1")
array.push(a_str_set_y1, "360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360")
array.push(a_str_set_y2, "400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400")

array.push(a_str_set_ticker, "SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SPY,SP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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1")
array.push(a_str_set_y1, "360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360")
array.push(a_str_set_y2, "400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400,400")

A: Solution below.
I was able to remove my f_str2float() and f_str2int() functions, because yesterday they released a new built-in function tonumber().
Script looks cleaner now.
//@version=4
study("Lines", "LI", true)

int             i_max_lines         = input(10,    "Max number of lines drawn", minval=1, maxval=20)
bool            i_extend_lines      = input(false, "Extend lines")

var string[]    a_ticker            = array.new_string()
var int[]       a_x1                = array.new_int()
var int[]       a_x2                = array.new_int()
var float[]     a_y1                = array.new_float()
var float[]     a_y2                = array.new_float()
var string[]    a_str               = array.new_string()

var string[]    a_str_set_ticker    = array.new_string()
var string[]    a_str_set_x1        = array.new_string()
var string[]    a_str_set_x2        = array.new_string()
var string[]    a_str_set_y1        = array.new_string()
var string[]    a_str_set_y2        = array.new_string()

var line[]      a_lines             = array.new_line()

// Initialize the data
f_init_data() =>
    // 4000 tickers, broken down into 5 sets, because a string has a max size of 4096 characters.
    // 800 tickers, set 1
    array.push(a_str_set_ticker, "QQQ,QQQ,QQQ,AMZN,AMZN")
    array.push(a_str_set_x1, "20,30,40,20,30")
    array.push(a_str_set_x2, "2,3,4,2,3")
    array.push(a_str_set_y1, "267,300,222,3000,2000")
    array.push(a_str_set_y2, "338.2,200,111,2500,1000")

// Initialize the lines
f_init_lines() =>
    for x = 0 to i_max_lines-1
        array.push(a_lines, line.new(na, na, na, na, extend=i_extend_lines ? extend.both : extend.none))

// Draw lines
f_draw_lines() =>
    if array.includes(a_ticker, syminfo.ticker)
        var int[]   subarray_x1 = array.new_int()
        var int[]   subarray_x2 = array.new_int()
        var float[] subarray_y1 = array.new_float()
        var float[] subarray_y2 = array.new_float()
        var int     x1          = na
        var int     x2          = na
        var float   y1          = na
        var float   y2          = na

        // Get elements with current ticker and put in a subarray.
        for x = array.indexof(a_ticker, syminfo.ticker) to array.lastindexof(a_ticker, syminfo.ticker)
            if array.get(a_ticker, x) == syminfo.ticker
                array.push(subarray_x1, array.get(a_x1, x))
                array.push(subarray_x2, array.get(a_x2, x))
                array.push(subarray_y1, array.get(a_y1, x))
                array.push(subarray_y2, array.get(a_y2, x))

        // Draw all lines in the subarray.
        for x = 0 to min(array.size(subarray_x1),i_max_lines)-1
            x1 := array.get(subarray_x1, x)
            x2 := array.get(subarray_x2, x)
            y1 := array.get(subarray_y1, x)
            y2 := array.get(subarray_y2, x)
            line.set_xy1(array.get(a_lines, x), bar_index - x1, y1)
            line.set_xy2(array.get(a_lines, x), bar_index - x2, y2)

if barstate.islast
    // Initialization
    f_init_data()
    f_init_lines()

    // Process the data
    for z = 0 to array.size(a_str_set_ticker)-1
        a_ticker := array.concat(str.split(array.get(a_str_set_ticker, z),","), a_ticker)

        a_str := str.split(array.get(a_str_set_x1, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_x1,int(tonumber(array.get(a_str,i))))

        a_str := str.split(array.get(a_str_set_x2, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_x2,int(tonumber(array.get(a_str,i))))

        a_str := str.split(array.get(a_str_set_y1, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_y1,tonumber(array.get(a_str,i)))

        a_str := str.split(array.get(a_str_set_y2, z),",")
        for i = 0 to array.size(a_str)-1
            array.push(a_y2,tonumber(array.get(a_str,i)))

    // Draw lines
    f_draw_lines()

Edit 1
In response to this comment.
It seems there was a problem with the array.concat() function, which inverted the ticker sequence. I solved it by processing the tickers the same way as the x/y values.
Also added a debug checkbox in the inputs, to show the content of the arrays.
//@version=4
study("Lines", "LI", true)

int             i_max_lines         = input(10,    "Max number of lines drawn", minval=1, maxval=20)
bool            i_extend_lines      = input(false, "Extend lines")
bool            i_debug             = input(false, "Show debug info")

var string[]    a_ticker            = array.new_string()
var int[]       a_x1                = array.new_int()
var int[]       a_x2                = array.new_int()
var float[]     a_y1                = array.new_float()
var float[]     a_y2                = array.new_float()

var string[]    a_str_set_ticker    = array.new_string()
var string[]    a_str_set_x1        = array.new_string()
var string[]    a_str_set_x2        = array.new_string()
var string[]    a_str_set_y1        = array.new_string()
var string[]    a_str_set_y2        = array.new_string()

var line[]      a_lines             = array.new_line()

// Initialize the data
f_init_data() =>

    //SET 1
    // array.push(a_str_set_ticker, "TSLA,TSLA,TSLA,SPY,SPY,SPY,SPY,AAPL,AAPL,AAPL")
    // array.push(a_str_set_x1, "2,2,2,2,2,2,2,2,2,2")
    // array.push(a_str_set_x2, "1,1,1,1,1,1,1,1,1,1")
    // array.push(a_str_set_y1, "872.94,874.37,643.0,392.01,391.88,378.81,374.8,130.65,131.07,120.1")
    // array.push(a_str_set_y2, "872.47,873.18,659.51,391.8,391.52,378.23,375.16,129.89,130.36,121.2")

    //SET 2
    array.push(a_str_set_ticker, "TSLA,TSLA,TSLA,SPY")
    array.push(a_str_set_x1, "2,2,2,2")
    array.push(a_str_set_x2, "1,1,1,1")
    array.push(a_str_set_y1, "872.94,874.37,643.0,392.01")
    array.push(a_str_set_y2, "872.47,873.18,659.51,391.8")

    array.push(a_str_set_ticker, "SPY,SPY,SPY,AAPL,AAPL,AAPL")
    array.push(a_str_set_x1, "2,2,2,2,2,2")
    array.push(a_str_set_x2, "1,1,1,1,1,1")
    array.push(a_str_set_y1, "391.88,378.81,374.8,130.65,131.07,120.1")
    array.push(a_str_set_y2, "391.52,378.23,375.16,129.89,130.36,121.2")

// Initialize the lines
f_init_lines() =>
    for x = 0 to i_max_lines-1
        array.push(a_lines, line.new(na, na, na, na, extend=i_extend_lines ? extend.both : extend.none))

// Draw lines
f_draw_lines() =>
    if array.includes(a_ticker, syminfo.ticker)
        var int[]   subarray_x1 = array.new_int()
        var int[]   subarray_x2 = array.new_int()
        var float[] subarray_y1 = array.new_float()
        var float[] subarray_y2 = array.new_float()
        var int     x1          = na
        var int     x2          = na
        var float   y1          = na
        var float   y2          = na

        // Get elements with current ticker and put in a subarray.
        for x = array.indexof(a_ticker, syminfo.ticker) to array.lastindexof(a_ticker, syminfo.ticker)
            if array.get(a_ticker, x) == syminfo.ticker
                array.push(subarray_x1, array.get(a_x1, x))
                array.push(subarray_x2, array.get(a_x2, x))
                array.push(subarray_y1, array.get(a_y1, x))
                array.push(subarray_y2, array.get(a_y2, x))

        // Draw all lines in the subarray.
        for x = 0 to min(array.size(subarray_x1),i_max_lines)-1
            x1 := array.get(subarray_x1, x)
            x2 := array.get(subarray_x2, x)
            y1 := array.get(subarray_y1, x)
            y2 := array.get(subarray_y2, x)
            line.set_xy1(array.get(a_lines, x), bar_index - x1, y1)
            line.set_xy2(array.get(a_lines, x), bar_index - x2, y2)

// Process the data
f_process_data() =>
    for z = 0 to array.size(a_str_set_ticker)-1
        for i = 0 to array.size(str.split(array.get(a_str_set_ticker, z),","))-1
            array.push(a_ticker,              array.get(str.split(array.get(a_str_set_ticker, z),","),i)    )
            array.push(a_x1,     int(tonumber(array.get(str.split(array.get(a_str_set_x1,     z),","),i)))  )
            array.push(a_x2,     int(tonumber(array.get(str.split(array.get(a_str_set_x2,     z),","),i)))  )
            array.push(a_y1,         tonumber(array.get(str.split(array.get(a_str_set_y1,     z),","),i))   )
            array.push(a_y2,         tonumber(array.get(str.split(array.get(a_str_set_y2,     z),","),i))   )

// Debug info
f_debug(_show) =>
    if _show
        label_text = "a_ticker=" + tostring(a_ticker) + "\n" + "a_x1=" + tostring(a_x1) + "\n" + "a_x2=" + tostring(a_x2) + "\n" + "a_y1=" + tostring(a_y1) + "\n" + "a_y2=" + tostring(a_y2)
        label.new(bar_index, high, label_text)

if barstate.islast
    // Initialization
    f_init_data()
    f_init_lines()

    // Process the data
    f_process_data()

    // Draw lines
    f_draw_lines()

    // Show debug info
    f_debug(i_debug)

Edit 2
In response to this comment.
Loops made smaller to avoid Loop takes too long to execute error.
Please update the f_process_data() function to the one below.
// Process the data
f_process_data() =>
    var string[]    a_str = array.new_string()

    for z = 0 to array.size(a_str_set_ticker)-1
        a_size  = array.size(str.split(array.get(a_str_set_ticker, z),","))

        a_str := str.split(array.get(a_str_set_ticker, z),",")
        for i = 0 to a_size-1
            array.push(a_ticker,              array.get(a_str,i)    )

        a_str := str.split(array.get(a_str_set_x1, z),",")
        for i = 0 to a_size-1
            array.push(a_x1,     int(tonumber(array.get(a_str,i)))  )

        a_str := str.split(array.get(a_str_set_x2, z),",")
        for i = 0 to a_size-1
            array.push(a_x2,     int(tonumber(array.get(a_str,i)))  )

        a_str := str.split(array.get(a_str_set_y1, z),",")
        for i = 0 to a_size-1
            array.push(a_y1,         tonumber(array.get(a_str,i))   )

        a_str := str.split(array.get(a_str_set_y2, z),",")
        for i = 0 to a_size-1
            array.push(a_y2,         tonumber(array.get(a_str,i))   )

A: Since Pinescript V5 and April 2022, the new fonction matrix allow tu use bi dimensionnal arrays (cf https://www.tradingview.com/pine-script-docs/en/v5/Release_notes.html?highlight=entry_id#id10)


text:
Q: Not Response contant logged with Spring CommonsRequestLoggingFilter My issue is that I can have a log of the Web Service Response with Spring CommonsRequestLoggingFilter.
Here is some details:
I expose a REST Service like this:
@GetMapping(value = "dessins/{concatDesignNumber}/fichiers", produces = APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    public ResponseEntity findFilesListByConcatDesignNumber(
            @PathVariable("concatDesignNumber") String concatDesignNumber, Pageable pageable) {

    ...

    return ResponseEntity.ok(collectorResult);
}

I want to log the request and the response, including the repsonse content.
Currently, I use CommonsRequestLoggingFilter like this:
@Configuration
public class RequestLoggingFilterConfig extends CommonsRequestLoggingFilter {

    @Bean
    public CommonsRequestLoggingFilter requestLoggingFilter() {
        CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter();
        filter.setIncludeQueryString(true);
        filter.setIncludePayload(true);
        // truncate payloads
        filter.setMaxPayloadLength(100000000);
        filter.setIncludeHeaders(false);
        filter.setAfterMessagePrefix("Request received: ");
        return filter;
    }
}

It works well with the request, but the response is not logged. Is there a clean way to log the response, response content and response error ?
Thanks in advance for your help,
Regards,
Florian


text:
Q: Firefox Unresponsive script after wake-up/resume Firefox is often unresponsive after waking up/resuming from hibernate/suspend on Ubuntu 12.04. After a while it will give me an error saying that some script is unresponsive and I get the choice to 'Stop' it or 'Continue' running it:

A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

I guess that Firefox doesn't like active scripts to be interrupted by hibernate/suspend, and thus freezes once I wake-up/resume my laptop. How do I resolve this, in order to make Firefox wake-up happy and snappy again?

A: Try this:
Type about:config in the URL bar and look for: dom.max_script_run_time, Double click it and change the time to 20.

A: Firefox is waking up and realizing that nothing has been happening for those running scripts for the past so many hours.  Additionally, if you're coming back from hibernation, the system is less responsive as it swaps all your programs back into RAM from swap space. It is rightfully notifying you that things have stopped.
I usually just tell it to 'continue' and it gives everything  the extra couple moments it needs to get moving again after a hibernate.


text:
Q: No slime spawning in slime chunk 2018 1.12.1 I found a slime chunk right inside my straight mine so I dug out a 16x16x3 chunk at level 19 and coordinates 71 19 -120. I have lit up the room light levels are above 10 everywhere and there are no other mobs spawning inside.
I have been waiting for about an hour afk with the game active at around 32 blocks away (coordinates are 90 11 -125) in order to get some slimes to spawn but still not even one.

*

*Confirmed slime chunk with - http://chunkbase.com/apps/slime-finder#-1729309068124591226

*The height level is below 40

*Several nights have passed

*Player position is around 32 blocks away from the center of the slime chunk (coordinates of center 7 19 7)

*Playing on 1.12.1 without any mods

*There isn't a huge stack of monsters around the slime chunk (there is a ravine right above it but its lit up)

*I searched for questions like this but they were mostly either related to a different problem that I have already solved or from 2+ years ago.

What could be causing this issue?

A: The coordinates you give are only about 21 blocks apart. Assuming that you have given the center of your farm (71,19,-120) and the location you are standing (90,11,-1225) you may not be far enough away.


text:
Q: Spring RabbitMQ get all declared queues I'm trying to get a list of all declared queues for a particular Virtual Host, using spring Rabbit libraries. But I can't see how you do it. There does exist a RabbitAdmin class which allows you to declare a queue, but you can't retrieve a list of existing queues.
Any ideas?
Thanks.

A: You won't be able to do this from the Spring/Java client.
Instead there is a REST API which is part of the Management plugin http://www.rabbitmq.com/management.html
Take a look at
http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v3_0_2/priv/www/api/index.html
for the full reference.
You will be interested in the section /api/queues to get all queues or /api/queues/vhost to get queues on a given vhost

A: For those reading that in 2016 -
Take a look on Hop (https://github.com/rabbitmq/hop), it aims to wrap RabbitMQ management API for Java.

A: Spring has an implementation now as well
http://docs.spring.io/spring-amqp/reference/htmlsingle/#management-template
When the management plugin is enabled, the RabbitMQ server exposes a REST API to monitor and configure the broker. A Java Binding for the API is now provided. In general, you can use that API directly, but a convenience wrapper is provided to use the familiar Spring AMQP Queue, Exchange, and Binding domain objects with the API. Much more information is available for these objects when using the com.rabbitmq.http.client.Client API directly (QueueInfo, ExchangeInfo, and BindingInfo respectively). The class RabbitManagementTemplate provides operations for the management apis. The two relating to this question are
List<Queue> getQueues();

List<Queue> getQueues(String vhost);


text:
Q: How to \protect '#' in \PackageError? I'm trying to write a package with a macro that's abbreviates \PackageError,
and I'd like in particular to use it to report messages such as
Parameter #1 cannot be "s"
(assuming my input validation determined the user typed something like
\somemacro{s}
and \somemacro really cannot have s as its first parameter).
\# (no protection),
\protect\# and
\protect\char`\#
all produce \# instead of #.
\protect# produces and error that reads
ERROR: Illegal parameter number in definition of  .
(that is, my error reporting system itself raises an error in that case).
So,
is it possible to print a literal # within \PackageError?
A MWE:
\documentclass{article}
\newcommand*{\myerror}[1]{%
  \PackageError
  {Some package}
  {#1}
  {}% no extra help
}

\begin{document}
Hello, world!

\myerror{%
  \protect\#1 doesn't work,
  but \protect~ does
}

\end{document}

That is,
\protect~ prints a ~.
--EDIT--
Because I can't accept more than one answer,
I'd like to point out that
antshar's answer,
David Carlisle's answer,
and
Ulrike Fischer's comment
all provide ways of printing # from within \PackageError.
As I can't think of a reason to consider one better than the others, I'll accept the answer from the user with less site reputation.
Consider this code:
\documentclass{article}

\begingroup
  \catcode`#=11
  \gdef\hashA{#}
\endgroup

\newcommand*{\hashB}{\csname c_hash_str\endcsname}

\newcommand*{\myerror}[1]{%
  \PackageError
  {Some package}
  {#1}
  {}% no extra help
}

\begin{document}
Hello, world!

\myerror{%
  These three forms print a hash symbol followed by "1":
  \hashA1
  \protect##1
  \hashB1
}
\end{document}

This correctly stops compilations and prints
ERROR: Package Some package Error: These three forms print a hash symbol followed by "1": #1 #1 #1 .
to the terminal.

A: ! Package Some package Error: #1 doesn't work, but ~ does .

See the Some package package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.16 }

?

from
\documentclass{article}
\newcommand*{\myerror}[1]{%
  \PackageError
  {Some package}
  {#1}
  {}% no extra help
}

\begin{document}
Hello, world!

\myerror{%
  \protect##1 doesn't work,
  but \protect~ does
}

\end{document}

A: You can save # as letter instead of active character using \catcode and then assign it to a macro.
\documentclass{article}
\newcommand*{\myerror}[1]{%
  \PackageError
  {Some package}
  {#1}
  {}% no extra help
}

\begin{document}
Hello, world!

\begingroup
  \catcode`#=11
  \gdef\hash{#}
\endgroup

\myerror{%
  \hash1 does work,
  and \protect~ works
}

\end{document}


text:
Q: VBA: Difference between & and + What is the difference between:
string1 + string2

and
string1 & string2

Are they equivalent? Why have two different symbols that do the same thing?

A: The expressions are the same as long as the operands are strings; if not, + might add them instead depending on type conversions. & guarantees you won't get anything except a string concatenation, and will convert operands to strings if possible to do so.
There's an MSDN entry about Concatenation operations in Visual Basic that explains it:

The & Operator (Visual Basic) is defined only for String operands, and it always widens its operands to String, regardless of the setting of Option Strict. The & operator is recommended for string concatenation because it is defined exclusively for strings and reduces your chances of generating an unintended conversion.

A: The two expressions are equivalent, but the operators are not. + can be used as an arithmetic operator as well as for string concatenation, & can only be used for the latter.


text:
Q: Spark Counter : Main method/ extends App gives different output for same application, Why it is so? I have a file which is having some missing data, So I am trying to identify the missing record count by using counter variable.
File: data-error.csv
123,200,Abc
124,300,xyz
125,4,
126,abd
127,400,abc1

This file contains Total No Records= 5 and Missing Record = 2

Program By extending App trait : output 5 2

object CountersTest extends App{
  val conf=new SparkConf().setAppName("CounterTest").setMaster("local")
  val sc=new SparkContext(conf)

  val fileRDD=sc.textFile("data-error.csv")
  var missingRecords=0

  val rdd1=fileRDD.map(rec=>{
    val parseResult=RecordParser.parse(rec)
    if(parseResult.isLeft) missingRecords+=1
    rec
  })
  println(rdd1.count())
  println(missingRecords)
}

Program By using main method : output 5 0

object CounterWithMain {
  def main(args: Array[String]): Unit = {
    val conf=new SparkConf().setAppName("CounterTest").setMaster("local")
    val sc=new SparkContext(conf)

    val fileRDD=sc.textFile("data-error.csv")
    var missingRecords=0

    val rdd1=fileRDD.map(rec=>{
      val parseResult=RecordParser.parse(rec)
      if(parseResult.isLeft) missingRecords+=1
      rec
    })
    println(rdd1.count())
    println(missingRecords)
  }
}

Why this same application is giving different output ? Please help me out on this. Thanks in advance.


text:
Q: Why does not margin-top less than a specific value work for an inline-block element? In the following code when i specify margin-top for #thirdDiv, It doesn't work until i give it 36px.
What is the reason?

#Container {
  border: 15px solid orange;
  width: 350px;
}

#firstDiv {
  display: inline-block;
  border: 1px solid red;
  font-size: 1em;
}

#secondDiv {
  border: 1px solid green;
  display: inline-block;
  font-size: 2em;
}

#thirdDiv {
  display: inline-block;
  border: 1px solid pink;
  font-size: 1em;
  margin-top: 36px;
}

 a

 b

 c

A: Because the child elements of your Container element are based on the bottom of that div. If you add vertical-align: top to your child elements, any margin-top is possible. You can try it out in this CodePen where I copied you code and tidied the CSS up a bit. Note that you can choose to only put vertical-align: top in your #thirdDiv element. This way you can keep the other two divs in their original position.

A: What you are looking for is padding. The CSS margin properties are used to create space around elements, outside of any defined borders whereas the CSS padding properties are used to generate space around an element's content, inside of any defined borders.
Try the following instead of applying margin-top to #thirdDiv.

#Container {
 padding-top: 36px;
 border: 15px solid orange;
 width: 350px;
}
#firstDiv {
 display: inline-block;
 border: 1px solid red;
 font-size: 1em;
}
#secondDiv {
 border: 1px solid green;
 display: inline-block;
 font-size: 2em;
}
#thirdDiv {
 display: inline-block;
 border: 1px solid pink;
 font-size: 1em;
}

 a

 b

 c

A: You must specify a value for margin-top else it won't know how much margin to add.
What were typing for margin-top before, margin-top: ;?
What is your desired effect?


text:
Q: JDBC sink topic with multiple structs to postgres I am trying to sink a few topics top a postgres database. However the topic schema defines a array at the top level and within it multiple structs. Automapping does not work and I cannot find any reference how to handle this. I need all structs because they are dependent types, the second struct references the first struct as a field.
Currently it breaks when hitting the 2nd struct stating statusChangeEvent (struct) has no mapping to sql column type. This because it is using auto.create to make a table (probably called ProcessStatus) then when hitting the second entry there is no column of course.
[
    {
        "type": "record",
        "name": "processStatus",
        "namespace": "company.some.process",
        "fields": [
            {
                "name": "code",
                "doc": "The code of the processStatus",
                "type": "string"
            },
            {
                "name": "name",
                "doc": "The name of the processStatus",
                "type": "string"
            },
            {
                "name": "description",
                "type": "string"
            },
            {
                "name": "isCompleted",
                "type": "boolean"
            },
            {
                "name": "isSuccessfullyCompleted",
                "type": "boolean"
            }
        ]
    },
    {
        "type": "record",
        "name": "StatusChangeEvent",
        "namespace": "company.some.process",
        "fields": [
            {
                "name": "contNumber",
                "type": "string"
            },
            {
                "name": "processId",
                "type": "string"
            },
            {
                "name": "processVersion",
                "type": "int"
            },
            {
                "name": "extProcessId",
                "type": [
                    "null",
                    "string"
                ],
                "default": null
            },
            {
                "name": "fromStatus",
                "type": "process.status"
            },
            {
                "name": "toStatus",
                "doc": "The new status of the process",
                "type": "company.some.process.processStatus"
            },
            {
                "name": "changeDateTime",
                "type": "long",
                "logicalType": "timestamp-millis"
            },
            {
                "name": "isPublic",
                "type": "boolean"
            }
        ]
    }
]

I am not using ksql atm. Which connector settings are suited for this task? If there is a ksql alternative it would be nice to know but the current requirement is to use the JDBC connector.
I tried using flatten but it does not support struct fields that have a schema. Which seems kind of weird. Aren't schema's the whole selling point of connect with kafka? Or is it more of a constraint you have to work around?

A:
Aren't schema's the whole selling point of connect with kafka?

Yes, but Postgres (or the JDBC Sink, in general) doesn't really support nested objects within columns. For that, you're better off with a document database, such as using Mongo Sink Connector.

Which connector settings are suited for this task?

None, really, other than transforms. You could write your own if flatten doesn't work.
You could try pre-defining your table to use JSONB for the two status columns, however, that's more of a workaround.


text:
Q: How to preprocess more in C/C++ I was wondering, and some people with a lot more knowledge than me will probably know the answer :
Why isn't the C (in my case its for C++) preprocessor more complete ?
What I mean is why couldn't we use for example C++ as the preprocessor language ? It would allow us to do so much more about classes, generate dynamic code etc...
Ideally I would want to call a C++ function just like a preprocessor macro, with a concrete example, I would like to do things like:
#void generateVariable(std::string type, std::string name) {
#    if (name[0] == 'p')
#        cout << "protected:" << endl << type << " " << name << ";" << endl;
#    if (name[0] == 'm')
#        cout << "public:" << endl << type << " " << name << ";" << endl;
#    std::string prefix = name;
#    prefix.erase(2, npos);
#    name.erase(0,2);
#    name[0] = toupper(name[0]);
#    cout << "public:" << endl << type << "get" << name << "() const { return " << prefix+name << "; }" << endl;
#}

So that I could call
class A {
    generateVariable(static const int, p_age)
}

And it would generate
class A {
    protected:
        static const int p_age;
    public:
        static const int getAge() const { return p_age; }
}

Are there actually ways to do this kind of thing, whithout parsing the whole file with a scripting language and rewriting it ?

A: The preprocessor actually can do this (though I wouldn't recommend to do so):
#define generateVariable(__type__, __name__) \
    protected: __type__ __name__; \
    public: __type__ get##__name__() { return __name__; }

class A {
     generateVariable(static const int, p_age);
}

get##__name__() will expand to getp_age() though ...


text:
Q: Exponents with variables inside exponents I am confused about how to reduce this, is there any way?
$\sqrt x \ln(\sqrt x) = ln(\sqrt x^\sqrt x) = $ $?$
This can be written like this too:
$ln(x^\frac{x^\frac{1}{2}}{2}$)
Or:
$ln(x^\frac{\sqrt x}{2}$)

A: $$\sqrt{x}\ln (\sqrt{x})=\dfrac{\sqrt{x}}{2}\ln x$$
If you need to simplify it more, please comment.

A: You have $\ln{(\sqrt{x})}=\frac{1}{2}\ln{x}$ so:
$\sqrt x \ln(\sqrt x) = 1/2 \sqrt{x} \ln{x}$