text:
Q: Erro "esta pagina não está funcionando" em site hospedado no AWS Estou configurando a hospedagem de um site PHP em um servidor gratuiuto da AWS, a pagina inicial de login está aparecendo corretamente, e quando eu confirmo o form de login, ele vai para a página que verifica os dados de login, e se os dados estão corretos, ele vai para a pagina principal, e se algo da errado ele volta para a pagina de login com a mensagem de erro por GET, porém ao carregar a pagina de verificação ele da o erro de Esta página não está funcionando, fiz alguns testes dando echo em algumas partes do código para verificar onde que ele está "travando" e acabei descobrindo que o erro é na parte de conexão ao banco de dados, que está hospedado no Hostgator.
Código da função que conecta ao banco de dados:
function conectardb(){
        $conexao = mysqli_connect('host', 'usuario', 'senha', 'banco');
        //testar a conexao
        if (mysqli_connect_errno()) {
            echo "FALHA NA CONEXÃO";
        }

        return $conexao;
    }

O código acima está em uma pagina separada, porém tentei usar na mesma página e o erro persiste. Ele não chega a printar o FALHA NA CONEXÃO no if.
O mesmo código de conexão, se conectando ao mesmo host do Hostgator está funcionando corretamente quando o site está hospedado localmente.
Gostaria de saber se alguém ja passou por uma situação parecida ou tem alguma ideia de como resolver, grato desde já!


text:
Q: How to create a ruby API for a java application I have a web application written mostly in Java. There are a few users that hope to use ruby to tailor this application to suit their own needs. How would I write an API that allows Ruby developers to interact with my application?
I'm really looking for some direction here - I know it's a broad question..

A: You could write up a simple web service using JRuby + Rails.
Learn more about JRuby here: http://jruby.org/
The main advantage of using JRuby is that you will be able to leverage your existing Java code.  The main advantage of using Ruby on Rails is that developing a web service will be a painless, even pleasurable experience.
And if you design your API in a RESTful manner, you can have Ruby programmers consume your API using ActiveResource
Resources:

*

*Quick intro to JRuby on Rails: 120 second guide.

*Great book if you want to get started: Ola Bini's Book

A: I think rmk has the right idea here, but I think rails is overkill.  You've really got two feasible options:
The first option would be to leverage JRuby to allow them to provide JRE classes that you can interface with your code.  They can write classes in ruby, compile them with JRuby, and you can deploy them with your app.
The other viable option would be to create a restful API using your existing java codebase and let them consume your api from ruby, much like rmk suggests.  If you're providing a restful api, there's no need to add the overhead of jruby and rails unless you have some desire to.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Python Subprocess : Launch script in a 32 bits conda environment from a 64 bits environment I'm trying to launch, from a python 64 bits conda environment, another python script within a 32 bits conda environment on Windows 7.
Unfortunately, I cannot get it working, I succeded launching the same environment by doing so:
In the conda py35 env (64 bits)
import subprocess, json, shlex
arg1, arg2 = 1,2
args = shlex.split('python myScript.py {} {}'.format(arg1, arg2))
######################## Call subprocess
process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process.wait()
stdout, stderr = process.communicate()
jsonData = stdout.decode()
data = json.loads(jsonData)
print(data)

In the file myScript.py supposed to run in the py34 env (32 bits)
import sys, json
arg1, arg2 = sys.argv[1], sys.argv[2]
out1, out2 = int(arg2), int(arg1) #out1, out2 = some_function(arg1, arg2)
jsonData = json.dumps({'out1' : out1, 'out2' : out2})
print(jsonData)

