c – system ("clear") is not working properly

Hello, I'm creating a C code that will allow me to retrieve information about products sold in a store on a given day.
If the user enters an invalid category option, the code clears the screen and requests the information again.

This is the code:

#include  // standard input-output
#include 
#include 

void initial_ message () {

printf (" t  tExercise 4  n");
printf (" n");
// To gather information
printf ("The products belong to three categories:  n");
printf ("Category A: 20,000 and 80,000  n");
printf ("Category B: 8,000 and 50,000  n");
printf ("Category C: 100,000 and 200,000  n");

printf ("Note: To enter the category, you must select uppercase letters.  n");
printf ("Example: A, B, or C.");
printf (" n");
printf ("Do not use periods or commas to enter the value of the article.  n");
printf ("Example: If you want to enter 100,000 pesos, enter: 100000");
printf (" n");
}
int main () {

int amount_sold = 0;

initial_message ();

// Retrieve the quantity of products sold
printf ("Enter the number of products sold on the day:");
scanf ("% i", & Quantity_sold);
printf (" n");

// create arrays to store values
// 1 name
Character name[cantidad_vendida][100];
char name;

// 2. Product ID
char product_id[cantidad_vendida][100];

// 3rd product category
char category_product[cantidad_vendida];
Character category;

// 4th value of the product
// int product value[cantidad_vendida];
// float value = 0.0;

// get the name of the product
for (int i = 0; i <Quantity_Sold; i ++) {
printf (" n");
// Get the name of the product
printf ("Enter the name of the product% i:", i + 1);
scanf ("% s", & names[i]);

// Get the product ID
printf ("Enter product ID% i:", i + 1);
scanf ("% s", & id_product[i]);

// Get the product category
// getchar ();
Bool Verification = false;
while (check == false) {
printf ("Enter the product category% i:", i + 1);
scanf ("% c", & category);
getchar ();
if ((category == A A)) || (category == B B)) || (category == & C))) {
Verification = true;
} else {
system ("clear"); // Use clear because cls is not portable
initial_message ();
printf (" n");
printf ("You did not enter a correct category.  n");
}
}
category_product[i]= Category;
}

// PRINT ALL INFORMATION
for (int i = 0; i <Quantity_Sold; i ++) {
printf ("ELEMENT% i  n", i + 1);
printf ("name:% s  n", name[i]);
printf ("id:% s  n", product_id[i]);
printf ("Category:% c  n", category_product[i]);
}

return 0;
}

If the person does not enter a correct option, clean the screen and reprint the original message. For some reason, however, there is still a line of text at the top of the screen, and I can not understand why, because this line had to be deleted after that system ("clear") and before you are prompted to re-enter a correct option …

See the first line:

See the first line

Thanks in advance!

Driver – Nvidia Quadro 1000M is not working properly

I have Dell Precision M4600 with Nvidia Quadro 1000M. Most desktop apps that use GPU rendering do not work well with me, such as: Slack, Steam or some apps that use the modern Electron platform (I see a blank or transparent window). For them I use settings or flags to use CPU or integrated card instead of GPU, but for some other apps (3D rendering or games) I have no workarounds instead of using integrated card.

I'm not sure exactly when this issue occurred, but it seems to be a Windows update, a BIOS update, or a GPU driver update. But I could not figure out how to recover a working GPU with different Win10 versions and different GPU drivers, and I'm too scared to downgrade the BIOS.

An attempt was made to contact Nvidia support, but they can not say anything other than "Try this driver, try another one". I've tried installing different versions of 412.36, 416.78, 425.51 (through support suggestions), but everyone has told me that my system is not compatible. The latest driver I can at least install is 377.55, but what's interesting, I can not access the IRQ section in the system configuration (cmd> msinfo32) if I have this driver installed. The window only crashes.

I also tried running safe mode to test how Steam works. It works fine with the "Enable GPU Rendering" option, but I'm not sure how to tell if it's not an integrated card.

Is there a common solution or at least an explanation for this problem? Every help is appreciated.

Hardware SVG image does not render properly on some screens

When rendering an SVG image in Chrome on an Acer computer with AMD processor, a strange problem occurs. We have an SVG image that will display correctly on most laptop screens.Enter image description here

