How to add another bulk operation?

Question: Jira allows to add web fragments on different locations.
I'd like to write a plugin that adds another bulk operation but can neither find a location (if this done via a web fragement at all) nor a hint in the Jira Plugin Module Types how to add such an operation. From existing plugins (e.g. exporter) I got the impression that there must be a way.
Any help appreciated. Thanks.
Comment: There's nothing wrong about you question but unless some jira support is among us on SO I think it'd be better to ask their support which I think is very good.
Comment: Well, I hope that I'm not the only one and some more experienced developers are here :-)
Comment: I read a question about this on answers.atlassian.com a few days ago
Comment: Thanks, here's what I found: [Any doc/guideline to create a new BulkOperation in JIRA ?](https://answers.atlassian.com/questions/208792/answers/11970910) and [Bulk operations on Issues in JIRA](https://answers.atlassian.com/questions/18948), though maybe not that straight forward.
Answer: It is possible to do it, here is what I did:
I extended AbstractBulkOperation class and used approach with EventListener to add this operation in afterPropertiesSet like this:
ComponentAccessor.getBulkOperationManager().addBulkOperation(MyOperationClass.NAME_KEY, MyOperationClass.class);

You need to implement canPerform, perform (the actual operation), getOperationName, getCannotPerformMessageKey, getNameKey, getDescriptionKey
I extended AbstractBulkOperationDetailsAction, but BulkEditBeanSessionHelper couldn't be autowired so I introduced protected constructor and got it there:
protected MyActionClass()
{
super(null, ComponentManager.getComponentInstanceOfType(BulkEditBeanSessionHelper.class));

genericBulkWatchOperation = ComponentAccessor.getBulkOperationManager().getOperation(NAME_KEY);
}

You need to implement getOperationDetailsActionName, doDetails,doDetailsValidation, doPerform methods in this class.
I created Webwork element in atlassian-plugin.xml, something like this:
<webwork1 key="key" name="name" class="java.lang.Object">
<actions>
<action name="path to action class" alias="Action">
<command name="details" alias="ActionDetails">
<view name="success">/secure/views/bulkedit/bulkchooseoperation.jsp</view>
<view name="input">/secure/views/bulkedit/bulkActiondetails.jsp</view>
<view name="error">/secure/views/bulkedit/bulkchooseoperation.jsp</view>
</command>
<command name="detailsValidation" alias="ActionDetailsValidation">
<view name="input">/secure/views/bulkedit/bulkActionconfirmation.jsp</view>
<view name="error">/secure/views/bulkedit/bulkActionconfirmation.jsp</view>
</command>
<command name="perform" alias="ActionPerform">
<view name="error">/secure/views/bulkedit/bulkActionerror.jsp</view>
</command>
</action>
</actions>
</webwork1>

JSP files cannot be embedded in plugin, I deployed them to /secure/views/bulkedit
To wrap it up - you need 3 classes (Operation, Action and EventListener), webwork definition in atlassian-plugin.xml and Event Listener definition also in atlassian-plugin.xml. Then you need JSP files. You can take existing ones and use them as an example.
Basically I took WatchIssue operation files and did it analogically.
I strongly suggest to take a look at JIRA code to see how they do it.

How to add another bulk operation?


How to properly restart unity?

