wakanda database query error when testing in bootstrap.js - wakanda

I created a new project in wakanda studio 1.1.3, then I created a model called Users with one attribute email of string type.
I passed on a query in my bootstrap.js to check if i am getting any value from the database.
The query command is the following
ds.Users.query({select: "email"});
The model is global access
When i run this is my console i am getting an error
"Some error occurred while parsing:
503 - Service Unavailable body { margin: 0px;
padding: 0px; font: 90% "Lucida Grande", Lucida, Verdana, sans-serif;
} div#title { background-color: #2c4b79; padding: 15px 15px 15px 20px;
margin: 0px; } div#message { padding: 20px; } div#details { padding:
10px; } h2 { color: #fff; font-size: 1.3em; margin: 0; padding: 0; } p
{ padding: 0px; margin: 0px; } 503 - Service Unavailable
"
Can anyone help in this issue

Don't use your bootstrap.js file for testing purposes. Create a new file that is not bootstrapped (ex. test.js, serverside.js, ...) and run (Run Button) a valid query (http://doc.wakanda.org/home2.en.html#/Wakanda-Server-Side-Concepts/Programming-in-Wakanda-Server/Queries-and-Finds.300-720609.en.html) in that file. You will then see the output in the output area:
Query Example:
ds.Users.all();
ds.Users.query('ID > 0');
ds.Users.query('ID > :1', 0);
Inside Wakanda studio:

Related

Powershell REST API call issue: how to understand?

VS2019 Rest service console app.
I call my Rest service via Powershell script.
It uses try-catch and during the call I receive the error
Request Error
BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; } #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; } A:link { color: #336699; font-weight: bold; text-decoration: underline; } A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; } A:active { color: #336699; font-weight: bold; text-decoration: underline; } .heading1 { background-color: #003366; border-bottom: #336699 6px solid; color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal;margin: 0em 0em 10px -20px; padding-bottom: 8px; padding-left: 30px;padding-top: 16px;} pre { font-size:small; background-color: #e5e5cc; padding: 5px; font-family: Courier New; margin-top: 0px; border: 1px #f0f0e0 solid; white-space: pre-wrap; white-space: -pre-wrap; word-wrap: break-word; } table { border-collapse: collapse; border-spacing: 0px; font-family: Verdana;} table th { border-right: 2px white solid; border-bottom: 2px white solid; font-weight: bold; background-color: #cecf9c;} table td { border-right: 2px white solid; border-bottom: 2px white solid; background-color: #e5e5cc;}
Request Error
The server encountered an error processing the request. Please see the service help page for constructing valid requests to the service.
I see that no service method call but the error. How to understand the reason?
That is method
[OperationContract]
[WebInvoke(UriTemplate = "/createdbnode", Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json)]
Message CreateDbNode(string name, bool is_enabled, DbNode[] links);
And call, but note: dbnode is not only Guid, it is more complicated class:
$bodyx = #{
"name"="zztop";"links"="[18220000-FA8F-40C5-8014-99044C6B1700]";"is_enabled"="0";
}
$jsonbody = $bodyx | ConvertTo-Json
Write-Host $jsonbody
Write-Host "========================"
Invoke-WebRequest -UseBasicParsing $url2 -Headers $headers -ContentType "application/json" -Method POST -Body $jsonbody

Watch infinite loop on using background

.checkbox-group {
position: relative;
padding-left: 30px;
input[type="checkbox"] {
height: 20px;
width: 20px;
margin: 0;
position: absolute;
opacity: 0;
left: 0;
z-index: 1;
&:checked {
+ .pseudo-checkbox {
background: red;
background: url("../../images/tick.png") no-repeat;
}
}
}
span.pseudo-checkbox {
height: 20px;
width: 20px;
display: inline-block;
border: 1px solid $input-border;
//background-color: #fff;
position: absolute;
left: 0;
}
}
When using sibling selector and background image, sass watch compiler goes into infinite loop (using laravel mix). Her i have included my sass. If I comment the background, the compilation works good.
Make sure to add the image to the original folder before compiling not the after compiling folder, i usually have the same problem but solve it by naming the before compiling img and the compiler will create new one it will name it images,

Creating a fluid row with Foundation 6 scss

What is the proper way to create a fluid row with Foundation 6 and scss? Currently I am doing it by setting $width: none, but I'm not sure if this is correct:
.topBanner {
#include grid-row($width: none);
background-color: $secondary-color;
padding: 5px;
text-align: center;
}
The produced CSS from this is:
.topBanner {
max-width: none;
margin-left: auto;
margin-right: auto;
margin: 0;
list-style-type: none;
background-color: #4990E2;
padding: 5px;
text-align: center;
}

Fancybox and Chrome / Firefox

