text:
Q: Is the mux in this golang socket.io example necessary? In an app that I'm making, a user is always part of a 'game'. I'd like to set up a socket.io server to communicate with users in a game. I'm planning to use http://godoc.org/github.com/madari/go-socket.io go-socket.io, which defines the newSocketIOfunction to create a new socketio instance.
Instead of creating one socketio instance, I thought it might be possible to create a map that maps game id's to socket.io instances, and configure them so that they listen on an url that represents the game id.
This way, I can use methods such as broadcast and broadcastExcept to broadcast to all players ithin a single game. However, I'd have to start a new goroutine for every game, and I don't know enough about their performance characteristics to know if this is scalable, since the request rate for a single socketio instance will be very low, about 1/second at peak times, but the connection might be idle for tens of seconds at other times (except for heartbeat, and possibly other communication specified by the socket.io protocol).
Would I be better off creating 1 socket.io instance, and tracking which connections belong to which games?

A:
I'd have to start a new goroutine for every game, and I don't know enough about their performance characteristics to know if this is scalable

Fire away, the Go scheduler is built to efficiently handle thousands and even millions of goroutines.
The default net/http server in the Go standard library spawns a goroutine for every client for instance.
Just remember to return from your goroutines once they're done working. Else you'll end up with a lot of stale ones.

Would I be better off creating 1 socket.io instance, and tracking which connections belong to which games?

I'm not involved in the project but if it follows Go's "get sh*t done" philosophy, then it shouldn't matter. You can find out what works better by profiling both approaches though.


text:
Q: SailsJS - Dynamically loading config without a restart Is it possible to dynamically update a sails.config object without having to relift sails to apply those changes?
I'm looking to dynamically update the sails.config.policies
In my bootstrap.js I have set
sails.config.policies = JSON.parse(myJSONString);

Which sets the values fine, but they never get applied.
Alternatively, is there any way of moving the sails.config files into a db and have them load from there on lift?
UPDATE
After following Andrea Rega suggestion, I moved my logic out and created a separate "allowedaccess" policy. I then added a new Model which maps out a users role to a route and pull that in within the policy. The user's role is then checked with the role->permission list in the database.

A: So, in my opinion a better approach could be putting the Policy layer as an infrastructural layer and the Authorization management layer as an application layer.
This is because you have to be able to change or configure your authorization at runtime, as a part of your applcation features, instead the sails policies are somethig static.
An example can be a policy isFeature1UserEnabled where an AuthorizationController is used in order to fetch the specific authorization for the "feature1" for the given user
Then in your sails.config.policies you will specify that for the method method1 a series of policies must be satisfied.
With this approach you are able to manage all your user right dinamically and then delegate to the sails policies to verify them and check all the related authorization contraints.
I hope this could help you

redpajama_set_name: RedPajamaStackExchange


text:
Q: Выдает такую ошибку....что делать? Forbidden
You don't have permission to access / on this server.
Apache/2.4.18 (Ubuntu) Server at laravelproject.com Port 80

На данный момент:
права у папки drwxrwxrwx
<VirtualHost *:80>

ServerName     test.laravel.com
ServerAdmin    webmaster@localhost
DocumentRoot   var/www/projects/test.laravel.com

Прописано в хостах: 127.0.0.1 test.laravel.com
В файле apache2.conf:
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www>
    Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/projects>
    AllowOverride All
    Require all granted
</Directory>

A: у меня было   DocumentRoot   var/www/projects/test.laravel.com
а нужно было добавить еще '/' вначале адресса!!!!
т.е. DocumentRoot   /var/www/projects/test.laravel.com
 а я чуть голову не сломал....пока не вычитал про разницу между абсолютным и относительным путем!
Вот кратко, если кому интересно!
 абсолютный путь идет из корня файловой системы, (то есть от знака /), а относительный-из той директории,в которой находишься.

A: У нас решили так — в Apache-2.4_server.conf дописали:
<Directory /home/path_to/public>
    AllowOverride All
    Require all granted
</Directory>

и выставили права доступа 755/644.


text:
Q: How to avoid Pycharm inspection error in multiline SQL literals I recently discovered that PyCharm complains about " expected, unexpected end of file" when I write a SQL Query, that spans multiple lines (using parantheses):

It looks like it detects that this is a SQL statement, but only parses the first line.
Any idea how to correctly write this without disabling inspections or writing very long lines ?

A: you need a python multi line string
string = """select * from table
              where x=1
              limit 10"""

if you want to avoid the new lines you can do this:
x = "select * from t " \
    "where x = 1 " \
    "limit 1"

doc

with sql dialect on:


text:
Q: How to get rid of suffixes from several shapefiles in a folder I have several shapefiles in a folder, each suffixed by _LINES or _AREAS.
I would like to get rid of these suffixes
California_Aqueduct_LINES.shp --> California_Aqueduct.shp
California_Aqueduct_LINES.dbf --> California_Aqueduct.dbf
California_Aqueduct_LINES.prj --> California_Aqueduct.prj
California_Aqueduct_LINES.shx--> California_Aqueduct.shx
Subdivision_AREAS.dbf --> Subdivision.dbf
Subdivision_AREAS.prj --> Subdivision.prj
Subdivision_AREAS.SHP --> Subdivision.SHP
Subdivision_AREAS.shx --> Subdivision.shx

A: Can i do this way:
#!/usr/bin/python

ls = ['California_Aqueduct_LINES.shp',
      'Subdivision_AREAS.dbf',
      'Subdivision_AREAS.SHP']

truncate = set(['LINES', 'AREAS'])
for p in [x.split('_') for x in ls]:
    pre, suf = p[-1].split('.')
    if pre in truncate:
        print '_'.join(p[:-1]) + '.' + suf
    else:
        print '_'.join(p[:-1]) + p[-1]

Output:
California_Aqueduct.shp
Subdivision.dbf
Subdivision.SHP

A: Here is something I've put together in ArcPY
import os, sys, arcpy

InFolder = sys.argv[1] # make this a hard set path if you like

arcpy.env.workspace = InFolder
CapitalKeywordsToRemove = ["_AREAS","_LINES"]# MUST BE CAPITALS

DS_List = arcpy.ListFeatureClasses("*.shp","ALL") # Get a list of the feature classes (shapefiles)
for ThisDS in DS_List:
    NewName = ThisDS # set the new name to the old name

    # replace key words, searching is case sensitive but I'm trying not to change the case
    # of the name so the new name is put together from the original name with searching in
    # upper case, use as many key words as you like

    for CapKeyWord in CapitalKeywordsToRemove:
        if CapKeyWord in NewName.upper():
            # remove the instance of CapKeyWord without changing the case
            NewName = NewName[0:NewName.upper().find(CapKeyWord)] + NewName[NewName.upper().find(CapKeyWord) + len(CapKeyWord):]

    if NewName != ThisDS:
        if not arcpy.Exists(NewName):
            arcpy.AddMessage("Renaming " + ThisDS + " to " + NewName)
            arcpy.Rename_management(ThisDS , NewName)
        else:
            arcpy.AddWarning("Cannot rename, " + NewName + " already exists")
    else:
        arcpy.AddMessage("Retaining " + ThisDS)

If you don't have arcpy let me know and I'll change it to just straight python... there's a bit more to it but it's not difficult.


text:
Q: Problems with php code on homepage template I'm new here and I am not a developer - I'm learning code on the fly so please be gentle :)
Anyway, I am having trouble with a video section on my client's homepage:
https://aurorapredictions.com
First, there is a bit of "extra" background below the video that I don't know why it's there. It magically goes away when you zoom in or out. Strange.
Picture Evidence Here
Second, depending on the browser, at 100% zoom-in rate, the top of the logo and bottom of the bottom are cut off.
Picture Evidence Here
How do I fix these issues? Below is the code for that section. THANKY YOU in advance!

                <?php echo CFS()->get( 'title_1' ); ?>

                <?php echo CFS()->get( 'title_2' ); ?>

                <?php echo CFS()->get( 'title_3' ); ?>

                <?php echo CFS()->get( 'title_4' ); ?>

 <img src="<?php bloginfo('stylesheet_directory'); ?>/images/aurora_large_logo.png" alt="Aurora Predictions"/>

Discover your tomorrow today

            <?php $link1 = CFS()->get( 'button_1_link' ); ?>
            <?php $link2 = CFS()->get( 'button_2_link' ); ?>
            <a href="<?php echo $link1[url]; ?>" target="<?php echo $link1[target]; ?>" class="btn btn-primary btnscla">
                <?php echo $link1[text]; ?>

A: Remove the background from (or make it black):
.videoHolder {
    background-image: url(../video/Aurora_3MB.jpg);
    background-size: cover;
}

As you also have it on the wrapping div (with a bunch of other stuff which is generated by your code):

  <video autoplay="" style="margin: auto; position: absolute; z-index: -1; top: 100%; left: 100%; transform: translate(-100%, -100%); visibility: hidden; opacity: 0; width: auto; height: 842px;">
    <source src="wp-content/themes/AuroraCustom/video/Aurora_3MB.mp4" type="video/mp4">
    <source src="wp-content/themes/AuroraCustom/video/Aurora_3MB.webm" type="video/webm">
    <source src="wp-content/themes/AuroraCustom/video/Aurora_3MB.ogv" type="video/ogg">
  </video>

Or remove the poster: wp-content/themes/AuroraCustom/video/Aurora_3MB from your above code, having the image as a background to both divs is the issue.


text:
Q: Download file by url in lua Lua beginner here. :)
I am trying to load a file by url and somehow I am just too stupid to get all the code samples here on SO to work for me.
How to download a file in Lua, but write to a local file as it works
downloading and storing files from given url to given path in lua
socket = require("socket")
http = require("socket.http")
ltn12 = require("ltn12")

local file = ltn12.sink.file(io.open('test.jpg', 'w'))
http.request {
    url = 'http://pbs.twimg.com/media/CCROQ8vUEAEgFke.jpg',
    sink = file,
}

my program runs for 20 - 30s and afterwards nothing is saved. There is a created test.jpg but it is empty.
I also tried to add w+b to the io.open() second parameter but did not work.

A: The following works:
-- retrieve the content of a URL
local http = require("socket.http")
local body, code = http.request("http://pbs.twimg.com/media/CCROQ8vUEAEgFke.jpg")
if not body then error(code) end

-- save the content to a file
local f = assert(io.open('test.jpg', 'wb')) -- open in "binary" mode
f:write(body)
f:close()

The script you have works for me as well; the file may be empty if the URL can't be accessed (the script I posted will return an error in this case).


text:
Q: Find max value for each year in file. How to take leap years into account? I have a set of 55 years worth of data in one 3D array (.nc file). Data was taken every 3 hrs over the 55 years. The shape of the array is (163520,64,128)
I need to find the maximum value for each year at each coordinate (64,128), so I can then eventually plot it on a global map.  I'm trying to find a simple way of looping through it so I can get the max for each year and the results end up into an array with shape (55,64,128)
I'm just not sure how to do that considering there are leap years. Is there a simple way to add years to the data in a way that would allow me to loop it by year? I'm just really unsure how to go about doing this.


