问:
What jquery video player, plays avi, mp4, mkv, wmv files?
I am working on a web-based media center app. As a lightweight alternative to having a running  a media center app in linux.

I have a bash script that generates an html file that uses a polaroid display, of all the posters of my downloaded movies.

http://imageshack.us/photo/my-images/651/polaroidscreenshot.png

Once I click on a movie poster, I want to go to a second page, that will play a locally hosted  video.

I have tried working with jplayer, but have had problems just using the demo code, that it comes with.

Are there jquery or html5 video player's that support standard movie video formats? Such as avi, mp4, mkv and wmv?

Or would I have to convert them to a format that is more usable to the player?

I would rather not have to convert them, that is doable but would be time consuming, and may distort video quality.

Any suggestions?

答:
It's been a long time since this question was asked, but I just came across it while researching video players.You can always convert video formats using the ffmpeg tool, but as you said, it would be time consuming, and may distort video quality.
Nowadays there are HTML5 video players and it would be a better solution to use them to play the video formats that you mentioned. Here is a blog post about some of the popular HTML5 video players available on the Open Web.
http://cloudinary.com/blog/html5_video_player</p>


来源: stackexchange

问:
How do I average a sentiment score for a day with multiple texts?
I am doing a text sentiment analysis in R using the tm package. I have scraped news articles from Reuters and gave them a variable name according to their date. I added a,b,c etc. to indicate multiple articles per day, like this:

art170411a

art170411b

art170411c

art170410a

...

...

I then run a standard positive/negative terms analysis which gives me the sentiment score per article. My question is: how do I average these scores so that I get a sentiment score per day?

I have a VCorpus containing my 2000+ articles over 3 years. Every article has a date stamp. For the matching with the positive/negative terms I have converted my Corpus to a list and then a bag of words like this:

```<code>corp_list <- lapply(corp, FUN = paste, collapse=" ")
corp_bag <- str_split(corp_list, pattern = "\\s+")
</code>```

I have the final score in two formats:

```<code>score_naive_list <- lapply(corp_bag, function(x) { sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))})

score_naive <- unlist(lapply(corp_bag, function(x) { sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))}))
</code>```

So my question: how do I average the multiple sentiment scores into a one day score?

答:
I redid my answer with reproducible data, once you get your data sorted this should work just fine.</p>

```<code>library(tm)
reut21578 <- system.file("texts", "crude", package = "tm")
corp <- VCorpus(DirSource(reut21578),readerControl = list(reader = readReut21578XMLasPlain))

timestamps <- meta(reuters,"datetimestamp")
days <- sapply(timestamps,strftime,format="%Y-%m-%d")
pos <- c("good","excellent","positive","effective")
neg <- c("bad","terrible","negative")

corp_list <- lapply(corp, FUN = paste, collapse=" ")
daily_bows <- aggregate(corp_list ~ days,data.frame(corp_list = unlist(corp_list),days = days),FUN=paste,collapse = " ")
corp_bag <- str_split(daily_bows$corp_list, pattern = "\\s+")

score_string <- function(x){
  sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))
}
daily_bows$scores <- sapply(corp_bag,score_string)
print(daily_bows[,c("days","scores")])

# days scores
# 1 1987-02-26      3
# 2 1987-03-01      1
# 3 1987-03-02      1
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I am doing a text sentiment analysis in R using the tm package. I have scraped news articles from Reuters and gave them a variable name according to their date. I added a,b,c etc. to indicate multiple articles per day, like this:

art170411a

art170411b

art170411c

art170410a

...

...

I then run a standard positive/negative terms analysis which gives me the sentiment score per article. My question is: how do I average these scores so that I get a sentiment score per day?

I have a VCorpus containing my 2000+ articles over 3 years. Every article has a date stamp. For the matching with the positive/negative terms I have converted my Corpus to a list and then a bag of words like this:

corp_list <- lapply(corp, FUN = paste, collapse=" ")
corp_bag <- str_split(corp_list, pattern = "\\s+")

I have the final score in two formats:

score_naive_list <- lapply(corp_bag, function(x) { sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))})

score_naive <- unlist(lapply(corp_bag, function(x) { sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))}))

So my question: how do I average the multiple sentiment scores into a one day score?

Body:
I redid my answer with reproducible data, once you get your data sorted this should work just fine.

library(tm)
reut21578 <- system.file("texts", "crude", package = "tm")
corp <- VCorpus(DirSource(reut21578),readerControl = list(reader = readReut21578XMLasPlain))

timestamps <- meta(reuters,"datetimestamp")
days <- sapply(timestamps,strftime,format="%Y-%m-%d")
pos <- c("good","excellent","positive","effective")
neg <- c("bad","terrible","negative")

corp_list <- lapply(corp, FUN = paste, collapse=" ")
daily_bows <- aggregate(corp_list ~ days,data.frame(corp_list = unlist(corp_list),days = days),FUN=paste,collapse = " ")
corp_bag <- str_split(daily_bows$corp_list, pattern = "\\s+")

score_string <- function(x){
  sum(!is.na(match(x, pos))) - sum(!is.na(match(x, neg)))
}
daily_bows$scores <- sapply(corp_bag,score_string)
print(daily_bows[,c("days","scores")])

# days scores
# 1 1987-02-26      3
# 2 1987-03-01      1
# 3 1987-03-02      1


问:
Socket.io: net::ERR_CONNECTION_CLOSED
I am trying to set up socket.io on my web site but the server logs an error saying the port is already in use (I set it to the same as my server's). I am using Express.

If I set it to a different port, I get a 'net::ERR_CONNECTION_CLOSED' error.

How can I fix this?

答:
You are probably creating (either explicitly or implicitly) two separate HTTP server instances that should listen on the same port, so the second instance will throw an error because the first is already occupying the port.

Instead, you can share the same HTTP server between both Express and socket.io, so there will be only one HTTP server that handles both:

```<code>const express  = require('express');
const app      = express();
const server   = app.listen(3000); // or whatever port you want
const io       = require('socket.io')(server);
</code>```

app.listen(...) returns the HTTP server instance that Express will create for you. You can re-use that instance for socket.io by passing it into its constructor (returned by require('socket.io')).

Title: Socket.io: net::ERR_CONNECTION_CLOSED

Body:
You are probably creating (either explicitly or implicitly) two separate HTTP server instances that should listen on the same port, so the second instance will throw an error because the first is already occupying the port.

Instead, you can share the same HTTP server between both Express and socket.io, so there will be only one HTTP server that handles both:

const express  = require('express');
const app      = express();
const server   = app.listen(3000); // or whatever port you want
const io       = require('socket.io')(server);

app.listen(...) returns the HTTP server instance that Express will create for you. You can re-use that instance for socket.io by passing it into its constructor (returned by require('socket.io')).


问:
Unable to acquire JDBC Connection
I have a Spring Boot project with Hibernate and Hikari DataSource.
If i have some functionality with injected SessionFactory object to get session object, in few days I have such exception for any methods assosiated with db operations (only restarting solves this problem):

```<code>org.springframework.transaction.CannotCreateTransactionException:
Could not open JPA EntityManager for transaction; nested exception is
javax.persistence.PersistenceException:
org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at
......
Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 -
Connection is not available, request timed out after 30001ms.
</code>```

It seems to manual used session makes this problem. (I have similar project with the same configs and functionality, but without injected SessionFactory and Session...and I don't have such problem at all)

application.yaml:

```<code>spring:
  jpa:
    properties:
      hibernate:
        dialect : org.hibernate.dialect.PostgreSQLDialect
        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
