text:
Q: Does a Lipschitz continuous function have one-sided derivatives everywhere? Let $f\colon\mathbb R\to\mathbb R$ satisfy the Lipschitz condition: there exists $K\geq 0$ such that for all $x,y\in\mathbb R$, we have $|f(x)-f(y)|\leq K\cdot |x-y|$. Is it true that $f$ has one-sided derivatives everywhere? I.e., that the limits
$$\lim_{h\nearrow 0}\frac{f(x+h)-f(x)}{h}\quad\text{and}\quad\lim_{h\searrow 0}\frac{f(x+h)-f(x)}{h}$$
exist for every $x$?
I know that both exist a.e. since the Lipschitz condition implies that $f$ is differentiable a.e., but I would like to know if it is not only true a.e., but everywhere. After working with this for some time, I got the feeling that it might be.

A: No. Counterexample:
Let $g : [1,2] \to \mathbb R$ be the graph which linearly connects the points
$$(1, 1), (1.5, -1.5), (2, 2).$$
Define $f [0,1] \to \mathbb R$ be
$$f(x) = \begin{cases} 0 & \text{if } x=0,\\ \frac{1}{2^{n+1}}\  g(2^{n+1} x) &\text{if }x\in [2^{-(n+1)}, 2^{-n}), n =0, 1, 2\cdots.\\
\end{cases}$$
Then $f$ is Lipschitz since it has bounded derivatives (except at some countable points where the derivatives does not exists). However,
$$\lim_{h\to 0^+} \frac{f(h) - f(0)}{h}$$
does not exist since
$$ \frac{f(2^{-(n+1)}) - f(0)}{2^{-(n+1)}}  =1, \ \ \ \frac{f(2^{-(n+1)} 1.5) - f(0)}{2^{-(n+1)} 1.5} = -1$$

A: Let
$$ f(x)=\begin{cases}x\sin\frac1x&0<|x|<\frac1\pi\\0&\text{otherwise}\end{cases}$$
Then $f$ is Lipschitz, but none of the one-sided derivatives exists at $x=0$.


text:
Q: Ошибка в преоброзавании строки в float Console.WriteLine("Выберите коэфицент - от 1.1x до 3x");
float k = Convert.ToSingle(Console.ReadLine());

После того как я ввёл значение с точкой (например 1.5) получается ошибка
"Unhandled exception. System.FormatException: Input string was not in a correct format."

redpajama_set_name: RedPajamaStackExchange


text:
Q: RawQuery data cursor showing empty field I try to pull data from database by using RawQuery method, but it seems I get empty rows. Actually data is present in the database which I am try to pull. Can anyone find my mistake?
db = dbhelper.getReadableDatabase();

String selectSQL = "Select * from " + Wish_list_Table.TABLE_NAME
                + " where " + Wish_list_Table.COL_CATEGORY + " = ?";

String[] add = { " HOME" };

TextView textView = getGenericView();
Cursor selectdata = db.rawQuery(selectSQL, add);
Log.i("select", "" + selectdata.getCount());

This class for database table property......
public static abstract class Wish_list_Table implements BaseColumns {
    public static final String TABLE_NAME = "WISH_LIST1";
    public static final String COL_NAME = "NAME";
    public static final String COL_TIME = "TIME";

    public static final String COL_DATE = "DATE";
    public static final String COL_CATEGORY = "CATEGORY";

    public static final String COL_DESC = "DESC";

}

this is DATABASE IMAGE...

A: Look at this:
String[] add = { " HOME" };

Don't you see there's a SPACE before "HOME"?
It will never match the values in the db!
So you'll always get an empty Cursor.
Replace that statement with this:
String[] add = { "HOME" };

And you'll get all the records where CATEGORY equals 'HOME'

A: try some thing like the following :
   String[] add = { "HOME" };

        String [] columns = {"NAME" , "CATEGORY"};

        Cursor cursor = db.query(Wish_list_Table.TABLE_NAME, columns,  Wish_list_Table.COL_CATEGORY + " = ?", add, null, null, null)

            while(cursor.moveToNext()){
                String name = cursor.getString(cursor.getColumnIndex(ArrayList_table.COL_NAME));
                textView.setText(name);
            }
            cursor.close();

but make sure the data in the database is present .


text:
Q: Show a single cell data from sql Php and sql is new to me.So I face a simple problem.
My table name is student_table(id,s_name).Now I want to select the id of 'Shakib'.
My code :
<?php
        $username="root";
        $password="";
        $database="mydb";
        mysql_connect('localhost',$username,$password);
        @mysql_select_db($database) or die( "Unable to select database");

        $query2="SELECT id from student_table where s_name = 'Shakib'";
        $result2=mysql_query($query2);

        echo $result2;

When I run this code it shows "Resource id #4" .
Please help me how I can show the id of 'Shakib'?

A: Try this:
$query=mysql_query($query2);
while($row=mysql_fetch_array($query))
{
   echo $row['id'];
}

According to php docs:
 mysql_query() sends a unique query (multiple queries are not supported) to
 the currently active database on the server that's associated with the
 specified link_identifier.

It doesn't executes the query "Resource id #4 is actually the reference to that query. To execute that query and get the result you have to use mysql_fetch_array.

A: If you are expecting only one row result then you can use:
$id = mysql_result($result2,0,0);


text:
Q: Browser detect downloads I am a VB.NET programmer and am wanting to make a simple application that will load when a download link is clicked in a browser. I am also wanting to filename of the download link.
I know applications like GetRight and other software do this.
How is the best way to do this? Is there some simple source code that I can have a look at to start on this?
thanks


text:
Q: Arbitrary number of nested-loops? I'm looking to take an arbitrary number of lists (e.g. [2, 1, 4 . . .], [8, 3, ...], . . .) and pick numbers from each list in order to generate all permutations. E.g.:
[2, 8, ...],
[2, 3, ...],
[1, 8, ...],
[1, 3, ...],
[4, 8, ...],
[4, 3, ...],
   ...
This is easily accomplished using nested for-loops, but since I'd like to it accept an arbitrary number of lists it seems that the for-loops would have to be hard coded. One for each list. Also, as my program will likely generate many tens of thousands of permutations, I'l like to generate a single permutation at a time (instead of computing them all in one go and storing the result to a vector). Is there a way to accomplish this programatically?
Since the number of lists is know at compile time, I thought maybe I could use template based meta-programming. However that seems clumsy and also doesn't meet the "one at a time" requirement. Any suggestions?

A: You can use fundamental principal of counting, like incrementing the last digit till it reaches its max value, then increment the second last one and so on, like a countdown does
Here is a sample code, assuming there might be diff length of diff lists.
#include <iostream>
using namespace std;
int main() {
    int n;
    cin>>n;
    int a[n], len[n],i,j;
    for(i = 0 ; i < n ; i++)
    {
        cin>>len[i];
        a[i]=0;
    }
    while(1)
    {
        for(i = 0 ; i< n;i++)
            cout<<a[i]<<" ";
        cout<<endl;
        for(j = n-1 ; j>=0 ; j--)
        {
            if(++a[j]<=len[j])
                break;
            else
                a[j]=0;
        }
        if(j<0)
            break;
    }
    return 0;
}

Try to run the code with 4 1 1 1 1 and it will give all 4 digit permutations of 0 and 1.
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1

You can use 2d arrays for getting combinations of nos.

A: The recursive way ...
void Recurse(const vector<vector<int>>& v,
             size_t listToTwiddle,
             vector<int>& currentPermutation)
{
    // terminate recursion
    if (listToTwiddle == v.size())
    {
        for(auto i = currentPermutation.cbegin(); i != currentPermutation.cend(); ++i)
        {
            cout << *i << " ";
        }
        cout << endl;
        return;
    }

    for(size_t i = 0; i < v[listToTwiddle].size(); ++i)
    {
        // pick a number from the current list
        currentPermutation.push_back(v[listToTwiddle][i]);

        // get all permutations having fixed this number
        Recurse(v, listToTwiddle + 1, currentPermutation);

        // restore back to original state
        currentPermutation.pop_back();
    }
}

void Do(const vector<vector<int>>& v)
{
    vector<int> permutation;
    Recurse(v, 0, permutation);
}

A: The STL did not have a ready-made function for this, but you may be able to write your own implementation by modifying some parts of next_permutation.
The problem is analogous to implement a binary digit adder. Increment array[0]. If the new value of array[0] overflows (meaning that its value is greater than the number of lists you have) then set array[0] to zero and increment array[1]. And so on.

A: Amusing.
What you seem to wish for is actually a kind of iterator, that would iterate over the given ranges, and at each step gives you a permutation.
It can, typically, be written without metaprogramming, especially since variadic templates are only supported since C++0x. Nonetheless it's a very interesting challenge I feel.
Our first helper here is going to be little tuple class. We are also going to need a number of meta-template programming trick to transform one tuple into another, but I'll let it as an exercise for the reader to write both the meta-template functions necessary and the actual functions to execute the transformation (read: it's much too hot this afternoon for me to get to it).
Here is something to get you going.
template <class... Containers>
class permutation_iterator
{
public:
  // tuple of values
  typedef typename extract_value<Containers...>::type value_type;

  // tuple of references, might be const references
  typedef typename extract_reference<Containers...>::type reference;

  // tuple of pointers, might be const pointers
  typedef typename extract_pointer<Containers...>::type pointer;

  permutation_iterator(Containers&... containers) { /*extract begin and end*/ }

  permutation_iterator& operator++()
  {
    this->increment<sizeof...(Containers)-1>();
    return *this;
  }

private:
  typedef typename extract_iterator<Containers...>::type iterator_tuple;

