Monogame – SpriteFont Exception: Text contains characters that cannot be resolved by this SpriteFont

I’m trying to put text on the screen and if I put anything but an empty string I get “Text contains characters that cannot be resolved by this SpriteFont.\nParameter name: text”

_spriteBatch.DrawString(screenText, "A", new Vector2(0, 200), Color.Black); 

screenText is the name of my SpriteFont variable.

<?xml version="1.0" encoding="utf-8"?> <!-- This file contains an xml description of a font, and will be read by the XNA Framework Content Pipeline. Follow the comments to customize the appearance of the font in your game, and to change the characters which are available to draw with. --> <XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">   <Asset Type="Graphics:LocalizedFontDescription">      <!--     Modify this string to change the font that will be imported.     -->     <FontName>Arial</FontName>      <!--     Size is a float value, measured in points. Modify this value to change     the size of the font.     -->     <Size>6</Size>      <!--     Spacing is a float value, measured in pixels. Modify this value to change     the amount of spacing in between characters.     -->     <Spacing>0</Spacing>      <!--     UseKerning controls the layout of the font. If this value is true, kerning information     will be used when placing characters.     -->     <UseKerning>true</UseKerning>      <!--     Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",     and "Bold, Italic", and are case sensitive.     -->     <Style>Regular</Style>      <!--     If you uncomment this line, the default character will be substituted if you draw     or measure text that contains characters which were not included in the font.     -->     <!-- <DefaultCharacter>*</DefaultCharacter> -->      <!--     CharacterRegions control what letters are available in the font. Every     character from Start to End will be built and made available for drawing. The     default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin     character set. The characters are ordered according to the Unicode standard.     See the documentation for more information.     For localized fonts you can leave this empty as the character range will be picked up     from the Resource Files.     -->     <CharacterRegions>       <CharacterRegion>         <Start>&#32;</Start>         <End>&#32;</End>       </CharacterRegion>     </CharacterRegions>     <!--     ResourceFiles control the charaters which will be in the font. It does this     by scanning the text in each of the resource files and adding those specific     characters to the font.      -->     <ResourceFiles>         <!-- <Resx>Strings.resx</Resx> -->     </ResourceFiles>   </Asset> </XnaContent> 

I did build and rebuild the spritefont file using the Content Builder.

I get this exception or whatever it is?

