Hi,
there is any pastebin-like php open source system without sql? I want to install it on localhost and dont want to backup sql.
edit: Highlighting as much as possible languages (as pastebin.com).
I am looking into the possibility/feasibility/resources for building a cross compiler which takes a procedural or Object Oriented language like C, or Java and compiling it into SQL. I understand that the advantage of SQL code is performing set operations which is fundamentally different from procedural languages which generally process 1 at a time. If anyone has done this before, or if it is thought of as too complicated to do or any other ideas/concerns/suggestions would be greatly appreciated.
Thanks in advance
Philip
After many hours, I have discovered that the given udp server needs the following steps for a successful communication:
1- Send "Start Message" on a given port
2- Wait to receive from server on any port
3- Then the port dedicated to you to send further data to the server equals the port you have received on it + 1
So I am asking if this kind is a known protocol/handshaking, or it is only special to this server??
PS: All above communication were in udp sockets in C#
PS: Related to a previous question: http://stackoverflow.com/questions/2757868/about-c-udp-sockets
Thanks
What is the difference, in general, between the concepts of namespaces and scope?
To my understanding, both describe the parts of a program in which a variable/object/method/function will be accessible. I understand that 'scope' tends to be a property of the variable (e.g., "This variable has global scope"), while a 'namespace' is a property of the program (e.g., "A Python function creates a local namespace"). Are there other differences?
Global scope vs global namespace addresses a slightly narrower question: global namespaces in C++. http://www.alan-g.me.uk/tutor/tutname.htm states,
There are a few very subtle differences between the terms but only a Computer Scientist pedant would argue with you, and for our purposes namespace and scope are identical.
What are those subtle differences? Under what circumstances or with which kinds of languages do people use each concept?
Hi!
I'm looking for a FPGA + machine.
It should be entry level pricing (e.g no more than $200).
EDIT: I want to make an ASM chart and program the FPGA to act like I specified in the chart
Hi Guys
I need to implement PSO's (namely charged and quantum PSO's).
My questions are these:
What Velocity Update strategy do each PSO's use (Synchronous or Asynchronous particle update)
What social networking topology does each of the PSO's use (Von Neumann, Ring, Star, Wheel, Pyramid, Four Clusters)
For now, these are my issues. All your help will be appreciated.
Thanks.
I need to write a server which accepts connections from multiple client machines, maintains track of connected clients and sends individual clients data as necessary. Sometimes, all clients may be contacted at once with the same message, other times, it may be one individual client or a group of clients.
Since I need confirmation that the clients received the information and don't want to build an ACK structure for a UDP connection, I decided to use a TCP streaming method. However, I've been struggling to understand how to maintain multiple connections and keep them idle.
I seem to have three options. Use a fork for each incoming connection to create a separate child process, use pthread_create to create an entire new thread for each process, or use select() to wait on all open socket IDs for a connection.
Recommendations as to how to attack this? I've begun working with pthreads but since performance will likely not be an issue, multicore processing is not necessary and perhaps there is a simpler way.
I mean, do programmers need very fast computers with amazing video cards or just standard ones. Is it better to use 1 or 2 monitors? Some applications consume a lot of resources like Netbeans or Eclipse and sometimes developers need to install databases, graphic design applications, web design applications, web servers in their own computers for testing purposes.
Hello everyone.
I'm new in Java so please forgive any obscene errors that I may make :)
I'm developing a program in Java that among other things it should also handle clients that will connect to a server. The server has 3 threads running, and I have created them in the following way :
DaemonForUI du;
DaemonForPort da;
DaemonForCheck dc;
da = new DaemonForPort(3);
dc = new DaemonForCheck(5);
du = new DaemonForUI(7);
Thread t_port = new Thread(da);
Thread t_check = new Thread(dc);
Thread t_ui = new Thread(du);
t_port.setName("v1.9--PORTd");
t_check.setName("v1.9-CHECKd");
t_ui.setName("v1.9----UId");
t_port.start();
t_check.start();
t_ui.start();
Each thread handles a different aspect of the complete program. The thread t_ui is responsible to accept asynchronous incoming connections from clients, process the sent data and send other data back to the client. When I remove all the commands from the previous piece of code that has to with the t_ui thread, everything runs ok which in my case means that the other threads are printing their debug messages.
If I set the t_ui thread to run too, then the whole program blocks at the "accept" of the t_ui thread.
After reading at online manuals I saw that the accepted connections should be non-blocking, therefore use something like that :
public ServerSocketChannel ssc = null;
ssc = ServerSocketChannel.open();
ssc.socket().bind(new InetSocketAddress(port));
ssc.configureBlocking(false);
SocketChannel sc = ssc.accept();
if (sc == null) {
;
}
else {
System.out.println("The server and client are connected!");
System.out.println("Incoming connection from: " + sc.socket().getRemoteSocketAddress());
in = new DataInputStream(new BufferedInputStream(sc.socket().getInputStream()));
out = new DataOutputStream(new BufferedOutputStream(sc.socket().getOutputStream()));
//other magic things take place after that point...
The thread for t_ui is created as follows :
class DaemonForUI implements Runnable{
private int cnt;
private int rr;
public ListenerForUI serverListener;
public DaemonForUI(int rr){
cnt = 0;
this.rr = rr;
serverListener = new ListenerForUI();
}
public static String getCurrentTime() {
final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return (sdf.format(cal.getTime()));
}
public void run() {
while(true) {
System.out.println(Thread.currentThread().getName() + "\t (" + cnt + ")\t (every " + rr + " sec) @ " + getCurrentTime());
try{
Thread.sleep(rr * 1000);
cnt++;
}
catch (InterruptedException e){
e.printStackTrace();
}
}
}
}
Obviously, I'm doing something wrong at the creation of the socket or at the use of the thread. Do you know what is causing the problem?
Every help would be greatly appreciated.
This is my first major application using multiple classes. It is written in vb and I know about creating objects of the class and using that instance to call functions of the class. But how do I create an object with constructors to allow another program written in C# to access my classes and functions and accept things from the program.
Hope this makes sense.
Do people practically ever use defensive getters/setters? To me, 99% of the time you intend for the object you set in another object to be a copy of the same object reference, and you intend for changes you make to it to also be made in the object it was set in. If you setDate(Date dt) and modify dt later, who cares? Unless I want some basic immutable data bean that just has primitives and maybe something simple like a Date, I never use it.
As far as clone, there are issues as to how deep or shallow the copy is, so it seems kind of "dangerous" to know what is going to come out when you clone an Object. I think I have only used clone() once or twice, and that was to copy the current state of the object because another thread (ie another HTTP request accessing the same object in Session) could be modifying it.
Edit - A comment I made below is more the question:
But then again, you DID change the Date, so it's kind of your own fault, hence whole discussion of term "defensive". If it is all application code under your own control among a small to medium group of developers, will just documenting your classes suffice as an alternative to making object copies? Or is this not necessary, since you should always assume something ISN'T copied when calling a setter/getter?
I'm having a hard time coming to grips with relational clausal logic, and I'm not sure if this is the place to ask but it would be help me so much with revision if anyone could provide guidance with the following questions.
Let P be the program:
academic(X); student(X); other_staff(X):-
works_in(X, university).
:-student(john).
:-other_staff(john).
works_in(john, university)
Question: Which are the Herbrand interpreations of P?
AS
I jave a 2D array like this, just like a matrix:
{{1, 2, 4, 5, 3, 6},
{8, 3, 4, 4, 5, 2},
{8, 3, 4, 2, 6, 2},
//code skips... ...
}
I want to get all the "4" position, instead of searching the array one by way, and return the position, how can I search it faster / more efficient? thz in advance.
Hi guys,
I started to use the new ConcurrentDictionary from .Net4 yesterday to implement a simple caching for a threading project.
But I'm wondering what I have to take care of/be careful about when using it?
What have been your experiences using it?
Friends!
Can someone point me to an explanation (subjective/ map) which untangles the complex mesh of technologies which kinda overwhelms a newbie who wants to get an understanding of what fits where in terms of software.
Thanks
What is the general idea of using breadth-first over the default depth-first search scheme in Prolog?
Not taking infinite branches?
Is there any general way to use breadth-first in Prolog? I've been googling around and I didn't find too much useful info for a novice.
sql = """
INSERT INTO [SCHOOLINFO]
VALUES(
'""" + self.accountNo + """',
'""" + self.altName + """',
'""" + self.address1 + """',
'""" + self.address2 + """',
'""" + self.city + """',
'""" + self.state + """',
'""" + self.zipCode + """',
'""" + self.phone1 + """',
'""" + self.phone2 + """',
'""" + self.fax + """',
'""" + self.contactName + """',
'""" + self.contactEmail + """',
'""" + self.prize_id + """',
'""" + self.shipping + """',
'""" + self.chairTempPass + """',
'""" + self.studentCount + """'
)
""";
I have the following code and Python keeps throwing the error that it cannon concatenate strings and nonetype objects. The thing is I have verified every variable here is in fact a string and is not null. I have been stuck on this for quite some time today, and any help would be greatly appreciated.
I want to be able to send files from an iPhone app to a computer. What would be the easiest way of doing this?
I've made simple server client programs before, but in those, the client has always needed to connect to the server before being able to receive messages from it. There is an app for the iPhone called iSimulate, where you put a server on a Mac (the iPhone simulator), and then you use the iSimulate app of an iTouch or iPhone to send touch events to the server. This app does not require you to type in an ip-address. Instead it presents a list of available computers that have this server up and running.
How exactly is this being done? Can a server broadcast a message over a network, w/o anyone being connected to the server? How does that work? How does a client listen for that broadcast?
Here's a video of the app I'm talking about:
http://www.youtube.com/watch?v=N3Qpd1ycZh4
if i run Server App. Exception occurs: on Dinle.Start()
System.Net.SocketException - Only one usage of each socket address (protocol/network address/port) is normally permitted
How can i solve this error?
Server.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace Server
{
public partial class Server : Form
{
Thread kanal;
public Server()
{
InitializeComponent();
try
{
kanal = new Thread(new ThreadStart(Dinle));
kanal.Start();
kanal.Priority = ThreadPriority.Normal;
this.Text = "Kanla Çalisti";
}
catch (Exception ex)
{
this.Text = "kanal çalismadi";
MessageBox.Show("hata:" + ex.ToString());
kanal.Abort();
throw;
}
}
private void Server_Load(object sender, EventArgs e)
{
Dinle();
}
private void btn_Listen_Click(object sender, EventArgs e)
{
Dinle();
}
void Dinle()
{
// IPAddress localAddr = IPAddress.Parse("localhost");
// TcpListener server = new TcpListener(port);
// server = new TcpListener(localAddr, port);
//TcpListener Dinle = new TcpListener(localAddr,51124);
TcpListener Dinle = new TcpListener(51124);
try
{
while (true)
{
Dinle.Start(); Exception is occured.
Socket Baglanti = Dinle.AcceptSocket();
if (!Baglanti.Connected)
{
MessageBox.Show("Baglanti Yok");
}
else
{
TcpClient tcpClient = Dinle.AcceptTcpClient();
if (tcpClient.ReceiveBufferSize 0)
{
byte[] Dizi = new byte[250000];
Baglanti.Receive(Dizi, Dizi.Length, 0);
string Yol;
saveFileDialog1.Title = "Dosyayi kaydet";
saveFileDialog1.ShowDialog();
Yol = saveFileDialog1.FileName;
FileStream Dosya = new FileStream(Yol, FileMode.Create);
Dosya.Write(Dizi, 0, Dizi.Length - 20);
Dosya.Close();
listBox1.Items.Add("dosya indirildi");
listBox1.Items.Add("Dosya Boyutu=" + Dizi.Length.ToString());
listBox1.Items.Add("Indirilme Tarihi=" + DateTime.Now);
listBox1.Items.Add("--------------------------------");
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("hata:" + ex.ToString());
}
}
}
}
Hi,
As a programmer, I know sometime all has to write some code which they think -"Thank God! It's done" or "Ohh, how did I write it?"...
Do you have any such piece of code.
how to sort a list in Scala by two fields, in this example I will sort by lastName and firstName?
case class Row(var firstName: String, var lastName: String, var city: String)
var rows = List(new Row("Oscar", "Wilde", "London"),
new Row("Otto", "Swift", "Berlin"),
new Row("Carl", "Swift", "Paris"),
new Row("Hans", "Swift", "Dublin"),
new Row("Hugo", "Swift", "Sligo"))
rows.sortBy(_.lastName)
I try things like this
rows.sortBy(_.lastName + _.firstName)
but it doesn't work. So I be curious for a good and easy solution.
Thanks in advance!
Pongo