i got a "little" bug on my website. Here is the code im using:
product.tpl
{else}
href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}"
data-fancybox-group="other-views"
class="fancybox{if $image.id_image == $cover.id_image} shown{/if}"
global.css
.fancybox-skin {
background: #f4f5f7 !important; }
.fancybox-skin .fancybox-close {
width: 28px;
height: 28px;
background: none;
font-size: 28px;
line-height: 28px;
color: #333333;
text-align: center;
background: #f4f5f7!important;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
border-radius: 50px; }
.fancybox-skin .fancybox-close:hover {
color: #515151; }
.fancybox-skin .fancybox-close:after {
content: "\f057";
font-family: "FontAwesome"; }
Here is a Link to a product.
If you enlarge the picture by clicking on it, and hover to one of the sites and than jump to one of the other pictures you can see that the background is moving. In Internet Explorer it is working fine.
Now:
/* 1920x1200 ----------- */
#media only screen
and (min-width : 1681px) {
/* Styles */
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 1.42857;
background: #f4f5f7 url('http://evoxity.net/themes/default-bootstrap/img/background/1920x1200.jpg');
margin: 0 ;
background-repeat: no-repeat scroll;
-moz-background-size:cover;
overflow: auto;
background-position:center 0;
}
}

P2P Video Confrencing using HTML5 or Javascript

I am trying to build video conferencing using html5 and javascript till now i am able to stream my camera capture and display it on canvas
here is the code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<style>
nav .search {
display: none;
}
.demoFrame header,
.demoFrame .footer,
.demoFrame h1,
.demoFrame .p {
display: none !important;
}
h1 {
font-size: 2.6em;
}
h2, h3 {
font-size: 1.7em;
}
.left {
width: 920px !important;
padding-bottom: 40px;
min-height: auto !important;
padding-right: 0;
float: left;
}
div.p {
font-size: .8em;
font-family: arial;
margin-top: -20px;
font-style: italic;
padding: 10px 0;
}
.footer {
padding: 20px;
margin: 20px 0 0 0;
background: #f8f8f8;
font-weight: bold;
font-family: arial;
border-top: 1px solid #ccc;
}
.left > p:first-of-type {
background: #ffd987;
font-style: italic;
padding: 5px 10px;
margin-bottom: 40px;
}
.demoAds {
position: absolute;
top: 0;
right: 0;
width: 270px;
padding: 10px 0 0 10px;
background: #f8f8f8;
}
.demoAds a {
margin: 0 10px 10px 0 !important;
display: inline-block !important;
}
#promoNode {
margin: 20px 0;
}
#media only screen and (max-width : 1024px) {
.left {
float: none;
}
body .one .bsa_it_ad {
position: relative !important;
}
}
</style> <style>
video { border: 1px solid #ccc; display: block; margin: 0 0 20px 0; }
#canvas { margin-top: 20px; border: 1px solid #ccc; display: block; }
</style>
</head>
<body>
<!-- Add the HTML header -->
<div id="page">
<!-- holds content, will be frequently changed -->
<div id="contentHolder">
<!-- start the left section if not the homepage -->
<section class="left">
<!--
Ideally these elements aren't created until it's confirmed that the
client supports video/camera, but for the sake of illustrating the
elements involved, they are created with markup (not JavaScript)
-->
<video id="video" width="640" height="480" autoplay></video>
<button id="snap" class="sexyButton">Snap Photo</button>
<canvas id="canvas" width="640" height="480"></canvas>
<script>
// Put event listeners into place
window.addEventListener("DOMContentLoaded", function() {
// Grab elements, create settings, etc.
var canvas = document.getElementById("canvas"),
context = canvas.getContext("2d"),
video = document.getElementById("video"),
videoObj = { "video": true, "audio" : true },
errBack = function(error) {
console.log("Video capture error: ", error.code);
};
// Put video listeners into place
if(navigator.getUserMedia) { // Standard
navigator.getUserMedia(videoObj, function(stream) {
video.src = stream;
video.play();
}, errBack);
} else if(navigator.webkitGetUserMedia) { // WebKit-prefixed
navigator.webkitGetUserMedia(videoObj, function(stream){
video.src = window.webkitURL.createObjectURL(stream);
video.play();
}, errBack);
}
// Trigger photo take
document.getElementById("snap").addEventListener("click", function() {
context.drawImage(video, 0, 0, 640, 480);
});
}, false);
</script>
</section>
<style>
body .one .bsa_it_ad { background: #f8f8f8; border: none; font-family: inherit; width: 200px; position: absolute; top: 0; right: 0; text-align: center; border-radius: 8px; }
body .one .bsa_it_ad .bsa_it_i { display: block; padding: 0; float: none; margin: 0 0 5px; }
body .one .bsa_it_ad .bsa_it_i img { padding: 10px; border: none; margin: 0 auto; }
body .one .bsa_it_ad .bsa_it_t { padding: 6px 0; }
body .one .bsa_it_ad .bsa_it_d { padding: 0; font-size: 12px; color: #333; }
body .one .bsa_it_p { display: none; }
body #bsap_aplink, body #bsap_aplink:hover { display: block; font-size: 10px; margin: 12px 15px 0; text-align: right; }
</style>
</div>
</body>
</html>
now i just want to stream video to make a conference between two people, i know i have to use webRTC or websocket but i don't know how to start writing code for that.
any help or suggestion would be very helpfull.
HTML5rocks has excellent tutorial on this.
WebRTC tutorial
To summarize below are the steps involved:-
Get streaming audio, video or other data.
Get network information such as IP address and port, and exchange this with other WebRTC clients (known as peers) to enable connection, even through NATs and firewalls.
Coordinate 'signaling' communication to report errors and initiate or close sessions.
Exchange information about media and client capability, such as resolution and codecs.
Communicate streaming audio, video or data. To acquire and communicate streaming data,
WebRTC implements the following APIs.
MediaStream: get access to data streams, such as from the user's camera and microphone. RTCPeerConnection: audio or video calling, with facilities for encryption and bandwidth management. RTCDataChannel: peer-to-peer communication of generic data.
You are obviously only asking for JavaScript here, but if you are a .NET or Mono dev you can install the nuget package XSockets.Sample.WebRTC, that will provide a JavaScript video conference for you... and also read this guide about it http://xsockets.net/blog/tutorial-building-a-multivideo-chat-with-webrtc

Resources