Question: I keep on experiencing weird bugs. These usually start after a few hours of use. Sometimes the dash starts opening under every open window (becomes only visible on desktop, but I still can search and open anything with the enter key while it's not visible). Also, there are other minor annoyances, such as random places (especially maximized Chrome, tabs area) after navigating between programs with alt+tab can't be clicked with the mouse. Switching back and forth fixes this.
I cannot use
compiz --replace

since after that, all of the app indicator icons are gone (only teamviewer stays). Skype, network, languages, sound (also keyboard sound up/down stops working) and date are gone. Restarting unity-panel-service does not help.
Any thoughts on how to resolve these?
Comment: I had a serious problem with that too, Yakuake terminal would stop responding, I solved it using [this script](http://sourceforge.net/p/scriptechocolor/git/ci/master/tree/ScriptEchoColor/bin.extras/secFixWindow.sh)  `secFixWindow.sh --fixcompiz` that  basically replaces with metacity, wait a bit and replaces again with compiz and all works fine :)
Comment: just to make it sure,  I tried this `xterm -e unity&disown` 3 times subsequently, and it worked correctly but on the 4th time, yakuake was inaccessible and cairo-dock messed up its positioning; so that script with the timing still worked better.
Answer: You can press Alt+F2, then type unity, then press Enter to restart Unity.

Or you could use:
sudo service gdm restart

On 14.04 and 14.10 use:
sudo service lightdm restart

On 15.04 and 15.10 use:
sudo systemctl restart lightdm.service

Comment: I think the command is `sudo service lightdm restart` on Ubuntu 14.04
Comment: In gnome 3, you can press Alt-F2 and enter r, and it restarts the shell without logging you out. It seems that unfortunately there's no way to do that with unity
Comment: "unity" seems to work. I guess I'll have to wait for problems to appear and then try it.
Comment: And you should be able to use `service` on 15.04. It will use the appropriate `systemctl` command.
Comment: On 20.04 LTS: **"Failed to restart lightdm.service: Unit lightdm.service not found."**
Comment: Should work just fine :)
Comment: after compiz crashed and Xorg had no window manager active, I pressed alt+f2 and nothing happened, any idea?
Comment: Well the ALT-F2 option got me in a worse state than I was before. Not recommended.
Comment: In 14.04: `sudo service lightdm restart`, for me, yields a black screen (I think it killed the process but didn't restart it). I had to fall back to a TTY terminal and run `sudo service lightdm start` to get back to a working desktop session.
Comment: On 16.04.3 LTS, my Macbook Pro with a second monitor showed funky patterns (primary monitor was fine). `sudo systemctl restart lightdm.service` caused me to lose my session anyway. At this point `sudo reboot now` is all that actually worked.
Comment: Pictures here: https://pzrq.squarespace.com/blog/2018/2/14/ubuntu-second-monitor-after-sleep-bug-pictures.html
Answer: Try secFixWindow.sh:
secFixWindow.sh --fixcompiz

It basically

replaces with Metacity,
waits a bit and
replaces again with Compiz.

Waiting is important to not mess with some applications like Yakuake or Cairo Dock.
Comment: Please don't run large shell scripts you download off the internet, unless you are going to take the time to read and understand all of it.
Comment: @JeffreyBlattman it is open source (not obfuscated, of course), unlike many applications out there that are machine dependent compiled and closed source, I mean, as I understand, any propietary application/driver have more chance to be a trustless source of problems than an open source anything that is around for some time already so other ppl could have poked on it, or am I missing something?
Comment: Yes, definitely you are missing something. Sourceforge is infested with malware and known to co-opt and modify abandoned projects. If are willing to inspect and understand the script, then fine go for it.
Comment: @JeffreyBlattman oh... thx on the info..., btw they seem to be scanning for malware (2016 on) but may be [trust is lost already 2015](https://www.howtogeek.com/218764/warning-don%E2%80%99t-download-software-from-sourceforge-if-you-can-help-it/), so [alternatives](https://en.wikipedia.org/wiki/Comparison_of_source_code_hosting_facilities)
Comment: @JeffreyBlattman also, it seems they were/are targeting abandoned projects, and this one was not. The threat also seems not so high as virus or outlawed things, but instead, sneaky unwanted sofware that may break our privacy I guess..., so basically, not all sofware would be compromised but... as I said... trust is lost :(
Comment: @JeffreyBlattman anyway, I described the basic functionality of the script, so it can be reimplemented in 3 line codes and that functionality is still a valid workaround

How to properly restart unity?


What is the fastest way to upload a big csv file in notebook to work with python pandas?

Question: I'm trying to upload a csv file, which is 250MB. Basically 4 million rows and 6 columns of time series data (1min). The usual procedure is:
location = r'C:\Users\Name\Folder_1\Folder_2\file.csv'
df = pd.read_csv(location)

This procedure takes about 20 minutes !!!. Very preliminary I have explored the following options

Upload in chunks and then put the chunks together.
HDF5
'feather'
'pickle'

I wonder if anybody has compared these options (or more) and there's a clear winner. If nobody answers, In the future I will post my results. I just don't have time right now.
Comment: With the exception of feather the others appear to be covered.  Be that as it may, I suspect your problem may be deeper than Python.  Is the location actually copying over a network which may be throttling the data?  Or is the machine running this code memory starved and, thus, swapping / thrashing?  It seems unreasonable for any of those methods to take 20 minutes to load 250MB of data.
Comment: It would help to understand the structure of your data, sometimes specifying upfront the dtypes helps with `read_csv`
Comment: This appears to be a [duplicate](http://stackoverflow.com/questions/25508510/fastest-way-to-parse-large-csv-files-in-pandas).
Comment: On hdf5 vs `.read_csv()` speed and space needs, see http://stackoverflow.com/questions/16639877/hdf5-taking-more-space-than-csv
Comment: i would consider only `HDF5` and `feather` (it might be tricky and painful to build it for Windows OS) - the rest will most definitely be much slower
Comment: Don't forget about Blaze.  http://blaze.readthedocs.io/en/latest/index.html
Comment: @SteveCohen there's not an answer that compares 'pickle', hdf5, 'feather', 'chunking' in one example. It would be a good reference question to have in the site.
Comment: Is there a reason you can't gzip it?
Comment: @KenKinder, i've added GZIP to my comparison
Comment: There are other alternatives: Parquet, asdf, TileDB...
Answer: Here are results of my read and write comparison for the DF (shape: 4000000 x 6, size in memory 183.1 MB, size of uncompressed CSV - 492 MB).
Comparison for the following storage formats: (CSV, CSV.gzip, Pickle, HDF5 [various compression]):
                  read_s  write_s  size_ratio_to_CSV
storage
CSV               17.900    69.00              1.000
CSV.gzip          18.900   186.00              0.047
Pickle             0.173     1.77              0.374
HDF_fixed          0.196     2.03              0.435
HDF_tab            0.230     2.60              0.437
HDF_tab_zlib_c5    0.845     5.44              0.035
HDF_tab_zlib_c9    0.860     5.95              0.035
HDF_tab_bzip2_c5   2.500    36.50              0.011
HDF_tab_bzip2_c9   2.500    36.50              0.011

reading

writing/saving

file size ratio in relation to uncompressed CSV file

RAW DATA:
CSV:
In [68]: %timeit df.to_csv(fcsv)
1 loop, best of 3: 1min 9s per loop

In [74]: %timeit pd.read_csv(fcsv)
1 loop, best of 3: 17.9 s per loop

CSV.gzip:
In [70]: %timeit df.to_csv(fcsv_gz, compression='gzip')
1 loop, best of 3: 3min 6s per loop

In [75]: %timeit pd.read_csv(fcsv_gz)
1 loop, best of 3: 18.9 s per loop

Pickle:
In [66]: %timeit df.to_pickle(fpckl)
1 loop, best of 3: 1.77 s per loop

In [72]: %timeit pd.read_pickle(fpckl)
10 loops, best of 3: 173 ms per loop

HDF (format='fixed') [Default]:
In [67]: %timeit df.to_hdf(fh5, 'df')
1 loop, best of 3: 2.03 s per loop

In [73]: %timeit pd.read_hdf(fh5, 'df')
10 loops, best of 3: 196 ms per loop

HDF (format='table'):
In [37]: %timeit df.to_hdf('D:\\temp\\.data\\37010212_tab.h5', 'df', format='t')
1 loop, best of 3: 2.6 s per loop

In [38]: %timeit pd.read_hdf('D:\\temp\\.data\\37010212_tab.h5', 'df')
1 loop, best of 3: 230 ms per loop

HDF (format='table', complib='zlib', complevel=5):
In [40]: %timeit df.to_hdf('D:\\temp\\.data\\37010212_tab_compress_zlib5.h5', 'df', format='t', complevel=5, complib='zlib')
1 loop, best of 3: 5.44 s per loop

In [41]: %timeit pd.read_hdf('D:\\temp\\.data\\37010212_tab_compress_zlib5.h5', 'df')
1 loop, best of 3: 854 ms per loop

HDF (format='table', complib='zlib', complevel=9):
In [36]: %timeit df.to_hdf('D:\\temp\\.data\\37010212_tab_compress_zlib9.h5', 'df', format='t', complevel=9, complib='zlib')
1 loop, best of 3: 5.95 s per loop

In [39]: %timeit pd.read_hdf('D:\\temp\\.data\\37010212_tab_compress_zlib9.h5', 'df')
1 loop, best of 3: 860 ms per loop

HDF (format='table', complib='bzip2', complevel=5):
In [42]: %timeit df.to_hdf('D:\\temp\\.data\\37010212_tab_compress_bzip2_l5.h5', 'df', format='t', complevel=5, complib='bzip2')
1 loop, best of 3: 36.5 s per loop

In [43]: %timeit pd.read_hdf('D:\\temp\\.data\\37010212_tab_compress_bzip2_l5.h5', 'df')
1 loop, best of 3: 2.5 s per loop

HDF (format='table', complib='bzip2', complevel=9):
In [42]: %timeit df.to_hdf('D:\\temp\\.data\\37010212_tab_compress_bzip2_l9.h5', 'df', format='t', complevel=9, complib='bzip2')
1 loop, best of 3: 36.5 s per loop

In [43]: %timeit pd.read_hdf('D:\\temp\\.data\\37010212_tab_compress_bzip2_l9.h5', 'df')
1 loop, best of 3: 2.5 s per loop

PS i can't test feather on my Windows notebook
DF info:
In [49]: df.shape
Out[49]: (4000000, 6)

In [50]: df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 4000000 entries, 0 to 3999999
Data columns (total 6 columns):
a    datetime64[ns]
b    datetime64[ns]
c    datetime64[ns]
d    datetime64[ns]
e    datetime64[ns]
f    datetime64[ns]
dtypes: datetime64[ns](6)
memory usage: 183.1 MB

In [41]: df.head()
Out[41]:
                    a                   b                   c  \
0 1970-01-01 00:00:00 1970-01-01 00:01:00 1970-01-01 00:02:00
1 1970-01-01 00:01:00 1970-01-01 00:02:00 1970-01-01 00:03:00
2 1970-01-01 00:02:00 1970-01-01 00:03:00 1970-01-01 00:04:00
3 1970-01-01 00:03:00 1970-01-01 00:04:00 1970-01-01 00:05:00
4 1970-01-01 00:04:00 1970-01-01 00:05:00 1970-01-01 00:06:00

                    d                   e                   f
0 1970-01-01 00:03:00 1970-01-01 00:04:00 1970-01-01 00:05:00
1 1970-01-01 00:04:00 1970-01-01 00:05:00 1970-01-01 00:06:00
2 1970-01-01 00:05:00 1970-01-01 00:06:00 1970-01-01 00:07:00
3 1970-01-01 00:06:00 1970-01-01 00:07:00 1970-01-01 00:08:00
4 1970-01-01 00:07:00 1970-01-01 00:08:00 1970-01-01 00:09:00

File sizes:
{ .data }  » ls -lh 37010212.*                                                                          /d/temp/.data
-rw-r--r-- 1 Max None 492M May  3 22:21 37010212.csv
-rw-r--r-- 1 Max None  23M May  3 22:19 37010212.csv.gz
-rw-r--r-- 1 Max None 214M May  3 22:02 37010212.h5
-rw-r--r-- 1 Max None 184M May  3 22:02 37010212.pickle
-rw-r--r-- 1 Max None 215M May  4 10:39 37010212_tab.h5
-rw-r--r-- 1 Max None 5.4M May  4 10:46 37010212_tab_compress_bzip2_l5.h5
-rw-r--r-- 1 Max None 5.4M May  4 10:51 37010212_tab_compress_bzip2_l9.h5
-rw-r--r-- 1 Max None  17M May  4 10:42 37010212_tab_compress_zlib5.h5
-rw-r--r-- 1 Max None  17M May  4 10:36 37010212_tab_compress_zlib9.h5

Conclusion:
Pickle and HDF5 are much faster, but HDF5 is more convenient - you can store multiple tables/frames inside, you can read your data conditionally (look at where parameter in read_hdf()), you can also store your data compressed (zlib - is faster, bzip2 - provides better compression ratio), etc.
PS if you can build/use feather-format - it should be even faster compared to HDF5 and Pickle
PPS: don't use Pickle for big data frames, as you may end up with SystemError: error return without exception set error message. It's also described here and here.
Comment: You might want to try 'cPickle.dump(..., protocol=2)' as in http://matthewrocklin.com/blog/work/2015/03/16/Fast-Serialization In my tests it was 3x faster than HDF fixed format.
Comment: Read and write time for ascii tables are misleading. There are much faster ways to read/write ascii files when a few reasonable assumptions are imposed. See PyArrow or [Astropy Fast ASCII](https://het.as.utexas.edu/HET/Software/Astropy-1.0/io/ascii/fast_ascii_io.html), and others.
Comment: One can store a subclass of DataFrame or Series to HDF5, but the type of the subclass is lost upon storing.
Answer: you can use datatable to load the csv file and then covert it to pandas dataframe, it is considerably faster than loading with pandas read_csv()
import datatable as dt

dt_df = dt.fread(csv_file)
pd_df = dt_df.to_pandas()

On csv file of 1 Go, pandas read_csv take about 34 minutes, while datable fread take only 40 second, which is a huge difference (x51 faster).
You can also work only with datatable dataframe, without the need to convert to pandas dataframe (this depends on the functionality that you want). A useful introduction to datatable : https://www.kaggle.com/sudalairajkumar/getting-started-with-python-datatable
Comment: hm. I just tried this and its still not as fast as reading each CSV line one row at a time. I have one with 11000 lines with a dozen or so columns. My raw file read benchmarks at 0.16 seconds vs. this datatable route which benchmarks at 9.7 seconds. I don't get it. If CSV is this fast, what am I missing regarding other storage schemes.
Comment: it's depend on 2 things, 1) how is your data, and 2) what you will do after reading it.  1) you can do it read CSV file manually, but but, you have to deal with conversion of type depending on columns, and deal with empty entry … and store the result some where in matrix for example. 2) if you want to manipulate your data with panda datafarme or (datatable), so you have to convert the data and this is also time to be consider. By the way there is [CSV library](https://docs.python.org/3/library/csv.html) in python you can use theme. **So, if CSV library is enough go for it ;)** , good luck.
Comment: Maybe that's the most important point in all of this. If line by line read is in fact all I need rather than in program representation of the data cached in memory, then I can get by with that. Maybe I should avoid HDF5 and other solutions unless I need an in-memory cache of the data. Is it correct to assume part of the overhead I am experiencing is due to the fact that other solutions are preparing the data to be stored in data space of the program?
Comment: Still I feel like I am missing something about HDF5 and other hierarchical binary format solutions. If I can use slicing and chunking to improve my indexing criteria (let's say for a particular time period within the data), shouldn't I be able to iterate over the binary file as fast as CSV file? (i.e., avoid the loading into memory step). Because ultimately, I would improve upon CSV with my own binary format of the data with own serializer/deserializer code. It would provide better storage footprint and make use of slicing by using well defined fs - but that is reinventing the wheel with hdf5.
Comment: @LeanMan, I think your missing point is: mix thing between 1) only read csv file (and you have to deal with type conversion)  and 2) library that are for data manipulation (statistics and analysis ) like pandas and others, these library comes with their own csv read, where they can guess the types.  [dask](https://dask.org/) is in the second category,  is a collection of smaller pandas for big data (Dask provides advanced parallelism for analytics).
Comment: I do intend to do statistics and analysis on my data but since most of the analysis is moving averages it doesn't require the "load to memory" time that pandas/hdf5 does. I can get by with reading the latest data at a time just like as time is moving and data is collected at the end of each period.


Independence of parabolic subgroup in parabolic induction and restriction?

Question: Suppose $G$ is a complex algebraic group, $L$ a proper Levi subgroup, and $\lambda$ an irreducible character of the subgroup $L^F$ of $F$-stable points in $L$, which is contained in $F$-stable parabolic subgroups $P$ and $Q$.
It's a theorem that the parabolic induction and restriction funtors $R^G_{L\subset P},\ ^\ast R^G_{L\subset P}$, etc. are independent of $P$ and $Q$. A line in a proof by Digne and Michel says,

By the Mackey Formula and the adjunction,
  $$
\langle R^G_{L\subset P}\lambda;R^G_{L\subset Q}\lambda\rangle_{G^F}=\sum\langle\ ^\ast R^L_{L\cap\ ^xL\subset L\cap\ ^xQ}\lambda;\ ^\ast R^{\ ^xL}_{L\cap\ ^xL\subset P\cap\ ^xL}\ ^x\lambda\rangle_{L^F\cap\ ^xL^F}
$$

Can anyone explain how exactly they're using Mackey and the adjunction to get this equality? The Mackey formula gives a decomposition of the composition $^\ast R^G_{L\subset P}\circ R^G_{L\subset Q}$, so I'm not sure how to use it to look at the inner product of two induction functors.
Answer: This is a pretty standard argument. Look at the hom space between the two induced representations, use Frobenius reciprocity to turn this into a hom from $\lambda$ to the restriction-induction of $\lambda$, use Mackey on the latter of these, and then Frobenius reciprocity again.
Comment: I see, Frobenius reciprocity makes this immediate now, thanks.


JQuery syntax error unrecognized expression

Question: $("#EMPLOYEE_ALT option:[value='"+$("#EMPLOYEE_ID").val()+"']").remove();

the above code gives the following error:

Uncaught Error: Syntax error, unrecognized expression: #EMPLOYEE_ALT\ option:[value='9999']

9999 is employee id witch is correct and this value suppose to be sent via ajax and return with something.
$.post("url", { emp: $("#EMPLOYEE_ID").val(),ajax: "yes"  },

Comment: Seems TYPO, voting to close
Comment: typographical  error :- you have unexpected : with your selector
Answer: You have unexpected : in your selector. The correct selector would be
$("#EMPLOYEE_ALT option[value='"+$("#EMPLOYEE_ID").val()+"']").remove();

Answer: Try this:
"#EMPLOYEE_ALT option[value='"+$("#EMPLOYEE_ID").val()+"']"

The attribute selector doesn't haves : on it. That is used for CSS's pseudo-classes only.

$("#remove").on("click", function() {
    $("#EMPLOYEE_ALT option[value='9999']").remove();
});

<select id="EMPLOYEE_ALT">
  <option value="1">1</option>
  <option value="9999">9999</option>
</select>

<button id="remove">Remove item '9999'</button>


How many maximal consistent sets are there on a $\mathscr{FOL}$

Question: Let $\mathfrak L$ be a $\mathscr{FOL}$ with completeness and soundness.
My question is how many maximal consistent sets on it?
I know that every maximal consistent set can be dealt as an ultrafilter on Henkin model. However, the quantity of ultrafilters on a poset, even on a boolean algebra, cannot be determined by the cardinality of it. Cardinality of the set of ultrafilters on an infinite Boolean algebra
So an extra question is that is there exists an arithmetic to calculate the quantity of ultrafilters on arbitary poset?
Answer: Consider the following infinite binary tree. The nodes of the tree are theories (sets of formulas) in the language of first order arithmetic. The root of the tree is the set of Peano Axioms ($PA$). The children of each node $T$ are $T \cup \{GL_T\}$ and $T \cup \{\lnot GL_T\}$, where $GL_T$ is the Goedel sentence of the theory $T$. By Goedel's Imcompleteness Theorem each node is a consistent set of formulas.
Each branch in this tree determines a theory - the union of all nodes, which is consistent by compactness theorem. So the theory corresponding to each branch can be extended to a maximal consistent set. Furthermore it is easy to see that these maximal consistent sets are all different. Now since there are $2^{\aleph_0}$-many branches in this tree, there are at least $2^{\aleph_0}$ maximal consistent sets in the language of arithmetic.
Clearly there are at most $2^{\aleph_0}$ maximal consistent sets, so $2^{\aleph_0}$ is the cardinality of the set of maximal consistent sets in the first-order language of arithmetic.
Comment: Your answer is enlightening, although it is not the final. If you find the final answer, please update. Thank you very much.


Limit point of the graph of a set valued function.

Question: Let $F:\mathbb R^n\to 2^{\mathbb R^m}$ a set valued function. Let $$\Gamma =\{(x,F(x))\mid x\in \mathbb R^n\},$$
its graph. I'm reading a book where they take $(p,q)$ a limit point of $\Gamma $ and they say that this implies that there are sequences $p_i\to p\in \mathbb R^n$, $q_i\to q$, where $q_i\in F(p_i)$.
Question What is strange it's that $q$ is a set whereas $q_i$ are element of $\mathbb R^m$, so what mean $q_i\to q$ ? Don't they want to say that there is a sequence $p_i\to p\in\mathbb R^n$ s.t. $F(p_i)\to q$ ? But I'm not so sure what mean $F(p_i)\to q$. Should it be that $q=\bigcup_{i\in\mathbb N}F(p_i)$.

For reference, this appear in chapter 2, proof of lemma 14, $\S$5 (page 66) of "Differential equation with continuous righthand sides" of A.F. Filipov.
Answer: On page 65 the author of the book you mentioned defines the graph of $F$ as
$$ \{(p,q) \in \mathbb{R}^n \times \mathbb{R}^m  \:|\: p \in D, q \in F(p)\} $$
and given this definition of graph of a set-valued function the statement is just about convergence in $\mathbb{R}^n$ and $\mathbb{R}^m$.
Comment: I didn't see that. Thanks.
Comment: Just by cuiriosity, don't we have $$\{(p,q)\mid p\in D, q\in F(p)\}=\{\{p\}\times F(p)\mid p\in D\}\ \ ?$$
Comment: Actually, it is $$ \bigcup_{p \in D} \{p\} \times F(p). $$


Combined Array of object properties inside Object, Inside Array

Question: Given this array of objects:
[
    {"Code": 101, "Description": "Invoice"},
    {"Code": 102, "Description": "Credit"},
    {"Code": 103, "Description": "Credit"},
    {"Code": 111, "Description": "Invoice"},
    {"Code": 112, "Description": "Credit"},
    {"Code": 113, "Description": "Credit"},
    {"Code": 182, "Description": "Backup"}
]

I need to combine the objects that have matching Descriptions into one single object with an array of Codes, like so:
[
    {"Code": [101,111], "Description": "Invoice"},
    {"Code": [102,103,112,113], "Description": "Credit"},
    {"Code": [182], "Description": "Backup"}
]

I have tried with the groupBy() helper function below (the vanilla JS one) and it is not working because I get an Object with a single undefined property with the original array as it's value:
var groupBy = function (arr, criteria) {
    return arr.reduce(function (obj, item) {

        // Check if the criteria is a function to run on the item or a property of it
        var key = typeof criteria === 'function' ? criteria(item) : item[criteria];

        // If the key doesn't exist yet, create it
        if (!obj.hasOwnProperty(key)) {
            obj[key] = [];
        }

        // Push the value to the object
        obj[key].push(item);

        // Return the object to the next item in the loop
        return obj;

    }, {});
};

var array = [
    {"Code": 101, "Description": "Invoice"},
    {"Code": 102, "Description": "Credit"},
    {"Code": 103, "Description": "Credit"},
    {"Code": 111, "Description": "Invoice"},
    {"Code": 112, "Description": "Credit"},
    {"Code": 113, "Description": "Credit"},
    {"Code": 182, "Description": "Backup"}
];

var groupDescription = groupBy(array, array.forEach(document => document.Description));

console.log(groupDescription);

What would be the best way to achieve my expected output?
Comment: Mods: this question was asked before by the OP where the original question was down-voted and closed as a dupe. However, the accepted answer on the dupe link does not answer the question...
Comment: "the best way" - what are you looking for? does the current code not work?
Comment: Thank you @RobinMackenzie for the clarification!
Comment: @evolutionxbox no, it wasn't doing what I needed. Robin's Answer does, though
Answer: Your expected output is an Array, but the reduce logic in your groupBy function takes an Object as it's initial value. It's not obvious why you want to run the criteria function for each item in the input array, as Description is a String, not an Array.
A simpler approach (may, or may not, be the best):

get the unique set of Descriptions as an array
iterate that array and for each Description, filter the original array and get the Codes

See below:

var arr = [
  {"Code": 101, "Description": "Invoice"},
  {"Code": 102, "Description": "Credit"},
  {"Code": 103, "Description": "Credit"},
  {"Code": 111, "Description": "Invoice"},
  {"Code": 112, "Description": "Credit"},
  {"Code": 113, "Description": "Credit"},
  {"Code": 182, "Description": "Backup"}
];

// expected output
//[
//  {"Code": [101,111], "Description": "Invoice"},
//  {"Code": [102,103,112,113], "Description": "Credit"},
//  {"Code": [182], "Description": "Backup"}
//]

var grouped = Array
  .from(new Set(arr.map(o => o.Description))) // get unique Descriptions as array
  .map(d => { // iterate that array
    return {
      "Code": arr
        .filter(o => o.Description === d)
        .map(o => o.Code), // return just the Code for original array items matching this unique Description
      "Description": d  // the Description
    }
  });

console.log(grouped);
Comment: Amazing! Now this works exactly as I need it. Thanks a lot, Robin. And thanks for clarifying to the Mods that this is a different kind of question.


Are there conflicts between SQL Server 2005 and SQL Server 2008?

Question: I am told that SQL Server 2005 installation with BI tools and SQL Server 2008 with BI tools can't work together on the same computer. Apparently "some" things stop working. This was told to me by one of my team members. Since I'm new to SQL BI, I cant discount what he has said altogether and I dont want to install them both on my dev box and find out later that there is problem.
Has anyone here installed them both, used both sufficiently well and found it to be working fine?
Thanks.
Answer: I have a complete install of both SQL2005 developer and SQL2008 developer on my workstation.  Nothing unusual has happened.  A collegue also has both installed and is making use of the BI side of SQL 2005, again we haven't noticed any ill affects.
Server side I would think twice before installing both, but only becuase of resource usasge.  If your box has sufficent resources available then I wouldn't expect any issue.
Answer: I'm not sure if this is your development system or the server... If its the server you can have side by side reporting services on the same server at the same time (though you use double the resources too). I am not sure why you would though; the reporting services 2008 is vastly superior and can report on data from the sql 2005 instance. If you are worried about the lack of a service pack for sql 2008 you can report on data in sql 2008 from reporting services 2005 (http://msdn.microsoft.com/en-us/library/ms143736.aspx)
If its local on your own pc you can have the development tools both installed at the same time (http://msdn.microsoft.com/en-us/library/bb500441.aspx); though in this case i would use the sql 2005 tools only if you are migrating to sql 2008 as SQL 2005 code works on 2008 but not necessarily the other way around.
If you have reporting services models make sure you check out report builder 2 which ms launched this week. Its a much better user experience than report builder 1.
Comment: Hi, thanks for the reply, I will be looking into those links shortly. well actually this is for my dev box. For the billable projects I need SQL 2005 working properly and not suffer from any conflicts. SQL 2008 is for self learning. That's why I need them both together.


Displaying gif animations

Question: I have this code to load a gif but I don't understand the <code>$(".block1").load("views/changepass.template.php");</code> part. Please explain.
<code>$(function() {
    $(".changepass").click(function() {
        $(".block1").load("views/changepass.template.php");
        return false;
    });
});
</code>
Comment: http://api.jquery.com/load/ should provide all the information you need about the `.load()` method
Answer: Here's an annotated version of the script, which should explain everything :
<code>$(function() {//When the document is ready to be interacted with, ...
    $(".changepass").click(function() {//establish a 'click' event handler for .changepass element(s), which ...
        $(".block1").load("views/changepass.template.php");//loads content from the server into .block1 element(s), then ...
        return false;//ensures the natural 'click' action of the clicked element is not executed.
    });
});
</code>

Displaying gif animations


Why accuracy of GridSearchCV method is lower than standard method?

Question: I use train_test_split (random_state = 0) and decision tree without any parameter tuning to model my data, I run it about 50 times to achieve the best accuracy.
import pandas as pd
import numpy as np

from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split

Laptop = pd.ExcelFile(r"D:\Laptop.xlsx",  data_only=True)
data = pd.read_excel(r"D:\Laptop.xlsx",sheet_name=0)

train, test = train_test_split(data, test_size = 0.15)
print("Training size: {}; Test size: {}".format(len(train), len(test)))

c = DecisionTreeClassifier()

features = ["Brand", "Size", "CPU", "RAM", "Resolution", "Class"]

x_train = train[features]
y_train = train["K=20"]
x_test = test[features]
y_test = test["K=20"]

dt = c.fit(x_train, y_train)

y_pred = c.predict(x_test)

from sklearn.metrics import accuracy_score
score = accuracy_score(y_test, y_pred)*100

print ("Accuracy using Decision Tree:", round(score, 1), "%")

In the second step, I decided to use the GridSearchCV method to set the tree parameters.
import pandas as pd
import numpy as np

from sklearn import tree
from sklearn.model_selection import train_test_split

from matplotlib import pyplot as plt
from scipy.stats import randint
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import RandomizedSearchCV
%matplotlib inline

Laptop = pd.ExcelFile(r"D:\Laptop.xlsx",  data_only=True)
data = pd.read_excel(r"D:\Laptop.xlsx",sheet_name=0)

train, test = train_test_split(data, test_size = 0.15, random_state = 0)
print("Training size: {}; Test size: {}".format(len(train), len(test)))

features = ["Brand", "Size", "CPU", "RAM", "Resolution", "Class"]

x_train = train[features]
y_train = train["K=20"]
x_test = test[features]
y_test = test["K=20"]

from sklearn.model_selection import GridSearchCV

param_dist = {"max_depth":[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
          "min_samples_leaf":randint (10,60)}

tree = DecisionTreeClassifier()
tree_cv = RandomizedSearchCV(tree, param_dist, cv=5)
tree_cv.fit(x_train, y_train)

print("Tuned Decisio Tree Parameters: {}".format(tree_cv.best_params_))
print("Best score is: {}".format(tree_cv.best_score_))

y_pred = tree_cv.predict(x_test)

from sklearn.metrics import accuracy_score
score = accuracy_score(y_test, y_pred)*100

print ("Accuracy using Decision Tree:", round(score, 1), "%")

my best accuracy in first method is very better than GridSearchCV method.
Why is this happening?
Do you know the best way to get the best tree with the most accuracy?
Comment: Please add the code and preferably part of your data, just enough to get a [MCVE].
Comment: Share your work to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
Comment: make sure your search space include the default hyperparameters of the 1st method
Comment: I added my code, @MaximilianPeters
Comment: I added my code, @SıddıkAçıl
Comment: The best tree parameters in the first method are included in the range of parameters of the second method. @KurumiTokisaki
Comment: You aren't using  GridSearchCV, you're using RandomSearchCV
Answer: Why is this happening?
Without seeing your code I can only speculate. It is probably based on the granularity of your grid. If you are making 50 combinations but there are billions of possible combinations then this is meaningless as a search space. Is there a way you can optimise what parameters you're searching for?
Do you know the best way to get the best tree with the most accuracy?
This is a hard question because you need to define accuracy. You can build a model which will overfit your test data. Technically the way to get the best tree is to try every possible combination of your hyperparameters, however for any reasonable number of parameters this will take forever. Generally your best method is to use a Bayesian approach to searching your hyperparameter space but you will return a distribution for each of your parameters. My advice would be to start with a RandomSearch rather than GridSearch. If you are a big fan of Skopt you can use BayesSearch. I recommend reading the code as I believe it is poorly documented.
import pandas as pd
import numpy as np
import xgboost as xgb
from skopt import BayesSearchCV
from sklearn.model_selection import StratifiedKFold

# SETTINGS - CHANGE THESE TO GET SOMETHING MEANINGFUL
ITERATIONS = 10 # 1000
TRAINING_SIZE = 100000 # 20000000
TEST_SIZE = 25000

# Classifier
bayes_cv_tuner = BayesSearchCV(
    estimator = xgb.XGBClassifier(
        n_jobs = 1,
        objective = 'binary:logistic',
        eval_metric = 'auc',
        silent=1,
        tree_method='approx'
    ),
    search_spaces = {
        'learning_rate': (0.01, 1.0, 'log-uniform'),
        'min_child_weight': (0, 10),
        'max_depth': (0, 50),
        'max_delta_step': (0, 20),
        'subsample': (0.01, 1.0, 'uniform'),
        'colsample_bytree': (0.01, 1.0, 'uniform'),
        'colsample_bylevel': (0.01, 1.0, 'uniform'),
        'reg_lambda': (1e-9, 1000, 'log-uniform'),
        'reg_alpha': (1e-9, 1.0, 'log-uniform'),
        'gamma': (1e-9, 0.5, 'log-uniform'),
        'min_child_weight': (0, 5),
        'n_estimators': (50, 100),
        'scale_pos_weight': (1e-6, 500, 'log-uniform')
    },
    scoring = 'roc_auc',
    cv = StratifiedKFold(
        n_splits=3,
        shuffle=True,
        random_state=42
    ),
    n_jobs = 3,
    n_iter = ITERATIONS,
    verbose = 0,
    refit = True,
    random_state = 42
)

result = bayes_cv_tuner.fit(X.values, y.values)

Skopt: https://scikit-optimize.github.io/
Code: https://github.com/scikit-optimize/scikit-optimize/blob/master/skopt/searchcv.py
Answer: It depends on the parameter limits you specify for GridSearchCV.
The decision tree without any parameter has default values of parameters which is not in the range you manually specified. Choose a better set of parameters and try GridSearchCV again.
Comment: The best tree parameters in the first method are included in the range of parameters of the second method.  @amalik2205


Update mime type from ~/.mime.types?

Question: The file /etc/mime.types tells that you can have a file named ~/.mime.types in your user directory and Ubuntu will grab all your defined types from there. However, I couldn't do that. I've read that there was another way to do it, but I would like to know if this way is still possible.
Comment: What's your Ubuntu version?
Answer: Create a new mime type only for your user
Replace foo with your file extension, in my example I have used foo FOUR times

Create a new XML file
nano ~/.local/share/mime/packages/foo.xml

Add the XML code below
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="text/foo">
    <comment>Todos Text file</comment>
    <glob pattern="*.foo"/>
    <glob pattern="*.FOO"/>
  </mime-type>
</mime-info>

Update the database
update-mime-database ~/.local/share/mime

Comment: That's right, but I guess he says the fact that it should be possible to add a type as /etc/mime.types mentions: `Users can add their own types if they wish by creating a ".mime.types" file in their home directory.  Definitions included there will take precedence over those listed here.`
Comment: This does not help ... this way I can just define type which cannot be associated with any application in `nautilus` ... I mean there is not even `Open With` tab when I right-click and select `Properties` in Nautilus

Update mime type from ~/.mime.types?


Got "neo4j: command not found" error when installing Neo4j on Linux machine

Question: I tried to install Neo4j1.9.2 on an Ubuntu machine. I downloaded neo4j-community-1.9.2-unix.tar.gz from Neo4j.org and unzipped it. The neo4j file is in the bin directory.
In bin directory, I typed command "neo4j start", got error "neo4j: command not found". I also tried command "sudo neo4j install", after I provided the password, I got same error "neo4j: command not found".
Java has been installed on this machine:
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
Answer: You probably don't have . in your PATH, so you need to do ./neo4j start.
Answer: If you install neo4j on your system using a package manager (mine is on gentoo using the portage overlay) the command is under /etc/init.d/neo4j. I found these useful in gentoo.
rc-service neo4j start
rc-update add neo4j default

The shell is on the path for all users, but the service is not on the path. This is the case for most services in most linux distributions, unless you have a DIY install.
Answer: You can start the neo4j server with:
service neo4j-service start
But, if you are able to access localhost:7474, then the server has already been started. You can check the status with:
service neo4j-service status


Primefaces 8 - java.lang.UnsupportedOperationException when validate value of primefaces Datepicker mindate

Question: I am new to jsf and primefaces. I have an app with springboot, jpa and jsf-primefaces, this one worked properly with version 7 of primefaces, however I just upgraded to version 8 and I have a problem. Changing the value of a datepicker throws the java.lang.UnsupportedOperationException exception
java.lang.UnsupportedOperationException: null. Debugging the application I have seen that the exception is generated in the  org.primefaces.util.CalendarUtils class convertDate2LocalTime method specifically when it tries to do the following cast date.toInstant (). AtZone (zoneId);
I will summarize what I think is most relevant, my datepicker code is as follows:
AltaEdicionCandidatos.xhtml

AltaEdicionCandidato ManagedBean
@ManagedBean(name="altaEdicionCandidato")
@ViewScoped public class AltaEdicionCandidato implements Serializable  {
private Candidato candidato;
private Date fecFeedBackMinDate;

public void onFechaEnvioChange(SelectEvent event)
    {
        this.fecFeedBackMinDate=((Date)event.getObject());
    }

...getters / setters
}

As you can see the component fecha_feedback has as mindate the value fecFeedBackMinDate(of the type java.util.Date) of the managedbean altaEdicionCandidato, when selecting any date of the component, it throws the exception java.lang.UnsupportedOperationException exception.
The ManagedBean I put it only as a reference, since it does not even run.
Debugging the process, I see that it is generated in the CalendarUtils.convertDate2ZonedDateTime class on the following line:
return date.toInstant (). atZone (zoneId);
private static ZonedDateTime convertDate2ZonedDateTime (Date date, ZoneId zoneId) {
         if (date == null) {
             return null;
         }
         else {
             return date.toInstant (). atZone (zoneId);
         }
     }

I have read that this is because the data type java.util.Date only has hours, minutes and seconds, but it does not have a time zone, therefore it throws the exception.
The call to this method begins in the DatePicker class where it tries to obtain the minTime variable of the java.time.LocalTime type using the getObjectAsLocalTime method.
protected ValidationResult validateTimeOnlyValue(FacesContext context, LocalTime time) {
        LocalTime minTime = CalendarUtils.getObjectAsLocalTime(context, this, getMindate());
        LocalTime maxTime = CalendarUtils.getObjectAsLocalTime(context, this, getMaxdate());
...

Because the value of the mindate is obtained with the getmindate method, I have not been able to know what it returns
Finally, it is even rarer, that in another view you used the same mechanics with the same components and data types and there is no exception.
AltaPosiciones.xhtml

The component with id fechaAsignacion has as mindate the value of the variable fecAsignacionMinDate of the managedBean altaEdicionPosicionesBean, which is of type java.util.Date
I have debugged and it goes through the same validations and methods mentioned but in this case it does not throw the exception.
This is a part trace of the exception
 context - java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException: null
    at java.sql.Date.toInstant(Unknown Source) ~[?:1.8.0_231]
    at org.primefaces.util.CalendarUtils.convertDate2ZonedDateTime(CalendarUtils.java:422) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.util.CalendarUtils.convertDate2LocalDate(CalendarUtils.java:435) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.util.CalendarUtils.convertDate2LocalDate(CalendarUtils.java:427) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.util.CalendarUtils.getObjectAsLocalDate(CalendarUtils.java:87) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.component.datepicker.DatePicker.validateDateValue(DatePicker.java:215) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.component.datepicker.DatePicker.validateDateValue(DatePicker.java:211) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.component.datepicker.DatePicker.validateValueInternal(DatePicker.java:163) ~[primefaces-8.0.jar:8.0]
    at org.primefaces.component.datepicker.DatePicker.validateValue(DatePicker.java:126) ~[primefaces-8.0.jar:8.0]
    at javax.faces.component.UIInput.validate(UIInput.java:988) ~[jsf-api-2.2.20.jar:2.2]
    at org.primefaces.component.datepicker.DatePicker.validate(DatePicker.java:103) ~[primefaces-8.0.jar:8.0]
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1270) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIInput.processValidators(UIInput.java:714) ~[jsf-api-2.2.20.jar:2.2]
    at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:575) ~[jsf-impl-2.2.20.jar:2.2.20]
    at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) ~[jsf-impl-2.2.20.jar:2.2.20]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIForm.visitTree(UIForm.java:371) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) ~[jsf-api-2.2.20.jar:2.2]
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700) ~[jsf-api-2.2.20.jar:2.2]
    at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403) ~[jsf-impl-2.2.20.jar:2.2.20]
    at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266) [jsf-impl-2.2.20.jar:2.2.20]
    at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:65) [primefaces-8.0.jar:8.0]
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1193) [jsf-api-2.2.20.jar:2.2]
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) [jsf-impl-2.2.20.jar:2.2.20]
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.20.jar:2.2.20]
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.20.jar:2.2.20]
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658) [jsf-api-2.2.20.jar:2.2]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:145) [prettyfaces-jsf2-3.3.3.jar:?]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:226) [rewrite-servlet-3.4.1.Final.jar:3.4.1.Final]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:155) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) [spring-security-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:130) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:66) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:105) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:123) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.7.RELEASE.jar:5.1.7.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.36]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.36]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [catalina.jar:9.0.36]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.36]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.36]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.36]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.36]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) [catalina.jar:9.0.36]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.36]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.36]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) [tomcat-coyote.jar:9.0.36]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.36]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:9.0.36]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-coyote.jar:9.0.36]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.36]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_231]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_231]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.36]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
[WARN ] 2020-07-24 17:17:27.918 [http-nio-8080-exec-3] lifecycle - java.lang.UnsupportedOperationException
javax.faces.FacesException: java.lang.UnsupportedOperationException