text:
Q: Using jsdom in chrome extension manifest v3 In chrome extensions manifest v3 it's stated that background.js is now replaced with service worker and dom is not available in a service worker. Then suggests undom or jsdom to be used as an alternative for DOMParser API.

Libraries such as jsdom can be used to emulate a typical browser
window environment, complete with DOMParser, event propagation, and
other capabilities like requestAnimationFrame. Lighter-weight
alternatives like undom provide just enough DOM to power many frontend
frameworks and libraries.

But undom is too limited and is just capable of creating elements but not querying dom elements which I need despite being easily usable in the service worker. So it tried to use jsdom which is more thorough with a drawback of a ~6MB size.
I tried to import jsdom and I learned it can be done using browserify in a comment to this question when I use a browserifyed bundle in a simple HTML file it works as expected but not in the chrome extension, which gives this error:
ReferenceError: require is not defined.
I used this answer to load the required js files like this:
try {
  importScripts('assets/jsdom.bundle.js', 'common.js', 'search.js', 'background.js');
} catch (e) {
  console.error(e);
}

and tried to use it like this in search.js:
const jsdom = require("./assets/jsdom.bundle");
const { JSDOM } = jsdom;

How jsdom can be used in a chrome extension service worker correctly?

A: Thanks to @wOxxOm's comment that put me in the right direction I managed to make it work like this:
1- Created a js file named main.js:
var jsdom = require("jsdom");
exports.jsdom = jsdom;

2- browserified it with this command:
browserify main.js -o jsdom.bundle.js --standalone jsdomModule
3- And finally used it in the service worker like this:
const { JSDOM } = jsdomModule.jsdom;
const jd = new JSDOM('
hello
');

Then I got this error when calling querySelector function:
EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
So after my 4th weekend on this, I gave up on using jsdom and went for doing the job in the content script and using "Message passing" to communicate with service worker which worked like a charm.
I think google guys should remove their jsdom suggestion from the documentation.


text:
Q: Colours of tikzpicture are appearing differently in different apps
Disclaimer: Honestly, I do not know whether this is the forum to ask this question. But since I do not know the appropriate forum, I am
asking it here. If anybody can suggest the proper forum, that will
also help.

Please refer to the following code snippet.
\begin{tikzpicture}[scale=2]
    \fill [fill=green!30] (0,0) -- (3,0) -- (3.5,2) -- (0.5,2) -- cycle;
    \fill [fill=green!30, opacity=50] (0,0) rectangle (3,2);
    \fill [fill=blue!80, opacity=50] (0,0) -- (3,0) -- (2.5,2) -- cycle;
    \draw [black, dashed] (2.5,2) -- (2.5,0) node[midway, right] {$ h $};
    \draw (0,0) -- (3,0) node [midway, below] {$ b $};
\end{tikzpicture}

This is to illustrate the formula for the area of a triangle. The colours in this image are displayed differently in different apps. I am using a MacBook Air (13-inch, Early 2015) with the Built-in Display which says "13.3-inch (1440 x 900)" and "Intel HD Graphics 6000 1536 MB graphics" in its description. The default Preview app is displaying the image like this:

whereas the Adobe Acrobat Reader app is displaying the colours like:

Preview is not displaying the blue colour properly but is respecting the opacity. Whereas Adobe Acrobat Reader is doing exactly the other way. What is the reason for this? I suspect this has something to do with colour accuracy. But can an app have issues with colour accuracy? Isn't that an issue with screens only? Please enlighten me.
EDIT: As requested, the following is an MWE.
\documentclass[aspectratio=169,10pt, notheorems]{beamer}
\setbeamerfont{headline}{size=\fontsize{8}{0}\selectfont}
\setbeamerfont{footline}{size=\fontsize{6}{0}\selectfont}
\usetheme{CambridgeUS}
\usefonttheme{serif}
\usecolortheme{beetle}
\usepackage{xcolor}
\usepackage{tikz}
\setbeamertemplate{navigation symbols}{}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\begin{document}
    \begin{frame}
        \begin{tikzpicture}[scale=2]
            \fill [fill=green!30] (0,0) -- (3,0) -- (3.5,2) -- (0.5,2) -- cycle;
            \fill [fill=green!30, opacity=50] (0,0) rectangle (3,2);
            \fill [fill=blue!80, opacity=50] (0,0) -- (3,0) -- (2.5,2) -- cycle;
            \draw [black, dashed] (2.5,2) -- (2.5,0) node[midway, right] {$ h $};
            \draw (0,0) -- (3,0) node [midway, below] {$ b $};
        \end{tikzpicture}
    \end{frame}
\end{document}


text:
Q: I am trying to make a Timesheet web app using fullCalender When user selects event type and no. of hours from dropdown then it should be added to the calendar. I have updated the event listener still no data is showing. Sorry if it seems a trivial question. i am new to web applications and a bit time strained.
$(document).ready(function() {

    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek'
        },
        navLinks: true, // can click day/week names to navigate views
        editable: true,
        eventLimit: true, // allow "more" link when too many events

    });
});
ok1.addEventListener('click',function() {
let date = moment($('#calendar').fullCalendar('getDate'));
let val = document.getElementById('inputGroupSelect02').value;
let desc=document.getElementById('nobh').toString();
$('#calendar').fullCalendar('renderEvent',
    $('#calendar').fullCalendar({events: [{
    start: date,
        title: val,
        description: desc
    }]}),true);
},true);

A: Thanks @ADyson following worked:-
$('#calendar').fullCalendar('renderEvent', { start: date, title: val, description: desc }, true);


