Id int64 34.6M 60.5M | Title stringlengths 15 150 | Body stringlengths 33 36.7k | Tags stringlengths 3 112 | CreationDate stringdate 2016-01-01 00:21:59 2020-02-29 17:55:56 | Y stringclasses 3 values |
|---|---|---|---|---|---|
37,242,908 | VBA EXCEL Populate blank cells in column B on sheet 2 from repeating list on sheet 1 until column B is complete | i decided to make a picture with small example to explain it easier. col D should be populated with names from col A repeating until each ID has a name. i have absolutely no idea how to loop it to make it work. mind boggling. i have been searching google for hours so i am now asking for help. thanks so much.
[![example][1]][1]
[1]: http://i.stack.imgur.com/qU4C9.png | <excel><vba> | 2016-05-15 19:42:49 | LQ_EDIT |
37,243,087 | How to install sshpass on Windows through Cygwin? | <p>In the packages window of CygWin, when I type sshpass, nothing comes up. I tried installing similar packages like openssh etc hoping one of them contains sshpass but no luck.</p>
| <windows><bash><cygwin><sshpass> | 2016-05-15 20:01:40 | HQ |
37,243,412 | Function in Matlab not working correctly | <p>I'm trying to write the following function which computes the sum of the series 1 + x^1 + ... + x^n. I have</p>
<pre><code>function[result] = sumGP(x,n)
if x == 1
result = n+1;
else
result = (x^(n+1) - 1)/(x-1);
end
sumGP(1,4)
</code></pre>
<p>If I want to call this function using 'sumGP(1,4)', the output should be '5'. But Matlab is saying 'undefined function of variable 'x'. </p>
| <matlab> | 2016-05-15 20:34:55 | LQ_CLOSE |
37,243,900 | C++ code to Java, few questions | <p>I got a code but it's C++ which I don't know.
But there are many similarities between C++ and Java in my opinion.
The only things I don't know what they mean / how to write them in Java are these:</p>
<pre><code>u = getNextUglyNumber(twoQ, threeQ, fiveQ, &q); //and what is &q, the &?
twoQ.push(u << 1); //what is << ?
std::cout << u << ' '; //this i dont understand at all
*q = 2; // same as q = 2*q?
if (fiveQ.front() < u) {
u = fiveQ.front(); //whats front?
</code></pre>
<p>Thanks a lot in advance for any kind of help!</p>
<p>Here is also the full code:</p>
<pre><code>typedef std::queue<int> Queue;
int findNthUglyNumber(int n) {
Queue twoQ, threeQ, fiveQ;
twoQ.push(2);
threeQ.push(3);
fiveQ.push(5);
int u, q;
while (n) {
u = getNextUglyNumber(twoQ, threeQ, fiveQ, &q);
switch (q) {
case 2:
twoQ.push(u << 1); /// u * 2
case 3:
threeQ.push(u << 2 - u); /// u * 3
case 5:
fiveQ.push(u << 2 + u); /// u * 5
}
n--;
std::cout << u << ' ';
}
return u;
}
int getNextUglyNumber(Queue &twoQ, Queue &threeQ, Queue &fiveQ, int &q) {
int u = twoQ.front();
*q = 2;
if (threeQ.front() < u) {
u = threeQ.front();
*q = 3;
}
if (fiveQ.front() < u) {
u = fiveQ.front();
*q = 5;
}
switch (*q) {
case 2:
twoQ.pop();
break;
case 3:
threeQ.pop();
break;
case 5:
fiveQ.pop();
break;
}
return u;
}
</code></pre>
| <java><c++> | 2016-05-15 21:34:39 | LQ_CLOSE |
37,244,399 | MySQL database Links to HTML Table | <p>I am trying to learn more about html, php, and mysql. I am trying to retrieve a link from the database that is just stored as a varchar, then display it in a table.</p>
<p>Each entry will have a different link, they are all linked to external website and I couldn't figure this out.
Here is my current code.</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><?php
include("connection.php");
$sql = "SELECT Username, Location, Points FROM database ORDER BY Points DESC";
$result1 = mysqli_query($db_con, $sql);
while($row1 = mysqli_fetch_array($result1)):;?>
<tr>
<td><a href="'.$row['Location'].'"><?php echo $row1[0]; ?></a></td>
<td><?php echo $row1[1]; ?></td>
<td><?php echo $row1[2]; ?></td>
</tr>
<?php endwhile; ?>
<?php</code></pre>
</div>
</div>
</p>
<p>The Location is where the links are stored, as you can tell I had a fairly sad attempt as I don't know mysql, php to well.</p>
<p>Thanks for your time!</p>
| <php><html><mysql> | 2016-05-15 22:34:58 | LQ_CLOSE |
37,244,459 | Errors in my PL/SQL code for Cursor (Need HELP Please) | Declare
vStudent_id grade.student_id%TYPE;
vSection_id grade.section_id%TYPE;
vNumeric_grade grade.numeric_grade%TYPE;
CURSOR gradeCursor IS
SELECT student_id,section_id,numeric_grade
FROM grade
WHERE student_id = 102
ORDER by numeric_grade;
Begin
Open gradeCursor;
LOOP
FETCH gradeCursor
INTO vStudent_id,vSection_id,vNumeric_grade;
EXIT WHEN gradeCursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Student number: ' || vStudent_id );
DBMS_OUTPUT.PUT_LINE('Section_id: ' || vSection_id );
IF numeric_grade IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('Numeric Grade: ' || vNumeric_grade );
ELSE
DBMS_OUTPUT.PUT_LINE('Numeric Grade: NULL' );
END IF;
END LOOP;
IF gradeCursor%ISOPEN THEN CLOSE gradeCursor; END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error dected' );
IF gradeCursor%ISOPEN THEN CLOSE gradeCursor; END IF;
END; | <sql><oracle><plsql><rdbms><cursors> | 2016-05-15 22:40:58 | LQ_EDIT |
37,244,890 | How to write an SQL query to update a table based of a result in another table | I have 2 different tables in my datbase and cant find any refrence on how to use a reuslt to update a part of a table.
Here is my scenario
Table: MenuItems
โโโโโโฆโโโโโโโโโโโโโโโฆ
โ id โ Name โ
โ โโโโโฌโโโโโโโโโโโโโโโฌ
โ 1 โ test โ
โ 2 โ test2 โ
โโโโโโฉโโโโโโโโโโโโโโโฉ
Table: MenuItemPrices
โโโโโโฆโโโโโโโโโโโโโโโฆ
โ id โ Price โ
โ โโโโโฌโโโโโโโโโโโโโโโฌ
โ 1 โ 3.50 โ
โ 2 โ 4.50 โ
โโโโโโฉโโโโโโโโโโโโโโโฉ
Say I want to update test2 price to 5.00, what would be the query I need? | <sql-server> | 2016-05-15 23:51:05 | LQ_EDIT |
37,245,006 | If and else statement in PHP inside of an echo | <p>I want to give the admin the ability to activate the user account so I have to status active and inactive
When I run my code I get 4 status
Active
Inactive
Active
Inactive
You will find here a screenshot to understand the problem Iโm facing </p>
<p><a href="http://i.imgur.com/2c0VcN7.png" rel="nofollow">http://i.imgur.com/2c0VcN7.png</a></p>
<pre><code> if(isset($_GET['id_user'])){
include("conexion.php");
$rep=$db->query("select * from user WHERE id_user=" .$_GET['id_user'] );
while($l=$rep->fetch()){
echo "
<form class= mainSettingsForm add method='POST'>
<label>Numero utlisateur :</label>
<input disabled='disabled' type='text' name='ref' value=' ".$l[0]." ' ></input>
<input name='id_user2' type='hidden' value='".$l[0]."' ></input>
<label>Nom utlisateur : </label>
<input type='text' name='username2' value='".$l[1]."' >
<label> nom : </label>
<input type='text' name='nom2' value='".$l[3]."' >
<label> prenom : </label>
<input type='text' name='prenom2' value='".$l[4]."' >
<label> Statut : </label>
<select name=statut >
if ($l[6] ==active) {
echo '
<option value=active >active</option>
<option value=inactive >inactive</option> }'
else {
echo '
<option value=inactive >inactive</option>
<option value=active >active</option> }'
</select>
<input class=btn-primary type='submit' name='enregistrer' value='enregistrer' >
</form>"; // fin echo
}
}
?>
</code></pre>
| <php><html> | 2016-05-16 00:09:28 | LQ_CLOSE |
37,245,194 | I cannot type "@" in a text input after i updated Flash proffesional CC to Animate CC | I cannot type "@" or any other type of special signs into a text input after i updated my flash proffesional. | <actionscript-3><flash><textinput> | 2016-05-16 00:39:21 | LQ_EDIT |
37,245,258 | How to shuffle imageIcons in an array? | <p>I am trying to code a memory matching game - the standard type of concentration game where the player is shown picture cards, they're flipped over, and they have to match the corresponding cards.</p>
<p>There's a few things that have me completely at a loss as to where I should even begin, and I would really appreciate it if I could get some advice. I'm not sure how I would shuffle the images in an array of Buttons each time I restarted the game. I considered making an integer matrix and shuffling the numbers and images separately, but 1) I'm not sure how to shuffle ImageIcons on a button, and 2) the 2 numbers that are supposed to match up would have different images.</p>
<p>I also considered making a String array to shuffle the filenames of the ImageIcons, but I think that would require reassigning each individual image icon (there are 48 cards and 24 pairs so that would take up a lot of time). Could I get some ideas on how to approach this problem? Is there an easier/more efficient solution than the ones I've thought up? I know there's a Fisher-Yates shuffle algorithm used for cards but I can't quite understand it. </p>
| <java><shuffle> | 2016-05-16 00:51:47 | LQ_CLOSE |
37,245,303 | What does UserA committed with UserB 13 days ago on github mean? | <p>I am interested in knowing which one of the two users made the file changes when github lists both. The git record contains only UserA however.</p>
| <git><github> | 2016-05-16 00:59:26 | HQ |
37,245,416 | segmentation fault(core dumped) while declaring vectors in c++ | I have been trying to use vectors but whenever i declare them globally , I get a segmentation fault(core dumped ) error. But when I specify a size on the vector I declared the error no longer occurs. If dynamic allocation occurs in vector then why is there a need of giving a size and what is this error? Someone please kindly explain | <c++><vector><stl> | 2016-05-16 01:17:01 | LQ_EDIT |
37,245,500 | I can run my PHP program and I received several errors.. Please see my attached images | [This is the warning I got][1]
[My logintest php code][2]
[][3]
[1]: http://i.stack.imgur.com/XDM3e.png
[2]: http://i.stack.imgur.com/m8Fqd.png
database name = portfolio
table name = admin | <php><mysql><html><web><phpmyadmin> | 2016-05-16 01:29:32 | LQ_EDIT |
37,245,739 | I don't understand the purpose of for in loops | <p>I've been working my way through the Javascript development track on Treehouse and am struggling with for in loops. I have been unable to locate any explanation of this loop in everyday language and am subsequently getting confused. What does for in actually do, and why would you use this loop as oppose to another loop? Is it basically just a way to assign a common label to each individual property of an object?</p>
| <javascript><loops><for-in-loop> | 2016-05-16 02:10:01 | LQ_CLOSE |
37,245,794 | How to get selected item from spinner in android | <p>In android I used a spinner to select an item from a list of items. Now I have to use that selected item in java. How can I do that? </p>
| <android><spinner> | 2016-05-16 02:16:58 | LQ_CLOSE |
37,245,920 | How to get width of an element in react native? | <p>How get width of an element in react native such as View ?
As there is not percent usage for width in react native, how to get width of an element or parent element?</p>
| <react-native> | 2016-05-16 02:35:12 | HQ |
37,246,384 | Swift - Remove Optional() from string | I am trying to assign a string to a label like so:
self.MsgBlock4.text = "\(wsQAshowTagArray![0]["MsgBlock4"]!)"
but it display the label like so `Optional(James)` how do I remove the Optional() ?
The Dictionary inside the array comes from here:
self.wsQAshowTag(Int(barcode)!, completion: { wsQAshowTagArray in
}) | <swift> | 2016-05-16 03:42:34 | LQ_EDIT |
37,246,991 | Insert image into row within column in mysql table rather than as an individual column? | I am incredibly new to PHP and mySql but am trying to learn for a project. Right now I have followed this tutorial http://www.formget.com/ajax-image-upload-php/ to be able to upload images as columns in a blob table in a mysql database with rows such as image size, id, etc.
I have a separate data table where I create columns for individual user accounts (each account has a row for username, password, etc). I have created a row in these columns to store a blob.
I do not need all the rows that the tutorial created for their images (image_type, size, etc) but really just need the image source (the image row). I need to insert this image into the ROW for images in my accounts column (depending on which account is signed in), NOT have new columns be created for each image. I do not know how to go about this with the code I have. Here my javascript for my HTML forms:
$(document).ready(function (e) {
//To transfer clicks to divs
$(".upload-button").on('click', function() {
$("#file").click();
});
$(".save").on('click', function() {
$(".submit").click();
});
$("#uploadimage").on('submit',(function(e) {
e.preventDefault();
$.ajax({
url: "upload.php", // Url to which the request is send
type: "POST", // Type of request to be send, called as method
data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
contentType: false, // The content type used when sending data to the server.
cache: false, // To unable request pages to be cached
processData:false, // To send DOMDocument or non processed data file it is set to false
success: function(data) // A function to be called if request succeeds
{
}
});
}));
// Function to preview image after validation
$(function() {
$("#file").change(function() {
// To remove the previous error message
var file = this.files[0];
var imagefile = file.type;
var match= ["image/jpeg","image/png","image/jpg"];
if(!((imagefile==match[0]) || (imagefile==match[1]) || (imagefile==match[2])))
{
$('.userimg').attr('src','noimage.png');
return false;
}
else
{
var reader = new FileReader();
reader.onload = imageIsLoaded;
reader.readAsDataURL(this.files[0]);
}
});
});
function imageIsLoaded(e) {
$("#file").css("color","green");
$('#image_preview').css("display", "block");
$('.userimg').attr('src', e.target.result);
$('.userimg').attr('width', '250px');
$('.userimg').attr('height', '230px');
};
});
Which then references upload.php, which is where changes need to be made:
<?php
if(isset($_FILES["file"]["type"]))
{
$validextensions = array("jpeg", "jpg", "png");
$maxsize = 99999999;
$temporary = explode(".", $_FILES["file"]["name"]);
$file_extension = end($temporary);
if ((($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/jpeg")
) && ($_FILES["file"]["size"] < $maxsize)//Approx. 100kb files can be uploaded.
&& in_array($file_extension, $validextensions)) {
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br/><br/>";
}
else
{
if (file_exists("images/" . $_FILES["file"]["name"])) {
echo $_FILES["file"]["name"] . " <span id='invalid'><b>already exists.</b></span> ";
}
else
{
$sourcePath = $_FILES['file']['tmp_name']; // Storing source path of the file in a variable
$targetPath = "images/".$_FILES['file']['name']; // Target path where file is to be stored
$size = getimagesize($_FILES['file']['tmp_name']);
/*** assign our variables ***/
$type = $size['mime'];
$imgfp = fopen($_FILES['file']['tmp_name'], 'rb');
$size = $size[3];
$name = $_FILES['file']['name'];
/*** check the file is less than the maximum file size ***/
if($_FILES['file']['size'] < $maxsize )
{
/*** connect to db ***/
$dbh = new PDO("mysql:host=localhost;dbname=sqlserver", 'username', 'password');
/*** set the error mode ***/
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
/*** our sql query ***/
$stmt = $dbh->prepare("INSERT INTO imageblob (image_type ,image, image_size, image_name) VALUES (? ,?, ?, ?)");
/*** bind the params ***/
$stmt->bindParam(1, $type);
$stmt->bindParam(2, $imgfp, PDO::PARAM_LOB);
$stmt->bindParam(3, $size);
$stmt->bindParam(4, $name);
/*** execute the query ***/
$stmt->execute();
$lastid = $dbh->lastInsertId();
//Move uploaded File
move_uploaded_file($sourcePath,$targetPath) ; // Moving Uploaded file
if(isset($lastid))
{
/*** assign the image id ***/
$image_id = $lastid;
try {
/*** connect to the database ***/
/*** set the PDO error mode to exception ***/
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
/*** The sql statement ***/
$sql = "SELECT image, image_type FROM imageblob WHERE image_id=$image_id";
/*** prepare the sql ***/
$stmt = $dbh->prepare($sql);
/*** exceute the query ***/
$stmt->execute();
/*** set the fetch mode to associative array ***/
$stmt->setFetchMode(PDO::FETCH_ASSOC);
/*** set the header for the image ***/
$array = $stmt->fetch();
/*** check we have a single image and type ***/
if(sizeof($array) == 2)
{
//To Display Image File from Database
echo '<img src="data:image/jpeg;base64,'.base64_encode( $array['image'] ).'"/>';
}
else
{
throw new Exception("Out of bounds Error");
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
catch(Exception $e)
{
echo $e->getMessage();
}
}
else
{
echo 'Please input correct Image ID';
}
}
else
{
/*** throw an exception is image is not of type ***/
throw new Exception("File Size Error");
}
}
}
}
else
{
echo "<span id='invalid'>***Invalid file Size or Type***<span>";
}
}
?>
I have tried trying to cut out references to image size, type, etc as I feel these are unnecessary, however this created errors. I have poured over other SO posts but can't understand how to simply insert an image into a row within an EXISTING column in mysql data base. On a deadline here and can only create new columns for images.
How can I accomplish this? | <php><mysql><image><blob> | 2016-05-16 05:02:27 | LQ_EDIT |
37,247,474 | ES6 in JShint - .jshintrc has esversion, but still getting warning (using atom) | <p>I am using atom, and I've tried several different jshint packages and they all give a warning which says </p>
<pre><code>"template literal syntax' is only available in ES6 (use 'esversion: 6')"
</code></pre>
<p>I created a top level .jshintrc file (at root), and added the following json:</p>
<pre><code>{
"esversion":6
}
</code></pre>
<p>However, it is still throwing the same error. Any ideas how to resolve. I've included the link to the <a href="http://jshint.com/docs/options/" rel="noreferrer">JSHint options</a> page. I'd like to start playing around with ES6 syntax, but would prefer not to have extra warnings.</p>
<p>Thanks SO community!</p>
| <javascript><ecmascript-6><jshint><atom-editor> | 2016-05-16 05:51:59 | HQ |
37,248,596 | Spec Flow Test Cases Getting Called Twice | <p>We have written test case using Spec Flow,but when we run them,the test will get called twice?</p>
<p>Any idea,what might be the cause?</p>
<p>Any help appreciated.</p>
<p>Thanks,</p>
| <c#><specflow> | 2016-05-16 07:15:34 | LQ_CLOSE |
37,248,720 | Rounding numbers to a specific value in Python | <p>I would like to do in python rounding to the specified value. Rounded to a tip or .99, 9.99 or other value. The value can by dynamic.
Example:</p>
<p>Rounded to .99</p>
<pre><code>20.11 => 20.99
11.33 = 11.99
1.00 = 1.99
</code></pre>
<p>Rounded to 9.99</p>
<pre><code>100 => 109.99
293.33 => 299.99
</code></pre>
<p>Rounded to 0.33</p>
<pre><code>1 => 1.33
34.44 => 35.33
</code></pre>
<p>How do that?</p>
| <python><decimal><rounding> | 2016-05-16 07:22:31 | LQ_CLOSE |
37,248,803 | Uplload video on twiter in java | Hi i am trting to upload a video on twitter i am using following code
private UploadedMedia uploadMediaChunkedInit(long size) throws TwitterException {
return new UploadedMedia(post(
conf.getUploadBaseURL() + "media/upload.json",
new HttpParameter[] { new HttpParameter("command", CHUNKED_INIT),
new HttpParameter("media_type", "video/mp4"), new HttpParameter("total_bytes", size) }) .asJSONObject());
}
Where i am geting following error: Method post is not defined
i got code from here.
[https://github.com/yusuke/twitter4j/pull/226/commits/73b43c1ae4511d3712118f61f983bcbca4ef0c59][1]
if any one can help me plz
Thanks | <java><twitter4j> | 2016-05-16 07:29:03 | LQ_EDIT |
37,249,437 | Why it throws null pointer exception when object is initialized to null and then trying to access class method? | <pre><code>public class Abc
{
public static void main(String args[])
{
def obj=null;
obj.method();
}
}
class Def
{
void method()
{
System.out.println("class def->>> method()");
}
}
</code></pre>
<p>The output of this code is generating a NullPointerException and why?</p>
| <java> | 2016-05-16 08:14:14 | LQ_CLOSE |
37,249,631 | Uninstalling Gulp globally (but not locally) | <p>New to Gulp, somehow I installed different versions of Gulp globally and locally, triggering version mismatch warning messages. Is it possible for me to uninstall Gulp globally without affecting local installs?</p>
| <gulp> | 2016-05-16 08:27:38 | HQ |
37,249,777 | How do I read and print the first 5 integers from a .txt file in C? | <p>I'm trying to read and print the first five integers from a .txt file in C.
I have a few files with lists of varying integers that I need to be able to read, using command line arguments.</p>
<p>For example, if I type</p>
<pre><code>./firstFive 50to100.txt
</code></pre>
<p>[File 50to100.txt contains integers 50-100 separated by a new line]</p>
<p>So the program should print - </p>
<pre><code>50
51
52
53
54
</code></pre>
<p>As there are a few different files to read (all containing integers), I'm using "fp" as a catch all to open a file specified from argv[1].</p>
<p>Here is what I have so far - </p>
<pre><code>#include <stdio.h>
int main(int argc, char *argv[]) {
FILE *fp;
int num;
int i;
if (argc < 2) {
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
return 1;
}
fp = fopen(argv[1], "r");
if (fp == NULL) {
fprintf(stderr, "%s: unable to open file %s,\n", argv[0], argv[1]);
return 1;
}
while (fscanf(fp, "%d", &num) == 1) {
for(i=0; i<5; i++) {
printf("%c/n", num[i]);
}
}
fclose(fp);
return 0;
}
</code></pre>
<p>At the moment it won't even compile. Any idea on what's going wrong?</p>
| <c><pointers><arguments><fopen><scanf> | 2016-05-16 08:37:02 | LQ_CLOSE |
37,251,016 | Why facebook like button(use iframe) not showing when url is a fan page's post, thanks a lot~ | may I ask why when facebook like button href is a fan page, it's working perfectly.
[enter image description here][1]
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FOscarPet.tw%2F%3Ffref%3Dts&width=450&layout=standard&action=like&show_faces=false&share=true&height=35&appId=PleaseChange2ARealAppId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
[1]: http://i.stack.imgur.com/aMLRH.png
But when href change to a fan page's "post", the like button not showing any more.
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FOscarPet.tw%2Fposts%2F1076964629016757&width=0&layout=standard&action=like&show_faces=false&share=true&height=35&appId=PleaseChange2ARealAppId" width="450" height="35" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
Thanks a lot~ :D | <facebook><facebook-like> | 2016-05-16 09:48:17 | LQ_EDIT |
37,251,043 | AutoMapper throwing StackOverflowException when calling ProjectTo<T>() on IQueryable | <p>I have created classes using EF Code First that have collections of each other.
Entities:</p>
<pre><code>public class Field
{
public int Id { get; set; }
public string Name { get; set; }
public virtual List<AppUser> Teachers { get; set; }
public Field()
{
Teachers = new List<AppUser>();
}
}
public class AppUser
{
public int Id { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string UserName => Email;
public virtual List<Field> Fields { get; set; }
public AppUser()
{
Fields = new List<FieldDTO>();
}
}
</code></pre>
<p>DTOs:</p>
<pre><code>public class FieldDTO
{
public int Id { get; set; }
public string Name { get; set; }
public List<AppUserDTO> Teachers { get; set; }
public FieldDTO()
{
Teachers = new List<AppUserDTO>();
}
}
public class AppUserDTO
{
public int Id { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string UserName => Email;
public List<FieldDTO> Fields { get; set; }
public AppUserDTO()
{
Fields = new List<FieldDTO>();
}
}
</code></pre>
<p>Mappings:</p>
<pre><code>Mapper.CreateMap<Field, FieldDTO>();
Mapper.CreateMap<FieldDTO, Field>();
Mapper.CreateMap<AppUserDTO, AppUser>();
Mapper.CreateMap<AppUser, AppUserDTO>();
</code></pre>
<p>And I am getting StackOverflowException when calling this code (Context is my dbContext):</p>
<pre><code>protected override IQueryable<FieldDTO> GetQueryable()
{
IQueryable<Field> query = Context.Fields;
return query.ProjectTo<FieldDTO>();//exception thrown here
}
</code></pre>
<p>I guess this happens because it loops in Lists calling each other endlessly. But I do not understand why this happens. Are my mappings wrong?</p>
| <c#><entity-framework><ef-code-first><automapper><stack-overflow> | 2016-05-16 09:49:44 | HQ |
37,251,322 | Create model in a custom path in laravel | <p>I want to create a model in a custom path. If i write the php artisan command like the following it will create model inside app.</p>
<pre><code>php artisan make:model core
</code></pre>
<p>But i want to create the model file inside the custom made Models folder. How can i do it ?</p>
| <php><laravel> | 2016-05-16 10:05:10 | HQ |
37,251,347 | Laravel/PHPUnit: Assert json element exists without defining the value | <p>I'm sending a post request in a test case, and I want to assert that a specific element, let's say with key 'x' exists in the response. In this case, I can't say <code>seeJson(['x' => whatever]);</code> because the value is unknown to me. and for sure, I can't do it with <code>seeJson(['x']);</code>. </p>
<p>Is there a way to solve this?</p>
<p>If it matters:
Laravel: v5.2.31
PHPUnit: 5.3.4</p>
| <json><laravel><phpunit><laravel-5.2> | 2016-05-16 10:06:27 | HQ |
37,251,572 | trying to find blank columns in csv file with python |
import csv
f = open('E:\pythontest\ip_data.csv')
csv_f = csv.reader(f)
for row in csv_f:
row_count = sum(1 for row in csv_f) + 1
print row_count
now i m trying to find columns have spaces and count them ,can anyone please guide me though this | <python><python-2.7> | 2016-05-16 10:19:41 | LQ_EDIT |
37,252,146 | Angular 2 redirect on click | <p>How to create simple redirect on click on some button in Angular 2? Already tried:</p>
<pre><code>import {Component, OnInit} from 'angular2/core';
import {Router, ROUTER_PROVIDERS} from 'angular2/router'
@Component({
selector: 'loginForm',
templateUrl: 'login.html',
providers: [ROUTER_PROVIDERS]
})
export class LoginComponent implements OnInit {
constructor(private router: Router) { }
ngOnInit() {
this.router.navigate(['./SomewhereElse']);
}
}
</code></pre>
| <javascript><redirect><angular> | 2016-05-16 10:50:29 | HQ |
37,252,249 | Ruby gem, color codes and string interpolation | I am trying to create a Ruby gem to colorize text. I am having hard time with string interpolation and color codes.
Say I want blue text
puts "\e[34mThis is blue text.\e[0m"
That's the way I get it.
I am using the "define_method" metaprogramming technique to create multiple methods(one for every color). The methods are created just fine, but I keep the color code for each color in an array. I iterate over both the color array and the color code one, and I do this
puts "\e#{code}m[#{self}\e[0m"
When I run it I get
"m[test" instead of the colorized text.
Any thoughts? If instead of #{code} I put the actual code, it works just fine, but that'd be like 20 ifs, one for each color and it won't be DRY.
Thank you. | <ruby><console-application> | 2016-05-16 10:55:48 | LQ_EDIT |
37,252,468 | Arrays.stream(array) vs Arrays.asList(array).stream() | <p>In <a href="https://stackoverflow.com/questions/27391028/arrays-aslist-vs-arrays-stream-to-use-foreach">this</a> question it has already been answered that both expressions are equal, but in this case they produce different results. For a given <code>int[] scores</code>, why does this work:</p>
<pre><code>Arrays.stream(scores)
.forEach(System.out::println);
</code></pre>
<p>...but this does not:</p>
<pre><code>Arrays.asList(scores).stream()
.forEach(System.out::println);
</code></pre>
<p>As far as I know <code>.stream()</code> can be called on any Collection, which Lists definitely are. The second code snippet just returns a stream containing the array as a whole instead of the elements.</p>
| <java><arrays><foreach><java-8><java-stream> | 2016-05-16 11:07:52 | HQ |
37,252,567 | How to return a Boolean from @ReactMethod in React Native? | <p>I want to return a Boolean from @ReactMethod in reactNative Android application.</p>
<p>But when I make method similar to </p>
<pre><code>@ReactMethod
public boolean retBoolean() {
return true;
}
</code></pre>
<p>and call it from JS component ,it returns undefined.
only when return type is void function gets called ,I am not able to return string or boolean.</p>
| <android><react-native> | 2016-05-16 11:13:17 | HQ |
37,252,742 | can i scan objects like fruits, vegetables, non vegetables and flowers with camera in android? | <blockquote>
<p>I want to make an android app to check the freshness of fruits,vegetables, non vegetables and flowers. I want to scan all these with camera and provide details to user after scanning. Can anyone please give me suggestion about it. I will be really thankful.</p>
</blockquote>
| <android> | 2016-05-16 11:22:48 | LQ_CLOSE |
37,253,085 | c++ loop its not end the program wont end | can u tell whats the mistake t runs ok but program wont end i a m new to programming please i need help i have posted the code any one v=can check and help me please and am using dev c++ for this and i dont know why its doing like this uuuuurgghhhhhh
#include <iostream>
using namespace std;
main(){
char num;
again:
int usr;
float area;
cout <<"\nEnter 1 to calculate area of rectangle\n";
cout <<"Enter 2 to calculate area of trapezoid\n";
cout <<"\nEnter your choice: ";
cin >> usr;
if(usr==1)
{
double width, length;
cout <<"Enter the width of rectangle: ";
cin >> width;
cout <<"Enter the length of rectangle: ";
cin >> length;
area=length*width;
cout <<"The area of rectangle is: "<< area;
}
if (usr==2)
{
double base1, base2, height;
cout <<"Enter the base 1 of trapezoid: ";
cin >> base1;
cout <<"Enter the base 2 of trapezoid: ";
cin >> base2;
cout <<"Enter the height of trapezoid: ";
cin >> height;
area= (((base1 + base2) /2)*height);
cout <<"The area of trapezoid is: "<< area;
}
cout <<"\n\ndo you want to do another calculation?";
cin >> num;{
goto again;
}
if (num=='y')
{
goto again;
}
if(num=='n'){
exit (0);}
} | <c++><loops> | 2016-05-16 11:40:47 | LQ_EDIT |
37,253,606 | react bootstrap readonly input within formcontrol | <p>I am using react bootstrap and this framework provides some nice FormControls.</p>
<p>But I would like to make the Input field that is generated within the FormControls to have a prop of readonly="readonly". This way, this field looks the same as my other FormControls, but does not give a keyboard input on IOS. </p>
<p>In my case, the input will be provided by a calendar picker which will be triggered by an popover.</p>
<p>Does anyone know how to give FormControl the parameter readonly="readonly", so that the generated Input field in the browser will have the prop readonly="readonly"?</p>
<p>Many thnx for the answers!</p>
| <reactjs><react-bootstrap><form-control><readonly-attribute> | 2016-05-16 12:09:25 | HQ |
37,254,035 | I am trying to make a app which will display my location in app with marker | I am new in android and created a predefined Map project from android studio.
This is my code..
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.getMyLocation();
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}
I want that instead of sydney my current location to be displayed with that red marker.
Please be bit easy as i am completely new.
Thanks | <android><android-studio><maps> | 2016-05-16 12:33:17 | LQ_EDIT |
37,254,045 | How to change Edit/Done button title in UINavigationBar in Swift | <p>I'm displaying an editButtonItem in my tableview but I need to change the text of Edit and Done to Change and Cancel. All the examples I've found so far are in Objective-C... I need Swift syntax.</p>
<p>I have the following in viewDidLoad function...</p>
<pre><code>self.navigationItem.leftBarButtonItem = self.editButtonItem()
</code></pre>
<p>... which displays the standard Edit/Done button item.</p>
| <ios><swift> | 2016-05-16 12:33:32 | HQ |
37,254,954 | Unreachable code in the Eclipse editer | I have a problem with this code, it says "Unreachable code".
It says that the "EntityLivingBase entity = (EntityLivingBase) theObject;" is a unreachable code.
Please Help Me!
Here's my project:
@Override
public void onRender() {
if (!this.isToggled())
return;
for(Object theObject : mc.theWorld.loadedEntityList) {
if(!(theObject instanceof EntityLivingBase)) {
continue;
EntityLivingBase entity = (EntityLivingBase) theObject;
if(entity instanceof EntityPlayer) {
if(entity != mc.thePlayer)
player(entity);
continue;
}
if (entity instanceof EntityMob) {
mob(entity);
continue;
}
if (entity instanceof EntityAnimal) {
animal(entity);
continue;
}
passive(entity);
}
}
super.onRender();
}
If you could help me, I would be very happy! | <javascript><java><eclipse> | 2016-05-16 13:20:24 | LQ_EDIT |
37,255,315 | Can't Load URL: The domain of this URL isn't included in the app's domains | <p>I'm trying to get access token from user</p>
<pre><code>string response_script = "<script>top.location.href='https://www.facebook.com/v2.4/dialog/oauth?response_type=token&client_id=[APPLICATION ID]&redirect_uri=https://www.facebook.com/[APPLICATION URL]/?sk=app_[PAGE ID]&scope='; </script>";
</code></pre>
<p>But I'm getting an error:</p>
<blockquote>
<p>Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.</p>
</blockquote>
<p>That code works well. So I think that needs to add my url to</p>
<blockquote>
<p>Valid OAuth redirect URIs</p>
</blockquote>
<p><strong>But</strong> It doesn't exists in advanced section anymore. facebook changed it's design and now it looks like <a href="http://i.imgur.com/lv7SCmz.png">this. It's too big image and because I have it in out of stackoverflow</a></p>
<p>What can I do?</p>
| <javascript><facebook><facebook-access-token><tabpage> | 2016-05-16 13:38:32 | HQ |
37,255,731 | Clean up "Replica Sets" when updating deployments? | <p>Every time a deployment gets updated, a new replica set is added to a long list. Should the old rs be cleaned?</p>
| <kubernetes> | 2016-05-16 13:58:43 | HQ |
37,256,335 | Iframe not loading in IE after installing update KB3154070 | <p>We have an application that mostly deals with iframes (loads the different pages within the application on demand)</p>
<p>Recently, the IE browser got updated with <a href="https://support.microsoft.com/en-gb/kb/3154070">KB3154070</a>(Current IE Version: 11.0.9600.18314) as part of the system updates. After that update, majority of the functionality is breaking completely. It effected all the pages that use iframes. The content is not loading and resulting in a blank page. The request appears to be aborted when inspected in the network panel as shown in the below screen capture.
<a href="http://i.stack.imgur.com/uKfgp.png">Network Traffic Capture</a></p>
<p>We have performed the following troubleshooting</p>
<p>We made sure that all iframe tags are close properly.
The src of the iframe is not empty.
If we access the same page outside (without loading into iframe), it works fine. But, the problem is with only within iframe.
As a quick workaround to this problem, we have asked our users to roll back the update. But, this is not the expected solution.</p>
<p>Your help is really appreciated.</p>
<p>Regards,
Swajay.</p>
| <asp.net><internet-explorer><iframe> | 2016-05-16 14:28:27 | HQ |
37,257,034 | Chart.js 2.0 doughnut tooltip percentages | <p>I have worked with chart.js 1.0 and had my doughnut chart tooltips displaying percentages based on data divided by dataset, but I'm unable to replicate this with chart 2.0.</p>
<p>I have searched high and low and have not found a working solution. I know that it will go under options but everything I've tried has made the pie dysfunctional at best.</p>
<pre><code><html>
<head>
<title>Doughnut Chart</title>
<script src="../dist/Chart.bundle.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<style>
canvas {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div id="canvas-holder" style="width:75%">
<canvas id="chart-area" />
</div>
<script>
var randomScalingFactor = function() {
return Math.round(Math.random() * 100);
};
var randomColorFactor = function() {
return Math.round(Math.random() * 255);
};
var randomColor = function(opacity) {
return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
};
var config = {
type: 'doughnut',
data: {
datasets: [{
data: [
486.5,
501.5,
139.3,
162,
263.7,
],
backgroundColor: [
"#F7464A",
"#46BFBD",
"#FDB45C",
"#949FB1",
"#4D5360",
],
label: 'Expenditures'
}],
labels: [
"Hospitals: $486.5 billion",
"Physicians & Professional Services: $501.5 billion",
"Long Term Care: $139.3 billion",
"Prescription Drugs: $162 billion",
"Other Expenditures: $263.7 billion"
]
},
options: {
responsive: true,
legend: {
position: 'bottom',
},
title: {
display: false,
text: 'Chart.js Doughnut Chart'
},
animation: {
animateScale: true,
animateRotate: true
}
}
};
window.onload = function() {
var ctx = document.getElementById("chart-area").getContext("2d");
window.myDoughnut = new Chart(ctx, config);{
}
};
</script>
</body>
</html>
</code></pre>
| <javascript><chart.js><chart.js2> | 2016-05-16 15:01:08 | HQ |
37,257,534 | R are not identified | <p>I creating a map project.
Main Activity =</p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainlayout);
if (googleHarita == null) {
googleHarita = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.haritafragment))
.getMap();
</code></pre>
<p>R says "cannot resolve symbol <em>R</em>".
What can I do?</p>
| <android> | 2016-05-16 15:25:47 | LQ_CLOSE |
37,257,688 | RaiseEvent on C sharp | <p>I know there is a lot of information about RaiseEvents on internet, but I can't understand them, somebody can help me with a simple example on C#.</p>
<p>Thanks very much.</p>
| <c#><class><events><raise><raiseevent> | 2016-05-16 15:34:10 | LQ_CLOSE |
37,257,993 | Combining multiple bash parameter substitutions within same variable set line without using any other commands | <p>Example of what I want to combine:</p>
<pre><code>sVar=$(whoami)
sVar=${sVar^}
sVar=${sVar::1}
</code></pre>
<p>Output:</p>
<ul>
<li>Uppercase first character of username</li>
</ul>
<p>Requirements:</p>
<ul>
<li>One-liner</li>
<li>Do the rest of the processing with parameter substitutions except for the initial command substitution above $(whoami)</li>
</ul>
<p>I realize this can be done with tr, sed, awk, printf, cut, etc.; but that is not the point of the question.</p>
<p>Any help is appreciate!</p>
<p>This isn't the real code or anything indicative of what I am wanting to actually do. I will often default (or try to) to using just one command over concatenating multiple commands.</p>
<p>I've seen other posts state that concatenating within the braces are not possible, but I know that everything is possible.</p>
<p>Please don't:</p>
<ul>
<li>Reference other posts as duplicate that say it's impossible</li>
</ul>
| <bash><variables><parameters><concatenation><substitution> | 2016-05-16 15:48:50 | LQ_CLOSE |
37,258,112 | Cywin64 - command not working as expected | The following command string will working fine in Cygwin32 but no longer works under Cygwin64. Does anyone have a clue why? All packages are installed as expected.
$svn status | sort | cut -c2- | xargs cksum
: No such file or directory
I am running on Windows 7 x64
Thank you.
Amad | <svn><cygwin> | 2016-05-16 15:54:18 | LQ_EDIT |
37,259,584 | Postgres shuts down immediately when started with docker-compose | <p>Postgres shuts down immediately when started with docker-compose. The yaml file used is below</p>
<pre><code>version: '2'
services:
postgres:
image: postgres:9.5
container_name: local-postgres9.5
ports:
- "5432:5432"
</code></pre>
<p>The log when docker-compose up command is executed</p>
<pre><code>Creating local-postgres9.5
Attaching to local-postgres9.5
local-postgres9.5 | The files belonging to this database system will be owned by user "postgres".
local-postgres9.5 | This user must also own the server process.
local-postgres9.5 |
local-postgres9.5 | The database cluster will be initialized with locale "en_US.utf8".
local-postgres9.5 | The default database encoding has accordingly been set to "UTF8".
local-postgres9.5 | The default text search configuration will be set to "english".
local-postgres9.5 |
local-postgres9.5 | Data page checksums are disabled.
local-postgres9.5 |
local-postgres9.5 | fixing permissions on existing directory /var/lib/postgresql/data ... ok
local-postgres9.5 | creating subdirectories ... ok
local-postgres9.5 | selecting default max_connections ... 100
local-postgres9.5 | selecting default shared_buffers ... 128MB
local-postgres9.5 | selecting dynamic shared memory implementation ... posix
local-postgres9.5 | creating configuration files ... ok
local-postgres9.5 | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
local-postgres9.5 | initializing pg_authid ... ok
local-postgres9.5 | initializing dependencies ... ok
local-postgres9.5 | creating system views ... ok
local-postgres9.5 | loading system objects' descriptions ... ok
local-postgres9.5 | creating collations ... ok
local-postgres9.5 | creating conversions ... ok
local-postgres9.5 | creating dictionaries ... ok
local-postgres9.5 | setting privileges on built-in objects ... ok
local-postgres9.5 | creating information schema ... ok
local-postgres9.5 | loading PL/pgSQL server-side language ... ok
local-postgres9.5 | vacuuming database template1 ... ok
local-postgres9.5 | copying template1 to template0 ... ok
local-postgres9.5 | copying template1 to postgres ... ok
local-postgres9.5 | syncing data to disk ... ok
local-postgres9.5 |
local-postgres9.5 | WARNING: enabling "trust" authentication for local connections
local-postgres9.5 | You can change this by editing pg_hba.conf or using the option -A, or
local-postgres9.5 | --auth-local and --auth-host, the next time you run initdb.
local-postgres9.5 |
local-postgres9.5 | Success. You can now start the database server using:
local-postgres9.5 |
local-postgres9.5 | pg_ctl -D /var/lib/postgresql/data -l logfile start
local-postgres9.5 |
local-postgres9.5 | ****************************************************
local-postgres9.5 | WARNING: No password has been set for the database.
local-postgres9.5 | This will allow anyone with access to the
local-postgres9.5 | Postgres port to access your database. In
local-postgres9.5 | Docker's default configuration, this is
local-postgres9.5 | effectively any other container on the same
local-postgres9.5 | system.
local-postgres9.5 |
local-postgres9.5 | Use "-e POSTGRES_PASSWORD=password" to set
local-postgres9.5 | it in "docker run".
local-postgres9.5 | ****************************************************
local-postgres9.5 | waiting for server to start....LOG: database system was shut down at 2016-05-16 16:51:54 UTC
local-postgres9.5 | LOG: MultiXact member wraparound protections are now enabled
local-postgres9.5 | LOG: database system is ready to accept connections
local-postgres9.5 | LOG: autovacuum launcher started
local-postgres9.5 | done
local-postgres9.5 | server started
local-postgres9.5 | ALTER ROLE
local-postgres9.5 |
local-postgres9.5 |
local-postgres9.5 | /docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
local-postgres9.5 |
local-postgres9.5 | LOG: received fast shutdown request
local-postgres9.5 | LOG: aborting any active transactions
local-postgres9.5 | LOG: autovacuum launcher shutting down
local-postgres9.5 | LOG: shutting down
local-postgres9.5 | waiting for server to shut down....LOG: database system is shut down
local-postgres9.5 | done
local-postgres9.5 | server stopped
local-postgres9.5 |
local-postgres9.5 | PostgreSQL init process complete; ready for start up.
local-postgres9.5 |
local-postgres9.5 | LOG: database system was shut down at 2016-05-16 16:51:55 UTC
local-postgres9.5 | LOG: MultiXact member wraparound protections are now enabled
local-postgres9.5 | LOG: database system is ready to accept connections
local-postgres9.5 | LOG: autovacuum launcher started
</code></pre>
<p>Postgres seems to work fine when a container is started using the same image with docker run</p>
<pre><code>docker run --name local-postgres9.5 -p 5432:5432 postgres:9.5
</code></pre>
| <postgresql><docker><docker-compose><postgresql-9.5> | 2016-05-16 17:18:11 | HQ |
37,259,862 | Why HTML and CSS doesn't work | Currently I'm learning HTML and CSS on W3C-Schools and now I've stuck at [this][1] chapter. Beforehand I want to say that I'm learning it at my Samsung Galaxy Note 4 (with Android 5.1.1). I'm using the [AWD - IDE For Web dev][2], [Total Commander][3], [Samsung Internet Browser][4] and [Google Chrome][5].
My problem is, that I don't know why my HTML and CSS doesn't work.
When I'm trying to define the CSS-Styling in a extern file ...
[enter image description here][6]
So there are two questions I have. **Where does the `รร` come from and why the HTML-Document is'nt designed as in CSS definded.**
When I'm trying to define the CSS-Styling intern ...
[enter image description here][7]
Then the background just changes but the heading and the paragraph doesn't.
The code that I'm used at my phone is a one-to-one copy from the chapter from W3C-Schools. I've also tried this with other Browsers and editors, but still doesn't work. I've also noticed that when I save the extern css-file in a own folder `css/styles.css` that I get the same result as the css-stylesheet intern.
**But my final Question is: What's wrong with that?**
Thanks in advance!
tp://www.file-upload.net/download-11582495/SecWebpage.zip.html Here is the project folder from this problem.
[1]: tp://www.w3schools.com/html/html_css.asp
[2]: tps://play.google.com/store/apps/details?id=org.kidinov.awd&hl=en
[3]: tps://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander&hl=en
[4]: tps://play.google.com/store/apps/details?id=com.sec.android.app.sbrowser&hl=en
[5]: tps://play.google.com/store/apps/details?id=com.android.chrome&hl=en
[6]: http://i.stack.imgur.com/PpETh.jpg
[7]: http://i.stack.imgur.com/9yFv2.jpg | <html><css> | 2016-05-16 17:35:19 | LQ_EDIT |
37,260,230 | Spark cluster full of heartbeat timeouts, executors exiting on their own | <p>My Apache Spark cluster is running an application that is giving me lots of executor timeouts:</p>
<pre><code>10:23:30,761 ERROR ~ Lost executor 5 on slave2.cluster: Executor heartbeat timed out after 177005 ms
10:23:30,806 ERROR ~ Lost executor 1 on slave4.cluster: Executor heartbeat timed out after 176991 ms
10:23:30,812 ERROR ~ Lost executor 4 on slave6.cluster: Executor heartbeat timed out after 176981 ms
10:23:30,816 ERROR ~ Lost executor 6 on slave3.cluster: Executor heartbeat timed out after 176984 ms
10:23:30,820 ERROR ~ Lost executor 0 on slave5.cluster: Executor heartbeat timed out after 177004 ms
10:23:30,835 ERROR ~ Lost executor 3 on slave7.cluster: Executor heartbeat timed out after 176982 ms
</code></pre>
<p>However, in my configuration I can confirm I successfully increased the executor heartbeat interval:
<a href="https://i.stack.imgur.com/cNoDW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cNoDW.png" alt="enter image description here"></a></p>
<p>When I visit the logs of executors marked as <code>EXITED</code> (i.e.: the driver removed them when it couldn't get a heartbeat), it appears that executors killed themselves because they didn't receive any tasks from the driver:</p>
<pre><code>16/05/16 10:11:26 ERROR TransportChannelHandler: Connection to /10.0.0.4:35328 has been quiet for 120000 ms while there are outstanding requests. Assuming connection is dead; please adjust spark.network.timeout if this is wrong.
16/05/16 10:11:26 ERROR CoarseGrainedExecutorBackend: Cannot register with driver: spark://CoarseGrainedScheduler@10.0.0.4:35328
</code></pre>
<p>How can I turn off heartbeats and/or prevent the executors from timing out?</p>
| <apache-spark><configuration> | 2016-05-16 17:57:28 | HQ |
37,260,703 | how to replace all of specific entry in a column with new entry | I have a data frame with a column that is filled with string entries of {A,B,C}, but want to replace all entries of A with B. What function would be best to do this? Thanks, I'm still an R newbie! | <r> | 2016-05-16 18:24:58 | LQ_EDIT |
37,260,901 | How to find module "fs" in MS Code with TypeScript? | <p>I'm running on a MacBook Air. I installed MS Code as an IDE and also have TypeScript installed.</p>
<p>I have a simple file with just this line:</p>
<pre><code>import fs = require('fs');
</code></pre>
<p>I'm getting a red squiggly under the 'fs' inside the parenthesis and the error message is <code>[ts] Cannot find module 'fs'.</code> The file has a .ts extension. I'm new to JavaScript and to TypeScript, but I was under the impression that <code>fs</code> was a core module, so how could it not be found? How do I fix the problem?</p>
<p>Other things that I tried already:</p>
<ul>
<li>Putting a simple function body in the file and then compiling on the command line with <code>tsc</code>. I get an essentially equivalent error there: <code>error TS2307: Cannot find module 'fs'.</code> </li>
<li>On the command line <code>sudo npm install fs -g</code>. This reports apparent success, but doesn't fix the problem.</li>
</ul>
<p>I poked around SE and the web, but the answers that seemed close all appear to assume that 'fs' is available.</p>
| <javascript><typescript><tsc> | 2016-05-16 18:36:03 | HQ |
37,261,126 | select option 3 level html | Can you help me! This code, select option 1 show apple, next select apple show iphone, all select other show input other. thanks you so much!
<select name="1">
<option value="Apple">Apple</option>
<option value="Samsung">Samsung</option>
<option value="other">Other</option>
</select>
<select name="Apple">
<option value="iphone">iPhone 7</option>
<option value="ipad">iPad Super Pro</option>
<option value="other">Other</option>
</select>
<select name="Samsung">
<option value="note">Note 6</option>
<option value="galaxy">Galaxy S8</option>
<option value="other">Other</option>
</select>
<input type="text" name="other"/> | <javascript><html><select><option> | 2016-05-16 18:49:58 | LQ_EDIT |
37,262,104 | How to update XML file in java | <p>I am new to java and I would like to update the dates to existing xml file but not sure ho to do it lets say the file is File.xml
and I need to change the date in:
So I need to update the start and end date.
Thanks</p>
| <java> | 2016-05-16 19:49:20 | LQ_CLOSE |
37,262,145 | syntax error, unexpected T_VARIABLE in subquwery | <p><a href="http://i.stack.imgur.com/3OkbU.jpg" rel="nofollow">i have syntax error in line 213 please need some help</a></p>
| <php><sql> | 2016-05-16 19:51:55 | LQ_CLOSE |
37,262,323 | Visual Studio not compiling TypeScript | <p>I have a Visual Studio project with a structure like so:</p>
<p><a href="https://i.stack.imgur.com/AQn7A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/AQn7A.png" alt="Folder structure"></a></p>
<p>My <code>tsconfig.json</code> looks like:</p>
<pre><code>{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
</code></pre>
<p>However, VS isn't compiling the <code>app.ts</code> into the <code>wwwroot</code> folder.</p>
<p>What am I missing?</p>
| <visual-studio><typescript><visual-studio-2015><asp.net-core> | 2016-05-16 20:03:16 | HQ |
37,262,425 | Excel VBA - A general how to... | I'm looking to figure out a way to take some data in a sheet and then carry it over to another sheet and change the formatting of it. In essence, I have a set employees, skills, branches and tiers. Rather than have a long list of each skill name and a separate row for each employee, I'd like to have (see 2nd image) the employee names listed under the skill name in a table.
Here is the spreadsheet with the data:
http://i.stack.imgur.com/8vqH8.png
And then I'd like to format the data like so in the second sheet using an update button:
http://i.stack.imgur.com/qDr2X.png
Any help would be greatly appreciated!
| <vba><excel> | 2016-05-16 20:09:30 | LQ_EDIT |
37,262,559 | hot to collapse 2 variables by dummies in panel data [stata] | I have to collapse a some variable of my dataset but Iโm getting issues.
Basicaly, there are 2 variables valor_receita_propria (in english is own_revenue_value) and qt_tec_total (or total_tec_qt, the quantity of technician in a institution). There are 2 dummy variables which specify if the value of the above mentioned variables refer to each individual plant or to his enterprise.
For example, if in_refT is equal 1, then the value of qt_tec_total of that plant actually refers to the whole enterprise. If the inrefT is equal 2, then the value of that plant refers to that singular plnat.
What I need to do is agregate all the values for enterprise. My plan was take the mean of all values referring to the enterprise and take the sum of all values referring to each plant, so I wrote:
โ
. collapse (sum) receitasum=vl_receita_propria if in_refC==2 (sum) tecsum=qt_tec_total if in_refT==2 (mean) receitasum=vl_receita_propria if in_refC==1 (mean) tecsum=qt_tec_total if in_refT==1 (sum) em_exerc (sum) doc_do (sum) qt_matricula_curso1, by (ano CO_MANT3)
โ
Of course, I need that it results only one variable of each kind referring only and exclusively to each whole enterprise.
However, it shows this error:
โ
invalid '('
r(198);
โ | <variables><stata><collapse><panel-data><dummy-variable> | 2016-05-16 20:17:27 | LQ_EDIT |
37,263,058 | Cannot uninstall Microsoft SQL server 2008 R2 | When I'm trying to uninstall Microsoft SQL server 2008 R2, the window with "Please wait while SQL Server 2008 R2 Setup processes the current operation" pops up and stays forever.
I've found solutions to this problem but it was when someone was trying to install server, but not uninstall.
Have anyone faced the similar problem and managed to fix it?
Thank you. | <sql-server><sql-server-2008-r2> | 2016-05-16 20:50:36 | LQ_EDIT |
37,263,357 | How to declare and import typescript interfaces in a separate file | <p>I want to define several interfaces in their own file in my typescript-based project, from which I'll implement classes for production as well as mocks for testing. However, I can't figure out what the correct syntax is. I've found plenty of tutorials on declaring interfaces and implementing them, but they all have a trivial implementation of both the interface and derived classes in the same file, which isn't very real-world. What's the right way to export and import the interfaces?</p>
| <typescript><typescript1.8> | 2016-05-16 21:14:33 | HQ |
37,263,398 | Attempted to compile "zone.js" as an external module, but it looks like a global module | <p>I have the "AngularClass" angular2-webpack-starter project
I have install all npm dependencies
Now I'm trying to install typings</p>
<p>typings.json</p>
<pre><code>{
"dependencies": {
"zone.js": "github:gdi2290/typed-zone.js#66ea8a3451542bb7798369306840e46be1d6ec89"
},
"devDependencies": {},
"ambientDependencies": {
"angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d",
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"hammerjs": "github:DefinitelyTyped/DefinitelyTyped/hammerjs/hammerjs.d.ts#74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c",
"node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#8cf8164641be73e8f1e652c2a5b967c7210b6729",
"selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea",
"webpack": "github:DefinitelyTyped/DefinitelyTyped/webpack/webpack.d.ts#95c02169ba8fa58ac1092422efbd2e3174a206f4"
}
}
</code></pre>
<p>when I typed </p>
<pre><code>sudo typings install
</code></pre>
<p>I got</p>
<pre><code>derzunov:angular2-webpack-starter derzunov$ sudo typings install
typings ERR! message Attempted to compile "zone.js" as an external module, but it looks like a global module.
typings ERR! cwd /Users/derzunov/projects/Angular2/angular2-webpack-starter
typings ERR! system Darwin 15.4.0
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install"
typings ERR! node -v v4.4.4
typings ERR! typings -v 1.0.2
typings ERR! If you need help, you may report this error at:
typings ERR! <https://github.com/typings/typings/issues>
</code></pre>
<p>What does it mean?
Help! =))</p>
| <javascript><node.js><typescript><angular> | 2016-05-16 21:16:43 | HQ |
37,264,306 | PHP multi select array | <p>I am having issues getting the following to work and really hope somebody can help out a little:</p>
<p>I have the following select dropdown box and I am trying to send 2 values each time. 1st is my JobID, 2nd is my ProfileID.</p>
<pre><code>echo ' <select class="ui dropdown multiple special AddProfileToCastings" name="AddProfileToCastings[]" >';
echo ' <option value="" >Casting Jobs</option>';
foreach($GetCastings_result as $data){
$Job_ID = $data->Job_ID;
echo ' <option value="'.$Job_ID.','.$ProfileID.'" >'.$data->Job_Title.'</option>';
}
echo " </select>";
if(isset($_POST['Submit_AddProfileToCastings'])){
$AddProfileToCastings = $_POST['AddProfileToCastings'];
print_r($AddProfileToCastings);
}
</code></pre>
<p>The resulting Array looks like this:</p>
<p>Array ( [0] => 66,1108 [1] => 69,1108 [2] => 73,1108 )</p>
<p>I would now like to split up my JobID and ProfileID(the comma separated values) so that I am able to insert the data in to my database.</p>
| <php><arrays> | 2016-05-16 22:32:54 | LQ_CLOSE |
37,265,169 | how to use if command to ignore the institution which did not appear and execute the rest command | I use STATA. I have a question regarding how to use loop commond to execute this task.
My task is I have mutliple institutions which school_code indicates their ID. And I knew that the ID is in range of 1 to 10000. They appear in the variable of "school_code". But, as mentioned, they did not appear occuasionally.
Therefore, I need a condition commond, "if" for example, to help me to ignore those institution did not appear in the given year automatically.
Thank you for your advice.
| <loops><if-statement><conditional-statements><stata> | 2016-05-17 00:19:35 | LQ_EDIT |
37,265,235 | In C I trying to do funtion of sum but the answer isn't the expected | I've been trying to do a program which it can sum to numbers, I want to do the one by funtions althought.
The funtion is call "sum", but program get " the sum is 0". What i need to debug ?
#include <stdio.h>
int sum()
{
int a, b;
int answer;
answer = a+b;
return 0;
}
int main()
{
int var_a, var_b;
int result;
printf (" first number \n");
scanf ("%i",&var_a);
printf ("second number \n");
scanf ("%i",&var_b);
result = sum(var_a,var_b);
printf(" The sum is %i", result);
return 0;
}
Sincerily
NIN. | <c><function> | 2016-05-17 00:27:30 | LQ_EDIT |
37,265,855 | How should I configure the base href for Angular 2 when using Electron? | <p>I need to either set <code><base></code> in the HTML or <code>APP_BASE_HREF</code> during the bootstrap for Angular 2 to not throw exceptions. If I set either of these then <code>Electron</code>, thinking in terms of the file system, throws exceptions in <code>browser_adapter.ts</code> when trying to match a route: </p>
<blockquote>
<p>EXCEPTION: Error: Uncaught (in promise): Cannot match any routes.
Current segment: 'C:'. Available routes: ['/dashboard', '/accounts'].</p>
</blockquote>
<p>I tried using just the <code>HashLocationStrategy</code> mentioned in <a href="https://www.xplatform.rocks/2016/01/07/building-an-electron-app-using-angular2-beta0-in-typescript/" rel="noreferrer">this blog post</a>, but Angular still complains about the base href not being set.</p>
| <typescript><angular><electron><angular2-routing> | 2016-05-17 01:49:24 | HQ |
37,266,411 | React stateless component this.refs..value? | <p>I don't know if I'm doing this correctly...
If I want to get value from an input I use this.refs.whatever.value.trim() but if that input is a stateless function component how do I do retrieve the value onSubmit?</p>
<p>I know this isn't correct now after researching but how are you supposed to get value from these input fields?</p>
<pre><code>import React, {Component} from 'react'
import {InputField} from '../components/forms/InputField'
import {Button} from '../components/forms/Button'
export default class SignupWrapper extends Component {
_handleSubmit(e) {
e.preventDefault();
const email = this.refs.email.value.trim();
const password = this.refs.password.value.trim();
const confirm = this.refs.confirm.value.trim();
console.log({email, password, confirm});
}
render() {
return (
<form id="application-signup" onSubmit={this._handleSubmit.bind(this)}>
<InputField type={'email'} name={'email'} text={'email'}
helpBlock={'email is required'} ref="email" />
<InputField type={'password'} name={'password'} text={'password'}
helpBlock={'password is required'} ref="password" />
<InputField type={'password'} name={'confirm'} text={'confirm password'}
helpBlock={'password confirmation is required'} ref="confirm" />
<Button type={'submit'} className={'btn btn-primary'} text={'signup'} />
</form>
)
}
}
</code></pre>
<p>this is the stateless inputfield</p>
<pre><code>import React from 'react'
export const InputField = (props) => (
<div className="form-group col-xs-12">
<label htmlFor={props.name}>{props.text}</label>
<input type={props.type} name={props.name} className="form-control"
data-stripe={props.stripe} />
<span className="help-block">{props.helpBlock}</span>
</div>
)
</code></pre>
| <reactjs> | 2016-05-17 03:04:26 | HQ |
37,266,429 | Video played with AVPlayer has grey line to top and sides on iPhone 6S Plus | <p>This seems to be a device specific bug on only <strong>iPhone 6S Plus</strong>.</p>
<p>Steps:</p>
<ol>
<li>Download <a href="https://developer.apple.com/library/ios/samplecode/AVPlayerDemo/Introduction/Intro.html" rel="noreferrer">AVPlayer demo sample code</a></li>
<li>Adjust <code>AVPlayerDemoPlaybackView.xib</code> so that <code>MPlayback View</code> has margins around it</li>
<li>Make content view color white</li>
</ol>
<p>1px grey lines will appear at the top and sides.</p>
<p>Anyone knows how to workaround this?</p>
<p>I have tried to put an opaque view that obscure the top, yet the line will still appear ABOVE the opaque view!</p>
| <ios><avplayer> | 2016-05-17 03:07:19 | HQ |
37,266,631 | Is there an Objective-C equivalent to Swift's fatalError? | <p>I want to discard superclass's default init method.I can achieve this easily with <code>fatalError</code> in Swift:</p>
<pre><code>class subClass:NSObject{
private var k:String!
override init(){
fatalError("init() has not been implemented")
}
init(kk:String){
k = kk
}
}
</code></pre>
<p>How can I do it in Objective-C?</p>
| <ios><objective-c><swift><overriding><subclass> | 2016-05-17 03:34:56 | HQ |
37,267,226 | Load a local image after loading a remote image failed | <p>Is it possible to load a local image if the remote image failed?</p>
<p>For example, I have the following code:</p>
<pre><code><Image style={ styles.userImage }
source={ { uri: http://example.com/my_image.jpg } }
onError={(error) => ...}
/>
</code></pre>
<p>In case for example I don't have the rights to access <code>http://example.com/my_image.jpg</code>, I'll get an error in <code>onError</code>. Is there a way then to load a local image instead?</p>
| <react-native> | 2016-05-17 04:36:46 | HQ |
37,267,375 | Is there any way to define custom routes in Phoenix? | <p>Let's say I want to create a <code>resources</code> with adding a couple of custom actions to it, the analogue in rails is:</p>
<pre><code>resources :tasks do
member do
get :implement
end
end
</code></pre>
<p>Which will return me not only 7 standard routes, but 1 new:</p>
<pre><code>GET /tasks/:id/implement
</code></pre>
<p>How can I do it in phoenix?</p>
| <elixir><phoenix-framework> | 2016-05-17 04:50:13 | HQ |
37,267,916 | How to run aws configure in a travis deploy script? | <p>I am trying to get <a href="https://travis-ci.com" rel="noreferrer">travis-ci</a> to run a custom deploy script that uses <a href="https://aws.amazon.com/cli/" rel="noreferrer"><code>awscli</code></a> to push a deployment up to my staging server.</p>
<p>In my <code>.travis.yml</code> file I have this:</p>
<pre><code>before_deploy:
- 'curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"'
- 'unzip awscli-bundle.zip'
- './awscli-bundle/install -b ~/bin/aws'
- 'export PATH=~/bin:$PATH'
- 'aws configure'
</code></pre>
<p>And I have set up the following environment variables:</p>
<pre><code>AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
</code></pre>
<p>with their correct values in the <code>travis-ci</code> web interface.</p>
<p>However when the <code>aws configure</code> runs, it stops and waits for user input. How can I tell it to use the environment variables I have defined?</p>
| <amazon-web-services><configuration><travis-ci><continuous-deployment><aws-cli> | 2016-05-17 05:35:36 | HQ |
37,268,391 | Strange "!*" entry in LocalVariableTypeTable when compiling with eclipse compiler | <p>Let's compile the following code with ECJ compiler from Eclipse Mars.2 bundle:</p>
<pre><code>import java.util.stream.*;
public class Test {
String test(Stream<?> s) {
return s.collect(Collector.of(() -> "", (a, t) -> {}, (a1, a2) -> a1));
}
}
</code></pre>
<p>The compilation command is the following:</p>
<p><code>$ java -jar org.eclipse.jdt.core_3.11.2.v20160128-0629.jar -8 -g Test.java</code></p>
<p>After the successful compilation let's check the resulting class file with <code>javap -v -p Test.class</code>. The most interesting is the synthetic method generated for the <code>(a, t) -> {}</code> lambda:</p>
<pre><code> private static void lambda$1(java.lang.String, java.lang.Object);
descriptor: (Ljava/lang/String;Ljava/lang/Object;)V
flags: ACC_PRIVATE, ACC_STATIC, ACC_SYNTHETIC
Code:
stack=0, locals=2, args_size=2
0: return
LineNumberTable:
line 5: 0
LocalVariableTable:
Start Length Slot Name Signature
0 1 0 a Ljava/lang/String;
0 1 1 t Ljava/lang/Object;
LocalVariableTypeTable:
Start Length Slot Name Signature
0 1 1 t !*
</code></pre>
<p>I was quite surprised to see this <code>!*</code> entry in <code>LocalVariableTypeTable</code>. JVM specification <a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.14" rel="noreferrer">covers</a> LocalVariableTypeTable attribute and says:</p>
<blockquote>
<p>The <code>constant_pool</code> entry at that index must contain a <code>CONSTANT_Utf8_info</code> structure (<a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4.7" rel="noreferrer">ยง4.4.7</a>) representing a field signature which encodes the type of a local variable in the source program (<a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.9.1" rel="noreferrer">ยง4.7.9.1</a>). </p>
</blockquote>
<p><a href="http://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.9.1" rel="noreferrer">ยง4.7.9.1</a> defines a grammar for field signatures which, if I understand correctly, does not cover anything similar to <code>!*</code>.</p>
<p>It should also be noted that neither javac compiler, nor older ECJ 3.10.x versions generate this <code>LocalVariableTypeTable</code> entry. Is <code>!*</code> some non-standard Eclipse extension or I'm missing something in JVM spec? Does this mean that ECJ does not conform to JVM spec? What <code>!*</code> actually mean and are there any other similar strings which could appear in <code>LocalVariableTypeTable</code> attribute?</p>
| <java><eclipse><lambda><bytecode><ecj> | 2016-05-17 06:09:01 | HQ |
37,268,874 | beforeunload not working in Safari 9.1 after the page reloads on clicking leave page button | <p>In safari 9.1,jquery beforeunload browser pop up doesnt show up for the second time.
Once the user clicks on leave page button in the pop up the page reloads.But after this the pop up never comes up though the controls goes to the code. Unless the browser is reopened again the pop up never shows up.
PFB the code</p>
<pre><code>window.addEventListener("beforeunload", function (e) {
if(condition) {
e.returnValue=""; // for chrome
return "message";
}
});
</code></pre>
| <jquery><safari><onbeforeunload> | 2016-05-17 06:41:20 | HQ |
37,268,907 | CMD - is not recognized as an internal/external command | <p>I have a problem with "<strong>Command Prompt</strong>" :</p>
<p><a href="https://i.stack.imgur.com/sNGxH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sNGxH.png" alt="enter image description here"></a></p>
<p>How to solve this problem ?</p>
| <windows><cmd><command-prompt> | 2016-05-17 06:43:29 | LQ_CLOSE |
37,269,509 | Batch file, how to remove the first world in a text file and only in the first line? | I have a .txt file that may contain various words on various lines and I just want to remove the first word in the first line. (ex: I have 2 lines in my text file containing 2 words each (abc, bcd on the first line and cde, def on the second) annd I want the output to be bcd on the first line and cde and def on the second). I researched this and I only came across to how to remove the first word in all the lines but I only need in the first line. Thanks in advance. | <string><batch-file><text><cut> | 2016-05-17 07:15:45 | LQ_EDIT |
37,269,736 | React Router - how to constrain params in route matching? | <p>I don't really get how to constrain params with, for example a regex.<br>
How to differentiate these two routes?</p>
<pre><code> <Router>
<Route path="/:alpha_index" component={Child1} />
<Route path="/:numeric_index" component={Child2} />
</Router>
</code></pre>
<p>And prevent "/123" from firing the first route?</p>
| <reactjs><react-router> | 2016-05-17 07:27:46 | HQ |
37,269,891 | Gridview in C# dont show data and a big eror | i am trying to show my data table with a grid view
protected void show_data(object sender, EventArgs e)
{
string str = "Data Source=(LocalDB)\\MSSQLLocalDB;";
str += "AttachDbFilename=|DataDirectory|DinoData.mdf;";
str += "Integrated Security= True";
SqlConnection c;
c = new SqlConnection(str);
GV.DataSource = User;
GV.DataBind();
}
the eror:
> An exception of type 'System.InvalidOperationException' occurred in
> System.Web.dll but was not handled in user code
>
> Additional information: Data source is an invalid type. It must be
> either an IListSource, IEnumerable, or IDataSource.
what should i do?
and if i want to show only part of the table with gridview how to do it?
thanks for helping | <c#> | 2016-05-17 07:35:02 | LQ_EDIT |
37,270,093 | I want to display sequence of weekday according to country. How can I achieve this using SAP UI5 and Javascript or JQuery | Sequence according to country should be
India: Mon, Tue, Wed, Thur, Fri, Sat, Sun
Dubai: Sun, Mon, ... | <javascript><jquery><calendar><sapui5> | 2016-05-17 07:44:59 | LQ_EDIT |
37,270,265 | How to center the Clicked position in the Recyclerview | <p>I want to center the clicked position in the <code>Recyclerview</code>. I am able to scroll the <code>Recyclerview</code> to certain position but i want to middle that position in the screen.
I used this method to scroll to that position.</p>
<pre><code>videoRecyclerview.scrollToPosition(position);
</code></pre>
| <android><android-recyclerview> | 2016-05-17 07:54:07 | HQ |
37,270,722 | Micro web-framework for Kotlin | <p>I would like to develop a very simple web-application. Is there something similar to Flask from Python world for Kotlin?</p>
<p>I know there is for instance Kara framework, but it looks abandoned.</p>
| <kotlin> | 2016-05-17 08:19:28 | HQ |
37,270,787 | Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document' | <pre><code>'<button id="'+item['id']+'" class="btnDeactivateKeyInChildPremiumCustomer waves-effect waves-light>ok</button>'
</code></pre>
<p>I used above code for generating button inside of jquery each function.The button created dynamically and when i clicked the button , it should show the progress on the button.
Im using this <a href="https://github.com/hakimel/Ladda" rel="noreferrer">Ladda Button Loader</a>.</p>
<pre><code> btnDeactivateKeyInChildPremiumCustomerClick : function(event){
var id = event.currentTarget.id;
var btnProgress = Ladda.create(document.querySelector('#'+id));
//btnProgress.start(); or //btnProgress.stop();
}
</code></pre>
<p>And then i passed the button the event handler catch the event process the above function.Inside that function it will create a <strong>btnProgress</strong> object.
After that i can call start() or stop() functions.I have successfully worked the in the case of only one button without creating the button dynamically inside each . But in the for each case it is showing some errors while executing <strong>var btnProgress = Ladda.create(document.querySelector('#'+id));</strong></p>
<p><strong>Error</strong></p>
<pre><code>Uncaught SyntaxError: Failed to execute 'querySelector' on 'Document': '#22' is not a valid selector.
</code></pre>
| <javascript><jquery><backbone.js> | 2016-05-17 08:23:09 | HQ |
37,270,835 | How to host material icons offline? | <p>My apologies if this is a very simple question, but how do you use google material icons without a </p>
<pre><code><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</code></pre>
<p>?</p>
<p>I would like my app to be able to display the icons even when the user does not have an internet connection</p>
| <javascript><html><cordova><materialize> | 2016-05-17 08:25:43 | HQ |
37,271,402 | pg_restore error: role XXX does not exist | <p>Trying to replicate a database from one system to another. The versions involved are 9.5.0 (source) and 9.5.2 (target). </p>
<p>Source db name is <code>foodb</code> with owner <code>pgdba</code> and target db name will be named <code>foodb_dev</code> with owner <code>pgdev</code>.</p>
<p>All commands are run on the target system that will host the replica.</p>
<p>The <code>pg_dump</code> command is:</p>
<pre><code> pg_dump -f schema_backup.dump --no-owner -Fc -U pgdba -h $PROD_DB_HOSTNAME -p $PROD_DB_PORT -d foodb -s --clean;
</code></pre>
<p>This runs without errors.</p>
<p>The corresponding <code>pg_restore</code> is:</p>
<pre><code> pg_restore --no-owner --if-exists -1 -c -U pgdev -d foodb_dev schema_backup.dump
</code></pre>
<p>which throws error:</p>
<pre><code>pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3969; 0 0 ACL public pgdba
pg_restore: [archiver (db)] could not execute query: ERROR: role "pgdba" does not exist
Command was: REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM pgdba;
GRANT ALL ON SCHEMA public TO pgdba;
GRANT ...
</code></pre>
<p>If I generate the dump file in plain text format (<code>-Fp</code>) I see it includes several entries like:</p>
<pre><code>REVOKE ALL ON TABLE dump_thread FROM PUBLIC;
REVOKE ALL ON TABLE dump_thread FROM pgdba;
GRANT ALL ON TABLE dump_thread TO pgdba;
GRANT SELECT ON TABLE dump_thread TO readonly;
</code></pre>
<p>that try to set privileges for user <code>pgdba</code> who of course doesn't even exist as a user on the target system which only has user <code>pgdev</code>, and thus the errors from <code>pg_restore</code>.</p>
<p>On the source db the privileges for example of the <code>dump_thread</code> table:</p>
<pre><code># \dp+ dump_thread
Access privileges
-[ RECORD 1 ]-----+--------------------
Schema | public
Name | dump_thread
Type | table
Access privileges | pgdba=arwdDxt/pgdba+
| readonly=r/pgdba
Column privileges |
Policies |
</code></pre>
<p>A quick solution would be to simply add a user <code>pgdba</code> on the target cluster and be done with it. </p>
<p>But shouldn't the <code>--no-owner</code> take care of not including owner specific commands in the dump in the first place?</p>
| <database><postgresql><restore> | 2016-05-17 08:52:03 | HQ |
37,271,755 | TypeError: sally is undefined | <p>Help me please, i have error "TypeError: sally is undefined";
I don`t understand why.</p>
<pre><code>function Person(name,age) {
this.name = name;
this.age = age;
this.species = "Homo Sapiens";
};
var sally = Person("Sally Bowles", 39);
var holden = Person("Holden Bowles", 16);
console.log("sally's species is " + sally.species + " and she is " +
sally.age);
console.log("holden's species is " + holden.species + " and he is " +
holden.age);
</code></pre>
| <javascript> | 2016-05-17 09:08:03 | LQ_CLOSE |
37,272,669 | CSS - background not working in firefox | I'm trying to get a background image to work in all browser. The following code works perfectly for every browser but firefox:
`<style>
body {
background: url('src/images/SpeqS.jpg') no-repeat center;
background-size: 50%;
height: 100%;
}
</style>`
Does anyone have any idea? | <css><firefox><background-image> | 2016-05-17 09:48:27 | LQ_EDIT |
37,273,145 | Error: Status{statusCode=DEVELOPER_ERROR, resolution=null} | <p>I am usign gplus sign in, and getting this error at time I am in onActivityResult....</p>
<pre><code>@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
callbackManager.onActivityResult(requestCode, resultCode, data);
client.onActivityResult(requestCode, resultCode, data);
if (requestCode == 0) {
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
if (result.isSuccess()) {
GoogleSignInAccount acct = result.getSignInAccount();
// Log.d("Result","details"+ acct.getDisplayName() + acct.getEmail());
mEmail = acct.getEmail();
String mFullName = acct.getDisplayName();
String mGoogleplusId = acct.getId();
SocialUser user = new SocialUser();
user.setType("googleplus");
user.setEmail(mEmail);
user.setFullname(mFullName);
user.setId(mGoogleplusId + "");
loginParams.put("email_id", mEmail);
loginParams.put("googlePlusId", mGoogleplusId);
loginParams.put("full_name", mFullName);
loginParams.put("registrationType", "googleplus");
SignUpService(user);
} else {
Toast.makeText(CustomerLogIn.this, "Unable to fetch data, Proceed manually", Toast.LENGTH_SHORT).show();
}
}
}
</code></pre>
<p>And I am calling for gplus login on button click. On clcking button following code is executed....</p>
<pre><code> GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleApiClient = new GoogleApiClient.Builder(CustomerLogIn.this)
.addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
.build();
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
startActivityForResult(signInIntent, 0);
</code></pre>
<p>And I am geetng this error...</p>
<pre><code>Status{statusCode=DEVELOPER_ERROR, resolution=null}
</code></pre>
<p>on this line....</p>
<pre><code>GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
</code></pre>
<p>Please suggest the solution.</p>
| <android><google-plus> | 2016-05-17 10:10:06 | HQ |
37,274,184 | Json data reading using jquery | <p>how can i get the value of User[keywords][] using jquery ? i tried to get like console.log(User[keywords]); but it does not work</p>
<pre><code>{
"User[firstName]": "",
"User[lastName]": "",
"User[city]": "",
"User[countryCode]": "",
"User[gender]": "",
"User[userType]": "",
"User[zip]": "",
"User[email]": "",
"User[age]": "",
"User[fullAddress]": "",
"CustomValue[11][fieldValue]": "",
"CustomValue[5][fieldValue]": "",
"CustomValue[1][fieldValue]": "",
"CustomValue[6][fieldValue]": "",
"CustomValue[7][fieldValue]": "",
"CustomValue[2][fieldValue]": "",
"CustomValue[8][fieldValue]": "",
"CustomValue[9][fieldValue]": "",
"CustomValue[4][fieldValue]": "",
"CustomValue[10][fieldValue]": "",
"CustomValue[3][fieldValue]": "",
"User[teams][]": null,
"": "",
"User[keywords][]": [
"52",
"53",
"54"
],
"User[searchType]": "1",
"User[keywordsExclude][]": null,
"User[id]": "",
"yt1": ""
}
</code></pre>
| <javascript><jquery><html><json><object> | 2016-05-17 10:58:58 | LQ_CLOSE |
37,274,317 | Timestamp from Mysql Database into readable | <p>Hi to everyone please Help me with this problem I am new to android programming.
I am developing an android application that the person can post something and as it is needed the post should have a time that shows when it is posted and I have set a column for the time inside mysql database with TIMESTAMP data type and when the post is inserted in the database it also inserts the full time and date that when it is posted but when I get the data from the server it shows the date and time fully like this : 17/5/2016 20:54:34
But I want to show it like readable format like this for Example : 4 hours ago or 3 days ago or 3 months ago
Please don't mark my Question as duplicate because I searched and I didn't find anything</p>
| <java><android><datetime> | 2016-05-17 11:05:15 | LQ_CLOSE |
37,274,347 | Why there is no Source Code Management tab in a Jenkins pipeline job? | <p>I've just installed the pipeline plugin (on Jenkins 2.1). When I create a new job the <em>Source Code Management</em> tab is missing (and a few others).
According to <a href="https://jenkins.io/2.0/#ux" rel="noreferrer">the article describing the Pipeline feature</a> at it should look like:
<a href="https://i.stack.imgur.com/pSjSa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pSjSa.png" alt="Source Code Management tab"></a></p>
<p>However this is how it looks like in my case:
<a href="https://i.stack.imgur.com/HZluW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HZluW.png" alt="enter image description here"></a></p>
<p>Where are the missing tabs, especially the <em>Source Code Management</em> one? Is it simply some missing config/plugin or a bug?</p>
<p>I'm on Jenkins 2.1</p>
| <jenkins><jenkins-pipeline> | 2016-05-17 11:06:48 | HQ |
37,274,403 | can' display cinder nova and neutron infos in horizon dashboard | i started to work on openstack , and have installed it on ubuntu, and after all configuration I've some problem displaying cinder & nova & neutron services on horizon [enter image description here][1] " error impossible to get information on nova , cinder , neutron"
[1]: http://i.stack.imgur.com/4MglV.png | <openstack><openstack-nova><openstack-neutron><openstack-cinder> | 2016-05-17 11:09:00 | LQ_EDIT |
37,274,508 | What do you use Apache Kafka for? | <p>I would like to ask if my understanding of Kafka is correct.</p>
<p>For really really big data stream, conventional database is not adequate so people use things such as Hadoop or Storm. Kafka sits on top of said databases and provide ...directions where the real time data should go?</p>
| <apache-kafka> | 2016-05-17 11:14:21 | HQ |
37,274,599 | How to setup single Nuget packages folder for multiple solutions and projects in Visual Studio 2015 | <p>We are developing multiple solutions in Visual Studio 2015. The solutions share some core projects that need nuget packages. The nuget references cannot be resolved when the nuget package is added from one solution and is later opened by another solution.</p>
<p>The folder structure is as follows:</p>
<ul>
<li>Codebase
<ul>
<li>SharedProjects
<ul>
<li>SharedProject1</li>
</ul></li>
<li>SolutionA
<ul>
<li>WebProjectA</li>
<li>packages folder A</li>
</ul></li>
<li>SolutionB
<ul>
<li>WebProjectB</li>
<li>packages folder B</li>
</ul></li>
</ul></li>
</ul>
<p>When I install a nuget package to <code>SharedProject1</code> when <code>SolutionA</code> is opened, the dll reference shows the path to the <code>packages folder A</code>. When <code>SolutionB</code> is opened in another computer, <code>SharedProject1</code> has a reference error since the <code>packages folder A</code> doesn't exist.</p>
<p>I have read this solution: <a href="https://stackoverflow.com/questions/18376313/setting-up-a-common-nuget-packages-folder-for-all-solutions-when-some-projects-a">Setting up a common nuget packages folder for all solutions when some projects are included in multiple solutions</a> but this doesn't solve the problem since the <code>repositoryPath</code> key in the .nuget/NuGet.config file is not applied with <code>Visual Studio 2015</code> and <code>Nuget 3.4.3</code> </p>
| <c#><.net><visual-studio-2015><nuget><nuget-package-restore> | 2016-05-17 11:18:15 | HQ |
37,275,947 | "DELETE TOP (1) FROM @TEMP" or "DELETE FROM #TEMP WHERE.." is faster? | <p>I am wondering which one is much faster in THEORY? </p>
<pre><code>IF EXISTS(SELECT TOP 1 1 FROM @ControlOrderList )
BEGIN
SET @RowNumber= (SELECT TOP 1 id FROM @ControlOrderList)
...
DELETE @ControlOrderList WHERE id=@RowNumber
END
</code></pre>
<p>or is this much faster?</p>
<pre><code>IF EXISTS(SELECT TOP 1 1 FROM @ControlOrderList )
BEGIN
SET @RowNumber= (SELECT TOP 1 id FROM @ControlOrderList)
...
DELETE TOP 1 @ControlOrderList
END
</code></pre>
<p>And is it secure to use DELETE TOP 1? Can I trust SQL-SERVER to delete the row that I got in "SELECT TOP 1 ....." ?</p>
| <sql-server><sql-delete> | 2016-05-17 12:16:51 | LQ_CLOSE |
37,276,106 | How to Dynamically hilight some words in html format | i have a List, that Included lots of keywords,
and have another List, that Included lots of text as HTML format.
i want dinamically Anywhere in my text come those keywords , i can hilight that keyword
what best way for this job in spring framework Or java? | <java><highlight> | 2016-05-17 12:23:44 | LQ_EDIT |
37,276,637 | RDP session is slow | <p>So I am connecting to my work computer from home and the Remote Desktop Connection app is annoyingly slow.</p>
<p>I pinged my work pc from my computer and it returned at a reasonable time of 50ms~ with 0 loss. I then attempted to ping my home IP from the RDP session and it timed out every time. Not sure if this might help anyone come to a conclusion but hopefully it does. Note I am also using it in conjunction with <strong>Cisco AnyConnect Secure Mobility Client</strong> if that helps at all. <em>Work is Windows 7</em> and <em>Home is Windows 8</em></p>
<p>I attempted switching off my home pc's firewall but that did nothing.</p>
<p>Any assistance would be great, surely a setting in the RDP file might make it run a little smoother.</p>
<p>I'll edit this post with further attempts at fixes below</p>
| <rdp><remote-connection><remote-client> | 2016-05-17 12:45:33 | HQ |
37,276,849 | Why is the default Ubuntu boot partition so small? How can I increase it? | <p>Recently I created a Ubuntu server. During install I accepted the default options. Installer creates a 236M <code>/boot</code> partition as shown below. After only a few months the partition is full. Is this partition not awfully small? How can I increase it?</p>
<pre><code>$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 4.0K 16G 1% /dev
tmpfs 3.2G 524K 3.2G 1% /run
/dev/mapper/ci--vg-root 95G 80G 11G 89% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 16G 0 16G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda1 236M 225M 0 100% /boot
</code></pre>
| <linux><ubuntu> | 2016-05-17 12:55:31 | LQ_CLOSE |
37,277,369 | Shared memory lib compatible with linux and windows c++ | <p>I'm looking for a shared memory lib that can handle both linux and windows platforms. I want to use it by C++.
Please let me know if you know any.</p>
| <c++><linux><windows><shared-memory> | 2016-05-17 13:19:17 | LQ_CLOSE |
37,277,397 | Facebook Messenger Chatbot how do I collect the users geo location that they send? | <p>In Facebook Messenger there is an icon allowing the user to send their geo coordinates. </p>
<p><a href="https://i.stack.imgur.com/QFTtR.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/QFTtR.jpg" alt="Location Sent through Facebook Messenger"></a></p>
<p>Is this available on the Facebook Messenger platform yet i.e. if a user sends me their location does my Chatbot have access to it? If so how is it done because i can't see it in the response in my webhook.</p>
| <facebook><facebook-php-sdk><facebook-messenger> | 2016-05-17 13:20:32 | HQ |
37,277,808 | OpenGL (C Language) : Make the shapes to be moved with keyboard (distortion issue) | <p>Well, we have the following C (GLUT Project) for OpenGL. I use CodeBlocks to compile it (with removed the extra main() function file).
I have based in some examples, sorry if the way I wrote OpenGL is bad. The main thing is to make it work fine.</p>
<p>The result I need is: all the shapes (head, body, hands, legs) of "Mr Robot", to be moved via the keyboard arrow keys. It works as expected but from some points and then, some of the shapes are distorted. I don't know why and how to fix it.</p>
<pre><code> #include <GL/glut.h>
GLuint kefali_x1=5, kefali_y1=30, kefali_x2=15, kefali_y2=30, kefali_x3=15, kefali_y3=40, kefali_x4=5,kefali_y4=40;
GLuint soma_x1=0, soma_y1=10, soma_x2=20, soma_y2=10, soma_x3=20, soma_y3=30, soma_x4=0, soma_y4=30;
GLuint podia_x1=10, podia_y1=10, podia_x2=20, podia_y2=0, podia_x3=10, podia_y3=-5, podia_x4=0, podia_y4=0;
GLuint dexi_xeri_x1=20, dexi_xeri_y1=30, dexi_xeri_x2=30, dexi_xeri_y2=27.5, dexi_xeri_x3=20, dexi_xeri_y3=25;
GLuint aristero_xeri_x1=-10, aristero_xeri_y1=27.5, aristero_xeri_x2=0, aristero_xeri_y2=30, aristero_xeri_x3=0, aristero_xeri_y3=25;
// ฯฯฮฝฮธฮตฯฮฟ ฯฯฮฎฮผฮฑ
GLuint listID;
void MrRobot(GLsizei displayListID)
{
glNewList(displayListID,GL_COMPILE);
//Save current colour state
glPushAttrib(GL_CURRENT_BIT);
// ฯฯฮผฮฑ
glColor3f(0.5,0.5,0.5);
glBegin(GL_POLYGON);
glVertex2f(soma_x1,soma_y1);
glVertex2f(soma_x2,soma_y2);
glVertex2f(soma_x3,soma_y3);
glVertex2f(soma_x4,soma_y4);
glEnd();
// ฮบฮตฯฮฌฮปฮน
glColor3f(0,0,1);
glBegin(GL_POLYGON);
glVertex2f(kefali_x1,kefali_y1);
glVertex2f(kefali_x2,kefali_y2);
glVertex2f(kefali_x3,kefali_y3);
glVertex2f(kefali_x4,kefali_y4);
glEnd();
// ฯฯฮดฮนฮฑ
glColor3f(1,0,0);
glBegin(GL_TRIANGLE_FAN);
glVertex2f(podia_x1,podia_y1);
glVertex2f(podia_x2,podia_y2);
glVertex2f(podia_x3,podia_y3);
glVertex2f(podia_x4,podia_y4);
glEnd();
// ฮดฮตฮพฮฏ ฯฮญฯฮน
glColor3f(0,1,0);
glBegin(GL_TRIANGLES);
glVertex2f(dexi_xeri_x1,dexi_xeri_y1);
glVertex2f(dexi_xeri_x2,dexi_xeri_y2);
glVertex2f(dexi_xeri_x3,dexi_xeri_y3);
glEnd();
// ฮฑฯฮนฯฯฮตฯฯ ฯฮญฯฮน
glColor3f(0,1,0);
glBegin(GL_TRIANGLES);
glVertex2f(aristero_xeri_x1,aristero_xeri_y1);
glVertex2f(aristero_xeri_x2,aristero_xeri_y2);
glVertex2f(aristero_xeri_x3,aristero_xeri_y3);
glEnd();
//Recall saved colour state
glPopAttrib();
glEndList();
}
void display()
{
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
listID=glGenLists(1);
MrRobot(listID);
//Execute the display list (the modelview matrix will be applied)
glCallList(listID);
glFlush();
}
void keyboard(unsigned char key,int x, int y)
{
printf("\nKeyboard event detected. \nCharacter key: %c\nMouse pointer position: x=%d y=%d",key,x,y);
if (key==GLUT_KEY_UP)
{
kefali_y1++;
kefali_y2++;
kefali_y3++;
kefali_y4++;
soma_y1++;
soma_y2++;
soma_y3++;
soma_y4++;
podia_y1++;
podia_y2++;
podia_y3++;
podia_y4++;
dexi_xeri_y1++;
dexi_xeri_y2++;
dexi_xeri_y3++;
aristero_xeri_y1++;
aristero_xeri_y2++;
aristero_xeri_y3++;
}
if (key==GLUT_KEY_DOWN)
{
kefali_y1--;
kefali_y2--;
kefali_y3--;
kefali_y4--;
soma_y1--;
soma_y2--;
soma_y3--;
soma_y4--;
podia_y1--;
podia_y2--;
podia_y3--;
podia_y4--;
dexi_xeri_y1--;
dexi_xeri_y2--;
dexi_xeri_y3--;
aristero_xeri_y1--;
aristero_xeri_y2--;
aristero_xeri_y3--;
}
if (key==GLUT_KEY_LEFT)
{
kefali_x1--;
kefali_x2--;
kefali_x3--;
kefali_x4--;
soma_x1--;
soma_x2--;
soma_x3--;
soma_x4--;
podia_x1--;
podia_x2--;
podia_x3--;
podia_x4--;
dexi_xeri_x1--;
dexi_xeri_x2--;
dexi_xeri_x3--;
aristero_xeri_x1--;
aristero_xeri_x2--;
aristero_xeri_x3--;
}
if (key==GLUT_KEY_RIGHT)
{
kefali_x1++;
kefali_x2++;
kefali_x3++;
kefali_x4++;
soma_x1++;
soma_x2++;
soma_x3++;
soma_x4++;
podia_x1++;
podia_x2++;
podia_x3++;
podia_x4++;
dexi_xeri_x1++;
dexi_xeri_x2++;
dexi_xeri_x3++;
aristero_xeri_x1++;
aristero_xeri_x2++;
aristero_xeri_x3++;
}
glutPostRedisplay();
}
int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitWindowPosition(50,50);
glutInitWindowSize(800,600);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutCreateWindow("MrROBOT");
glMatrixMode(GL_MODELVIEW);
gluOrtho2D(-10,50,-10,50);
glScalef(0.4,0.4,0.4);
glutDisplayFunc(display);
glutSpecialFunc(keyboard);
glutMainLoop();
return 0;
}
</code></pre>
| <c><opengl><codeblocks><glut> | 2016-05-17 13:38:18 | LQ_CLOSE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.