Search Results

Search found 342 results on 14 pages for 'initializer'.

Page 9/14 | < Previous Page | 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • how to group by over anonymous type with vb.net linq to object

    - by smoothdeveloper
    I'm trying to write a linq to object query in vb.net, here is the c# version of what I'm trying to achieve (I'm running this in linqpad): void Main() { var items = GetArray( new {a="a",b="a",c=1} , new {a="a",b="a",c=2} , new {a="a",b="b",c=1} ); ( from i in items group i by new {i.a, i.b} into g let p = new{ k = g, v = g.Sum((i)=>i.c)} where p.v > 1 select p ).Dump(); } // because vb.net doesn't support anonymous type array initializer, it will ease the translation T[] GetArray<T>(params T[] values){ return values; } I'm having hard time with either the group by syntax which is not the same (vb require 'identifier = expression' at some places, as well as with the summing functor with 'expression required' ) Thanks so much for your help!

    Read the article

  • jquery autocomplete filtering

    - by eidylon
    Hello all, I have a page, which uses jQuery Autocomplete on the second two textboxes (investigator and institution). It is getting the data fine, and displaying it, but for some reason it is not filtering the list of data as i continue to type. Anyone know why? Is there something i need to do to turn this on? According to the jQuery site, the only options to the autocomplete initializer are delay, minLength and source. Thanks in advance! I'm using jQ v1.4.1 and jQui v.1.8rc1. Below is the code which I am calling on $(document).ready(). function hookUpAutoCompletes() { $('table#params input[name=sinvestigator]').autocomplete({ source: "json-investigators.asp", minLength: 2 }) $('table#params input[name=sinstitution]').autocomplete({ source: "json-institutions.asp", minLength: 2 }) }

    Read the article

  • How do I upgrade my Crystal Report libraries in a .NET 3.5 project to CR XI R2?

    - by Stuart B
    Our project currently uses Crystal Reports for Visual Studio 2008. We need to upgrade to XI R2, but I'm having problems doing so. Here are the steps I followed: Install Crystal Reports XI R2. Collect updated assemblies from the GAC. I did this because I couldn't find version XI libraries in the "Add References..." dialog. I verified that these assemblies were of version 11.5.*. The libraries I gathered were: CrystalDecisions.CrystalReports.Engine CrystalDecisions.Enterprise.Framework CrystalDecisions.Enterprise.InfoStore CrystalDecisions.ReportSource CrystalDecisions.Shared CrystalDecisions.Windows.Forms Replace all references in my projects to version 10.5 Crystal libraries with references to the newer assemblies. Everything builds fine, but when I try to instantiate a ReportDocument, I get this error: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. Is there anything I'm missing? Will this just not work?

    Read the article

  • Weird Mono compilation error

    - by nubela
    Hi, I am using IKVM to get SVNKit on a Mono project I'm working with, I have a class that implements an interface from SVNKit, and I can't compile: On windows and on .NET, everything compiles fine, just getting this on Mono. /home/nubela/Workspace/subsync/subsync/Core/Subversion/PropGetHandler.cs(22,22): Error CS0535: Subsync.Core.Subversion.PropGetHandler' does not implement interface member org.tmatesoft.svn.core.wc.ISVNPropertyHandler.__()' (CS0535) (subsync) I googled _() method, and it seems to be the initializer method for the base class in the Java library compiled from IKVM. I have no clue how to proceed now, any idea guys? :)

    Read the article

  • Crossdomain TinyMCE

    - by pistacchio
    Hi, folling this discussion and this link, I learnt that by adding document.domain = 'mydomain.com'; to the tinyMCE initializer file and tiny_mce_popup.js i can overcome the cross domain problem. I haven't tested it on a proper production server, but in my dev environment the base domain is localhost:8000 and my static files (also tinyMCE ones) are on localhost:88. Adding document.domain = 'localhost:8000'; or document.domain = 'localhost:88'; doesn't solve the problem as I get the following error: Uncaught Error: SECURITY_ERR: DOM Exception 18 Any help? Thanks

    Read the article

  • Programatically Create Controller in Rails

    - by Trey Bean
    What's the best way to dynamically create a controller in Rails. I've got a class that needs to generate a bunch of controller that inherit from it. I could just create a bunch of files in /app/controllers, but they'd all be basically empty files. There's got to be a way to generate these classes dynamically and have them treated like other controllers in Rails, e.g. reloaded correctly in dev mode. I tried putting this in a config/initializer: FL.contact_types.each do |contact_type| controller_name = "#{contact_type.pluralize}Controller" Object.const_set(controller_name.to_sym, Class.new(ContactsController)) unless Object.const_defined?(controller_name.to_sym) end This worked, but I run into the dependency/reload problem and get “A copy of AuthenticatedSystem has been removed from the module tree but is still active” since the ContactsController inherits from ApplicationController which includes AuthenticatedSystem. Is creating a bunch of empty files really the best solution?

    Read the article

  • Change My.Settings ConnectionString in runtime?

    - by Sultanen
    I have a ClickOnce deployment where i have a INI-settings file on the network file with "global" settings that is supposed to affect the program on all client computers. The problem i have is that i whant to have the Database connectionString stored in this INI file and have it read and stored in the My.Settings ConnectionString at program startup. How do i do this? The ConnectionString setting is Application scoped and therefore Read-Only, if i try to set it by My.Settings("ConnectionString") = "Source=server;Initial Catalog=database;Integrated Security=True" I get a runtime error: An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'DB_lib.DB_LINQ' threw an exception. [EDIT] I got rid of the error by using the My.Settings("ConnectionString") = "Source=server;Initial Catalog=database;Integrated Security=True" in another place then the the eventtriggerd settingsLoaded method i created.. The problem is that even though the connectionstring semes to be the right, the program still connects to the "default" database that is typed in to the app.config file??

    Read the article

  • Rails3 and `cd somehwere && do something`

    - by Samer Abukhait
    I have a rails project that has other projects under it, sub-projects have rake and bundler files. When I do ruby -e `cd sub-project && rake`, or ruby -e `cd sub-project && bundle`, commands work as expected and use the sub-project rake/bundler files. However, when I do the same thing from a Rails3 console (rails 3.0.3), rake gives the error no such file to load -- initializer, and bundle operates as if it was fired from the root directory. I tried the same commands from a Rails2.3.10 console and they worked as expected. Is Rails3 doing something wrong here? I am using Ruby 1.9.2 via RVM. $ ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]

    Read the article

  • Reporting services - custom library is not working after installing report on production Server

    - by niao
    Greetings, I created a report which uses custom library created by me. I've copied these libraries to the following folders: c:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\ c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ Everything works find when I run the report using Visual Studio. When I install it on Production Server (where these dlls were also copied) the following error is returned: Failed to load expression host assembly. Details: The type initializer for 'MyParserForReportingServices.MyParser' threw an exception. (rsErrorLoadingExprHostAssembly) Can someone please help me?

    Read the article

  • Init modules in apache2

    - by user306963
    Hello, I used to write apache modules in apache 1.3, but these days I am willing to pass to apache2. The module that I am writing at the moment has is own binary data, not a database, for performance purposes. I need to load this data in shared memory, so every child can access it without making his own copy, and it would be practical to load/create the binary data at startup, as I was used to do with apache 1.3. Problem is that I don't find an init event in apache2, in 1.3 in the module struct, immediatly after STANDARD_MODULE_STUFF you find a place for a /** module initializer */, in which you can put a function that will be executed early. Body of the function I used to write is something like: if ( getppid == 1 ) { // Load global data here // this is the parent process void* data = loadGlobalData( someFilePath ); setGlobalData( config, data ); } else { // this is the init of a child process // do nothing } I am looking for a place in apache2 in where I can put a similar function. Can you help? Thanks Benvenuto

    Read the article

  • Arrays of pointers to arrays?

    - by a2h
    I'm using a library which for one certain feature involves variables like so: extern const u8 foo[]; extern const u8 bar[]; I am not allowed to rename these variables in any way. However, I like to be able to access these variables through an array (or other similar method) so that I do not need to continually hardcode new instances of these variables into my main code. My first attempt at creating an array is as follows: const u8* pl[] = { &foo, &bar }; This gave me the error cannot convert 'const u8 (*)[]' to 'const u8*' in initialization, and with help elsewhere along with some Googling, I changed my array to this: u8 (*pl)[] = { &foo, &bar }; Upon compiling I now get the error scalar object 'pl' requires one element in initializer. Does anyone have any ideas on what I'm doing wrong? Thanks.

    Read the article

  • vb.net Object Initialiser List(Of T)

    - by Tim B James
    I have been looking at some C# code: List<Employee> Employees = new List<Employee>{ new Employee{firstname="Aamir",lastname="Hasan",age=20}, new Employee{firstname="awais",lastname="Hasan",age=50}, new Employee{firstname="Bill",lastname="Hasan",age=70}, new Employee{firstname="sobia",lastname="khan",age=80}, }; Now when I convert this to vb.net Dim Employees as List(Of Employee) = New List(Of Employee)() With { New Employee() With { _ .firstname = "Aamir", _ .lastname = "Hasan", _ .age = 20 _ }, _ New Employee() With { _ .firstname = "awais", _ .lastname = "Hasan", _ .age = 50 _ }, _ New Employee() With { _ .firstname = "Bill", _ .lastname = "Hasan", _ .age = 70 _ }, _ New Employee() With { _ .firstname = "sobia", _ .lastname = "khan", _ .age = 80 _ } _ } I get the error "Name of field or property being initialized in an object initializer must start with'.'." Now I can get an array of employee using the code: Dim Employees = { New Employee() With { _ .FirstName = "Aamir", _ .LastName = "Hasan", _ .Age = 20}, _ New Employee() With { _ .FirstName = "Awais", _ .LastName = "Hasan", _ .Age = 50}, _ New Employee() With { _ .FirstName = "Bill", _ .LastName = "Hasan", _ .Age = 70 _ } _ } But I would like a List(Of Employee) as it is bugging me as to why this doesnt work in vb.net?

    Read the article

  • Objective C - Constants with behaviour

    - by Akshay
    Hi, I'm new to Objective C. I am trying to define Constants which have behavior associated with them. So far I have done - @interface Direction : NSObject { NSString *displayName; } -(id)initWithDisplayName:(NSString *)aName; -(id)left; // returns West when North -(id)right; // return East when North @end @implementation Direction -(id)initWithDisplayName:(NSString *)aName { if(self = [super init]) { displayName = aName; } return self; } -(id)left {}; -(id)right {}; @end Direction* North = [Direction initWithDisplayName:@"North"]; // error - initializer element is not constant. This approach results in the indicated error. Is there a better way of doing this in Objective C.

    Read the article

  • Ruby on Rails: reducing complexity of parameters in a RESTFul HTTP POST request (multi-model)

    - by randombits
    I'm using cURL to test a RESTFul HTTP web service. The problem is I'm normally submitting a bunch of values normally like this: curl -d "firstname=bob&lastname=smith&age=25&from=kansas&someothermodelattr=val" -H "Content-Type: application/x-www-form-urlencoded" http://mysite/people.xml -i The problem with this is my controller will then have code like this: unless params[:firstname].nil? end unless params[:lastname].nil? end // FINALLY @person = People.new(params[:firstname], params[:lastname], params[:age], params[:from]) etc.. What's the best way to simplify this? My Person model has all the validations it needs. Is there a way (assuming the request has multi-model parameters) that I can just do: @person = People.new(params[:person]) and then the initializer can take care of the rest?

    Read the article

  • type of an array

    - by Tim
    Hi, when I need to pass an array to a function, it seems all the following declarations of the function will work void f(int arr[]) void f(int arr[4]) // is this one correct? for this: int a[]={1,2,3,4}; f(a); But when I assign an array to another array, it fails int a[]={1,2,3,4}; int b[4] = a; // error: array must be initialized with a brace-enclosed initializer So why an array passed as an argument of a function is okay, but used on the rhs of simple assignment is wrong? Thanks!

    Read the article

  • Building libopenmetaverse on CentOS 5

    - by Gary
    I'm trying to build libopenmetaverse on CentOS however I get the following error. I'm not this kind of developer and am installing this for someone else to use. This is just the part of the build that fails. Any ideas? [nant] /opt/libomv/Programs/WinGridProxy/WinGridProxy.exe.build build Buildfile: file:///opt/libomv/Programs/WinGridProxy/WinGridProxy.exe.build Target framework: Mono 2.0 Profile Target(s) specified: build build: [echo] Build Directory is /opt/libomv/bin [csc] Compiling 15 files to '/opt/libomv/bin/WinGridProxy.exe'. [resgen] Error: Invalid ResX input. [resgen] Position: Line 2700, Column 5. [resgen] Inner exception: An exception was thrown by the type initializer for System.Drawing.GDIPlus BUILD FAILED External Program Failed: /tmp/tmp5a71a509.tmp/resgen.exe (return code was 1) Total time: 0.4 seconds. BUILD FAILED Nested build failed. Refer to build log for exact reason. Total time: 47 seconds. Build Exit Code: 1

    Read the article

  • How to test silverlight behaviors using Rhino Mocks?

    - by Derek
    I have slightly adapted the custom behavior code that can be found here: http://www.reflectionit.nl/blog/default.aspx?guid=d81a8cf8-0345-48ee-bbde-84c2e3f21a25 that controls a MediaElement. I need to know how to go about testing this with Rhino Mocks e.g. how to instantiate a new ControlMediaElementAction in test code and then call the Invoke method etc. Doing something simple like this in test code: mMediaElementControlBehaviour = new ControlMediaElementAction (); gives me an exception "The type initializer for 'System.Windows.DependencyObject' throw an exception. Thinking it was the instantiation of the MediaElement, I tried this two lines of code: MediaElement mediaElementStub = MockRepository.GenerateStub(); this.Container.RegisterInstance(mediaElementStub); This gave the exception 'Can't create mocks of sealed classes' If someone can point me in the right direction, it would be apreciated. Silverlight 4, Rhino Mocks 3.5 Silverlight v2.0.50727 Thanks,

    Read the article

  • Auto update CSS from SASS/SCSS in Rails?

    - by Vulgrin
    Maybe I'm confused on how SASS/SCSS works within Rails (2.3.8.) but I was under the impression that if I included the option Sass::Plugin.options[:always_update] = true that whenever I changed my SCSS file and then hit the page (controller) again, the SCSS would recompile. I can't seem to get this to work, and can't seem to find a good tutorial / example for it. I've tried setting the above property in the Environment.rb file, but it didn't seem to do anything. I tried putting it in its own initializer with require 'sass' but that doesn't seem to work either. What am I missing? Or am i just forced to keep a terminal open with a sass --watch command running to be able to rapidly debug / change my styles? thx

    Read the article

  • Devise email confirmation from localhost

    - by John
    I am able to get the registration confirmation email to send out in deployment on Heroku, but when I try a registration on localhost:3000, I get the following error: undefined local variable or method `confirmed_at' for #<User:0xb67a1ff0> In my config/environments/production.rb file I have: config.action_mailer.default_url_options = { :host => 'xxxx.com' } And I have an initializer file with the following format: ActionMailer::Base.smtp_settings = { :user_name => "[email protected]", :password => "xxxxxx", :domain => "xxxx.com", :address => "smtp.sendgrid.net", :port => "xxx", :authentication => :plain, :enable_starttls_auto => true }; What settings do I need to get the localhost working? Thanks! John

    Read the article

  • How can I make sure the Sphinx daemon runs?

    - by Ethan
    I'm working on setting up a production server using CentOS 5.3, Apache, and Phusion Passenger (mod_rails). I have an app that uses the Sphinx search engine and the Thinking Sphinx gem. According to the Thinking Sphinx docs... If you actually want to search against the indexed data, then you’ll need Sphinx’s searchd daemon to be running. This can be controlled using the following tasks: rake thinking_sphinx:start rake ts:start rake thinking_sphinx:stop rake ts:stop What would be the best way to ensure that this takes place in production? I can deploy my app, then manually run rake thinking_sphinx:start, but I like to set things up so that if I have to bounce the server, everything will come back up. Should I put a call to that Rake task in an initializer? Or something in rc.local?

    Read the article

  • Using XTemplate with SimpleStore in Ext

    - by qui
    I am currently adding some functionality to some old code. There used to be a template which took a flat array of items and spat out some HTML, now the data is coming from a simple store which reads some JSON.. var allwords = [ ['abacteriano', 'abacteriano'], ['abacterial', 'abacteriano'], ['abciximab', 'abciximab'], etc.. So my simplestore goes like this: termStore = new Ext.data.SimpleStore({ fields: ['term', 'lookup'], data: allwords }); This definitly works fine as I use the termStore in a combobox. However I am having difficulty getting it to play with an XTemplate. It seems the syntax in extjs doesn't play well with SO, so this bit wont be in a code block... So I guess I'll describe it :p Essentially its a simple template which tries to get values out of the passed collection by doing {term} I then try and apply it by doing: tpl.overwrite(Ext.get("contentbox"), termStore); This gives me a JS error of "invalid object initializer"

    Read the article

  • Ruby class variable is reset after rails app initialized

    - by Phuong Nguy?n
    I tried to assign a class static variable like this class QueryLogger < Logger @@query_logger_default_instance = nil def self.default_instance # Use global variable because static variable doesn't work @@query_logger_default_instance ||= self.new(STDOUT) end end In initializers folder of my rails app, I added a file with this code block ActiveRecord::Base.logger = QueryLogger.default_instance In a request (action of controller), I make a call to this: QueryLogger.default_instance. My assumption is that the call to default_instance will always report the same. However, it does not. Now I try to watch stuff in NetBeans by setting breakpoint inside default_instance. Thing happen as expected, the default_instance get called twice, one due to the initializer block and one due to the call to my action. Surprising thing is, in both times, @@query_logger_default_instance report nil inside NetBeans inspector. The first nil report is correct, but the second shocked me. It's look like static variable gets reset after rails app initialized. Is there some magic there?

    Read the article

  • WPF application in obj directory doesn't work.

    - by juharr
    When I build my WPF application the exe that ends up in the bin directory works just fine, but the one in the obj directory does not. When I Debug the exe from the obj directory I get the following exception: TypeInitializationException was unhandled: The type initializer for 'MyProject.App' threw an exception. So basically I'm wondering why the obj exe doesn't work while the bin one does (I was under the assumption that the obj exe was just copied to the bin) and how to fix it. The reason that I even care is because I'm using Wix to create a MSI for my application and I have a Votive project setup that uses var.MyProject.TargetPath which points to the exe in the obj directory.

    Read the article

  • Use a ContextLoaderListener in accordance with DispatchServlet

    - by Phuong Nguyen de ManCity fan
    I want to use both ContextLoaderListener (so that I can pass Spring Beans to my servlet) as well as DispatchServlet (Spring MVC). However, currently I have to pass init param to these both class initializer: <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/app-config.xml </param-value> So, I use the same xml for these both classes. Wonder if it would lead to my beans being initialized twice? If yes, how would I do to avoid that?

    Read the article

  • Trick to getting initWithNibFile to be invoked?

    - by PhazeZero
    I've implemented a View Controller, and I'm trying to do some very basic initialization in initWithNibFile...which I understand to be the designated initializer for View Controller objects. I've tried to put breakpoints on the code, and have put very simple NSLog statements into it as well. Regardless...I'm not seeing it be executed (and the object i'm attempting to alloc/init inside the function is also not being allocated - so I'm about 99% sure I'm not hitting the code. Is there something I need to do elsewhere to cause this method to be invoked? I'm getting a clean build, no warnings or errors. And the app successfully loads up the View, and I can invoke a ButtonClick method I've coded and connected to this same View Controller. Any suggestions would be appreciated. TC

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14  | Next Page >