For Acer (with AMD processor), the SVG file is rendered in green over the attached image.

Has anyone faced this kind of problem? Hints or solutions are much appreciated.

PHP meta tags do not work properly in Yii2.0

I'm worried about the routing of my website. All of my SEO meta-elements are implemented through the Metadata section in my CMS. One of the most important entries named after page routing works properly. I will create meta tags for a specific page. Once I insert the desired link as input into the "Page Routing" entry to implement these meta tags, it will not work anymore. For example, consider the following hierarchy to indicate the exact problem.

Home -> Course -> Course 1 -> Topic 1, Topic 2, … ->

If I choose topic 1 and want to create metas for it, the last tags for the course section will be implemented! In other words, the internal links in the course section of my website do not accept tags.

I am new to programming and could not find who would solve this problem.

Part of my layout looks like this:

<link rel = "canonical" href = "https://physexams.com/controller-> id. "/". Yii :: $ app-> controller-> action-> id?> "/>

<link rel = "publisher" href = "Publisher?> "/>

<?= Html::encode($metadata->Title)?>

<meta charset = "Character set?> ">

<meta name = "description" content = "meta_description?> "/>

and part of the controller and its action is:

Class CoursesController extends controller
{

/ **
* @inheritdoc
* /
Actions for public events ()
{
return [
            'error' => [
                'class' => 'yiiwebErrorAction',
            ].
& # 39; captcha & # 39; => [
                'class' => 'yiicaptchaCaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ].
];
}

/ **
* Displays the homepage.
*
* @return mixed
* /
public function actionIndex ($ id = 0)
{
$ coursesP = [] ;
if ($ id! = 0)
{
$ coursesP = courses :: find () -> where (['id'=> $id , 'itsok' => "yes"]) -> with (& # 39; lessons & # 39;) -> one ();

if (empty ($ coursesP))
{
$ this-> redirect (Url :: to (['courses']));
} else {

$ courses = Lessons :: find () -> where (['course_id' => $coursesP->id, 'itsok' => "yes"]) -> all ();
}
}
otherwise {

$ courses = courses :: find () -> where (['itsok' => "yes"]) -> with (& # 39; lessons & # 39;) -> all ();

}

return $ this-> render (& # 39; index & # 39 ;, [
            'courses' => $courses ,
            'id' => $id ,
            'parent' => $coursesP
        ]);
}
public function actionInternal ($ id = 0)
{



if ($ id == NULL)
{
return $ this-> redirect (Url :: to (['courses/index']));
}

$ lesson = Lessons :: find () -> where['itsok' => 'yes' , 'id' => $id]) -> with (['course' , 'lessonElements']) -> one ();
$ otherLessons = Lessons :: find () -> where (['course_id' => $lesson->course_id  , 'itsok' => 'yes']) -> all ();

if (empty ($ lesson-> id))
{
return $ this-> redirect (Url :: to (['courses/index']));
}

return $ this-> render (& # 39; internal & # 39 ;, [
            'lesson' => $lesson ,

            'otherLessons' => $otherLessons

        ]);
}

}

The UrlManager configuration file is

getBaseUrl ());



return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log', 'thumbnail'].
& # 39; controller namespace & # 39; => & # 39; frontend  controller & # 39 ;,
// & # 39; defaultRoute & # 39; => & # 39; / site / index & # 39 ;,

& # 39; components & # 39; => [
        'request' => [
            'baseUrl' => $baseUrl,
        ].
& # 39; # 39 & urlManager; =>[
& # 39; # 39 & baseUrl; => $ baseUrl,
& # 39; class & # 39; => & # 39; yii  web  UrlManager & # 39 ;,

