Laravel setup failed to open stream
I'm trying to setup laravel but its proving to be a right mere! I've
cloned it from github and also used composer to clone laravel and I've got
both of these techniques working which is good because its something I
really wanted to learn. Simpler than I thought.
However when I try to navigate to my laravel directory which is called
iProject so I type into my browser localhost/iProject I get a list of
directories which is not what I expected, I expected to be directed to at
least the hello.php page.
I've tired another technique as described in a Net-tuts tutorial which is
setting up a listening port and there I am then going through
localhost:8888, but when using this technique the following error message
appears:
Warning: Unknown: failed to open stream: No such file or directory in
Unknown on line 0
Fatal error: Unknown: Failed opening required 'public/'
include_path='.;C:\xampp\php\PEAR') in Unknown on line 0
Thursday, 3 October 2013
Wednesday, 2 October 2013
Is it possible to pass a string from Java to JSP with Java Class?
Is it possible to pass a string from Java to JSP with Java Class?
Good Evening, I need to create a string (sql statement) which might be
pass to 2 or more jsp files. Recommended method is "by accessing the
ServletContext attributes via Java scriptlet or the applicationScope via
EL". But, is there a simple way to pass the string from java class to the
jsp? Something like below?
Java
public class SharedSQL extends HttpServlet{
public String example() {
String sqlstmt = "select ABC from ABC";
return sqlstmt;
}
}
JSP
<%
SharedSQL sqlStatement = new SharedSQL() ;
String sqlstmt = sqlStatement.example();
db4.query ( sqlstmt ) ;
%>
I am new to servlet/JSP 'things', need some hints and tips...Thanks in
advanced^^
Good Evening, I need to create a string (sql statement) which might be
pass to 2 or more jsp files. Recommended method is "by accessing the
ServletContext attributes via Java scriptlet or the applicationScope via
EL". But, is there a simple way to pass the string from java class to the
jsp? Something like below?
Java
public class SharedSQL extends HttpServlet{
public String example() {
String sqlstmt = "select ABC from ABC";
return sqlstmt;
}
}
JSP
<%
SharedSQL sqlStatement = new SharedSQL() ;
String sqlstmt = sqlStatement.example();
db4.query ( sqlstmt ) ;
%>
I am new to servlet/JSP 'things', need some hints and tips...Thanks in
advanced^^
Accessing data in nested arrays & objects with Go
Accessing data in nested arrays & objects with Go
I'm doing my best to unmarshall some json data into usable form in Go, but
can't seem to get it. The data is:
{
"series": [
{
"series_id": "PET.EMD_EPD2D_PTE_NUS_DPG.W",
"name": "U.S. No 2 Diesel Retail Prices, Weekly",
"units": "Dollars per Gallon",
"updated": "2013-09-27T07:21:57-0400",
"data": [
[
"20130923",
"3.949"
],
[
"20130916",
"3.974"
]
]
}
]
}
I'm trying to get the arrays under data into a variable, so I can loop
through them and do something like:
if data[i][0] == "20130923" {
fuelPrice.Price == data[i][1]
}
I'm definitely a beginner. Thanks for your time and effort.
I'm doing my best to unmarshall some json data into usable form in Go, but
can't seem to get it. The data is:
{
"series": [
{
"series_id": "PET.EMD_EPD2D_PTE_NUS_DPG.W",
"name": "U.S. No 2 Diesel Retail Prices, Weekly",
"units": "Dollars per Gallon",
"updated": "2013-09-27T07:21:57-0400",
"data": [
[
"20130923",
"3.949"
],
[
"20130916",
"3.974"
]
]
}
]
}
I'm trying to get the arrays under data into a variable, so I can loop
through them and do something like:
if data[i][0] == "20130923" {
fuelPrice.Price == data[i][1]
}
I'm definitely a beginner. Thanks for your time and effort.
File Image to Servlet Fails
File Image to Servlet Fails
I am trying to upload an image to a servlet, but every once and a while
during automated testing, it silently fails. It looks like the number of
bytes available to be read is zero.
Do you guys know what would cause this?
Here is the code:
List<FileItem> items = new ServletFileUpload(
new DiskFileItemFactory()).parseRequest(request);
Logger.log(LogLevel.INFO, "Upload contains "+items.size()+" items.");
int i=0;
for (FileItem item : items){
Logger.log(LogLevel.INFO, "\tItem "+(i++)+".
Name:\t"+item.getName()+", Type:\t"+item.getContentType());
// File is of type "file"
if (!item.isFormField())
{
InputStream inputStream = item.getInputStream();
if (inputStream.available()==0){
Logger.log(LogLevel.WARN, "Item shows file type, but no
bytes are available");
}
try {
image = ImageIO.read(inputStream);
if (image!=null){
break;
}
} catch (Exception e) {
Logger.log(LogLevel.ERROR, "There was an error reading the
image. "+ExceptionUtils.getFullStackTrace(e));
throw new InternalValidationException("imageSource",
"ImageInvalid",
"Image provided is not a valid image");
} finally {
IOUtils.closeQuietly(inputStream);
}
}
}
if (image == null) {
Logger.log(LogLevel.ERROR, "Image was supposedly read correctly,
but was null afterwards");
throw new InternalValidationException("imageSource",
"ImageInvalid",
"Image provided is not a valid image");
}
Here is the output:
2013/10/02 05-53-32,287::LOG:INFO[com.example#upload:L130 -- Upload
contains 2 items.]
2013/10/02 05-53-32,288::LOG:INFO[com.example#upload:L133 -- Item
0. Name: Dog.jpg, Type: application/octet-stream]
2013/10/02 05-53-32,288::LOG:WARN[com.example#upload:L140 -- Item shows
file type, but no bytes are available]
2013/10/02 05-53-32,289::LOG:INFO[com.example#upload:L133 -- Item
1. Name: null, Type: text/plain; charset=ISO-8859-1]
2013/10/02 05-53-32,290::LOG:ERROR[com.example#upload:L159 -- Image was
supposedly read correctly, but was null afterwards]
I am trying to upload an image to a servlet, but every once and a while
during automated testing, it silently fails. It looks like the number of
bytes available to be read is zero.
Do you guys know what would cause this?
Here is the code:
List<FileItem> items = new ServletFileUpload(
new DiskFileItemFactory()).parseRequest(request);
Logger.log(LogLevel.INFO, "Upload contains "+items.size()+" items.");
int i=0;
for (FileItem item : items){
Logger.log(LogLevel.INFO, "\tItem "+(i++)+".
Name:\t"+item.getName()+", Type:\t"+item.getContentType());
// File is of type "file"
if (!item.isFormField())
{
InputStream inputStream = item.getInputStream();
if (inputStream.available()==0){
Logger.log(LogLevel.WARN, "Item shows file type, but no
bytes are available");
}
try {
image = ImageIO.read(inputStream);
if (image!=null){
break;
}
} catch (Exception e) {
Logger.log(LogLevel.ERROR, "There was an error reading the
image. "+ExceptionUtils.getFullStackTrace(e));
throw new InternalValidationException("imageSource",
"ImageInvalid",
"Image provided is not a valid image");
} finally {
IOUtils.closeQuietly(inputStream);
}
}
}
if (image == null) {
Logger.log(LogLevel.ERROR, "Image was supposedly read correctly,
but was null afterwards");
throw new InternalValidationException("imageSource",
"ImageInvalid",
"Image provided is not a valid image");
}
Here is the output:
2013/10/02 05-53-32,287::LOG:INFO[com.example#upload:L130 -- Upload
contains 2 items.]
2013/10/02 05-53-32,288::LOG:INFO[com.example#upload:L133 -- Item
0. Name: Dog.jpg, Type: application/octet-stream]
2013/10/02 05-53-32,288::LOG:WARN[com.example#upload:L140 -- Item shows
file type, but no bytes are available]
2013/10/02 05-53-32,289::LOG:INFO[com.example#upload:L133 -- Item
1. Name: null, Type: text/plain; charset=ISO-8859-1]
2013/10/02 05-53-32,290::LOG:ERROR[com.example#upload:L159 -- Image was
supposedly read correctly, but was null afterwards]
glutTimerFunc() callback function isn't executed if time threshold is under a certain number of msecs
glutTimerFunc() callback function isn't executed if time threshold is
under a certain number of msecs
I am working with an application which requires an engine to be executed
in the lowest amount of time as possible by a GLUT GUI using the
glutTimerFunc():
void SetGLUTTimer(void);
void callback(int value)
{
Engine* pEngine;
pEngine = (Engine*) value;
pEngine->Process();
pEngine->SetGLUTTimer();
}
void Engine::SetGLUTTimer(void)
{
glutTimerFunc(50, callback, (int)this);
}
bool Engine::Run(void)
{
if (m_pViewer != NULL)
m_pViewer->Run();
else
return false;
return true;
}
If I set the time threshold to 1000 msecs or more the engine callback will
be regularly called, while any other interval below a second (like in the
example above) will cause the GUI to run indefinitely never executing the
engine Process() function.
under a certain number of msecs
I am working with an application which requires an engine to be executed
in the lowest amount of time as possible by a GLUT GUI using the
glutTimerFunc():
void SetGLUTTimer(void);
void callback(int value)
{
Engine* pEngine;
pEngine = (Engine*) value;
pEngine->Process();
pEngine->SetGLUTTimer();
}
void Engine::SetGLUTTimer(void)
{
glutTimerFunc(50, callback, (int)this);
}
bool Engine::Run(void)
{
if (m_pViewer != NULL)
m_pViewer->Run();
else
return false;
return true;
}
If I set the time threshold to 1000 msecs or more the engine callback will
be regularly called, while any other interval below a second (like in the
example above) will cause the GUI to run indefinitely never executing the
engine Process() function.
Tuesday, 1 October 2013
Sort PHP multidimensional array [Value1],[Value2]
Sort PHP multidimensional array [Value1],[Value2]
I have this Array:
[0] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 75071886
)
[tags] => SimpleXMLElement Object
(
[0] => #20, MusicVideos
)
)
[1] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 74212195
)
[tags] => SimpleXMLElement Object
(
[0] => #5, MusicVideos
)
)
[2] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 37274070
)
[tags] => SimpleXMLElement Object
(
[0] => #9, MusicVideos
)
)
[3] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 37277922
)
[tags] => SimpleXMLElement Object
(
[0] => #12, MusicVideos
)
)
Now I would like to sort this array by [tags] How do I do this this PHP?
Using the Online tool [Tags] use to order in my website by i want "#1",
"#2"
But i have one more than one [Tags] Like "#1" and "Category"
Thanks
I have this Array:
[0] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 75071886
)
[tags] => SimpleXMLElement Object
(
[0] => #20, MusicVideos
)
)
[1] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 74212195
)
[tags] => SimpleXMLElement Object
(
[0] => #5, MusicVideos
)
)
[2] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 37274070
)
[tags] => SimpleXMLElement Object
(
[0] => #9, MusicVideos
)
)
[3] => Array
(
[video_id] => SimpleXMLElement Object
(
[0] => 37277922
)
[tags] => SimpleXMLElement Object
(
[0] => #12, MusicVideos
)
)
Now I would like to sort this array by [tags] How do I do this this PHP?
Using the Online tool [Tags] use to order in my website by i want "#1",
"#2"
But i have one more than one [Tags] Like "#1" and "Category"
Thanks
R matrix and cooccurrence analysis
R matrix and cooccurrence analysis
I'm really newbie in R and I'd like to use it to carry out a co-occurrence
analysis of microbial taxa. I have a table like this (tab-separated) with
the relative abundance of taxa: Taxon Sample1 Sample2
Sample3.......Sample54 OTU1 0.2 0.005 0.009 0.12 OTU2 0.62..... OTU3 ....
OTU136
I'd like to obtain a Spearman's rank correlation matrix of the taxa and
then plot it in some nice graph. I'm supposed to have to convert my table
in matrix, before running the corr.test command, right?? So, I tryed to
convert it and it didn't give me any error, but when I tryed to tun the
corr.test, it says that the matrix is not numeric....
Can anyone help me to figure out how to do??
Thanks Francesca
I'm really newbie in R and I'd like to use it to carry out a co-occurrence
analysis of microbial taxa. I have a table like this (tab-separated) with
the relative abundance of taxa: Taxon Sample1 Sample2
Sample3.......Sample54 OTU1 0.2 0.005 0.009 0.12 OTU2 0.62..... OTU3 ....
OTU136
I'd like to obtain a Spearman's rank correlation matrix of the taxa and
then plot it in some nice graph. I'm supposed to have to convert my table
in matrix, before running the corr.test command, right?? So, I tryed to
convert it and it didn't give me any error, but when I tryed to tun the
corr.test, it says that the matrix is not numeric....
Can anyone help me to figure out how to do??
Thanks Francesca
Hosted 2008 SBS, DNS over Site to Site VPN Issues
Hosted 2008 SBS, DNS over Site to Site VPN Issues
Been having a little bit of a headache recently with DNS over site to site
VPN.
We have a SBS within a hosted environment and an RDS. The SBS is of course
hosting DNS for the internal domain. The office has all Domain
Workstations running Windows 7. All seems to run fine until DNS lookups
fail internally, I changed the SBS to have only 127.0.0.1 as primary DNS
(took out a public secondary) and changed the RDS to have only the
internal IP for SBS (again took out a public DNS secondary) and this seems
to have fixed the issue.
My question is why? My thoughts on DNS are:
Workstation - DNS Lookup - DNS Server replies with IP - Workstation can
find machine via IP
So how would changing IP address (secondary) on the Servers affect what
the workstations get as a reply from a DNS query?
Sorry hope this makes sense I tried my best not to waffle!
Thanks,
Charlie H
Been having a little bit of a headache recently with DNS over site to site
VPN.
We have a SBS within a hosted environment and an RDS. The SBS is of course
hosting DNS for the internal domain. The office has all Domain
Workstations running Windows 7. All seems to run fine until DNS lookups
fail internally, I changed the SBS to have only 127.0.0.1 as primary DNS
(took out a public secondary) and changed the RDS to have only the
internal IP for SBS (again took out a public DNS secondary) and this seems
to have fixed the issue.
My question is why? My thoughts on DNS are:
Workstation - DNS Lookup - DNS Server replies with IP - Workstation can
find machine via IP
So how would changing IP address (secondary) on the Servers affect what
the workstations get as a reply from a DNS query?
Sorry hope this makes sense I tried my best not to waffle!
Thanks,
Charlie H
Requests masking server name / DAPPER-HOST-IP
Requests masking server name / DAPPER-HOST-IP
For the last few days, I've been having a lot of requests to unexisting
pages on my server.
The worrying part about it is that, when I look at the 404 error log I've
built for my site, these requests seem to mask my server name: when asking
for CGI.SERVER_NAME (that's ColdFusion's equivalent to PHP's
$_SERVER['SERVER_NAME']), it doesn't return my server name as expected,
but other external domain names (some of them from kind of "dodgy"
websites).
Having a look at apache's access log, all the requests follow the same
pattern:
[root@myserver]# grep DAPPER-HOST-IP access_log | head -n 1
XXX.XX.XXX.XX - - [30/Sep/2013:02:11:28 +0100] "GET
/page-completely-unrelated-to-my-website.cfm HTTP/1.1" 404 1826 "-"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT
6.1)DAPPER-HOST-IP:YY.YYY.YY.YYY"
where XXX.XX.XXX.XX are always IPs of a certain search engine (which I'm
not especially keen on keeping). The user agent always have the string
"DAPPER-HOST-IP" and YY.YYY.YY.YYY is always a different random-ish IP,
unrelated to both my server and the above-mentioned search engine. I
suspect this IP has something to do with the server name masking issue.
The only action I've taken is to block some of the search engine's IP. I
hope this is enough, though I'm still worried about the fact that some
requests generated in my server appear as being originated from other
servers.
Any other suggestions would be appreciated. The only useful reference I've
found online up until now is:
http://www.webmasterworld.com/search_engine_spiders/4612980.htm
For the last few days, I've been having a lot of requests to unexisting
pages on my server.
The worrying part about it is that, when I look at the 404 error log I've
built for my site, these requests seem to mask my server name: when asking
for CGI.SERVER_NAME (that's ColdFusion's equivalent to PHP's
$_SERVER['SERVER_NAME']), it doesn't return my server name as expected,
but other external domain names (some of them from kind of "dodgy"
websites).
Having a look at apache's access log, all the requests follow the same
pattern:
[root@myserver]# grep DAPPER-HOST-IP access_log | head -n 1
XXX.XX.XXX.XX - - [30/Sep/2013:02:11:28 +0100] "GET
/page-completely-unrelated-to-my-website.cfm HTTP/1.1" 404 1826 "-"
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT
6.1)DAPPER-HOST-IP:YY.YYY.YY.YYY"
where XXX.XX.XXX.XX are always IPs of a certain search engine (which I'm
not especially keen on keeping). The user agent always have the string
"DAPPER-HOST-IP" and YY.YYY.YY.YYY is always a different random-ish IP,
unrelated to both my server and the above-mentioned search engine. I
suspect this IP has something to do with the server name masking issue.
The only action I've taken is to block some of the search engine's IP. I
hope this is enough, though I'm still worried about the fact that some
requests generated in my server appear as being originated from other
servers.
Any other suggestions would be appreciated. The only useful reference I've
found online up until now is:
http://www.webmasterworld.com/search_engine_spiders/4612980.htm
Subscribe to:
Comments (Atom)