</code>```

DataSourceConfig

```<code>@EnableJpaRepositories("com.my.project.config")
@Configuration
public class DataSourceConfig {

    @Inject
    private AppProperties properties;

    @Bean(name = "dataSource")
    public DataSource dataSource() {
        AppProperties.DatabaseProperties dbProps = properties.getDatabaseProperties();
        HikariDataSource dataSource = new HikariDataSource();
        dataSource.setDriverClassName(org.postgresql.Driver.class.getName());
        dataSource.setJdbcUrl(
            dbProps.getProtocol().concat("://")
                .concat(dbProps.getDbHost()).concat(":")
                .concat(dbProps.getDbPort()).concat("/")
                .concat(dbProps.getDbname())
        );
        dataSource.setUsername(dbProps.getUsername());
        dataSource.setPassword(dbProps.getPassword());
        dataSource.setMaximumPoolSize(30);
        dataSource.setMinimumIdle(30);

        return dataSource;
    }

    @Bean
    public SessionFactory sessionFactory(HibernateEntityManagerFactory hemf)   {
        return hemf.getSessionFactory();
    }
}
</code>```

LogRepositoryImpl

```<code>@Repository
public class LogRepositoryImpl implements LogRepository {

    @Autowired
    private SessionFactory sessionFactory;

    @Override
    public List<Log> getLogs(int offset, int count) {
        Criteria criteria = getSession().createCriteria(Log.class);
        return criteria.setFirstResult(offset).setMaxResults(count).list();
    }

    @Override
    public void save(Log log) {
        getSession().save(log);
    }