text:
Q: How can I improve this RE to not end at "('"? I have this regex
href=["'](.*?)["']
And I want to match this entire string but it only matches up to (' and does not include explore
href="javascript:openurl('/Xplore/accessinfo.jsp')"
It also has to match
href="/iel5/4235/4079606/04079617.pdf?tp=&arnumber=4079617&isnumber=4079606"
The first link is the only special case, I have been able to match all other cases with the regex I have provided, I just want to somehow exclude the ' in the middle of the first string.

A: What you could do is have a positive lookahead define the end of the string:
^href=("|').*?(?=\1)\1$

That way, no matter if its a single or double quote, the second capture group will run till it finds the same single or double quote.


text:
Q: How to pass multiple environment variables in Cypress tests? In my Cypress test, I am trying to pass multiple environment variables via the command line with the below command:
./node_modules/.bin/cypress run --env url=https://example.cypress.io/todo,height=900

According to Cypress documentation (https://docs.cypress.io/guides/guides/environment-variables#Option-4-env):

Multiple values must be separated by a comma, not a space.

So I'm not sure why an error is being thrown.
Below is the error message I am getting:

CypressError: cy.visit() failed trying to load:
https://example.cypress.io/todo%20height=900
The response we received from your web server was:
404: Not Found

I understand the URL is picking up the height value, but I'm following the Cypress documentation, so I don't know why it isn't being passed in as a second variable.
Can someone please tell me what I'm doing wrong, & how it can be resolved?


text:
Q: Logarithmic equation in which base of the logarithm is not same. If $log_{9}x=log_{12}y=log_{16}(x+y)$ then find $y/x$.
I simplified this into
$\frac { \log { x }  }{ \log { 9 }  } =\frac { \log { y }  }{ \log { 12 }  } =\frac { log(x+y) }{ \log { 16 }  } $
I equated two terms to get three equations. But that didn't give the answer. So when I looked at its step by step solution then I found
$\frac { \log { x }  }{ \log { 9 }  } =\frac { \log { y }  }{ \log { 12 }  } =\frac { log(x+y) }{ \log { 16 }  } =\frac { log\frac { y }{ x }  }{ log\frac { 12 }{ 9 }  } =a$
After this step I understood the solution but I don't how the last term equal(i.e $\frac { log\frac { y }{ x }  }{ log\frac { 12 }{ 9 }  } $) equal to others terms.
Any help would be appreciated. Please help.

A: If $\frac{\log x}{\log 9} = \frac{\log y}{\log 12}$, then
$\frac{\log x}{\log 9} - \frac{\log y}{\log 12} = 0$, i.e. $\frac{\log 12 \cdot \log x - \log 9\cdot \log y}{\log 9\cdot \log 12} = 0$ and thus
$$
\log 12 \cdot \log x - \log 9\cdot \log y = 0\,.
$$
Rewriting,
$$\begin{align*}
0 &= \frac{\log 12\cdot  \log x}{\log 12 - \log 9} - \frac{\log 9\cdot \log y}{\log 12 - \log 9}
= \log x + \frac{\log 9\cdot  \log x}{\log 12 - \log 9} - \frac{\log 9\cdot \log y}{\log 12 - \log 9} \\
&= \log x + \log 9\cdot \frac{\log x - \log y}{\log 12 - \log 9}
= \log x + \log 9\cdot \frac{\log\frac{x}{y}}{\log\frac{12}{9}}.
\end{align*}$$
Rearranging the terms,
$$
-\frac{\log\frac{x}{y}}{\log\frac{12}{9}} = \frac{\log x}{\log 9}
$$
that is
$$
\frac{\log\frac{y}{x}}{\log\frac{12}{9}} = \frac{\log x}{\log 9} .
$$


text:
Q: How to format a microSDXC card into Fat32? I need to format a brand new Micro SD card of extended capacity into FAT32.
I've read that formatting SD cards of 64/128 GB requires special tools.
How can I format in my Linux machine an SD card of 64/128 GB?
I've formatted a 16GB USB stick with Gparted, does it work also with a larger MicroSDXC card?

A: Yes, gparted should work the same.  However I have not tried it.  I use mkfs.fat as supplied w/Ubuntu 14.04 to format various microSDHC and 64GB microSDXC.


text:
Q: How to cache multiple images for a same entity id in android I have a scenaio where i am getting a array of json objects from server. Each object repesents a data structure with a unique id and several images url like... banner url, icon url, backup url. etc.
Now i want to cache the images if where are downloaded ones. I am well aware of LruCache. But problem is..i just have one unique id which can be used as key. Any suggestions.

A: You can put the caching module to you image loader and save them by the URL since its unique like this:
                       | Caching module      |
                       | -> haveImageForUrl? |
loadImage(URL) ------> |                     |
                       |  no          yes    |
                          |            |
                         load it      get it from
                         from Web     cache
                         and cache
                         it

Your caching module may be just an simple HashMap with URL as key and the image as value.


text:
Q: How do I create actors that express hierarchical structures in akka? I recently started developing using akka event sourcing/cluster sharding, and thanks to the online resources I think I understood the basic concepts and how to create a simple application with it. I am however struggling to apply this methodology in a slightly more complex data structure:
As an example, let's think about webpages and URLs.
Each Page can be represented with an actor in the cluster (having its unique id as the path of the page, e.g. /questions/60037683).
On each page I can issue commands such as

*

*Create page (so if the page does not exist, it will be created)

*Edit page (editing the details of the page)

*Get page content (and children)

Etc.
When issuing commands to single pages, everything is easy as it's "written on the manual". But I have the added the complexity that a web page can have children, so when creating a "child page" I need the parent to update references to its children.
I thought of some possible approaches, but they feel incomplete.

*

*Sending all events to the single WebPage and when creating a page, finding the parent page (if any) and communicate that a new child has been added

*Sending all events to the single WebPage, and when creating a page, the message is sent to the parent, and then it will create a new command that will tell the child to initialize

*Creating an infrastructure as WebPageRepository that will keep track of the page tree and will relay CRUD commands to all web page actors.

My real problem is, I think, handling the return of Futures properly when relaying messages to other actors that have to actually perform the job.
I'm making a lot of confusion and some reading resources would be greatly appreciated.
Thanks for your time.
EDIT: the first version was talking about a generical hierarchical file-system-like structure. I updated with the real purpose, webpages and urls and tried to clarify better my issues

A: After some months of searching, I reached the conclusion that what I'm doing is trying to have actors behave transactionally, so that when something is created, the parent is also updated in a safe manner, meaning that if one operation fails, all operations who completed successfully are rolled back.
The best pattern for this, in my opinion, proved to be the saga pattern, which adds a bit of complexity to the whole process, but in the long run it does what I needed.
Basically I ended up implementing the main actor as a stand alone piece (as it should be) that can receive create commands and add children commands.
There is then a saga actor which takes care of creating the content, adding the child to the parent and rolling back everything if something fails during the process.
If someone else has a better solution, I'll be glad to hear it out


text:
Q: Remote debugging, creating a server I'm following some WinDbg instructions from the CodeProject tutorial.
To start a server, I can get this to work from the command line fine:
WinDbg –server npipe:pipe=pipename

(note: multiple clients can connect).
Where do I enter this from the windbg UI? I tried the command browser window, but that didn't seem to do anything:
.server npipe:pipe=pipename

(note: single client can connect)
This question is related to creating the server from WinDbg UI, not connecting from the client.

A: I am assuming that you are referring to usermode debugging here, so I will respond with that in mind.
From windbg attached to your program that you want to remote:
If you want to use symbols that are cached on the target, then run:
from the Command Window's prompt type .server npipe:pipe=YourPipeName
If you have another machine with with a larger symbol cache, then on the target run:
dbgsrv -t tcp:port=4000
This sets up a thin debug client (a.k.a. remote stub)
Then on the machine running the debugger, open Windbg > File > Connect to remote stub
tcp:server= machine_running_dbgsrv ,port=4000
Now hit F6 and attach to the process you want to debug.
Note: the versions of windbg have to be the same on the machine running dbgsrv and the one running windbg. If they don't match, when you get to part where you hit F6, you end up with no processes in the process list.

*

*Jason

A: File -> Connect to remote session. Or just use CTRL-R.


text:
Q: How can I fix a floating mess? It's still hard for me to understand the floats. On the example bellow I tried to clear both sides of the "Header" but still the elements nested inside of their parent element which is ".greenband". Do you know what's the solution as for "p-greenband" and the "botton" to appear inside of the ".greeenband"? Also how can I put the logo and the nav menu at the same line without altering the "padding-top"? Is there anything that does it automatically?

     @charset "utf-8";
     /* CSS Document */
     body {
       font-family: 'Source Sans Pro', sans-serif;
     }
     .container {
       width: 80%;
       margin: 0 auto;
     }
     header {
       position: fixed;
       width: 100%;
       height: 60px;
       background-color: #000000;
       text-transform: uppercase;
     }
     header h2 {
       clear: left;
       color: #FFFFFF;
       float: left;
     }
     nav {
       float: right;
     }
     nav li {
       float: left;
       list-style: none;
       color: #6E6E6E;
       margin-left: 20px;
       font-size: 14px
     }
     .greenband {
       background-color: #7cc193;
       height: 160px;
     }
     #p-greenband {
       color: #FFFFFF;
     }
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>

Trunk Club

How it Works

What to Expect

Stylists

Log In

Get Started

Trunk club for Women in Here.

  <button>Learn More</button>

A: Your header is in fixed position, it is then outside the flow of the document and .greenband sits under it.
add some padding equals to height of header to push content down in sight.
Maybe a min-width would be usefull to make sure title and links stay side by side ?
You may want to look at box-sizing too :)
Position:sticky; could be an alternative .

@charset "utf-8";
     /* CSS Document */
     body {
       font-family: 'Source Sans Pro', sans-serif;
     }
     .container {
       width: 80%;
       margin: 0 auto;
     }
     header {
       position: fixed;
       width: 100%;
       min-width:800px;/* ? needed */
       height: 60px;
       background-color: #000000;
       text-transform: uppercase;
     }
     header h2 {
       clear: left;
       color: #FFFFFF;
       float: left;
     }
     nav {
       float: right;
     }
     nav li {
       float: left;
       list-style: none;
       color: #6E6E6E;
       margin-left: 20px;
       font-size: 14px
     }
     .greenband {
       background-color: #7cc193;
       padding-top:60px; /* height of fixed header */
     }
     #p-greenband {
       color: #FFFFFF;
     }
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>

Trunk Club

How it Works

What to Expect

Stylists

Log In

Get Started

Trunk club for Women in Here.

  <button>Learn More</button>

A: If you want a fixed header, may I suggest doing like this, so you don't need to think about what height the header has.
This will also make it more response for different screen sizes.

@charset "utf-8";
/* CSS Document */
body {
  font-family: 'Source Sans Pro', sans-serif;
}
html, body {
  margin: 0;
  height: 100%;
  font-family: 'Source Sans Pro', sans-serif;
}
.wrapper {
  display: flex;
  flex-direction: column;
  width: 80%;
  height: 100%;
  margin: 0 auto;
}
.container {
  clear: both;
}
header {
  flex: 0;
  background-color: #000000;
  text-transform: uppercase;
}
header h2 {
  color: #FFFFFF;
  float: left;
}
nav {
  float: right;
}
nav li {
  float: left;
  list-style: none;
  color: #6E6E6E;
  margin-left: 20px;
  font-size: 14px
}
.content {
  flex: 1;
  overflow: auto;
}
.greenband {
  background-color: #7cc193;
  height: 160px;
}
#p-greenband {
  margin-top: 0;
  color: #FFFFFF;
}
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>

Trunk Club

How it Works

What to Expect

Stylists

Log In

Get Started

Trunk club for Women in Here.

      <button>Learn More</button>


text:
Q: How to add row in a table on a click event of a Button i want to add a row in a table on the click event of a Button.for this i am using following code. But it not work.
-(void)translation:(id)sender
{
    [self tableView:mainTableView numberOfRowsInSection:1];
    i+1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return i;
}

where i is a global variable which intialize in viewdidload function by 1;
Thanks in advance for any type of suggestion.Thanks

A: You can just do it like this on button event increment an instance or global variable like you are using i so the code will look like this
-(void)translation:(id)sender
{
   i = i+1;
//This function will automatically call numberofrows and cellforrowatindexpath methods of tableView
   [tableView reloadData];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return i;
}

A: A little suggestion : Table View Programming Guide for iOS, read that first.


text:
Q: Remove Lookup Columns ID's on list Excel Export Has anyone come across this issue or dealt with ID numbers being exported from a lookup column? Is there a way that I can have the SharePoint list not export the numbers when I 'Excel export' the list?
List:

Excel Export: The red boxed ID are the ones that I would not like to include in the Export which are the Lookup columns.

All help on this issue would be appreciated.

A: I don't think that there is any solution for this. The problem is, that SharePoint has to convert all fields to string which will produce "LookupValue;#LookupId" as can be seen on your screenshot.

A: There are workarounds for the issue:

*

*Turn off the "Allow multiple values" for the lookup column.

*If you must turn on the "Allow multiple values", you could use the Substitute formula to remove the "#;#;" in the excel after exporting to the excel.

*You could create workflow to copy value from the lookup column to single line of text and set as the picture below.

And the result as below:

There is a similar post:
https://social.technet.microsoft.com/Forums/sharepoint/en-US/f3436b19-9184-4ed2-a4fe-4320cefeaaca/removing-the-id-of-a-lookup-column-when-exporting-sharepoint-list-to-excel?forum=sharepointgeneralprevious

A: I know this is an old post but hopefully this can help someone.  I set up some VB Code in Excel to remove the ID and characters.  To use the code:

*

*Right click on the worksheet name and select "View Code"

*Double click on "ThisWorkbook" under "Project - VBA Project"

*Paste in the code below (replace "sheet1" with the name of the worksheet) and save the file as a .xlsm file.  If you have more columns than "A:Z" you can increase that as well.

When you close and then reopen the file it will scrub the IDs.
Note that I added a line to refresh the data upon opening the workbook as well - if you don't do this and use the normal option to update the data upon opening the workbook it will scrub the IDs first, and then add them back in when it's refreshed.  So make sure "Refresh data when opening the file" is unchecked under the connection properties.
Private Sub Workbook_Open()

'PURPOSE: Run Data tab's Refresh All function when file is opened
ThisWorkbook.RefreshAll

'PURPOSE: Scrub ID and #s
Worksheets("Sheet1").Columns("A:Z").Replace What:="#*#", Replacement:=" ", SearchOrder:=xlByColumns, MatchCase:=True
Worksheets("Sheet1").Columns("A:Z").Replace What:=";#*", Replacement:="", LookAt:=xlPart

End Sub


text:
Q: XSL-FO - Scaling image inside a table This table is inside another table.  Why is the image not scaling to 1 inch?
         <fo:table table-layout="fixed">
                    <fo:table-column column-width="1.00in" />
                    <fo:table-body>
                        <fo:table-row>
                            <fo:table-cell>
                                <fo:block>
                                    <fo:external-graphic src="url('{$url}')" scaling="uniform" scaling-method="auto" width="1.00in"/>
                                </fo:block>
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>

A: I had to specify the content-width attribute in external-graphic.


text:
Q: where clause using OR and AND in sqlite android I want to match string to any 3 column of the table and 4th column must be equal to some string in the SQlite Database table. For example , lets take 3 columns : first_name,middle_name,last_name either of these columns equal to = "String" and 4th column : age= 20.But below query reruns "null", So please help to solve the problem.
   Cursor cursor = db.query(TABLE_ONE, new String[] { KEY_FNAME, KEY_MNAME, KEY_LNAME }, KEY_FNAME + "=? OR " + KEY_MNAME + "=? OR " + KEY_LNAME + "=?  AND " + KEY_AGE + "=?",
            new String[] { string , string, string, "20"}, null, null, null, null);

