Questions About Strin

Passing a string to a database with ToUpper? VB.NET 2010

I'm trying to validate a textbox. If user enters all lower case characters then convert it to all upper case. So when its added to the database its all upper case. I need help with my function, I don't know if its a syntax error or something, here it is. I'm using VB.Net 2010

Public Function CheckLetters(ByVal strIn As String) As Boolean

    Dim i As Integer
    Dim strOne As String

    For i = 0 To Len(strIn) - 1

        strOne = strIn.Substring(i, 1).ToUpper
        Select Case strOne

            Case "A" To "Z"
            Case Else

                Return False
        End Select
    Next

    Return True
End Function
http://www.stackoverflow.com/questions/12717624/passing-a-string-to-a-database-with-toupper-vb-net-2010

Deadlock in MPI_Reduce() when run on multiple nodes

I have a problem with my MPI code, it hangs when the code is run on multiple nodes. It successfully completes when run on a single node. I am not sure how to debug this. Can someone help me debug this issue?

Program Usage:

mpicc -o string strin.cpp
mpirun -np 4 -npernode 2 -hostfile hosts ./string 12 0.1 0.9 10 2

My Code:

#include <iostream>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"

int main ( int argc, char **argv )
{

    float *y, *yold;
    float *v, *vold;
    int nprocs, myid;
    FILE *f = NULL;
    MPI_Status   status;
    int namelen;
    char processor_name[MPI_MAX_PROCESSOR_NAME];


    //  const int NUM_MASSES = 1000;
    //  const float Ktension = 0.1;
    //  const float Kdamping = 0.9;
    //  const float duration = 10.0;

#if 0
    if ( argc != 5 ) {
        std::cout << "usage: " << argv[0] 
    
http://www.stackoverflow.com/questions/12791591/deadlock-in-mpi-reduce-when-run-on-multiple-nodes

How to Display �C Symbol in Excel from database?

I am using a excel File which has a cell contain C Symbol with other string (Ex.. -40C )

And i am trying to get the value of that cell using

    Dim strIn As String
    strIn = Range("B2").Text

All working fine and strIn has a value "-40C" but once i changed My Regional setting as follows..

Regional setting

it started to shows strIn values as "-40?c"

Debug Mode

0 symbol is changed with ??

Thanks in advance for any help.. Liyo Jose.

http://www.stackoverflow.com/questions/12800288/how-to-display-c-symbol-in-excel-from-database

Referencing EPPlus .Net library in IronPython

I'm trying to use the EPPlus Dot Net library from IronPython to open and update an Excel spreadsheet, but I cannot establish a reference to the library. I'm not sure whether the problem is in my code, my understanding of referencing Dot net libraries (which is very basic), the way in which I downloaded and "installed" the dll, or whether it simply is not compatible with IronPython.

Can anybody suggest how I can reference this library from IronPython?

Here's my python code:

import sys
from collections import OrderedDict
sys.path.append(r'C:\EPPlus')
import clr
clr.AddReference('WindowsBase')
clr.AddReferenceToFile('EPPlus.dll')  # Fails here.

The code fails on clr.AddReferenceToFile('EPPlus.dll') with:

Traceback (most recent call last):
  File "auction_support_epp.py", line 6, in <module>
IOError: System.IO.IOException: Could not add reference to assembly EPPlus.dll
   at IronPython.Runtime.ClrModul
    
http://www.stackoverflow.com/questions/12844834/referencing-epplus-net-library-in-ironpython

QTip with JQGrid using Hyperlink

I have a jqgrid that has a hyperlink for the ID field within the grid. What I like to do is when somebody hovers over the id hyperlink that is in Jqgrid, I like to show a qTip with the ID selected- http://craigsworks.com/projects/qtip/. I actually like to go one step further - when somebody hovers over the ID hyperlink, I like to use JSON and return a string and then display that strin in the QTip

I tried the following:

     $(this).qtip({
              content: {
              text: $(this).attr('title'),
         }
     });
http://www.stackoverflow.com/questions/12902705/qtip-with-jqgrid-using-hyperlink

How to handle multiple object types when creating a new Type

Been tasked to write some asset tracking software... Want to try to do this the right way. So I thought that a lot of assets had common fields. For instance, a computer has a model and a manufacturer which a mobile phone also has.

I would want to store computers, monitors, mobile phones, etc. So I thought the common stuff can be taken into account using an abstract base class. The other properties that do not relate to one another would be stored in the actual class itself.

For instance,

public abstract class Asset {
private string manufacturer;

    public string Manufacturer { get; set; }
    //more common fields
}

    public class Computer : Asset {
    private string OS;
    public strin OS { get; set; }
    //more fields pertinent to a PC, but inherit those public properties of Asset base
    }

    public class Phone : Asset {
    //etc etc
    }

But I have 2 concerns:

1)If I have a web form asking someone to add an

http://stackoverflow.com/questions/2186901/how-to-handle-multiple-object-types-when-creating-a-new-type

Django ORM and Unicode data

I'm using following model to store info about pages:

class Page(models.Model):
    title = models.TextField(blank = False, null = False)

New data saves correctly, I'm saving Unicode data there (lots of non-ASCII titles). But when I'm performing query:

page = Page.objects.filter(id = 1)

page.title looks odd:

u'\u042e\u0449\u0435\u043d\u043a\u043e'

What could I made wrong? Thanks.

Update: Really, when I'm print page.title - it looks OK. But I need to dump it to JSON, so after such code:

dumps({'title': page.title})

All looks bad.

Update 2: Thanks to everyone, pointed me that this behavoir is correct. But unicode-escaped strins are so long. Can I translate them to utf-8 somehow?

http://stackoverflow.com/questions/2280855/django-orm-and-unicode-data

Why am I getting "UnsatisfiedLinkError: no SolarisSerialParallel in java.library.path"

Hi i am trying to send sms to my mobile using java.When I run the application I am getting the the follwing error.

package HelloWorld;

import java.io.*;
import java.util.BitSet;
import javax.comm.*;
import java.lang.*;
public class SerialToGsm {

    InputStream in;
    OutputStream out;
    String lastIndexRead;
    String senderNum;
    String smsMsg;

    SerialToGsm(String porta) {
        try {
//            CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier("serial0");
            CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(porta);
            SerialPort sp = (SerialPort)portId.open("Sms_GSM", 0);
            sp.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
            sp.setFlowControlMode(sp.FLOWCONTROL_NONE);

            in = sp.getInputStream();
            out = sp.getOutputStream();

            // modem reset
            sendAndRecv("+++AT", 30);       // delay for 20
    
http://stackoverflow.com/questions/2851748/why-am-i-getting-unsatisfiedlinkerror-no-solarisserialparallel-in-java-library-path