    private Session getSession() {
        return sessionFactory.getCurrentSession();
    }
}
</code>```

dataSource.setMaximumPoolSize(30),
        dataSource.setMinimumIdle(); didn't solve this problem

答:
Sounds to me like an issue with your transaction boundaries, which aren't releasing the connections back to the pool. Could you try putting @Transactional on your LogRepositoryImpl class?

```<code>@Repository
@Transactional
public class LogRepositoryImpl implements LogRepository {
    . . .
}
</code>```

Title: Unable to acquire JDBC Connection

Body:
I have a Spring Boot project with Hibernate and Hikari DataSource.
If i have some functionality with injected SessionFactory object to get session object, in few days I have such exception for any methods assosiated with db operations (only restarting solves this problem):

org.springframework.transaction.CannotCreateTransactionException:
Could not open JPA EntityManager for transaction; nested exception is
javax.persistence.PersistenceException:
org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at
......
Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 -
Connection is not available, request timed out after 30001ms.

It seems to manual used session makes this problem. (I have similar project with the same configs and functionality, but without injected SessionFactory and Session...and I don't have such problem at all)

application.yaml:

spring:
  jpa:
    properties:
      hibernate:
        dialect : org.hibernate.dialect.PostgreSQLDialect
        current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext

DataSourceConfig

@EnableJpaRepositories("com.my.project.config")
@Configuration
public class DataSourceConfig {

    @Inject
    private AppProperties properties;

    @Bean(name = "dataSource")
    public DataSource dataSource() {
        AppProperties.DatabaseProperties dbProps = properties.getDatabaseProperties();
        HikariDataSource dataSource = new HikariDataSource();
        dataSource.setDriverClassName(org.postgresql.Driver.class.getName());
        dataSource.setJdbcUrl(
            dbProps.getProtocol().concat("://")
                .concat(dbProps.getDbHost()).concat(":")
                .concat(dbProps.getDbPort()).concat("/")
                .concat(dbProps.getDbname())
        );
        dataSource.setUsername(dbProps.getUsername());
        dataSource.setPassword(dbProps.getPassword());
        dataSource.setMaximumPoolSize(30);
        dataSource.setMinimumIdle(30);

        return dataSource;
    }

    @Bean
    public SessionFactory sessionFactory(HibernateEntityManagerFactory hemf)   {
        return hemf.getSessionFactory();
    }
}

LogRepositoryImpl

@Repository
public class LogRepositoryImpl implements LogRepository {

    @Autowired
    private SessionFactory sessionFactory;

    @Override
    public List<Log> getLogs(int offset, int count) {
        Criteria criteria = getSession().createCriteria(Log.class);
        return criteria.setFirstResult(offset).setMaxResults(count).list();
    }

    @Override
    public void save(Log log) {
        getSession().save(log);
    }

    private Session getSession() {
        return sessionFactory.getCurrentSession();
    }
}

dataSource.setMaximumPoolSize(30),
        dataSource.setMinimumIdle(); didn't solve this problem

Body:
Sounds to me like an issue with your transaction boundaries, which aren't releasing the connections back to the pool. Could you try putting @Transactional on your LogRepositoryImpl class?

@Repository
@Transactional
public class LogRepositoryImpl implements LogRepository {
    . . .
}


问:
Deleting CoreData object & Inverse relationships
I have an object (A) that has a To-Many relationship to another object (B).
Also, B holds an inverse relationship to A.

When I delete B, It still shown on A's relation ship count, unless i manually clean the inverse relationship of B before deletion.
I want it to happen synchronously, so i could update a UITableView and delete B's row,
instead of waiting for MOC's save action to complete.

Is there any way to handle that without manually cleaning B's inverse?
(I have tons of these relationships and it would be bad practice & hard to maintain)

Thanks!

答:
Almost 5 years later (at iOS 10 now) and I stumbled upon the same issue.

App started crashing after I decided to 'optimise' things by removing the saveContext() from almost everywhere, thinking that the in-memory representation is guaranteed to be correct (since includesPendingChanges is true by default).

However I was getting the issue described (and because later some UITableView needed to be updated, app was crashing).

Here are four separate approaches, any one of which solved the issue in my case:
(ordered from best to worst as far as I can judge)

calling processPendingChanges() (on the NSManagedObjectContext) after the deletion

calling refreshAllObjects() (on the NSManagedObjectContext) after the deletion

calling saveContext() after the deletion (as others have pointed out in the comments)

just waiting. for example, delaying the execution of the code that depends on the correct data by 0.1 seconds or so (using DispatchQueue.main.asyncAfter). (this of course is by far the worst approach and you should not implement it)

Things I am still not sure about:

I tried replicating it on a separate very small example project and I did not get the issue. So what is the underlying problem?

Is this expected behaviour or a bug? Is it documented anywhere?


问:
Don't allow Google Form submission at specific time
I have a Google Form but I want to limit the usage of this form.
Users should not be able to submit this form from 19:00 until 21:00.

Looking at the events documentation there is no event available to trigger when the user opens the form (except for when editing).

The only other way I can think of is to delete the entry after it's added, but it's important to prevent the new entry from being created. Therefore an on form submit function does not seem to be the right option as well.

Ideally we'd have a notification to the user when it's opening the form within the prohibited timerange asking him/her to return later. Any suggestions on how to realize this?

答:
You may take a look at Form class, especially on setAcceptingResponses(enabled) method, which is allowing you to accepting new responses. You can use it with a time based trigger to disabled new responses at 19:00 and enable it at 21:00.

Otherwise, you can use FormTriggerBuilder class and create a onFormSubmit() trigger to aware the user of a time restriction, since other trigger can't advise your user sooner.


问:
MVC 3 RC2 Webgrid nightmares, anyone have paging working correctly?
I am using the latest RC2 version of MVC3.

I have a webgrid and it is giving me horrible problems, specifically with the paging and sorting.
I have been told that the paging should be more efficient now, and not pull back the whole table but only rows needed for the page you are viewing. This is not working as i hoped (very slow), and so have taken it to the simplest form and booted up the profiler.

I have this ActionResult:

```<code>    public ActionResult TestGrid()
    {
        return View(ents.Decisions);
    }
</code>```

And this view:

```<code>    @model IEnumerable<DecisionPanel.Web.Models.DataModel.Decision>

@{
    ViewBag.Title = "TestGrid";
    var usersGrid = new WebGrid(source: Model, rowsPerPage: 50);
}

<h2>TestGrid</h2>

@usersGrid.GetHtml(
        tableStyle: "grid",
        headerStyle: "header",
        alternatingRowStyle: "alt",
        rowStyle: "row",
                columns: usersGrid.Columns(
                        usersGrid.Column("UserID", "User Id"),
                        usersGrid.Column("HasAgreed", "Has Agreed?"),
                        usersGrid.Column("Comment"),
                        usersGrid.Column("DateResponded", "Date of Response", format: @<text>@item.DateResponded.ToString("dd MMM yyy (HH:mm.ss)")</text>)
        )
    )
