Recent content by I like Serena

  1. I like Serena

    Did my Android program crash because it lacks a delay mechanism?

    TextView.setText has multiple signatures. In this case you are passing an integer, which is interpreted as a resource ID, but you do not have a text resource with that ID. You can fix it if you convert the number to something that TextView.setText will interpret as a string instead.
  2. I like Serena

    C/C++ Errors trying to compile a simple code

    If I compile your code with the command that is in your shell script, it compiles correctly without output, and I can run it, although I get a run time exception: g++ -std=c++11 -o ./curr ./curr.cpp ./curr Floating point exception (core dumped) If I compile it with an older standard, I get...
  3. I like Serena

    C/C++ Errors trying to compile a simple code

    The errors indicate that you are still using the wrong C++ standard. So the command line that you intended does not seem to be executed. How about typing the compile command in an actual linux shell and not use VSCode at all? Also note that your shell script as it is now, will compile, and...
  4. I like Serena

    C/C++ Errors trying to compile a simple code

    I believe you have set the C++ standard only for VSCode's intellisense, which is for syntax highlighting and code completion while editing. The compiler itself still uses the wrong C++ standard. You can check by inspecting the compile commands in the terminal window. It should contain something...
  5. I like Serena

    React - changing default properties

    Hey @mathmari ! What you have is html with inline css in a javascript file. Does it work? 🤔 Instead of duplicating inline css in many files, the usual approach is to have a central CSS file that determines the layout globally. It also removes distracting layout directives from the code. In...
  6. I like Serena

    React - Menu - Sidebar - Suboptions are not shown in browser

    Hey mathmari! So it works now and whatever issue there was, is gone? 🤔
  7. I like Serena

    React - load new image - error - part 2

    Perhaps a closing quote or an angled bracket was missing? We can check if we inspect the generated html. 🤔
  8. I like Serena

    React - load new image - error - part 2

    I believe the "point" of React is that it is easy to quickly create a website. Of course React also has more advanced concepts, but it is not required to use them. As for the CSS, it is not trivial to get a title vertically aligned to the right of an image, simple as that may seem at first.
  9. I like Serena

    React - load new image - error - part 2

    Right-click and Inspect? 🤔
  10. I like Serena

    React - load new image - error - part 2

    As an alternative, we can do: <div><img src={logo} style="vertical-align: middle;">Title</div> The key is that the image itself must have a vertical alignment style. The text follows suit.
  11. I like Serena

    React - load new image - error - part 2

    Then the title must be in a container with the same height as the image, and it must be vertically aligned to the middle. We can achieve that with for instance <table><tr><td><img src={logo}></td><td>Title</td></tr></table>. 🤔
  12. I like Serena

    React - load new image - error - part 2

    Where do you want the title? I assumed you wanted it below the image. The tags <div>, <p>, and <h3> are all block-style tags, which means they always start on a new line and can take up all of the horizontal space. If you want the title to be to the right, you can use <span> or no tag at all...
  13. I like Serena

    React - load new image - error - part 2

    That should work yes. The inner <div> around the <img> seems a bit redundant though, and as an alternative for the title you might also use <p>Title</p>. 🤔
  14. I like Serena

    React - load new image - error

    The text {logo} has not been expanded. I'm not sure why. Which command did you use to build and run the web application? 🤔 Suppose you add console.log(logo) after line 2 as shown in the example that @pbuk pointed out. What do you get in the logging then? You can see the logging if you right...
Back
Top