I can connect manually by doing:
M-x sql-postgres
and type the User, Database, Host, Server
I'd like to do something like:
(connect-foo (user "me")(database "bar")(host "earth"))
When i execute my code i am getting this error
LPTSTR lpBuffer;
::GetLogicalDriveStrings(1024,lpBuffer);
while(*lpBuffer != NULL)
{
printf("%s\n", lpBuffer); // or MessageBox(NULL, temp, "Test", 0); or whatever
lpBuffer += lstrlen(lpBuffer)+1;
printf("sizeof(lpBuffer) %d\n",lstrlen(lpBuffer));
}
OutPut
C
sizeof(lpBuffer) 3
D
…
I'm playing WAVs on my Android phone by loading the file and feeding the bytes into AudioTrack.write() via the FileInputStream BufferedInputStream DataInputStream method. The audio plays fine and when it is, I can easily adjust sample rate, volume, etc on the fly with nice performance. However, it's taking about two full seconds for…
I've got the following code:
def get_input(self):
"""
Reads command from stdin, returns its JSON form
"""
json_string = sys.stdin.read()
print("json string is: "+json_string)
json_data =json.loads(json_string)
return json_data
It reads a json string that was sent to it from another process. The json is…
i intend to fill a char-pointer array successively in a for-loop. the content to fill in is a integer so i need to cast. but i didn't get the result i want to..
for (i=0;i<max0;i++){
sprintf(buf, "%d", content[i]);
}
sprintf replaces the hole buf, but i want to append.
for (i=0;i<max0;i++){
buf[i]=(char) contint[i]…
Hello all,
I need really your help please.
What I do is to build a table in html tags in my servlet then when trying to send this table to a servlet for the display using:
Response.sendRedirect this did not work.
I have an error but I don't know the cause.
I search to how do it since I use:
response.setContentType("text/html"); …
I've pretty much always used send() with sockets and now I'm moving onto the WSA functions. With send(), I have a sendall() helper that ensured all data is delivered even if it didn't happen in one try and a partial send occurred on first call.
So, instead of learning the hard way or over-complicating code when I don't have to,…
I have written a driver for a UART in omap4460 panda board running on Linux platform.I have enabled DMA in FIFO mode in UART.My user application transfers 100 bytes of data from user space to kernel buffer(DMA buffer).
As soon as the DMA channel is enabled, data from DMA buffer is copied to FIFO which is then transmitted to TSR…
Right now, I'm adding a rudimentary sound engine to my game. So far, I am able to load in a WAV file and play it once, then free up the memory when I close the game. However, the game crashes with a nice ArgumentOutOfBoundsException when I try to play another sound instance.
Specified argument was out of the range of valid…
Hello all!
This question is the result of two other questions I've asked in the last few days.
I'm creating a new question because I think it's related to the "next step" in my understanding of how to control the flow of my send/receive, something I didn't get a full answer to yet.
The other related questions are:…
Hello all.
I am implementing a UDP data transfer thing. I have several questions about UDP buffer.
I am using UDPClient to do the UDP send / receive. and my broadband bandwidth is 150KB/s (bytes/s, not bps).
I send out a 500B datagram out to 27 hosts
27 hosts send back 10KB datagram back if they receive.
So, I…
I'm prototyping a client that displays streaming video from a HaiVision Barracuda through a quicktime client. I've been unable to reduce the buffer size below 3.0 seconds... for this application, we need as low a latency as the network allows, and prefer video dropouts to delay. I'm doing the following:
-…
I am currently writing the positions of my geometry to the RGB channels of gl_FragColor and I would like to write 1.0 to the alpha channel if the fragment is part of geometry, and 0.0 if its empty.
Is there a simple way to tell if a fragment is geometry or not? Maybe through gl_FragCoord.z?
thanks
Hi,
To make things easier, the table contains all the words in the English dictionary.
What I would like to do is be able to store the data as a trie. This way I can traverse the different branches of the trie and return the most relevant result.
First, how do I store the data in the table as a trie?
…
I am having to deal with raw bites in a project and I need to basically do something like this
byte[] ToBytes(){
byte[] buffer=new byte[somelength];
byte[] tmp=new byte[2];
tmp=BitConverter.GetBytes(SomeShort);
buffer[0]=tmp[0];
buffer[1]=tmp[1];
tmp=BitConverter.GetBytes(SomeOtherShort);
…
I'm having problems with DFS backtracking in an adjacency matrix. Here's my code:
(i added the test to the main in case someone wants to test it)
public class Graph {
private int numVertex;
private int numEdges;
private boolean[][] adj;
public Graph(int numVertex, int numEdges) {
…
I wonder how to list the content of a tar file only down to some level?
I understand tar tvf mytar.tar will list all files, but sometimes I would like to only see directories down to some level.
Similarly, for the command ls, how do I control the level of subdirectories that will be displayed? By…
The sys.dm_os_buffer_descriptors Dynamic Management View gives you a look into the data pages that are currently in your SQL Server buffer pool. Just in case you are not familiar with some of the internals to SQL Server and how the engine works, SQL Server only works with objects that are in memory…
I've been developing rails applications for about 6 months now (I was originally a java developer) and I'm getting familiar enough with building applications that I want to take my rails knowledge to the next level.
The majority of books and learning materials I've found deal mostly with "how to…
I have been trying for long time to figure out this:
I have loaded a model from a directx file (I am using opengl and Java) the model have a hierarchical system of nested reference frames (there are not bones). There are just 2 frames, one of them is called x3ds_Torso and it has a child frame…
In a 2d world, using a quadtree to prune pairs in collision detection, how can I chose the depth of said quadtree?
The world I am dealing with is mostly made of moving objects¹, so the cost of dispatching the objects between the quadtree cells matter. So what I am interested in is the…
I have a code library which is written in C++ and makes extensive use of the wxWidgets library. I'm now trying to wrap my library (currently using SWIG) so that it's callable from wxPython, but I've hit a wall:
------ Build started: Project: MyLibLib, Configuration:…
Hi all,
I'm using Filestream for read big file ( 500 MB) and I get the OutOfMemoryException.
Any solutions about it.
My Code is:
using (var fs3 = new FileStream(filePath2, FileMode.Open, FileAccess.Read))
{
byte[] b2 =…
Hi there, I have got a homework to hack program using buffer overflow ( with disassambling, program was written in C++, I haven't got the source code ). I have already managed it but I have a problem. I have to print some message on the screen, so I found out…