Hi,
I've used the java compiler tree api to generate the ast for java source files. However, i'm unable to access th comments in the source files.
So far, i've been unable to a way to extract comments from source file .. is there a way using the compiler api or some other tool ?
Hi,
I want to change the maximum file upload size in my website, for this i'm going to add some code lines in my .htaccess file.
i have searched in google and i got the lines of code to add in .htaccess file. But i don't know exactly were to add that lines of code .
Below is the lines of code currently in my .htaccess file
code below
-FrontPage-
IndexIgnore .htaccess /.?? *~ *# /HEADER */README* */_vti*
order deny,allow
deny from all
allow from all
order deny,allow
deny from allenter code here
AuthName www.mysite.com
AuthUserFile /www/htdocs/domains/s11/01712/www.mysite.com/webdocs/_vti_pvt/service.pwd
AuthGroupFile /www/htdocs/domains/s11/01712/www.mysite.com/webdocs/_vti_pvt/service.grp
AddHandler php5-script .php
Here is the code to add
php_value post_max_size 50M
php_value upload_max_filesize 50M
how to add this lines of code in .htaccess file and where??
Please help me..
Thanks
For many methods in .NET, the exceptions they can potentially throw can be as many as 7-8 (one or two methods in XmlDocument, Load() being one I think, can throw this many exceptions).
Does this mean I have to write 8 catch blocks to catch all of these exceptions (it is best practise to catch an exception with a specific exception block and not just a general catch block of type Exception).
How do I use this information?
Thanks
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "this is the test");
emailIntent.putExtra(Intent.EXTRA_TEXT, "testing time");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
Hi,
Was just wondering how do these sites (and many other softwares that generate flash movies from audio clips,images , docs) work ? how do they compile the media files(audio/image/vid) into a flv movie on the server ? Can the same be done using some open source tech.
Any info or hint or some direction where i'd get more info regarding this would be very helpful.
Thanks
I am building a library to automatically create forms for Objects in the project that I am working on.
The codebase is in C#, and essentially we have a HUGE number of different objects to store information about different things. If I send these objects to the client side as JSON, it is easy enough to programatically inspect them to generate a form for all of the properties.
The problem is that I want to be able to create a simple way of enforcing permissions and doing validation on the client side. It needs to be done on a field by field level.
In javascript I would do this by creating a parallel object structure, which had some sort of { permissions : "someLevel", validator : someFunction } object at the nodes. With empty nodes implying free permissions and universal validation. This would let me simply iterate over the new object and the permissions object, run the check, and deal with the result.
Because I am overfamilar with the hammer that is javascript, this is really the only way that I can see to deal with this problem. My first implementation thus uses reflection to let me treat objects as dictionaries, that can be programatically iterated over, and then I just have dictionaries of dictionaries of PermissionRule objects which can be compared with.
Very javascripty. Very awkward.
Is there some better way that I can do this? Essentially a way to associate a data set with each property, and then iterate over those properties.
Or else am I Doing It Wrong?
Hi,
I have ELMAH set up for a webapp, logging exceptions to a SQL server.
I wish to have ELMAH send me an email too, but only when a specific exception is thrown (ie. MySpecialException).
ELMAH must still log all exceptions to SQL server.
I know you can do it programmatically in global.asax, but I'd prefer to use web.config.
So, how do I restrict ELMAH error mails to filter out everything but a specific exception type, using web.config?
Hi all, i have a class with some method that depend by one parameter.
What is the best way to write this method?
Example:
First way
class Test{
var $code;
function Test($type){
if($type=="A"){
$this->code=create_function(/*some args and some code*/);
}
else if($type=="B"){
$this->code=create_function(/*some args and some code*/);
}
}
function use(/*some args*/){
return call_user_func($this->code,/*some args*/);
}
}
Second way
class Test{
var $type;
function Test($type){
$this->type=$type;
}
function use(/*some args*/){
if($this->type=="A"){
//some code
}
else if($this->type=="B"){
//some code
}
}
}
$test=new Test("A");
$test->use();
Which way you would choose?
Thanks.
For eclipse 3.5 / 3.6 and JQuery 1.4.2, what are the best practices for a development IDE?
(jquerywtp seems unmaintained, and aptana seems an overkill)
Is eclipse not the right tool for JQuery dev?
I have been experimenting with various uses of hierarchies like this and the differences between absolute and relative imports, and can't figure out how to do routine things with the package, subpackages, and modules without simply putting everything on sys.path. I have a two-level package hierarchy:
MyApp
__init__.py
Application
__init__.py
Module1
Module2
...
Domain
__init__.py
Module1
Module2
...
UI
__init__.py
Module1
Module2
...
I want to be able to do the following:
Run test code in a Module's "if main" when the module imports from other modules in the same directory.
Have one or more test code modules in each subpackage that runs unit tests on the modules in the subpackage.
Have a set of unit tests that reside in someplace reasonable, but outside the subpackages, either in a sibling package, at the top-level package, or outside the top-level package (though all these might end up doing is running the tests in each subpackage)
"Enter" the structure from any of the three subpackage levels, e.g. run code that just uses Domain modules, run code that just uses Application modules, but Application uses code from both Application and Domain modules, and run code from GUI uses code from both GUI and Application; for instance, Application test code would import Application modules but not Domain modules.
After developing the bulk of the code without subpackages, continue developing and testing after organizing the modules into this hierarchy.
I know how to use relative imports so that external code that puts MyApp on its sys.path can import MyApp, import any subpackages it wants, and import things from their modules, while the modules in each subpackage can import other modules from the same subpackage or from sibling packages. However, the development needs listed above seem incompatible with subpackage structuring -- in other words, I can't have it both ways: a well-structured multi-level package hierarchy used from the outside and also used from within, in particular for testing but also because modules from one design level (in particular the UI) should not import modules from a design level below the next one down.
Sorry for the long essay, but I think it fairly represents the struggles a lot of people have been having adopting to the new relative import mechanisms.
I have an nHibernate querie issue that looks quite straight forward, but I can't seem to get my head around it!
I am creating some simple example classes to illustrate my problem:
public class Car {
public int Id { get; set; }
public IList<Interior> InteriorParts { get; set; }
}
public class Interior {
public int Id { get; set; }
public InteriorProducer Producer { get; set; }
}
public class InteriorProducer {
public int Id { get; set; }
}
Now to the query: I have the id of the InteriorProducer, but need to get a list of Cars where the interior have been produced by the interior producer.
So in a simple, pseudo SQL, it looks something like this:
select cars
where car.InteriorParts.Producer.Id = Id
I have a really hard time getting my head around this to create an nHibernate query.
Any Ideas?
Thanks
I have a Listbox in WPF with the SelectionMode set to Multiple, and can multiselect the items in the Listbox. However, the SelectedItem is not updating the Observable Collection it is bound to.
Is there a way to bind the multiple selected items from a ListBox to an Observable Collection?
Obviously, I am a novice web designer. I'm using php and sql to do all the under-the-hood stuff, but I want a visually appealing as well as functional comment system. Right now I am just using HTML forms but they don't look very good. Should I be using javascript? Any tips to get me started?
I have Made the CheckboxList like this?
<%foreach(ListItem m in bootcamp.STPs.ProjectManagement.Controllers.MemberController.JALLMembers()){%>
<label for=""><%= m.Text %></label>
<input id="Mana" type="checkbox" value="<%= m.Value %>" name="chkbx" />
<%}%>
How can I get the Values of selected checkboxes through ajax script in controller?
I am using Asp.net MVC?
I am reading Hibernate in Action and the author suggests to move business logic into our domain models (p. 306). For instance, in the example presented by the book, we have three entities named Item, Bid, and User and the author suggests to add a placeBid(User bidder, BigDecimal amount) method to the Item class.
Considering that usually we have a distinct layer for business logic (e.g. Manager or Service classes in Spring) that among other things control transactions, etc. is this really a good advice? Isn't it better not to add business logic methods to our entities?
Thanks in advance.
I'm facing this problem. So, I need to build the support libraries (zlib, libtiff, libpng, libxml2, libiconv) with "Multithreaded DLL" (/MD) & "Multithreaded DLL Debug" (/MDd) run-time options. But the problem is there is no direct way . I mean there is no *.sln / *.vcproj file which I can open in Visual C++ and build it.
I'm aware with the GNU build system:
$./configure --with-all-sorts-of-required-switches
$./make
$./make install
During my search I've encountered with something called CMake which generates *.vcproj & *.sln file but for that CMakeLists.txt is required. Not all projects provide CMakeLists.txt.
I've never compiled anything from Visual C++ Command Line.
Generally most projects provide makefile. Now how do I generate *.vcproj / *.sln from this?
Can I compile with mingw-make of MinGW?
If I can, how do I set different options ("Multi-Threaded"(/MT), "Multi-Threaded Debug"(/MTd), "Multi-Threaded DLL"(/MD), "Multi-Threaded DLL Debug"(/MDd)) for run-time libraries?
I don't know what other ways are available. Please throw some light on this.
I installed ruby-mbox by doing gem install ruby-mbox
Running this:
#!/usr/bin/ruby
require 'rubygems'
require 'mbox'
m = IO.read('test.eml')
puts m.size
m = Mbox.new(m)
puts m
produces this:
71309505
/Library/Ruby/Gems/1.8/gems/ruby-mbox-0.0.2/lib/mbox/mbox.rb:45:in `initialize': uninitialized constant Mbox::StringIO (NameError)
from r.rb:7:in `new'
from r.rb:7
I have proved that "m" is assigned a string containing the contents of the file, just before Mbox.new(m) is called.
It looks as though the Mbox::StringIO should have been defined by hasn't been.
What's going wrong here?
Ruby version:
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
(That's the default ruby installed on OS X 10.6.6)
var response = "{\"tree\":[{\"level1\":[{\"node\":{\"id\": 1,\"name\": \"paradox\",\"parent\": 0}}]},{\"level2\":[{\"node\":{\"id\": 2,\"name\": \"lucent\",\"parent\": 1}},{\"node\":{\"id\": 3,\"name\": \"reiso\",\"parent\": 1}}]},{\"level3\":[{\"node\":{\"id\": 4,\"name\": \"pessi\",\"parent\": 3}},{\"node\":{\"id\": 5,\"name\": \"misho\",\"parent\": 2}}]},{\"level4\":[{\"node\":{\"id\": 6,\"name\": \"hema\",\"parent\": 5}},{\"node\":{\"id\": 7,\"name\": \"iiyo\",\"parent\": 4}}]}]}";
var data = eval("(" + response + ")");
This is a dummy json response I am currently testing. Now how do I get the value of "name" in the 1st node of "level1" from the "tree"? Thanks
I have Bass component from http://www.un4seen.com/bass.html. I load mp3 and triying to change the format to PCM but it wont do nothing?
or any suggestion will be appreciated.
Posting a video on tumblr.com allows you to just paste the URL of the video on youtube, vimeo, whatever and tumblr automatically does the embedding for you.
I assume that this would be nothing more than a mapping between an URL-regex and the belonging HTML construct for embedding the video. Or it is just parsing the response of the URL and getting the construct from there.
Is there already any utility, preferably in Java, for doing this? If not, how would you do it?
hello,
i have XML files which contain records with the following structure:
<payment contractType="1">
<income type="0">
<gr code="1" amount="1506.00"/>
<gr code="4" amount="35.00"/>
<gr code="10" amount="288.14"/>
<de code="3011300" amount="138.72"/>
<de code="3081100" amount="48.81"/>
<de code="3082400" amount="109.84"/>
</income>
<netAmount1 value="765.00"/>
<netAmount2 value="765.00"/>
</payment>
each file has many records of type payment and i want the final xml to contain one payment
record by adding all the amount values for every differrent code value
I think XPath can be used for this, but I never used it before , could someone show me some Java (or else) code for this?
I am getting the warning that:
One or more signals are missing in the
sensitivity list of always block.
always@(Address)begin
ReadData = instructMem[Address];
end
How do I get rid of this warning?
Before I continue I would just like to say I know that "Premature optimization is the root of all evil." However this program is only a hobby project and I enjoy trying to find ways to optimize it.
That being said, I was reading an article on improving xml performance and it recommended sharing "the XmlNameTable class that is used to store element and attribute names across multiple XML documents of the same type to improve performance."
I wasn't able to find any information about doing this in my googling, so it is likely that this is either not possible, a no-no, or a stupid question, but what's the harm in asking?
I have a menu click event that looks something like this....
Public Sub ToolbarManager_ToolClick(sender as Object, e as EventArgs)
Case "New"
CreateNewFile()
Case "Save"
SaveCurrentFile()
Case "Exit"
ExitApp()
Case.......
etc...
etc...
End Sub
This strikes me as being 'ugly' - but I'm unsure of the 'best' way or the most appropriate way to clean it up.