U++: Issueshttps://www.ultimatepp.org/redmine/https://www.ultimatepp.org/redmine/redmine/favicon.ico2015-06-30T16:44:36ZRedmine
Redmine Bug #1165 (Approved): Remove SSE2 flag from Skylark tutorialshttps://www.ultimatepp.org/redmine/issues/11652015-06-30T16:44:36ZZbigniew Rebacz
<p>SSE2 is no longer valid upp flag.</p> Bug #1123 (Approved): Handlers with ** work incorrectlyhttps://www.ultimatepp.org/redmine/issues/11232015-06-16T20:02:45ZJan Dolinárdolik.rce@gmail.com
<p>When the handler path contains "**", the "handler function" in witz treats it as if it was only "*", i.e. uses only one argument.</p>
<p>I attached a modified Skylark03 tutorial demonstrating the flawed cases. See the comments in index.witz.</p>
<p>I also tried to patch it, but I'm not very happy with it. It all seems way to complicated for such a simple problem. Perhaps there is a better solution. If not, the patch should be good enough to fix most of the corner cases which don't work correctly now.</p> Bug #1050 (Approved): Function to access request contenthttps://www.ultimatepp.org/redmine/issues/10502015-05-02T16:27:24ZJan Dolinárdolik.rce@gmail.com
<p>There is currently no way to access the content of request in Skylark. This is wrong, because sometimes, the request body can contain important information. The information is actually read by Http class, but it is not directly accessible to the user. Therefore I suggest to add this one simple method:<br /><pre>
const String& Http::GetContent() const {
return content;
}
</pre></p>
<p><em>My actual usecase:</em> I am trying to write a method that will accept "web hook" initiated from <a href="https://about.gitlab.com" class="external">gitlab</a> instance when someone pushes to the repository. Gitlab can be instructed to send a request to any url, but it is always POST request, where body contains JSON data describing the pushed commits and Content-Type is application/json. So right now, there is no way to get the data, because Skylark only reads content if Content-Type is one of application/x-www-form-urlencoded* or multipart/*.</p> Bug #1044 (Approved): Minor bugs in static files handlinghttps://www.ultimatepp.org/redmine/issues/10442015-04-19T18:34:59ZJan Dolinárdolik.rce@gmail.com
<p>I noticed some inconsistent behavior of the static files, depending on root variable being empty or not. Two simple fixes in the attached patch should solve it for all use cases.</p> Feature #1028 (Approved): Function-like templateshttps://www.ultimatepp.org/redmine/issues/10282015-03-27T21:16:42ZJan Dolinárdolik.rce@gmail.com
<p>Several times lately, I found myself in a situation when I needed to render similar code in witz template multiple times, but with slightly different visuals or content. To do it easily, I wrote myself this little witz function:</p>
<pre>
Value Render(const Vector<Value>& arg, const Renderer *r) {
if (arg.GetCount() < 1)
return "";
// create new Renderer, as we can not modify the one currently used
Renderer rr;
// copy variables so they are avalable in the rendered template too
for(int i = 1; i < r->Variables().GetCount(); i++) {
rr(r->Variables().GetKey(i), r->Variables()[i]);
}
// add arguments as variables
for(int i = 1; i < arg.GetCount(); i++) {
rr("_"+IntStr(i), arg[i]);
}
// render the template passed in first argument
return rr.Render(AsString(arg[0]));
}
INITBLOCK {
Compiler::Register("render", Render);
};
</pre>
<p>The usage is simple, I just have a template which uses $_1, $_2, etc. for the variable arguments and in the main template I call it as a function, e.g. $render("MyApp/mytable.witz", "MyHeader", $CONF.TABLE1_BGCOLOR, $TABLE1_CONTENT).</p>
<p>I know this can probably be done using includes and defines in witz, but this way it feels much more natural and also the syntax is much simpler to write. Also, the function might be simpler and more efficient if implemented directly in Skylark, it might be possible to avoid creating brand new renderer or at least copy the variables more efficiently.</p>
<p>If you think this might be of interest to other people, you can add it to the Skylark/stdlib.icpp. If you think it's stupid idea, just close this issue :)</p> Bug #752 (Approved): Skylark examples should use "<!DOCTYPE HTML>"https://www.ultimatepp.org/redmine/issues/7522014-04-15T21:39:52ZZbigniew Rebacz
<p>My Firefox shows warnings when this markup is not included at the beggining of html document.</p> Feature #747 (Approved): Witz templates should give better errors when includedhttps://www.ultimatepp.org/redmine/issues/7472014-04-14T11:39:00ZMiroslav Fidlercxl@ntllib.org
<p><a class="external" href="http://www.ultimatepp.org/forums/index.php?t=msg&goto=42914&#msg_42914">http://www.ultimatepp.org/forums/index.php?t=msg&goto=42914&#msg_42914</a></p> Feature #523 (Patch ready): Periodic background jobs in skylarkhttps://www.ultimatepp.org/redmine/issues/5232013-09-18T17:49:08ZJan Dolinárdolik.rce@gmail.com
<p>Sometimes it is handy to be able to execute some periodic job inside the server that runs in background, independently from request handling threads. Probably most common example of this would be expiration of temporary data (either on disk or in database). Currently, it is not easy to do such thing in Skylark, as you can only react when a request comes and there is no guarantee when or if a request occurs. Also doing this correctly in thread is troublesome as SkylarkApp::quit is private, so it is not simple to quit the thread when the application is terminated.</p>
<p>So I wrote a patch that adds AddJob(Callback cb, int period=60) function to the public interface of SkylarkApp. This function can be used to add multiple jobs that will be executed with given periodicity (in seconds) in a background thread. The timing is not guaranteed to be precise and is only approximate, as longer job can postpone other jobs. If there are no jobs added, the extra thread is not created.</p>
<p>Example of usage:<br /><pre>
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
}
};
void job1() {
LOG("JOB1 "<<GetSysTime());
}
void job2() {
LOG("JOB2 "<<GetSysTime());
}
CONSOLE_APP_MAIN
{
MyApp()
.AddJob(callback(job1),3)
.AddJob(callback(job2),5)
.Run();
}
</pre></p>
<p>What do you think Mirek, do you mind if I commit it? I'll of course add proper documentation if you say it is ok.</p>
<p>I think this might be even used internally to periodically expire the sessions. I think the way it is done now (on every 1000th request per thread, if I remember correctly), can lead to piling up way too many sessions in database, which in turn caused deadlocks in database on delete statements for me.</p> Feature #493 (New): Skylark Replace '$'https://www.ultimatepp.org/redmine/issues/4932013-07-16T06:59:49ZMiroslav Fidlercxl@ntllib.orgBug #441 (Approved): Http::SetLanguage doesn't workhttps://www.ultimatepp.org/redmine/issues/4412013-02-09T12:56:44ZJan Dolinárdolik.rce@gmail.com
<p>There is a typo in Http::SetLanguage that prevent setting the desired language:</p>
<pre>
--- upp-production/uppsrc/Skylark/Session.cpp (revision 5771)
+++ upp-production/uppsrc/Skylark/Session.cpp (working copy)
@@ -177,7 +177,7 @@
Http& Http::SetLanguage(int lang_)
{
- Renderer::SetLanguage(lang);
+ Renderer::SetLanguage(lang_);
Upp::SetLanguage(lang_);
SessionSet("__lang__", lang);
SessionSet("language", ToLower(LNGAsText(lang)));
</pre> Bug #416 (Approved): ClearSession not working correctlyhttps://www.ultimatepp.org/redmine/issues/4162013-01-10T16:48:16ZJan Dolinárdolik.rce@gmail.com
<p>Session clearing doesn't work correctly, the values of session variables might persist and reapear in next request. To fix, simply add session_dirty=true in Http::ClearSession().</p>
<p><a class="external" href="http://www.ultimatepp.org/forum/index.php?t=rview&goto=38728&th=7200#msg_38728">http://www.ultimatepp.org/forum/index.php?t=rview&goto=38728&th=7200#msg_38728</a></p> Bug #382 (Approved): Incorect parsing of $$ in witzhttps://www.ultimatepp.org/redmine/issues/3822012-12-18T14:46:05ZJan Dolinárdolik.rce@gmail.com
<p><a class="external" href="http://www.ultimatepp.org/forum/index.php?t=msg&goto=38457">http://www.ultimatepp.org/forum/index.php?t=msg&goto=38457</a></p> Bug #380 (Rejected): Skylark Jquery issuehttps://www.ultimatepp.org/redmine/issues/3802012-12-18T11:35:32ZMiroslav Fidlercxl@ntllib.org
<p><a class="external" href="http://www.ultimatepp.org/forum/index.php?t=msg&goto=38453&#msg_38453">http://www.ultimatepp.org/forum/index.php?t=msg&goto=38453&#msg_38453</a></p> Feature #355 (Approved): Improve Skylark error handlinghttps://www.ultimatepp.org/redmine/issues/3552012-11-24T13:59:57ZMiroslav Fidlercxl@ntllib.org
<p><a class="external" href="http://www.ultimatepp.org/forum/index.php?t=msg&th=7079&start=0x%x">http://www.ultimatepp.org/forum/index.php?t=msg&th=7079&start=0x%x</a>%</p>