void b2World::DestroyBody(b2Body* b) {     b2Assert(m_bodyCount > 0);     b2Assert(IsLocked() == false);     if (IsLocked())     {         return;     }      // Delete the attached joints.     b2JointEdge* je = b->m_jointList;     while (je)     {         b2JointEdge* je0 = je;         je = je->next;          if (m_destructionListener)         {             m_destructionListener->SayGoodbye(je0->joint);         }          DestroyJoint(je0->joint);          b->m_jointList = je;     }     b->m_jointList = NULL;      // Delete the attached contacts.     b2ContactEdge* ce = b->m_contactList;     while (ce)     {         b2ContactEdge* ce0 = ce;         ce = ce->next;         m_contactManager.Destroy(ce0->contact);     }     b->m_contactList = NULL;      // Delete the attached fixtures. This destroys broad-phase proxies.     b2Fixture* f = b->m_fixtureList;     while (f)     {         b2Fixture* f0 = f;         f = f->m_next;          if (m_destructionListener)         {             m_destructionListener->SayGoodbye(f0);         }          f0->DestroyProxies(&m_contactManager.m_broadPhase);         f0->Destroy(&m_blockAllocator);         f0->~b2Fixture();         m_blockAllocator.Free(f0, sizeof(b2Fixture));          b->m_fixtureList = f;         b->m_fixtureCount -= 1;     }     b->m_fixtureList = NULL;     b->m_fixtureCount = 0;      // Remove world body list.     if (b->m_prev)     {         b->m_prev->m_next = b->m_next;     }      if (b->m_next)     {         b->m_next->m_prev = b->m_prev;     }      if (b == m_bodyList)     {         m_bodyList = b->m_next;     }      --m_bodyCount;     b->~b2Body();     m_blockAllocator.Free(b, sizeof(b2Body)); } 

Debugger points out to first line : b2Assert(m_bodyCount>0); What exactly it means? I get this exception when i close the game.

IIS url rewrite exception

We are hosting some sites on IIS. We have the url rewrite module installed and are rewriting anything that isn't https to https.

Now we come across an issue where for a very specific file we need to turn this rewrite off. But for some reason it doesn't work. It still rewrites to https.

Can anyone see what I am doing wrong?

Thanks.

[​IMG]

Truststore with root certificate throwing the sslhandshake Exception

I got to know from below post that having root ca certificate in the truststore is enough. If that’s the case, I just created my own truststore and added the root certificate to that truststore and trying to establish the connection using this truststore then I’m getting following exception. javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Please someone help me with this. TIA

Deny access to all PHP files using FilesMatch, but make an exception for one

Currently, using htaccess I am denying access to any PHP file in a directory, but not the JS, PNG, CSS files in the same directory.

<FilesMatch "\.php$  "> Order deny,allow Deny from all </FilesMatch> 

What if I want to make an exception for one file (“foobar.php” for example) however? Can I write multiple statements in a single htaccess? What is the order of execution?

Error en NetBeans con conexión a SQL SERVER: Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException

Buen día,

Al tratar de ejecutar un código que llama a la conexión con la BD me arroja error: Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException. El error se presenta al ejecutar el metodo activado por le botón

Comparto el códido donde se configura el error y el códido de la conexión de con la BD, además del error completo

import java.awt.Image; import java.awt.Toolkit; import java.sql.Connection; import java.util.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.Vector; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JOptionPane; import javax.swing.JTextField; import javax.swing.table.DefaultTableModel; import tveterinaria.conexion;   /**  *  * @author wolfc  */ public class citas extends javax.swing.JFrame {      /**      * Creates new form citas      */     public ResultSet res;     public citas() {       initComponents();        this.setLocationRelativeTo(null);       Image imagen = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("icon/incono.png"));       this.setIconImage(imagen);       cargarcomboboxdueno(jcdueno);       cargarprofe(jcprofesional);       //cargarmascota(jcmascota);       }      public void consultar() {       DefaultTableModel modelo = (DefaultTableModel) jtcitas.getModel();       modelo.setRowCount(0);       res = tveterinaria.conexion.Consulta("Select * from citas");        try {         while (res.next()) {           Vector v = new Vector();           v.add(res.getInt(1));           v.add(res.getDate(2));           v.add(res.getString(3));           v.add(res.getInt(4));           v.add(res.getInt(5));           v.add(res.getInt(6));           v.add(res.getString(7));           modelo.addRow(v);           jtcitas.setModel(modelo);          }        } catch (SQLException e) {         JOptionPane.showMessageDialog(null, e);       }     }      public void consultacitaiddueno() {       DefaultTableModel modelo = (DefaultTableModel) jtcitas.getModel();       modelo.setRowCount(0);       res = tveterinaria.conexion.Consulta("Select * from citas where iddueno =" + jcdueno.getSelectedItem() + "");       try {         while (res.next()) {           Vector v = new Vector();           v.add(res.getInt(1));           v.add(res.getDate(2));           v.add(res.getString(3));           v.add(res.getInt(4));           v.add(res.getInt(5));           v.add(res.getInt(6));           v.add(res.getString(7));           modelo.addRow(v);           jtcitas.setModel(modelo);          }        } catch (SQLException e) {         JOptionPane.showMessageDialog(null, e);       }     }      public void consultacitaidmascota() {       DefaultTableModel modelo = (DefaultTableModel) jtcitas.getModel();       modelo.setRowCount(0);       res = tveterinaria.conexion.Consulta("Select * from citas where idmascota =" + jcmascota.getSelectedItem() + "");       try {         while (res.next()) {           Vector v = new Vector();           v.add(res.getInt(1));           v.add(res.getDate(2));           v.add(res.getString(3));           v.add(res.getInt(4));           v.add(res.getInt(5));           v.add(res.getInt(6));           v.add(res.getString(7));           modelo.addRow(v);           jtcitas.setModel(modelo);            txtidcita.setText(res.getString(1));           txtidcita.setText(res.getString(2));           txtidcita.setText(res.getString(3));           txtidcita.setText(res.getString(4));           txtidcita.setText(res.getString(5));           txtidcita.setText(res.getString(6));           txtidcita.setText(res.getString(7));          }        } catch (SQLException e) {         JOptionPane.showMessageDialog(null, e);       }     }     DefaultComboBoxModel com;     public void consultacitaidprofe() {       DefaultTableModel modelo = (DefaultTableModel) jtcitas.getModel();       modelo.setRowCount(0);       res = tveterinaria.conexion.Consulta("Select * from citas where idprofesional =" + jcprofesional.getSelectedItem() + "");       try {         while (res.next()) {           Vector v = new Vector();           v.add(res.getInt(1));           v.add(res.getDate(2));           v.add(res.getString(3));           v.add(res.getInt(4));           v.add(res.getInt(5));           v.add(res.getInt(6));           v.add(res.getString(7));           modelo.addRow(v);           jtcitas.setModel(modelo);          }        } catch (SQLException e) {         JOptionPane.showMessageDialog(null, e);       }     }       public void cargarcomboboxdueno(JComboBox jcdueno) {       conexion con = new conexion();       String sql = " SELECT iddueno from citas group by iddueno ";       try {         Connection cn = con.getConexion();         PreparedStatement entrada = cn.prepareStatement(sql);         ResultSet rs = entrada.executeQuery();         jcdueno.addItem("Seleccione la cédula del dueño");         while (rs.next()) {           jcdueno.addItem(rs.getInt(1));         }       } catch (Exception e) {         JOptionPane.showMessageDialog(null, "Error: " + e);       }     }     public void cargarprofe(JComboBox jcprofesional) {       {         conexion con = new conexion();         String sql = " SELECT idprofesional from citas group by idprofesional ";          try {           Connection cn = con.getConexion();           PreparedStatement entrada = cn.prepareStatement(sql);           ResultSet rs = entrada.executeQuery();           jcprofesional.addItem("Seleccione la cédula del profesional");            while (rs.next()) {             jcprofesional.addItem(rs.getInt(1));           }         } catch (Exception e) {           JOptionPane.showMessageDialog(null, "Error: " + e);         }       }     }     public void cargarmascota(JComboBox jcmascota) {        conexion con = new conexion();        if (jcdueno.getSelectedItem().toString().equals("Seleccione la cédula del dueño")) {         String sql = " SELECT idmascota from citas group by idmascota";         try {           Connection cn = con.getConexion();           PreparedStatement entrada = cn.prepareStatement(sql);           ResultSet rs = entrada.executeQuery();           jcmascota.addItem("Seleccione el ID de la mascota");            while (rs.next()) {             jcmascota.addItem(rs.getInt(1));           }         } catch (Exception e) {           JOptionPane.showMessageDialog(null, "Error: " + e);         }        } else {         com = new DefaultComboBoxModel();         jcmascota.setModel(com);         String sql = " SELECT idmascota from citas where iddueno=" +           jcdueno.getSelectedItem() + "group by idmascota";         try {           Connection cn = con.getConexion();           PreparedStatement entrada = cn.prepareStatement(sql);           ResultSet rs = entrada.executeQuery();           jcmascota.addItem("Seleccione el ID de la mascota");            while (rs.next()) {             jcmascota.addItem(rs.getInt(1));           }         } catch (Exception e) {           JOptionPane.showMessageDialog(null, "Error: " + e);         }       }     }       private void btnconsultarActionPerformed(java.awt.event.ActionEvent evt) {       // TODO add your handling code here       if (jcprofesional.getSelectedItem().toString().equals("Seleccione la cédula del profesional") &&         jcdueno.getSelectedItem().toString().equals("Seleccione la cédula del dueño")) {         consultacitaidmascota();       } else {         if (jcmascota.getSelectedItem().equals("Seleccione el ID de la mascota") &&           jcdueno.getSelectedItem().equals("Seleccione la cédula del dueño")) {           consultacitaidprofe();         } else {           if (jcmascota.getSelectedItem().equals("Seleccione el ID de la mascota") &&             jcprofesional.getSelectedItem().equals("Seleccione la cédula del profesional")) {             consultacitaiddueno();           } else {             if (jcmascota.getSelectedItem().equals("Seleccione el ID de la mascota") &&               jcdueno.getSelectedItem().equals("Seleccione la cédula del dueño") &&               jcprofesional.getSelectedItem().equals("Seleccione la cédula del profesional")) {               consultar();             } else {               JOptionPane.showMessageDialog(null, "Coma mierda");             }           }         }       }     }

Adicionalmente comparto el metodo de la conexión a la BD el cual arroja el error

public static ResultSet Consulta(String consulta) {   Connection con = getConexion();   Statement declarar;   try {     declarar = con.createStatement();     ResultSet respuesta = declarar.executeQuery(consulta);     return respuesta;   } catch (SQLException e) {     JOptionPane.showMessageDialog(null, "Error en consultas" + e.getMessage(),       "Error de Conexion consulta", JOptionPane.ERROR_MESSAGE);   }   return null; }

Si bien es cierto que el metodo devuelve un valor null, es código reciclado tal al pie de la letra y nunca antes había arrojado un error similar. Incluso en otras partes del proyecto se usa de la misma manera el metodo y no se ve afectado por el error.

Fix 401 Unauthorized Exception uploading file to SharePoint 2010

I have a WCF service hosted in IIS on Domain 1. This service is accepting a request to upload a file, and then uploading the file to a SharePoint 2010 Server on Domain 2, using the client object model.

Everything works fine when I hardcode the username, password & domain using:

context.Credentials = new NetworkCredential(login, password, domain); 

However, due to the compliance & security we cannot do this in our company. We need to use integrated security if possible. I have tried setting the credentials to both

context.Credentials = CredentialCache.DefaultCredentials; context.Credentials = CredentialCache.DefaultNetworkCredentials; 

But neither appear to work, we receive the error

System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate() at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest() at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

Can someone provide any tips on how to fix this? Or tips that might lead us to the resolution, logs to check etc. I am not the developer of the SharePoint site, but can chase them down. I have gone through many questions/answers here and none seem to help us.

Fix 401 Unauthorized Exception uploading file to SharePoint 2010

I have a WCF service hosted in IIS on Domain 1. This service is accepting a request to upload a file, and then uploading the file to a SharePoint 2010 Server on Domain 2, using the client object model.

Everything works fine when I hardcode the username, password & domain using:

context.Credentials = new NetworkCredential(login, password, domain); 

However, due to the compliance & security we cannot do this in our company. We need to use integrated security if possible. I have tried setting the credentials to both

context.Credentials = CredentialCache.DefaultCredentials; context.Credentials = CredentialCache.DefaultNetworkCredentials; 

But neither appear to work, we receive the error

System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute() at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate() at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest() at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

Can someone provide any tips on how to fix this? Or tips that might lead us to the resolution, logs to check etc. I am not the developer of the SharePoint site, but can chase them down. I have gone through many questions/answers here and none seem to help us.

Why is sudoers NOPASSWD option applying the exception to ROOT instead of specified user?

/etc/sudoers:

# This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults        env_reset Defaults        mail_badpass Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d  h ALL=NOPASSWD: /usr/bin/brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 

But doing the command still gives me a permission error.

h@pop-os:~$   brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 brightlight: could not open "brightness" file: Permission denied 

Also

h@pop-os:~$   sudo -l Matching Defaults entries for h on pop-os:     env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin  User h may run the following commands on pop-os:     (ALL : ALL) ALL     (root) NOPASSWD: /usr/bin/brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 

Things I have tried:

  • Rebooting
  • Creating a file in /etc/sudoers.d/brightlight with last line of config above

EDIT: Fixed, you need to add sudo, and it won’t prompt you for a password