  template <size_t N>
  typename std::enable_if_c<N < sizeof...(Containers) && N > 0>::type
  increment()
  {
    assert(mCurrent.at<N>() != mEnd.at<N>());
    ++mCurrent.at<N>();
    if (mCurrent.at<N>() == mEnd.at<N>())
    {
      mCurrent.at<N>() = mBegin.at<N>();
      this->increment<N-1>();
    }
  }

  template <size_t N>
  typename std::enable_if_c<N == 0>::type increment()
  {
    assert(mCurrent.at<0>() != mEnd.at<0>());
    ++mCurrent.at<0>();
  }

  iterator_tuple mBegin;
  iterator_tuple mEnd;
  iterator_tuple mCurrent;
};

If you don't know how to go meta, the easier way is to go recursive, then require the user to indicate which container she wishes to access via a at method taking a N as parameter to indicate the container index.

A: Using recursion you could probably "feed yourself" with the current position, the remaining lists and so forth. This has the potential to overflow, but often a recursive function can be made into a non-recursive one (like with a for loop), although much of the elegance disappears.

A: The non recursive way:
#include <vector>
#include <iostream>

// class to loop over space
// no recursion is used
template <class T>
class NLoop{

public:

    // typedefs for readability
    typedef std::vector<T> Dimension;
    typedef std::vector< Dimension > Space;
    typedef std::vector< typename Dimension::iterator > Point;

    // the loop over space and the function-pointer to call at each point
    static void loop(Space space, void (*pCall)(const Point&))
    {

        // get first point in N-dimensional space
        Point current;
        for ( typename Space::iterator dims_it = space.begin() ; dims_it!=space.end() ; ++dims_it )
        {
            current.push_back( (*dims_it).begin() );
        }

        bool run = true;
        while ( run )
        {

            // call the function pointer for current point
            (*pCall)(current);

            // go to next point in space
            typename Space::iterator dims_it = space.begin();
            typename Point::iterator cur_it = current.begin();
            for (  ; dims_it!=space.end() ; ++dims_it, ++cur_it )
            {
                // check if next in dimension is at the end
                if ( ++(*cur_it) == (*dims_it).end() )
                {
                    // check if we have finished whole space
                    if ( dims_it == space.end() - 1 )
                    {
                        // stop running now
                        run = false;
                        break;
                    }
                    // reset this dimension to begin
                    // and go to next dimension
                    *cur_it = (*dims_it).begin();
                }
                else
                {
                    // next point is okay
                    break;
                }
            }

        }
    }
};

// make typedef for readability
// this will be a loop with only int-values in space
typedef NLoop<int> INloop;

// function to be called for each point in space
// do here what you got to do
void call(const INloop::Point &c)
{
    for ( INloop::Point::const_iterator it = c.begin() ; it!=c.end() ; ++it)
    {
        std::cout << *(*it) << " ";
    }
    std::cout << std::endl;
}

int main()
{

    // fill dimension
    INloop::Dimension d;
    d.push_back(1);
    d.push_back(2);
    d.push_back(3);

    // fill space with dimensions
    INloop::Space s;
    s.push_back(d);
    s.push_back(d);
    s.push_back(d);

    // loop over filled 'space' and call 'call'
    INloop::loop(s,call);

    return 0;

}


text:
Q: Why are the window buttons on the left? MS-Windows cribbed the original X-Windows button layout. Then for some unknown reason Ubuntu puts them on the left!!!
You don't change the layout of your keyboard every time you change your operating system, so why change the window button layout?

A: Having windows buttons on the left side is not really unusual:
 Apple Macintosh
 MS Windows 1.0
 Atari TOS
 Apple OSX
Coming from an Atari ST I immediately felt at home with Ubuntu's windows buttons on the left. For me it was and still is the right place. I never felt comfortable with right sided Windows' buttons.
So the question should rather be why some operating systems won't let us move them to where we want them to be.
Ubuntu does not force us to live with left-sided buttons. You are free to move them to the right, just as you personally prefer, simply by choosing a windows manager different to Unity:


text:
Q: Two diodes in parallel for over-voltage protection I've got a power supply circuit that needs the input to be protected against some pretty big voltage spikes.  To do this, I need a really beefy clamping diode (D1) that will handle the voltage and current associated with those spikes.  I also have a second diode in parallel with less current/voltage handling capability, but with a higher breakdown voltage (D2).  My thought was that the secondary diode might react faster, but the primary diode would do the real voltage clamping.  The circuit below is a simplified version (not including additional bias components).

My hope is that the two diodes will provide the response as shown below.  Is this a bad idea?  Any cautions or warnings for this type of implementation?

