I'm stuck learning fsharp so I can add a block to a file that nobody else at the company knows how to write or maintain.
This is hell.
I'd say it's hellish for a dozen hours, then it clicks and everything seems smooth (well, assuming it's as close as OCaml as I think it is, I can't install Xamarin T_T )I'm stuck learning fsharp so I can add a block to a file that nobody else at the company knows how to write or maintain.
This is hell.
Switch jobs with meI'm stuck learning fsharp so I can add a block to a file that nobody else at the company knows how to write or maintain.
This is hell.
Nearly instant if you're in the same familyHow hard is it to learn a functional language once you've already learned at least one functional language previously? Is it like learning a new imperative language where you already grok the most important fundamentals and it's pretty easy to pick up a new one?
That's fun... Got Id, Reflexive, Counter and Peano right currently.
We'll need more information, I think, but I suppose there could be.i'm dabbling into 3d (voxels actually) and i don't understand indices (of vertices). I googled but everything i found is too technical/advanced for my level of incompetence:
i have a square face that is made of two triangular meshes; so a total of 6 vertices for the face. But two couples of these vertices share the same coordinates, since the two triangles are joined.. Do these vertices with the equal coordinates, have the same index (meaning that, in practice, there are 4 indices -or "index values"- per face)?
(0,1,0) _____ (1,1,0)
|\ |
| \ |
| \ |
| \ |
|____\|
(0,0,0) (1,0,0)
It's more likely that I don't know what I'm talking about!Also, where are the voxels? Or haven't I understood anything you're talking about??
int numOfIndices = CHUNK_SIZE_X * CHUNK_SIZE_Y * CHUNK_SIZE_Z * 6 * 6 / 3;
short[] indices = new short[numOfIndices];
short j = 0;
for (i = 0; i < numOfIndices; i += 6, j += 4) {
indices[i + 0] = (short)(j + 0);
indices[i + 1] = (short)(j + 1);
indices[i + 2] = (short)(j + 2);
indices[i + 3] = (short)(j + 2); // notice this index value is reused
indices[i + 4] = (short)(j + 3);
indices[i + 5] = (short)(j + 0); // notices this index values is reused
}
this.meshes = new Mesh[chunksX * chunksY * chunksZ];
for (i = 0; i < meshes.length; i++) {
meshes[i] = new Mesh(
true,
CHUNK_SIZE_X * CHUNK_SIZE_Y * CHUNK_SIZE_Z * 6 * 4,
CHUNK_SIZE_X * CHUNK_SIZE_Y * CHUNK_SIZE_Z * 36 / 3,
VertexAttribute.Position(),
VertexAttribute.Normal()
);
meshes[i].setIndices(indices);
}
Yes, that's it...It's more likely that I don't know what I'm talking about!
Anyway I think you answered my question:
here it computes the indices of the faces, 6 in total, but they get only 4 values because two are reused
https://alf.nu/ReturnTrue
goddamn. how do you guys do it. I got 2 right
edit: got 3, damnnnn
edit: 4
I've got the first 7 so far. This is fun.
voxels are just 3d bitmaps, they aren't very complicated at all. A bitmap is just an array storing some data(color if we are talking about images) and some information about its dimensions, so in 2d you have width and height and in 3d you have depth as well. Unlike triangles though since voxels is a data structure there's no notion of what they look like in terms of graphics. Most applications render them as cubes(but you could use whatever you want) and to do that you need to generate the geometry which I guess is what you are looking at.i'm dabbling into 3d (voxels actually) and i don't understand indices (of vertices). I googled but everything i found is too technical/advanced for my level of incompetence:
The second one exists in many (most?) languages since it's part of IEEE.Am I missing something? I cannot even complete the second one...
Am I missing something? I cannot even complete the second one...
More of a test if your knowledge of Javascript edge cases/rules.NaN never is equal to anything
This rule is pretty much universal, since it's in IEEEMore of a test if your knowledge of Javascript edge cases/rules.NaN never is equal to anything
This rule is pretty much universal, since it's in IEEE.754
Is the transitivity exception one a javascript oddity?
Saw it immediately, but I still don't have a clue. Again, I'm a JS newbie, I don't know all null / 0 / "" / undefined / etc. comparison results, and I suspect that's one of those cases...Yes. Note the lack of strict equality.
Did 14, although I wasn't aware thatI did counter in 50 then I saw some of the other scores...
Down to 16 with a little cheating thanks to spoilers.
Was my first try, then I tried to reduce the variable declaration... Especially when getting rid of it means getting rid of return, too.()=>{var a=0;return()=>++a}
No idea about the others. Anyway I think the test is bullshit because you should avoid all those situations.
Yeah I could shave one off too with that but I have no idea why it works or where I can read up on it despite having gone over ES2015 multiple times.Did 14, although I wasn't aware thatso that would make 13._ could replace ()
Did 14, although I wasn't aware thatso that would make 13._ could replace ()
Can't really see how you can do less, but I have a lot to learn in JS. But the 1-character solution makes me wondering.
Yeah I could shave one off too with that but I have no idea why it works or where I can read up on it despite having gone over ES2015 multiple times.
This is my comprehensible solution for counter.
(x=1)=>()=>x++%4
How did you shave a point off of that? I think I can shorten the first argument but it's unclear how.
Hint : a is not b.How did you shave a point off of that? I think I can shorten the first argument but it's unclear how.
This one is more generic, supporting multiple languages for the same questions: https://www.codewars.comI LOVE code golf. If there's any interesting ressources for Python, I'm interested.
This one is more generic, supporting multiple languages for the same questions: https://www.codewars.com
I know this one... Codingame, too. And a bunch of problems collections like Euler Project to Advent of Code. (We should actually do a list)
But I was specifically talking about code golf, where length of solution matter. Codingame did this at a time, but I think they removed it...
I think I discovered it here, in fact
That's proper ECMS? I used pow :/Lol I had to update to chrome 52 to do peano in 7:2**53-1
BecauseCan someone tell me why that works but not:2e53-1
I'm also curious...Also how are people reaching 6 and 5?
Experimental ES6 feature!That's proper ECMS? I used pow :/
I don't know JS but I was able to get the questions because of this joke video
https://www.destroyallsoftware.com/talks/wat
I don't even know what I'm looking at ^_^Experimental ES6 feature!
proto1 is the first question I answered almost instantly, but 19 isn't very good. I'm wondering where the 16 score people are saving chars.
let's see the codeQuick question.
I defined two methods in Java, methodA(List<T> listA, List<T> listB) and methodB(T item, List<T> list). I then try to call the first method by passing two List<Integer>. However, when I try to compile, it complains about ambiguity.
What can I do to solve that?
let's see the code
import java.util.*;
public class HelloWorld{
public static <T> List<T> methodA(List<T> list1, List<T> list2){
List<T> result = new ArrayList<T>();
System.out.println("A");
return result;
}
public static <T> List<T> methodA(T element, List<T> list){
List<T> result = new ArrayList<T>();
System.out.println("B");
return result;
}
public static void main(String []args){
List<Integer> a = methodA(Arrays.asList(1, 2), Arrays.asList(1, 2, 3));
}
}
There's not much more to that.
Code:import java.util.*; public class HelloWorld{ public static <T> List<T> methodA(List<T> list1, List<T> list2){ List<T> result = new ArrayList<T>(); System.out.println("A"); return result; } public static <T> List<T> methodB(T element, List<T> list){ List<T> result = new ArrayList<T>(); System.out.println("B"); return result; } public static void main(String []args){ List<Integer> a = methodA(Arrays.asList(1, 2), Arrays.asList(1, 2, 3)); } }
That code works fine for me.
What I find odd is that you're not even invoking methodB at all. So it seems completely irrelevant to your question.
HelloWorld.java:18: error: reference to methodA is ambiguous
List<Integer> a = methodA(Arrays.asList(1, 2), Arrays.asList(1, 2, 3));
^
both method <T#1>methodA(List<T#1>,List<T#1>) in HelloWorld and method <T#2>methodA(T#2,List<T#2>) in HelloWorld match
where T#1,T#2 are type-variables:
T#1 extends Object declared in method <T#1>methodA(List<T#1>,List<T#1>)
T#2 extends Object declared in method <T#2>methodA(T#2,List<T#2>)
1 error
Works for me.There's not much more to that.
Ops sorry, checked here again, both method are called methodA. My bad. Will update the code.
The compiler error this:
Code:HelloWorld.java:18: error: reference to methodA is ambiguous List<Integer> a = methodA(Arrays.asList(1, 2), Arrays.asList(1, 2, 3)); ^ both method <T#1>methodA(List<T#1>,List<T#1>) in HelloWorld and method <T#2>methodA(T#2,List<T#2>) in HelloWorld match where T#1,T#2 are type-variables: T#1 extends Object declared in method <T#1>methodA(List<T#1>,List<T#1>) T#2 extends Object declared in method <T#2>methodA(T#2,List<T#2>) 1 error
public static void main(String[] args) {
List<Integer> a = methodA(Arrays.asList(1, 2, 3), Arrays.asList(1, 2, 3), Integer.class);
}
public static <T> List<T> methodA(List<T> list1, List<T> list2, Class<T> clazz) {
List<T> result = new ArrayList<T>();
System.out.println("A");
return result;
}
public static <T> List<T> methodA(T element, List<T> list, Class<T> clazz) {
List<T> result = new ArrayList<T>();
System.out.println("B");
return result;
}
Only way I can think to get rid of the ambiguity is to add a third parameter to each call of Class<T> clazz.
List<Integer> a = methodA<Integer>(Arrays.asList(1, 2, 3), Arrays.asList(1, 2, 3));
Just specify it explicitly?
Code:List<Integer> a = methodA<Integer>(Arrays.asList(1, 2, 3), Arrays.asList(1, 2, 3));
List<Integer> a = HelloWorld.<Integer>methodA(Arrays.asList(1, 2, 3), Arrays.asList(1, 2, 3));
s = "T" + Left(CStr(ws.Cells(1, i)), 4) + "." + Right(CStr(ws.Cells(1, i)), 2)
ws.Cells(1, i).Value = s