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
Bordon
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
Subscribe to:
Comments (Atom)