</code>```

Hitting the page is causing this to run on the profiler - 11 times:

```<code>SELECT
[Extent1].[ID] AS [ID],
[Extent1].[UserID] AS [UserID],
[Extent1].[HasAgreed] AS [HasAgreed],
[Extent1].[Comment] AS [Comment],
[Extent1].[DateResponded] AS [DateResponded]
FROM [dbo].[DecisionResults] AS [Extent1]
</code>```

I am having some other problems but if i can't even get this working i am considering abandoning the webgrid.

I know it's early days with it being out under a week, but has anyone else had any joy using the paging?

答:
Aren't you supposed to specify the pager similar to </p>

```<code>@usersGrid.Pager(WebGridPagerModes.NextPrevious)
</code>```

ContentLicense: CC BY-SA 2.5

Body:
I am using the latest RC2 version of MVC3.

I have a webgrid and it is giving me horrible problems, specifically with the paging and sorting.
I have been told that the paging should be more efficient now, and not pull back the whole table but only rows needed for the page you are viewing. This is not working as i hoped (very slow), and so have taken it to the simplest form and booted up the profiler.

I have this ActionResult:

    public ActionResult TestGrid()
    {
        return View(ents.Decisions);
    }

And this view:

    @model IEnumerable<DecisionPanel.Web.Models.DataModel.Decision>

@{
    ViewBag.Title = "TestGrid";
    var usersGrid = new WebGrid(source: Model, rowsPerPage: 50);
}

TestGrid

@usersGrid.GetHtml(
        tableStyle: "grid",
        headerStyle: "header",
        alternatingRowStyle: "alt",
        rowStyle: "row",
                columns: usersGrid.Columns(
                        usersGrid.Column("UserID", "User Id"),
                        usersGrid.Column("HasAgreed", "Has Agreed?"),
                        usersGrid.Column("Comment"),
                        usersGrid.Column("DateResponded", "Date of Response", format: @<text>@item.DateResponded.ToString("dd MMM yyy (HH:mm.ss)")</text>)
        )
    )

Hitting the page is causing this to run on the profiler - 11 times:

SELECT
[Extent1].[ID] AS [ID],
[Extent1].[UserID] AS [UserID],
[Extent1].[HasAgreed] AS [HasAgreed],
[Extent1].[Comment] AS [Comment],
[Extent1].[DateResponded] AS [DateResponded]
FROM [dbo].[DecisionResults] AS [Extent1]

I am having some other problems but if i can't even get this working i am considering abandoning the webgrid.

I know it's early days with it being out under a week, but has anyone else had any joy using the paging?

Body:
Aren't you supposed to specify the pager similar to

@usersGrid.Pager(WebGridPagerModes.NextPrevious)


问:
How to implement generic function that receives differents types scala
```<code>    import org.apache.spark.{ SparkConf, SparkContext }
    import org.apache.spark.rdd.RDD

    class BaseType(val a: String) extends Serializable {
     override def toString = "(" + a + ")"
    }
    class TypeA(a: String, val b: String) extends BaseType(a) {
     override def toString = "(" + a + "," + b + ")"
    }
    class TypeB(a: String, val b: String) extends BaseType(a) {
     override def toString = "(" + a + "," + b + ")"
    }

   object EntityInheritance {
    def main(args: Array[String]) = {

    val sparkConf = new SparkConf()
      .setMaster("local[*]")
      .setAppName("EntityInheritance Sample")

    val sc = new SparkContext(sparkConf)

    val text_file = sc.textFile("/dqa/sample_logs/tipologies/entityInheritance.txt")
    val items = text_file.flatMap(_.split("\n"))

        val itemsRDDa = items.map(newInstanceA(_))
        itemsRDDa.foreach { rdd => println(rdd) }
        val countAa = countersAttributeA[TypeA](itemsRDDa)

        val itemsRDDb = items.map(newInstanceB(_))
    itemsRDDb.foreach { rdd => println(rdd) }
        val countBa = countersAttributeA[TypeB](itemsRDDb)

    sc.stop()
  }

    def newInstanceA(str: String): TypeA = {
      val parts = str.split(" ")
      new TypeA(parts(0), parts(1))
    }

    def newInstanceB(str: String): TypeB = {
        val parts = str.split(" ")
        new TypeB(parts(0), parts(1))
    }

    // I want to implement a generic function that receives RDD[TypeA] or RDD[TypeB]
    // it's a simple example
     def countersAttributeA[A](rdd: org.apache.spark.rdd.RDD[A]) = {
       rdd
        .map(s => (s.a, 1))
        .reduceByKey(_ + _)
     }
   }
