Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What is the best Perl module to be used in OO style to manage sending response to the client browser with headers, cookies, response codes, redirects. Should be standalone module not part of a framework, I use Moose and CGI::Simple only.
I know I can manually send headers and cookies but I want more control with easy interface.
print "Set-Cookie: $n=$v;$expires;path=/\n";
print "Content-type: text/html;charset=utf-8\n\n";
Interface should be like:
$response->set_header(...);
$response->set_cookie(...);
$response->set_code(404);
$response->redirect(url);
$response->content(...);
I searched cpan.org about response and http keywords but did not get helpful results.
You're probably looking for Plack, which most of the frameworks use to handle exactly that. Though you really should use a framework.
You may use the most common HTTP::Response.
This question is really opinion based. So IMO, youre looking for
the Poet - uses Plack::* and
Mason what is using Moose for processing, e.g. query params handling and so on...
If don't want Poet, you can use Mason without Poet directly with Plack, but you loosing an great config management, session handling a much more...
The interface inside of components are like you want, e.g:
$m->redirect("http://somesite.com", 302);
my $user_agent = $m->req->headers->header('User-Agent'); #access headers
$m->res->content_type('application/json'); #set header
$m->print(JSON::XS::encode_json($data));
and so on..
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I release a bunch of tools for free, but recently I have began to sell an application, that has private research, and people have been able to get my source code, and one person publically released my entire source. I spent a lot of time on this program, just to have someone crack it, and release my entire source.
How can I go about protecting my program? I have tried HWID, but people are still able to crack it. I know I am limited by C#, but it the most convenient to use. I just need a way to protect my programs from people trying to do this.
You could have a look at the many obfuscation tools that are out there, for example these:
http://gapotchenko.com/eazfuscator.net
http://orangeheap.blogspot.nl
http://confuser.codeplex.com (succeeded by https://yck1509.github.io/ConfuserEx/ and then again by https://github.com/XenocodeRCE/neo-ConfuserEx)
http://ntoolbox.com)
Well, the problem with languages like C#/Java is that they are generally much easier to de-obfuscate. The way to secure this is generally to put this stuff into a webservice, but you said you couldn't really do that. What about porting specific non-trivial functions over to a language like C, and obfuscate that. Your C# program could then use reflection to make calls to this external/unmanaged dll. It would increase the difficulty for de-obfuscating, but the problem is that if someone wants it bad enough, they can figure it out as it is client-side.
It may be that legal action is the only real solution here, but this is not a site for legal advice, and I am not qualified to give it if it were.
Additionally, this could be a business decision. Consider Making your software open-source and post a donation link. I am also not qualified to give business advice, but this is worth considering. It may actually increase your revenue, not to mention the other benefits that come with releasing open-source software.
There's Dotfuscator (http://www.preemptive.com/products/dotfuscator/overview). But the best solution in some cases is to offer what you do as a web site (Software as a Service).
Consider this tool for example to convert VB to C#: http://converter.telerik.com/
Or this tool to format JSON: http://jsonformatter.curiousconcept.com/
This may or may not work for you. I don't know what the nature of the software you're trying to protect is.
No, your code needs to contain the information needed to decrypt itself, its an impossible problem to solve.
Your best solution is to put your intellectual property on a server in the cloud that only you have access to. Give your customers a unique login, audit their access to check for abuse, off load as much grunt work onto your customers machines, but keep your algorithms locked into the cloud.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I might ask something stupid but I want to learn some web scraping. I already know how to use perl, so I would prefer to do it using this language. I know there are a lot of modules on CPAN, I tried to read those but I barely understand something. I haven't found anthing that would explain from zero what this process means. I could use some help with some links or some materials to study a little web scraping.
Thanks!
At a pretty basic level, 'web scraping' is just downloading a webpage, and parsing it to extract the information you want. At a started level, the module you want is LWP that lets you fetch content, and then 'something' to extract the information you want. HTML::Parser or HTML::TableExtract for example. There's nothing to say you can't roll your own using pattern matching of course, but ... well, processing HTML isn't a new problem, so why re-invent the wheel?
At a more advanced level though, you might want to interact with a site - log in to it perhaps, or 'click through' some menus. For this, I like WWW::Mechanize.
I'm afraid I can't give you much more without a better understanding of the sort of problem you're trying to solve though. Are you at a basic 'fetch a webpage and parse' sort of level?
(You can find details and examples of the above modules on CPAN. The LWP page has some examples that should get you started.)
I wrote a pretty basic tutorial on WWW::Mechanize here
..I have successfully crawled pages on several occasions so please let me know if you have a case you would like to try and need some help :)
To start you can look at WWW::Mechanize and HTML::TreeBuilder::XPath modules.
In my opinion, the best module for web scraping is Web::Scraper. Its language can be quite terse at times, but there are plenty of examples.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am a C# developer which I specialize in Win forms and web application. I work in financial field and most of my experience is connecting to Oracle/sql/sybase and get data and display on the screen.
Recently I taught myself how to develop iPhone / iPad applications. It went very well. Now I want to learn how to connect using web services to my own databases and get data or upload data.
So I need to learn Web services, SOAP, WSDL and whatever else that I need. I don't have any experience in it but if someone can direct me to the right books I will buy them and read them. i want to start writing in my office and connect to my databases and be able to do a proof of concept. Any ideas?
Particularly because you're starting out, I would suggest looking at RESTful services. The API is essentially a URL using HTTP GET, PUT, POST, or DELETE. The output can be XML, JSON, whatever you want. Very simple to construct and test. And because the API is so simple, you don't necessarily need to add another library to your project and increase the code size.
The second chapter of the book iPhone Games Projects talks about how to use a RESTful rankings system to record game scores to a server from an iPhone game.
I don't think you need books for that subject. Try using some API's to make your life easier, and check some code samples. For example:
For JSON, SBJSON is a standard: https://github.com/stig/json-framework/
For XML, have a look at this Apple example: https://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007323
An easy way to retrieve info from a online database is to use PHP. You simply call a PHP file located on your server from your iPhone application. The PHP file takes in info you sent it via GET/POST methods (if required), retrieves info from your database, and echo's it in XML/JSON.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Where is a good place to learn how to use CGI with perl for making websites?
I will be running on Linux with apache2, but there is a possibility I may run on Windows for our company. I need to make a site for internal use only, that one might run on Windows with IIS.
If you’re not forced into CGI, forget about it – it’s obsolete & sucks. Some alternatives are listed in this related question.
The CGI module from CPAN is the canonical starting point for basic CGI scripts, and there are a lot of reasons to use it versus handling your own param parsing. CGI.pm (the module) handles behind the scenes a lot of things that you don't want to have to build yourself. If you need to maintain state, CGI::Session helps. And if you plan on expanding beyond simple CGI scripting you can plan larger applications around CGI::Application in combination with a templating solution.
For the output side, Template::Toolkit or HTML::Template are commonly used.
There is the somewhat outdated book, CGI Programming with Perl (O'Reilly). Though it is outdated it does give a good overview and starting point for basic CGI. I wouldn't hesitate to recommend purchasing a used copy (there are copies available used online starting for the cost of shipping). It's definitely worth reading through. Even though it doesn't address some of the more modern issues such as Unicode, it still lays out for you the start to finish CGI process. That alone is worth the read.
Perhaps start by reading the POD for CGI, and later for CGI::Session. Build from there.
There is so much more to the "state of the art" nowadays than simple CGI, but you have to start somewhere. If your plan is to develop complex sites, beyond what CGI::Application can facilitate, you'll start wondering about Catalyst, Mojolicious, and other frameworks. But that's a different topic. The old saying from Economists, "It depends..." It depends on what you want to accomplish, whether CGI will be a good fit versus a more robust and scalable framework.
If you can, forget CGI.
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm --interactive Task::Plack
will run a while (bit long), but will install for you the basics for modern perl/web development - Plack and several middle-wares.
Read step-by-step thru fantastic Miyagawa's Plack advent calendar, and after a while you will be an perl/web/app-dev/guru. ;)
Module CGI will fill your CGI needs. As for making web sites, that has nothing to do with CGI, and I don't have a reference handy.
Where is a good place to learn how to
use CGI with perl for making websites?
I suggest a good history book that talks about the "dot-com boom" of the mid to late 90s - that's about the time period when CGI was in common use.
If, on the other hand, you'd like to learn something that's still relevant today, I suggest looking at mod_perl or FastCGI, using a framework such as Catalyst or Plack.
Please don't learn CGI. Learn instead a modern and clean Perl web engine such as Dancer or Mojolicious. And if you want to understand the lower levels of the modern Perl 5 stack, read about PSGI.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm building some custom tools to work against a JIRA install, and the exposed SOAP API is great, except that none of the arguments are named.
For example, the prototype for getIssue is:
RemoteIssue getIssue (string in0, string in1);
All of the SOAP RPC methods follow this convention, so without documentation I'm pretty hardpressed to figure out what to pass on a lot of these.
Does anyone know of a definitive API documentation guide?
Found the javadoc:
http://docs.atlassian.com/software/jira/docs/api/rpc-jira-plugin/latest/index.html?com/atlassian/jira/rpc/soap/JiraSoapService.html
I've found that it's pretty simple to intuit what the parameters are supposed to be. Depending on how complicated you're going, you might be able to guess what you're supposed to pass.
There's one super important one though (this is Python with SOAPpy):
self.proxy = WSDL.Proxy( jiraUrl )
self.token = self.proxy.login(self.username, self.password)
...
issues = self.proxy.getIssuesFromFilter(self.token, args[0])
After getting the token from the login() method, you need to pass it in as a parameter to all of the other SOAP calls. After figuring that out, it's been pretty straightforward to figure out what the parameters should be (for example, getIssuesFromFilter should take the filterId as its other parameter)
See http://confluence.atlassian.com/display/JIRA/JIRA+RPC+Services for all JIRA RPC services
The javadoc link you found is the correct one. You should also know that not everything is exposed via the SOAP or RPC interfaces, but you can do just about anything using the REST interface. Unfortunately, the REST interface isn't well documented, but you can use an HTML traffic inspector tool (like Fiddler for IE) to grab the actual POST data sent to the server from the web interface and piece together the interface for the particular call you need. Not always the easiest way but it does work.