EDIT :
I also tried with raw query , but not working :
  String query = "SELECT * FROM table_one WHERE (" +
            "fname = '"+string1+"' OR mname = '"+string1+"' OR  lname = '"+string1+"') AND age ='20'";

    Cursor cursor = db.rawQuery(query,null);

A: Try wrapping the OR statements in parentheses:
"(" + KEY_FNAME + "=? OR " + KEY_MNAME + "=? OR " + KEY_LNAME + "=?)  AND " + KEY_AGE + "=?"


text:
Q: How do I clear out a user object attribute in Active Directory? Suppose you have connected to Active Directory using the simple syntax:
string adPath = "LDAP://server.domain.com/CN=John,CN=Users,dc=domain,dc=com";
DirectoryEntry userEntry = Settings.GetADEntry(adPath);

Now, you find that you would like to see an attribute for that user.
Let's try to display the mail attribute (which stands for email address):
Console.WriteLine("User's mail attribute is " + userEntry.Properties["mail"]);

How can I delete the mail attribute value, since setting it to an empty string will not throw an error?

A: It turns out to be pretty simple, albeit not very commonly used...
string adPath = "LDAP://server.domain.com/CN=John,CN=Users,dc=domain,dc=com";
DirectoryEntry userEntry = Settings.GetADEntry(adPath);
userentry.Properties["mail"].Clear();
userentry.CommitChanges();

A: Not sure that you can delete it since user objects usually follow a company schema but maybe something like the following will work:
userEntry.Properties["mail"] = null;

or maybe:
userEntry.Invoke("Put", "mail", null);

then:
userEntry.CommitChanges();


text:
Q: Using a global collection in a form module In order to implement an undo functionality for changes in a form I try to use a "global" collection.
Thus I have at the top of the form module:
Option Compare Database
Public ChgeStack As collection

and
Private Sub Form_Open(Cancel As Integer)
Set ChgeStack = New collection
End Sub

However, at any moment when the form is idle, checking in the immediate window (?ChgeStack.count) gives an error (object required) indicating that the collection is  no longer allocated.
(breaking at the end of the form_open yields the correct count of zero, so it was allocated)
What is the problem here?

A:
"... checking in the immediate window (?ChgeStack.count) gives an error (object required) indicating that the collection is no longer
  allocated."

No, in the Immediate window, ChgeStack is outside your form's context.  In that situation, ChgeStack is an empty variable, not the collection object in your form, and has no .Count method.
If you want to check the collection's count from the Immediate window, let Access know you want ChgeStack which is a member of your form:
? Forms("YourFormNameHere").ChgeStack.Count

Or you could add a break point in your form's code, trigger it, and while in Break mode try your original approach (? ChgeStack.count) in the Immediate window.  In that context, ChgeStack will be evaluated as a member of the form.