This example works and outputs what I want {'out1': 2, 'out2': 1} but myScript.py is not running within the 32 bits env, which is a requirement as I am going to use some legacy functions running only on 32 bits.
I tried to change the call to subprocess with the following:
process = subprocess.Popen(args, env = 'C:\Appl\Miniconda3_32bits\envs\py34\Scripts\activate', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
AttributeError: 'str' object has no attribute 'values'

Or with two following calls:
process = subprocess.Popen(['CALL', 'C:\Appl\Miniconda3_32bits\envs\py34\Scripts\activate'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process.communicate(args)

File "C:\Appl\Minconda3_64bits\envs\py35\lib\subprocess.py", line 955, in _execute_child
startupinfo)
FileNotFoundError

Or by changing the arguments:
args = shlex.split('CALL C:\Appl\Miniconda3_32bits\envs\py34\Scripts\activate python myScript.py {} {}'.format(arg1, arg2))

If you have any recommandations about how to get it working. I have only found previous questions about starting a new process within the same environment. I am quite puzzled about how to get it working and if my attempt is the best way to address this problem in a pythonic way.


text:
Q: C++ multidimensional arrays possibilities I would like to translate some existing Matlab code that quite naturally uses a lot of multidimensional arrays and I wonder what are the possible options. I want the containers to have copy constructors, default constructors, if possible clear error messages at compilation, access via A[i][j] and in general not to be troublesome. Preferably, they should use the std::move operation for speed.
As far as I can see the options boils down to:

*

*std::vector iterated. It sure works, but it seems stupid to write std::vector<std::vector<std::vector<double> > >for a 3D array. I am also concerned with the overhead in speed and memory.

*The boost::multiarray and blitz::Array offer most of the functionality but fails at the copy constructor (see stackoverflow) at runtime. It is unclear to me if there are valid reasons for that.

*The Eigen library seems to be very fast but it does not allow copy at all, and has no default constructor, which means that another container has to be used.

*The std::array has the disadvantage that the size has to be known when the object is created, so there is no default constructors.
Is there a simpler multidimensional container satisfying all the requests but more frugal than iterated std::vector?

A: I am not sure this can answer all your needs but I myself had to handle multi-dimensional arrays for creating meshes/grid and wanted to create my own class for that.
My class let's call it MultiArray uses a a one-dimension vector as container.
For instance, writing MultiArray<4, float, 10, 15, 10, 18> A() would create a multi array A[10][15][10][18] in a vector of size 10*15*10*18.
I can access to elements by single index A(i) or by coordinates A[i][j][k][l] by calling A({i,j,k,l}). For performance purpose I have precomputed in the constructor the product of the dimensions in order to compute fastly  coordinates->index or index->coordinates.
The code is generic for N dimensions. I can detail some parts if you want.

A: There is good linear algebra package called Armadillo
http://arma.sourceforge.net/
used it with R, happy user

A: You have missed another option:

*

*std::valarray

Depending on what your requirements are it could be useful.
http://www.cplusplus.com/reference/valarray/


text:
Q: display only 1 column from the subquery : list the bran_name whos avg price is >= 3 and also have at least 2 distinct products Here is my query:
select avg(p2.price), p2.brand_name, count(distinct p2.product_id)
count_of_products
from product p2
group by p2.brand_name
having count(distinct p2.product_id) >= 2 and avg(p2.price) > 3

but I need to display only band_name in the final query.
I tried this:
select p1.brand_name from product p1,
(select avg(p2.price), p2.brand_name, count(distinct p2.product_id)
count_of_products
from product p2
group by p2.brand_name
having count(distinct p2.product_id) >= 2 ) p2 and and avg(p2.price) > 3
where
p1.brand_name = p2.brand_name

but it gives me following error:
>[Error] Script lines: 3-9 --------------------------
 No column name was specified for column 1 of 'p2'.

A:
but I need to display only band_name in the final query

So just remove the other columns from the select clause:
select brand_name
from product
group by brand_name
having count(distinct product_id) >= 2 and avg(price) > 3


text:
Q: How to change ownership of a binary generated through Bazel? Suppose I have a binary that is generated from the following rule:
cc_binary(
  name = "script",
  srcs = ["script.c"],
)

I am then using this binary in my tests:
cc_test(
  name = "test",
  srcs = ["test.cc"],
  data = [":script"],
)

My question is: Is it possible to change the ownership (chown root:root) and permissions (chmod +s) of this binary through bazel itself?
The binary contains some commands that can only be executed by root, hence the need to change ownership and permissions.

A: Bazel tests are run in a sandbox. The details depend on your operating system, what flags you're passing to bazel, and which bazel version. tags = ["requires-fakeroot"] (on your cc_test) is the way to ask a sandbox implementation to run a test as root. As the documentation says This is only supported on Linux. though.
That tag results in the test being run as root within its namespace. That means it can do many things root can (create suid root files, mount things, configure network devices, etc), but nothing with effects outside of the namespace (so it can't shut down your computer for example).
The permissions you mentioned would make the file setuid root. Normal users can't do that because then you could just make a copy of bash suid root, run it, and become root. That means you'll need to run your build as root if it's going to produce a setuid root file, which is not the usual way to run bazel. If you're just looking to create setuid root files on your target system, I would package the files in a tarball with pkg_tar and use mode = "6555" to make it suid. The default owner is 0.0, aka root, already.


text:
Q: valueupdate enables dirtyflag in knockout This is my html
<textarea id="emp" data-bind="value: lastName, valueUpdate: 'afterkeydown', restrictnumberofwords : 50,  event: { keydown: test}" ></textarea>

this is knockout code
ko.bindingHandlers.restrictnumberofwords = {
update: function(element, valueAccessor, allBindingsAccessor, viewModel)
{

   element.value = element.value.substr(0, valueAccessor());
   allBindingsAccessor().value(element.value.substr(0, valueAccessor()));
}
};

function test(data, e) {

    //some logic which will restrict user to type specific number of characters
}

In my actual code i have autosave fuctionality which will make dirtyflag true whenever we type something in textarea. But i dont want to enable dirtyflag everytime user types in textarea. it should only enable autosave if we tab out from control. How to acheive it?

A: You can use the textInput binding for live updates, and the value binding for updates on blur:

const liveInput = ko.observable("");
const slowInput = ko.observable("");
const charCount = ko.pureComputed(() => liveInput().length);

ko.applyBindings({ liveInput, slowInput, charCount });

<input data-bind="textInput: liveInput, value: slowInput" placeholder="type to see two values sync">

Live:

On blur:

Char. count:

A: Your code looks good, I think you need to remove value update.
<textarea id="emp" data-bind="value: lastName,  restrictnumberofwords : 50,  event: { keydown: test}" ></textarea>


text:
Q: Can I set a timeout for copying files in Ubuntu? I'm still learning ubuntu.  I'm attempting to pull some data from a HDD in Ubuntu 14.xx.  Currently it says I have 8,011 hours left to pull ~150GB via USB.  To speed this up, is there any way to set a timeout option with the copy function to allow it to skip corrupted files after a set length of time, forcing it to continue?  Is there a better way of doing this?

A: For copying data off a failing drive I highly recommend ddrescue.
As the manual states you can rescue the most important part of the drive first:
ddrescue -i0 -s50MiB /dev/hdc hdimage logfile
ddrescue -i0 -s1MiB -d -r3 /dev/hdc hdimage logfile

Then rescue some key drive areas:
ddrescue -i30GiB -s10GiB /dev/hdc hdimage logfile
ddrescue -i230GiB -s5GiB /dev/hdc hdimage logfile

Finally rescue the rest (does not recopy what is already done):
ddrescue /dev/hdc hdimage logfile
ddrescue -d -r3 /dev/hdc hdimage logfile

You can add the -T <interval> or --timeout=<interval> option if you want.


text:
Q: How to design responsive images for ViewPager2 I use ViewPager2 in android application. The width of it is match_parent and the height is 300 dp.  I use Picasso library to load images from URL to ViewPager2. There is one problem is when I use a tablet, the image's width must match to parent but height is fixed and it makes images ugly.
What is the best way to show images but on different devices?
Picasso.get()
    .load(slideritem1.getimage())
    .fit()
    .into(imageView);


text:
Q: How to reduce the number of pages in pagination The code below is the function for pagination in my wordpress blog. Presently it outputs 7 pages and then the .. last page number.
How can I reduce this number so it shows only 5 pages and then ... last page number?
function emm_paginate_loop($start, $max, $page = 0) {
    $output = "";
    for ($i = $start; $i <= $max; $i++) {
        $output .= ($page === intval($i))
            ? "$i"
            : "$i";
    }
    return $output;
}

A: I believe you're using 2 custom functions one of them is emm_paginate_loop() you're showing. But i saw that settings for that custom pagination is on function emm_paginate() and specifically "gap":

'gap' - Default is 3 (int). The minimum number of pages before a gap is
        replaced with ellipses (...).

But that only sets a minimum number...

A: I think you'd be better off using a plugin for this. WP-Paginate gives you this option along with other options that might be useful
Edit
Since a plugin isn't advisable for a mobile site, maybe you could add $range = 5 to the function
function emm_paginate_loop($start, $max, $page = 0, $range = 5) {
    $output = "";
    for ($i = $start; $i <= $max; $i++) {
        $output .= ($page === intval($i))
            ? "$i"
            : "$i";
    }
    return $output;
}


text:
Q: Can't load RSS XML with namespace I have Apache 2.4 running on RHEL and have the following XML -
<?xml version="1.0" encoding="utf-8"?>
<rss>
<channel>
<title>This is a test</title>
<link>http://example.com/</link>
<description>This is a test</description>
<language>en-us</language>
<lastBuildDate>Wed, 06 Apr 2016 13:37:53 -0400</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Test</generator>
</channel>
</rss>

This loads just fine as expected in the browser. Now if this is changed to -
 <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
    <title>This is a test</title>
    <link>http://example.com/</link>
    <description>This is a test</description>
    <language>en-us</language>
    <lastBuildDate>Wed, 06 Apr 2016 13:37:53 -0400</lastBuildDate>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>Test</generator>
    </channel>
    </rss>

I get "the connection was reset". There is nothing in the apache access or error logs that can point to what might be causing this to not load. Also if I remove version="2.0" xmlns:xhtml="http://search.yahoo.com/mrss/" and add something like blah="blah" it works. The version or namespace declaration causes the XML to not load. Any help to approach this problem will be highly appreciated.
MORE DETAILS AS PER THE COMMENTS

*

*The XML file is static and not generated but PHP or any other code

*If I change the extension to .txt or .html, it works just fine.

*If I have version or namespace attribute (one or the other), the file does not render. So both these fails- <rss version="2.0"> <rss xmlns:media="http://search.yahoo.com/mrss/">

*If I rename the node <rss> to <rss1>, it works.

*Tested all browsers, also wget and same results

*PHP is installed on this server. Can any extensions cause this?

A: This was happening over a limited access VPN that had restrictions for RSS and MP4 traffic.


text:
Q: how to enable syntax highlighting for c code in a textview on android studio? I created an application for students to learn software with examples. I have published it in play store. I'm continuing developemnt on this application. I want show syntax highlighting in all c codes but I haven't found a way to do it . I tried a lot of way to add syntax highlighting but It is not possible.

A: If I got your requirements right, correct me if I'm wrong. You need to show syntax highlighting for code snippets (c language) on a text view, which your already exiting play store app only shows in black and white.
To get the highlighted html of the code snippet you could use this site and then you could get the html of the highlighted code snippet from the HTML Code section of the above linked site. After which you have two options to show it on the android application.

*

*Using the TextView
Using java you could populate the text view with the following util method
myTextView.setTextsetText(Html.fromHtml("
#include <stdio.h>\n" +
        "int main()\n" +
        "{\n" +
        "   // printf() displays the string inside quotation\n" +
        "   printf(\"Hello, World!\");\n" +
        "   return 0;\n" +
        "}\n" +
        "
"));

*Using WebViews
Once again using java you could populate a webView with the html code you obtained from the above mentioned site.
WebView webView  = (WebView) findViewById(R.id.webView);
webView.loadData("
#include <stdio.h>\n" +
        "int main()\n" +
        "{\n" +
        "   // printf() displays the string inside quotation\n" +
        "   printf(\"Hello, World!\");\n" +
        "   return 0;\n" +
        "}\n" +
        "
","text/html", "UTF-8");


text:
Q: How to find out who called a method? Example: When my method -fooBar gets called, I want it to log in the console which other method of which other class called it.
Right now, I only know how to log the method name of fooBar itself and it's class, with this:
_cmd

[self class]

Is this possible to figure out?

A: How about this:
NSString *sourceString = [[NSThread callStackSymbols] objectAtIndex:1];

NSCharacterSet *separatorSet = [NSCharacterSet characterSetWithCharactersInString:@" -[]+?.,"];
NSMutableArray *array = [NSMutableArray arrayWithArray:[sourceString  componentsSeparatedByCharactersInSet:separatorSet]];
[array removeObject:@""];

NSLog(@"Class caller = %@", [array objectAtIndex:3]);
NSLog(@"Method caller = %@", [array objectAtIndex:4]);

Credits to the original author, intropedro.

A: In fully optimized code, there is no 100% surefire way to determine the caller to a certain method.   The compiler may employ a tail call optimization whereas the compiler effectively re-uses the caller's stack frame for the callee.
To see an example of this, set a breakpoint on any given method using gdb and look at the backtrace.  Note that you don't see objc_msgSend() before every method call.  That is because objc_msgSend() does a tail call to each method's implementation.
While you could compile your application non-optimized, you would need non-optimized versions of all of the system libraries to avoid just this one problem.
And this is just but one problem;  in effect, you are asking "how do I re-invent CrashTracer or gdb?".   A very hard problem upon which careers are made.   Unless you want "debugging tools" to be your career, I would recommend against going down this road.
What question are you really trying to answer?

A: It's not possible in the general case without actually walking the stack. There's not even a guarantee that another object send the message that called the method. For example, it could be called from a block in a signal handler.

A: NSLog(@"Show stack trace: %@", [NSThread callStackSymbols]);

A: See backtrace(3).

A: User the below method

Pass index for which you want to display method and pass -1 if you want to display full stack of method
+(void) methodAtIndex:(int)index{
    void* callstack[128];
    int frames = backtrace(callstack, 128);
    char** strs = backtrace_symbols(callstack, frames);

    if (index == -1) {
        for (int i = 0; i < frames; ++i) {
            printf("%s\n", strs[i]);
        }
    }
    else {
        if (index < frames) {
            printf("%s\n", strs[index]);
        }
    }
    free(strs);

}

A: This information can be obtained using DTrace.

A: Make a macro that adds the __FUNCTION__ to the function name to the function call.  This macro will then call your function with an extra parameter of a char* to the target function.

A: I was trying to catch who, how and when changes window's size and did some handwork:
- (void)logWindowWidth:(NSString *)whoCalls {
   NSLog(@"%@", whoCalls);
   NSLog(@"self.window.size.width %f", self.window.size.width);
}

-(void)someMethod {
  [self logWindowWidth:@"someMethod - before"];
  ...
  [self logWindowWidth:@"someMethod - after"];
}

-(void)anotherMethod {
  [self logWindowWidth:@"anotherMethod - before"];
  ...
  [self logWindowWidth:@"anotherMethod - after"];
}


text:
Q: Center of a circle from two chords. If two chords of a circle intersect and are $\perp$ to each other, is it possible to find the distance from the intersection point of the chords to the center?
I was trying to use the power of a point argument.

A: Draw congruent chords parallel to those you have, and get this symmetric picture.

The central rectangle has width $AB-2BK$ and height $CD-2CK$. The center of the circle is at the intersection of the rectangle's diagonals, so the distance from $K$ to the center is half the length of a diagonal of the rectangle, or $\dfrac{1}{2}\sqrt{(AB-2BK)^2+(CD-2CK)^2}$

A: The short answer is yes, it is possible.

The general outline of finding the distance $KO$ is this:
Given the lengths $AK, BK, CK$, and $DK$, use the Pythagorean Theorem to find the lengths of the sides of cyclic quadrilateral $ABCD$ and use Theorem 2 in this question to find the radius of the circle.
Once you have that, you can find the length of the perpendicular line from $AB$ passing through $O$. By Pythagoras, this is equal to
$$m=\sqrt{r^2-\left(\frac{AK+BK}{2}\right)^2}$$
and, in turn, you can find $KO$ by using Pythagoras once again:
$$KO=\sqrt{m^2+\left(\frac{AK-BK}{2}\right)^2}$$


text:
Q: Text color doesnt change after hover

@charset "utf-8";
/* CSS Document */
a.header {
 text-decoration: none;
 color: #e4703e;
}

a.header1 {
 text-decoration: none;
 color: #E74C3C;
}

a.header2 {
 text-decoration: none;
 color: #00aced;
}

a.header3 {
 text-decoration: none;
 color: #2C3E50;
}

a.header4 {
 text-decoration: none;
 color: #517fa4;
}

a.header5 {
 text-decoration: none;
 color: #E74C3C;
}

a.header6 {
 text-decoration: none;
 color: #E74C3C;
}
* {
 padding: 0;
 margin-top: 0px;
 margin-right: 0px;
 margin-left: 0px;
 margin-bottom: 0px;
 font-family: 'Lato', sans-serif;
 box-sizing: border-box;
}

.float-right {
  float: right;
}

.fa {
 font-size: .8em;
 font-family: 'FontAwesome';
 line-height: 22px !important;
 margin-right: 2px;
}

dropdown {
 display: inline-block;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 vertical-align: top;
}

dropdown label, dropdown ul li {
  display: block;
  width: 200px;
  background: #FFFFFF;
  padding: 15px 20px;
}

dropdown label:hover, dropdown ul li:hover {
  background: #e4703e;
  color: white;
  cursor: pointer;
}

dropdown label {
  color: #e4703e;
  border-left: 4px solid #e4703e;
  position: relative;
  z-index: 2;
}

dropdown input {
  display: none;
}

dropdown input ~ ul {
  position: relative;
  visibility: hidden;
  opacity: 0;
  top: -20px;
  z-index: 1;
}

dropdown input:checked + label {
 background: #e4703e;
 color: white;
}

dropdown input:checked ~ ul {
  visibility: visible;
  opacity: 1;
  top: 0;
}

.link1, dropdown ul li:nth-child(1) {
  border-left: 4px solid #E74C3C;
  text-decoration: none;
  color: #E74C3C;
}
dropdown ul li:nth-child(1) .fa {
  color: #E74C3C;
}
dropdown ul li:nth-child(1):hover {
  background: #E74C3C;
  color: #FFFFFF;

}
dropdown ul li:nth-child(1):hover .fa {
  color: white;
}

dropdown ul li:nth-child(2) {
  border-left: 4px solid #00aced;
}
dropdown ul li:nth-child(2) .fa {
  color: #00aced;
}
dropdown ul li:nth-child(2):hover {
  background: #00aced;
  color: #FFFFFF;
}
dropdown ul li:nth-child(2):hover .fa {
  color: white;
}

dropdown ul li:nth-child(3) {
  border-left: 4px solid #2C3E50;
}
dropdown ul li:nth-child(3) .fa {
  color: #2C3E50;
}
dropdown ul li:nth-child(3):hover {
  background: #2C3E50;
  color: white;
}

dropdown ul li:nth-child(3):hover .fa {
  color: white;
}
dropdown ul li:nth-child(4) {
  border-left: 4px solid #517fa4;
}
dropdown ul li:nth-child(4) .fa {
  color: #517fa4;
}
dropdown ul li:nth-child(4):hover {
  background: #517fa4;
  color: white;
}
dropdown ul li:nth-child(4):hover .fa {
  color: white;
}

dropdown ul li:nth-child(5) {
  border-left: 4px solid #bb0000;
}
dropdown ul li:nth-child(5) .fa {
  color: #bb0000;
}
dropdown ul li:nth-child(5):hover {
  background: #bb0000;
  color: white;
}
dropdown ul li:nth-child(5):hover .fa {
  color: white;
}

dropdown ul li:nth-child(6) {
  border-left: 4px solid #517fa4;
}
dropdown ul li:nth-child(6) .fa {
  color: #517fa4;
}
dropdown ul li:nth-child(6):hover {
 background: #517fa4;
 color: #E74C3C;
}
dropdown ul li:nth-child(6):hover .fa {
  color: white;
}

.animate {
  -webkit-transition: all .3s;
  -moz-transition: all .3s;
  -ms-transition: all .3s;
  -ms-transition: all .3s;
  transition: all .3s;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Chrome and Safari */
  -moz-backface-visibility: hidden;
  /* Firefox */
  -ms-backface-visibility: hidden;
  /* Internet Explorer */
}

@charset "utf-8";
/* CSS Document */

body {
  margin-top: 180px;
  background-color: #112;
  background-color: #0c2d41;
  font-family: roboto, 'helvetica neue', helvetica, arial, sans-serif;
}
.container {
  width: 800px;
  margin: auto;
}
.row {
  position: relative;
  height: 50px;
  z-index: 1;
  clear: both;
  margin-bottom: 30px;
  text-align: center;
}
.row--intro {
 padding-top: 10px;
 font-size: 16px;
 line-height: 28px;
 font-weight: 300;
 color: #fff;
 opacity: 0.4;
 margin-right: 0px;
}
.row--intro span {
  font-size: 11px;
}
.skew-title {
  font-size: 25px;
}
.skew-title span {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 50px;
  margin: auto;
  z-index: 2;
  text-align: center;
  color: #fff;
  font-family: 'roboto condensed';
  font-weight: 700;
  font-size: 35.714285714285715px;
  line-height: 50px;
  -webkit-transform: skewY(-15deg);
      -ms-transform: skewY(-15deg);
          transform: skewY(-15deg);
  -webkit-transform-origin: 0 100%;
      -ms-transform-origin: 0 100%;
          transform-origin: 0 100%;
  -webkit-transition: all 0.2s;
          transition: all 0.2s;
  cursor: default;
}
.skew-title span:after,
.skew-title span:before {
  display: block;
  top: 0;
  left: 0;
  position: absolute;
  background: #185a81;
  height: 50px;
  width: 40px;
  content: ' ';
  z-index: -1;
  -webkit-transition: all 0.2s;
          transition: all 0.2s;
}
.skew-title span:before {
  background: rgba(0,0,0,0.1);
  -webkit-transform: skewY(15deg);
      -ms-transform: skewY(15deg);
          transform: skewY(15deg);
  -webkit-transform-origin: 0 0;
      -ms-transform-origin: 0 0;
          transform-origin: 0 0;
}
.skew-title span:nth-child(even) {
  background-color: #154e70;
  -webkit-transform: skewY(15deg);
      -ms-transform: skewY(15deg);
          transform: skewY(15deg);
  -webkit-transform-origin: 100% 100%;
      -ms-transform-origin: 100% 100%;
          transform-origin: 100% 100%;
}
.skew-title span:nth-child(even):after {
  background-color: #154e70;
}
.skew-title span:nth-child(even):before {
  -webkit-transform-origin: 100% 0;
      -ms-transform-origin: 100% 0;
          transform-origin: 100% 0;
  -webkit-transform: skewY(-15deg);
      -ms-transform: skewY(-15deg);
          transform: skewY(-15deg);
}
.skew-title span.flat {
  -webkit-transform: skewY(0);
      -ms-transform: skewY(0);
          transform: skewY(0);
}
.skew-title span.flat:before {
  -webkit-transform: skewY(0);
      -ms-transform: skewY(0);
          transform: skewY(0);
}
.skew-title span.flat:nth-child(even):after {
  background-color: #185a81;
}
.skew-title span.alt:after {
  background-color: #b94a2c;
}
.skew-title span.alt:nth-child(even):after {
  background-color: #a14026;
}
.skew-title span.alt.flat:nth-child(even):after {
  background-color: #b94a2c;
}

.blueline {
 color: #326c9c;
}
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>CodePen - Skewed title text</title>
    <link href="http://fonts.googleapis.com/css?family=Roboto:400,300,700" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:700" rel="stylesheet" type="text/css">
    <link href="css/skew.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet" type="text/css">
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="css/dropdown.css" rel="stylesheet" type="text/css">

                J
                O
                O
                S
                T
                L
                E
                K

                T
                E
                C
                H

Making games since 2014!

            <dropdown>
                <input id="toggle" type="checkbox">

                    Home

Processing

            </dropdown>
            <dropdown>
                <input id="toggle2" type="checkbox">
                Games

                            Venture

            </dropdown>
            <dropdown>
                <input id="toggle3" type="checkbox">
                Coding

                            Codepen

                            Github

            </dropdown>
            <dropdown>
                <input id="toggle4" type="checkbox">
                Contact Me

Google+

Twitter

Steam

Facebook

Youtube

Instagram

            </dropdown>

My second menu thing the dropdown is not changing to white when hovering and there is a random orange bar there somehow, how to fix? I want it to be a link without line and with a color matching its color code

A: Add the following to your css code
    dropdown ul li a {
      color: inherit;
      text-decoration: none;
    }

   dropdown ul li a:hover {
      color: white;
      background: #E74C3C;
      text-decoration: none;
    }


text:
Q: How to push notifications to iOS with Google Cloud Messaging We have succesfully managed to send push notifications on Android from GCM, but I was wondering how can I connect to Apple Push Notification Service with GCM? Do I need to download some API´s on the client side or is everything supported on the backend? I am using Xamarin.Forms to develop the frontend.

A: You will have to use APNS or 3rd party stuffs like PushSharp
Please have a look at the following threads. There is a bit of configuring required to have push notifications enabled in Ios. You need a couple of certificates.
http://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/ios/remote_notifications_in_ios/
https://forums.xamarin.com/discussion/20845/how-to-approach-push-notifications-on-xamarin-forms-project

A: Google recently launched GCM for iOS. There is a Objective-C API available, however, I'm unsure if there is a Xamarin wrapper in place anywhere.

A: Xamarin has finally published the free component Google Cloud Messaging for iOS
And here is a link to nuget package.


text:
Q: Loop to unzip from one directory to individual directories I am trying to design a loop that implements a lot of single elements I have seen before and the combination is throwing me off.  Basically I have a structure like this:
/bin/script.sh
/conf/patches/1.zip
/conf/patches/2.zip
/conf/patches/3.zip
/sharedir

I want a loop that will go through however many patches I have in /conf/patches, unzip each patch into a separate directory in /sharedir.  Each directory should be named the name of the file.
What I was trying so far was:
for file in '../conf/patches/*.zip'
do
    unzip "${file%%.zip}" -d /sharedir/$file
done

As you can see...there is definitely something I am missing in this combination.

A: Remove quotes from glob pattern otherwise it is not expanded:
for file in ../conf/patches/*.zip
do
    unzip "${file%%.zip}" -d /sharedir/
done

EDIT: You can try
for f in ../conf/patches/*.zip; do
   echo g="${f%%/*}"
   unzip -d "sharedir/${g%*.zip}" "$f"
done

A: Try this:
for file in /conf/patches/*.zip
do
  f="${file##*/}"
  mkdir -p "/sharedir/${f%.zip}"
  unzip -d "/sharedir/${f%.zip}" "${file}"
done


text:
Q: No matching distribution found for multiple packages Suddenly I get a lot of errors while trying to use my previously working (for many months) requirements file.
I tried to go to the pypi.org and get the same 404 error.
Is there something wrong with my setup?
> pip install -r requirements.txt
Collecting get==2019.4.13 (from -r requirements.txt (line 4))
  Cache entry deserialization failed, entry ignored
Exception:
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/get/

If I remove line get==2019.4.13 next error is:
> pip install -r requirements.txt
Collecting post==2019.4.13 (from -r requirements.txt (line 11))
  Cache entry deserialization failed, entry ignored
Exception:
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/post/

A: PyPI administrator here. You probably unintentionally had request instead of requests in your requirements.txt file.
These projects (request, get, post) were removed by their author and no longer exist. You should remove them from your requirements.txt file.

A: I had the similiar problem. I have a django website deployed to Heroku. When I pushed my commit it threw errors like this:
remote:        ERROR: Could not find a version that satisfies the requirement post==2019.4.13 (from -r /tmp/build_f0948004/requirements.txt (line 26)) (from versions: none)
remote:        ERROR: No matching distribution found for post==2019.4.13 (from -r/tmp/build_f0948004/requirements.txt (line 26))

I deleted dependencies below that spat errors in requirements.txt:
get==2019.4.13
post==2019.4.13
request==2019.4.13

And I saved my commit and pushed it. Now it works fine.


text:
Q: FLOT Charts: Customising Axis I need to figure out how to do two custom axises with flot charts.
For the Y-Axis it must only show rounded numbers such as 100, 200, 400, 1000, 2000, 4000, 6000
So the first digit can be either a 1, or a multiple of 2. It can be 300, 500, 700 etc
the X-Axis must be broken down to exactly Week1, Week2, Week3, Week4, and Week5 for a month.
(It's fixed that even if there isnt enough days to fill it doesn't need to stretch to the end.
It's to show the break down of one month.)


text:
Q: Call variadic function in C++ with a vector of arguments Suppose I have a variadic function like this:
template <typename... A>
void func(A... args)
{
    //Do stuff
}

And I have also a vector like this:
enum Type{
    DOUBLE,
    STRING
};
std::vector<std::pair<std::string, Type>> varg;

So I want to iterate over the elements of the map and call the templated function with the specified types, like: varg = {{"a", Type::STRING}, {"1.2", Type::DOUBLE}};
should call func("a", 1.2)
Any hints on how to do that?

A: You are mixing up compile-time and runtime features here. (Hint: It won't work)
As a thought-experiment:
Suppose you have a std::vector<> of some kind, that is filled with some data, say with N entries. Note that this N is a priori only known at runtime!
Now you want to unpack these N data segments into a variadic template, something that has to be done compile-time! Templates are compile-time features!
This cannot work. You can in principle do something similar if you use compile-time containers (see boost::mpl). But these require, that you know (or can calculate) everything at compile-time.
Also you may want to look at boost::fusion which sort of tries to bridge this gap. Though you should always note that it cannot! Templates are still compile-time only.

A: At the lowest level (C-like), the application binary interface follows some  calling conventions, notably how arguments are transmitted to a function, and it usually depends on the type of the argument (often, pointers go in some processor registers and floating point numbers go in some other kind of registers).
If you want to call a function of unknown signature (i.e. you know its signature and the actual arguments and their number only at runtime, not at compile time) you need some ABI specific tricks, and probably some machine specific code. You might consider using the libffi which provides

a portable, high level programming interface to various calling conventions

BTW, you could consider packing or boxing your values in some "universal" container à la boost::any or QVariant or your own tagged unions, or perhaps boost::variant
Perhaps you might want to embed some interpreter in your application, e.g. GNU guile or Lua.
Noticve that for C or C++, functions and function pointers have some compile-time known signature which matters a lot. Calling something with the wrong signature (that is a function whose signature is not the one the compiler expects) is undefined behavior.


text:
Q: Does block parameters need to specify ownership qualifiers when providing weak references? I'm trying to use blocks in a way where I provide a reference to the object which retains the block, as follows:
typedef void(^RunBlock)(__weak Thing *block_owner, ThingFinishBlock finish);

where Thing has a property run_block, of the type RunBlock.
Thing *thing = [Thing thingWithBlock^(Thing *owner, ThingFinishBlock finish) { ... }];

Calling the run_block from within the Thing goes something like this:
__weak typeof(self) this = self;
_finish_block = ^(){ ... }
self.run_block(this, _finish_block);

So what I'm wondering now is, is it safe to define the run_block's first parameter Thing *owner without prefixing it with __weak, or will this cause a retain loop? I'm unsure, as the pointer is already defined as __weak in the typedef, and the given parameter is already __weak.
^(__weak Thing *owner ...){ ... }

As opposed to
^(Thing *owner, ...) { ... }

Thanks!

A: No, __weak in parameters is not part of the function type itself.
typedef void(^RunBlock)(__weak Thing *block_owner, ThingFinishBlock finish);

is the same as
typedef void(^RunBlock)(Thing *block_owner, ThingFinishBlock finish);

It's where you implement the block that the __weak in the parameter matters.
Also, I have no idea why you think this has anything to do with retain cycles.


text:
Q: nodejs or meteor- how get it working on OVH Cloud VPS I got problem using OVH CLOUD VPS and NodeJS / MeteorJS.
When trying to do meteor update I receive:
Unable to update package catalog (are you offline?)

If you are using Meteor behind a proxy, set HTTP_PROXY and HTTPS_PROXY environment variables or see this page for more details:  https://github.com/meteor/meteor/wiki/Using-Meteor-behind-a-proxy

When trying do any npm install package I get:
npm ERR! Error: connect ECONNREFUSED
npm ERR!     at errnoException (net.js:904:11)
npm ERR!     at Object.afterConnect [as oncomplete] (net.js:895:19)
npm ERR!  { [Error: connect ECONNREFUSED]
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

I have been googling for some time and all sollutions with making npm set registry or adding / deleting npm config (set / delete) proxy doesnt bring sollution.
Have any of you solved how to use NPM / METEOR on OVH VPS ?

A: similar question here:
npm not working - "read ECONNRESET"
answer I believe is:
npm config set registry http://registry.npmjs.org/
or https


text:
Q: set text and image in button on c# I have a WinForms application.
In the Main form I have some buttons and I want to add an image beside the text.
I set the background Image property to the image I want and on the FormLoad event
I set the image relation like that:
button1.TextImageRelation = TextImageRelation.ImageBeforeText;

so i was expecting to get something like a "list" when on the left side there is an image
and on the right side there is a text.
but all i'm getting now is the text on the center of the button and multiplicity of the image vertically and horizontally

A: You should use Image property of the button, not the BackgroundImage. The TextImageRelation works with the Image property.
This is an incorrect usage of BackgroundImage.

A: Ok I solved it by setting the BackgroundImageLayout to None

A: Do nothing with the FormLoad event. Just click the button you want to change image and text of and press F4, that will bring the properties window. find for text and set it to nothing i.e delete anything you find in the text. for image you need to find for image in properties window and then brouse your desired image. that's all


text:
Q: C# COM and attaching events So, I have this legacy type app I am trying to understand and maintain and need some help.
I have not dabbled much into Remoting but this solution appears to be using 3rd party COM components.
The documentation is reasonable but does not talk much about .NET and how to attach event handlers. Instead it documents (and is used in the solution) about how to create an instance of the object via Activator.CreateInstance.
so currently it is doing this:
mainObj = Activator.CreateInstance(Type.GetTypeFromProgID("xxxRemote.clsxxxJob"));

that's fine.
But I want to attach an event handler to listen to a specific event on that instantiated object created by the Activator.
The documentation gives me the events exposed but no examples on how to go about wiring them up when using this approach.
anyone have any ideas on how to wire up events when using COM like this?

A: it should be through normal reflection.
There's a guide in msdn like http://msdn.microsoft.com/en-us/library/ms228976(v=vs.110).aspx
The problem is that to define the methods that will be hooked to the events, you won't have the types defined and will have to do some IL emmiting black magic to build the methods in runtime. It's an interesting problem.
I'm sending an example of the "normal" way opening an ADO connection through COM (just to have something that will call an event handler). Then, I have another example of doing this, the hard way.
Sorry by the mess in the code, but it is just a sample.
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Reflection;
using ADODB;
using System.Reflection.Emit;

namespace COMTests.Tests
{
[TestClass]
public class UnitTest1
{
    private string server;
    private string database;
    private string user;
    private string password;

    [TestInitialize]
    public void Initialize()
    {
        this.server = "";
        this.database = "";
        this.user = "";
        this.password = "";
    }

    [TestMethod]
    public void TestCreateConectionTheSaneWay()
    {
        ADODB.Connection connection = new ADODB.Connection();
        connection.Provider = "sqloledb";
        connection.ConnectionString = String.Format("Server={0};Database={1};User Id={2};Password={3}",
            this.server, this.database, this.user, this.password);
        connection.ConnectComplete += new ADODB.ConnectionEvents_ConnectCompleteEventHandler(TheConnectionComplete);
        connection.Open();

    }

    [TestMethod]
    public void TestCreateConnectionTheInsaneWay()
    {
        Type connectionType = Type.GetTypeFromProgID("ADODB.Connection");

        EventInfo eventType = connectionType.GetEvent("ConnectComplete");

        Type[] argumentTypes =
            (from ParameterInfo p in eventType.EventHandlerType.GetMethod("Invoke").GetParameters()
             select p.ParameterType).ToArray<Type>();

        MethodInfo handler = FabricateAMethod(argumentTypes, "Wow! Should I be happy because it works?",
            "Ass2", "Type2", "Method2");
        Delegate d2 = Delegate.CreateDelegate(eventType.EventHandlerType, handler, true);

        object o = Activator.CreateInstance(connectionType);
        eventType.AddEventHandler(o, d2);

        connectionType.GetProperty("Provider").SetValue(o, "sqloledb", null);
        connectionType.GetProperty("ConnectionString").SetValue(o, String.Format("Server={0};Database={1};User Id={2};Password={3}",
            this.server, this.database, this.user, this.password), null);
        connectionType.GetMethod("Open").Invoke(o, new object[] { "", "", "", -1 });

    }

    [TestMethod]
    public void TestFabricatedMethod()
    {
        MethodInfo m = FabricateAMethod(new Type[] {}, "Yeap. Works.", "Ass1", "Type1", "Method1");
        m.Invoke(null, new Object[] { });
    }

    private MethodInfo FabricateAMethod(Type[] arguments, string stringToPrint, string assemblyName,
        string typeName, string methodName)
    {
        AssemblyName aName = new AssemblyName(assemblyName);
        AssemblyBuilder ab =
            AppDomain.CurrentDomain.DefineDynamicAssembly(
                aName,
                AssemblyBuilderAccess.RunAndSave);
        ModuleBuilder mb =
           ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");

        TypeBuilder tb = mb.DefineType(
            typeName,
            TypeAttributes.Public);

        MethodBuilder method = tb.DefineMethod(methodName, MethodAttributes.Public | MethodAttributes.Static,
           typeof(void), arguments);

        MethodInfo writeString = typeof(Console).GetMethod("WriteLine",
        new Type[] { typeof(string) });
        ILGenerator il = method.GetILGenerator();

        il.Emit(OpCodes.Ldstr, stringToPrint);
        il.EmitCall(OpCodes.Call, writeString, null);
        il.Emit(OpCodes.Ret);

        return tb.CreateType().GetMethod(methodName);
    }

    public static void TheConnectionComplete(Error pError, ref EventStatusEnum adStatus, Connection pConnection)
    {
        Console.WriteLine("The normal way.");
    }

}

}


text:
Q: Result of Java split() is varies when working with string of numbers Why does Java String.split() generate different results when working with string defined in code versus string read from a file when numbers are involved?  Specifically I have a file called "test.txt" that contains chars and numbers separated by spaces:
G H 5 4

The split method does not split on spaces as expected.  But if a string variable is created within code with same chars and numbers separated by spaces then the result of split() is four individual strings, one for char and number.  The code below demonstrates this difference:
   import java.io.File;
   import java.io.FileReader;
   import java.io.BufferedReader;

   public class SplitNumber {

     //Read first line of text file
     public static void main(String[] args) {
       try {
         File file = new File("test.txt");
         FileReader fr = new FileReader(file);
         BufferedReader bufferedReader = new BufferedReader(fr);

         String firstLine;
         if ((firstLine = bufferedReader.readLine()) != null) {
           String[] firstLineNumbers = firstLine.split("\\s+");
           System.out.println("First line array length: " + firstLineNumbers.length);

           for (int i=0; i<firstLineNumbers.length; i++) {
             System.out.println(firstLineNumbers[i]);
           }
         }
         bufferedReader.close();

         String numberString = "G H 5 4";
         String[] numbers = numberString.split("\\s+");
         System.out.println("Numbers array length: " + numbers.length);

         for (int i=0; i<numbers.length; i++) {
           System.out.println(numbers[i]);
         }
       } catch(Exception exception) {
         System.out.println("IOException occured");
         exception.printStackTrace();
       }
     }
   }

The result is:
First line array length: 3
G
H
5 4
Numbers array length: 4
G
H
5
4

Why do the numbers from the file not get parsed the same as the same string defined within code?

A: Based on feedback I changed the regex to split("[\\s\\h]+") which resolved the issue; the numbers for the file were properly split which clearly indicated that I had a different whitespace-like character in the text file that I was using.  I then replaced the contents of the file (using notepad) and reverted back to split("\\s+") and found that it worked correctly this time.  So at some point I must have introduced different white-space like characters in the file (maybe a copy/paste issue).  In the end the take away is I should use split("[\\s\\h]+") when reading from a file where I want to split on spaces as it will cover more scenarios that may not be immediately obvious.
Thanks to all for helping me find the root cause of my issue.


text:
Q: Change Attribute value from 1 & 0 to Yes and No on Front End I have an attribute whose value when input was 1 & 0, 1 = yes and 0 = no.
I have just upgraded to Magento 1.9.2 and on the front end, it is showing 1 & 0, instead of Yes or No.
Is there a simple coding I can do that will put Yes and No on the frontend instead of 1 & 0?
Any help would be greatly appreciated.

A: if($data == "1"){
echo "Yes";
}else{
echo "No";
}

A: <?php echo $attrVal ? "Yes" : "No"; ?>

A: on frontend you have to write following code for that attribute.
echo $_product->getAttributeText('attribute_code');


text:
Q: trying to consume wcf service but I think my web.config file is incorrect I am having try trying to consume a service. I am trying to deploy it to a server and consume it however I get this error. I have created a web application and added a wcf service. I am getting this

Server stack trace:
     at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding)
     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
     at IBusinessV1.CheckForUpdate(String currentVersion)
     at BusinessV1Client.CheckForUpdate(String currentVersion)

Is there something wrong with my config?
<system.serviceModel>
   <services>
      <service name="SP.WebWCF.Business_v1">
          <endpoint
             address="https://services.mydomain.com"
             binding="basicHttpBinding"
             bindingConfiguration=""
             contract="SP.WebWCF.IBusiness_v1"
             listenUri="/" isSystemEndpoint="true" />
      </service>
    </services>
    <behaviors>
       <serviceBehaviors>
           <behavior>
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="false"/>
           </behavior>
       </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

A: Ok, so your did show the server config, but you never really told us what the error is - you show the stack trace - but not the error message.....
Anyway, looking at your service config, one thing seems a bit odd - your service address:
address="https://services.mydomain.com"
binding="basicHttpBinding"

Typically this would either be something like
address="https://services.mydomain.com/MyServiceVirtualDir/MyService.svc"

if you're hosting your service inside IIS, or something like
address="https://services.mydomain.com/MyService"

if you're self-hosting in a Windows NT service or something.
Can you double-check your address - are you 100% sure it's correct??
Update: also, you're using https://, however, you're not showing any security-settings in your service config. Just for test: can you invoke your service when you change the service address in the config to just http:// ??


text:
Q: datetimepicker validation start date should be less than enddate in the calendar while clicking jquery How do I make start date less than end date in the calendar on datetimepicker? While clicking on end date I should not be able to select the date before start date I selected.
var dateFormat = "mm/dd/yy",
        startDate = $( "#startDate" )
            .datetimepicker({
                defaultDate: "+1w",
                changeMonth: true,
                numberOfMonths: 3,
                timepicker: false,
            })
            .on( "change", function(e) {
                e.stopPropagation();
                endDate.datetimepicker( "option", "minDate", getDate( this ) );
            }),
        endDate = $( "#endDate" ).datetimepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            timepicker: false,
        })
            .on( "change", function(e) {
                e.stopPropagation();
                startDate.datetimepicker( "option", "maxDate", getDate( this ) );
            });

    function getDate( element ) {
        var date;
        try {
            date = $.datetimepicker.parseDate( dateFormat, element.value );
        } catch( error ) {
            date = null;
        }
        return date;
    }

});

A: Firstly, you need to know which library you're using. See the "Official Website" in your link, it points to this repository: https://github.com/xdan/datetimepicker
Then, you can find their document in here: https://xdsoft.net/jqplugins/datetimepicker/
Look for how they set options by search for this: setOptions
var dateFormat = "mm/dd/yy",
    startDate = $("#startDate")
        .datetimepicker({
            defaultDate: "+1w",
            changeMonth: true,
            numberOfMonths: 3,
            timepicker: false,
            onChangeDateTime: function(currentDateTime ){
                endDate.datetimepicker("setOptions", { "minDate": currentDateTime });
            },
        }),
    endDate = $("#endDate").datetimepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 3,
        timepicker: false,
        onChangeDateTime: function(currentDateTime ){
            startDate.datetimepicker("setOptions", { "maxDate": currentDateTime });
        },
    });

I suggest you find another library that support this range picker feature by default, that's easier.
On their document site, you can see they have one call PeriodPicker, but it's not free. I'll look for something else, there's must be plenty of options.
If you don't need to pick time, just date, then I suggest the jQuery UI's datepicker.


text:
Q: How can I use the same namespace names in cpp-winrt idl file and a normal/standard cpp class? The scenario is new and I believe it might be a bug in cpp-winrt module or the vc compiler.
The Problem
1. Create a "windows runtime component" using the cpp-winrt template for universal windows.
2. Note the namespace name defined in the idl file. By default the idl file is named as class.idl.
3. Add a "new standard cpp class" to the project using the class wizard.
4. Put the new class under the same namespace name as defined in the idl file.
5. Build the project.
    a. The build should succeed.
6. Use the standard cpp class in the runtime implementation class.
7. Now try to build the project again.
    a. The build will fail this time.
The Reason
1. cppwinrt.exe generates source files from the idl file.
2. The runtime implementation class namespace is prefixed by "winrt".
3. The standard cpp class is not prefixed by the namespace "winrt".
4. The vc compiler expects the standard cpp class namespace to start from "winrt"
5. Otherwise the name resolution fails even if you try to use the fully qualified namespace name.
Example runtime idl file

namespace NMLevel1.NMLevel2
{
    [default_interface]
    runtimeclass Class
    {
        Class();
        void RuntimeMethod1();
        Int32 RuntimeMethod2(Int32 arg1);
        String RuntimeMethod3(String arg1);
        Int32 MyProperty;
    }
}

Example standard cpp file
#pragma once
#include <string>
using namespace std;

namespace NMLevel1::NMLevel2
{
    class StdCPPClass
    {
    public:
        StdCPPClass();
        virtual ~StdCPPClass();

        void method1();
        int method2(int arg1);
        wstring method3(wstring arg1);
    };
}

Example runtime class implementation
#include "pch.h"
#include "Class.h"
#include "NMLevel1.NMLevel2.Class.g.cpp"
#include "StdCPPClass.h"

using namespace winrt;
using namespace Windows::Foundation;

namespace winrt::NMLevel1::NMLevel2::implementation
{
    void Class::RuntimeMethod1()
    {
        NMLevel1::NMLevel2::StdCPPClass stdcls;

        Uri uri(L"http://aka.ms/cppwinrt");
        //printf("Hello, %ls!\n", uri.AbsoluteUri().c_str());
        printf("RuntimeMethod1(): Hello, %ls!\n", stdcls.method3(uri.AbsoluteUri().c_str()).c_str());
    }
}

NMLevel1::NMLevel2::StdCPPClass stdcls; is not allowed without prefixing the namespace with winrt.

Is this a bug or a design limitation that cannot be overcome?
or How can I use the same namespace 'NMLevel1::NMLevel2' in idl and cpp files?

A: Name lookup in C++ is fairly involved, especially when namespaces get essentially merged through using declarations. To help the compiler identify the name you want, you'll have to be explicit, and use a fully qualified name (as opposed to a qualified name, as in the sample).
You'll have to change
void Class::RuntimeMethod1()
{
    NMLevel1::NMLevel2::StdCPPClass stdcls;
    // ...
}

to
void Class::RuntimeMethod1()
{
    ::NMLevel1::NMLevel2::StdCPPClass stdcls;
    // ...
}

Note the leading :: scope resolution, which limits lookup to the global scope (or namespaces introduced into the global namespace through a using declaration). You'll find additional information here: Qualified name lookup.


text:
Q: Mosaic Dataset - Gray and White areas I'm trying to add high resolution orthoimagery from the USGS to a mosaic dataset in arcMap. When I "Add rasters to mosaic dataset" most of the rasters load in fine, but some have strips of white area and other places are sort of grey, low contrast. I checked Update Overviews. Please see the image below as an example of the issue. Also, as you zoom in the grey/white areas go away. Any ideas?

A: From Esri Technical Support: "The caching process sometimes creates blank and/or white tiles when using Mosaic datasets."
Their recommendation at https://support.esri.com/en/technical-article/000011325 is to bump the number of maximum number of rasters per mosaic dataset from the default of 20 to 100 (right click mosaic dataset > properties > defaults tab > Maximum Number of Rasters per Mosaic). This worked for me for WorldView-2 imagery.
Instead of changing the maximum number of rasters per mosaic default value, clicking the Dynamic Range Adjustment button also worked for me (in Pro this is: highlight mosaic dataset in Contents: Mosaic Layer ribbon > Appearance > DRA (next to Stretch Type).


text:
Q: Problema em upload de imagem Laravel/Intervention Estou com um problema quando tento fazer o upload de uma imagem, pois bem, quando dou submit no form ele retorna o seguinte erro:
Intervention\Image\Exception\NotWritableException
Can't write image data to path (public/images/products/2014-06-01-16:24:38-581165_571926502843010_889453779_n.jpg)

Pois bem, imaginei que podia ser problema de permissão, fui lá e dei permissão 777 no diretório, mas o danado continua dando o mesmo erro.
Segue o meu código:
public function postCreate(){
            $validator = Validator::make(Input::all(),Product::$rules);

            if($validator->passes()){
                    $product = new Product();
                    $product->category_id   = Input::get('category_id');
                    $product->title                 = Input::get('title');
                    $product->description   = Input::get('description');
                    $product->price                 = Input::get('price');
                    $product->availability  = Input::get('availability');

                    $image = Input::file('image');
                    $filename = date('Y-m-d-H:i:s').'-'.$image->getClientOriginalName();
                    Image::make($image->getRealPath())->resize('468,249')->save('public/images/products/'.$filename);
                    $product->image                 = 'images/products/'.$filename;
                    $product->save();

                    return Redirect::to('admin/products/index')
                            ->with('message','Produto cadastrado');
            }
}

A: Agradeço a todas as respostas, porém, resolvi da seguinte forma:
$filename = date('Y-m-d-H-i-s').'.'.Input::file('image')->getClientOriginalExtension();
Image::make(Input::file('image')->getRealPath())->resize('468,249')->save( public_path('img/products/'.$filename));

Forneci o caminho absoluto do arquivo e não o relatio, a partir da raiz do projeto. Com isso ele fez o upload, a solução foi dada numa pergunta que fiz no grupo Laravel Brasil.
Pergunta no grupo Laravel Brasil
Muito obrigado pela ajuda de todos!!!

A: Não sou conhecedor de Laravel, mas sugiro uma mudança no nome do arquivo.
Não se qual S.O. está usando mas sugiro remover o caractere ":" do nome do seu arquivo, dado que no Windows e no Linux ele é um caractere inválido. Vide documentação do Windows e uma recomendação neste site. Troque ":" por "_" ou qualquer outro caractere válido e veja o resultado.
Adaptando a seguinte linha:
$filename = date('Y-m-d-H_i_s').'-'.$image->getClientOriginalName();

A: Tente assim:
public function postCreate(){
    $validator = Validator::make(Input::all(),Product::$rules);

    if($validator->passes()){
            $product = new Product();
            $product->category_id   = Input::get('category_id');
            $product->title         = Input::get('title');
            $product->description   = Input::get('description');
            $product->price         = Input::get('price');
            $product->availability  = Input::get('availability');

            $image = Input::file('image');
            $filename = date('Y-m-d-H:i:s').'-'.$image->getClientOriginalName();
            Image::make($image->getRealPath())->resize('468,249')->save('images/products/'.$filename);
            $product->image         = 'images/products/'.$filename;
            $product->save();

            return Redirect::to('admin/products/index')
                    ->with('message','Produto cadastrado');
    }
}

Porque se colocou public no save e não precisa, por isso não é caminho válido. Por padrão não precisa colocar o public que o framework já reconhece tal caminho


text:
Q: Matlab help Newton Rapshon method If I have a code like this
funk=@(x) x2-4;
dfunk=@(x) 2*x;

xk=4;

for i = 1:5
   xk+i= xk-funk(of what? xk or @(x) x2-4) / dfunk( same problem here);
 end

I do not know what am I supposed to write in brackets it is supposed to be Newton Raphson method.
Thanks for help

A: You should not add i to your xk in the for loop. As Newton's Metod
generates a series which converges to a root of the funktion the +i only operates on the indices of the series.
Your code should look like this.
funk = @(x) x^2-4;
dfunk = @(x) 2*x;
xk = 4;
for i=1:5
    xk = xk - funk(xk)/dfunk(xk)
end

Anyway I would not recommend to use a fixed condition like i=1:5 but something like
TOL = 10e-4;
DIFF = 1;             % something larger than TOL
funk = @(x) x^2-4;
dfunk = @(x) 2*x;
xk = 4;

while (DIFF > TOL)
   aux = xk - funk(xk)/dfunk(xk);
   DIFF = abs(xk-aux);
   xk = aux;
end


text:
Q: preg_split commas not inside parenthesis Test string:
Organic whole wheat bread, Monterey Jack Cheese (milk, cheese culture, salt), Hormel Natural Ham (salt, turbinado sugar, lactic acid (not from milk)

Desired output:
Array (
        [0] => Organic whole wheat bread
        [1] => Monterey Jack Cheese
        [2] => Hormel Natural Ham
      )

I don't mind if the sub-ingredients appear with the original item (i.e., "Monterey Jack Cheese (milk, cheese culture, salt)"), I just don't want them on their own because they aren't added ingredients.
I found a couple other questions here that I tried applying to my problem, but I never got the expected output.
Oh, and in case preg_split isn't PHP-centric, I'm using PHP.
Thanks in advance!

A: I would first remove all the parentheses and their contents:
$result = preg_replace('/\s*\([^()]+\)/', '', $subject);

and then preg_split() on the remaining commas. This assumes that parentheses aren't nested.
If parentheses can be nested, then you will need to run this as many times as there are nesting levels. Each time, the innermost parenthesis will be removed.


text:
Q: Restore File Owner from Backup, but not Content By mistake we did a
chown www-data:www-data / -R

on a production server.
We do have a backup, but as only the permissions are wrong we want to restore only the permissions from the backup, not the file content.
Is there a simple command for this, for example with rsync?

A: It is possible with
getfacl -R /path/to/backup/on/backupserver > backup-acls.txt

and transfering the file on your production server, then
setfacl --test --restore=backup-acls.txt

After successfull test remove the --test option.
There might be errors for files such as PHP sessions which are no longer on the system, so these folders have to be checked manually.


text:
Q: What's the meaning behind the idiom "Answers on a postcard"? Answers on a postcard, please I don't hear this phrase used often anymore; of course it was common many years ago when people still actually sent postcards instead of Instagram posts. Since it's not used often now, trying to find the origin and meaning behind it has resulted in conflicting or vague descriptions.
So what does it mean, and does it have more than one meaning? For example, it might be genuine request for answers to a proposed question, but they're expected to be brief. However, I've heard it being used in a sarcastic tone, like "Will Covid-19 cause a recession? Answers on a postcard, please."

A: It used to be common for magazines to print in each issue a conundrum or quiz question for their readers, with a small prize for the first correct reply, or the first X-number of correct replies. Up until a certain point, a postcard cost less to send than a letter, and postcards were easier for the magazine staff to sort, so the standard instruction was "Answers on a postcard, please, to [the magazine address]". So this became a catchphrase for "If anybody knows, please tell me". This was a favourite expression of Jack Knight's in DC's Starman comic book of the 1990s.

A: It is used to express a quick, often obvious answer,
answer on a postcard:

*

*A brief, concise answer, reply, or opinion, especially one meant as a quick response to a general question.

*

*I'd like to get people's opinions on where to go for a summer vacation. Answers on a postcard, please!

*An answer that is considered obvious or self-evident.

*

*We'd like to get into more complex reasons for inequality, so please avoid just giving answers on a postcard.

(Fareflex Dictionary)

A: According to one Victoria S Dennis:

It used to be common for magazines in Britain (and over the Atlantic for all I know) to print in each issue a conundrum or quiz question for their readers, with a small prize for the first correct reply, or the first 10 correct replies, or whatever. Until a few years ago a postcard cost less to send than a letter, and postcards were easier for the magazine staff to sort, so the standard instruction was "Answers on a postcard, please, to [the magazine address]". So this became a catchphrase for "If anybody knows, please tell me".

I cannot be sure of the accuracy of this claim, but it seems reasonable.
It can indeed be used sarcastically, but as with most other phrases that has to be derived from the context.
As for why it's a dying phrase, that's likely because postcards are a dying art.


text:
Q: iterating over a group in multimap how do I know if I am in first or last elements? I mean this situation:
for (auto iter = myMmap.equal_range(find_key).first;
  iter != myMmap.equal_range(find_key).second;
  ++iter)
{
  //code
}

How to derive from the iterator (that is without using counters) that I'm in first or last item in this set.

A: Like this?
auto range = myMmap.equal_range(find_key);

for (auto it = range.first; it != range.second; ++it) {
    if (it == range.first) { // first

    } else if (std::next(it) == range.second) { // last

    } else {}
}

A: I trust mixing iter and cit is typo.
You check if the iterator is the first or last element in a group just like you do in the for_cycle - first element is equal_range(find_key).first and one element past the last one is equal_range(find_key).second.


text:
Q: Can't get data from Dropdown List PHP to Xampp MySQL I'm trying to get that from a dropdown list from my html.
<FORM ID="" ACTION="save.php">

Time

                    <SELECT NAME="Time" ID="Time" style="width:220px">
                        <OPTION>
                        <OPTION>7:30-8:30
                        <OPTION>7:30-9:00
                        <OPTION>7:30-10:30
                    </SELECT>

What happens is when the user click the submit button, it automatically call save.php
<?php
$time = $_POST['Time'];

//create connection_aborted
$conn = mysqli_connect("localhost", "root", "", "scheduling");
//check connection
if($conn-> connect_error) {
    die ("connection failed; ". $conn-> connect_error);
}
$sql = "INSERT INTO sched (Time)VALUES ('$time')";

$conn->close();
?>

This technique works on textbox, I don't know why can't get data from drop down list. Am I missing something? Please help to fix.

A: Your option tags need a value attribute to send to the server. Try this:
<SELECT NAME="Time" ID="Time" style="width:220px">
  <OPTION value=""></OPTION>
  <OPTION value="7:30-8:30">7:30-8:30</OPTION>
  <OPTION value="7:30-9:00">7:30-9:00</OPTION>
  <OPTION value="7:30-10:30">7:30-10:30</OPTION>
</SELECT>

A: You need set the option value like this:
<select id="Time" required>
  <option value="">Please Select</option>
  <option value="7:30-8:30">7:30-8:30</option>
  <option value="7:30-9:00">7:30-9:00</option>
  <option value="7:30-10:30">7:30-10:30</option>
</select>

And if you have option with blank value, good to check in php first before insert like this

if (!empty($_POST['Time'])) $Time = $_POST['Time'];

A: <select id="Time" name="Time">
  <option disabled="disabled" selected="selected" value="">Please Select One</option>
  <option value="7:30-8:30">7:30-8:30</option>
  <option value="7:30-9:00">7:30-9:00</option>
  <option value="7:30-10:30">7:30-10:30</option>
</select>


text:
Q: blocked a frame with origin from accessing a cross-origin frame Using the same domain Hi I am having a problem with this message.
the url from my MAIN page is:
page1.mydomain.com/page1.html

this page have a Iframe to:
frame.mydomain.com/iframe.html

and from the main page I open a window from a another page like that:
mywindow = window.open("http://page1.mydomain.com/page3.html", 'page3', 'status=1,height=768,width=1280,scrollbars=1');

all the 3 pages have set the javascript:
document.domain = "mydomain.com";

I can interact from the main page to the iframe without a problem.
I only have problem to access the window.open properties.
Like:
mywindow.document.getElementById("something")

I got that error message.
blocked a frame with origin from accessing a cross-origin frame

if I try from the page3:
window.opener.document.getElementById("somethingPage1")

I got the same error:
blocked a frame with origin from accessing a cross-origin frame

Why I can interact with the iframe and can't interact with the window.open and the window.opener ?

A: In my case domain names were different and I solved it by replacing client's domain with the parent's domain name. You can try that if domain name is not matter in child(popup) windows.
What you are trying to access window.opener.document.getElementById() won't work.
It will raise security error as you posted. Best way to do is make both the URLs under the same Domain Name if it's possible. Or just for the development you can install extension
"Allow-Control-Allow-Origin:" in Chrome it will work.


text:
Q: Implementing correct texture mapping in triangles with glTexCoord4f() in a Doom-like engine A while ago I asked a question similar to this one, but in that case I was trying to correct the perspective texture mapping of a trapezoid that had the horizontal lines constantly parallel with glTexCoord4f() and this is relatively simple. However, now I'm trying to fix the texture mapping of the floor and ceiling in my engine, the problem is that since both depend on the shape of the map, I need to use triangles to fill in the polygonal shapes that the map may contain.
I tried a few variations of the same method I used for correct texture mapping on trapezoids, the attempt with more "acceptable" results were when I calculated the size of the triangle's edges (with screen coordinates) and used each result in the different 'q' in each glTexCoord4f(), that is how code currently stands.
With that in mind, how can I fix this while using glTexCoord4f()?
Here is the code I used to correct the texture mapping of the walls (functional):
float u, v;
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);

float sza = wyaa - wyab; //Size of the first vertical edge on the wall
float szb = wyba - wybb; //Size of the second vertical edge on the wall

//Does the wall have streeched textures?
if(!(*wall).streechTexture){
    u = -texLength;
    v = -texHeight;
}else{
    u = -1;
    v = -1;
}

glBindTexture (GL_TEXTURE_2D, texture.at((*wall).texture));
glBegin(GL_TRIANGLE_STRIP);

glTexCoord4f(0, 0, 0, sza);
glVertex3f(wxa, wyaa + shearing, -tza * 0.001953);

glTexCoord4f(u * szb, 0, 0, szb);
glVertex3f(wxb, wyba + shearing, -tzb * 0.001953);

glTexCoord4f(0, v * sza, 0, sza);
glVertex3f(wxa, wyab + shearing, -tza * 0.001953);

glTexCoord4f(u * szb, v * szb, 0, szb);
glVertex3f(wxb, wybb + shearing, -tzb * 0.001953);

glEnd();
glDisable(GL_TEXTURE_2D);

And here the current code that renders both the floor and the ceiling (which needs to be fixed):
glEnable(GL_TEXTURE_2D);
glBindTexture (GL_TEXTURE_2D, texture.at((*floor).texture));
float difA, difB, difC;

difA = vectorMag(Vertex(fxa, fyaa), Vertex(fxb, fyba)); //Size of the first edge on the triangle
difB = vectorMag(Vertex(fxb, fyba), Vertex(fxc, fyca)); //Size of the second edge on the triangle
difC = vectorMag(Vertex(fxc, fyca), Vertex(fxa, fyaa)); //Size of the third edge on the triangle

glBegin(GL_TRIANGLE_STRIP); //Rendering the floor
glTexCoord4f(ua * difA, va * difA, 0, difA);
glVertex3f(fxa, fyaa + shearing, -tza * 0.001953);

glTexCoord4f(ub * difB, vb * difB, 0, difB);
glVertex3f(fxb, fyba + shearing, -tzb * 0.001953);

glTexCoord4f(uc * difC, vc * difC, 0, difC);
glVertex3f(fxc, fyca + shearing, -tzc * 0.001953);
glEnd();

glBegin(GL_TRIANGLE_STRIP); //Rendering the ceiling
glTexCoord4f(uc, vc, 0, 1);
glVertex3f(fxc, fycb + shearing, -tzc * 0.001953);

glTexCoord4f(ub, vb, 0, 1);
glVertex3f(fxb, fybb + shearing, -tzb * 0.001953);

glTexCoord4f(ua, va, 0, 1);
glVertex3f(fxa, fyab + shearing, -tza * 0.001953);
glEnd();

glDisable(GL_TEXTURE_2D);

Here a picture of how it looks visually (for comparison purposes, the floor has the failed attempt at correct texture mapping, while the ceiling has affine texture mapping):

I understand that it would be easier if I just set a normal perspective view, but that would simply defeat the whole purpose of the engine.

A: This is an issue only for floor and ceiling (unless your camera can tilt). So you can render your wals as you doing. But for floors and ceiling you have these basic options (As I mentioned in your old duplicate post):

*

*Rasterize scan line on your own
So instead of rendering triangles (which old ray casters did not do) you render vertical lines pixel by pixel using points instead of triangles. That will be much slower of coarse as GL is more suited for polygonal primitives. See draw_scanline functions in here:

*

*Efficient floor/ceiling rendering in Raycaster

*Use perspective view and pass z coordinate
Looks like you added the z coordinate already. So now you just need to set perspective view that matches your wall rendering. OpenGL will do the rest on its own. So you should add something like gluPerspective for your GL_PROJECTION matrix. but just for your floors/ceilings ...

*Pass z coordinate and overide fragment shader
So you just write fragment shader that computes the perspective correct texture mapping correction in it and just output wanted texel color +/- some lighting. Here example of shaders usage:

*

*complete GL+GLSL+VAO/VBO C++ example
For more info see:

*

*Ray Casting with different height size


text:
Q: Magento 1.9.2.4 is not hiding unused attribute combinations in configurable products I have an issue with my Magento shop based on Magento 1.9.2.4.
In backend if you check the screenshots you'll see that I have 2 attributes (global, dropdown, included for configurable products):

*

*Size: A / B

*Color: Black / White

After that based on this attributes, you'll see 2 product combinations created:

*

*A + Black

*B + White

The problem is, when I choose in frontend Size A, in the second dropdown I should see just Black, and hiding White because I don't have a combination like "A + White"
Same for B, in the second dropdown I should see just white, but i see both white and black.
I found that is a bug just on 1.9.2.4 because I installed an older fresh Magento 1.8 and this bug does not exist.
The customer shouldn't be allowed to choose product combinations which are not created in backend. How can I solve this in 1.9.2.4 ?

A: I faced the same problem. And i don't know where it cames from.
In my case there was a problem with the following file:
app/design/frontend/yourtemplate/default/template/catalog/product/view/type/options/configurable.phtlm
Try to replace it with a new version from magento, theme or earlier version.


text:
Q: Does listener service require Oracle server to be installed? I have installed Oracle 8i Client version in my machine. I have created local service naming to. I am trying to connect the local service. I am getting below error,
The test did not succeed.
ORA-12541: TNS:no listener

There may be an error in the fields entered,
or the server may not be ready for a connection.

Do I need server to be installed in my machine for the listener to be run in my machine?

A: *

*Where is the database server running?

*Did you create a listener on the local machine?  If so, please post the listener.ora in addition to the tnsnames.ora file.

Normally, the listener would run on the database server.  It is possible to run the listener on a machine other than the database server but that would not be a particularly common configuration.  It would be much more common to run the database and the listener on your laptop.
It would be extremely unusual, though, to want to install any version of 8i today.  8.1.7 has been desupported for nearly a decade and isn't supported on any operating system that is vaguely near supported.

A: yes, the listener is part of the server, not the client. As you're trying to connect to a locally installed server (I guess) and that server doesn't exist (as you installed only the client) the client will respond that there is no listener (as the listener would be what's replying to the client, not the server directly).


text:
Q: Why blink bulb animation not working in Broadcast Receiver called from a Fragment My Alarm is getting triggered,This I confirmed by using debug statement in Broadcast receiver class.But blinking animation is not working.I am very new to Android.Can anyone tell me what is the issue?One guess i can get is may be Broadcast receiver is not able to know about fragment reference so it is not able to run the animation.If this is the case ,then actually I dont know to how to add the reference Or If I can return from the receiver and do all the activity inside the fragment.Please let me know the steps.
Fragement Scetion Code:
    Calendar calendar= Calendar.getInstance();
    calendar.setTimeInMillis(System.currentTimeMillis());
    calendar.set(Calendar.HOUR_OF_DAY,16);
    calendar.set(Calendar.MINUTE,42);
    calendar.set(Calendar.SECOND,0);
    Intent intent =new Intent(getContext(),NotificationActivity.class);
    intent.putExtra("id",R.id.notification_imageView);
    PendingIntent pendingIntent =
    PendingIntent.getBroadcast(getContext(),100,intent,PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager alarmManager=(AlarmManager) getActivity().getSystemService(ALARM_SERVICE);
    System.out.println("DEBUG==> Instantiating Alarm Manager Service");
    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,calendar.getTimeInMillis(),1000 * 60 *
    02,pendingIntent);

BroadcastReceiever Class --ClassNotificationActivity.class
  public class NotificationActivity extends BroadcastReceiver {
  private View view;
  @Override
   public void onReceive(Context context, Intent intent) {
   ImageView img;
    System.out.println("DEBUG==> Page Notification Activity is being loaded");
    View view = View.inflate(context, R.layout.Samplelayout, null);
   img = view.findViewById(R.id.imageview);
   System.out.println("DEBUG==> Loading bulb Image for Animation"+img);
   System.out.println("DEBUG==> Loading bulb Image for Animation");
   Animation animation = new AlphaAnimation((float) 0.5, 0); // Change alpha from fully visible to
    invisible
    animation.setDuration(500); // duration - half a second--2 minutes
    animation.setRepeatCount(200);
    img.startAnimation(animation);
      }
         }

Manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_ALARM" />

 <receiver  android:name=".view.ui.NotificationActivity" />

Samplelayout.xml:
       <LinearLayout
                android:id="@+id/linearLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@color/red"
                android:gravity="center_horizontal"
                android:orientation="vertical">

                <ImageView
                    android:id="@+id/imageview"
                    android:layout_width="70dp"
                    android:layout_height="64dp"
                    android:layout_margin="20dp"
                    android:src="@drawable/Dumble"
                    android:tint="@android:color/white"
                    tools:layout_editor_absoluteX="32dp"
                    tools:layout_editor_absoluteY="32dp" />

            </LinearLayout>


text:
Q: Does File.Copy() to a network share on the same machine copy the file over the network? Similar to question 555341, Would a File.Copy() (or FileStream.Write(), etc) travel over the network if the destination directory were a Windows file share that resides on the same machine.
Example
MachineA executes the following code:
File.Copy(source, @"\\MachineA\SomeShare\DestinationLocation")


text:
Q: "Garbage" IP address with colons in $_SERVER['REMOTE_ADDR'] for some clients I have a PHP script sitting on a server that is hit by several different machines at different times throughout the day based on cronjobs that are setup on each machine. I'd like to know the IP of the machines making the request and when it is made by a browser, the following executes successfully:
<?php
  ...
  echo $_SERVER['REMOTE_ADDR'];
  ...
?>

However, when made by CURL or any other command line tool I have attempted to use (lynx included), I end up with the following garbage:
2701:5:4a80:7d:2ee:8eff:5e61:801d
From the investigation I've done, this is a result of Apache not populating the $_SERVER variable for requests received that are made from the command line.
REMOTE ADDR Issue with Cron Job
Anyone know of a way to get command line requests to play nice with the $_SERVER variable or should I go down another route?

A: That's not garbage, that is the correct remote address.  Someone used IPv6 to access your server.


text:
Q: How to allow class only inherit from one of two interfaces I have two interfaces Interface1, Interface2. I only want to MyClass inherits from one of them.
It should compile error if I define a class like this:
class MyClass : Interface1, Interface2
{
}

Thanks!

A: First, it is not inheritance , it is implementation.
you should write one of them
class MyClass: Interface1
{
}


text:
Q: Bug Affecting Entity Movement in Java Game Development I am working through a tutorial from Youtube on how to make a 2D style game in Java (Click here for Video 1, though I am currently working on video #20)
I recently tried to add Event Tiles that cause the player to teleport/heal/take damage. I no longer have the teleport option while troubleshooting, but essentially what is happening when I start the game is that my player spawns where it should, but when I press any directional key, I am instantly transported to the top left tile and I have no clue why.
I've narrowed it down to my checkEvent method, which I will post below.
Please let me know if I can post more code, I also have  a KeyHandler, Entity, Player, and Event Rectangle classes, but in troubleshooting, it wasnt until I took away the checkEvent method below that I was able to move again.
package main;
public class EventHandler {
    GamePanel gp;
    EventRect eventRect[][];

    int previousEventX, previousEventY;
    boolean canTouchEvent = true;

    public EventHandler(GamePanel gp) {
        this.gp = gp;

        eventRect = new EventRect[gp.maxWorldCol][gp.maxWorldRow];

        int col = 0;
        int row = 0;

        while (col < gp.maxWorldCol && row < gp.maxWorldRow) {

            eventRect[col][row] = new EventRect();
            eventRect[col][row].x = 23;
            eventRect[col][row].y = 23;
            eventRect[col][row].width = 2;
            eventRect[col][row].height = 2;
            eventRect[col][row].eventRectDefaultX = eventRect[col][row].x;
            eventRect[col][row].eventRectDefaultY = eventRect[col][row].y;

            col++;
            if (col == gp.maxWorldCol) {
                col = 0;
                row++;
            }
        }
    }

    public void checkEvent() {

        //check if character is one tile away from  last event
        int xDistance = Math.abs(gp.player.worldX = previousEventX);
        int yDistance = Math.abs(gp.player.worldY = previousEventY);
        int distance = Math.max(xDistance, yDistance);
        if (distance > gp.tileSize) {
            canTouchEvent = true;
        }

        if(canTouchEvent == true) {
            if (hit(27, 16, "any") == true) {damagePit(27, 16, gp.dialogueState);}
            if (hit(27, 18, "any") == true) {healingPool(27, 18, gp.dialogueState);}
        }
    }

    public boolean hit(int col, int row, String reqDirection) {

        boolean hit = false;
        gp.player.solidArea.x = gp.player.worldX + gp.player.solidArea.x;
        gp.player.solidArea.y = gp.player.worldY + gp.player.solidArea.y;
        eventRect[col][row].x = col*gp.tileSize + eventRect[col][row].x;
        eventRect[col][row].y = row*gp.tileSize + eventRect[col][row].y;

        if (gp.player.solidArea.intersects(eventRect[col][row]) && eventRect[col][row].eventDone == false) {
            if (gp.player.direction.contentEquals(reqDirection) || reqDirection.contentEquals("any")) {
                hit = true;

                previousEventX = gp.player.worldX;
                previousEventY = gp.player.worldY;
            }
        }

        gp.player.solidArea.x = gp.player.solidAreaDefaultX;
        gp.player.solidArea.y = gp.player.solidAreaDefaultY;
        eventRect[col][row].x = eventRect[col][row].eventRectDefaultX;
        eventRect[col][row].y = eventRect[col][row].eventRectDefaultY;

        return hit;
    }

    /*public void teleport(int col, int row, int gameState) {
        gp.gameState = gp.gameState;
        gp.ui.currentDialogue = "NYOOM";
        gp.player.worldX = gp.tileSize * 17;
        gp.player.worldY = gp.tileSize * 20;
        canTouchEvent = false;
    }
     */
    public void damagePit(int col, int row, int gameState) {
        gp.gameState = gameState;
        gp.ui.currentDialogue = "MWAHA! You dun messed up";
        gp.player.life -= 1;
        //eventRect[col][row].eventDone = true;
        canTouchEvent = true;
    }
    public void healingPool(int col, int row, int gameState) {
        if (gp.keyH.enterPressed == true) {
            gp.gameState = gameState;
            gp.ui.currentDialogue = "Ahh, moistness";
            gp.player.life = gp.player.maxLife;
        }
    }
}

This is my first time posting, so if there is etiquette I am not following, please let me know :)

A: Your checkEvent() method is wrong:
public void checkEvent() {

    //check if character is one tile away from  last event
    int xDistance = Math.abs(gp.player.worldX = previousEventX);
    int yDistance = Math.abs(gp.player.worldY = previousEventY);
    int distance = Math.max(xDistance, yDistance);
    if (distance > gp.tileSize) {
        canTouchEvent = true;
    }

    if(canTouchEvent == true) {
        if (hit(27, 16, "any") == true) {damagePit(27, 16, gp.dialogueState);}
        if (hit(27, 18, "any") == true) {healingPool(27, 18, gp.dialogueState);}
    }
}

In the line int xDistance = Math.abs(gp.player.worldX = previousEventX); you are assigning the current value of previousEventX (which is 0) to gp.player.worldX (which transports the player to the X coordinate 0) and sets the xDistance to 0 (because you calculate Math.abs(0)).
The next line for the yDistance is similar.
Change those two lines to
    int xDistance = Math.abs(gp.player.worldX - previousEventX);
    int yDistance = Math.abs(gp.player.worldY - previousEventY);


text:
Q: Showing latest product add I just installed Magento with custom free template ( Eros ). what I trying now is to add latest or just list of products to the homepage.
On the CMS->Pages->Home page-> Design (which I think that doesn't work because if I delete everything from there nothing change on the frontend) has this which I think is responsible for this action:
 <block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
 </block>

Then in content I've put this:
{{block type="catalog/product_new" name="home.catalog.product.list" alias="product_homepage" template="catalog/product/new.phtml"}}

And there si nothing on the page.
EDIT:
In content of home-page also is this which is working.
{{block type="customblocks/customblock" alias="root" template="customblocks/customblock.phtml"}}

A: There are missing reference name. use <reference name="content"> for show new products at content area.
<reference name="content">
<block type="catalog/product_new" name="home.catalog.product.new" alias="product_new" template="catalog/product/new.phtml" after="cms_page">
        <action method="addPriceBlockType">
            <type>bundle</type>
            <block>bundle/catalog_product_price</block>
            <template>bundle/catalog/product/price.phtml</template>
        </action>
 </block>


text:
Q: Why does my page instantly scroll down each time I reload the site? Also how can I place "About Me" further down? So I added smooth scrolling and a button that scrolls you to the bottom and that's the point but now every time I load in and reload the site etc. it automatically scrolls down. I also want to put the "About me" heading further down so it isn't visible unless you click "Click to learn more"
Picture of the site: https://i.gyazo.com/79313e6ee1fe3de82d18b33f238ac5d9.jpg
HTML CODE:

    <title>Intriguing Copy</title>
    <link rel="stylesheet" href="style.css">

Home

About me

Samples

Contact

THE COPY THAT INTRIGUES BUT DONT DECEIVE

    <button type="button">CLICK TO LEARN MORE</button>

About me

A: *

*I don't understand what you want to say provide CSS for easy to understand your problem.

*Set #down as default display: none  and then add script(see my code) and also add onclick="show()" in button element,

    <title>Intriguing Copy</title>
    <link rel="stylesheet" href="style.css">

Home

About me

Samples

Contact

THE COPY THAT INTRIGUES BUT DONT DECEIVE

    <button type="button" onclick="show()">CLICK TO LEARN MORE</button>

About me

A: This
<button type="button">CLICK TO LEARN MORE</button>

is invalid - you cannot nest interactive elements like that. Either use a button or use an anchor.
If your page is automatically scrolling, I'd assume you're reloading the page after clicking this anchor. I suspect that if you look at your browser's navigation bar, it will end with #down, like
https://whateveryourdomain.is/somepage.html#down

That's how page anchors work - the browser will attempt to scroll the page until the matching anchor tag or id'd element is at the top of the viewport.


text:
Q: JFrame Border Layout Center doesn't work on Linux I have a JFrame with a JLabel in it. My aim is to illustrate the JLabel in the Middle of the JFrame and save a picture of it.
This is the Main Code:
f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
try {
    image = ImageIO.read(new File(
            pfadVorlageDatei + bezeichnungVorlageDatei));
} catch (IOException e) {
    e.printStackTrace();
}

JPanel panel = new JPanel() {

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(image, 0, 0, null);
    }

    @Override
    public Dimension getPreferredSize() {
        return new Dimension(
                image.getWidth(null),
                image.getHeight(null));
            }
};

drawTextOnJPanel(jodelText, panel);
f.getContentPane().add(panel);

f.pack
f.setLocationRelativeTo(null);
f.setState(JFrame.NORMAL);
f.setVisible(true);
f.dispose();

BufferedImage img2 = getScreenShot(f.getContentPane());
Graphics2D graphics2D = img2.createGraphics();

try {
    ImageIO.write(img2, "png", new File(speicherPfad + dateiBezeichnung));
} catch (Exception exception) {
    System.out.println("Fehler");
}

The Code for drawTextOnJPane()
String htmlTest = "";

try {
    htmlTest = "
" +
    Emoji.parse(finalJodelTextWithCorrectTags, String.valueOf(size - 2)) +
    "
";
} catch (Exception e) {
    e.printStackTrace();
}
JLabel label = new JLabel(htmlTest);

EmptyBorder border = new EmptyBorder(5, 235, 70, 100); //Ränderabstände
label.setBorder(border);
label.setFont(new Font("OpenSansEmoji", Font.PLAIN, size));
label.setForeground(Color.white);

panel.setLayout(new BorderLayout());
panel.add(label, BorderLayout.CENTER);

The Code works perfectly when running on Windows. But when I switch it to my Raspberry Pi the Layout is not correct, the JLabel is moved down.
Here is a Picture of the correct layout in Windows:

Here is a Picture of the incorrect layout in Linux (Raspberry Pi) and the same Picture when I skip the Method f.setVisible(true)

When I skip the Method setVisible(true) on Windows then it looks the same, so I think the Method setVisible(true) doesn't work correctly on the Linux OS.


text:
Q: Target framework drop down missing I'm working on a C# Windows Universal project. I created a Unit Test project and wanted to add a reference to my first project in the test one. I get the error "Unable to get reference to project". I read that this might be due to .NET target framework mismatch between the projects.
I tried to change the target framework in the Windows Universal project to fix the issue but the drop down does not exist.
I think maybe the drop down not being here is normal, since it's the purpose of a Windows Universal project. But that doesn't help me writing tests.