I love coding and designing applications but there is something annoying me so much. Some times I can't focus and understand what I am reading when learning new code or a new subject or whatever and that really annoys me because It causes me to read again and again and again which really puts me off and frustrate me.
Does something like this happen to you or is there some problem with me ?
Well, I have read several user guides and watched dozens and dozens of video tutorials on how to program with Python, and feel pretty confident about writing simple applications for it. My main point in my question is, where would I be able to learn more advanced programming knowledge about Python?
Hello Everyone
I am using magento 1.4.0.1
I want to install new features using magento connect but whenever I go to
System magento Connect magento Connect manager I get a 404
I have read that it could have to do with rights. But the rights of which folders?
Thanks very much.
I've already read all available documentation and I cannot find a solution.
I have a calendar outside of the grid which on click returns a date. All I need to do is filter my jqGrid based on that date. Can someone point me to the correct API method?
Thanks!
Python says I need 4 bytes for a format code of "BH":
struct.error: unpack requires a string argument of length 4
Here is the code, I am putting in 3 bytes as I think is needed:
major, minor = struct.unpack("BH", self.fp.read(3))
"B" = Unsigned char (1 byte) + "H" unsigned short (2 bytes) = 3 bytes (!?)
struct.calcsize("BH") says 4 bytes.
How can I use authentication with System.ServiceModel.Syndication to read a private RSS?
The code I use right now just returns forbidden.
I have tried adding &PASS=password and &PASSWORD=password to the URL but it doesnt help.
try
{
using (XmlReader reader = XmlReader.Create("http://trac:8080/Project/report/7?format=rss&USER=enr"))
{
tracFeed = SyndicationFeed.Load(reader);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Is it possible to read cookie expiration time with php ?
When I print_r($_COOKIE) it outputs:
Array
(
[PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f
[userId] => 1232
[userEmail] => [email protected]
[firstName] => user
[lastName] => user
)
So I think $_COOKIE don't have the expiration time, is it possible with some other function?
Hi,
I'm calling servlets which has implemented CometProcessor interface, and whenever I try to call the servlets with get request, I'm getting the above error. May I know the reason?
public class ChatServlets
extends HttpServlet implements CometProcessor {
public void event(CometEvent event)
throws IOException, ServletException {
HttpServletRequest request = event.getHttpServletRequest();
HttpServletResponse response = event.getHttpServletResponse();
if (event.getEventType() == CometEvent.EventType.BEGIN) {
response.getWriter().println("Welcome ");
} else if (event.getEventType() == CometEvent.EventType.READ) {
response.getWriter().println("Bye");
}
}
}
Hi I have postfix running on my Mail Server. I want the following functionality using java program
Whenever a new mail comes i came to know using postfix. but I want a java program which can read this newly coming email.
Thanks
Sunil Kumar Sahoo
Are there are decent implementations of a vector graphics canvas in GWT? I would like to be draw arbitrary shapes and have them react to user input (mouse in/out/click/etc). There are wrappers for the HTML canvas, but that feature is not supported in older browsers (read: IE).
So I've been digging into how the stdio portion of libc is implemented and I've come across another question. Looking at man setvbuf I see the following:
When the first I/O operation occurs on
a file, malloc(3) is called, and a
buffer is obtained.
This makes sense, your program should have a malloc in it for I/O unless you actually use it. My gut reaction to this is that libc will clean up its own mess here. Which I can only assume it does because valgrind reports no memory leaks (they could of course do something dirty and not allocate it via malloc directly... but we'll assume that it literally uses malloc for now).
But, you can specify your own buffer too...
int main() {
char *p = malloc(100);
setvbuf(stdio, p, _IOFBF, 100);
puts("hello world");
}
Oh no, memory leak! valgrind confirms it. So it seems that whenever stdio allocates a buffer on its own, it will get deleted automatically (at the latest on program exit, but perhaps on stream close). But if you specify the buffer explicitly, then you must clean it up yourself.
There is a catch though. The man page also says this:
You must make sure that the space that
buf points to still exists by the time
stream is closed, which also happens
at program termination. For example,
the following is invalid:
Now this is getting interesting for the standard streams. How would one properly clean up a manually allocated buffer for them, since they are closed in program termination? I could imagine a "clean this up when I close flag" inside the file struct, but it get hairy because if I read this right doing something like this:
setvbuf(stdio, 0, _IOFBF, 100);
printf("hello ");
setvbuf(stdio, 0, _IOLBF, 100);
printf("world\n");
would cause 2 allocations by the standard library because of this sentence:
If the argument buf is NULL, only the
mode is affected; a new buffer will be
allocated on the next read or write
operation.
hello...i have a problem with my project..i want to use barcode scanner for input data to textfield (i'm using jquery). this barcode scanner read serial number and model name of each product..but after scan, serial number and model name appear in one textfield. how to make them appear separately into different text field..first textfield for serial number and second textfield for model name...
is there some code to make it??use ajax,javascript or something else??
I'm trying to read XML that is being pushed to my java app. I originally had this in my glassfish server working. The working code in glassfish is as follows:
public class XMLPush implements Serializable
{
public void processXML()
{
StringBuilder sb = new StringBuilder();
BufferedReader br = null;
try
{
br = ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getReader ();
String s = null;
while((s = br.readLine ()) != null)
{
sb.append ( s );
}
//other code to process xml
...........
.............................
}catch(Exception ex)
{
XMLCreator.exceptionOutput ( "processXML","Exception",ex);
}
....
.....
}//processXML
}//class
It works perfect, but my client is unable to have glassfish on their server. I tried grabbing the raw xml from php, but I couldn't get it to work. I decided to open up a socket and listen for the xml push manually. Here is my code for receiving the push:
public class ListenerService extends Thread
{
private BufferedReader reader = null;
private String line;
public ListenerService ( Socket connection )thows Exception
{
this.reader = new BufferedReader ( new InputStreamReader ( connection.getInputStream () ) );
this.line = null;
}//ListenerService
@Override
public void run ()
{
try
{
while ( (this.line = this.reader.readLine ()) != null)
{
System.out.println ( this.line );
........
}//while
} System.out.println ( ex.toString () );
}
} catch ( Exception ex )
{
...
}//catch
}//run
I haven't done much socket programing, but from what I read for the past week is that passing the xml into a string is bad. What am I doing wrong and why is it that in glassfish server it works, and when I just open a socket myself it doesn't?
this is all that I receive from the push:
PUT /?XML_EXPORT_REASON=ResponseLoop&TIMESTAMP=1292559547 HTTP/1.1
Host: ************************
Accept: */*
Content-Length: 470346
Expect: 100-continue
<?xml version="1.0" encoding="UTF-8" ?>
Where did the xml go? Is it because I am placing it in a string? I just need to grab the xml and save it into a file and then process it. Everything else works, but this.Any help would be greatly appreciated.
I'm trying to specify a relative directory in the web.xml file. I basically want it to read the "data" folder underneath "web-inf", but nothing I've tried seems to work.
"/data" translates to the data folder in the root directory (I'm using windows).
"data" translates to "C:\Program Files\Eclipes\data"
"${CATALINA_HOME}/[etc...]" doesn't seem to work either.
Any ideas?
Hi All,
I need to read a PNG file and interpret all the information stored in it and print it in human readable format. While working on PNG, i understood that it uses CRC-32 for generating checksum for each chunk. But I could not understand the following information mentioned on the PNG file specification site:
The polynomial used by PNG is:
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1
Here is the link for reference:
http://www.w3.org/TR/PNG/
Can anyone please help me in understanding this?
Regards,
darkie
I have the following code:
f = open(path, 'r')
html = f.read() # no parameters => reads to eof and returns string
soup = BeautifulSoup(html)
schoolname = soup.findAll(attrs={'id':'ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel'})
print schoolname
which gives:
[<span id="ctl00_ContentPlaceHolder1_SchoolProfileUserControl_SchoolHeaderLabel">A B Paterson College, Arundel, QLD</span>]
when I try and access the value (i.e. 'A B Paterson College, Arundel, QLD) by using schoolname['value'] I get the following error:
print schoolname['value'] TypeError: list indices must be integers, not str
What am I doing wrong to get that value?
hi
i am using jsp, in that one i used search box with 'id' i want to read that id to javascript file...
but document.getelementbyid() is not working...
Does anyone know if there is any API exposed to manage repository permissions within SharpSVN? For example, programatically adding read and write permissions on a per repository basis.
Alternatively, any other thoughts on managing permissions with other SVN APIs? Worst case wil be manually managing the contents of svnaccessfile but this is a last resort. Thanks.
How do I ensure that an app.config file gets read on assembly initialization, for .Net 3.5-4 ?
It's a class library assembly. VS2008 provides a menu to add an app.config file, but it's ignored so far.
I need to use the app.config to provide information for logging from the assembly.
Thanks in advance!
I am creating a script that allows the user to choose their own timezone...
If I am to make this work, how do I store dates in the database so that every timezone will read it, and show the correct date in their timezone?
Do I store the date as GMT and then when a user with the timezone GMT +10 selected views the item within my script, I show that date in GMT +10 time?
Is there a better way to do this?
Examples would be great :)
I just purchased a license to ReSharper 5.0 and it has been almost impossible to edit ASPX pages. I read somewhere that I can disable code analysis on a single page with the following command "Ctrl+Shift+Alt+8". But it also hasn't worked.
Is there a way to disable ReSharper Code Analysis on all ASPX pages?
Hello: we currently do not use asp.net controls (no web forms). The way we do is:
1 Read HTML file from disk
2 lookup database, parse tags and populate data
finally,
Response.Write(page.ToString());
here there is no possibility of using asp.net controls. What I am wondering is, if we use asp.net controls in those HTML files, is there way to process them during step 2?
Thanks and appreciate your response.
Hello,
I'm curious, whether there is any way to print formated numpy.arrays, e.g., in the way similar to this:
x = 1.23456
print '%.3f' % x
If I want to print the numpy.array of floats, it prints several decimals, often in 'scientific' format, which is rather hard to read even for low-dimensional arrays. However, numpy.array apparently has to be printed as a string, i.e., with %s. Is there any solution ready for this purpose? Many thanks in advance :-)