</code>```

Hello, I have a problem but is possible that this idea is isn't good.

I trying to implement a generic function that receives different types. When create a different objects for example TypeA and TypeB I want to send to counterAttributeA -> count number of apparences of attribute 'a', but the console send this error:

```<code>[error] /src/main/scala/org/sparklambda/testing/EntityInheritance.scala:53: value a is not a member of type parameter A
[error]       .map(s => (s.a, 1))
[error]                    ^
[error] one error found
</code>```

Anyone you can help me? Thank's for all.

答:
You need to tell the compiler that the type is going to be at least BaseType in order for it to know that it'll have access to the a property.

```<code>def countersAttributeA[A <: BaseType](rdd: org.apache.spark.rdd.RDD[A])
</code>```

Body:
    import org.apache.spark.{ SparkConf, SparkContext }
    import org.apache.spark.rdd.RDD

    class BaseType(val a: String) extends Serializable {
     override def toString = "(" + a + ")"
    }
    class TypeA(a: String, val b: String) extends BaseType(a) {
     override def toString = "(" + a + "," + b + ")"
    }
    class TypeB(a: String, val b: String) extends BaseType(a) {
     override def toString = "(" + a + "," + b + ")"
    }

   object EntityInheritance {
    def main(args: Array[String]) = {

    val sparkConf = new SparkConf()
      .setMaster("local[*]")
      .setAppName("EntityInheritance Sample")

    val sc = new SparkContext(sparkConf)

    val text_file = sc.textFile("/dqa/sample_logs/tipologies/entityInheritance.txt")
    val items = text_file.flatMap(_.split("\n"))

        val itemsRDDa = items.map(newInstanceA(_))
        itemsRDDa.foreach { rdd => println(rdd) }
        val countAa = countersAttributeA[TypeA](itemsRDDa)

        val itemsRDDb = items.map(newInstanceB(_))
    itemsRDDb.foreach { rdd => println(rdd) }
        val countBa = countersAttributeA[TypeB](itemsRDDb)

    sc.stop()
  }

    def newInstanceA(str: String): TypeA = {
      val parts = str.split(" ")
      new TypeA(parts(0), parts(1))
    }

    def newInstanceB(str: String): TypeB = {
        val parts = str.split(" ")
        new TypeB(parts(0), parts(1))
    }

    // I want to implement a generic function that receives RDD[TypeA] or RDD[TypeB]
    // it's a simple example
     def countersAttributeA[A](rdd: org.apache.spark.rdd.RDD[A]) = {
       rdd
        .map(s => (s.a, 1))
        .reduceByKey(_ + _)
     }
   }

Hello, I have a problem but is possible that this idea is isn't good.

I trying to implement a generic function that receives different types. When create a different objects for example TypeA and TypeB I want to send to counterAttributeA -> count number of apparences of attribute 'a', but the console send this error:

[error] /src/main/scala/org/sparklambda/testing/EntityInheritance.scala:53: value a is not a member of type parameter A
[error]       .map(s => (s.a, 1))
[error]                    ^
[error] one error found

Anyone you can help me? Thank's for all.

Body:
You need to tell the compiler that the type is going to be at least BaseType in order for it to know that it'll have access to the a property.

def countersAttributeA[A <: BaseType](rdd: org.apache.spark.rdd.RDD[A])


问:
How can I display a svg in prawn without saving a .svg file before?
For this moment, I generate a svg file and then I read it and I display it in my pdf:

```<code> qr = Barby::QrCode.new('test')
 outputter = Barby::CairoOutputter.new(qr).to_svg
 File.open('myfile.svg', 'wb'){|f| f.write outputter }
 pdf.svg IO.read('myfile.svg'), width: 50, height: 50