A: It won't work -- if you put 2 diodes in parallel, I can't easily say how they will share current in the forward (conducting) direction, but in blocking, the LOWEST breakdown one will breakdown. The 2nd is useless.
You might put 2 in series, but this has its own problems (they don't split the applied V equally). Best to get a single component rated for what you want to do.

A: Two 5KP22CA (5 kW, 22 V TVS) in parallel can clamp an SAE J1455 load dump (unloaded 100 V peak, 0.4 Ω impedance, 0.4 s fall-time if I recall correctly) to <30 V.
So long as your duty cycle is fairly low or the diodes thermally coupled, you can parallel TVS fairly well.  They are far from perfect Zeners as their standoff/breakdown/max voltage range is quite broad so one robbing all the surge from the other is unlikely.

A: You may want to research Gas Discharge Tube Arrestors.  These usually have higher current ratings than the equivalent TVS diodes.
I would replace the higher breakdown voltage diode with a GDT.  The TVS diode would start conducting for the small spikes and the GDT would suppress the large spikes.

A: Depending on the details of your circuit you may be able to use one of these
http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1003,C1142,C1029,P38400


text:
Q: How to implement threading in client generated by axis to make multiple requests to a webservice using java I have an array list of request objects. I run them in a for loop and inside the loop I call the webservice and add the response object to another array list. I need to implement threading so that I can send multiple request to the web service.

A: I haven't really tried this myself however thought it might be interesting so I played around with it, hope it does what you want:
List<RefundOrderResponse> responses = Collections.synchronizedList(new ArrayList<RefundOrderResponse>());

Executor e = Executors.newFixedThreadPool(10);
CompletionService<RefundOrderResponse> ecs = new ExecutorCompletionService<RefundOrderResponse>(e);

// Create some futures based on the requests we have that we want processed
List<Future<RefundOrderResponse>> futures = new ArrayList<Future<RefundOrderResponse>>();

for (final RefundOrderRequest request : requests)
{
    futures.add(ecs.submit(new Callable<RefundOrderResponse>()
    {
        @Override
        public RefundOrderResponse call () throws Exception
        {
            // do the call to the web service here and return the response
            return soapWS.refundOrder(request);
        }
    }));
}

// Now we can process the response, note with a completion service we are assuming process order of responses is not very important.
for (int i = 0; i < futures.size(); i++) {
    responses.add(ecs.take().get());
}

I've used the Java CompletionService here, or more specifically the ExecutorCompletionService (as it uses an executor to run in parrallel). It does assume that the processing of the response can be done in any order, which in this case is simply just adding them to a responses list. Not sure what you plan on doing with the responses list however you could just process them in the loop instead of adding them to a list.


text:
Q: Return Re-sized Image from Database Through .ashx I've found some similar questions on SO and elsewhere, but nothing that quite does what I'm looking for (or, maybe I'm just too boneheaded to connect the dots!)
I'm looking to return a thumbnail image from a full size image stored as varbinary(max) in the database.  I'll be using the thumbnails in a gallery-style view, so small size / efficient loading is crucial.   I've been using an .ashx to return the full size image into a bound asp.net Image control, with the following code:
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

    Dim conn As New SqlConnection()
    conn.ConnectionString = *connectionstring*

    Dim cmd As New SqlCommand()
    cmd.Connection = conn
    cmd.CommandType = CommandType.StoredProcedure
    cmd.CommandText = "GetEmplHeadShot"

    Dim emplID As New SqlParameter("@emplID", context.Request.QueryString("emplid"))
    cmd.Parameters.Add(emplID)

    conn.Open()

    Dim myReader As SqlDataReader = cmd.ExecuteReader
    If myReader.Read Then

        context.Response.BinaryWrite(myReader("HeadShot"))
        context.Response.ContentType = "image/jpeg"

    End If
    myReader.Close()
    conn.Close()

End Sub

I realize it's probably best to address the re-size at the upload, and stored the smaller image as a discrete column.  But in the meantime, is it possible to program the handler to re-size the image on the fly?  Ideally, I'd be able to pass an additional query string parameter, something like isResized from the image binding, allowing the same handler to be used for both full size and re-sized images.
Any advice / assistance would be greatly appreciated.  Ideas on alternative approaches (i.e. "you're going about this all wrong") would also be very welcome.

A: Sorry, not a VB guy, but here's an example if you can read C#.  You'll want to add some handling for missing parameters and such, but this could outline your basic approach.
        public void ProcessRequest( HttpContext context )
        {
            int height = Convert.ToInt32(context.Request["height"]);
            int width = Convert.ToInt32(context.Request["width"]);

            //Get image from database here, put into a stream
            var stream = new MemoryStream(); //this would represent the stream from your database image

            using( var original = Image.FromStream( stream ) )
            {
                using( var resized = new Bitmap(width, height, PixelFormat.Format24bppRgb) )
                {
                    using( var g = Graphics.FromImage( resized ) )
                    {
                        g.SmoothingMode = SmoothingMode.AntiAlias;
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                        g.PixelOffsetMode = PixelOffsetMode.HighQuality;

                        g.DrawImage( original, new Rectangle( new Point( 0, 0 ), new Size(width, height) ) );

                        var resizedStream = new MemoryStream();
                        resized.Save(resizedStream, ImageFormat.Jpeg);

                        context.Response.ContentType = "image/jpeg";
                        context.Response.BinaryWrite(resizedStream.GetBuffer());
                        context.Response.End();
                    }
                }
            }

        }

A: Yes, instead of returning the var binary directly back to the response, put it into a Bitmap object (via a memory stream created from the varbinary)
Resize the BMP, then save it back to the memory stream via the save method, then output the memory stream back to a byte array to the response.
Keep in mind though that instantiating a Bitmap on the server can be very memory intesive.  If you have multiple requests simultaneously, you could run into "out of memory exceptions".  It's probably a good idea to save the thumbnails to db or disk when created, so that you don't have to keep re-creating them on every request.

A: Yes, it's certainly possible to do the resizing on the fly. I would suggest you just let the HttpHandler create the thumbnail on the first request, storing it in the database or as an image on the server.
For your scenario I would probably consider a solution where the handler takes in height/width parameters, resizes the image, and stores it for reuse.


text:
Q: Remove title in nomenclature I am using the nomencl environment within the elsarticle class to produce an overview of mathematical variables used in the paper. As this nomenclature should be part of the appendix, I would like to suppress its title.
I have found how to change nomenclature titles, but  not how to remove it altogether. Here is what I have so far in my TeX Code:
\documentclass[authoryear, review]{elsarticle} %preprint
\special{papersize=210mm,297mm}
\usepackage{nomencl}
\makenomenclature
\RequirePackage{ifthen}
\renewcommand{\nomname}{This is the title that should not appear}
\begin{document}
    Bla bla
\begin{frontmatter}
\end{frontmatter}
\section{Section example}
This is my text, where variables appear.
\nomenclature[1]{$\mu$}{Example variable}
\appendix
\section{Definition of model variables}
\printnomenclature[0.9in]
\end{document}

If I just use \renewcommand{\nomname}{}, LaTeX produces a large gap where the title used to be, which also does not look nice.
Thank you very much for any hints or pieces of advice!
Best
Christian

A: nomencl package uses \thenomenclature with this code
\def\thenomenclature{%
  \@ifundefined{chapter}%
  {
    \section*{\nomname}
    \if@intoc\addcontentsline{toc}{section}{\nomname}\fi%
  }%
  {
    \chapter*{\nomname}
    \if@intoc\addcontentsline{toc}{chapter}{\nomname}\fi%
  }%
 ... % and some more code not relevant for this solution

i.e. there is either a \section*{\nomname} or \chapter*{\nomname} command. which should be avoided here.
If the intoc option is used, the \addcontentsline should be omitted as well, but this was not requested.
\documentclass[authoryear, review]{elsarticle} %preprint

\usepackage{xpatch}
\special{papersize=210mm,297mm}
\usepackage{nomencl}

\xpatchcmd{\thenomenclature}{%
  \section*{\nomname}% Look for `\section*... etc.
}{% Replace it by 'nothing'
}{\typeout{Success}}{\typeout{Failure}}

\makenomenclature
\RequirePackage{ifthen}
%\renewcommand{\nomname}{This is the title that should not appear}
\begin{document}
    Bla bla
\begin{frontmatter}
\end{frontmatter}
\section{Section example}
This is my text, where variables appear.
\nomenclature[1]{$\mu$}{Example variable}
\appendix
\section{Definition of model variables}
\printnomenclature[0.9in]
\end{document}


text:
Q: Screen flickering with Ubuntu 15 on MSI PE 60 2QE My new MSI PE60 2QE laptop mounts an Intel Integrated Graphics Chipset 5600 connected to a Samsung 156HL01-102 display.
The display works perfectly when I boot with the "nomodeset" parameter in the kernel command line -- but using the framebuffer driver, which doesn't allow multiple monitors.
With KMS enabled (by removing the "nomodeset" parameter), X starts correctly with the intel drivers and I can use multiple monitors, but the laptop's panel shows an irregular flicker, ranging from occasional flickering horizontal black lines (which are really annoying) to a constant flashing & flickering making the display all but unusable.
An external monitor connected to the DP port works well. I've not tried the HDMI yet.
Things I have tried (among many others I've discovered were irrelevant):
* Creating a new (1.3) EDID matching the displays characteristics as recommended in https://www.osadl.org/Single-View.111+M5ec938a7b3b.0.html
* Setting different video modes using xrandr
* Booting with Kernel 3.19.0.25 with i915.enable_IPS=0 as suggested here: Screen flickering on Ubuntu Gnome 14.04 - 4K resolution
* Booting with i915.powersave=0
* Booting with acpi_osi=Linux
How can I get the intel drivers to work without this flickering?
About the hardware:
$ lspci|grep -E "VGA|3D"
00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 0a)
01:00.0 3D controller: NVIDIA Corporation Device 139b (rev a2)

About the display:
$ sudo get-edid -q|edid-decode
Intel(R) HSW Mobile/Desktop Graphics Chipset Accelerated VGA BIOSExtracted contents:
header:          00 ff ff ff ff ff ff 00
serial number:   4c 83 4c 32 00 00 00 00 00 17
version:         01 04
basic params:    95 22 13 78 0a
chroma info:     ce 85 9e 5b 4c 94 26 17 50 54
established:     00 00 00
standard:        01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
descriptor 1:    dc 37 80 a0 70 38 40 40 30 20 25 00 58 c2 10 00 00 19
descriptor 2:    00 00 00 0f 00 00 00 00 00 00 00 00 00 1e 82 10 52 00
descriptor 3:    00 00 00 fe 00 53 41 4d 53 55 4e 47 0a 20 20 20 20 20
descriptor 4:    00 00 00 fe 00 31 35 36 48 4c 30 31 2d 31 30 32 0a 20
extensions:      00
checksum:        d1

Manufacturer: SDC Model 324c Serial Number 0
Made week 0 of 2013
EDID version: 1.4
Digital display
6 bits per primary color channel
DisplayPort interface
Maximum image size: 34 cm x 19 cm
Gamma: 2.20
Supported color formats: RGB 4:4:4, YCrCb 4:2:2
First detailed timing is preferred timing
Established timings supported:
Standard timings supported:
Detailed mode: Clock 143.000 MHz, 344 mm x 194 mm
               1920 1968 2000 2080 hborder 0
               1080 1082 1087 1144 vborder 0
               -hsync -vsync
Manufacturer-specified data, tag 15
ASCII string: SAMSUNG
     ASCII string: 156HL01-102
 Checksum: 0xd1
EDID block does NOT conform to EDID 1.3!
    Missing name descriptor
    Missing monitor ranges

xrandr output:
$ xrandr --verbose
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 32767 x 32767
eDP1 connected 1920x1080+1920+0 (0x6a) normal (normal left inverted right x axis y axis) 344mm x 194mm
    Identifier: 0x63
    Timestamp:  13894
    Subpixel:   unknown
    Gamma:      1.0:1.0:1.0
    Brightness: 1.0
    Clones:
    CRTC:       1
    CRTCs:      1 0 2
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
    EDID:
        00ffffffffffff004c834c3200000000
        00170104952213780ace859e5b4c9426
        17505400000001010101010101010101
        010101010101dc3780a0703840403020
        250058c2100000190000000f00000000
        00000000001e82105200000000fe0053
        414d53554e470a2020202020000000fe
        00313536484c30312d3130320a2000d1
    BACKLIGHT: 4882
        range: (0, 4882)
    Backlight: 4882
        range: (0, 4882)
    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 (0x6a)  143.0MHz -HSync -VSync *current +preferred
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock   68.8KHz
        v: height 1080 start 1082 end 1087 total 1144           clock   60.1Hz
  1920x1080 (0x12c)  138.5MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock   66.6KHz
        v: height 1080 start 1083 end 1088 total 1111           clock   59.9Hz
  1680x1050 (0x12d)  146.2MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock   65.3KHz
        v: height 1050 start 1053 end 1059 total 1089           clock   60.0Hz
  1680x1050 (0x12e)  119.0MHz +HSync -VSync
        h: width  1680 start 1728 end 1760 total 1840 skew    0 clock   64.7KHz
        v: height 1050 start 1053 end 1059 total 1080           clock   59.9Hz
  1600x1024 (0x12f)  103.1MHz +HSync +VSync
        h: width  1600 start 1600 end 1656 total 1664 skew    0 clock   62.0KHz
        v: height 1024 start 1024 end 1029 total 1030           clock   60.2Hz
  1400x1050 (0x130)  122.0MHz +HSync +VSync
        h: width  1400 start 1488 end 1640 total 1880 skew    0 clock   64.9KHz
        v: height 1050 start 1052 end 1064 total 1082           clock   60.0Hz
  1280x1024 (0x131)  108.0MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock   64.0KHz
        v: height 1024 start 1025 end 1028 total 1066           clock   60.0Hz
  1440x900 (0x132)  106.5MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock   55.9KHz
        v: height  900 start  903 end  909 total  934           clock   59.9Hz
  1280x960 (0x133)  108.0MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock   60.0KHz
        v: height  960 start  961 end  964 total 1000           clock   60.0Hz
  1360x768 (0x134)   84.8MHz -HSync +VSync
        h: width  1360 start 1432 end 1568 total 1776 skew    0 clock   47.7KHz
        v: height  768 start  771 end  781 total  798           clock   59.8Hz
  1360x768 (0x135)   72.0MHz +HSync -VSync
        h: width  1360 start 1408 end 1440 total 1520 skew    0 clock   47.4KHz
        v: height  768 start  771 end  781 total  790           clock   60.0Hz
  1152x864 (0x136)   81.6MHz -HSync +VSync
        h: width  1152 start 1216 end 1336 total 1520 skew    0 clock   53.7KHz
        v: height  864 start  865 end  868 total  895           clock   60.0Hz
  1024x768 (0x137)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x138)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  800x600 (0x139)   36.0MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz
        v: height  600 start  601 end  603 total  625           clock   56.2Hz
  640x480 (0x13a)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   59.9Hz
DP1 connected primary 1920x1080+0+0 (0x6b) normal (normal left inverted right x axis y axis) 477mm x 268mm
    Identifier: 0x64
    Timestamp:  13894
    Subpixel:   unknown
    Gamma:      1.0:1.0:1.0
    Brightness: 1.0
    Clones:     HDMI1
    CRTC:       0
    CRTCs:      1 0 2
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
    EDID:
        00ffffffffffff0010ac60404c4e4141
        2d1401030e301b78ea9535a159579f27
        0e5054a54b00714f8180d1c001010101
        010101010101023a801871382d40582c
        4500dd0c1100001e000000ff00343257
        313930423941414e4c0a000000fc0044
        454c4c205032323131480a20000000fd
        00384c1e5311000a202020202020005b
    Broadcast RGB: Automatic
        supported: Automatic, Full, Limited 16:235
    audio: auto
        supported: force-dvi, off, auto, on
  1920x1080 (0x6b)  148.5MHz +HSync +VSync *current +preferred
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock   67.5KHz
        v: height 1080 start 1084 end 1089 total 1125           clock   60.0Hz
  1280x1024 (0x13b)  135.0MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock   80.0KHz
        v: height 1024 start 1025 end 1028 total 1066           clock   75.0Hz
  1280x1024 (0x131)  108.0MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock   64.0KHz
        v: height 1024 start 1025 end 1028 total 1066           clock   60.0Hz
  1152x864 (0x13c)  108.0MHz +HSync +VSync
        h: width  1152 start 1216 end 1344 total 1600 skew    0 clock   67.5KHz
        v: height  864 start  865 end  868 total  900           clock   75.0Hz
  1024x768 (0x13d)   78.8MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock   60.1KHz
        v: height  768 start  769 end  772 total  800           clock   75.1Hz
  1024x768 (0x137)   65.0MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz
        v: height  768 start  771 end  777 total  806           clock   60.0Hz
  800x600 (0x13e)   49.5MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock   46.9KHz
        v: height  600 start  601 end  604 total  625           clock   75.0Hz
  800x600 (0x138)   40.0MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz
        v: height  600 start  601 end  605 total  628           clock   60.3Hz
  640x480 (0x13f)   31.5MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock   37.5KHz
        v: height  480 start  481 end  484 total  500           clock   75.0Hz
  640x480 (0x140)   25.2MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock   31.5KHz
        v: height  480 start  490 end  492 total  525           clock   60.0Hz
  720x400 (0x141)   28.3MHz -HSync +VSync
        h: width   720 start  738 end  846 total  900 skew    0 clock   31.5KHz
        v: height  400 start  412 end  414 total  449           clock   70.1Hz
HDMI1 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x65
    Timestamp:  13894
    Subpixel:   unknown
    Clones:     DP1
    CRTCs:      1 0 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
HDMI2 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x66
    Timestamp:  13894
    Subpixel:   unknown
    Clones:
    CRTCs:      1 0 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
VGA1 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x67
    Timestamp:  13894
    Subpixel:   unknown
    Clones:
    CRTCs:      1 0 2
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
    Identifier: 0x68
    Timestamp:  13894
    Subpixel:   no subpixels
    Clones:
    CRTCs:      3
    Transform:  1.000000 0.000000 0.000000
                0.000000 1.000000 0.000000
                0.000000 0.000000 1.000000
               filter:

A: Turn off "Unredirect fullscreen windows" in compizconfig or use the terminal:
gconftool-2 --set /apps/compizconfig-1/profiles/Default/plugins/composite/screen0/options/unredirect_fullscreen_windows --type bool 0

A: To solve your problem install the latest current stable short-lived branch  NVIDIA drivers 355.
But first undo all the changes you have made to set the system back to standard configuration.
Remove all parameters  - uninstall every NVIDIA related software you have had installed before.
Boot into the Ubuntu system and when the login screen appears press Ctrl+Alt+F1.
Enter your user name and password and then execute:
sudo apt-get purge nvidia*
sudo reboot

Note:
If you had bumblebee installed remove the packages as well (it will be replaced by nvidia-prime).
In this case the commands would be:
sudo apt-get purge nvidia* bumblebee
sudo reboot

Now install the new drivers and NVIDIA Optimus support.
When the login screen appears press Ctrl + Alt + F1.
Enter your user name and password and then execute:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-355 nvidia-prime
sudo reboot

In case you have to adjust which card to use in BIOS select NVIDIA or  switchable graphics mode.
Open NVIDIA X Server Settings -> Prime Profiles to switch between the intel and NVIDIA GPUs.

A: I've had similar problems with flickering on Ubuntu. In my case helped disabling "Unknown display" in Settings -> Displays. Maybe it'll work also in your case.

A: Using 17.04 alpha
This stopped the flashing for me; nano to /etc/modprobe.d/i915.conf and add the following (usually the file does not already exist) and reboot:
*# added by DW 3.3.2017 attempt to stop i915 flashing
options i915 enable_rc6=7 enable_psr=2 enable_fbc=1 lvds_downclock=1 semaphores=1*


text:
Q: jwt payload is the same each time i register a new user i'm new to this . i've followed along with this tutorial //https://devdactic.com/restful-api-user-authentication-1/
so it's all working , adduser is hashing , login is returning a jwt login a new user is returned to jwt.encode in route /api/login and a new jwt is returned
I want to get the user details from a protect route, for example
server.get('/api/routeThatNeedsJWTToken', passport.authenticate('jwt', { session: false }), function(req, res){
    res.json({'Success! You can not see this without a token':'bla', user: req.user});
  });
Here the req.user returned is always the first user i registered. i need the one matching the jwt, the users id or name .
any help appreciated or i'm thinking about starting from scratch and going this way https://www.sitepoint.com/using-json-web-tokens-node-js/
please see server.js and config/passport.js for a walk through the code
https://github.com/Lambda-School-Labs/decisionjam
here is an example of two jwt
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaG9pY2VzIjpbXSwiY3JlYXRlZE9uIjoiMjAxOC0wNS0xMFQxMjozMjo1MS45MTJaIiwiX2lkIjoiNWFmNDNiZjNmZmNmNGNmM2JjMjBlMmFjIiwidXNlcm5hbWUiOiJwYXQxIiwiZW1haWwiOiJwYXRlbWFpbDEiLCJwYXNzd29yZCI6IiQyYSQxMCR2eERIc2RkckYxZUFDdURIODdTNlFPYlZVcTlPcUtoNmV1cmRkQWpvWTVXbkRFaXRwbGJqYSIsIl9fdiI6MH0.vUcvRiJJD5s8kWBIodbE5ZCQeRdn0r7m6b1pC0KWnYk"
JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjaG9pY2VzIjpbXSwiY3JlYXRlZE9uIjoiMjAxOC0wNS0xMFQxMjo1MjoyNy45MThaIiwiX2lkIjoiNWFmNDQwOGI4MDA2YWJmNGUxZGU5ZmIxIiwidXNlcm5hbWUiOiJwYXQyIiwiZW1haWwiOiJwYXRlbWFpbDIiLCJwYXNzd29yZCI6IiQyYSQxMCRTbGhqTHg0aXBlSzRRd2h5T0FSajRPaHZZSWpyWG1rVmFjUjdYL09kMlBpdldoTG5lcUtzSyIsIl9fdiI6MH0.NmZrAupocchKjvwUBblOpLBIFmMujaF2gZ9ii_YfK48"

A: In req.user is the user saved in session. If you want to take user from JWT token, you should add an authentication method in path declaration, that extract info from JWT token, with jwt.decode  and assing the result to the req.user.
This way user object in request will be the user being authenticated by the token.


text:
Q: Adding cropping on PC when printing Have not touched Java in a few years but I was asked to make some Java code to print a picture and some text several times. It works fine on a Mac but printing from a Windows machine the print out is cropped. The image is his res and about 8x10 at 300DPI.
public class printClass implements Printable {

BufferedImage image;
private URL url;

printClass(URL url1) {
    url = url1;
}

public int print(Graphics g, PageFormat pf, int page) throws PrinterException {

    Graphics2D g2d = (Graphics2D) g;
    g2d.translate(pf.getImageableX(), pf.getImageableY());

    AffineTransform theAT = g2d.getTransform();

    double theScaleFactor = (72d / 300d);

    Font font = new Font("Arial", Font.PLAIN, 10);
    Font font2 = new Font("Arial", Font.PLAIN, 5);

    g2d.setFont(font);

    if (page < 10) {
        g2d.scale(theScaleFactor, theScaleFactor);
        g2d.drawRenderedImage(image, null);
        g2d.setTransform(theAT);
        return PAGE_EXISTS;
    } else {
        return NO_SUCH_PAGE;
    }

}public void init() {

    try {
        img = ImageIO.read(url);
        image = (BufferedImage) img;
    } catch (IOException e) {
        System.out.println("Error: " + e);
    }
    PrinterJob job = PrinterJob.getPrinterJob();
    PrinterResolution pr = new PrinterResolution(300, 300, PrinterResolution.DPI);
    PrintRequestAttributeSet attrib = new HashPrintRequestAttributeSet();
    PageFormat pFormat = job.getPageFormat(attrib);
    Paper paper = pFormat.getPaper();
    paper.setImageableArea(0.0,0.0,pFormat.getPaper().getWidth(), pFormat.getPaper().getHeight());
    pFormat.setPaper(paper);

    attrib.add(pr);
    attrib.add(PrintQuality.HIGH);

    job.setPrintable(this);

    boolean ok = job.printDialog();
    if (ok) {
        try {
            job.print(attrib);
        } catch (PrinterException ex) {
        }
    }
}
}

The URL is the image being printed. This is part of a Java applet. The text addition part is missing in this code but it is like the following:
 g.drawString(markUpText, x, y);

A: Okay so I solved my own problem.  I did not include the print format to the printable.
 job.setPrintable(this,pFormat);

This cause some other interesting problems with print quality and location in Windows and location in Mac.
I solved the quality issues by removing the DPI and and PrintQuality.HIGH from the attributes.
I solved the location issue with the following code in the prinatble function:
 g2d.translate(pf.getImageableX() + 30, pf.getImageableY()+30);

I also switched to the new Copies to attributes to allow me to easily control the amount of copies they want printed.
Still not sure if this is the best way to go about this but it works!


text:
Q: Using a mock location provider in an espresso test on Android 11+ My Android app uses the position provided by the gps.
One of my classes overrides the onProviderDisabled method of LocationListener.
The app is working fine and gets the gps position.
I have an Espresso test that create a test provider for mock locations in the @Before setup() method of my test class:
locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
locationManager.addTestProvider(LOCATION_PROVIDER_NAME, false,
                                false, false, false,
                                true, true, true,
                                POWER_USAGE_HIGH,
                                ProviderProperties.ACCURACY_FINE);
locationManager.setTestProviderEnabled(LOCATION_PROVIDER_NAME, false);

Then in my test, I call
locationManager.setTestProviderEnabled(LOCATION_PROVIDER_NAME, true);
SystemClock.sleep(200);
...
test if gps is enabled
...

On an Android 8 device, this code works fine (onProviderDisabled not called)
But on Android 11, 12 and 13 devices, about 300 ms after enabling the test provider, the onProviderDisabled is called.
What do I need to do to enable mock location on new Android devices?

A: I finally found the solution. It is so easy when you know it !
On recent Android devices, when using mock locations in Espresso test, you must switch ON the location service manually before running the test.
Note: this was not required on Android 8 devices


text:
Q: How can I get the last line of HTML text with Javascript? For example:

asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass

How can I get the last line of HTML text with Javascript?

A: You can use this regex
/[^\r\n]+$/g

const regex = /[^\r\n]+$/g;
const str = `asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass
asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas
ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass asdfas ass
asdfas ass`;
let m;

var result = str.match(regex);
console.log(result[0]);


text:
Q: Proof: Cauchy sequences and uniform continuity I'm working on a proof and I'm having trouble relating definitions
I want to prove that if f is uniformly continuous, then if a sequence $ {a_n} $ is Cauchy, $ {f(a_n)} $ is Cauchy.
So if $ f $ is uniformly continuous, then for all $ \epsilon>0 $ there exists a $ \delta>0 $ such that $ d(x,y)<\delta $ implies $ d(f(x),f(y))<\epsilon $
And by definition, a sequence $ a_n $ is Cauchy if for $ \epsilon>0,$ there exists a natural number $ N_1 $ such that for all $ m,n>N_1, d(a_m,a_n)<\epsilon. $
How can I show that $ f(a_n) $ must be Cauchy?

A: Assume $f$ is uniformly continuous, and let $(a_n)$ be a Cauchy sequence in your space. Given $\varepsilon > 0$, we may choose, by uniform continuity of $f$, a $\delta > 0$ such that for all $x, y$, $d(x,y) < \delta$ implies $d(f(x),f(y)) < \varepsilon$. Since $(a_n)$ is Cauchy, there exists a positive integer $N$ such that $d(a_m,a_n) < \delta$ for all $m,n \ge N$. Hence, if $m, n \ge N$, then $d(a_m,a_n) < \delta$, which implies $d(f(a_m),f(a_n)) < \varepsilon$. Since $\varepsilon$ was arbitrary, $(f(a_n))$ is Cauchy.


text:
Q: Checkbox not enabled programatically in android What i am doing::
I am having a checkbox and a button
onclick of the button i am trying to enable the checkbox
What is happening::
Checkbox is not enabled onclick
Question::
How can i resolve my issue
Is there any different approach to solve this

MainActivity.java
public class MainActivity extends Activity {

    Button button1;
    CheckBox checkBox1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        button1=(Button) findViewById(R.id.button1);
        checkBox1=(CheckBox) findViewById(R.id.checkBox1);

        button1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {

                checkBox1.setEnabled(true);
            }
        });
    }
}

activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <CheckBox
        android:id="@+id/checkBox1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:checked="false"
        android:layout_marginTop="54dp"/>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/checkBox1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="67dp"
        android:text="Button" />

</RelativeLayout>

A: Try replacing your onClick code with the following:
button1.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        checkBox1.setChecked(true);
    }
});

I believe you were looking for setChecked(), not setEnabled().

A: Use checkBox.setChecked() method:
checkBox.setChecked(true);


text:
Q: Duplicate records coming in typeahead search I am implementing typeahead search using typeahaead.js but as type in typeahead searchbox, in suggestions dropdown each records is coming twice.I checked the datasource(that is POST api call),it has only unique records.where am I doing wrong?Any help or relevant links.
Even control is not going to dup detector.
Similar issue discussed here,but no solution is there.

        <input class="typeahead" type="text" placeholder=" Search">


text:
Q: unresolved type error from classes imported from external jar file I'm creating an android application using fuzzy logic. I have imported the jar library by adding it to the lib folder.
However, the classes that refer to these libraries show an error "couldn't be resolved to a type".
I tried the solution, classes from android project library not resolved in android project. But it didn't work for me and the clean-refresh-build method too wasn't useful.
The code:
import java.sql.Savepoint;

import com.fuzzylite.*;
import com.fuzzylite.defuzzifier.*;
import com.fuzzylite.factory.*;
import com.fuzzylite.hedge.*;
import com.fuzzylite.imex.*;
import com.fuzzylite.norm.*;
import com.fuzzylite.norm.s.*;
import com.fuzzylite.norm.t.*;
import com.fuzzylite.rule.*;
import com.fuzzylite.term.*;
import com.fuzzylite.variable.*;

import android.app.Activity;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.RatingBar;
import android.widget.SeekBar;
import android.widget.TextView;

private void fuzzy(){
    Engine engine = new Engine();
    engine.setName("Mamdani-Tip-Calculator");

    InputVariable inputVariable1 = new InputVariable();
    inputVariable1.setEnabled(true);
    inputVariable1.setName("FoodQuality");
    inputVariable1.setRange(1.000, 10.000);
    inputVariable1.addTerm(new Trapezoid("Bad", 0.000, 1.000, 3.000, 7.000));
    inputVariable1.addTerm(new Trapezoid("Good", 3.000, 7.000, 10.000, 11.000));
    engine.addInputVariable(inputVariable1);

    InputVariable inputVariable2 = new InputVariable();
    inputVariable2.setEnabled(true);
    inputVariable2.setName("Service");
    inputVariable2.setRange(1.000, 10.000);
    inputVariable2.addTerm(new Trapezoid("Bad", 0.000, 1.000, 3.000, 7.000));
    inputVariable2.addTerm(new Trapezoid("Good", 3.000, 7.000, 10.000, 11.000));
    engine.addInputVariable(inputVariable2);

    OutputVariable outputVariable = new OutputVariable();
    outputVariable.setEnabled(true);
    outputVariable.setName("Tip");
    outputVariable.setRange(0.000, 30.000);
    outputVariable.fuzzyOutput().setAccumulation(new AlgebraicSum());
    outputVariable.setDefuzzifier(new Centroid(200));
    outputVariable.setDefaultValue(Double.NaN);
    outputVariable.setLockValidOutput(false);
    outputVariable.setLockOutputRange(false);
    outputVariable.addTerm(new Gaussian("AboutTenPercent", 10.000, 2.000));
    outputVariable.addTerm(new Gaussian("AboutFifteenPercent", 15.000, 2.000));
    outputVariable.addTerm(new Gaussian("AboutTwentyPercent", 20.000, 2.000));
    engine.addOutputVariable(outputVariable);

    RuleBlock ruleBlock = new RuleBlock();
    ruleBlock.setEnabled(true);
    ruleBlock.setName("");
    ruleBlock.setConjunction(new AlgebraicProduct());
    ruleBlock.setDisjunction(new Maximum());
    ruleBlock.setActivation(new Minimum());
    ruleBlock.addRule(Rule.parse("if FoodQuality is Bad and Service is Bad then Tip is AboutTenPercent", engine));
    ruleBlock.addRule(Rule.parse("if FoodQuality is Bad and Service is Good then Tip is AboutFifteenPercent", engine));
    ruleBlock.addRule(Rule.parse("if FoodQuality is Good and Service is Bad then Tip is AboutFifteenPercent", engine));
    ruleBlock.addRule(Rule.parse("if FoodQuality is Good and Service is Good then Tip is AboutTwentyPercent", engine));
    engine.addRuleBlock(ruleBlock);

}

ScreenShots:
The imported libraries do not seem to have a problem.
The classes cannot be resolved to a type

A: Where have you imported the jfuzzylite.jar file? I think you should see the jfuzzylite.jar file within the referenced libraries.
Have you tried building the jfuzzylite.jar using ant on the build.xml file provided with jfuzzylite?


text:
Q: Set a visual focus on a element with jQuery I've seen some pages with a cool visual focus on elements for example a div:
alt text http://img40.imageshack.us/img40/3007/32303100.png
The white box is a div and the rest of the page is dimmed out.
Are there jQuery plugins for that effekt?

A: jQuery Spotlight


text:
Q: Xcode: How does one fully erase the contents of an array using code only? Is it possible to empty an xcode array using code? I'm talking about a full-on clean, nothing needs to be left over.

A: Since you didn't say what programming language you are using in Xcode, I gonna give you solutions in both Swift & Objective-C.
Swift:
var array = ["a"]
// clear all elements in array
array.removeAll()

Objective-C:
NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:@[@"a", @"b"]];
[mutableArray removeAllObjects];

And one tip: You can refer to Apple's Developer Documentation from Xcode -> Help -> Developer Documentation. It's very useful for looking up APIs.


text:
Q: Como exportar footer corretamente com primefaces extensions Uso JSF 2.2 e Primefaces 5.0
Utilizando o primefaces Extensions para exportar, em único arquivo excel, três tabelas de um sistema, estou tendo problema com as informações exportadas: O footer de tabelas com colunas dinâmicas, renderizadas em página conforme tratativa no bean e uso de variáveis boolean (utilizadas nos rendere) não estão sendo exportados como desejado (mesmo visual da tela).
Vide imagem:

Segue abaixo o código da página:
<?xml version='1.0' encoding='UTF-8' ?>

    Painel de Controle - Sistema de Notificação de Eventos

    <ui:include src="/paginas/admin/includes/topo.xhtml" />

        <h:form id="cadastro" prependId="false" styleClass="formCadastro">
            <h:panelGrid columns="2">

                <h:panelGroup>

                        <f:selectItem itemValue="" itemLabel="Selecione..." />
                        <f:selectItems value="#{relatoriosMB.listaAnos}" var="intAno"
                            itemLabel="#{intAno.intValue()}"
                            itemValue="#{intAno.intValue()}" />

                </h:panelGroup>

                <h:panelGroup>

                        <f:selectItem itemValue="" itemLabel="Selecione..." />
                        <f:selectItem itemValue="1" itemLabel="JANEIRO" />
                        <f:selectItem itemValue="2" itemLabel="FEVEREIRO" />
                        <f:selectItem itemValue="3" itemLabel="MARÇO" />
                        <f:selectItem itemValue="4" itemLabel="ABRIL" />
                        <f:selectItem itemValue="5" itemLabel="MAIO" />
                        <f:selectItem itemValue="6" itemLabel="JUNHO" />
                        <f:selectItem itemValue="7" itemLabel="JULHO" />
                        <f:selectItem itemValue="8" itemLabel="AGOSTO" />
                        <f:selectItem itemValue="9" itemLabel="SETEMBRO" />
                        <f:selectItem itemValue="10" itemLabel="OUTUBRO" />
                        <f:selectItem itemValue="11" itemLabel="NOVEMBRO" />
                        <f:selectItem itemValue="12" itemLabel="DEZEMBRO" />

                </h:panelGroup>

                <h:panelGroup>

                        <f:selectItem itemValue="" itemLabel="Selecione..." />
                        <f:selectItem itemValue="1" itemLabel="JANEIRO" />
                        <f:selectItem itemValue="2" itemLabel="FEVEREIRO" />
                        <f:selectItem itemValue="3" itemLabel="MARÇO" />
                        <f:selectItem itemValue="4" itemLabel="ABRIL" />
                        <f:selectItem itemValue="5" itemLabel="MAIO" />
                        <f:selectItem itemValue="6" itemLabel="JUNHO" />
                        <f:selectItem itemValue="7" itemLabel="JULHO" />
                        <f:selectItem itemValue="8" itemLabel="AGOSTO" />
                        <f:selectItem itemValue="9" itemLabel="SETEMBRO" />
                        <f:selectItem itemValue="10" itemLabel="OUTUBRO" />
                        <f:selectItem itemValue="11" itemLabel="NOVEMBRO" />
                        <f:selectItem itemValue="12" itemLabel="DEZEMBRO" />

                </h:panelGroup>
            </h:panelGrid>

                    <f:setPropertyActionListener value="false"
                        target="#{exporterController.customExporter}" />
                    <pe:exporter type="pdf" target=":edicao:dataTableAnual,:edicao:dataTablePeriodo,:edicao:dataTableIncidentePeriodo"
                        fileName="TipoClassificação" datasetPadding="3" />

                    <f:setPropertyActionListener value="false"
                        target="#{exporterController.customExporter}" />
                    <pe:exporter type="xlsx" target=":edicao:dataTableAnual,:edicao:dataTablePeriodo,:edicao:dataTableIncidentePeriodo"
                        fileName="TipoClassificação" datasetPadding="3" postProcessor="#{managerexcel.postProcessXLS}"/>

        </h:form>

        <h:form id="edicao" prependId="false">

                <f:facet name="header" style="text-allign:center">
                    Tabela Tipo de Classificação - ANUAL
                </f:facet>

                    <f:facet name="header">
                        <h:outputText value="TIPO CLASSIFICAÇÃO" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JAN" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="FEV" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAR" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="ABR" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAI" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUN" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUL" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="AGO" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="SET" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="OUT" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="NOV" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="DEZ" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="TOTAL" />
                    </f:facet>

                <f:facet name="header" style="text-allign:center">
                    Tabela Incidente - PERÍODO
                </f:facet>

                    <f:facet name="header">
                        <h:outputText value="INCIDENTE" />
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JAN"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="FEV"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAR"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="ABR"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAI"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUN"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUL"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="AGO"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="SET"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="OUT"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="NOV"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="DEZ"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="TOTAL"/>
                    </f:facet>

                <f:facet name="header" style="text-allign:center">
                    Tabela Grau do Incidente - PERÍODO
                </f:facet>

                    <f:facet name="header">
                        <h:outputText value="GRAU DO INCIDENTE"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JAN"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="FEV"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAR"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="ABR"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="MAI"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUN"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="JUL"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="AGO"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="SET"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="OUT"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="NOV"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="DEZ"/>
                    </f:facet>

                    <f:facet name="header">
                        <h:outputText value="TOTAL"/>
                    </f:facet>

        </h:form>

    <ui:include src="/paginas/admin/includes/rodape.xhtml" />

Como podemos ver já tentei usar o rendered e o exportable, ambos com atributos boolean, mesmo assim não funcionou.

A: Realizei a implementação do Custom Exporter, idem aos passos fornecidos no site Steps to Custom Exporter
Após a implementação do modo customizado de exportação depurei o código padrão da exportação customizada, especificamente a classe "ExcelCustomExporter" e verifiquei que não havia consistência, quanto a tag exportable dos componentes footers. Depurando o código identifiquei o metodo que criava as colunas agrupadas do footer e inseri a consistência da tag exportable, do componente em uso. Alterei o metodo "tableColumnGroup", passando a criar a célula e inserir valor a ela quando o exportable fosse true.
Segue abaixo o código modificado:
protected void tableColumnGroup(Sheet sheet, DataTable table, String facetType) {
    ColumnGroup cg = table.getColumnGroup(facetType);
    List<UIComponent> headerComponentList = null;
    if (cg != null) {
        headerComponentList = cg.getChildren();
    }
    if (headerComponentList != null) {
        for (UIComponent component : headerComponentList) {
            if (component instanceof org.primefaces.component.row.Row) {
                org.primefaces.component.row.Row row = (org.primefaces.component.row.Row) component;
                int sheetRowIndex = sheet.getLastRowNum() + 1;
                Row xlRow = sheet.createRow(sheetRowIndex);
                int i = 0;
                for (UIComponent rowComponent : row.getChildren()) {
                    UIColumn column = (UIColumn) rowComponent;
                    String value = null;
                    if (facetType.equalsIgnoreCase("header")) {
                        value = column.getHeaderText();
                    } else {
                        value = column.getFooterText();

                    }
                    int rowSpan = column.getRowspan();
                    int colSpan = column.getColspan();

                    Cell cell = xlRow.getCell(i);

                    if (rowSpan > 1 || colSpan > 1) {
                        if (rowSpan > 1) {
                            cell = xlRow.createCell((short) i);
                            Boolean rowSpanFlag = false;
                            for (int j = 0; j < sheet.getNumMergedRegions(); j++) {
                                CellRangeAddress merged = sheet.getMergedRegion(j);
                                if (merged.isInRange(sheetRowIndex, i)) {
                                    rowSpanFlag = true;
                                }

                            }
                            if (!rowSpanFlag) {
                                cell.setCellValue(value);
                                cell.setCellStyle(facetStyle);
                                sheet.addMergedRegion(new CellRangeAddress(
                                        sheetRowIndex, //first row (0-based)
                                        sheetRowIndex + (rowSpan - 1), //last row  (0-based)
                                        i, //first column (0-based)
                                        i  //last column  (0-based)
                                ));
                            }
                        }
                        if (colSpan > 1) {
                            cell = xlRow.createCell((short) i);

                            for (int j = 0; j < sheet.getNumMergedRegions(); j++) {
                                CellRangeAddress merged = sheet.getMergedRegion(j);
                                if (merged.isInRange(sheetRowIndex, i)) {
                                    cell = xlRow.createCell((short) ++i);
                                }
                            }
                            cell.setCellValue(value);
                            cell.setCellStyle(facetStyle);
                            sheet.addMergedRegion(new CellRangeAddress(
                                    sheetRowIndex, //first row (0-based)
                                    sheetRowIndex, //last row  (0-based)
                                    i, //first column (0-based)
                                    i + (colSpan - 1)  //last column  (0-based)
                            ));
                            i = i + colSpan - 1;
                        }
                    } else {
                        //TODO TRATAR E VERIRIFICAR SE  O VALUE PODE SER EXIBIDO
                        if (column.isExportable()) {
                            cell = xlRow.createCell((short) i);
                            for (int j = 0; j < sheet.getNumMergedRegions(); j++) {
                                CellRangeAddress merged = sheet.getMergedRegion(j);
                                if (merged.isInRange(sheetRowIndex, i)) {
                                    cell = xlRow.createCell((short) ++i);
                                }
                            }
                            cell.setCellValue(value);
                            cell.setCellStyle(facetStyle);
                        }
                    }
                    if (column.isExportable()) {
                        i++;
                    }
                }
            }

        }

    }
}

Gerei o relatório novamente, porém para um período de JAN a MAI, segue evidência:


text:
Q: CSS Vertical timeline I am trying to create a vertical timeline down the middle of a bootstrap page with circles representing each date along it.
The css I have so far is:
    .middleline {
       list-style: none;
       position: relative;
       padding: 20px 0px 20px;
    }

    .middleline:before{
       top: 0;
       bottom: 0;
       position: absolute;
       content: " ";
       width: 3px;
       background-color: #608dc5;
       left: 50%;
       margin-left: -1.5px;
    }

    .middleline li{
        position: absolute;
        width: 40px;
        height: 40px;
        background-color: #4f80bf;
        border-radius: 50px;
    }

I've been fiddling with this for hours now, but can't get it to center with the timeline circles (li) over it. The line with be to the left slightly with the circles to the right. Moving them with right/left just pushes them to the end of the page.
any ideas?
Fiddle of whole page: https://jsfiddle.net/vtb4t17h/

A: Do you mean like this: https://jsfiddle.net/vtb4t17h/1/
Basically change .middleline li
To look like this:
.middleline li {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: #4f80bf;
    border-radius: 50px;
    left: 50%;
    margin-left: -20px;
    list-style: none;
}

I added:
    left: 50%;
    margin-left: -20px;
    list-style: none;

What I done
I offset the left:50% (which brings the li exactly centre), thing is they are 40px wide, so they need to be brought back in by 20px so get centre of that element, so margin-left:-20px does that


text:
Q: Unable to refer to pointer from main method within function that takes in pointer as argument I recently finished "The C Programming Language - 2nd Edition" and I thought a good next step would be creating my own data structures library using C.
I'm currently working on implementing a standard binary tree and I've been stuck with the insertion method.  So far I've created the node struct:
typedef struct node
{
    int data;
    struct node * rc;
    struct node * lc;
}NODE;

and I'm trying to get insertion method to work when presented with the root node of the tree.  Here is how I've created the root node and how I call it in the addNode() function:
int main() {
    NODE * root = NULL;
    addNode(12, root);

    return 0;
}

My addNode() function is structued like so:
void addNode(int info, NODE * node)
{
    if (node == NULL) {
        node = (NODE *)malloc(sizeof(NODE));
        node->data = info;
        node->rc = NULL;
        node->lc = NULL;
    }
}

When I try to display the actual value of 'data' stored within the NODE * root from the main method, I get a segmentation fault.  After some exploring, I realized that the reason for this was that my memory allocation for node in the addNode() method was not actually redefining root to be newly allocated memory with the value 'info' but was instead creating a separate NODE * node.
Ultimately I think my issue is that I'm still trying to grasp pointers in C but I would greatly appreciate any insight into how I could go about fixing my code.  (Sorry in advance if my C terminology is not quite there yet either)

A: The problem is that in your addNode function you are actually modifying the local node, not the actual variable in the outer scope. To fix this issue, you need to pass a pointer to pointer to NODE in addNode. Also, please do not cast the result of malloc as it is not needed and it may hide bugs i.e. you might forget to add the needed headers.


text:
Q: How to Deploy the Feature with Scope=Site & Scope=Web for WebParts & EventReceiver respectively? I have only 1 Visual Studio Project.
It contains 1 EventReceiver(for DocumentLibrary) and multiple-WebParts.
I have defined the Scope=Site of Feature.xml file of Project.
I have created 1 custom function in EventReceiver, which calls on Every event is fire either Add/Update/Delete in my DocumentLibrary.
When I deploy it by rightclicking on the project, Everything is working fine but When I create any page or any item is added into my any CustomList then also the EventReceiver is fires. Although it is created on DocumentLibrary.
Its not giving me any error, but I dnt want to call it again.
But when I Debug the Project by F5, then I am getting error in EventReceiver, because its called multiple times means on every event.
If I deploy the EventReceiver's Scope=Web, then might be it will solve the problem, but I need to deploy the WebParts also with Scope=Site.
So How to solve this problem by single deployment ?

A: You can add second feature to the project. In this case you will have one solution package with two features (first is a site scoped feature, second is a web scoped feature). In a site scoped feature you can include your web parts. To do it you should click on Features folder and select add new feature option.

A: I suspect you've bound the event receiver to the Document Library template, which your custom list may also be using, therefore the event receiver is bound to both list instances.
If I need to bind an event receiver to a specific list then I do so in code, usually via Feature Activation and codd like this:
    protected static void AddEventReceiverToList(string name, string className, SPList list, string assemblyName, SPEventReceiverType eventReceiverType, SPEventReceiverSynchronization eventReceiverSynchronization)
    {
        if (name == null) throw new ArgumentNullException("name");
        if (className == null) throw new ArgumentNullException("className");
        if (list == null) throw new ArgumentNullException("list");
        if (assemblyName == null) throw new ArgumentNullException("assemblyName");
        SPEventReceiverDefinitionCollection eventReceiverDefinitionCollection = list.EventReceivers;

        foreach (SPEventReceiverDefinition eventReceiverDefinition in eventReceiverDefinitionCollection)
        {
            if (eventReceiverDefinition.Name == name)
            {
                return;
            }
        }

        SPEventReceiverDefinition eventReceiver = eventReceiverDefinitionCollection.Add();
        eventReceiver.Name = name;
        eventReceiver.Synchronization = eventReceiverSynchronization;
        eventReceiver.Type = eventReceiverType;
        eventReceiver.Assembly = assemblyName;
        eventReceiver.Class = className;
        eventReceiver.Update();
    }


text:
Q: MySQL JSON data type update with delete I'm using MySQL 5.7 and JSON data type and PHP.
First I update my data.
UPDATE car SET attributes = JSON_SET(`attributes`'$.A','Audi','$.B','BMW','$.C','Cadillac')

The result is this which is correct.
{
"A": "Audi",
"B": "BMW",
"C": "Cadillac"
}

Then I try to update "B" with "". Then my data looks like this.
{
"A": "Audi",
"B": "",
"C": "Cadillac"
}

But I want it to look like this. (I want to remove "B" if it's empty).
{
"A": "Audi",
"C": "Cadillac"
}

How do I do this the correct way?

A: Easy:
UPDATE `car` SET `attributes` = JSON_REMOVE(`attributes`, '$.B');


text:
Q: Polymer Unit Testing unreliable Platform.flush I have set up a testing framework for polymer elements and have the following convenience functions for Mocha, the element is the polymer element to be tested in an <iframe>:
this.ctx.set = function(callback) {
  callback.call(this, this.element);
  Platform.flush();
  return this;
};
this.ctx.then = function(callback) {
  setTimeout(function() {
    callback.call(this, this.element);
    this.test.callback();
  }.bind(this), 100);
  return this;
};

These are then used like so:
(function() {
  'user strict';
  elementSuite('vca-colour-picker', function() {
    test('setting the web value should be reflected in the RGB values', function(done) {
      this.set(function(element) {
        element.web = '#FFCC88';
      }).then(function(element) {
        assert.equal(element.r, 255);
        assert.equal(element.g, 204);
        assert.equal(element.b, 136);
      });
    });
  });
}());

The setTimeout depending on the milliseconds specified fails occasionally. I used the Unit Testing Polymer Elements guide to determine the Platform.flush and the setTimeout but it seems unreliable for testing.
Is there a reliable way I can make sure the then function is ran after the Polymer attribute changes have propagated?


text:
Q: MPDF pdf is not opening in any browser, no error showing in Codeignitor i've used mpdf for dynamic pdf generation, PDF is working fine but in online server when i'm trying to preview the pdf in browser or download it to my pc , it shows "Unable to Load Pdf".
I've also tried to check it into editor, i've not found any curropted error symbol.
Ob_clean(); // not working for me

here is my code:-
<?php
        require_once 'vendor/autoload.php';

        $mpdf = new \Mpdf\Mpdf();

        $mpdf->WriteHTML('

                        HI,

                                I am

                                '.$_POST['input1'].'

                                '.$_POST['input2'].'

        ');
        $file_name = "resume.pdf";

        $mpdf->Output($file_name, 'I');
    }

?>

A: Mpdf needs PHP 5.4+
Make sure that you provide the following required PHP modules:

*

*gd

*mbstring

If not for example in Linux we can install by using following two commands(change 7.0 to your server's PHP version)
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-mbstring

IMPORTANT : Also check the group where resume.pdf saving is www-data and it has write permission there recursively.
We can add it by following commands
sudo chgrp -R www-data folderpathhere/
sudo chmod -R g+w folderpathhere/


text:
Q: Removing defalt background on item selection in Telerik RadListView for UWP I am using the Telerik RadListView Control in my UWP application. I want to remove the default selection background provided by the RadlistView which is shown in green in the image here

A: Telerik for UWP is now open source. You could see its all code from GitHub: https://github.com/telerik/UI-For-UWP
For your question, if you debug your project in visual studio and check its visual tree, you would see that it actually is a Grid control named as 'CheckBox'.

So, what we need to do is finding the style of RadListViewItem and change the 'CheckBackground[Path]' fill color when it's selected.
Then, the style of RadListViewItem also could be found on github:https://github.com/telerik/UI-For-UWP/blob/master/Controls/DataControls/DataControls.UWP/Themes/Generic.xaml#L705
You could copy it and apply it for your own project. To achieve your requirement, you just need to change the 'Selected' visual state in this style.
I made a code sample for your reference:
xmlns:telerikDataControls="using:Telerik.UI.Xaml.Controls.Data"
xmlns:listView="using:Telerik.UI.Xaml.Controls.Data.ListView"
<Grid>
    <Grid.Resources>
        <SolidColorBrush x:Key="TelerikSecondaryForegroundBrush" Color="#99FFFFFF" />
        <SolidColorBrush x:Key="TelerikSelectedBrush" Color="#FF006AC1" />
        <SolidColorBrush x:Key="TelerikHighlightBrush" Color="#FF006AC1" />
        <Style TargetType="listView:RadListViewItem">
            <Setter Property="TabNavigation" Value="Local" />
            <Setter Property="UseSystemFocusVisuals" Value="True" />
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="BorderBrush" Value="Transparent" />
            <Setter Property="BorderThickness" Value="4" />
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Padding" Value="5" />
            <Setter Property="MinHeight" Value="55" />
            <Setter Property="MinWidth" Value="55" />
            <Setter Property="Margin" Value="5" />
            <Setter Property="Canvas.ZIndex" Value="10" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="listView:RadListViewItem">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grid" Storyboard.TargetProperty="Opacity">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding DisabledStateOpacity, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectedState">
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBox" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderBrush">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unselected">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckBox" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="border" Storyboard.TargetProperty="BorderBrush">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding BorderBrush, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ReorderState">
                                    <VisualState x:Name="ReorderEnabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ReorderHandle" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="ReorderDisabled" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="grid" Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}">
                                <ContentControl x:Name="PART_Content" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" Margin="{TemplateBinding Padding}"
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalAlignment}"
                                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                                        Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
                                        IsTabStop="False" />
                                <Border x:Name="border"
                                IsHitTestVisible="False"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{x:Null}" />
                                <Grid x:Name="CheckBox" IsHitTestVisible="False" Visibility="Collapsed" Width="35" Height="35" Margin="4"
                              VerticalAlignment="Top" HorizontalAlignment="Right">
                                    <Path x:Name="CheckBackground"
                                IsHitTestVisible="False"
                                Stretch="Fill"
                                Fill="{StaticResource TelerikSelectedBrush}"
                                Data="M0,0 L86.1743,0 L86.1743,86.1743 z"
                                StrokeLineJoin="Round" StrokeThickness="0">
                                    </Path>
                                    <Path x:Name="CheckMark"
                                IsHitTestVisible="False"
                                Stretch="Fill"
                                Fill="White" Margin="16,0,0,17"
                                Data="M0,119 L31,92 L119,185 L267,0 L300,24 L122,250 z"
                                StrokeLineJoin="Round" StrokeThickness="0" />
                                </Grid>
                                <Border Background="Transparent"
                                HorizontalAlignment="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                              Converter={StaticResource orientationToHorizontalAlignmentConverter},
                                                              ConverterParameter=First}"
                                VerticalAlignment="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                              Converter={StaticResource orientationToVerticalAlignmentConverter},
                                                              ConverterParameter=First}"
                                Height="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                 Converter={StaticResource orientationToSizeConverter},
                                                 ConverterParameter=Height}"
                                Width="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                 Converter={StaticResource orientationToSizeConverter},
                                                 ConverterParameter=Width}"
                                x:Name="PART_FirstHandle" Visibility="Collapsed" x:DeferLoadStrategy="Lazy" />
                                <Border Background="Transparent"
                                HorizontalAlignment="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                              Converter={StaticResource orientationToHorizontalAlignmentConverter},
                                                              ConverterParameter=Second}"
                                VerticalAlignment="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                              Converter={StaticResource orientationToVerticalAlignmentConverter},
                                                              ConverterParameter=Second}"
                                Height="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                 Converter={StaticResource orientationToSizeConverter},
                                                 ConverterParameter=Height}"
                                Width="{Binding Path=Orientation, RelativeSource={RelativeSource TemplatedParent},
                                                 Converter={StaticResource orientationToSizeConverter},
                                                 ConverterParameter=Width}"
                                x:Name="PART_SecondHandle" Visibility="Collapsed" x:DeferLoadStrategy="Lazy" />
                                <BitmapIcon x:Name="PART_ReorderHandle" UriSource="{Binding HandleIconPath, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                    ManipulationMode="None" Width="48" Height="48"  HorizontalAlignment="Right" VerticalAlignment="Center"
                                    Visibility="Collapsed" x:DeferLoadStrategy="Lazy">
                                    <BitmapIcon.RenderTransform>
                                        <RotateTransform CenterX="0.5" CenterY="0.5" Angle="{Binding Orientation, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource orientationToRotateDegreesConverter}}" />
                                    </BitmapIcon.RenderTransform>
                                </BitmapIcon>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Grid.Resources>
    <telerikDataControls:RadListView x:Name="listView">
    </telerikDataControls:RadListView>
</Grid>


text:
Q: Refresh Android Activity from outside mainActivity (Adapter class) I searched over it and found two results:
Call
1
recreate();

2
startActivity(getIntent());
finish();

But I want to refresh the activity NOT from within the activity.
I have more than one fragments, each fragment has listViews which has buttons.
My listView is populated by the data on the server. On button Click I am changing my data on the server and want to refresh all the listViews (so as to make them load new content). The onClick() function is in the listAdapter. So is there any way to refresh whole Activity from this listAdapter class.
OR
Way to refresh fragments from the listAdapter class.

A: You should call notifyDataSetChanged() on your Adapter. See this question

A: Pass the context of your activity to your ListView and call this method from your list view
((Activity)context).recreate();


text:
Q: How to enable Gzip compression on CentOS 7 server running remi-php74 on Apache? So far I have done the following based on what I've found;
yum -y install lzip oniguruma oniguruma-devel
yum install pcre-devel gcc zlib zlib-devel  libzip-devel make
yum -y install php74-php-pecl-zip.x86_64
echo "extension=/opt/remi/php74/root/usr/lib64/php/modules/zip.so" >> /etc/php.d/zip.ini
systemctl restart httpd

Contents of my .htaccess file -
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype
# For Olders Browsers Which Can't Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

What am I missing or need to do?
According to testing on https://www.giftofspeed.com/gzip-test/ GZip compression is still not working.


text:
Q: Equivariant sheaves over affine schemes Let $k$ be a field, let $G$ be a linear algebraic group over $k$ and
let $A$ be a commutative $k$-algebra which is acted on by $G$.
We say that an $A$-module $M$ is a $(G,A)$-module if it satisfies the following two properties:
1) $M$ is a rational $G$-module (over $k$)
2) The multiplication map $A \otimes M \rightarrow M$ is a morphism of
rational $G$-modules.
If we let $X=\text{Spec}(A)$ and view $M$ as a quasi-coherent sheaf on $X$,
then giving $M$ the structure of a $(G,A)$-module should be equivalent to giving it the structure of a $G$-equivariant sheaf on $X$
(see https://en.wikipedia.org/wiki/Equivariant_sheaf). Is there an easy, explict way to see why these two definitions coincide?


text:
Q: "potentially dangerous Request.Form value" I am getting the error

A potentially dangerous Request.Form value was detected from the client

when I deploy my application (the error does not happen when I run via localhost).
It occurs when submitting a form, because one of the fields contains HTML. I have added [AllowHtml] around the property in the model that corresponds to the offending form-field, but this does not seem to work.
I would rather not use [ValidateInput(false)] on the action method for obvious reasons, and at any rate, that doesn't seem to work either.
Is there any other configuration I need to be doing? I have read that adding
<httpRuntime requestValidationMode="2.0"/>

to the web config file could fix it, but again I don't want to add that because I still want secure validation for other parts of my application.
Any ideas?

A: [AllowHtml] requires you to add <httpRuntime requestValidationMode="2.0"/> (setting this value doesn't mean that you don't get secure validation, it's just the validation mode). Other parts of the site will be secure, you are disabling validation only for the particular property on your view model.

[ValidateInput(false)] will work but as you said it might be less secure as it disables validation for all properties.
I would stick with [AllowHtml].

UPDATE:
Both [AllowHtml] and [ValidateInput(false)] work out of the box in ASP.NET MVC 3 without the requirement of adding <httpRuntime requestValidationMode="2.0"/> in web.config. This was necessary in ASP.NET MVC 2 running under ASP.NET 4.0
Here's an example:
View model:
public class MyViewModel
{
    [AllowHtml]
    public string Text { get; set; }
}

Controller:
public class HomeController : Controller
{
    public ActionResult Index()
    {
        var model = new MyViewModel
        {
            Text = "<html/>"
        };

        return View(model);
    }

    [HttpPost]
    public ActionResult Index(MyViewModel model)
    {
        return View(model);
    }
}

View:
@model MyViewModel
@using (Html.BeginForm())
{
    @Html.TextAreaFor(x => x.Text)
    <input type="submit" value="OK" />
}

When the form is submitted no exception is thrown.