Precompiled Headers with Variables in Visual Studio

I'm working on a project with very large 2D vectors which store images. The compilation for this, obviously, takes forever. One image is around 500kb in text. So, I thought I'd use precompiled headers in Visual Studio 2022 to get the compilation time faster.

Sprites.cpp

#include "Sprites.h"

Sprites.h

#pragma once
#include <vector>

namespace Sprites {
#include "Sprites/spr1.hpp"
#include "Sprites/spr2.hpp"
#include ...
}; // namespace Sprites

The sprite files go like this:

std::vector<std::vector<unsigned int>> spr1 = {{0xffffff, 0xf...

win32Platform.cpp (my main file)

#include "Sprites.h"

#include <windows.h>
#include <string>
...

When I try to build this, however, I get this error.

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2005	"class std::vector<class std::vector<unsigned int,class std::allocator<unsigned int> >,class std::allocator<class std::vector<unsigned int,class std::allocator<unsigned int> > > > Sprites::spr1" (?TrashBag@Sprites@@3V?$vector@V?$vector@IV?$allocator@I@std@@@std@@V?$allocator@V?$vector@IV?$allocator@I@std@@@std@@@2@@std@@A) already defined in win32Platform.obj		C:\Users\[username]\source\repos\[project name]\[project name]\Sprites.obj	1	

I think I know why this happens, the reason being I include ```Sprites.h``` twice in the project. If this were only a header file, like <vector> it wouldn't cause a problem but since these are variables I can't redefine them. But if I can't do that, how am I supposed to reduce compilation time.

PS- I know I can use an image library and read from the image files, but if I wanted to precompile this, how would I go about doing that?

πŸ‘︎ 6
πŸ’¬︎
πŸ“…︎ Nov 05 2021
🚨︎ report
Waves (and/or particles) produce pretty patterns. Here I am controlling a GLSL shader file by manipulating specific variables of two wave sources #mathematics #Python #coding #diyproject #raspberrypi #opensource #glslshader #glslviewer @patriciogonzalezvivo #visuals v.redd.it/wh1b2lwjrsy71
πŸ‘︎ 35
πŸ’¬︎
πŸ‘€︎ u/ErikOostveen
πŸ“…︎ Nov 10 2021
🚨︎ report
Change Power BI Visual Titles Dynamically using DAX Variables and Conditional Formatting youtube.com/watch?v=mSarc…
πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Dec 10 2021
🚨︎ report
Extron GCP Visual Feedback Based on Variable

Hi all,

As title, should this be possible for a button? I can get text feedback to work but not visual, dragging it over does nothing. Other conditions are able to be dragged.

Is this a bug? Can anyone recreate?

Thanks in advance

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/JamieEC
πŸ“…︎ Oct 01 2021
🚨︎ report
I saw a nice visual description of variable pitch propellers at work today on one of our Q400s during routine maintenance. The left prop is in disc setting while the one on the right is normal setting.
πŸ‘︎ 130
πŸ’¬︎
πŸ‘€︎ u/oodlesofnoodle1
πŸ“…︎ Mar 24 2021
🚨︎ report
OneDark Pro and Visual Studio variable highlight for Python

I'm having an issue regarding Visual Studio Code OneDark Pro theme. I would like to change the color of variables (only variables I declare, not method calls, etc. but when I try to do this using

"editor.tokenColorCustomizations": { 
    "textMateRules": [
                        { "scope": "source.python", 
                            "settings": { 
                            "foreground": "#E06C75" 
                            } 
                        } 
    ] 
} 

I get this (I wrote a code sample to illustrate what is happening):

https://preview.redd.it/ogzoe5i5rkf71.png?width=319&format=png&auto=webp&s=682e6d45ae1e547285e36e3b99db82dbd3e1a4a5

As you can see, colons are in red, every variables even the "for i in..." and the full "os.system.getcwd()" are in red.

https://preview.redd.it/yqb1xv7irkf71.png?width=299&format=png&auto=webp&s=7ac92687d0c64a671b66fa31d8fc02b54bdd2d05

By default, here is what I have (above). The thing is that I want the variable

I only want the variables I declare to be in red. How can I do that ? Thank you in advance!

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Roux55
πŸ“…︎ Aug 05 2021
🚨︎ report
$VISUAL vs. $EDITOR shell variable – what is the difference? bash.cyberciti.biz/guide/…
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/nixcraft
πŸ“…︎ Jul 10 2021
🚨︎ report
STAR WARSβ„’: Squadrons - 3.0 Release Notes (120fps mode on Xbox Series S/X, new 4K visual or performance modes on Xbox Series S/X, variable frame rate support on Xbox Series S/X ) ea.com/games/starwars/squ…
πŸ‘︎ 199
πŸ’¬︎
πŸ‘€︎ u/F0REM4N
πŸ“…︎ Nov 26 2020
🚨︎ report
i created a sorting algorithm visual that can compare the speed and efficiency of different algorithms on variable-length lists in python v.redd.it/b9fi1f1nlic51
πŸ‘︎ 2k
πŸ’¬︎
πŸ‘€︎ u/jsuddret
πŸ“…︎ Jul 23 2020
🚨︎ report
How come visual studio can't display the name of the variable responsible for a null reference exception?

I'm getting so frustrated by this problem, which feels like an old inefficiency from the 90s, but tbh I have little to no idea how things behind the curtain work, so here I am asking you guys.

Today I worked with Automapper and got instantly furstrated when it wasn't able to tell me which property it wasn't able to map (list -> string / string -> list but it just indicated the types which it was unable to map, not the property name fml).

Now I'm sitting in front of my computer, due to another bug, completely unmotivated, trying to figure out why Visual Studio can't show me which variable was NULL. I'm in the midst of implementing a new API and trying out to work out OData, and that shit just fails when I make GET request without telling me what exactly is null. Why is this still a thing? Can it be improved upon? I just want to know which variable was NULL or which function returned NULL, I wanna know where the problem happened. Shouldn't this be something the compiler knows? Like, it's literally the reason it stopps, and it it such an infamous problem everybody has. I'm just like, man, really frustrated by this shit. I can't wait for the days where better solutions will by standard for developers.

πŸ‘︎ 30
πŸ’¬︎
πŸ“…︎ Oct 21 2020
🚨︎ report
Why can't use a variable to declare an array's size in visual studio 2019 but not in dev c?

Error C2057 expected constant expression

https://ibb.co/x33kP1T

the file is .c already

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/JacksonSteel
πŸ“…︎ Jan 18 2021
🚨︎ report
Scatter Chart doesn't allow for Regression Line *and* Variable Bubble Size together. Any scatter plot visuals that do?

In the stock Scatter Plot visual, you can have a regression line, or variable bubble size, but not both.

I went through all the scatter plot visuals in Appsource, and couldn't find any that offered both. Most don't even have regression lines, and ones that doo (i.e. Craydec Regression Chart), don't have variable bubble sizes.

Anyone aware of any way to display a regression line, and bubble size? Without going crazy and having 2 charts on top of each other.

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/cdigioia
πŸ“…︎ Mar 28 2021
🚨︎ report
org-variable-pitch and visual-line-mode questions

I'm using a package 'org-variable-pitch'. I probably don't understand how things are supposed to work, but in order to get variable pitch in the body sections (i.e., stuff that's not a heading or a drawer etc.) you have to setup variable pitch for everything, and then turn it off for everything except the body sections. Why not define a face for those body sections, and set that to variable and leave everything else alone? Why does org define faces for everything except this body text?

Also... I'm trying to use visual-line-mode with these variable-pitch sections. However, when it wraps, it wraps to the start of the new line, instead of to the indent level of the first line. Is there a setting that controls this?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/pixpop
πŸ“…︎ May 11 2021
🚨︎ report
Visual Studio Code: is the Python variable explorer available only for Jupyter notebooks? Can it be enabled for non-notebook scripts?

I am used to Spyder but wanted to try Visual Studio Code 1.51.1 with my Anaconda setup on Windows.

I see that VSC can run my Python scripts, so it recognises the Anaconda installation etc.

However, I can't find the variable explorer. Where is it / how do I enable it?

I have been able to find some settings on variable explorer only for Jupyter notebooks; does this mean the variable explorer is available only when using notebooks and not when running scripts outside of a notebook?

I have found documentation on the variable explorer in the context of notebooks, but nothing outside of notebooks, e.g.

https://devblogs.microsoft.com/python/python-in-visual-studio-code-april-2019-release/

πŸ‘︎ 21
πŸ’¬︎
πŸ‘€︎ u/MonthyPythonista
πŸ“…︎ Nov 23 2020
🚨︎ report
Just realized the bookended visual symmetry of S05E03 Jughead showing "Ellie" pointing a gun at Daniel's face at the end of the teaser right before the opening LOST theme, then S05E14 The Variable ending with Eloise shooting him in the back right before the show's closing LOST title card. Cool.
πŸ‘︎ 20
πŸ’¬︎
πŸ“…︎ Dec 09 2020
🚨︎ report
How to give each string in an array its own "Name Window" variable, for RPG/Visual Novel-like dialogue?

I followed HeartBeast's dialogue tutorial and I have been successful in getting the dialogue to work. However, I have no idea how to get a name window to appear for each "page", or string, in the array.

For example, imagine the var dialogue is like this:

var dialogue = ["Hey there.", "What's up?"]

How would I get dialogue[0] to have the name "Emilia" (she being the one speaking, and her name would appear in the name window above the dialogue window), and dialogue[1] to have "Robert"? Like this:

var dialogue = ["[Emilia] Hey there.", "[Robert] What's up?"]

For reference, here's my dialogue script.

extends RichTextLabel

var dialogue = [""]
var page = 0
var timer_length = 5
var dia_timer = 0

func _ready():
	set_bbcode(dialogue[page])
	set_visible_characters(0)
	set_process_input(true)

func _physics_process(delta):
	if dia_timer &gt; 0:
		dia_timer -= 1
	if dia_timer == 0:
		set_visible_characters(get_visible_characters() + 1)
		dia_timer = timer_length

func _input(event):
	if Input.is_action_just_pressed("ui_accept"):
		if get_visible_characters() &gt; get_total_character_count():
			if page &lt; dialogue.size() - 1:
				page += 1
				set_bbcode(dialogue[page])
				set_visible_characters(0)
			else:
				page = 0
				set_bbcode(dialogue[page])
				set_visible_characters(0)
		else:
			set_visible_characters(get_total_character_count())

Then each NPC has its own RichTextLabel, of which its script extends from the main dialogue script above.

Below is the script for the NPC's dialogue (with the dialogue omitted and replaced with generic dialogue). I would love to have the "Hi" and "How are you" have the NPC's name, and for "I'm doing fine" to have the player's name.

extends "res://dialogue.gd"

onready var dia_window = get_parent()

func talking():
	dialogue = ["Hi!", 
                    "How are you?",
                    "I'm doing fine."]

func _input(event):
	if Input.is_action_just_pressed("ui_accept"):
		if get_visible_characters() &gt; get_total_character_count():
			if page &lt; dialogue.size() - 1:
				dia_window.show()
			else:
				dia_window.hide()
		else:
			set_visible_characters(get_total_character_count())

Thank you so much for any help!

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Romanticist_20
πŸ“…︎ Dec 09 2020
🚨︎ report
Passing a variable to powerpoint vba from visual basic

Hi all. I am coding an application in VB.net and I am trying to get the application to launch a powerpoint file and dynamically populate the slides with predefined content based on a certain variable's value.

My issue is I am not sure how to pass the variable to the VBA in powerpoint. Can anyone assist me? I am coding in Visual Studio, but quite new to it.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/ryanblumenow
πŸ“…︎ Feb 11 2021
🚨︎ report
I can't add script categories or groups for the editor's export variables in Visual Script

The preview of my script setup.

According to the official docs, I should be able to add the script categories for the export variables with this example code:

func _get_property_list(): 
    var properties = []
    properties.append(
        { 
            name = "Debug",
            type = TYPE_NIL,
            usage = PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_SCRIPT_VARIABLE
        }
    )
    return properties

and the script groups with this example code:

func _get_property_list(): 
    var properties = []
    properties.append(
        {
            name = "Rotate",
            type = TYPE_NIL,
            hint_string = "rotate_",
            usage = PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SCRIPT_VARIABLE
        }
    )
    return properties

However, it doesn't seem to work for me. No matter what I tried, no category or group showed up in the inspector tab at all.

Here is my reproduction project file.

I'm not sure whether this is a bug. Sometimes, I got this error and I can't add any node to the Visual Script's editor at all unless I restart the engine:

The error I got sometimes. I have to restart the engine.

I can report a bug but I want to make sure first that it's not my fault. I am rather new to Godot. Please help. Thanks.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/3cue
πŸ“…︎ Dec 06 2020
🚨︎ report
So yeah... it took a LONG time to make it work. It's a visual intuition for vector sum. With variable inputs. The tips of the arrows gave me sum trouble to draw but I figured em out heh.
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/mago_dos_mestres
πŸ“…︎ Oct 04 2020
🚨︎ report
Visual studio doesn't recognize I want to write an integer variable

Edit:solved

Just started learning, I'm following some videos on YouTube, so I'll try my best to explain what is going on.

On the tutorials I'm watching, the guy writes for example "string" it starts as light blue, then it turns dark blue, and it becomes "usable" (for the lack of a better word), he writes "int", and again it starts light blue and as soon as he hits space it turns dark blue and works.

If I use string it works normally and in the same way, but when I write "int" it never becomes dark blue and gets a red dash bellow as if I was misspelling it, I know capitalisation matters and all that, if I look for the options visual studio gives me to autocomplete, it shows me Int16, Int32 and Int64, all with capital letters, and int us just not an option.

Does anyone knows what's going on?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/julamad
πŸ“…︎ Sep 13 2020
🚨︎ report
Creating a visual for data with three variables

Hey everyone!

So I've been trying to make a chart the easily captures three variables. Below is some sample data.

Sales Threshold Total Sales Count of Customers
$20,000+ $63,000 3
$10,000-$19,999 $22,000 2
$5,000-$9,999 $20,000 3
$1,000-$4,999 $22,000 10

So the way to read this chart is your "Sales threshold" is the purchases that exceed a certain value, so for example if Customer A bought $21,000 worth of product they belong in the $20,000+ threshold.

"Total Sales" is the sum of sales that exceed the threshold requirement. For example, if 3 Customers purchased $21,000 worth of product then the "Total Sales would be $63,000.

"Count of Customer" represents the number of customers that meet the sales threshold.

I'm trying to create a visual that captures the impact the number of customers has on the total sales here. To demonstrate, I want to be able to show in a visualization chart that 3 Customers make up about 50% of the sales and they all belong in a $20,000+ threshold. I also need to be able to show that 10 out 18 customers make up only about 17% of the sales and they belong in the $1000-$4,999 bucket. I may have to make more than one chart but I'm looking for the cleanest way to be able to illustrate both points.

Any suggestions y'all may have would be greatly appreciated.

πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ Sep 23 2020
🚨︎ report
I'd like to share my PowerShell script to run CI/CLI builds with properly configured Visual Studio environment variables, it uses vswhere.exe and VsDevCmd.bat gist.github.com/noseratio…
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/noseratio
πŸ“…︎ Sep 28 2020
🚨︎ report
A visual explanation of independence of random variables.
πŸ‘︎ 13
πŸ’¬︎
πŸ‘€︎ u/shmakn
πŸ“…︎ Jun 18 2020
🚨︎ report
Visual Studio 2019 - Linux C WSL - Environment Variable /r/VisualStudio/comments/…
πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/its_isler
πŸ“…︎ May 07 2020
🚨︎ report
An ability to search for a function and a variable in Visual Script by double-clicking at their name in the members' window.

Today, I opened a proposal regarding the ability to search for a function and a variable in Visual Script at the godot-proposals Github.

Here is my proposal #1780.

https://preview.redd.it/p64g8df4jhx51.png?width=1920&format=png&auto=webp&s=14d6bf9bfc6fe7a440c968a7a7b6ec0fd7dabb54

Basically, it's the same text searching ability (ctrl+f) that you had in GDScript which you could use it to search for functions or variables. However, this is for Visual Script.

IMO, this is a very important feature that is currently missing. For anyone who's interesting or thinking that Godot should have this feature, you can show your interest in my proposal #1780.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/3cue
πŸ“…︎ Nov 05 2020
🚨︎ report
Is there a Visual Studio Code Angular extension that links models and variables to the template?

For example when I need to rename a variable in the TypeScript code I can use rename symbol. I wonder if there's an extension that also renames it in the template.

thx & Happy New Year Eve!

πŸ‘︎ 19
πŸ’¬︎
πŸ‘€︎ u/adammendoza
πŸ“…︎ Dec 30 2019
🚨︎ report
Working on a Crystal hack with variable trainer parties so I decided to make a visual tool to help me
πŸ‘︎ 181
πŸ’¬︎
πŸ‘€︎ u/Rouge_means_red
πŸ“…︎ Jun 03 2019
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.