</code>```

My question is: how can I display my svg without saving a .svg file before. I know there is a css property that allow that but I can't use css with prawn...
Any ideas?

答:
It's working like that:

```<code>pdf.svg outputter, width: 50, height: 50
</code>```

thanks @Mark Thomas

Body:
For this moment, I generate a svg file and then I read it and I display it in my pdf:

 qr = Barby::QrCode.new('test')
 outputter = Barby::CairoOutputter.new(qr).to_svg
 File.open('myfile.svg', 'wb'){|f| f.write outputter }
 pdf.svg IO.read('myfile.svg'), width: 50, height: 50

My question is: how can I display my svg without saving a .svg file before. I know there is a css property that allow that but I can't use css with prawn...
Any ideas?

Body:
It's working like that:

pdf.svg outputter, width: 50, height: 50

thanks @Mark Thomas


问:
Pass data between activities Android
I want to know if there is a way to pass a class object, which can't implement serializable interface between 2 android activities.
I know that to pass data using intent you have to implement serializable interface, but unfortunately I can't do this, any idea?

```<code>public class ContactMongo implements Serializable{
private DB collection;
public ContactMongo()
{ }

}
</code>```

DB doesn't implement serializable, so I can't perform intent.putExtra();

答:
You need to send an intent with whatever you want to pass.

```<code>Intent intent = new Intent(this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById(R.id.editText);
    Object object;
    intent.putExtra("nameforyourobject", object);
    startActivity(intent);
</code>```

https://developer.android.com/training/basics/firstapp/starting-activity.html

Title: Pass data between activities Android

Body:
I want to know if there is a way to pass a class object, which can't implement serializable interface between 2 android activities.
I know that to pass data using intent you have to implement serializable interface, but unfortunately I can't do this, any idea?

public class ContactMongo implements Serializable{
private DB collection;
public ContactMongo()
{ }

}

DB doesn't implement serializable, so I can't perform intent.putExtra();

Body:
You need to send an intent with whatever you want to pass.

Intent intent = new Intent(this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById(R.id.editText);
    Object object;
    intent.putExtra("nameforyourobject", object);
    startActivity(intent);

https://developer.android.com/training/basics/firstapp/starting-activity.html


问:
Moving Laravel 5.4 project on CentOS 6 (Linux) - permission denied issue
I have moved laravel projects before on shared hosting but not to university CentOS server.

I have put laravel public folder files inside public_html and I have put all other laravel project files under blog folder.

```<code>Root
 -blog
  -entire project files
 -public_html
  -all the public files
</code>```

I changed 2 lines in index.php

```<code>require __DIR__.'/../blog/bootstrap/autoload.php';
$app = require_once __DIR__.'/../blog/bootstrap/app.php';
</code>```

As you can see I have added /blog

I have access to SSH shell, and below are the list of errors:

```PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 10:43:58 2017] [error] [client 137.195.14.30] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 10:43:58 2017] [error] [client 137.195.14.30] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 11:58:06 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:06 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:09 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:09 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:12 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:12 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:14 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:14 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:11 2017] [crit] [client 92.98.49.227] (13)Permission denied: /home/cs/username/public_html/app/Http/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 13:13:58 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:14:09 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:14:14 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:42 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:52 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:54 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:55 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:58 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:22:01 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:29:56 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:35:40 2017] [error] [client 92.98.49.227] File does not exist: /home/cs/username/public_html/public
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
```

答:
If public_html/ is your web root directory, then you might want to place ALL your Laravel files inside of the web root directory. Laravel should know how to use its own public folder. You shouldn't have to change the autoload paths.

For permissions to other important Laravel directories, please read this:

"Directory Permissions

After installing Laravel, you may need to configure some permissions. Directories within the  storage and the bootstrap/cache directories should be writable by your web server or Laravel will not run. If you are using the Homestead virtual machine, these permissions should already be set."

Body:
I have moved laravel projects before on shared hosting but not to university CentOS server.

I have put laravel public folder files inside public_html and I have put all other laravel project files under blog folder.

Root
 -blog
  -entire project files
 -public_html
  -all the public files

I changed 2 lines in index.php

require __DIR__.'/../blog/bootstrap/autoload.php';
$app = require_once __DIR__.'/../blog/bootstrap/app.php';

As you can see I have added /blog

I have access to SSH shell, and below are the list of errors:

PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 10:43:58 2017] [error] [client 137.195.14.30] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 10:43:58 2017] [error] [client 137.195.14.30] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 11:54:48 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 11:58:06 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:06 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:09 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:09 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:12 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:12 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:14 2017] [error] [client 92.98.49.227] PHP Warning:  require(/home/cs/username/public_html/../bootstrap/autoload.php): failed to open stream: No such file or directory in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 11:58:14 2017] [error] [client 92.98.49.227] PHP Fatal error:  require(): Failed opening required '/home/cs/username/public_html/../bootstrap/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/index.php on line 22
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:35 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:05:38 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:05:46 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:07:33 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 12:55:51 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:05 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 12:56:11 2017] [crit] [client 92.98.49.227] (13)Permission denied: /home/cs/username/public_html/app/Http/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 13:13:58 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:14:09 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:14:14 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:42 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:52 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:54 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:55 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:21:58 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:22:01 2017] [alert] [client 92.98.49.227] /home/cs/username/public_html/public/.htaccess: Options not allowed here
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/public_html/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/public_html/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:22:20 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:29:56 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel',  in /home/cs/username/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729, referer: http://www2.macs.hw.ac.uk/~mf156/
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:34 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:35:40 2017] [error] [client 92.98.49.227] File does not exist: /home/cs/username/public_html/public
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:35:45 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php): failed to open stream: Permission denied in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Warning:  include(): Failed opening '/home/cs/username/blog/vendor/composer/../../app/Http/Kernel.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /home/cs/username/blog/vendor/composer/ClassLoader.php on line 444
[Thu Jun 08 13:36:48 2017] [error] [client 92.98.49.227] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class App\\Http\\Kernel does not exist' in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php:729\nStack trace:\n#0 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(729): ReflectionClass->__construct('App\\\\Http\\\\Kernel')\n#1 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(608): Illuminate\\Container\\Container->build('App\\\\Http\\\\Kernel')\n#2 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\\Container\\Container->resolve('App\\\\Http\\\\Kernel', Array)\n#3 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(709): Illuminate\\Container\\Container->makeWith('App\\\\Http\\\\Kernel', Array)\n#4 /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php(248): Illuminate\\Foundation\\Application->makeWith('App\\\\Http\\\\Kernel', Array)\n#5 /home/cs/username/blog/vendor/lara in /home/cs/username/blog/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 729


问:
Jquery jtable sorting child table
General query at this stage - I can post code if needs be but I shall probably have to simplify it a bit first.
I have used jtable quite a bit but I am having trouble getting sorting to work on a child table - are there fundamental differences between sorting a child table and a parent table?

When I put in the custom listAction function on the child table definition with parameters (postData, jtParams), and sorting: true on the definition, jtParams just comes through as an empty object.

Am I missing something?

Thanks

答: I recommend you to use JqGrid library. This may not answer your question but it's better if you post your code and everyone can see what are you trying.</p>

Title: Jquery jtable sorting child table


问:
how to call function in node loop one at a time
this block of code process else block first and then if block, for all request at once, i need a code that execute 5  iterations stop for 15 sec. and then again continue from next 5 iterations and so on.</p>

```<code>function passotken(token, callback) {

async.waterfall([
function(callback) {
db.executesql("select top 20 ext_id as EMPNUM ,  data as datae from newtable", function (data, err) {

    callback(null, data);
    });
},
function(data, callback) {
    var _json_parse = JSON.parse(JSON.stringify(data));
    var rows = data.length;

    console.log(rows)
    var cnt = 1;

    for (var row = 1; row <= rows; row++) {

    logger.info(_json_parse[row-1].EMPNUM);
    //console.log(dateFormat(_json_parse[row].datae));
    var req = 'https://pratik.com/ta/rest/v2/companies/|RHV/employees/|' +_json_parse[row-1].EMPNUM + '/timesheets?date=' + dateFormat(_json_parse[row-1].datae, "isoDate");
    //console.log(req);
    var myXMLText = req;

    reques.push(myXMLText);

    }
   // console.log(reques);

    for (var a = 0; a < rows; a++) {
         //CURRENTLY PROCESSING ALL REQUEST IN IF BLOCK AND STOP FOR 15 SEC FOR ONLY FIRST IF CONDITION AFTER THAT ALL IF CONDITION PROCESSING WITHOUT HALT
    if(a%5==0)
    {
        console.log("if");
        //console.log(reques[a]);

        //postreq(reques[a],token,sleeped(a));
      /*  setTimeout(function(){sleeped(reques[a],token);;

    },15000); */
        sleeped(reques[a],token);

        //SHOULD PROCESS IF BLOCK ONCE AND STOP FOR 15 SEC
    }
    else
    {

        postreqELSE(reques[a],token);
        //SHOULD PROCESS ALL REQUECT IN ELSE BLOCK TILL IF CONDITION ABOVE NOT SATISY

    }

    }

Promise.all(ps)
.then((results) => {
console.log("results"); // Result of all resolve as an array
}).catch(err => console.log("err"));
},
], function(err, result) {
if (!err)
    console.log("Successfully completed")
else console.log(err);
});
};

