[QUOTE=tschumann;53007200]What's the CSS and do you mean vertically align?[/QUOTE]
[CODE].top-social{position:relative;left:230px}.fb-like{position:relative;top:-6px}#twitter{position:relative;top:-6px;left:10px}[/CODE]
Yeah I need it to be aligned with the rest of the buttons at the top of the page (recommend, fb button, twitter)
Been trying to figure it out for weeks
So in c# I'm doing some Bluetooth programming as a hobby project. Are there any good tutorials? Because I'm communicating with an Arduino at the moment and I can connect with an async request with inthehand, but it throws out when I run again citing object disposal.
I have a table with datetime column, how can I select COUNT of total entries from last 7 days and group them by days individually?
so I have: id | time (SQL datetime) | url | columns
I need it to show count of total daily entries as:
time: 2017-12-27, rows: 0,
time: 2017-12-26, rows: 6,
time: 2017-12-25, rows: 12,
time: 2017-12-24, rows: 0,
Etc
There is one condition though - If there are no results/entries for that day -> return rows as 0
[QUOTE=arleitiss;53008999]I have a table with datetime column, how can I select COUNT of total entries from last 7 days and group them by days individually?
so I have: id | time (SQL datetime) | url | columns
I need it to show count of total daily entries as:
time: 2017-12-27, rows: 0,
time: 2017-12-26, rows: 6,
time: 2017-12-25, rows: 12,
time: 2017-12-24, rows: 0,
Etc
There is one condition though - If there are no results/entries for that day -> return rows as 0[/QUOTE]
You can't count non-existing rows, so you won't have rows:0 as a possible result.
Otherwise use something like that:
[CODE]select your_date, count(your_date) where your_date >= min_date and your_date <= max_date group by your_date[/CODE]
Then format the output anyway you want.
I'm encountering a crash when attempting to render a vertex array object. I only encounter this crash when trying to render it as soon as it is completed, rather than waiting a few seconds and then rendering it.
I figured that unlike some other things like textures or shaders that can be attempted to use while incomplete, that geometry needs special care, so I tried using several GLsync fences. I put one after uploading data to the vertex buffers, and another after configuring the vertex array object.
In those cases, I do the following:
[code]//...set up state...//
m_fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
glFlush();[/code]
and before calling glDrawArrays, I check the fence
[code]const auto state = glClientWaitSync(m_fence, 0, 0);
if (state == GL_ALREADY_SIGNALED || state == GL_CONDITION_SATISFIED) {
// ... safe to render, right? //
}[/code]
When debugging, I crash on the glDrawArrays call after it is presumed to be safe to render (nvoglv64.dll Access Violation 0x0000000000000000).
I can easily replicate this. I only have 1 object in my scene and it starts off culled behind the camera. If I immediately turn the camera to face it and draw, I crash. If I wait a second and then do it, it is fine.
[editline]28th December 2017[/editline]
Whoops, the issue appeared to be that I forgot to update the number of vertex attribute pointers I was enabling. I recently reduced the number of attributes I needed, but forgot to change the number I was enabling.
I get why this should cause it to crash, but I'm more puzzled as to why this [B][I]doesn't [/I][/B] crash if I give it a few seconds.
I have an interpolated surface (geo data) and a scattered 3d poibt cloud. I need to check which of these points are under that surface and which are not so I can cut the ones above off.
Does anybody know a solution? Preferably Python or Matlab
Anybody have experience with Laravel? I just got assigned to a PHP 7.1 project at work and I'm having some basic issues. I haven't used PHP since 5.5 so there's probably a lot of new changes.
I'm just trying to instantiate a class that implements an interface. Pretty simple.
My class looks something like:
[code]
class UserRepository implements UserRepositoryContract
{
public function current() { }
public function find($id) { }
protected function loadUserRelationships($user) { }
public function search($query, $excludeUser = null) { }
public function create(array $data) { }
public function updateBillingAddress($user, array $data){ }
public function updateVatId($user, $vatId) { }
}
[/code]
The was I'm trying to use it is like so:
[code]
$user = new UserRepository().create($request);
[/code]
But I get the following error:
Cannot instantiate interface Laravel\Spark\Contracts\Repositories\UserRepository
I'm guessing this is a pretty simple answer, but there don't happen to be any simple, straight forward answers I got from googling. I know some people on here are proficient in PHP, so I'd thought i'd ask here.
OpenGL question:
I know different type of state changes are more expensive than others, but one thing I haven't been able to find an answer for is whether or not a repetitive state change is costly, like binding the same shader twice in a row? Will a state changing function incur the same cost if the state isn't actually changed?
For example, assuming we have a list of models that are SORTED by VAO, would this
for each (auto &model in m_models) {
glBindVertexArray( model.vao ); // called for each model, may be the same between adjacent entries in m_models
glDrawArrays( GL_TRIANGLES, 0 , model.tri_count );
}
be equivalent to this
for each ( auto &unique in m_unique_list ) {
glBindVertexArray( unique.vao ); // only called once for a list of models that use this VAO
for each ( auto &unique_model in unique_users ) {
glDrawArrays( GL_TRIANGLES, 0 , unique_model .tri_count );
}
}
Honestly hard to answer except for saying that it probably incurs a cost but a smaller cost than binding a new VAO. The thing about the OpenGL philosophy is that you levy the costs of doing checks/optimizations like this on the CPU since it is quicker then sending instructions to the GPU. That's why there is so little usage for querying things like vertex attributes (and instead we have things like layout = 0).
I looked at the spec and it is delightfully absentminded about the cost of rebinding the same VAO (10.3.1 on https://www.khronos.org/registry/OpenGL/specs/gl/glspec45.core.pdf).
I am trying to find an actual implementation but that may prove impossible, but I am almost certain there is no actual check done on the OS side and everything is delegated to the driver (which probably does some sanity check but it become a quality of implementation question then).
Best to just make as little calls as possible, it would be as fast as or faster than making more calls.
I need help figuring out why this command in Windows Batch scripts isn't working. I'm trying to get the output from a program to be set as a variable. The way I saw to do it was to save the program's output into a text file, then set a variable to take the contents of that file as input for a variable. Right now it looks like this:
someprogram > result.txt
set /p myVar=<result.txt
The thing is that when I try to use myVar, it's empty. I've tried having setlocal enableDelayedExpansion in the code and not having it in, with no difference. Anyone know what's wrong?
Anybody have a clue on how to vertically align the buttons on the webpage?
I'm thinking about giving up since whatever I try does not work, but I want the site to look nice for my mum. She is the owner you see there is no hurry but it's been like this for months and irks me every time I see it
so which WAYWO are we actually using
What exactly are you trying to do with this variable? Why not just pipe the contents?
Basically going to multiply it by 4/5 and use it as a parameter for another program. Thing is I can't even get the value back from the text file, let alone use it in a calculation.
Hmmm. Might have to build the top layer from the ground up. I am sure many of you were bewildered by this as much as I am so thank you anyway for taking a look
Guess I can only hope the new version looks better when I get it up and going
I have a piece of python using PyQt signals that suddenly doesn't work reliably. It literally only connects methods in my class to window signals when I run the debugger. If I run the program normally, the signals don't run the methods likely because the class' __init__() is not being run.
Why would a piece of my software only work when the debugger runs it?
Anyone know how I can get Yaw and Pitch in a 360 picture?
I am working with Pannellum and right now I want to get some Tours. Those require a "point" in the pictures defined by Yaw and Pitch. Is there any existing tools for this?
Hey everyone, I figured I'd try my chances here at getting some help in understanding why I am getting an error "Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1" on line 112. I have tried my luck on Google and Stackoverflow but I could not seem to find anything that helped explain why.
I'd like to note that I am not the original author of this script(Here), I have merely been trying to get it to work with my limited programming abilities, but I have now hit a brick wall. The only changes I have made are changing the int triangle_num and the file directories.
import java.io.*;
public class vtachange {
public static void main(String args[]) {
FileWriter fw = null;
BufferedWriter out = null;
int triangle_num = 22438 + 1;
try {
BufferedReader in = new BufferedReader(new FileReader("input.vta"));
BufferedReader in_smd = new BufferedReader(new FileReader("input_face.smd"));
fw = new FileWriter("D:\\Tools\\eclipse\\Workspace\\Test\\null.txt");
out = new BufferedWriter(fw);
String s;
int switchA = 1;
int switchB = 1;
int count_time = -1;
String count_time_N;
while (switchB == 1){
s = in.readLine();
if (s.contains("vertexanimation")){
switchB = 5;
}
}
while (switchA != 0){
s = in.readLine();
if (s != null){
if (s.contains("time")){
switchA = 5;
}
else {
switchA = 2;
}
}
else{
switchA = 0;
}
if (switchA == 5){
out.close();
count_time = count_time + 1;
count_time_N = Integer.toString(count_time);
out = new BufferedWriter(new FileWriter("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\" + count_time_N + ".txt"));
}
if (switchA == 2){
out.write(s); out.newLine();
}
}
out.close();
in.close();
File f = new File("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\null.txt");
f.delete();
switchB = 1;
while (switchB == 1){
s = in_smd.readLine();
if (s.contains("triangles")){
switchB = 5;
}
}
s = in_smd.readLine();
out = new BufferedWriter(new FileWriter("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\smd.txt"));
int divide_four = 0;
while (!s.contains("end")){
if ( (divide_four % 4) == 0 ){
}
else{
out.write(s); out.newLine();
}
s = in_smd.readLine();
divide_four++;
}
out.close();
divide_four = divide_four*3/4;
String[] smd_array = new String[divide_four];
in_smd = new BufferedReader(new FileReader("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\smd.txt"));
for(int i = 0 ; i < divide_four; i++){
s = in_smd.readLine();
s = s.substring(4,s.length());
smd_array[i] = s;
}
in_smd.close();
String[][] master_array = new String[count_time+1][triangle_num];
for(int i = 0; i < count_time+1; i++){
for(int j = 0 ; j < triangle_num; j++){
master_array[i][j]= null;
}}
int find_blank = 0;
String s_count;
for(int i = 0; i < count_time+1 ; i++){
in = new BufferedReader(new FileReader("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\" + Integer.toString(i) + ".txt"));
s = in.readLine();
while(s != null){
s = s.substring(4, s.length());
find_blank = s.indexOf(" ");
s_count = s.substring(0,find_blank);
s = s.substring(find_blank+1,s.length());
master_array[i][Integer.parseInt(s_count)] = s;
s = in.readLine();
}
in.close();
}
int[] match_array = new int[divide_four];
for (int i = 0; i < triangle_num; i++){
for (int j = 0; j < divide_four; j++){
if( smd_array[j].contains(master_array[0][i]) ){
match_array[j] = i;
}
}
}
BufferedWriter out_final = new BufferedWriter(new FileWriter("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\match\\match_final.txt"));
for (int j = 0 ; j < count_time+1; j ++){
out = new BufferedWriter(new FileWriter("D:\\Tools\\eclipse\\Workspace\\Test\\bin\\match\\match" + Integer.toString(j) + ".txt"));
out_final.write(" time " + Integer.toString(j) + " #"); out_final.newLine();
for (int i = 0; i < divide_four; i++){
if(master_array[j][match_array[i]] == null){
}
else{
out.write(" " + Integer.toString(i) + " " + master_array[j][match_array[i]]); out.newLine();
out_final.write(" " + Integer.toString(i) + " " + master_array[j][match_array[i]]); out_final.newLine();
}
}
out.close();
}
out_final.write("end"); out_final.newLine();
out_final.close();
} catch (IOException e) {
System.err.println(e);
System.exit(1);
}
finally{
if(out != null) try{out.close();}catch(IOException e){}
if(fw != null) try{fw.close();}catch(IOException e){}
}
}
}
You do a check if the string is null but you don't check to see if the string is long enough to substring it starting at the index of 4. As the exception name implies, the index is out of bounds.
Yep, that solved the problem. Unfortunately, it exposed a NullPointerException w/ "java.lang.String.contains(Unknown Source)" just below it at the smd_array. I don't quite understand where it is getting a null value from tho, as best I can all arrays are initialized. Do I need a null check somewhere?
}
int[] match_array = new int[divide_four];
for (int i = 0; i < triangle_num; i++){
for (int j = 0; j < divide_four; j++){
if( smd_array[j].contains(master_array[0][i]) ){
match_array[j] = i;
}
I think you're overthinking it if you need a tool or whatever. Yaw is an angle and so is pitch, which means they are going to be from 0-360 degrees (or 0 to 2pi), same goes for pitch.
If you have a rectangular panoramic projection ie: this 600x325 pixel image:
http://www.canadiannaturephotographer.com/sphericalpanoramas/_MG_8803-Panorama.jpg
Yaw is going to be in this range (0, 360) and it's going to be the pixels from (0, 600).
Pitch is also going to be in the same range (0,360) and it's going to be the y axis though, so (0,325).
I hope this helps.
So I'm taking the final Computer Science course in my university, and the main thing for that course is to create our program from scratch in any language we want, BUT the program must be Object Oriented and have roughly 5,000 lines of personally-written code.
Unfortunately I can't come up with an idea that I'm interested in or motivated to do. I was going to make a game in Unreal Engine 4, but that would be too hard to pull off successfully in 4 months with all my other courses.
The only idea I can come up with is to make some sort of automation program, but I have no idea what to automate.
I do get the math on how to do it. The problem is that I have around 15 images which each have around 3-4 hotspots. So I need a tool in which I can quickly identify a spot on the image as yaw and pitch.
Wow, I have to express my feelings on how dumb that requirement is. It's not about # of lines. It's about how powerful those lines are.
I agree, the only thing about it that I'm alright with is that the professor grades the program heavily on it's complexity, so if I came up with a simple program and somehow managed to get the line limit, I'd get a horrible grade on the rest of the project, no matter how well it runs.
Make a calculator loaded with switch cases and pad it complexity wise by doing bitshifting operations
This doesn't need a thread so I'll put it here.
I'm studying at university and this term, we have C# coding. While I managed just fine to learn Java first year at uni, C# is giving me issues. Reason is that the lecturer we had in Java organized the class better with lots of practical classes to help us learn how to code and understand the code. He handed out tasks and instructions on things we had to code that got increasingly difficult and it was great.
The C# lecturer is not so good. He explains stuff very poorly. The practical classes are not good. You just go there and ask one out of two people (who look after the entire class of 100-something students) for help when you need it. No real instructions and such. I get the basics of writing code, stuff like creating classes and instances of classes, loops of different kinds, making lists and arrays, etc, but some things in C#, I don't understand.
I have two different sets of code, which are old written exams from 2016 and 2017 that I got from the university intranet, that summarize what we have to learn from the C# course. If some C# expert would kindly take time to thoroughly explain the code, what it does, how it does it and why and what is written out in the console when you run it, I'd be eternally grateful and I'll gift you a 25€ Steam gift card as a way of saying thanks for your time.
Well, where's the code?
Sorry, you need to Log In to post a reply to this thread.