& # 39; # 39 & enablePrettyUrl; => true,
& # 39; show script name & # 39; => false,
& # 39; # 39 & enableStrictParsing; => false,
& # 39; # 39 & rules; =>[
& # 39; home & # 39; => & # 39; site / index & # 39 ;,
& # 39; / & # 39; => & # 39; site / index & # 39 ;,
& # 39; frontend / web & # 39; => & # 39; site / index & # 39 ;,
& # 39; index & # 39; => & # 39; site / index & # 39 ;,
& # 39; site & # 39; => & # 39; site / index & # 39 ;,
& # 39; site / login & # 39; => & # 39; site / login & # 39 ;,
& # 39; site / contact & # 39; => & # 39; site / contact & # 39 ;,
& # 39; site / about & # 39; => & # 39; site / about & # 39 ;,
& # 39; site / faq & # 39; => & # 39; site / faq & # 39 ;,
& # 39; profile / logout & # 39; => & # 39; profile / logout & # 39 ;,
& # 39; profile & # 39; => & # 39; profile / index & # 39 ;,
Unit /; & # 39/& # 39; => & # 39; courses / internal & # 39 ;,
& # 39; lesson & # 39; => & # 39; courses / internal & # 39 ;,

Course /; & # 39/& # 39; => & # 39; courses / index & # 39 ;,
& # 39; courses & # 39; => & # 39; courses / index & # 39 ;,

Test /; & # 39/& # 39; => & # 39; Exam / internal & # 39 ;,
& # 39; exam & # 39; => & # 39; exam / index & # 39 ;,

& # 39; ticket & # 39; => Ticket / index & # 39 ;,



Memory card /; & # 39/& # 39; => & # 39; blog / internal & # 39 ;,
# Blog;/& # 39; => & # 39; Blog / Cat & # 39 ;,
& # 39; blog & # 39; => & 39; blog / index & # 39 ;,

& # 39;//& # 39; => & # 39;/& # 39 ;,


].
].
& # 39; user & # 39; => [
            'identityClass' => 'commonmodelsUser',
            'enableAutoLogin' => true,
        ].
& # 39; log & # 39; => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yiilogFileTarget',
                    'levels' => ['error', 'warning'].
].
].
].
& # 39; errorHandler & # 39; => [
            'errorAction' => 'site/error',
        ].

& # 39; thumbnail & # 39; => [
            'class' => 'himiklabthumbnailEasyThumbnail',
            'cacheAlias' => 'assets/gallery_thumbnails',
        ].
& # 39; # 39 & asset manager; => [
            'class' => 'yiiwebAssetManager',
            'bundles' => [
                        'yiiwebJqueryAsset' => [
                            'js' => [
                                'jquery.min.js'
                            ]
                        ].

& # 39; yii  bootstrap  BootstrapAsset & # 39; => [
                            'css' => [
                               'css/bootstrap.min.css',
                            ]
                        ].

].
].
].
& # 39; params & # 39; => $ params,
];

I want the routing element to work for every link I put in the Metadata section of my CMS

The neural network written in Python 3.6 (WinPython) is not behaving properly

So I'm using the sequential model of Python 3.6 (WinPython) to design a deep neural network.
My code looks like this:

`model = Sequential ()
model.add (Dense (newshape[1]+1, Activation = & # 39; relu & # 39 ;, input_shape = (newshape[1],)))
model.add (Dense (500, activation = & relu & # 39;))
model.add (density (250, activation = & relu & # 39;))
model.add (Dense (90, activation = & relu & # 39;))
model.add (Density (2, Activation = & sigmoid & # 39;))
model.compile (loss = & # 39; binary_crossentropy & # 39 ;,
optimizer = & # 39; adam & # 39 ;,
metrics =['accuracy'])
model.fit (X_train, y_train, epochs = 1000, batch_size = 25, verbose = 0)
ANN = model.predict (featurevector)
print (ANN) `

The variable feature vector Contains all the functionality of the samples that I need to forecast. I have 2 sample sets, A and B for predictive purposes, set A contains class 1 samples, while set B contains class 2 samples. Now, when I turn on my computer for the first run, I get the correct output for set A and set B. However, as soon as I try to get the result, after I've already tried to get a prediction for set B, it's predicted that sentence A belongs to the same class as sentence B. I always get the correct output for sentence B. However, this is not the case for quantity A. This is how it looks like:

Turn on the computer …

Prediction A: correct output

Prediction B: correct output

Say sentence A again: wrong output

Predict sentence B again: Proper output

Say sentence A again: wrong output

Say sentence A again: wrong output

… and so on

Rpg – Removing and adding items to inventory does not work properly