function callback() {
console.log("completed successfully");
}

function postreq(request1,token)
{
//BLOCK

    }

    function sleeped(requesarr,token)
    {
    console.log("in sleeping");
    //console.log(requesarr,token)

    setTimeout(function(){
        postreq(requesarr,token);
    },15000);}

    function postreqELSE(request2,token1)
{
console.log("in 3RD function");
   //BLOCK2

    }
</code>```

答:
Sure, this question was answered previously here: What is the JavaScript version of sleep()?

Following is an example which will do what you're requesting:

```<code>var reques = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}
async function checkLoop()
{
  for (var a = 0; a < 20; a++)
  { console.log("["+a+"] a%5 is: "+a%5);
    console.log ( new Date().toLocaleTimeString());
    if(a%5==0)
    { console.log("if");
    console.log ( new Date().toLocaleTimeString());
    await sleep(15000);
    }
    else
    { console.log("else");
    console.log ( new Date().toLocaleTimeString());

    }
  }
}
checkLoop();
</code>```

This prints out the following: (partial) Important to note that it will always pause on the first iteration because the index starts at 0, not 1.

```<code>[0] a%5 is: 0
8:58:38 AM
if
[1] a%5 is: 1
8:58:53 AM
else
8:58:53 AM
[2] a%5 is: 2
8:58:53 AM
else
8:58:53 AM
[3] a%5 is: 3
8:58:53 AM
else
8:58:53 AM
[4] a%5 is: 4
8:58:53 AM
else
8:58:53 AM
[5] a%5 is: 0
8:58:53 AM
if
8:58:53 AM
[6] a%5 is: 1
8:59:08 AM
else
8:59:08 AM
[7] a%5 is: 2
8:59:08 AM
else
8:59:08 AM
</code>```

If you can't use async, then try this approach: (interval set at 1.5 secs for easier testing. just change the 1500 to 15000 to = 15 seconds)

```<code>var reques = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
var _interval;
var timeToWait = 1500;
function checkLoop(_init)
{
  clearInterval(_interval);
  console.log("checkLoop entered with value of: ", _init);
  var start = (typeof(_init) == "undefined") ? 0 : _init;
  console.log("start is: "+start);
  for (var a = start; a < 20; a++)
  { console.log("["+a+"] a%5 is: "+a%5);
    console.log ( new Date().toLocaleTimeString());
    if(a%5==0)
    { console.log("if");
    console.log ( new Date().toLocaleTimeString());
    (function(_idx){_interval = setInterval(function(){checkLoop(_idx+1)}, timeToWait);})(a)
    break;
    }
    else
    { console.log("else");
    console.log ( new Date().toLocaleTimeString());

    }
  }
}
checkLoop();
</code>```

Body:
this block of code process else block first and then if block, for all request at once, i need a code that execute 5  iterations stop for 15 sec. and then again continue from next 5 iterations and so on.

function passotken(token, callback) {

async.waterfall([
function(callback) {
db.executesql("select top 20 ext_id as EMPNUM ,  data as datae from newtable", function (data, err) {

    callback(null, data);
    });
},
function(data, callback) {
    var _json_parse = JSON.parse(JSON.stringify(data));
    var rows = data.length;

    console.log(rows)
    var cnt = 1;

    for (var row = 1; row <= rows; row++) {

    logger.info(_json_parse[row-1].EMPNUM);
    //console.log(dateFormat(_json_parse[row].datae));
    var req = 'https://pratik.com/ta/rest/v2/companies/|RHV/employees/|' +_json_parse[row-1].EMPNUM + '/timesheets?date=' + dateFormat(_json_parse[row-1].datae, "isoDate");
    //console.log(req);
    var myXMLText = req;

    reques.push(myXMLText);

    }
   // console.log(reques);

    for (var a = 0; a < rows; a++) {
         //CURRENTLY PROCESSING ALL REQUEST IN IF BLOCK AND STOP FOR 15 SEC FOR ONLY FIRST IF CONDITION AFTER THAT ALL IF CONDITION PROCESSING WITHOUT HALT
    if(a%5==0)
    {
        console.log("if");
        //console.log(reques[a]);

        //postreq(reques[a],token,sleeped(a));
      /*  setTimeout(function(){sleeped(reques[a],token);;

    },15000); */
        sleeped(reques[a],token);

        //SHOULD PROCESS IF BLOCK ONCE AND STOP FOR 15 SEC
    }
    else
    {

        postreqELSE(reques[a],token);
        //SHOULD PROCESS ALL REQUECT IN ELSE BLOCK TILL IF CONDITION ABOVE NOT SATISY

    }

    }

Promise.all(ps)
.then((results) => {
console.log("results"); // Result of all resolve as an array
}).catch(err => console.log("err"));
},
], function(err, result) {
if (!err)
    console.log("Successfully completed")
else console.log(err);
});
};

function callback() {
console.log("completed successfully");
}

function postreq(request1,token)
{
//BLOCK

    }

    function sleeped(requesarr,token)
    {
    console.log("in sleeping");
    //console.log(requesarr,token)

    setTimeout(function(){
        postreq(requesarr,token);
    },15000);}

    function postreqELSE(request2,token1)
{
console.log("in 3RD function");
   //BLOCK2

    }

Body:
Sure, this question was answered previously here: What is the JavaScript version of sleep()?

Following is an example which will do what you're requesting:

var reques = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}
async function checkLoop()
{
  for (var a = 0; a < 20; a++)
  { console.log("["+a+"] a%5 is: "+a%5);
    console.log ( new Date().toLocaleTimeString());
    if(a%5==0)
    { console.log("if");
    console.log ( new Date().toLocaleTimeString());
    await sleep(15000);
    }
    else
    { console.log("else");
    console.log ( new Date().toLocaleTimeString());

    }
  }
}
checkLoop();

This prints out the following: (partial) Important to note that it will always pause on the first iteration because the index starts at 0, not 1.

[0] a%5 is: 0
8:58:38 AM
if
[1] a%5 is: 1
8:58:53 AM
else
8:58:53 AM
[2] a%5 is: 2
8:58:53 AM
else
8:58:53 AM
[3] a%5 is: 3
8:58:53 AM
else
8:58:53 AM
[4] a%5 is: 4
8:58:53 AM
else
8:58:53 AM
[5] a%5 is: 0
8:58:53 AM
if
8:58:53 AM
[6] a%5 is: 1
8:59:08 AM
else
8:59:08 AM
[7] a%5 is: 2
8:59:08 AM
else
8:59:08 AM

If you can't use async, then try this approach: (interval set at 1.5 secs for easier testing. just change the 1500 to 15000 to = 15 seconds)

var reques = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];
var _interval;
var timeToWait = 1500;
function checkLoop(_init)
{
  clearInterval(_interval);
  console.log("checkLoop entered with value of: ", _init);
  var start = (typeof(_init) == "undefined") ? 0 : _init;
  console.log("start is: "+start);
  for (var a = start; a < 20; a++)
  { console.log("["+a+"] a%5 is: "+a%5);
    console.log ( new Date().toLocaleTimeString());
    if(a%5==0)
    { console.log("if");
    console.log ( new Date().toLocaleTimeString());
    (function(_idx){_interval = setInterval(function(){checkLoop(_idx+1)}, timeToWait);})(a)
    break;
    }
    else
    { console.log("else");
    console.log ( new Date().toLocaleTimeString());

    }
  }
}
checkLoop();


问:
A PHP Error was encountered Severity: Notice Message: Undefined variable: result

A PHP Error was encountered Severity: Notice

Message: Undefined variable: result

Filename: user/messages.php

Line Number: 87

Backtrace:

File: E:\xampp\htdocs\ci\application\views\user\messages.php Line: 87
  Function: _error_handler

File: E:\xampp\htdocs\ci\application\controllers\users\Dashboard.php
  Line: 12 Function: view

File: E:\xampp\htdocs\ci\index.php Line: 315 Function: require_once

here is my code
Controller

```<code>      <?php defined('BASEPATH') OR exit('No direct script access allowed');
        class Bills extends CI_Controller{
       function __construct(){
      parent::__construct();
     }

     public function bill(){
     $id = $this->session->userdata('email');
     $this->load->database();
     $this->load->helper(array('form', 'url', 'html'));
     $this->load->model('fuser/Bill');
     $data['result'] = $this->Bill->bills();
     $this->load->view('user/messages',$data);
      }
      }
      ?>

