I want to build a regex that matches PHP-style error messages in HTML source code.
Does anybody know of one that exists or how I can create a list of possible PHP error outputs?
So guys, there's plenty of different ciphers available - but which one is the safest to use nowadays?
List: http://www.php.net/manual/en/mcrypt.ciphers.php
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext import db
from google.appengine.api import urlfetch
class TrakHtml(db.Model):
hawb = db.StringProperty(required=False)
htmlData = db.TextProperty()
class MainHandler(webapp.RequestHandler):
def get(self):
Traks = list()
Traks.append('93332134')
#Traks.append('91779831')
#Traks.append('92782244')
#Traks.append('38476214')
for st in Traks :
trak = TrakHtml()
trak.hawb = st
url = 'http://etracking.cevalogistics.com/eTrackResultsMulti.aspx?sv='+st
result = urlfetch.fetch(url)
self.response.out.write(result.read())
trak.htmlData = result.read()
trak.put()
result.read() is not giving whole file , it giving some portion. trak.htmlData is a textproparty() so it have to store whole file and i want that only
I am getting lot of errors for HttpRequestValidationException in my event log.
Is it possible to HTMLEncode all the inputs from override of ProcessRequest on web page. I have tried this but it gives context.Request.InputStream.CanWrite == false always.
Is there any way to HTMLEncode all the feilds when request is made?
public override void ProcessRequest(HttpContext context)
{
if (context.Request.InputStream.CanRead)
{
IEnumerator en = HttpContext.Current.Request.Form.GetEnumerator();
while (en.MoveNext())
{
//Response.Write(Server.HtmlEncode(en.Current + " = " +
//HttpContext.Current.Request.Form[(string)en.Current]));
}
long nLen = context.Request.InputStream.Length;
if (nLen > 0)
{
string strInputStream = string.Empty;
context.Request.InputStream.Position = 0;
byte[] bytes = new byte[nLen];
context.Request.InputStream.Read(bytes, 0, Convert.ToInt32(nLen));
strInputStream = Encoding.Default.GetString(bytes);
if (!string.IsNullOrEmpty(strInputStream))
{
List<string> stream = strInputStream.Split('&').ToList<string>();
Dictionary<int, string> data = new Dictionary<int, string>();
if (stream != null && stream.Count > 0)
{
int index = 0;
foreach (string str in stream)
{
if (str.Length > 3 && str.Substring(0, 3) == "txt")
{
string textBoxData = str;
string temp = Server.HtmlEncode(str);
//stream[index] = temp;
data.Add(index, temp);
index++;
}
}
if (data.Count > 0)
{
List<string> streamNew = stream;
foreach (KeyValuePair<int, string> kvp in data)
{
streamNew[kvp.Key] = kvp.Value;
}
string newStream = string.Join("", streamNew.ToArray());
byte[] bytesNew = Encoding.Default.GetBytes(newStream);
if (context.Request.InputStream.CanWrite)
{
context.Request.InputStream.Flush();
context.Request.InputStream.Position = 0;
context.Request.InputStream.Write(bytesNew, 0, bytesNew.Length);
//Request.InputStream.Close();
//Request.InputStream.Dispose();
}
}
}
}
}
}
base.ProcessRequest(context);
}
I want to read a text file containing a space sepearted vlaues.Values are integers.
How can i read it and put it in a array list??
eg of contents of texx file
1 62 4 55 5 6 77
now i want a arraylist as [1, 62,4,55,5,6,77].
How do i do it in java?
i want to check select statement(string) is valid or not in c#.net, if select statement is right then retrieve data and fill dropdown list box else drop down should be empty
The scenario is I want to get the users who has less than 2 photos.
There are two table:
[Users] (UserId, UserName)
[UserPhotos] (PhotoId, PhotoName, UserId)
UserId is a Foreign Key but I do not want to use association like user.Photos.
A user may have none photo in the [UserPhotos] table.
How to use Linq To Sql to get List<User> who has less than 2 photos?
Hi All,
I have just taken over as manager at a company and at the moment they are very rigid in how they approach development. Everyone gets a list of what they are doing each week. My question is how does your company balance support with development and if an important support request comes in how is this processed without disturbing the flow of the developers?
Lastly, do you use an software log support requests and development tasks.
Thanks
I have a list of directories
/home
/dir1
/dir2
...
/dir100
Some of them have no files in it. How can I use Unix find to do it?
I tried
find . -name "*" -type d -size 0
Doesn't seem to work.
I have two data grids. The first auto-loads a list of items (json data store). OnCellClick the first grid fires a dynamically parametrized url and loads data into the second grid. It works fine, but the pagination of the second grid does not focus the new context.
What shall I do to make the pagination work with the new url?
I'm opening a 2005 SSIS pakage and also an old C# project..both are in this solution here. I'm missing namespaces and I can't find the assemblies to add back to my references folder for my C# Project
Microsoft.SqlServer.Dts.Pipeline
for example is not one I find in the list of references in the .NET references tab. So how the hell do I get these SQL Server assemblies? Do I have to install the SQL Server 2008 sdk?
Lost.
I just want to copy list of files displayed in eclipse search tab,
When i try using right click copy and paste into some folder it does not work.It actually copies the file location rather than the file itself
I am developing the web site, It consists of device name list and related Build Button. When one click the Build button the one process will run in server. When more than ten user click the Build button more processes will create at that server will hang. How can send all request from client to single process in server.
I've a hard time understanding signs I see in my text editor vim. I see signs like ^@ and ^A and ^M and ^F. What does this mean? Is there any structured list of these signs and their meaning?
Trying to Google it is a dead end since Google will not search for "^@".
Hi!
I have a static library static_library.a
How to list functions and methods realized there.
or at least how to look is there concrete function 'FUNCTION_NAME' realized?
<select><option><input type="checkbox" />Headache</option></select>
By using the above code i did't get a check box inside a combo box list.Can you suggest me , how should i proceed.
How can i return Last Insert Id on my store procedure using MySQL and use them with Nhibernate?
When i am inserting recording using Nhibernate + mysql store procedure then i am getting error that result not found
IQuery qry = session.CreateSQLQuery(string.Format("{0})", qryString)).AddScalar("ProductID", NHibernateUtil.Int32);
qry.List();
tx.Commit();
In a single-module project, I don't see how to get a 'classified' artifact from the project itself into the descriptor and thus the assembly. Do I list it as a dependency?
Hey guys, there is a form where the user select some of his friends and I'm curious on how I can implement a list that searches simultaneously while the user is typing a friend's name and when he selects the name the name is written in the text box(jQuery). And if the user wants to select more than one friend, when I'm inserting the names in the database, how can I separate the names that are written in one input field?
. I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue Can you please advice.
Employee emp = new Employee();
comHandledBySQt.DataSource = from x in emp.GetDataFromTable("1")
select new { x.Id, Name = x.FirstName + " " + x.LastName };
comHandledBySQt.DisplayMember = "Name";
comHandledBySQt.ValueMember = "Id";
Above code should displays drop list of employees first name and last name in a combo box
I'm creating a digg-like site using Ruby on Rails that ranks the item (based on this algorithm). I'm using the will-paginate gem list the items in pages.
The problem is, will-paginate only allows me to insert ':order =' based on the table data. I would like to make will-paginate to sort by a number which is calculated using a function based on different fields on the table (e.g number of votes, age hours).
How can I do that?
I am writing a driver to act as a wrapper around two separate MySQL connections (to distributed databases). Basically, the goal is to enable interaction with my driver for all applications instead of requiring the application to sort out which database holds the desired data.
Most of the code for this is in place, but I'm having a problem in that when I attempt to create connections via the MySQL Driver, the DriverManager is returning an instance of my driver instead of the MySQL Driver. I'd appreciate any tips on what could be causing this and what could be done to fix it!
Below is a few relevant snippets of code. I can provide more, but there's a lot, so I'd need to know what else you want to see.
First, from MyDriver.java:
public MyDriver() throws SQLException
{
DriverManager.registerDriver(this);
}
public Connection connect(String url, Properties info)
throws SQLException
{
try { return new MyConnection(info); }
catch (Exception e) { return null; }
}
public boolean acceptsURL(String url)
throws SQLException
{
if (url.contains("jdbc:jgb://"))
{ return true; }
return false;
}
It is my understanding that this acceptsURL function will dictate whether or not the DriverManager deems my driver a suitable fit for a given URL. Hence it should only be passing connections from my driver if the URL contains "jdbc:jgb://" right?
Here's code from MyConnection.java:
Connection c1 = null;
Connection c2 = null;
/**
*Constructors
*/
public DDBSConnection (Properties info)
throws SQLException, Exception
{
info.list(System.out); //included for testing
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url1 = "jdbc:mysql://server1.com/jgb";
String url2 = "jdbc:mysql://server2.com/jgb";
this.c1 = DriverManager.getConnection(
url1, info.getProperty("username"), info.getProperty("password"));
this.c2 = DriverManager.getConnection(
url2, info.getProperty("username"), info.getProperty("password"));
}
And this tells me two things. First, the info.list() call confirms that the correct user and password are being sent. Second, because we enter an infinite loop, we see that the DriverManager is providing new instances of my connection as matches for the mysql URLs instead of the desired mysql driver/connection.
FWIW, I have separately tested implementations that go straight to the mysql driver using this exact syntax (al beit only one at a time), and was able to successfully interact with each database individually from a test application outside of my driver.
Hi,
I have a list of 'n' contact ids corresponding to which I need to obtain the contact details. One simple way to make n queries using the contact ids and retrieve those contacts. But this will be very time-consuming especially if n is large. I would like to know if there is any simpler way to obtain these results (like batch query etc).
I have this code to get the Cursor once for this instance, and the Log shows it is called many times although I marked as final. What I am missing?
private Cursor getAllContactsCached() {
final Cursor c=this.getList();
return c;
}
getAllContactsCached method should retrieve list once, and the 2nd time it should reuse the final object for return
Hello Folks,
I am trying to develop a application where
The user 'X' has logged into Facebook
app has a set of email addresses (possible friends of user 'X')
app gets the list of friends of user 'X' (uids)
Want to check if user with email address [email protected] is a valid facebook user by using email address and is user X's friend (basically a uid to email mapping)
Thanks!