Python PyPDF - EOF Marker Not Found - pypdf

I have seen other articles that talked about doing something along the lines of:
fileOpen = file(file_name,'a')
fileOpen.write("%%EOF")
file.close()
But this does not work For me. Anyone have any clue why that's the case? I've been searching on this site and others, but have yet to come up with an answer. I am using Python btw in Backtrack Linux.

For anyone who's curious, I just had forgotten that pyPDF only supported PDF files, and this is why it generated this error when I tried getting the metadata from other files. Stupid part on my end.

Related

onvif with gsoap 2.8.62 version get error code (SOAP_EMPTY 52)

I get SOAP_EMPTY using gsoap, I have searched for a long time and had no answer,SOAP_EMPTY is newly added to gsoap,and it seems I'm the unlucky guy to meet this problem.
Here is where my code come from:https://github.com/miibotree/ONVIF/blob/master/main.c
Now soap_call___tds__GetCapabilities will return code SOAP_EMPTY,I'm now using gdb to track this problem it seems that I need to set a valid soap->id to avoid this problem,but I'm a fresh guy with onvif and don't know how to set a valid soap->id,and now I'm reading various docs about onvif and trying to solve it.
Hope any guys could help me, sinch searching so many docs makes my eyes pain and I still haven't found the answer,thanks.
SOAP_EMPTY is a validation failure. This error indicates than an element/attribute is empty but is supposed to have content. For example an integer value should not be an empty string. The old error generated by older gSOAP releases in this case was SOAP_TYPE which was less informative. In either case, validation fails. The best way to find out is to use soap_print_fault() and soap_print_fault_location()` where the latter call shows the location in XML where the problem is. Our ONVIF testing with gSOAP did not reveal such an issue.

Ember CLI project crashes when I change CSS file. Am I missing something?

I'm pretty new to Ember but have used Ember CLI to create a project and am on my way. Lots to learn but I'm very impressed so far.
Anyway, my understanding is that Ember CLI projects use broccoli's file-watching features to create a "continuous development" environment. I've seen it in action: as I change templates or javascript files, my changes are immediately apparent when I switch back to the browser.
But when I make changes to css files, my app crashes. Console output is below. Note that when I restart the app with ember server, everything works as exepected. So this isn't some CSS syntax error or the like.
So ... this sure seems like a bug to me, but I'm so new around here that I'm wondering if I'm just missing something very basic.
We're not talking SASS files, either. I'm getting this error if I change a single character in a very small /app/styles/app.css - the one generated by ember new. I've also tried moving the style rule to a file called my.css and leaving app.css empty except for this one line: #import 'my.css'; No love.
Can anyone help? Thanks in advance,
-Billy B
D:\BitBucket\dispatch-alert\node_modules\ember-cli\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:246
Object.keys(this.dirRegistery[dir]).forEach(function(file, i, arr) {
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at Watcher.detectChangedFile (D:\BitBucket\dispatch-alert\node_modules\ember
-cli\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:246:10)
at Watcher.normalizeChange (D:\BitBucket\dispatch-alert\node_modules\ember-c
li\node_modules\broccoli-sane-watcher\node_modules\sane\index.js:280:10)
at FSWatcher.EventEmitter.emit (events.js:98:17)
at FSEvent.FSWatcher._handle.onchange (fs.js:1039:12)
Update:
Based on the help I've gotten so far (thank you guys) and poking around a bit, I have a theory: because I can edit files in other directories and other editors just fine, I conclude that app/styles is just plain not in the list of "watched" directories. This could be a simple error of omission, but I"m wondering if it isn't deliberate. Wouldn't this directory be one that is processed by Compass and other CSS preprocessors, which might have their own file watching systems or otherwise have problems with watched files? Perhaps the makers of ember-cli have deliberately omitted this directory?
How do I find this out? And what should I do? Head over to the ember-cli project and ask for assistance there? I tried to find where a list of watched directories might be kept, but have so far been unsuccessful.
A workaround for the moment is to alter the index.js in line 246 (according in your error and my error messages) in the sane module and add something like this:
if (!this.dirRegistery[dir]){
console.log('error',' empty/unkown dir',dir);
callback();
return;
}
No idea if this is is valid fix. Somehow this is related to sublime. (Caching, File-lock?)..

Bad permalinks adding "%20%E2%80%8E"

Can anybody help me on this issue? It's very important to my site.
Some (although not all) of my permalinks won't work. Some work perfectly and some are having variants of this "%20%E2%80%8E" added to the end of them, which obviously is giving me the 404 message.
I've tried deactivating plug ins but had no difference and obviously as some work, it is unlikely to be that. I have also checked for hidden characters but cannot seem to find any.
Can anybody think of a viable reason/solution for this error?
Thanks
If you are using c# .net then before open the url just encode it.
ReplacedString = HttpUtility.UrlEncode(YourString);

How to drawTextBlock in zend PDF

I using ZendFW 1.7.2 in my project and need to save PDF file. i am success for use function drawText but some of my data is too long so i need it break line. Now i get a solution from
http://devzone.zend.com/1776/creating-pdf-documents-with-zend-framework/
that use function drawTextBlock but when i test with it.It's can't success any always return errors
Fatal error: Call to undefined method Zend_Pdf_Page::drawTextBlock()
I think it's relate problem with something configuration ?Anyone used to success on it? please share it to me, I am looking to see your reply soon.
Thanks
DrawTextBlock is not existing in Zend Framework as it is a proposal for a improvement by Nico Edtinger. See: http://framework.zend.com/wiki/display/ZFPROP/Zend_Pdf+text+drawing+improvements+-+Nico+Edtinger
The solution provided on Zend Framework PDF multiline problems probably will help you further.

How can I download Yahoo Groups?

I want to download some Yahoo Groups (files, photos, messages, memberlist) and I've found these scripts:
http://freshmeat.net/projects/grabyahoogroup/
http://sourceforge.net/project/showfiles.php?group_id=62034
I've downloaded ActivePerl and the needed modules from CPAN (nothing fancy; they're very easy to find). I've managed to install them, but when I run the script I get an error after it tells me that I've successfully logged in:
"Use of uninitialized value $cells in pattern match (m//) at yahoogroups_files.pl line 244, line 2."
I'm guessing that Yahoo changed the layout of the page or something, but I'm not able to update the script myself. I'm a newbie when it comes to Perl and understanding the way Yahoo generates the pages, I only know some basic C++. I want to mention that I'm not lazy, I'll try do fix it myself but I need your help: hints, advice, anything.
PS: I've contacted the author, but he isn't willing to update the scripts.
You would need knowledge in the following fields:
use of an html parser
http knowledge ( get/post/head )
web scraping
I suggest you focus on WWW::Mechanize since it's capable of all these things ( and more )
EDIT: another solution ( that doesn't need programming ) , is this: login with your browser on yahoo groups, store the cookie, and then run wget , passing the stored cookie as a parameter. This way you'll get the task accomplished very fast.
Find your browser's cookies.txt file on your harddrive, and then call wget like this ( if I remember the commands correctly ) :
wget --load-cookies path_to_cookie_file -r -w 60 website
The full man page can be found here
EDIT2: Another option is to use WebDriver to automate firefox. You can use this article as a guide on how to accomplish this.
By the filename I'm assuming you're using Yahoo Group archiver found here: http://sourceforge.net/projects/grabyahoogroup/
I ran the files script against the SubEthaEdit group and it works great. All of the files downloaded without incident.
Looking at the code it seems to barf while processing an html table in a while loop if $cells is empty.
Considering the code did work when I tested it it's possible there's something going on with the listing of that group's files. You'll want to try outputting $content and figure out where and why the regular expression on 243 isn't able to process that html.
EDIT: If you don't mind posting the group this is happening with I'm sure myself or someone else here can try it out and troubleshoot on their own. It's tough to pinpoint what's up when the issue can't be duplicated. Also, try the same group I did and see if it works out for you. Certainly something up with the group you're trying if that works.
Dunno if it will help you, but here's what I did to get the message-download working:
http://sourceforge.net/forum/forum.php?thread_id=3283915&forum_id=209170
(I only used message-download, I didn't look at file-download)
Was tinkering on this a while ago to backup my girlfriend's group messages and files from uni. Upon debugging on the latest scripts I've found out that there seems to be a bug on group_domain declaration (theres also a group declaration bug that i've found on yahoo2maildir.pl of the same project, see $request)
($group_domain) = $url =~ /\/\/(.*?groups.yahoo.com)\//;
in this case, i've overwritten the $request var under the function sub download_folder() with
from <br>
$request = GET "http://$group_domain/group/$group/files$sub_folder/";
<br> to <br>
$request = GET "http://**groups.yahoo.com/group/$user_group**/files$sub_folder/";
grabyahoogroup works well in the latest edition, which can be found at the svn repo:
http://grabyahoogroup.svn.sourceforge.net/viewvc/grabyahoogroup/trunk/yahoo_group/
The version at sourceforge.net/projects/grabyahoogroup/files/ HAS BUGS AND DID NOT WORK FOR ME.
I've been looking for a tool that collects messages/conversations from Yahoo Groups!. I finally found this tool that converts your Yahoo! Groups messages into MBOX format after struggling to try to make my own and searching everywhere on the internet.
Download tools
Both of the following are Google Chrome extensions.
Chrome Extension to Download Members posted by Sam Hobbs (2015).
Chrome Application To Download Messages posted by Mark Fletcher (Jan 2016).
Plain string to Base64 binary data
At some time past September 16, 2010 (at least for me), the messages retrieved are no longer plain text and instead Base 64 binary data (ASCII). Using this swiss converter tool can allow you to read the data as it is.
Sample content from the MBOX format
VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4=
Sample result after conversion
The quick brown fox jumps over the lazy dog.
for cause, as of 2019/09
https://github.com/csaftoiu/yahoo-groups-backup
.....