**Model**

      <?php
     class Bill extends CI_Model
     {
      function __construct()
      {
         // Call the Model constructor
         parent::__construct();
      }
      //we will use the select function
      public function bills($id)
      {
         //data is retrive from this query

     $query = $this->db->get('invoices');
       return $query->result();
      }

      }
     ?>

**View**
      <div class="billing_tabs_text_part">
                <?php foreach($result as $row){?>
                  <p><?php echo $row['book_id']; }?></p>
                </div>
</code>```

答:
don't return  , print and check the result
ex:
var_dump($query->result());</p>

Body:
A PHP Error was encountered Severity: Notice

Message: Undefined variable: result

Filename: user/messages.php

Line Number: 87

Backtrace:

File: E:\xampp\htdocs\ci\application\views\user\messages.php Line: 87
  Function: _error_handler

File: E:\xampp\htdocs\ci\application\controllers\users\Dashboard.php
  Line: 12 Function: view

File: E:\xampp\htdocs\ci\index.php Line: 315 Function: require_once

here is my code
Controller

      <?php defined('BASEPATH') OR exit('No direct script access allowed');
        class Bills extends CI_Controller{
       function __construct(){
      parent::__construct();
     }

     public function bill(){
     $id = $this->session->userdata('email');
     $this->load->database();
     $this->load->helper(array('form', 'url', 'html'));
     $this->load->model('fuser/Bill');
     $data['result'] = $this->Bill->bills();
     $this->load->view('user/messages',$data);
      }
      }
      ?>

**Model**

      <?php
     class Bill extends CI_Model
     {
      function __construct()
      {
         // Call the Model constructor
         parent::__construct();
      }
      //we will use the select function
      public function bills($id)
      {
         //data is retrive from this query

     $query = $this->db->get('invoices');
       return $query->result();
      }

      }
     ?>

**View**

                <?php foreach($result as $row){?>

<?php echo $row['book_id']; }?>