19 questions
0
votes
1
answer
414
views
Is there a way to generate a bigquery query on the fly or Dynamically, based on an list of criteria for the where condition?
I'm Trying to generate a query in big query dynamically based on different conditions in the "Where" condition of the query.
so for instance if I receive a list of columns and their ...
0
votes
1
answer
239
views
stabilityai/stable-cascade takes 7+ hours to generate an image
I am using this model: https://huggingface.co/stabilityai/stable-cascade
from diffusers import StableCascadeCombinedPipeline
print("LOADING MODEL")
pipe = StableCascadeCombinedPipeline....
0
votes
0
answers
113
views
How can I make GCC Assert a Compile Time Error when an array of constant structs has a single uninitialized element?
I want to generate asserts at compile time, checking whether each element within a struct is initialized or not. I was wondering how I could generate a for loop of such static assert statements at ...
0
votes
2
answers
99
views
How to write CPP template functions that is recursive on argument array length
Say I want to write a function arrfill<N> that fills an array of length N. Below is the template implementation I tried.
template<typename T>
bool arrfill(T arr[0], T v){;}
template<...
1
vote
1
answer
2k
views
Javascript P5, drawing a grid on a canvas
I'm carrying out a P5 assignment for college and struggling to understand some code I found online. I've included a screenshot of the output of the code and the actual code below. I understand the ...
0
votes
0
answers
305
views
How to start a generative portrait in p5.js
I need help with a code I'm working on for a project.
What I need it to do is show the users the picture one by one and memorize the time spent on each. At the end it should open the webcam and ...
20
votes
3
answers
4k
views
Implementing variadic type traits
Intro
I'm looking for a pattern to convert C++ type traits into their variadic counterparts. A methodology to approach the problem would be appreciated and generative programming patterns to automate ...
1
vote
1
answer
349
views
Auto-generate methods for subclasses
I have a few dozen classes. Here are two of them:
class Class_A(ClassABC):
def __init__(self):
super().__init__()
def from_B(self, b):
#do stuff
def from_C(self, c):
...
17
votes
1
answer
8k
views
Visual Studio T4 vs CodeSmith
I've been using CodeSmith for the past 2 years and love what it does for me. However, I also know about T4 which is built in to Visual Studio and can do some pretty cool stuff too. Based on ...
18
votes
7
answers
7k
views
Are there any Parsing Expression Grammar (PEG) libraries for Javascript or PHP?
I find myself drawn to the Parsing Expression Grammar formalism for describing domain specific languages, but so far the implementation code I've found has been written in languages like Java and ...