I've got an image generator written in C. Now I want to pass those images to x264 to encode them and write it to a file.
Every 100th image should be a key frame in order to save the video to disk every 100th frame.
The image generator calls onImageGenerated() after each image.
I'd appreciate any pointers on how to set up x264 in this way.
I am trying to emulate the behavior found in finder and itunes. Single click on a selected object edits it. Double click opens the object.
I have set the doubleAction of the tableView but like it says in the documentation. "If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead." I dont want this. Is there a way i can get that message sent even if the cell is editable? I really have no idea how to begin implementing this. Any general pointers would be appreciated.
I am using one program to monitor the keyboard for input but would like to use that same program to populate the clipboard then automatically paste to the cursor location of the other program? Can this be done... I am using Delphi 4 Pro.
I m doing like this in java script :
document.getElementById(XYZ).value = '32768';
document.getElementById(ABC).value = '32768 ';
document.getElementById(XYZ).disabled = true;
document.getElementById(ABC).disabled = true;
when i m pressing submit it gives "0" as value.
BUT i want to retrieve above values.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
readOnly is an option but it changes the FONT COLOUR from gray to black,
but i want gray colored text in readOnly textbox
any help!!!!
thanx !!!
I've made a piece of code in what's on my server, the problem is that it doesn't send while im receiving. so if i send something to client 1 to client 2, client2 only receives if he sends something himself.. how can i solve this ?
/* Thread*/
while (! stop_received) {
nr_bytes_recv = recv(s, buffer, BUFFSIZE, 0);
if(strncmp(buffer, "SEND", 4) == 0) {
char *message = "Text asads \n";
rv = send(users[0].s, message, strlen(message), 0);
rv = send(users[1].s, message, strlen(message), 0);
if (rv < 0) {
perror("Error sending");
exit(EXIT_FAILURE);
}
}else{
char *message = "Unknown command \n";
rv = send(s, message, strlen(message), 0);
if (rv < 0) {
perror("Error sending");
exit(EXIT_FAILURE);
}
}
}
I'm building a simple client-server chat system.
The clients send data to the server and the server resends the data to all the other clients. I'm using the TcpListener and Network stream classes to send the data between the client and the server.
The fields I need to send are, for example: name, text, timestamp, etc. I separate them using the ASCII character 29.
I'm also using ASCII character 30 to mark the end of the streamed data.
The data is encoded with UTF8..
Is this a good approach? Will I run into problems? Are there better methods?
UPDATE:
Probably my question was misunderstood, so I explain it better..
Suppose to have a list of data to send from client to server, and suppose to send all the data in only one stream, how do you send these data?
Using a markup
Using a character as a delimiter
Using a fixed length for every fields
Are there any FTP programs which can automatically copy (or rather 'move') the contents of a folder to a remote server? I have of course googled this but only really found one or two ancient products which look really clunky and unmaintained. I was wondering if there's a way to do this from the command line or any better solution to the base problem.
In more detail, new files get written to a folder every few hours. These new files need to be FTP'd elsewhere and then deleted. Mirroring or synchonisation systems are probably out of the picture as we need to delete the source files once they've been successfully transferred.
If it's easier, the 'solution' could pull the files off the server (rather than the server pushing them to the client). The computers will both be Windows OS.
Hi,
I am trying to make a dynamic form which retrives data. How can I use javascript to load a value from a mysql database?
I understand that it must use php in some way, and I know how to query the database and assign the value to a php variable, but I have no idea what to do after that...any advice?
the goal is to have someone enter their orderid say, then the datbase auto pulls down and enters their last invoice in the field below it after they click GO...
This one really has me banging my head. I'm sending alphanumeric data from an Android app, through the BluetoothChatService, to a serial bluetooth adaptor connected to the serial input of a radio transceiver.
Everything works fine except when I try to configure the radio on-the-fly with its AT-commands. The AT+++ (enter command mode) is received OK, but the problem comes with the extended-ascii characters in the next two commands: Changing the radio destination address (which is what I'm trying to do) requires CCh 10h (plus 3 hex radio address bytes), and exiting the command mode requires CCh ATO.
I know the radio can be configured OK because I've done it on an earlier prototype with the serial commands from PIC basic, and it also can be configured by entering the commands directly from hyperterm. Both these methods somehow convert that pesky CCh into a form the radio understands.
I've have tried just about everything an Android noob could possibly come up with to finagle the encoding such as:
private void command_address() {
byte[] addrArray = {(byte) 0xCC, 16, 36, 65, 21, 13};
CharSequence addrvalues = EncodingUtils.getString(addrArray, "UTF-8");
sendMessage((String) addrvalues);
}
but no matter what, I can't seem to get that high-order byte (CCh/204/-52) to behave as it should. All other (< 127) bytes, command or data, transmit with no problem. Any help here would be greatly appreciated.
-Dave
MYMESSAGE = "<div>Hello</div><p></p>Hello"
send_mail("testing",MYMESSAGE,"[email protected]",['[email protected]'],fail_silently=False)
However, this message doesn't get the HTML mime type when it is sent. In my outlook, I see the code...
I have a huge disgusting stored procedure that wasn't slow a couple months ago, but now is. I barely know what this thing does and I am in no way interested in rewriting it.
I do know that if I take the body of the stored procedure and then declare/set the values of the parameters and run it in query analyzer that it runs more than 20x faster.
From the internet, I've read that this is probably due to a bad cached query plan. So, I've tried running the sp with "WITH RECOMPILE" after the EXEC and I've also tried putting the "WITH RECOMPLE" inside the sp, but neither of those helped even a little bit.
When I look at the execution plan of the sp vs the query, the biggest difference is that the sp has "Parallelism" operations all over the place and the query doesn't have any. Can this be the cause of the difference in speeds?
Thank you, any ideas would be great... I'm stuck.
Hi,
I created a workflow . My workflow sends e-mails to users who has salesperson security role. But I have big problem. After I export and import customizations in different company users of old company are shown on the e-mail template. How can I create a worflow which sends e-mail to users who has selected security role.
Regards,
Erdogan Uslu
I have ExtJS based application. I have compound object on the server side, and have ExtJS window with few tabs for editing different parts of this one object. For example:
I Have Compound object "Car"
public class Car
{
public string Name;
public string Color;
public List Wheels;
public List Doors;
}
And on my ExtJS window i have tabs ("General Info", "Wheels", "Doors") for editing different parts of this object.
So what i want:
When i want to create a new car i want to generate JSON configuration for my class "Car" like {Name:null; Color:null; Wheels:[]; Doors:[]} then sent it to the client, fill it on the client (without callbacks to server) and after user finishes creating his Car object (he added wheels, doors, set name and color) and press save, I want to sent this filled(generated) JSON object to server and save it to DB.
Is it possible?
Thanks
I have a form on my web page, it allows to submit many queries to my website,
every query is on a separate line in TextArea. Because waiting for all queries to complete is
too long I would like to update the web page after every query completes.
How to do this in ASP.NET MVC 2?
I will be grateful for helpful responses.
I am new to Perl and I want to write a Perl program that:
creates an HTTP request
sends it to any URL (e.g. http://www.google.com )
includes a cookie in the request
logs the http response codes in a file
(I am using Putty to connect with finesse server)
I'm writing a program that requires an image to be fetched from a remote server every 10 milliseconds or so, as that's how often the image is updated. My current method calls a timer to grab the image, but it encounters Socket Closed errors all the time, and sometimes does not work at all.
How can I fix my methods to keep the socket open the whole time, so no reconnecting is needed?
Here is the full class:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.swing.Timer;
public class Connection {
public static void createServer() throws IOException {
Capture.getScreen();
ServerSocket socket = null;
try {
socket = new ServerSocket(12345, 0,
InetAddress.getByName("127.0.0.1"));
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Server started on "
+ socket.getInetAddress().getHostAddress() + ":"
+ socket.getLocalPort() + ",\nWaiting for client to connect.");
final Socket clientConnection = socket.accept();
System.out.println("Client accepted from "
+ clientConnection.getInetAddress().getHostAddress()
+ ", sending file");
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.out.println("Sending File");
try {
pipeStreams(new FileInputStream(new File(
"captures/sCap.png")),
clientConnection.getOutputStream(), 1024);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
};
System.out.println("closing out connection");
try {
clientConnection.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
Timer timer = new Timer(10, taskPerformer);
timer.setRepeats(true);
timer.start();
}
public static void createClient() throws IOException {
System.out.println("Connecting to server.");
final Socket socket = new Socket();
try {
socket.connect(new InetSocketAddress(InetAddress
.getByName("127.0.0.1"), 12345));
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
}
ActionListener taskPerformer = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
System.out.println("Success, retreiving file.");
try {
pipeStreams(socket.getInputStream(), new FileOutputStream(
new File("captures/rCap.png")), 1024);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
}
}
};
System.out.println("Closing connection");
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
Timer timer = new Timer(10, taskPerformer);
timer.setRepeats(true);
timer.start();
}
public static void pipeStreams(java.io.InputStream source,
java.io.OutputStream destination, int bufferSize)
throws IOException {
byte[] buffer = new byte[bufferSize];
int read = 0;
while ((read = source.read(buffer)) != -1) {
destination.write(buffer, 0, read);
}
destination.flush();
destination.close();
source.close();
}
}
Hello All,
How can i make MPI process notify the others about an error for example, specially on an MPI program where all the MPI processees are independant from each others ( There no synchronisation between the different MPI processees ) ?
Thanks
I have searched much but I didn't find any solution but I god somewhere this example:
ContentValues values = new ContentValues();
values.put(BluetoothShare.URI, "content://" + uritoSend);
values.put(BluetoothShare.DESTINATION, deviceAddress);
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP, ts);
but this example give error unsupported content. please provide me the correct answer.
Thanks in advance
The below web services code has worked properly for me for over a year. We have updated our SharePoint servers, and now the below code throws an exception (at the bottom line of code) "Object reference not set to an instance of an object"
UserProfileWS.UserProfileService userProfileService = new UserProfileWS.UserProfileService();
userProfileService.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
string serviceloc = "/_vti_bin/UserProfileService.asmx";
userProfileService.Url = _webUrl + serviceloc;
UserProfileWS.PropertyData[] info = userProfileService.GetUserProfileByName(null);
EDIT: The service is still there. I browse http:///_vti_bin/UserProfileService.asmx, and the information for the service is still there, including the full description of the GetUserProfileByName call.
EDIT2: This does appear to be due to a change in SharePoint. I loaded a previous version of my software (known to be working), and it exhibits the same erroneous behavior.