Please, I will be very grateful if you could guide me to know why this happens.
Beforehand thank you very much.
Comment: Don't convert to java.sql.Date in your model... Bad design. Use the normal java dates not the sql ones!
Comment: If you create a small reproducible test case or MVCE I can help debug your issue. Use this project to create a small reproducer: https://github.com/primefaces/primefaces-test
Comment: Hello, thank you very much for the suggestions ... in terms of design, I have followed the instructions on the official Primefaces page, now with the update to PF8 I see that some things have changed but, the reality is that in PF7 it works correctly. I am trying to make a small example to reproduce it.
Comment: Did you check the imports in `org.primefaces.util.CalendarUtils`? The `Date date` in ZonedDateTime convertDate2ZonedDateTime (Date date, ZoneId zoneId)` is that really an sql one? I doubt it. But since it extends the normal `java.util.Date`, I'm 100% sure **YOU** use `java.sql.Date` somewhere.
Answer: I have found the cause of this, in my entity model, I did not notice that the date columns had the @Temporal(TemporalType.DATE) annotation, which I understand is mapped as a java.sql.Date not as a java.util.Date, this is why when you first loaded and referenced the minimum value directly from the loaded object, it marked the error. I removed these annotations and it works properly. Thank you all for your comments
Answer: I hope this will help, but the first test with prime calendar.
Your pattern="dd/MM/yyyy" does not show any information about zone.
Try like this pattern="yyyy-MM-dd HH:mm:ssZ"
If your model property LocalDate , pattern must be only date, if your model property is LocalDateTime put patterns like yyyy-MM-dd
Comment: Hi Armen, thank you very much... in my model property I defined the java.util.Date type, but, i don't understand, why in other view i have the same code and it works...


Does the Ocarina have a use asides from playing music?

Question: Does the Ocarina have a functional use asides from playing a random tune whenever you whip it out?
Answer: According to Gamerevolution it is just a Legend of Zelda Easter egg that plays a random tune.

Created using clay, a fairly valuable resource, the Animal Crossing:
  New Horizons ocarina requires quite an investment to craft. After
  putting in all that clay, surely the ocarina has some secret function
  and benefit? Well, it plays music…
Yep, at least at the time of writing, the only purpose of the ocarina
  is to play a tune. The ocarina plays random notes, with the player
  unfortunately not able to influence which sounds are used. It's just a
  random song.

And corroborated on the animal crossing wiki

It is made from clay, and plays random notes when interacted with. The
  relevant button can be held down to hold a note.
Comment: If only it could control time or the weather...


Where can I find information about Google Maps Single Search Box coverage?

Question: Where can I find a complete list of countries where Google Maps supports the single search box?
Answer: I'm not sure exactly what you are asking, but the listing of the API coverage offered by Google Maps is at: Google Maps API Coverage


Can't stack flex items vertically even after using flex-wrap

Question: I'm using flexbox to align 3 items horizontally. The 3 aside items under the section element with the class of .main are aligned across when the viewport is the size of the desktop's.
I want for the three flex-items to stack vertically on top of each other as I manually shrink the viewport on my desktop browser.
I've used display: flex for the parent container as well as flex-direction: row flex-wrap: wrap
My problem is that as I shrink the viewport width, the three flex-items just get narrower as they're next to each other. They don't stack vertically as expected.
Any ideas would help!
here's the html
<!DOCTYPE HTML>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel ="stylesheet" href = "screen.css">
        <title>Creating a Responsive Web Design</title>

Add interest with natural textures

                    Get advice from top designers

What's trending

Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.

Where to find it

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Lorem ipsum dolor sit amet, consect.

Tools of the trade

Nullam sit amet enim. Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci rhoncus neque, id pulvinar odio.

Creating a modern atmosphere

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Lorem ipsum dolor sit amet etuer adipiscing elit.  Pulvinar odio lorem non turpis. Nullam sit amet enim lorem.

                    Learn More

How-To: Seating

Consectetuer adipiscing elit. Morbi commodo ipsum sed gravida orci magna rhoncus pulvinar odio lorem.

                        Learn more

How-To: Lighting

Morbi commodo, ipsum sed pharetra gravida magna rhoncus neque id pulvinar odio lorem non turpis nullam sit amet.

                        Learn more

Lorem ipsum dolor sit amet conse ctetuer adipiscing elit. Morbi comod sed dolor sit amet consect adipiscing elit.

Author Name Business Title Company

                        About Us

                                sub-link-one

                                sub-link-two

                                sub-link-three

                                        sub-sub-link-one

                                        sub-sub-link-two

                        Design Corner

                                sub-link-one

                                sub-link-two

                        Products

                        Contact us

Here's the css:
/* CSS Document for Screens */
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
@import 'reset.css';

/* apply a natural box layout model to all elements, but allowing components to change */

*, *:before, *:after {
  box-sizing: inherit;
}
html{
  box-sizing: border-box;
  font-size: 16px;
}

body{
  font-family: 'Open Sans', sans-serif;
}

#page{
  margin: 2em;
}
h1, h2, h3, h4{
  font-weight: 700;
}
h1{
  margin: 0 0 1em 0;
  font-size: 2.8em;
}

h2{
  margin: 0 0 0.5em 0;
  font-size: 1.6em;
}

h3{
  font-size: 1.3em;
  margin: 0 0 0.5em 0;
}

h4{
  font-size: 1em;
  margin: 0 0 1.5em 0;
}

p{
  margin: 0 0 1em 0;
}

a{
  color: #007eff;
}
a:visited{
  color: #65b1ff
}

/*header styles*/
header{
  background: url('graphics/banner_1200.jpg') center center/cover no-repeat;
  display: flex;
  height: 430px;
  justify-content: space-around;
  /*padding: 2em;*/
}

.logo{
  height: 66px;
  width: 160px;
}

.hero{
  flex-basis: 42%;
  align-self: center;
}

.hero h1{
  color: #fff;
  line-height: 1.05em;
}

/*Section styles*/
.main{
  margin: 4em;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}
.main aside{
  padding: 0 1%;
  flex-basis: 30%;
}

.main aside .content h3{
  margin-bottom: 1.45em;
}
.main aside .content p{
  line-height: 1.5em;
}

Answer: Give them a min-width
.main aside{
  padding: 0 1%;
  flex-basis: 30%;
  min-width: 300px;
}

Sample

/* CSS Document for Screens */
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
@import 'reset.css';

/* apply a natural box layout model to all elements, but allowing components to change */

*, *:before, *:after {
  box-sizing: inherit;
}
html{
  box-sizing: border-box;
  font-size: 16px;
}

body{
  font-family: 'Open Sans', sans-serif;
}

#page{
  margin: 2em;
}
h1, h2, h3, h4{
  font-weight: 700;
}
h1{
  margin: 0 0 1em 0;
  font-size: 2.8em;
}

h2{
  margin: 0 0 0.5em 0;
  font-size: 1.6em;
}

h3{
  font-size: 1.3em;
  margin: 0 0 0.5em 0;
}

h4{
  font-size: 1em;
  margin: 0 0 1.5em 0;
}

p{
  margin: 0 0 1em 0;
}

a{
  color: #007eff;
}
a:visited{
  color: #65b1ff
}

/*header styles*/
header{
  background: url('graphics/banner_1200.jpg') center center/cover no-repeat;
  display: flex;
  height: 430px;
  justify-content: space-around;
  /*padding: 2em;*/
}

.logo{
  height: 66px;
  width: 160px;
}

.hero{
  flex-basis: 42%;
  align-self: center;
}

.hero h1{
  color: #fff;
  line-height: 1.05em;
}

/*Section styles*/
.main{
  margin: 4em;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}
.main aside{
  padding: 0 1%;
  flex-basis: 30%;
  min-width: 300px;
}

.main aside .content h3{
  margin-bottom: 1.45em;
}
.main aside .content p{
  line-height: 1.5em;
}
<!DOCTYPE HTML>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel ="stylesheet" href = "screen.css">
        <title>Creating a Responsive Web Design</title>

Add interest with natural textures

                    Get advice from top designers

What's trending

Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.

Where to find it

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Lorem ipsum dolor sit amet, consect.

Tools of the trade

Nullam sit amet enim. Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci rhoncus neque, id pulvinar odio.

Creating a modern atmosphere

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Lorem ipsum dolor sit amet etuer adipiscing elit.  Pulvinar odio lorem non turpis. Nullam sit amet enim lorem.

                    Learn More

How-To: Seating

Consectetuer adipiscing elit. Morbi commodo ipsum sed gravida orci magna rhoncus pulvinar odio lorem.

                        Learn more

How-To: Lighting

Morbi commodo, ipsum sed pharetra gravida magna rhoncus neque id pulvinar odio lorem non turpis nullam sit amet.

                        Learn more

Lorem ipsum dolor sit amet conse ctetuer adipiscing elit. Morbi comod sed dolor sit amet consect adipiscing elit.

Author Name Business Title Company

                        About Us

                                sub-link-one

                                sub-link-two

                                sub-link-three

                                        sub-sub-link-one

                                        sub-sub-link-two

                        Design Corner

                                sub-link-one

                                sub-link-two

                        Products

                        Contact us

Or use a media query to switch the flex direction
@media screen and (max-width: 600px) {
  .main{
    flex-direction: column;
  }
}

Sample

/* CSS Document for Screens */
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
@import 'reset.css';

/* apply a natural box layout model to all elements, but allowing components to change */

*, *:before, *:after {
  box-sizing: inherit;
}
html{
  box-sizing: border-box;
  font-size: 16px;
}

body{
  font-family: 'Open Sans', sans-serif;
}

#page{
  margin: 2em;
}
h1, h2, h3, h4{
  font-weight: 700;
}
h1{
  margin: 0 0 1em 0;
  font-size: 2.8em;
}

h2{
  margin: 0 0 0.5em 0;
  font-size: 1.6em;
}

h3{
  font-size: 1.3em;
  margin: 0 0 0.5em 0;
}

h4{
  font-size: 1em;
  margin: 0 0 1.5em 0;
}

p{
  margin: 0 0 1em 0;
}

a{
  color: #007eff;
}
a:visited{
  color: #65b1ff
}

/*header styles*/
header{
  background: url('graphics/banner_1200.jpg') center center/cover no-repeat;
  display: flex;
  height: 430px;
  justify-content: space-around;
  /*padding: 2em;*/
}

.logo{
  height: 66px;
  width: 160px;
}

.hero{
  flex-basis: 42%;
  align-self: center;
}

.hero h1{
  color: #fff;
  line-height: 1.05em;
}

/*Section styles*/
.main{
  margin: 4em;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
}
.main aside{
  padding: 0 1%;
  flex-basis: 30%;
}

.main aside .content h3{
  margin-bottom: 1.45em;
}
.main aside .content p{
  line-height: 1.5em;
}

@media screen and (max-width: 600px) {
  .main{
    flex-direction: column;
  }
}
<!DOCTYPE HTML>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel ="stylesheet" href = "screen.css">
        <title>Creating a Responsive Web Design</title>

Add interest with natural textures

                    Get advice from top designers

What's trending

Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis.

Where to find it

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Lorem ipsum dolor sit amet, consect.

Tools of the trade

Nullam sit amet enim. Lorem ipsum dolor sit amet, consect etuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci rhoncus neque, id pulvinar odio.

Creating a modern atmosphere

Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Lorem ipsum dolor sit amet etuer adipiscing elit.  Pulvinar odio lorem non turpis. Nullam sit amet enim lorem.

                    Learn More

How-To: Seating

Consectetuer adipiscing elit. Morbi commodo ipsum sed gravida orci magna rhoncus pulvinar odio lorem.

                        Learn more

How-To: Lighting

Morbi commodo, ipsum sed pharetra gravida magna rhoncus neque id pulvinar odio lorem non turpis nullam sit amet.

                        Learn more

Lorem ipsum dolor sit amet conse ctetuer adipiscing elit. Morbi comod sed dolor sit amet consect adipiscing elit.

Author Name Business Title Company

                        About Us

                                sub-link-one

                                sub-link-two

                                sub-link-three

                                        sub-sub-link-one

                                        sub-sub-link-two

                        Design Corner

                                sub-link-one

                                sub-link-two

                        Products

                        Contact us

Answer: Looks like you confused flex-direction: row with flex-direction: column! If you want to stack them in a column, use the column flex direction :)
Comment: yup! had that in mind for the media queries when the device is in mobile :)


loading with simple opengl image library(SOIL) an image(color space: GRAY)

Question: I want to read out the pixel values of an grey scale image. With RGB images I have no problems. The code is just simply:
int width, height;
unsigned char* image = SOIL_load_image(filepath.c_str(), &width, &height, 0, SOIL_LOAD_RGB);
std::cout << "size of image : " << size  << " width: " << width << " height: " << height << std::endl;

Now I want to load an image(png) with color space GRAY, I thought I could simply change SOIL_LOAD_RGB to SOIL_LOAD_L but that don't work out.
My output on the console is:
size of image : -237407992 width: 10 height: -1312230988
And it is not constant. Only the width stays 10, and the height is changing every time I run the program.
Is there something I have to change or consider when working with gray scale images?
Comment: language is c++. I added a tag
Answer: You should change the third parameter from '0' to '&channel', like this
unsigned char *image = SOIL_load_image(filepath.c_str(), &width, &height, &channel, SOIL_LOAD_L);


collapse button : working offline with bootstrap 3

Question: i have a problem with bootstrap 3.
I wanted to make a responsive navbar, but when i make the page smaller, and the button is shown, unfortunatly it doesn't react to the click event, though  i added the bootstrap.js and jquery.js
Here is the code

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Toggle navigation

            </button>
            Service Medicale

 Home

 Not

 Login

any idea why it's not working? do i need another js file to make it happen ?
PS : do not mind the "th:*" tags, i'm using thymeleaf
EDIT:
The code above work normally when i include the jquery.min.js and bootstrap.min.js files with links (internet needed) but when i download them and try to add them locally (offline), the button doesn't work , any ideas why ?
Comment: Looks ok on bootply http://www.bootply.com/zzi8Gmd9Ya
Comment: then what's the problem ? i already had included jquery.js and bootstrap.min.js in my html file, and i had tested it on jsfiddle and it worked too, but when i run it on glassfish using intellij (i'm making a web app with spring mvc 4 and hibernate ...), the button just doesn't react to the click
Answer: Please see here your html code is fine make sure that you have in header reference to those 2 scripts:

Comment: i already had included jquery.min.js and bootstrap.min.js in my html file, and i had tested it on jsfiddle and it worked too, but when i run it on glassfish using intellij (i'm making a web app with spring mvc 4 and hibernate ...), the button just doesn't react to the click
Comment: @Aissasa please check order jQuery has to be before bootstrap
Comment: i found the problem, when i include an offline version of the js files (which is a necessity for the purpuse of the app i'm working on) it doesn't work, but when i use the online versions (with the lines above) it works, so my question now: is there a difference between the two approches and how make it work locally (offline), and thank you :)
Comment: Just copy those scripts to your local drive and add the local reference
Comment: that's what i did but it's not working for me, i don't understand why
Comment: can you please add to your question page header tag ?


External HDMI display on Ubuntu 16.04, NVIDIA GeForce GTX 960M

Question: My Dell Inspiron 7566 laptop with Ubuntu 16.04 can't detect external monitor Dell W2709 connected to HDMI port.
I tried:

booting with the display connected,
connecting display after login,
disconnecting and connecting again
System settings/Displays/Detect Displays

Nothing works, the display stays in power save mode, which is it's usual behavior when getting no signal. And the laptop doesn't realize the display is connected to HDMI.
On Windows partition the same display connected with the same HDMI cable connected to the same HDMI port got recognized right away, so the hardware is ok.
Graphic units on board: NVIDIA GeForce GTX 960M + Intel HD Graphics 530.
NVIDIA X Server Settings claim both work fine. It doesn't detect any external display though.
I found several suggestions for similar problems, generally falling into two categories: update the kernel or/and try different graphic drivers.
I tried do both. As for kernel, I believe my initial one which came with Ubuntu 16.04 was 4.4.0 or so. I went up trying several versions, including 4.4.8, 4.8.1, 4.8.17 and I ended up on the fresh 4.9.9.
As for graphic drivers, I've bee trying several tutorials, and at some point I ended up with this collection:

I tried all of those drivers, and I believe those are the newest ones NVIDIA offers. Fortunatelly nothing got broken with all those attempts, but unfortunatelly the problem is still not resolved.
I've been trying to use xrandr too, I found that "HDMI-1-1 disconnected".
Adding an new resolution 1920x1200 for my external display and trying to force it with arandr ended up with unusable unity on my primary laptop display, fortunatelly it recovered with a reboot.
I will appreciate any suggestions, yet other drivers to try, or maybe other more exotic step-by-step instructions. I got this laptop expecially for my work, and I need to have the external display for it badly. Thanks!
UPDATE: I found a way to get the external monitor DELL 2709W working with my Ubuntu. However peculiar and non-usable it is, it may be a hint to find a real solution:

This method requires another laptop(!) connected to another port of the display. In my case it is a MacBookPro with an adapter, connected to one of DVI ports. This is to keep the display on - it has to actually display anything on screen.
Using Dell monitor controls, I disabled the DDC/CI mode
Using Dell monitor controls, I select the DVI port, so I can see the other system displayedr
I boot up Ubuntu while it is connected with the Dell monitor with HDMI cable, and I log in to unity
Now when I open System Settings/Displays, I can see the secondary display 'Dell Inc. 27"'
Using the Dell monitor controls I switch to HDMI, and voila - I can see the extended desktop
Only when I let the Ubuntu laptop fall asleep for a minute, or worse - turn it off, the extended desktop is gone and I have to do the whole procedure again to get it back. Hence - it's not a way to work.. but maybe it's a hint to any display/graphics hardware expert, how I could better deal with it?

This is the xrandr report with the HDMI cable plugged in to the laptop and HDMI port of the monitor, and the HDMI source selected for the monitor (and the monitor sleeps):
$ xrandr --verbose
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1 connected primary 1920x1080+0+0 (0x46) normal (normal) 344mm x 193mm
Identifier: 0x42
Timestamp:  20511
Subpixel:   unknown
Gamma:      1.0:1.0:1.0
Brightness: 1.0
Clones:
CRTC:       0
CRTCs:      0 1 2
Transform:  1.000000 0.000000 0.000000
            0.000000 1.000000 0.000000
            0.000000 0.000000 1.000000
           filter:
EDID:
    00ffffffffffff000daec41500000000
    2b1901049522137802ef059054529329
    25505400000001010101010101010101
    0101010101015e358096703814402c1c
    240058c11000001ab22a809670381440
    2c1c240058c11000001a000000fe0038
    4b563432003135364847450a00000000
    0000413196000000000a010a20200021
scaling mode: Full aspect
    supported: None, Full, Center, Full aspect
Broadcast RGB: Automatic
    supported: Automatic, Full, Limited 16:235
audio: auto
    supported: force-dvi, off, auto, on
1920x1080 (0x46) 136.620MHz +HSync -VSync *current +preferred
    h: width  1920 start 1964 end 1992 total 2070 skew    0 clock  66.00KHz
    v: height 1080 start 1082 end 1086 total 1100           clock  60.00Hz
1920x1080 (0x47) 138.500MHz +HSync -VSync
    h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  66.59KHz
    v: height 1080 start 1083 end 1088 total 1111           clock  59.93Hz
1920x1080 (0x48) 109.300MHz +HSync -VSync
    h: width  1920 start 1964 end 1992 total 2070 skew    0 clock  52.80KHz
    v: height 1080 start 1082 end 1086 total 1100           clock  48.00Hz
1680x1050 (0x49) 146.250MHz -HSync +VSync
    h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
    v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
1680x1050 (0x4a) 119.000MHz +HSync -VSync
    h: width  1680 start 1728 end 1760 total 1840 skew    0 clock  64.67KHz
    v: height 1050 start 1053 end 1059 total 1080           clock  59.88Hz
1600x1024 (0x4b) 103.125MHz +HSync +VSync
    h: width  1600 start 1600 end 1656 total 1664 skew    0 clock  61.97KHz
    v: height 1024 start 1024 end 1029 total 1030           clock  60.17Hz
1400x1050 (0x4c) 122.000MHz +HSync +VSync
    h: width  1400 start 1488 end 1640 total 1880 skew    0 clock  64.89KHz
    v: height 1050 start 1052 end 1064 total 1082           clock  59.98Hz
1280x1024 (0x4d) 108.000MHz +HSync +VSync
    h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
    v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
1440x900 (0x4e) 106.500MHz -HSync +VSync
    h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
    v: height  900 start  903 end  909 total  934           clock  59.89Hz
1280x960 (0x4f) 108.000MHz +HSync +VSync
    h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
    v: height  960 start  961 end  964 total 1000           clock  60.00Hz
1360x768 (0x50) 84.750MHz -HSync +VSync
    h: width  1360 start 1432 end 1568 total 1776 skew    0 clock  47.72KHz
    v: height  768 start  771 end  781 total  798           clock  59.80Hz
1360x768 (0x51) 72.000MHz +HSync -VSync
    h: width  1360 start 1408 end 1440 total 1520 skew    0 clock  47.37KHz
    v: height  768 start  771 end  781 total  790           clock  59.96Hz
1152x864 (0x52) 81.620MHz -HSync +VSync
    h: width  1152 start 1216 end 1336 total 1520 skew    0 clock  53.70KHz
    v: height  864 start  865 end  868 total  895           clock  60.00Hz
1024x768 (0x53) 133.475MHz -HSync +VSync DoubleScan
    h: width  1024 start 1100 end 1212 total 1400 skew    0 clock  95.34KHz
    v: height  768 start  768 end  770 total  794           clock  60.04Hz
1024x768 (0x54) 65.000MHz -HSync -VSync
    h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
    v: height  768 start  771 end  777 total  806           clock  60.00Hz
960x720 (0x55) 117.000MHz -HSync +VSync DoubleScan
    h: width   960 start 1024 end 1128 total 1300 skew    0 clock  90.00KHz
    v: height  720 start  720 end  722 total  750           clock  60.00Hz
928x696 (0x56) 109.150MHz -HSync +VSync DoubleScan
    h: width   928 start  976 end 1088 total 1264 skew    0 clock  86.35KHz
    v: height  696 start  696 end  698 total  719           clock  60.05Hz
896x672 (0x57) 102.400MHz -HSync +VSync DoubleScan
    h: width   896 start  960 end 1060 total 1224 skew    0 clock  83.66KHz
    v: height  672 start  672 end  674 total  697           clock  60.01Hz
960x600 (0x58) 77.000MHz +HSync -VSync DoubleScan
    h: width   960 start  984 end 1000 total 1040 skew    0 clock  74.04KHz
    v: height  600 start  601 end  604 total  617           clock  60.00Hz
960x540 (0x59) 69.250MHz +HSync -VSync DoubleScan
    h: width   960 start  984 end 1000 total 1040 skew    0 clock  66.59KHz
    v: height  540 start  541 end  544 total  555           clock  59.99Hz
800x600 (0x5a) 81.000MHz +HSync +VSync DoubleScan
    h: width   800 start  832 end  928 total 1080 skew    0 clock  75.00KHz
    v: height  600 start  600 end  602 total  625           clock  60.00Hz
800x600 (0x5b) 40.000MHz +HSync +VSync
    h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
    v: height  600 start  601 end  605 total  628           clock  60.32Hz
800x600 (0x5c) 36.000MHz +HSync +VSync
    h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
    v: height  600 start  601 end  603 total  625           clock  56.25Hz
840x525 (0x5d) 73.125MHz -HSync +VSync DoubleScan
    h: width   840 start  892 end  980 total 1120 skew    0 clock  65.29KHz
    v: height  525 start  526 end  529 total  544           clock  60.01Hz
840x525 (0x5e) 59.500MHz +HSync -VSync DoubleScan
    h: width   840 start  864 end  880 total  920 skew    0 clock  64.67KHz
    v: height  525 start  526 end  529 total  540           clock  59.88Hz
800x512 (0x5f) 51.562MHz +HSync +VSync DoubleScan
    h: width   800 start  800 end  828 total  832 skew    0 clock  61.97KHz
    v: height  512 start  512 end  514 total  515           clock  60.17Hz
700x525 (0x60) 61.000MHz +HSync +VSync DoubleScan
    h: width   700 start  744 end  820 total  940 skew    0 clock  64.89KHz
    v: height  525 start  526 end  532 total  541           clock  59.98Hz
640x512 (0x61) 54.000MHz +HSync +VSync DoubleScan
    h: width   640 start  664 end  720 total  844 skew    0 clock  63.98KHz
    v: height  512 start  512 end  514 total  533           clock  60.02Hz
720x450 (0x62) 53.250MHz -HSync +VSync DoubleScan
    h: width   720 start  760 end  836 total  952 skew    0 clock  55.93KHz
    v: height  450 start  451 end  454 total  467           clock  59.89Hz
640x480 (0x63) 54.000MHz +HSync +VSync DoubleScan
    h: width   640 start  688 end  744 total  900 skew    0 clock  60.00KHz
    v: height  480 start  480 end  482 total  500           clock  60.00Hz
640x480 (0x64) 25.175MHz -HSync -VSync
    h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
    v: height  480 start  490 end  492 total  525           clock  59.94Hz
680x384 (0x65) 42.375MHz -HSync +VSync DoubleScan
    h: width   680 start  716 end  784 total  888 skew    0 clock  47.72KHz
    v: height  384 start  385 end  390 total  399           clock  59.80Hz
680x384 (0x66) 36.000MHz +HSync -VSync DoubleScan
    h: width   680 start  704 end  720 total  760 skew    0 clock  47.37KHz
    v: height  384 start  385 end  390 total  395           clock  59.96Hz
576x432 (0x67) 40.810MHz -HSync +VSync DoubleScan
    h: width   576 start  608 end  668 total  760 skew    0 clock  53.70KHz
    v: height  432 start  432 end  434 total  447           clock  60.06Hz
512x384 (0x68) 32.500MHz -HSync -VSync DoubleScan
    h: width   512 start  524 end  592 total  672 skew    0 clock  48.36KHz
    v: height  384 start  385 end  388 total  403           clock  60.00Hz
400x300 (0x69) 20.000MHz +HSync +VSync DoubleScan
    h: width   400 start  420 end  484 total  528 skew    0 clock  37.88KHz
    v: height  300 start  300 end  302 total  314           clock  60.32Hz
400x300 (0x6a) 18.000MHz +HSync +VSync DoubleScan
    h: width   400 start  412 end  448 total  512 skew    0 clock  35.16KHz
    v: height  300 start  300 end  301 total  312           clock  56.34Hz
320x240 (0x6b) 12.587MHz -HSync -VSync DoubleScan
    h: width   320 start  328 end  376 total  400 skew    0 clock  31.47KHz
    v: height  240 start  245 end  246 total  262           clock  60.05Hz
DP-1 disconnected (normal)
Identifier: 0x43
Timestamp:  20511
Subpixel:   unknown
Clones:     HDMI-1
CRTCs:      0 1 2
Transform:  1.000000 0.000000 0.000000
            0.000000 1.000000 0.000000
            0.000000 0.000000 1.000000
           filter:
Broadcast RGB: Automatic
    supported: Automatic, Full, Limited 16:235
audio: auto
    supported: force-dvi, off, auto, on
HDMI-1 disconnected (normal)
Identifier: 0x44
Timestamp:  20511
Subpixel:   unknown
Clones:     DP-1
CRTCs:      0 1 2
Transform:  1.000000 0.000000 0.000000
            0.000000 1.000000 0.000000
            0.000000 0.000000 1.000000
           filter:
aspect ratio: Automatic
    supported: Automatic, 4:3, 16:9
Broadcast RGB: Automatic
    supported: Automatic, Full, Limited 16:235
audio: auto
    supported: force-dvi, off, auto, on

Comment: In your BIOS/UEFI settings, did you try setting the video to discrete only instead of integrated or hybrid?
Comment: Unfortunatelly I haven't found any option to choose the video in my BIOS. As for my UEFI - it is omited on boot... my laptop originally had Windows system with Windows bootup UEFI, and the only option to start Ubuntu that I managed was to start with legacy BIOS. When I reactivate UEFI, it tells me to recover WIndows.

It all means I cannot choose or switch on/off my graphic units on boot. I can only choose it after logging in to Ubuntu, and then I don't really have any problem doing so - both the integrated Intel graphics and the NVIDIA unit works well after I restart.
Comment: I'm not an expert, but IMO the experimeint I've put above as UPDATE suggests, that the Dell monitor is actually capable of working together with my laptop. Only once it goes into some nasty sleep mode, the laptop cannot wake it up or even detect it. What would be nice, is a low level terminal command, which would force a wakeup signal sent on the HDMI port, so that the monitor would wake up and could be communicated with. Do you know of any such low-level display commands / signals being available from Ubuntu terminal?
Comment: When I switch to Windows, it is able to wake up the monitor and use it even during the start of the system. So I would say Windows is sending such wakeup / turn-on signal, which is missing on Ubuntu boot up, so I would love to be able to send it myself afterwards... if this diagnose would be correct by any chance.
Comment: Recently I connected this Dell laptop to a ASUS PB328Q monitor HDMI port. I've been testing this setup both on Ubuntu 14.04 and Ubuntu 16.10. The symptoms were quite the same as in case of the Dell 2709W monitor described above: System Settings/Displays/Detect Displays didn't detect any external monitor, it only showed the Build-in Display.
Comment: I am confident that hardware part is not an issue here - the HDMI cable I use, the HDMI laptop port and the monitor can communicate and the monitor got detected instantly by Windows 10. I need and want to use Ubuntu though - any help is appreciated.
Answer: I had exactly the same problem with a Laptop HP Pavillion and a GEFORCE GTX 960M. I had problems with the HDMI with both a TV and a beamer.
I finally solved it by installing the latest version of the open source drivers (nvidia-390 at the time of this post).
These steps should do the job: first clean up any eventual mess that there might be by doing
apt-get purge nvidia*

and then you can do the actual installation
add-apt-repository ppa:graphics-drivers/pp
apt update
apt-get install nvidia-387

After rebooting in principle you should obtain a non empty output to
lsmod | grep nvidia

but in my case it was empty and that was why it wasn't working. At the boot Linux wasn't loading the relevant modules. This was UEFI secure boot's fault. Apparently the secure boot didn't like the open source drivers and blocked them from being loaded. This can be fixed by going to the BIOS and disabling it (see here for a more thorough explanation https://askubuntu.com/a/762255).
If it still doesn't work you can try to look for these two possible issues:

Some other drivers are not blacklisted, e.g. nouveau (https://askubuntu.com/a/951892)
The file /etc/X11/xorg.conf isn't there. If so generate it with nvidia-xconfig
Answer: @marek I have the same laptop and the same issue and I managed to fix it.
To be honest I'm not 100% sure where the culprit lies, but you can try a few things
Try installing the latest nvidia 36* driver, on my install it is 367 but yours might be different. You can check my running this from the command line
sudo apt-cache search '^nvidia-[:digit]' --names-only

Also try installing the nvidia-prime driver, which is for optimus range of nvidia cards, which this laptop has.
Try installing the latest 4.4.* kernel, on my version it is 4.4.25.
Finally, check if your external monitor supports sound as well as audio on the hdmi cable. Mine does and i think that is what caused the problem for me. When I switched the hdmi to hdmi cable to an hdmi to dvi cable, things started working.
Comment: Thank you very much for your answer. You will find it hard to believe, but after a few months, many evenings spend trying, I still didn't get it working. As a result, I have quite a powerful machine which I cannot use for my work, instead I am using an old Mac, because that one can handle the secondary Screen. Quite resigned on this situation.
Comment: My current version if kernel is 4.8.0. I use nvidia-375 driver. I tried to connect several HDMI newly bought 32" screens - one ASUS, one BENQ, and one AOC, with native resolutions of  2560x1440 - none detected on Ubuntu (no problem on Windows). I installed several other versions of nvidia driver, kernels, Ubuntu versions, clean installs, even tried Mint - all for nothing. I went trough hundreds of similar problems on this and other forums, tried all proposed solutions, nothing worked for me. I really cannot understand how it can be working for anybody else (sooner or later), just not for me.
Comment: I tried a hdmi to dvi dongle too, hoping that it will run on DVI which I am using currently with my Mac - it did not do the trick.
Comment: I am not sure about the sound support in my external monitor - it does not  have any speakers, so it cannot generate any sound by itself, but it has some sound output, probably directing the sound received through HDMI/DP (if it worked).
Answer: I was also trying to connect an external HDMI monitor to my system but was not happening. So I changed setting in BIOS to enable Virtualization Environment and it worked. It was detected in windows but not on ubuntu so BIOS is the option to change.
Comment: Virtualization support has nothing to do with a monitor being detected or not.