A: Thanks. I have tried all of that, with the same result: the collection exists when checked at some breakpoint in the code, but no longer after any code has finished running (it does not seem to survive).
However, when I place the collection declarative in a straight module (instead of the form's module) as a global all works as I expect.
So, problem solved.
(incidentally, VBA does not accept globals in a form module… - possibly because it is in fact a class?)

A: I would suggest declaring your collection in a code module then it is accessible everywhere and will continue to exists beyond your form.
If being visible throughout your project is a problem then rename it so you or anyone else knows it usage.
Public colChgeStack_YourFormNameHere As New Collection


text:
Q: Set minimum and maximum level of zoom I'm using cesium 3D map i
use var viewer = new Cesium.Viewer("cesiumContainer");
var layers = viewer.scene.imageryLayers;
var blackMarble = layers.addImageryProvider(new Cesium.IonImageryProvider({ assetId: 3812,  minimumLevel : 5 }));

i want to set minimum and maximum level of zoom used minimumLevel : 5 but the earth size gets reduced
Link: https://cesium.com/learn/cesiumjs/ref-doc/WebMapTileServiceImageryProvider.html
Any suggestions is highly appreciated.
Link: working demo

A: const viewer = new Cesium.Viewer('cesiumContainer', {});

viewer.scene.screenSpaceCameraController.minimumZoomDistance = 6378137;
viewer.scene.screenSpaceCameraController.maximumZoomDistance = 6378137 * 2;


text:
Q: Backbone sort collection array I have an app in backbone and underscore.
I have already seen this questions but I haven'0t solved my problem because is a little bit different:
Sorting Backbone Collections
Backbone/Underscore sortBy is not sorting collection
My problem is: I have a collection into a view and I want to sort it by the field order and after print this collection into the template.
I have tried this but doesn't work with underscore:
this.hotels.models = _(this.hotels.models).sortBy("order");
$(this.el).html(this.template({hotels: this.hotels.models}));

How can I sort my collection(model) and after print it inot template?
My code doesn't sort my array.

A: The models array is an array of Model objects, the attributes of which are stored in model.attributes. Wrapping the array and calling sortBy assumes the objects being sorted are plain objects, and the attribute directly accessible as model.{attribute}.
To get it to do what you want you can pass sortBy a comparator function that gets the attribute you want:
this.hotels.models = _(this.hotels.models).sortBy(function(model) {
    return model.get("order");
});

However this is what Backbone already does in the Collection class. To use the built-in comparator you can simply set the Collection's comparator attribute to the name of the Model attribute by which you want to sort.
Example:
this.hotels.comparator = "order";
this.hotels.sort();
$(this.el).html(this.template({hotels: this.hotels.models}));


text:
Q: Initializing a List with arrays I want to populate a List of string arrays at compile time
something like this:
        List<string[]> synonyms = new List<string[]>
        {
            { "enabled", "enable", "enabling" },
            { "disabled", "disable", "disabling" },
            { "s0", "s0 state" },
            { "s5", "s5 state" }
        };

but I get a compile error:
No overloaded method 'Add' takes 2 arguments
Why is this? It works if they weren't string arrays with List<string>

A: You aren't creating arrays in your example, try the following:
    List<string[]> synonyms = new List<string[]>
    {
        new[] { "enabled", "enable", "enabling" },
        new[] { "disabled", "disable", "disabling" },
        new[] { "s0", "s0 state" },
        new[] { "s5", "s5 state" }
    };

A: You need to add a string array
List<string[]> synonyms = new List<string[]>
    {
        new string[] { "enabled", "enable", "enabling" },
        new string[] { "disabled", "disable", "disabling" },
        new string[] { "s0", "s0 state" },
        new string[] { "s5", "s5 state" }
    };

A: Create implicitly typed arrays for your List initializer:
List<string[]> synonyms = new List<string[]>
{
    new [] { "enabled", "enable", "enabling" },
    new [] { "disabled", "disable", "disabling" },
    new [] { "s0", "s0 state" },
    new [] { "s5", "s5 state" }
};

new [] { ... } is equivalent to doing new string[] { ... } when the types of the objects in the array are all string. You will get an error using the implicit syntax if the types of the objects in the array are different.

A: The reason that your code does not work is spelled out in How to: Initialize a Dictionary with a Collection Initializer (C# Programming Guide):

A Dictionary contains a collection of key/value pairs. Its Add method takes two parameters, one for the key and one for the value. To initialize a Dictionary, or any collection whose Add method takes multiple parameters, enclose each set of parameters in braces...

Thus, in the syntax
    {
        { "enabled", "enable", "enabling" },
    }

The compiler is expecting your collection to have an Add(string, string, string) method.  Because there is no such method on List<string []>, your compilation fails.
In fact, it's possible to make such a collection and initialize it with this syntax.  If you create the following collection:
public class TripleCollection<T> : IEnumerable<Tuple<T, T, T>>
{
    readonly List<Tuple<T, T, T>> list = new List<Tuple<T, T, T>>();

    public void Add(T first, T second, T third)
    {
        list.Add(Tuple.Create(first, second, third));
    }

    public IEnumerator<Tuple<T, T, T>> GetEnumerator()
    {
        return list.GetEnumerator();
    }

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
    }
}

The following will compile successfully and create a collection with one 3-tuple:
        var tuples = new TripleCollection<string>
        {
            { "1", "2", "3" },
        };

You can also make the following List subclass:
public class ListOfArray<T> : List<T[]>
{
    public new void Add(params T[] args)
    {
        base.Add(args);
    }
}

And initialize it with the desired syntax:
        var synonyms = new ListOfArray<string>
        {
            { "enabled", "enable", "enabling" },
            { "disabled", "disable", "disabling" },
            { "s0", "s0 state" },
            { "s5", "s5 state" }
        };

But for List<string []>, as others have noted, you need to initialize your synonyms list by explicitly allocating each string [] entry, rather than using an implicit collection intializer for each entry:
        var synonyms = new List<string[]>
        {
            new [] { "enabled", "enable", "enabling" },
            new [] { "disabled", "disable", "disabling" },
            new [] { "s0", "s0 state" },
            new [] { "s5", "s5 state" }
        };

A: You need to specify that the inner objects are arrays so that it doesn't look for multi-parameter Add methods.
    List<string[]> synonyms = new List<string[]>
    {
        new[] { "enabled", "enable", "enabling" },
        new[] { "disabled", "disable", "disabling" },
        new[] { "s0", "s0 state" },
        new[] { "s5", "s5 state" }
    };

A: I think it might be that you're not making any instances of the arrays.
     List<string[]> synonyms = new List<string[]>
    {
       {new string[] { "enabled", "enable", "enabling" }},
       {new string[] { "disabled", "disable", "disabling" }},
       {new string[] { "s0", "s0 state" }},
       {new string[] { "s5", "s5 state" }}
    };


text:
Q: Multiple NativeScript Custom Components I'm working with multiple custom components an everything works per the documentation.
folder structure

*

*app

*

*pages

*

*...

*custom

*

*headers

*

*header.xml

*footer.xml

*login

*

*login.xml

main-page.xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
      xmlns:myHeaders="custom/headers"
      xmlns:myLogin="custom/login">

  <StackLayout>
    <myHeaders:header />
    <myLogin:login />
    <myHeaders:footer />
  </StackLayout>

</Page>

This works producing the intended output on the screen.
Is this the best way to deal with custom components (mixing similar ones in a directory; creating new namespaces for other components) or is there a way to split those into their own directory and have them under a similar namespace?

A: This is a common pattern for structuring custom components in NativeScript projects.
Putting individual components in additional folders will require additional namespace references, as you suspected. NativeScript does not presently provide a way to create a shared namespace for custom components that live in different folders.


text:
Q: SVN setup with visual studio code IDE(v 1.12.1.) (for Nativescript-Cli projects) I am using Nativescript-cli extension in visual studio code IDE to develop hybrid application. Here i need to synchronize/commit code base periodically in to SVN url(like https:///svn/HotelAppMobile/) like SVN repositories in eclipse.
My development environment -
1.visual studio code IDE - version 1.12.1.
2.Current Framework - Nativescript-Cli(Nativescript with angular)
I have tried with extension tortoise-svn-for-vscode in visual studio code. but i did't get any proper documentations on how to use this extension.
please suggest any other extension or idea to accomplish my need.
Thanks in advance.

A: I just had the same problem.
You have to install TortoiseSVN https://tortoisesvn.net/downloads.html (not just the extension) locally and set up a local SVN sync directory and sync it, before you can open it in vscode and use the extension to commit changes from within vscode via right click the file -> "SVN...".


text:
Q: C# Regular Expression: Search the first 3 letters of each name Does anyone know how to say I can get a regex (C#) search of the first 3 letters of a full name?
Without the use of (.*)
I used (.**)but it scrolls the text far beyond the requested name, or
if it finds the first condition and after 100 words find the second condition he return a text that is not the look, so I have to limit in number of words.
Example: \s*(?:\s+\S+){0,2}\s*
I would like to ignore names with less than 3 characters if they exist in name.
Search any name that contains the first 3 characters that start with:
'Mar Jac Rey' (regex that performs search)

Should match:

*

*Marck Jacobs L. S. Reynolds

*Marcus Jacobine Reys

*Maroon Jacqueline by Reyils

Can anyone help me?

A: I think what you want is this regular expression to check if it is true and is case insensitive
@"^[Mar|Jac|Rey]{3}"

Less specific:
@"^[\w]{3}"

A: If you want to capture the first three letters of every words of at least three characters words you could use something like :
((?<name>[\w]{3})\w+)+

And enable ExplicitCapture when initializing your Regex.
It will return you a serie of Match named "name", each one of them is a result.
Code sample :
Regex regex = new Regex(@"((?<name>[\w]{3})\w+)+", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
var match = regex.Matches("Marck Jacobs L. S. Reynolds");

If you want capture also 3 characters words, you can replace the last "\w" by a space. In this case think to handle the last word of the phrase.

A: The zero or more quantifier (*) is 'greedy' by default—that is, it will consume as many characters as possible in order to finding the remainder of the pattern. This is why Mar.*Jac will match the first Mar in the input and the last Jac and everything in between.
One potential solution is just to make your pattern 'non-greedy' (*?). This will make it consume as few characters as possible in order to match the remainder of the pattern.
Mar.*?Jac.*?Rey

However, this is not a great solution because it would still match the various name parts regardless of what other text appears in between—e.g. Marcus Jacobine Should Not Match Reys would be a valid match.
To allow only whitespace or at most 2 consecutive non-whitespace characters to appear between each name part, you'd have to get more fancy:
\bMar\w*(\s+\S{0,2})*\s+Jac\w*(\s+\S{0,2})*\s+Rey\w*

The pattern (\s+\S{0,2})*\s+ will match any number of non-whitespace characters containing at most two characters, each surrounded by whitespace. The \w* after each name part ensures that the entire name is included in that part of the match (you might want to use \S* instead here, but that's not entirely clear from your question). And I threw in a word boundary (\b) at the beginning to ensure that the match does not start in the middle of a 'word' (e.g. OMar would not match).


text:
Q: How to track Chrome Extension installs, via Google Analytics + Google Ads? I have created a Chrome Extension, hosted on the Chrome Web Store, and I'm driving PPC ad traffic to it via Google Ads.
My goal is to be able to track, what percent of users searching Keyword A, vs Keyword B, vs Keyword C, ultimately download the Chrome Extension. However there is a shockingly small amount of information/documentation online about how to track and set up any of this.
Here's what I've done:

*

*Inside of Google Analytics, I created a new Property for the Extension. For the Data Stream, I link to the Chrome Web Store page for the extension.

*On that Data Stream page inside of Google Analytics, I copied the Measurement ID, which is something like "G-R57QV4PBCE"

*I then pasted that, inside of the Chrome Web Store developer editor page, for the Chrome Extension, where it asks for a Google Analytics ID.

*Inside of Google Ads? Under "Linked Accounts"? I found Google Analytics, found the specific property which contains that Chrome Extension data stream, and I linked that.
So my understanding is that all of these things should now be linked -- the Chrome Web Store Extension page is linked with Google Analytics, which should track all of the install information on there. Then the Google Analytics page is integrated with the Google Ads account, meaning I should be able to ultimately see information about -- What percent of people who searched Keyword A or Keyword B, ultimately landed on the Web Store page, and installed the extension -- correct?
Am I missing anything here? Any additional steps or anything to be able to track this correctly? Do I need to add UTM parameters to the Google Ads link I use to drive traffic to the web store? Do I need to set up any custom events inside of Google Analytics to be able to correctly track what I'm trying to track?
Thanks


text:
Q: Change the filestructure in linux I am currently using manjaro and I have the following problem.
My root partition is 7gb and my home partition is 100gb big. Now packages always get installed on the root partition.
I tried to resize the root partiton with a linux livecd and gparted but it seems that I can only shrink it.
Is there a way to tell linux that it should reallocate the space from /usr/share to the home partition?

A: As Eddy_Em points out in the comments, there is no reason why you should not be able to resize your partition as desired. I recommend you try as he suggested.
Now, another way would be to make your /usr/ directory point to your /home. You can do that using symlinks:

*

*Move your existing /usr directory to /home (if you don't have sudo set up on your system, switch to root using su):
sudo mv /usr/ /home/usr

*Now, make a link pointing to that directory:
sudo ln -s /home/usr /usr

*Reboot

Using the bind option is probably a better idea. To do that, you would move the /usr directory to /home as shown in step 1 above, then add this line to your /etc/fstab file:
/home/usr  /usr  bind  bind  0  0

A: Use gparted
First shrink and move the partition to the right.
Then you can expand the first partition.
Normally if you shrink the partition it create freespace on the right which is not helpful.  You can move and shrink in 1 step with gparted.  However if you have already shrunk the larger partiton then you need to move it to the right also.
With the resize dialog inside of gparted open
grab the right side and drag it left a big 10gb should enough.  Then click and hold in the middle of the partition icon and drag it all the way to the left.
After clicking OK you should be able to resize the first partition.


text:
Q: one-to-many relationship with join table: relation not being persisted I'm using hibernate JPA annotations, and as for repositories I'm using Spring JPA
i have the following two entities:
@Entity
@Table(name = "idn_organization")
@Audited
public class Organization extends UuidBasedEntity {
    @Column(name = "full_name", length = 64, nullable = false)
    private String fullName;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
    @JoinTable(
            name = "idn_organization_address",
            joinColumns = @JoinColumn(name = "organization_id"),
            inverseJoinColumns = @JoinColumn(name = "address_id")
    )
    private Set<Address> addresses;

    @Column(name = "phone_number", length = 12, nullable = true)
    private String phoneNo;

    @Column(name = "registered_date", nullable = true)
    private Date registeredDate;

    @Column(name = "social_security", length = 9, nullable = true)
    private String socialSecurity;

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public Set<Address> getAddresses() {
        return addresses != null ? addresses : new HashSet<Address>();
    }

    public void setAddresses(Set<Address> addresses) {
        if (this.addresses == null)
            this.addresses = new HashSet<>();

        this.addresses.clear();

        if (addresses != null)
            this.addresses.addAll(addresses);
    }

And:
@Entity
@Table(name = "cmn_address")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Audited
public class Address extends AutoIdBasedEntity {

    @Valid
    @NotNull(message = "{address.type.notNull}")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "type_code")
    @ForeignKey(name = "FK_address_address_type")
    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    private AddressType type;

    @NotNull(message = "{address.line1.notNull}")
    @Column(name = "address_line_1", length = 256, nullable = true)
    private String addressLine1;

    @Column(name = "address_line_2", length = 128, nullable = true)
    private String addressLine2;

    @Column(name = "address_line_3", length = 128, nullable = true)
    private String addressLine3;

    @Valid
    @NotNull(message = "{address.town.notNull}")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "city_id")
    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    private Town city;

    @NotNull(message = "{address.state.notNull}")
    @Size(min = 2, max = 2, message = "{address.state.notEmpty}")
    @Column(name = "state_code")
    private String state;

    //@NotNull(message = "{address.zip.notNull}")
    // TODO Not all DTOP Results match
    // @Pattern(regexp = "\\d{5}(-\\d{4})?", message = "{address.zip.notValid}")
    @Column(name = "postal_code", length = 32, nullable = true)
    private String postalCode;

    @Valid
    @NotNull(message = "{address.country.notNull}")
    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "country_code")
    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
    private Country country;

As mentioned my repository is:
public interface OrganizationRepository extends JpaRepository<Organization, String>, JpaSpecificationExecutor<Organization> {
}

The problem I'm having is specifically with the method save in my service:
@Service("identityService")
@Transactional(readOnly = true, propagation = Propagation.REQUIRED)
public class IdentityServiceImpl implements IdentityService {
    private static Logger logger = LoggerFactory.getLogger(IdentityServiceImpl.class);

    @Autowired
    private OrganizationRepository organizationRepository;

    @Override
    public void persistOrganization(Organization organization) {
        organizationRepository.save(organization);
        if (logger.isDebugEnabled()) {
            logger.debug("Organization [" +
                    organization.getUuid() + " - " +
                    organization.getFullName() + "] created or updated.");
        }
    }
}

Whenever I call my save method the organization is persisted and so is the address in their respective tables... but the join table entry is not! Therefore, I obtain a new organization, a new address, but there's no link between them. So what am I doing wrong here? It obviously also happens when I try to edit the organization somehow.

A: The problem was in my service as I had the annotation:
@Transactional(readOnly = true, propagation = Propagation.REQUIRED)

and because I was managing transactions through web flow, they never commited. So I added @Transactional to the persist methods and that fixed it. You can also just remove the readOnly = true part, but I didn't because there were fetch methods that I didn't want to be exposed.


text:
Q: Can't connect VS Code to Linux machine for remote development I am getting this error on VS Code and have no clue why it fails
[15:14:59.543] Log Level: 2
[15:14:59.555] remote-ssh@0.51.0
[15:14:59.555] win32 x64
[15:14:59.560] SSH Resolver called for "ssh-remote+xx.xx.xx.xx", attempt 1
[15:14:59.561] SSH Resolver called for host: xx.xx.xx.xx
[15:14:59.561] Setting up SSH remote "xx.xx.xx.xx"
[15:14:59.621] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server
[15:14:59.624] Install and start server if needed
[15:15:01.964] getPlatformForHost was canceled
[15:15:01.965] Resolver error: Connecting was canceled
[15:15:01.973] ------

A: In dialog box where you have typed user@host type/select Linux/Windows/etc. depends what you are using, then type/select Continue, then type password for remote session.

A: Add one key in your settings.json as below. Please remember to replace the $remote_server_name to yours.
    "remote.SSH.remotePlatform": {
        "$remote_server_name": "linux"
    }

Menu: File->Preference->Settings
Or click the icon to open settings.json:

A: For those getting this error on Windows: Check if you have multiple ssh clients installed.
How I solved it was by adding my ssh-configuration to ALL ssh-config files.
In my case I had one in

*

*C:\Users\USER_NAME.ssh\config (this is the one that the remote extension used to give me connection options)

*and another in C:\Program Data\ssh\ssh-config

After adding my ssh-config setting to both I got the prompt to select virtual hosts' OS. Tried editing the settings.json file directly, but I think it gets confused because of the multiple ssh-configurations.
P.S.
Tested it for both private key and password enabled connections and it work with either.

A: I got a similar problem, but the error logs were bigger. Before that, I deleted the python and reinstalled it. Perhaps this led to the problem. Just reinstalled "Remote -SSH" extension in vscode and it worked for me.

A: In my case there were two files that look like
vscode-remote-lock.<user>.<xxx>
vscode-remote-lock.<user>.<xxx>.target
where  was my remote user name and xxx the VS Code Remote Server build hash.
These two files on the remote server in the folder.
/run/user/1000/

I deleted both files and then VS Code came up right away. I have encountered this a few times now. VS Code Remote Server install is not very robust. I use it on about 7 remote machines and every once in a while something goes awry and it cannot recover from simple errors and gets stuck in installation loops.
This trick only works if there is a valid ~/.vscode-server on the remote machine with a hash that matches your local VS Code installation.
If you got here because you were trying to install VS Code in the first place and for whatever reason VS Code had issues with the remote installation, I highly recommend installing it manually by downloading and extracting the tar file to the remote machine directly.
I have tried playing with the setting "Use remote.SSH: Use Flock" and other tricks posted on StackOverflow but none of these work for me whenever I have remote installation issues. I cannot figure out why on some machines, a smooth remote installation is not possible. Even when all of my ssh keys and remote ids have been copied and tested from both the Windows command line and inside a WSL Ubuntu instance.
If VS Code Remote Server installation had slightly better error logic and better error messages none of us would be wasting hours doing this simple task.
I was getting the exact same error as the original poster received and yet none of the other answers were my issue.


text:
Q: How to express "$a \leq x \leq a + \frac{y}{n} $ for every $n \geq 1$, then $x = a$" using quantifiers I've been studying the real number system from Apostol Calculus Vol I and the theorem I.31 says the following:

If three real numbers a, x and y satisfy the inequalities
$a \leq x \leq a + \frac{y}{n} $
for every $n \geq 1$, then $x = a$

Now, i've tried to prove the theorem by contradiction and in my head (i think i'm wrong by the way) the statement using quantifiers is

$\forall x \in \mathbb{R} \, \forall y\in \mathbb{R} \, \forall a \in \mathbb{R} \, \forall n \geq 1 \, (a \leq x \leq a + \frac{y}{n}) \implies (x = a)$

and so the negation is

$\exists x \in \mathbb{R} \, \exists y\in \mathbb{R} \, \exists a \in \mathbb{R} \, \exists n \geq 1 \, (a \leq x \leq a + \frac{y}{n}) \wedge (x \neq a)$

But then i saw the proof in the book and Apostol uses the Archimedean property to show that if $x > a$ then there exists a number $n$ such that $n(x-a) > y \,$ and $x > a + \frac{y}{n}$. And well, this doesn't match my intuition for the statement nor the negation of the statement. What would be the correct quantified statement and its negation?

A: Be careful of operator precedence here.  The statement

if $a \leq x \leq a + \frac{y}{n}$ for every $n \geq 1$, then $x = a$

is a material implication at the outermost level, so its symbolic form is
$$
(\forall n \in \mathbb{Z}^+ \; (a \le x \le a + \tfrac{y}{n}))
\to (x = a).
$$
The full statement

if three real numbers $a$, $x$, and $y$ satisfy the inequalities
$a \leq x \leq a + \frac{y}{n}$
for every $n \geq 1$, then $x = a$

is thus
$$
\forall a \in \mathbb{R} \; \forall x \in \mathbb{R} \;
\forall y \in \mathbb{R} \;
((\forall n \in \mathbb{Z}^+ \, (a \le x \le a + \tfrac{y}{n}))
\to (x = a)), \tag{1} \label{1}
$$
whose negation is
$$
\exists a \in \mathbb{R} \; \exists x \in \mathbb{R} \;
\exists y \in \mathbb{R} \;
((\color{red}{\forall} n \in \mathbb{Z}^+ \, (a \le x \le a + \tfrac{y}{n}))
\land (x \neq a)), \tag{2} \label{2}
$$
by De Morgan's laws.

Due to the properties of quantifiers,
\eqref{1} is not equivalent to
$$
(\times) \quad
\forall a \in \mathbb{R} \; \forall x \in \mathbb{R} \;
\forall y \in \mathbb{R} \;
\color{red}{\forall} n \in \mathbb{Z}^+ \, ((a \le x \le a + \tfrac{y}{n}))
\to (x = a)),
$$
but rather
$$
(\checkmark) \quad
\forall a \in \mathbb{R} \; \forall x \in \mathbb{R} \;
\forall y \in \mathbb{R} \;
\color{red}{\exists} n \in \mathbb{Z}^+ \, ((a \le x \le a + \tfrac{y}{n}))
\to (x = a)). \tag{1'}
$$
Similarly, \eqref{2} is not equivalent to
$$
(\times) \quad
\exists a \in \mathbb{R} \; \exists x \in \mathbb{R} \;
\exists y \in \mathbb{R} \;
\color{red}{\exists} n \in \mathbb{Z}^+ \, ((a \le x \le a + \tfrac{y}{n}))
\land (x \neq a)),
$$
but rather
$$
(\checkmark) \quad
\exists a \in \mathbb{R} \; \exists x \in \mathbb{R} \;
\exists y \in \mathbb{R} \;
\color{red}{\forall} n \in \mathbb{Z}^+ \, ((a \le x \le a + \tfrac{y}{n}))
\land (x \neq a)). \tag{2'}
$$

A: The statement you wrote was almost correct, but a bit unnatural. Almost the same thing, but easier to understand is:
$\forall x,y,a\in \mathbb{R}: (a\le x\le a+\frac{y}{n})\forall n\in \mathbb{N^+} \implies (x=a)$.
Important is, that the condition $(a\le x\le a+\frac{y}{n})$ is met for all natural numbers. The way you wrote it, the statement would imply, that for a fixed, the implication still holds, which is obviously untrue (x=2, y=8, a=1, n=8 gives $a\le x\le a+\frac{y}{n}$, but $1\neq 2$).
Can you now work out the negation yourself?


text:
Q: Changing math fonts for Greek letters My QUESTION amounts to: is it possible to use mathpazo for everything, except for Greek math fonts in euler?

A: \documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\DeclareSymbolFont{Letters} {U}{zeur}{m}{n}% Euler
\DeclareMathSymbol\Gamma    {\mathalpha}{Letters}{"00}
\DeclareMathSymbol\Delta    {\mathalpha}{Letters}{"01}
\DeclareMathSymbol\Theta    {\mathalpha}{Letters}{"02}
\DeclareMathSymbol\Lambda   {\mathalpha}{Letters}{"03}
\DeclareMathSymbol\Xi       {\mathalpha}{Letters}{"04}
\DeclareMathSymbol\Pi       {\mathalpha}{Letters}{"05}
\DeclareMathSymbol\Sigma    {\mathalpha}{Letters}{"06}
\DeclareMathSymbol\Upsilon  {\mathalpha}{Letters}{"07}
\DeclareMathSymbol\Phi      {\mathalpha}{Letters}{"08}
\DeclareMathSymbol\Psi      {\mathalpha}{Letters}{"09}
\DeclareMathSymbol\Omega    {\mathalpha}{Letters}{"0A}
\DeclareMathSymbol{\alpha}  {\mathalpha}{Letters}{"0B}
\DeclareMathSymbol{\beta}   {\mathalpha}{Letters}{"0C}
\DeclareMathSymbol{\gamma}  {\mathalpha}{Letters}{"0D}
\DeclareMathSymbol{\delta}  {\mathalpha}{Letters}{"0E}
\DeclareMathSymbol{\epsilon}{\mathalpha}{Letters}{"0F}
\DeclareMathSymbol{\zeta}   {\mathalpha}{Letters}{"10}
\DeclareMathSymbol{\eta}    {\mathalpha}{Letters}{"11}
\DeclareMathSymbol{\theta}  {\mathalpha}{Letters}{"12}
\DeclareMathSymbol{\iota}   {\mathalpha}{Letters}{"13}
\DeclareMathSymbol{\kappa}  {\mathalpha}{Letters}{"14}
\DeclareMathSymbol{\lambda} {\mathalpha}{Letters}{"15}
\DeclareMathSymbol{\mu}     {\mathalpha}{Letters}{"16}
\DeclareMathSymbol{\nu}     {\mathalpha}{Letters}{"17}
\DeclareMathSymbol{\xi}     {\mathalpha}{Letters}{"18}
\DeclareMathSymbol{\pi}     {\mathalpha}{Letters}{"19}
\DeclareMathSymbol{\rho}    {\mathalpha}{Letters}{"1A}
\DeclareMathSymbol{\sigma}  {\mathalpha}{Letters}{"1B}
\DeclareMathSymbol{\tau}    {\mathalpha}{Letters}{"1C}
\DeclareMathSymbol{\upsilon}{\mathalpha}{Letters}{"1D}
\DeclareMathSymbol{\phi}    {\mathalpha}{Letters}{"1E}
\DeclareMathSymbol{\chi}    {\mathalpha}{Letters}{"1F}
\DeclareMathSymbol{\psi}    {\mathalpha}{Letters}{"20}
\DeclareMathSymbol{\omega}  {\mathalpha}{Letters}{"21}
\DeclareMathSymbol{\varepsilon}{\mathalpha}{Letters}{"22}
\DeclareMathSymbol{\vartheta}{\mathalpha}{Letters}{"23}
\DeclareMathSymbol{\varpi}  {\mathalpha}{Letters}{"24}
\DeclareMathSymbol{\varphi} {\mathalpha}{Letters}{"27}
\DeclareMathSymbol\upOmega  {\mathord}{Letters}{"0A}
\DeclareMathSymbol\upDelta  {\mathord}{Letters}{"01}

\begin{document}

Palatino $\Omega$

\end{document}


text:
Q: How to grab a value from vue.js data into a another data parameter I am using vue.js and vue-qrcode
I store some user data in localStorage and get it correctly.
<template>

            <qrcode :size="size" :val="val"></qrcode>

    {{content.last}}
</template>

I tried putting string into the template, where it works, but, the QR is malformed somehow. If I remove the variable and use just text in the data() val model, QR is perfect and it works. But, I need to grab 4 values from the content model above.

A: Hard to tell without seeing your entire Vue app. This much is for sure, you cannot use content.last in you val object as it will be undefined. Basically you are assigning it before it exists. A computed object should help there.
something like:
computed: {
  val() {
    var content = store.todoStorage.fetch();
    return "BEGIN:VCARD\r\nVERSION:2.1\r\nN:john;doe\r\nFN:asd " + content.last + "\r\nTEL;TYPE=cell:234\r\nEMAIL;PREF;INTERNET:234234\r\nEND:VCARD"
  }
}

Again, not sure if this is going to solve without seeing your code, but it may put you in the right path.


text:
Q: How to connect snowflake database to Teradata SQL assistant I'm not able to connect snowflake database in Teradata SQL assistant.
I have already install ODBC Driver in my laptop. But still not able to define ODBC driver in  Teradata SQL assistant.
Can you please guide


text:
Q: How to install user Agent (launchchd) in Mac and Run for all users on login On MacOs I want to create a application that runs in the background (hidden)and on user login  , so I have created a user agent and .plist configuration added in /Library/LaunchAgents
It is running ok for the user through  which I installed , but when I switch the user it does not  run for the other user  I have seen in activity monitor (it was showing for other user and also I am logging some text in file for checking its not logging )
So how can I install the user agent for all the users


text:
Q: Pod files are missing I am new in iOS dev, but I need to build a certain project. The problem is that when I click on the build button xcode fails and one of the errors says
Unable to load content of list : path_to_pod_file

as well I see that in project structure xcode marked missing files with red color

I read about pod files and understood that it is a kind of configuration file, so the question is: are these files should be generated by build (somehow) or it is files that I hadn't received with a project and there is no way to generate them?

A: I found a solution here:
https://medium.com/@soufianerafik/how-to-add-pods-to-an-xcode-project-2994aa2abbf1#
Actually, the files I asked for above are generated and I needed to install the pod and run the Pod file which (in my case) was under my project structure.

*

*sudo gem install cocoapods

*cd PATH_TO_YOUR_PROJECT_FOLDER

*pod init (IN CASE IF YOU HAVEN'T ALREADY HAVE IT)

*pod install

*Double click on the Xcode workspace to open the project

*You can clean/re-build your project and run it.


text:
Q: create-react-app & jest — SyntaxError: Unexpected token import NOTE: I fixed this by moving all of the code inside my src/nod_modules folder into the src folder directly and deleting src/node_modules as per this short thread: https://github.com/facebook/create-react-app/issues/4241

I am using create-react-app and having trouble running Jest.
When I attempt to import any one of my React components into my test file, I get an error when I yarn test:
Test suite failed to run

.../src/node_modules/common/ErrorMessage.js:1
({"Object.<anonymous>":function(
module,exports,require,__dirname,__filename,global,jest)
{import React from 'react'
^^^^^^

SyntaxError: Unexpected token import

This is what my test file looks like:
// test.test.js

// attempting to import
import ErrorMessage from '../node_modules/common/ErrorMessage.js'

// dummy test
test('adds 1 + 2 to equal 3', () => {
  expect(1 + 2).toBe(3)
})

However, the error does not get thrown if I'm at the root of the src file, importing my index.js. At that point, the error gets thrown in the first file that index.js imports. For example:
test.test.js
import index from './index'

index.js
import React from 'react'
import { render } from 'react-dom'
import './style/index.css'
import LoginContainer from './node_modules/user/LoginContainer'
import NewUser from './node_modules/user/NewUser'
// etc.

terminal output
 FAIL  src/test.test.js
  ● Test suite failed to run

    /Users/hannahmccain/Desktop/DEV/expense-report/fullstack-expense-report/client/src/node_modules/user/LoginContainer.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import React, { Component } from 'react'
                                                                                ^^^^^^

    SyntaxError: Unexpected token import

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
      at Object.<anonymous> (src/index.js:11:164)
      at Object.<anonymous> (src/test.test.js:3:14)

It seems like, in the context of Jest, Babel isn't able to compile the files in src/node_modules properly. I'm just at a loss as to how to correct that! Any insights would be appreciated.
FYI, Jest is supposed to work out-of-the-box with create-react-app, and I don't want to eject. Without ejecting, I'm unable to make certain changes I've seen recommended elsewhere, such as updating the Jest settings in my package.json.

A: To follow up with @Himanshu Singh answer, by adding this in my package.json helped me resolved this error.
{
  test: react-scripts test --transformIgnorePatterns \"node_modules/(?!ui-core)/\" --env=jsdom
}

A: The code inside node_modules/user/LoginContainer.js is not a production release (babelified version) as it still has those import statement.
Jest that comes pre-configured with create-react-app, excludes everything inside node_modules from babel-transformation before running tests assuming that the code inside node_modules would be pre-babelified.
And since your module inside node_modules isn't babelified, jest throws error as soon as it encounters import statement.
Solution
1. You must be having a build script for your node_module in use. Try placing the production release of your module inside node_modules.This will do the trick but will also create further issues (as per my experience).
2. Start configuring jest and its dependencies explicitly without ejecting. Essentially by changing your test script to jest --env=jsdom. You will need to install jest, react-dom, babel-transforms-* explicitly and then configure using jest configuration inside package.json.
Here you need to focus on two major configuration option - transformIgnorePatterns and transform.
In short, transform everything and ingnore everything that is already transformed.
Take a look at Jest configuration section for more details.


text:
Q: wso2 datamapper hangs WSO2 developer studio when gives large json file as input I have to consume a rest service which returns a json in response.
From that json response I need to create another json format , which will be output of my service.
In data mapper , I define input as json, and provide sample json (response from service I need to consume) as  example. This json is quite big (some 1200 lines).
As soon as I upload json example eclipse hangs for ever.
I tried increasing maxPermsize of eclipse but no use.
I am using developer studio on Eclipse Mars.
Please guide me: I tried using eclipse neon but wso2 developer studio tab did not  appear in eclipse after installing plugins.
Maybe eclipse neon does  not support WSO2.
I also downloaded wso2 developer studio pre-instaled in eclipse luna. But data mapper was missing in palette there.
What can I try to get past this issue?


text:
Q: Docker save can't export ~50GB image because no space, although I have 150GB free I am simply trying to export a Docker image that I have so that I can push it to another system; however, I cannot even save it because of no space:
$ docker save mycustomimage:latest -o nessus.tar
Error response from daemon: write /var/lib/docker/tmp/docker-export-255300778/f2881cc25962de53a9f4efdbf759e88c86bd183abf773477ebbd5ddebc229ae8/layer.tar: no space left on device

However, if I run df -h, I can confirm that I have over 150GB of free space:
$ df -h
Filesystem      Size   Used  Avail Capacity     iused               ifree %iused  Mounted on
/dev/disk1s1   466Gi  275Gi  182Gi    61%     1290334 9223372036853485473    0%   /
devfs          374Ki  374Ki    0Bi   100%        1296                   0  100%   /dev
/dev/disk1s4   466Gi  8.0Gi  182Gi     5%           8 9223372036854775799    0%   /private/var/vm
map -hosts       0Bi    0Bi    0Bi   100%           0                   0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%           0                   0  100%   /home
drivefs        466Gi  292Gi  173Gi    63% 18446744069414640546          4294967295 32808793364899312%   /Volumes/GoogleDrive

here's a list of the images:
$ docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mycustomimage/kali      latest              a1f226987b86        12 hours ago        33GB
mycustomimage/kali      <none>              ac3292dcbd65        4 months ago        25.1GB
mycustomimage/kali      <none>              8a628403a803        6 months ago        12GB

I am not even sure if all of these images are 33GB combined, or 33GB is just the file size of the last image. It's just a simple Kali Linux docker with one custom tool on it that is about 5GB in space. I'm pretty sure that, if this image is 70GB large, then it's larger than my VM which has even more stuff installed.

A: Your df -h output corresponds with the output that I would expect to see on a mac, which means your linux containers are not running on the system where df -h was run.
If you are running the Docker Desktop for mac, then your docker daemon is running inside a hyperkit virtual machine that the whale icon Docker.app application manages in the background. This virtual machine includes a virtual disk with a finite size. The smallest configurable disk size for this disk image is 16GB. To see how much space your whale icon docker desktop managed virtual machine has, click on the whale icon, and choose "Preferences". Under the "Disk" tab, you will see how big the disk is, and how much space it is taking up (due to compression).
When the docker save command is run, the daemon will create a .tar at the location referenced in your error output, /var/lib/docker/tmp/.... Since your virtual machine's disk does not have enough space for that temporary .tar file, you get a disk out of space error.
To see the true amount of space available to the VM, run the following command:
docker run --rm -it -v /var/lib/docker/tmp:/r alpine df -h /r

It is possible to increase the amount of space your disk image has available to it, but keep in mind that will take up real space on your hard drive even once the large files are deleted from the filesystem on the disk image.
tldr; you are running docker in a virtual machine that has less space available to it than your host machine shows as available.

A: I pruned some images and containers and after that it worked.
docker image prune

and
docker container prune

https://docs.docker.com/config/pruning/


text:
Q: What does "But otherwise" mean I've been reading HP and came across this para that I don't quite understand.

"Well, you can't blame him for wanting to get out and about," said Ron, when Harry discussed
his fears with him and Hermione. "I mean, he's been on the run for over two years, hasn't he,
and I know that can't have been a laugh, but at least he was free, wasn't he? And now he's just
shut up all the time with that ghastly elf(Kreacher)."
Hermione scowled at Ron, but otherwise ignored the slight on Kreacher.

I want to know what the highlighted part means.
My understanding is that Hermione got angry at Ron for insulting elf but then she ignored this and went on to talk about something else and not fight with Ron.

A: "Otherwise" can be understood as "other than that" or, in context "Other than scowling at Ron".
"A scowl" is, of course, a facial expression for anger. We learn in the second part that "Other than scowling, Hermione ignore the insult that Ron made about Kreacher"  In particular she didn't say anything to Ron (and this might be surprising since in the past she has been very talkative about Elf Welfare)
The fact that she mostly ignored Ron's comment contrasts with the fact that she did scowl.  So the two parts of the sentence are joined with "but".
So, yes she got angry, (but not very angry) and expressed this in her face, but chose not to say anything.


text:
Q: Difficulty with list script Write a function named sum_values that takes a list as a parameter and returns the sum of the values at indices 11, 8, 5 and 1f. You may assume the input will be large enough to have values at all these indices.
def sum_values(list):
    value = sum(list(11)) + sum(list(8)) + sum(list(5)) + sum(list(1))
    return value

I am getting list object is not callable and error input.

A: def sum_values(a_list):

    value = a_list[11] + a_list[8] + a_list[5] + a_list[1]
    return value

sum_values([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) #29

the sum() function will work if the list is something like [[1,1,1],2,3,4], then sum(list[0]) will return 3.

A: You can just return the concatenated indices
def sum_values(lista):
    return lista[11] + lista[8] + lista[5] + lista[1]

l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
print(sum_values(l))

29

A: a = [1,2,3,4,5,6,7,8,9,10,11,12]

def sum_values(lst):
    result = a[11] + a[8] + a[5] + a[1]
    return result

print(sum_values(a)) # will print 29

For details on the error that you got you can refer

A: You can use list comprehension.
my_test_list = [10, 15, 6, 84, 1, 9, 12, 122, 242, 5, 10, 18, 1, 0, 0, 6, 27]
indices = [11,8,5,1]

def sum_values(my_list):
    return sum([my_test_list[index] for index in range(0, len(my_test_list)) if index in indices])

print(sum_values(my_test_list))

Output:
>>> 284

This will only sum items if they are at the indices specified in the indices list. Hope this helps.


text:
Q: POST returned a response status of 500 Internal Server Error in RESTful client communication Folks,
I am working with the RESTful webservice in java and it causing the 500 error while communicating from the Java application
I referred this tutorial to do the same
implementing RESTful Web Services in Java
here is the RESTful webservice
@Path("WebTest")
@Produces("application/json")

public class WebTestResource {

    private TreeMap<Integer, BookDemo> bookMap = new TreeMap<Integer, BookDemo>();

    public WebTestResource() {
    }

    @GET
    public List<BookDemo> getBooks() {
        List<BookDemo> books = new ArrayList<BookDemo>();
        books.addAll(bookMap.values());
        return books;
    }

    @GET
    @Path("{id}")
    public BookDemo getBook(@PathParam("id") int bookId) {
        return bookMap.get(bookId);
    }

    @POST
    @Path("add")
    @Produces("text/plain")
    @Consumes("application/json")
    public String addBook(BookDemo book) {
        int id = bookMap.size();
        try{

            book.setId(id);
            bookMap.put(id, book);

            String strFilePath = "D:\\Java™\\RESTful\\test.txt";
            FileWriter file= null;
            try {
                file = new FileWriter(strFilePath);
                file.write(book.getBookName());
            } catch (IOException ex) {
                Logger.getLogger(WebTestResource.class.getName()).log(Level.SEVERE, null, ex);
            }
            finally{
                try {
                    file.flush();
                    file.close();
                } catch (IOException ex) {
                    Logger.getLogger(WebTestResource.class.getName()).log(Level.SEVERE, null, ex);
                }

            }
        }
        catch(Exception ex){

        }

        return "Book \"" + book.getBookName() + "\" added with Id " + id;
    }

}

Webservice Client to the java application
public class Restful {
    private WebResource webResource;
    private Client client;
    private static final String BASE_URI = "http://localhost:8050/WebRestfulAppTest/services";

    public Restful() {
        com.sun.jersey.api.client.config.ClientConfig config = new com.sun.jersey.api.client.config.DefaultClientConfig();
        client = Client.create(config);
        webResource = client.resource(BASE_URI).path("WebTest");
    }

    public <T> T getBook(Class<T> responseType, String id) throws UniformInterfaceException {
        WebResource resource = webResource;
        resource = resource.path(java.text.MessageFormat.format("{0}", new Object[]{id}));
        return resource.get(responseType);
    }

    public String addBook(Object requestEntity) throws UniformInterfaceException {
        return webResource.path("add").type(javax.ws.rs.core.MediaType.APPLICATION_JSON).post(String.class, requestEntity);
    }

    public <T> T getBooks(Class<T> responseType) throws UniformInterfaceException {
        WebResource resource = webResource;
        return resource.get(responseType);
    }

    public void close() {
        client.destroy();
    }

}

POJO
@XmlRootElement(name = "BookDemo")
public class BookDemo {
private int id;

private String bookName;

private String bookAuthor;

private String bookISBN;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getBookName() {
return bookName;
}

public void setBookName(String bookName) {
this.bookName = bookName;
}

public String getBookAuthor() {
return bookAuthor;
}

public void setBookAuthor(String bookAuthor) {
this.bookAuthor = bookAuthor;
}

public String getBookISBN() {
return bookISBN;
}

public void setBookISBN(String bookISBN) {
this.bookISBN = bookISBN;
}

}

main()
public class GetCallService {
    static Restful objRestful = new Restful();

    public static void main(String[] args){
        try{
        BookDemo book = new BookDemo();
        book.setBookAuthor("ABC");
        book.setBookName("Introduction to RESTful Web Services Example test application");
        book.setBookISBN("ISBN 10: 0-596-52926-0");
        objRestful.addBook(book);
        BookDemo book1 = new BookDemo();
        book1.setBookAuthor("XYZ");
        book1.setBookName("RESTfull web");
        book1.setBookISBN("ISBN 10: 0-596-52926-0 Prajwal");
        objRestful.addBook(book1);
        }
        catch(Exception ex){
            ErrorLog.errorLog(ex);
        }
    }
}

Exception

ex = (com.sun.jersey.api.client.UniformInterfaceException)
  com.sun.jersey.api.client.UniformInterfaceException: POST
  http://localhost:8050/WebRestfulAppTest/services/WebTest/add returned
  a response status of 500 Internal Server Error

A: there is an Exception in the web services add :
catch(Exception ex){
    ex.printStackTrace();
}


text:
Q: Chart.Js : How to change the color of a point, based on a third data I want to change the color of the points according to a third data.
At the moment, I get my x- and y-axes from a json file:
{"data": [{"date": "2022-04-04", "position": 5.0, "indexed": 1}, {"date": "2022-04-05", "position": 5.0, "indexed": 0}, {"date": "2022-04-06", "position": 5.0, "indexed": 0}, {"date": "2022-04-07", "position": 5.0, "indexed": 0}, {"date": "2022-04-07", "position": 5.1, "indexed": 0}, {"date": "2022-04-08", "position": 5.9, "indexed": 0}, {"date": "2022-04-09", "position": 5.0, "indexed": 0}, {"date": "2022-04-10", "position": 5.0, "indexed": 0}, {"date": "2022-04-11", "position": 5.0, "indexed": 0}, {"date": "2022-04-12", "position": 5.0, "indexed": 0}, {"date": "2022-04-13", "position": 5.0, "indexed": 0}, {"date": "2022-04-14", "position": 5.0, "indexed": 0}, {"date": "2022-04-15", "position": 5.0, "indexed": 0}, {"date": "2022-04-16", "position": 5.0, "indexed": 0}, {"date": "2022-04-17", "position": 5.0, "indexed": 0}, {"date": "2022-04-18", "position": 5.0, "indexed": 0}, {"date": "2022-04-19", "position": 5.0, "indexed": 0}, {"date": "2022-04-20", "position": 5.0, "indexed": 0}, {"date": "2022-04-21", "position": 5.0, "indexed": 0}]}

date : x
position : y
indexed : if 0 : blue - if 1 : red
To change the color according to this third data, I used the scriptable options : https://www.chartjs.org/docs/latest/general/options.html#scriptable-options
Here is what I wrote:

const main_data = {
label: '{{ keyword }}',
data: [],
backgroundColor: "#6AC44D",
borderColor: "#1300FF",
pointBorderColor: [],
borderWidth: 1,
pointBackgroundColor : function(context) {
        const response = fetch('/get_json/{{keyword}}');
        const datapoints = response.json();
        datapoints.then(datapoints => {
        const indexed = datapoints.data.map(function(index){
            return index.indexed;
        })
        var index = context.dataIndex;
        var value = context.dataset.data[index];
        console.log(value)
        var label = context.labels;
        if (indexed == 0){return value == 'blue'}else{return value =='red'}
    });
}

}

What am I doing wrong?
Here, the function that allows me to create the graph, without changing the colors of the points.
This part works:

function createChart(){
    async function fetchdata(){
    const url = '/get_json/{{keyword}}';
    const response = await fetch(url);
    const datapoints = await response.json();
    return datapoints;
    };

    fetchdata().then(datapoints => {
        const dates = datapoints.data.map(function(index){
            return index.date;
        })
        const positions = datapoints.data.map(function(index){
            return index.position;
        })
        const indexed = datapoints.data.map(function(index){
            return index.indexed;
        })

    myChart.config.data.labels = dates
    myChart.config.data.datasets[0].data = positions
    myChart.update();
    });
}

A: There are 2 errors that are happening when returning the color:

*

*when returning the colors you're actually returning booleans, as mentioned in the comments it should just be the strings

*indexed is an array, so indexed==0 isn't correct, what you actually want to do is check against the target index in indexed
Your final if should look like this:
if (indexed[context.dataIndex] == 0){return 'blue'}else{return 'red'}

I've also made a JSFiddle so you can see this in action


text:
Q: Adding objects that have not defined def addAccount():
    print ("You have chosen to add an account")
    numAcc = 5
    proceed = int(input("Please choose 1 to procedd. If you enter 0, the process will be cancelled.: "))
    while (proceed != 0):
        addName = str(input("Please enter the name of the new account: "))
        addBirthday = str(input("Please enter the birthday of the user (month day, year) :"))
        addAddress = str(input("Please enter the address of the user: "))
        addHkid = str(input("Please enter the HK IDcard number: "))
        addBalance = 0
        numAcc = numAcc + 1
        c6 = Customer (addName, addBirthday, addAddress, addHkid, addBalance)
        CustomerList.append (c6)
        break

I have this code for my python code.
I have defined CustomerList above, and customers called from c1 to c5.
I'd like to add new customers called c6 --- until whatever the number is.
Is there a way for me to change some codes or something to be able to add new customers into my customer list? I was trying to use numAcc so that every while loop I can add 1 for that numAcc value and use that number to add account (as number that is added at the end of each customers).
Customers I've defined are like this:
c1 = Customer ("Jack", "Jan, 10th, 1996", "430 Davis Ct., San Francisco", "M8875895", 40000)
c2 = Customer ("Smith", "March 24th, 1997", "3-5 Tai Koo Shing, Hong Kong", "M3133242", 600)
c3 = Customer ("Suzy", "May 5th, 1995", "32 Clearwater Bay Ave. Hong Kong", "M8378644", 100000)
c4 = Customer ("Craig", "May 24th, 1993", "700 Powell Street, San Francisco", "M2314565", 70000)
c5 = Customer ("Vic", "September 21st, 1992", "1210 Freud Street, New York", "M1234569", 3400)

A: Are you looking for something like this?
def addAccount():
    print ("You have chosen to add an account")
    proceed = 1
    while proceed != 0:
        proceed = int(input("Please enter any number except 0 to proceed. If you enter 0, the process will be cancelled: "))
        addName = str(input("Please enter the name of the new account: "))
        addBirthday = str(input("Please enter the birthday of the user (month day, year) :"))
        addAddress = str(input("Please enter the address of the user: "))
        addHkid = str(input("Please enter the HK IDcard number: "))
        addBalance = 0
        CustomerList.append(Customer(addName, addBirthday, addAddress, addHkid, addBalance))

This will keep adding/modifying Customer's to CustomerList until the user enters 0.