I'm an IT student doing my first 2D role-playing game. At the moment I am making my inventory system. I follow a tutorial and everything worked fine until I added features to add or remove items from the inventory. I've been looking for the problem for a long time, but I was out of luck. please help
The problem is when I press play:
1. I do not seem to be able to select the first item in the inventory list at all (I have inserted a message that will be displayed when the item is clicked).
2. If I select one of the other items, the message will be displayed and the item will be removed from the inventory as expected. All other items disappear as well! However, when I look in the article list from the inspector, the other elements are actually there, but I can not select / see them.

Here is my inventory script:

    public class Inventory: MonoBehaviour {

public GameObject player;
Public GameObject inventory panel;

public list list = new list();

public static inventory instance;

void start () {
Instance = that;
updateSlots ();
}

int i = 0;
void updateSlots () {
foreach (Turn child into inventoryPanel.transform) {

SlotController slot = child.GetComponent();
if (i <list.Count) {
slot.item = list [i];
} else {
slot.item = null;
}

slot.updateInfo ();

i ++;
}
}
public void Add (Article) {
if (list.Count <6) {
list.Add (item);
}
updateSlots ();
}
public void Remove {item position) {
list.Remove (element);
updateSlots ();
}
}

and here is the controller:

public class SlotController: MonoBehaviour {

public element;

private void start () {
Update information ();
}

public void updateInfo () {
Image displayImage = transform.Find ("Image"). GetComponent ();

if (item) {
displayImage.sprite = item.Icon;
displayImage.color = Color.white;
}
miscellaneous
displayImage.sprite = null;
displayImage.color = Color.clear;
}
}

public void usage () {
if (item) {
item.Use ();
}
}
}

c ++ – How to properly load the game resources regardless of the working directory?

I'm writing a resource manager for a hobby game project that reads textures / fonts, and so on.

So far, I've specified the location of the files relative to the executable path, like:

my_texture.loadFromFile ("textures \ my_texture.png");

Now, however, I realized that the relative path I give is relative to the working directory of the game. For example, if I run the executable from my IDE (which sets the working directory to the project directory instead of the executable directory), the game can not load the texture and crash.

I thought about using the arguments of the main unit[0] and researched it, but apparently it's not reliable (it could only be called the name of the Exes)

So how can I reliably get the path to my resource files? How do the pros do it?

I use the SFML and C ++ 17. I would like a portable solution, otherwise Windows.

I checked this question, but it was not helpful.

manipulate – switching function does not work properly

I would like to choose between the tent and hat function to fold, but my switch function generates an error.

I do not need the original actions exactly. But I want to plot the two I pick.

error pattern

(* Define tent function *)

Tri[x_, wT_] : =
piecemeal[{{(1 / wT ^ 2) * x + (1 / wT),
0> x> -wT}, {- (1 / wT ^ 2) * x + (1 / wT), 0 <x < wT}}];

(*Defining Top Hat Funtion*)

Hat[x_, wH_] := 
  Piecewise[ {{(1/(2*wH)), 0 > x> -wH}, {(1 / (2 ยท wH)), 0 <x < wH}}];

 (*Defining Incline Funtion*)

(*Plotting & Manipulate Function*)
Manipulate[
 pT = Plot[Tri[x, wTent], {x, -10, 10}, PlotStyle -> Blue,
PlotRange -> All];
pH = order[Hat[x, wH], {x, -10, 10}, PlotStyle -> LightGreen,
PlotRange -> All];
show[{pT, pH}, PlotRange -> All, ImageSize -> Medium],
s1 = switch[fx, "Tent Function", Tri[x + df, wTent],
"Cylinder function", hat[x + df, wH]];
s2 = switch[gx, "Tent Function", Tri[x + dg, wTent],
"Cylinder function", hat[x + dg, wH]];
plotConv1 =
plot[{s1, s2}, {x, -10, 10}, Exclusions -> None, PlotRange -> All];
{{tTent, 1, "Triangle Width"}, 0,1, 1}
{{wH, 1, "hat width"}, 0,1, 1}
{fx, {"tent function", "top hat function"}},
{{df, 0, "Shift fx"}, -5, 5},
{gx, {"tent function", "top hat function"}},
{{dg, -5, "Shift fg"}, -10, 10}
]