Daily Archives

Articles indexed Monday March 29 2010

Page 12/123 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • jaxb namespaces in each element instead of root element during marshalling

    - by Anton
    By default, jaxb 2 lists all (all possible required) namespaces in root element during marshalling: <rootElement xmlns="default_ns" xmlns:ns1="ns1" xmlns:ns2="ns2"> <ns1:element/> </rootElement> Is there a way to describe namespace in each element instead of root element ?: <rootElement xmlns="default_ns"> <element xmlns="ns1"/> </rootElement> It also solves the problem of "unnecessary namespaces", which is also important in my case. Any suggestions appreciated.

    Read the article

  • Using numpy.apply

    - by andylei
    What's wrong with this snippet of code? import numpy as np from scipy import stats d = np.arange(10.0) cutoffs = [stats.scoreatpercentile(d, pct) for pct in range(0, 100, 20)] f = lambda x: np.sum(x > cutoffs) fv = np.vectorize(f) # why don't these two lines output the same values? [f(x) for x in d] # => [0, 1, 2, 2, 3, 3, 4, 4, 5, 5] fv(d) # => array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) Any ideas?

    Read the article

  • How can I create a new branch in git from an existing file tree?

    - by pkaeding
    I am looking to add an existing file tree to a git repository as a new branch (I can't just copy the existing tree into my git tree, since the existing tree is versioned under a different VCS, and I am trying to sync them up). Is this possible? EDIT: Would setting up a new git repository, that is connected to the existing remote repository, and then moving the resulting .git folder work? That seems really hackish, but if that's the way to do it...

    Read the article

  • mod_ntlm for RHEL 5.3

    - by vikasa
    I tried to compile mod_ntlm for Oracle HTTP Server but got all sorts of errors, can someone point me to a pre-compiled binary? Tried everything at http://wiki.bestpractical.com/view/NtlmAuthentication still no go Thanks

    Read the article

  • Matlab Simulink: Transfer Function

    - by stanigator
    I am trying to model a transfer function block for let's say 1/(s+1). I am having a hard time coming up with proper search terms for it, hence having trouble finding out how I can achieve this on the Internet. What is the easiest way to implement a block for a transfer function in Simulink? Thanks in advance.

    Read the article

  • How to understand the output of gcc -S *.cpp?

    - by user198729
    A sample one as follows: .file "hw.cpp" .section .rdata,"dr" LC0: .ascii "Oh shit really bad~!\15\12\0" .text .align 2 .globl __Z3badv .def __Z3badv; .scl 2; .type 32; .endef __Z3badv: pushl %ebp movl %esp, %ebp subl $8, %esp movl $LC0, (%esp) call _printf leave ret .section .rdata,"dr" LC1: .ascii "WOW\0" .text .align 2 .globl __Z3foov .def __Z3foov; .scl 2; .type 32; .endef __Z3foov: pushl %ebp movl %esp, %ebp subl $4, %esp movl LC1, %eax movl %eax, -4(%ebp) movl $__Z3badv, 4(%ebp) leave ret .def ___main; .scl 2; .type 32; .endef .align 2 .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax addl $15, %eax addl $15, %eax shrl $4, %eax sall $4, %eax movl %eax, -4(%ebp) movl -4(%ebp), %eax call __alloca call ___main call __Z3foov movl $0, %eax leave ret .def _printf; .scl 2; .type 32; .endef Has anyone tried to understand it?

    Read the article

  • Cocoa Memory Usage

    - by user288024
    I'm trying to track down some peculiar memory behavior in my Cocoa desktop app. My app does a lot of image processing using NSImage and uploads those images to a website over HTTP using NSURLConnection. After uploading several hundred images (some very large), when I run Instrument I get no leaks. I've also run through MallocDebug and get no leaks. When I dig into object allocations using Instrument I get output like this: GeneralBlock-9437184, Net Bytes 9437184, # Net 1 GeneralBlock-192512, Net Bytes 2695168, # Net 14 and etc., for smaller sizes. When I look at these in detail, they're marked as being owned by 'Foundation' and created via NSConcreteMutableData initWithCapacity. During HTTP upload I'm creating a post body using NSMutableData, so I'm guessing these are buffers Cocoa is caching for me when I create the NSMutableData objects. Is there a way to force Cocoa to free these? I'm 90% positive I'm releasing correctly (and Instruments and MallocDebug seem to confirm this), but I think Cocoa is keeping these around for perf reasons since I'm allocating so many MSMutableData buffers.

    Read the article

  • Generating equals / hashcode / toString using annotation

    - by Bruno Bieth
    I believe I read somewhere people generating equals / hashcode / toString methods during compile time (using APT) by identifying which fields should be part of the hash / equality test. I couldn't find anything like that on the web (I might have dreamed it ?) ... That could be done like that : public class Person { @Id @GeneratedValue private Integer id; @Identity private String firstName, lastName; @Identity private Date dateOfBirth; //... } For an entity (so we want to exlude some fields, like the id). Or like a scala case class i.e a value object : @ValueObject public class Color { private int red, green, blue; } Not only the file becomes more readable and easier to write, but it also helps ensuring that all the attributes are part of the equals / hashcode (in case you add another attribute later on, without updating the methods accordingly). I heard APT isn't very well supported in IDE but I wouldn't see that as a major issue. After all, tests are mainly run by continuous integration servers. Any idea if this has been done already and if not why ? Thanks

    Read the article

  • Correct method to search for AD user by email address from .NET

    - by BrianLy
    I'm having some issues with code that is intended to find a user in Active Directory by searching on their email address. I have tried 2 methods but I'm sometimes finding that the FindOne() method will not return any results on some occasions. If I look up the user in the GAL in Outlook I see the SMTP email address listed. My end goal is to confirm that the user exists in AD. I only have the email address as search criteria, so no way to use first or last name. Method 1: Using mail property: DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(mail=" + email + ")"; search.PropertiesToLoad.Add("mail"); SearchResult result = search.FindOne(); Method 2: proxyAddresses property: DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(proxyAddresses=SMTP:" + email + ")"; // I've also tried with =smtp: search.PropertiesToLoad.Add("mail"); SearchResult result = search.FindOne(); I've tried changing the case of the email address input but it still does not return a result. Is there a problem here with case sensitivity? If so, what is the best way to resolve it?

    Read the article

  • Complementary language to learn after Python?

    - by BobDobbs
    As a reasonable proficient Python programmer, I'm wondering what a good second language to learn would be. More specifically, something that does well the things that Python doesn't in general do as well. My first guess would be C/C++ since it's got easy extensibility with Python and because it offers generally better performance, but I'm wondering if Java or C# might be a better or at least equivalently good option with different up/downsides compared to C/C++.

    Read the article

  • Disable input fields based on selection from drop down

    - by Thomas
    I have a drop down box and some text input fields below it. Based on which item from the drop down menu the user selects, I would like to disable some of the fields. I think I am failing to target the input fields correctly but I can't figure out what the problem is: Here is the script I have gotten so far: $(document).ready(function(){ var customfield = $('#customfields-tf-19-tf'); var customfield1 = $('#customfields-tf-20-tf'); var customfield2 = $('#customfields-tf-13-tf'); $(function() { var call_table = { 'Condominium': function() { customfield.attr("disabled"); }, 'Co-Op': function() { customfield1.attr("disabled"); }, 'Condop': function() { customfield2.attr("disabled"); } }; $('#customfields-s-18-s').change(function() { call_table[this.value](); }); }); }); And the layout for my form: <td width="260" class="left"> <label for="customfields-s-18-s">Ownership (Required):</label> </td> <td class="right"> <select name="customfields-s-18-s" class="dropdown" id="customfields-s-18-s" size="" > <option value="Condominium"> Condominium</option> <option value="Co-Op"> Co-Op</option> <option value="Condop"> Condop</option> </select> </td> </tr> <tr> <td width="260" class="left"> <label for="customfields-tf-19-tf">Maintenance:</label> </td> <td class="right"> <input type="text" title="Maintenance" class="textInput" name="customfields-tf-19-tf" id="customfields-tf-19-tf" size="40"/> </td> </tr> <tr id="newsletter_topics"> <td width="260" class="left"> <label for="customfields-tf-20-tf">Taxes:</label> </td> <td class="right"> <input type="text" title="Taxes" class="textInput" name="customfields-tf-20-tf" id="customfields-tf-20-tf" size="40" /> </td> </tr> <tr> <td width="260" class="left"> <label for="customfields-tf-13-tf" class="required">Tax Deductibility:</label> </td> <td class="right"> <input type="text" title="Tax Deductibility" class="textInput" name="customfields-tf-13-tf" id="customfields-tf-13-tf" size="40" /> </td> </tr>

    Read the article

  • parse json with ant

    - by paleozogt
    I have an ant build script that needs to pull files down from a web server. I can use the "get" task to pull these files down one by one. However, I'd like to be able to get a list of these files first and then iterate over the list with "get" to download the files. The webserver will report the list of files in json format, but I'm not sure how to parse json with ant. Are there any ant plugins that allow for json parsing?

    Read the article

  • Android Update Layout Content

    - by GuyNoir
    I'm looking for a way to update a layout's content with a new view. Is there any way to easily do this. It would be similar to how tabs work, but I don't want to have to get into extending the current tab structure if I don't have to. The final result would be a few buttons that would switch the content in a specific linearlayout for each button. Any help?

    Read the article

  • Anyone looking for a graphic designer for an app? [closed]

    - by Jacob
    Hey my name is Jacob, and I was wondering if any of the app developers here are looking for someone to make graphics for their apps. Sorry if this is not an appropriate question for this site, but according to the FAQ, a question is valid as long as it is: * detailed and specific * written clearly and simply * of interest to other programmers Let me know :)

    Read the article

  • Is there a distributed VCS that can manage large files?

    - by joelhardi
    Is there a distributed version control system (git, bazaar, mercurial, darcs etc.) that can handle files larger than available RAM? I need to be able to commit large binary files (i.e. datasets, source video/images, archives), but I don't need to be able to diff them, just be able to commit and then update when the file changes. I last looked at this about a year ago, and none of the obvious candidates allowed this, since they're all designed to diff in memory for speed. That left me with a VCS for managing code and something else ("asset management" software or just rsync and scripts) for large files, which is pretty ugly when the directory structures of the two overlap.

    Read the article

  • ListView control rendering issue with Groups, CheckBoxes and View mode SmallIcon

    - by volody
    Microsoft MSDN site has next remark: "Any groups assigned to a ListView control appear whenever the ListView.View property is set to a value other than View.List." My problem is that i like to have View set to SmallIcon. In this mode ListView control is shifted left, and CheckBoxes are covered by left edge How to solve this issue, or at least how is possible to shift rendering of control to the right. My OS is Windows XP Service Pack 3. It looks like that ListView items with Groups and CheckBoxes shows correctly only when View set to Details.

    Read the article

  • Castle ActiveRecord "Could not compile the mapping document: (string)"

    - by Nick
    Hi I am having getting an exception when trying to initialize ActiveRecord and I cannot figure out what I am missing. I am trying to convince the company I work for to use Castle ActiveRecord and it won't look good if I can't demonstrate how it works. I have work on projects before with Castle ActiveRecord and I had never experience this problem before. Thanks for your help The exception that I get is Stack Trace: at Castle.ActiveRecord.ActiveRecordStarter.AddXmlString(Configuration config, String xml, ActiveRecordModel model) at Castle.ActiveRecord.ActiveRecordStarter.AddXmlToNHibernateCfg(ISessionFactoryHolder holder, ActiveRecordModelCollection models) at Castle.ActiveRecord.ActiveRecordStarter.RegisterTypes(ISessionFactoryHolder holder, IConfigurationSource source, IEnumerable`1 types, Boolean ignoreProblematicTypes) at Castle.ActiveRecord.ActiveRecordStarter.Initialize(IConfigurationSource source, Type[] types) at ConsoleApplication1.Program.Main(String[] args) in C:\Projects\CastleDemo\ConsoleApplication1\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() Inner Exception: {"Could not compile the mapping document: (string)"} Below is my configuration file: <add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" /> <add key="dialect" value="NHibernate.Dialect.MsSql2000Dialect" /> <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <add key="connection.connection_string" value="Data Source=SPIROS\SQLX;Initial Catalog=CastleDemo;Integrated Security=SSPI" /> <add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" /> and this is the main method that runs the initialization: static void Main(string[] args) { //Configure ActiveRecord source XmlConfigurationSource source = new XmlConfigurationSource("../../config.xml"); // //Initialazi ActiveRecord ActiveRecordStarter.Initialize( source, typeof(Product)); // //Create Schema ActiveRecordStarter.CreateSchema(); // }

    Read the article

  • Visual Studio 2010 RC with Office 2010 and Office 2007 installed

    - by BlueDevil
    I have Visual Studio 2010 installed on my Windows XP development machine along with Office 2007 Professional and Office 2010 Professional. I am trying to develop several add-ins for Office 2007; however, I prefer to use Office 2010 on a day-to-day basis. How do I set Visual Studio 2010 to install the add-in and open Word 2007 when I press debug? Currently, Word 2010 opens, but does not recognize the add-in. Unless I have to, I would like to keep Office 2010 installed.

    Read the article

  • How does XMPP work with perl?

    - by TheGNUGuy
    Hey everybody, I am trying to make my own jabber bot but i have run into a little trouble. I have gotten my bot to respond to messages, however, if I try to change the bot's presence then it seems as though all of the messages you send to the bot get delayed. What I mean is when I run the script I change the presence so I can see that it is online. Then When I send it a message it takes 3 before the callback subroutine i have set up for messages gets called. After the 3rd message is sent and the chat subroutine is called it still process the first message I sent. This really doesn't pose TOO much of a problem except that I have it set up to log out when I send the message "logout" and it has to be followed by two more messages in order to log out. I am not sure what it is that I have to do to fix this but i think it has something to do with iq packets because I have an iq callback set as well and it gets called 2 times after setting the presence. Here is my source code: http://pastebin.com/MgKMhTML Thanks for your help!

    Read the article

  • ASP.NET UpdatePanel > Get selected value from checbox list outside of panel

    - by Rob
    Hi, I have a listing in an UpdatePanel I have some filters for that list in the form a checkboxList control. The checkboxList is created dynamically on page load During the Ajax update (postback), the checkbox list is not populated form the viewstate, so I cannot get the listing to filter. Note: If I put the checkbox list items directly in the markup, it all works, just not if the listing is populated on-postback. protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { foreach (var p in global.Product) CheckListManufacurer.Items.Add(new ListItem(p, p)); } base.OnLoad(e); } <form id="ProductListForm" runat="server"> <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true"></asp:ScriptManager> <asp:CheckBoxList ID="CheckListManufacurer" runat="server" EnableViewState="true"> <asp:ListItem Value="" Text="(All)"></asp:ListItem> </asp:CheckBoxList> <asp:Button id="btnTestAjax" runat="server" Text="Test" /> <asp:UpdatePanel ID="ProductsPanel" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnTestAjax" /> <asp:AsyncPostBackTrigger ControlID="CheckListManufacurer" /> </Triggers> <ContentTemplate> <sr:ProductList ID="Products" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </form>

    Read the article

  • has_many :through on self?

    - by Glex
    I have a User model. A user can be either a dj, a club, or a clubber (this is controlled by the User#account_type attribute). A club can have many djs, and a dj can have many users: enumerated_attribute :account_type, %w(^clubber dj club), :nil => false do label :clubber => "Clubber" label :dj => "DJ" label :club => "Club" end has_many :dj_club_relationships, :class_name => "User", :dependent => :destroy has_many :dj_user_relationships, :dependent => :destroy has_many :djs, :through => :dj_club_relationships, :class_name => "User" has_many :users, :through => :dj_user_relationships However, this doesn't work as well as expected, since Rails doesn't know, for example, that it needs to destroy all dj_club_relationships with club_id when the user being destroyed is a club, and with dj_id when the user is a dj. How can I help rails know about it?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >