You need to specify a suitable character set for your database, i.e. one which supports the languages that you want to store data in, something like Unicode. See MySQL Character Set Reference[^].
L Madhavan
Posts
-
How to SAVE&EDIT "HINDI" words in JSP & MySql... -
Programming time for algorithm? Anyone help me.................I'm not sure what you mean by "count time". If you mean algorithmic complexity, the worst case running time would be O((T - P + 1) * P) because that's the maximum number of times the loops in BruteForce together can execute. A little calculus also shows that the worst occurs when P = (T + 1) / 2, in which case the running time would be O(T2). If you're looking to calculate the actual running time of the function, you should use a library function such as clock()[^] to get the time before and after calling the BruteForce function - then the difference in those times will give you the execution time.
-
Using MFC's socket within the Process' threadsOh yes, I missed that point. You do need to detach the original socket.
-
To add Meta tag with javascript is good or bad for google search engineIt makes no sense to add META tags using JavaScript because search engines do not evaluate scripts and hence they will never see those tags.
-
Should i go for open source or Asp.net technology for web developmentThere is nothing such as better or worse. It all depends on what you require and what technologies are available for you to use.
-
Using MFC's socket within the Process' threadsAmitCohen222 wrote:
if I understand correctly it is since the only thread allowed to use this socket is the one created it
Not exactly, it's got to do with a bug in MFC. See knowledge base Q193101[^] - I had a similar problem and calling AfxSocketInit() in each thread fixed it.
-
mciSendString problemI believe it might have something to do with not having a "window" to play the video in. It might be simpler to use the MCIWnd functions (I've used them and had no problem in playing videos) compared to sending command strings yourself.
-
C programming in Linux warning messageYou're partially right about the *opt_socket_name[5] thing. You declare the array of pointers using a *, eg. char *opt_socket_name[5]. Now, for a normal pointer, you would assign it the address of an existing variable. Example:
int value = 10;
int *pointer = &value;
printf("%d\n", *pointer);But the problem is that there is no string data type in C. A string itself is an array of characters and an array is internally a pointer, which means that a string is already a pointer. So the & and * are not used at all. This is how you would use an array of strings:
main() {
int i;
char *opt_socket_name[5];char string1[10];
// ...
char string5[10];strcpy(string1, "hello 1");
// ...
strcpy(string5, "hello 5");opt_socket_name[0] = string1;
// ...
opt_socket_name[4] = string5;for (i = 0; i < 5; i++)
printf("%s\n", opt_socket_name[i]);
} -
help..Try New Project > Win32 Console Application.
-
downloading DSLGo to http://damnsmalllinux.org/download.html[^], select any of the mirrors, then go to the current folder and download current.iso. Burn the image onto a CD, then reboot your system and the DSL live CD should load.
-
Linux web proxyFor questions 1 and 3: If you're familiar with Linux, yes, it's enough you read up the chapter on squid. I also found a simple tutorial here[^]. For question 2: Generally, you need two. One connects the proxy server to the local network. Another connects it to the internet, unless you're using an interface other than Ethernet.
-
C programming in Linux warning messageIt looks like you're trying to copy text into a string, but there are quite a few mistakes in the code: 1. A string is an array of characters, for eg. char str[100]. Therefore opt_socket_name[5] is a string that can hold 4 characters (+1 for the null terminator) 3. A * represents a pointer - you can also use a character pointer as a string, but it would point to an existing array of characters. 4. You use either * or an array. In your case, *opt_socket_name[5] means an array of 5 strings. 5. const = constant. Don't use that unless you don't want to modify the string. So here's what your code should look like:
static char opt_socket_name[20];
main()
{
strcpy(opt_socket_name, "testing");
printf("%s", opt_socket_name);
}If you're looking for an explanation for your warning and the segmentation fault, here it is: as I mentioned, in your original program, opt_socket_name[i] is a string and *opt_socket_name[i] points to a single character in the string. What you are passing to strcpy is a single character, which in C can be implicitly typecast to an integer, which in turn is typecast to a pointer and hence the warning.
-
Redrawing..Looks like the Draw method is using an XOR pen, which is a common method for drawing shapes. An XOR operation is similar to inverting the colours, so by drawing it the second time, you effectively erase the old shape before drawing the shape at the new position.
-
ShellExecute with new instanceYou will have to retrieve the path to the default browser and directly execute it, passing in the URL as a parameter.
ShellExecute(this->m_hWnd, _T("open"), pathToBrowser, _T("www.xyz.com"), NULL, SW_SHOWNORMAL);
-
checkmark/icon in submenu[owner draw menu]Shift the rectangle by the icon dimensions, say 16 pixels to the right, then draw the text there. Now draw the icon at the original position.
CRect rect;
rect.left=lpDrawItemStruct->rcItem.left;
rect.top=lpDrawItemStruct->rcItem.top + 2;
rect.right=lpDrawItemStruct->rcItem.right;
rect.bottom=lpDrawItemStruct->rcItem.bottom + 2;// Put code here to draw icon at (rect.left, rect.top)
// Now shift the rectangle before drawing text
rect.OffsetRect(16, 0);//str is a string which i want to output : eg -> Open\tCtrl+O
pDC->DrawText (str,rectt,nFormat); //this will draw text into the menu/submenuYou can load standard images such as check mark etc. using LoadBitmap[^]
-
PHP editor?If you just want a simple editor, try Bluefish[^]. If you want a complete IDE (including debugging etc.) try Eclipse PDT[^].
-
checkmark/icon in submenu[owner draw menu]What problem are you facing in drawing the icon? You can use DrawIconEx[^] and pass in the DC from the DRAWITEMSTRUCT.
-
Embded media playerB87 wrote:
i uploaded this in server but some formats which can play in my system cant supported in other systems
Embedded objects run on the client side, so the supported formats depend on the codecs that are installed on the client's system. The best solution to this is to simply use a standard format such as MP3 or WMA so that it plays on all systems.
-
using _ultoa_s is creating a problemstrlen returns the current length of the string, not the actual size of the buffer. Moreover, if the buffer is uninitialized, (i.e. no null terminator) the behaviour of strlen is undefined.
-
How to open localhost in MFC? (Very Urgent...........) [modified]Maybe the CInternetSession[^] class will help you. The OpenURL function of this class opens any Internet file and returns a CStdioFile object, which you can use as a normal file object. If you want to save the file, simply read from this file and write into another file.