Search Results

Search found 13178 results on 528 pages for 'subsonic active record'.

Page 2/528 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to explore the local active directory ?

    - by Quandary
    Question: On Windows7, how can I explore the local active directory ? I mean getting all directory entries I would see when I execute this code: Dim AD As New System.DirectoryServices.DirectoryEntry("WinNT://" + Environment.MachineName & ",computer") I have found a systernals tool, called activedirectory explorer, (http://technet.microsoft.com/en-us/sysinternals/bb963907.aspx) and I run it as complete administrator (root), but it always says "server not working/running". But the server obviously works, since I can query it from .net... and it's definitely local, since I plugged the network connection

    Read the article

  • SubSonic Alias/Where Clause

    - by JohnBob
    Hey, I want to convert the following SQL Query to a SubSonic Query. SELECT [dbo].[tbl_Agency].[ParentCompanyID] FROM [dbo].[tbl_Agency] WHERE REPLACE(PhoneNumber, ' ', '') LIKE REPLACE('%9481 1111%', ' ', '') I thought I would do it like below, but I just can't get it to produce valid SQL. //SubSonic string agencyPhoneNumber = "9481 1111"; SubSonic.SqlQuery subQueryagencyPhoneNumber = new SubSonic.Select(Agency.ParentCompanyIDColumn.ColumnName); subQueryagencyPhoneNumber.From(Agency.Schema.TableName); //WHERE subQueryagencyPhoneNumber.Where("REPLACE(" + Agency.PhoneNumberColumn.ColumnName + ", ' ', '')").Like("%" + agencyPhoneNumber + "%"); Does anyone out there know how to fix this - I'm using SubSonic 2.2. I feel like I'm taking crazy pills here - this should be straightforward, right? Cheers, JohnBob

    Read the article

  • Exception with Subsonic 2.2, SQLite and Migrations

    - by Holger Amann
    Hi, I'm playing with Migrations and created a simple migration like public class Migration001 : Migration { public override void Up() { TableSchema.Table testTable = CreateTableWithKey("TestTable"); } public override void Down() { } } after executing sonic.exe migrate I'm getting the following output: Setting ConfigPath: 'App.config' Building configuration from c:\tmp\MigrationTest\MigrationTest\App.config Adding connection to SQLiteProvider Found 1 migration files Current DB Version is 0 Migrating to 001_Init (1) There was an error running migration (001_Init): SQLite error near "IDENTITY": syntax error Stack Trace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] argum ents, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argume nts, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwn er) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib ilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke Attr, Binder binder, Object[] parameters, CultureInfo culture) at SubSonic.CodeRunner.RunAndExecute(ICodeLanguage lang, String sourceCode, S tring methodName, Object[] parameters) in D:\@SubSonic\SubSonic\SubSonic.Migrati ons\CodeRunner.cs:line 95 at SubSonic.Migrations.Migrator.ExecuteMigrationCode(String migrationFile) in D:\@SubSonic\SubSonic\SubSonic.Migrations\Migrator.cs:line 177 at SubSonic.Migrations.Migrator.Migrate() in D:\@SubSonic\SubSonic\SubSonic.M igrations\Migrator.cs:line 141 Any hints?

    Read the article

  • Creating an Apache Virtual Directory, but updating Active Directory DNS

    - by SnoConeGod
    Hello all, I'm just getting started with using the Zend Framework and am following a recommended procedure where I am supposed to create an Apache Virtual Directory for the public-facing portion of a new Zend project. I don't THINK I had any issues creating the Virtual Directory, but my knowledge of the required DNS changes is rather lacking. The dev server I'm using is on a Microsoft Windows Active Directory domain, so I've added A records for both the server name and the subdomain. Still, trying to browse to the site from a Windows 7 PC isn't working properly. What am I missing? What's the proper set of steps for getting an Apache-served subdomain to appear properly in a peer computer's web browser? Details below: server: Debian command-line only, freshly installed today with Zend Server CE LAMP stack server name: ZENDEV subdomain: SQUARE.ZENDEV AD Domain functional level: 2008 mixed (run by a mishmash of 03 and 08 servers) attempting to visit the sites: http://square.zendev and http://square.zendev.domain.local (name of domain redacted, but using the local (not com) suffix) Apache Virtual Directory added to httpd.conf: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot "/var/www/square/public" ServerName square.localhost </VirtualHost> Is this only a problem with DNS? Or with DNS and my Virtual Directory? Thanks! John

    Read the article

  • SubSonic missing stored procedures in StoredProcedures.cs when generated with SubCommander sonic.exe

    - by Mark
    We have been using SubSonic to generate our DAL with a lot of success on VS2005 and SubSonic Tools 2.0.3. SubSonic Tools do not work on VS2008 (as far as we can work out) so we have tried to use SubCommander\sonic.exe and are now hitting some problems. When we regenerate the project using SubCommander\sonic.exe and try to compile we get some errors reporting missing members (which should have been automatically generated based on the stored procedures we have). On closer inspection it looks like my StoredProcedures.cs file is missing some (not all) automatically generated methods for my classes. As an example, I have 2 procs: [dbo]._ClassA_Func1 [dbo]._ClassA_Func2 Only one of these is being generated in the StoredProcedures.cs file. These methods generate fine using the SubSonic Tools plugin. We have tried now with versions 2.1 and 2.2 of SubSonic with the same issue. We are still on .NET 2.0 so cannot use SubSonic 3.0. I have checked the permissions of both procs using fn_my_permissions and they seem identical. Does anyone have any ideas on what I can check? Thanks -- Mark

    Read the article

  • How to use Subsonic 2.0 ?

    - by programmerist
    i try to use subsonic 3.0 but i can not do that. i decided to use subsonic.2.0. So i try to make it i can not :( my Web Config : <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/> </configSections> <connectionStrings> <add name="AdventureWorks" connectionString="Data Source=.;Database=eticaret; Integrated Security=true; User ID=sa; Password=123456;"/> </connectionStrings> <SubSonicService defaultProvider="eticaret"> <providers> <clear/> <add name="eticaret" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="eticaret" generatedNamespace="eticaretDAL"/> </providers> </SubSonicService> </configuration> also look this article: what is error? http://www.codeproject.com/KB/database/SubsonicDAL.aspx

    Read the article

  • Allow sudo on specific file from active directory group

    - by tubaguy50035
    I have an Ubuntu Server 12.04 box that has active directory integration running on it. I want to allow a certain active directory group access to execute a script as sudo. I want to do something like this: %programmers ALL=NOPASSWD: /usr/local/bin/createSambaShare.php When I log in with my active directory user and issue groups I do not see the group programmers, but I am a part of the programmers group within active directory. I've set up the group under the Unix attributes tab and given it an id of 1000 and added my user to it. My first thought was that I needed to add the group to the Ubuntu box. When I tried to do that, it told me that the programmers group already existed. What am I missing here?

    Read the article

  • Spring MVC and 406 Error XML request

    - by Asp1de
    Hi i have a problem when running my code outside eclipse. This is my Equinox enviroment: Framework is launched. id State Bundle 0 ACTIVE org.eclipse.osgi_3.7.0.v20110221 1 ACTIVE org.eclipse.equinox.common_3.6.0.v20110506 2 ACTIVE org.eclipse.update.configurator_3.3.100.v20100512 3 RESOLVED catalina-config_1.0.0 Master=20 4 ACTIVE org.springframework.osgi.catalina.start.osgi_1.0.0 Fragments=62 5 ACTIVE com.springsource.javax.activation_1.1.1 6 ACTIVE com.springsource.javax.annotation_1.0.0 7 ACTIVE com.springsource.javax.ejb_3.0.0 8 ACTIVE com.springsource.javax.el_1.0.0 9 ACTIVE com.springsource.javax.mail_1.4.0 10 ACTIVE com.springsource.javax.persistence_1.0.0 11 ACTIVE com.springsource.javax.servlet_2.5.0 12 ACTIVE com.springsource.javax.servlet.jsp_2.1.0 13 ACTIVE com.springsource.javax.servlet.jsp.jstl_1.1.2 14 ACTIVE com.springsource.javax.xml.bind_2.0.0 15 ACTIVE com.springsource.javax.xml.rpc_1.1.0 16 ACTIVE com.springsource.javax.xml.soap_1.3.0 17 ACTIVE com.springsource.javax.xml.stream_1.0.1 18 ACTIVE com.springsource.javax.xml.ws_2.1.1 19 ACTIVE com.springsource.org.aopalliance_1.0.0 20 ACTIVE com.springsource.org.apache.catalina_6.0.18 Fragments=3, 22 21 ACTIVE com.springsource.org.apache.commons.logging_1.1.1 22 RESOLVED com.springsource.org.apache.coyote_6.0.18 Master=20 23 ACTIVE com.springsource.org.apache.el_6.0.18 24 ACTIVE com.springsource.org.apache.juli.extras_6.0.18 25 ACTIVE com.springsource.org.apache.log4j_1.2.15 Fragments=33 26 ACTIVE com.springsource.org.apache.taglibs.standard_1.1.2 27 ACTIVE org.springframework.osgi.commons-el.osgi_1.0.0.SNAPSHOT 28 ACTIVE data_1.0.0 29 ACTIVE Api_1.0.0 30 ACTIVE connector_1.0.0 31 ACTIVE core_1.0.0 32 ACTIVE org.springframework.osgi.jasper.osgi_5.5.23.SNAPSHOT 33 RESOLVED com.springsource.org.apache.log4j.config_1.0.0 Master=25 34 ACTIVE testController_1.0.0 35 ACTIVE org.eclipse.core.contenttype_3.4.100.v20100505-1235 36 ACTIVE org.eclipse.core.jobs_3.5.0.v20100515 37 ACTIVE org.eclipse.equinox.app_1.3.0.v20100512 38 ACTIVE org.eclipse.equinox.preferences_3.3.0.v20100503 39 ACTIVE org.eclipse.equinox.registry_3.5.0.v20100503 40 ACTIVE org.eclipse.osgi.services_3.2.100.v20100503 41 ACTIVE osgi.core_4.3.0.201102171602 42 ACTIVE dataImplementation_1.0.0 43 ACTIVE org.springframework.osgi.servlet-api.osgi_2.4.0.SNAPSHOT 44 ACTIVE org.springframework.aop_3.1.1.RELEASE 45 ACTIVE org.springframework.asm_3.1.1.RELEASE 46 ACTIVE org.springframework.beans_3.1.1.RELEASE 47 ACTIVE org.springframework.context_3.1.1.RELEASE 48 ACTIVE org.springframework.context.support_3.1.1.RELEASE 49 ACTIVE org.springframework.core_3.1.1.RELEASE 50 ACTIVE org.springframework.expression_3.1.1.RELEASE 51 ACTIVE org.springframework.osgi.extensions.annotations_1.2.1 52 ACTIVE org.springframework.osgi.core_1.2.1 53 ACTIVE org.springframework.osgi.extender_1.2.1 54 ACTIVE org.springframework.osgi.io_1.2.1 55 ACTIVE org.springframework.osgi.mock_1.2.1 56 ACTIVE org.springframework.osgi.web_1.2.1 57 ACTIVE org.springframework.osgi.web.extender_1.2.1 58 ACTIVE org.springframework.oxm_3.1.1.RELEASE 59 ACTIVE org.springframework.transaction_3.1.1.RELEASE 60 ACTIVE org.springframework.web_3.1.1.RELEASE 61 ACTIVE org.springframework.web.servlet_3.1.1.RELEASE 62 RESOLVED tomcat-configuration-fragment_1.0.0 Master=4 My controller is: @RequestMapping(value = "/test1", method = RequestMethod.GET, produces = "application/json") public @ResponseBody Person test1() { logger.info(" <--- Test 1 ---> \n"); Person p = new Person("a", "b", "c"); return p; } @RequestMapping(value = "/test2", method = RequestMethod.GET, produces = "application/xml") public @ResponseBody Person test3() { logger.info(" <--- Test 1 ---> \n"); Person p = new Person("a", "b", "c"); return p; } @RequestMapping(value = "/test2", method = RequestMethod.GET, headers = "Accept=*/*") public @ResponseBody Person test4() { logger.info(" <--- Test 1 ---> \n"); Person p = new Person("a", "b", "c"); return p; } @RequestMapping(value = "/parent", method = RequestMethod.GET, headers = "Accept=application/xml") public @ResponseBody Parent test2() { logger.info(" <--- Test 1 ---> \n"); Parent p = new Parent("a", "b"); return p; } If i run the TEST 1(json request) it works perfectly but when i run the test 2, 3 and 4 the browser give me back that error: (406) The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers (). Could someone help me? PS: if i run the bundle inside ECLIPSE it works perfectly. I generate the bundles with maven.

    Read the article

  • How to set up the CNAME in DNS zone record to work with Unbounce

    - by Lirik
    I'm trying to run split testing on some landing pages I "designed" with Unbounce, but it requires that I set the CNAME record for my domain/sub-domain and I'm having trouble figuring out what is the right way to do it. My host is arvixe (www.arvixe.com) and their customer support has failed to help me for the past 5 days (I spoke to them multiple times). I followed the directions for setting the CNAME record and I was able to set the CNAME record, but I'm consistently unable to verify that the CNAME record is set up correctly. I followed the instructions on Unbounce to verify the CNAME record for my sub-domain (beta.devboost.com) and here are the results: No records found reverse lookup smtp diag port scan blacklist Reported by ns1.SNARE.arvixe.com on Thursday, November 10, 2011 at 5:49:57 PM (GMT-6) Here is my DNS zone record from the control panel of my host (last record, CNAME unbouncepages.com): Is there something wrong with my DNS Zone Record? What's the right way to do this? Update: I also have a CNAME record for beta in my root domain (devboost.com): I've updated my sub-domain record now: I've removed most of the other DNS records and I've removed the beta label for the CNAME record: Is that correct? Is there anything else I need to do?

    Read the article

  • How do I make subsonic (media server) work with SSL?

    - by John Baber
    The roughly out-of-the-box setup as a regular user works fine (meaning the site appears at http://myserver.com:4040). From ps aux java -Xmx100m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=4040 -Dsubsonic.httpsPort=0 -Dsubsonic.contextPath=/ -Dsubsonic.defaultMusicFolder=/var/music -Dsubsonic.defaultPodcastFolder=/var/music/Podcast -Dsubsonic.defaultPlaylistFolder=/var/playlists -Djava.awt.headless=true -verbose:gc -jar subsonic-booter-jar-with-dependencies.jar but just giving an https port java -Xmx100m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=4040 -Dsubsonic.httpsPort=6060 -Dsubsonic.contextPath=/ -Dsubsonic.defaultMusicFolder=/var/music -Dsubsonic.defaultPodcastFolder=/var/music/Podcast -Dsubsonic.defaultPlaylistFolder=/var/playlists -Djava.awt.headless=true -verbose:gc -jar subsonic-booter-jar-with-dependencies.jar makes http://myserver.com:4040 say HTTP ERROR: 404 NOT_FOUND RequestURI=/index.view Powered by jetty:// and https://myserver.com:6060 say Unable to connect I'm only making the change by doing # SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=120" SUBSONIC_ARGS="--max-memory=100 --https-port=6060" in /etc/default/subsonic and issuing a sudo service subsonic restart (this is Ubuntu Oneiric)

    Read the article

  • NULL ForeignKeyTo property in Subsonic 3/ASP.NET MVC?

    - by chad
    Issue: the primary key of the base table is named differently than the the key in the fk table. Subsonic 3 does not know how to handle that, which is fine, its beta. So I was going to change the Html.ControlFor logic to just grab the table and use the pkname from that: var fk = db.FindTable(col.ForeignKeyTo.FriendlyName); However the .ForeignKeyTo is null. Where in the templates does that ITable get populated?

    Read the article

  • Dynamic Data with Subsonic 3

    - by Ezequiel Bertti
    i want to make a webproject with Subsonic and Dynamic Data... But when i go register the ContextData a don't have it in subsonic with LINQ... in Global.asax.cs a have to do something like this model.RegisterContext(SubSonicRepo, new ContextConfiguration() { ScaffoldAllTables = true }); how can i make it work? have some way to make it work? using entities or LINQ everything work... but using Subsonic with linq it not work...

    Read the article

  • subsonic in visual studio design host

    - by csizo
    Hi, I'm facing currently a problem regarding Subsonic configuration. What I want to achieve is using subsonic data access in a System.Web.UI.Design.ControlDesigner class. This class is hosted in Visual Studio Environment and enables design time operations on the attached System.Web.UI.WebControls.Control. The only problem is SubSonic seems always looking for SubSonicSection in the application configuration regardless passing connection string to it. The relevant code snippet: using (SharedDbConnectionScope dbScope = new SharedDbConnectionScope(new SqlDataProvider(), ConnectionString)) { Table1 _table1 = new Select().From<..().Where(...).IsEqualTo(...).ExecuteSingle<...>(); Throws exception on ExecuteSingle() method (configuration section was not found) while using (SharedDbConnectionScope dbScope = new SharedDbConnectionScope(ConnectionString)) { Throws exception on new SharedDbConnectionScope() (configuration section was not found) So the question is: Is there any way to pass the settings runtime to bypass the configuration section lookup as I don't want to add any subsonic specific configuration to devenv.configuration Thanks

    Read the article

  • Subsonic connections and dataset

    - by ajk
    Hi, If using subsonic, i know you hav to close a datareader. but what if you get a dataset back, from a stored procedure? What can you close? So if its like this - SubSonic.StoredProcedure sp = SubSonic.StoredProcedure; DataSet ds = DataSet; ds = sp.GetDataSet; What do i close when done? I don't think dataset can be closed, right? This is Subsonic 2.x Sorry if this was posted already, i tried to post earlier but got error message, and then couldnt find it so am trying again.

    Read the article

  • Subsonic in a VS2008 Add-In woes

    - by Michael Smit
    Hi, I am writing a VS2008 add-in that connects to a remote database blah blah. I am having a problem with the app.config in this project. When I use SubSonic in my code, it moans that is cannot find the SubSonicServer section. This is because the .config file cannot be found. This appears to a problem with paths as the add-in is a DLL running in the context of VS2008 and the working directory is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE. Is there a way to get the app.config to deploy properly with the application so my add-in (and SubSonic) can find what it needs in the .config file, or is there a way to get SubSonic to work without the need for the .config? I am very experienced in SubSonic projects now, but only winforms, web, web service, and WPF applications. This is the first time I have tried to use SubSonic in a VS2008 Add-In project. I also have AppSettings in the config file which the ConfigurationManager cannot read because it cannot see the .config file. 2AM now and brain is tired of trying to figure this one out. Hopefully there is an answer when I wake up :) TIA

    Read the article

  • Subsonic and the VB.net 2005 interop toolkit

    - by wja
    I have an application I am converting over from vb6 to vb.net 2.0/3.5. Using Subsonic 2.2 and the vb.net Interop Toolkit 2005. Cannot seem to get the .net form using subsonic to work inside the interop environment. It keeps saying it cannot find the subsonic service provider in the app.config. But I know it is there. Has anyone used these two toolkits together successfully? Will subsonic even work inside the interop environment in that way? Thanks in advance!

    Read the article

  • Controllling Drupal's active/active-trail with duplicate menu items

    - by Mark
    I'm developing a site that requires some duplication of links within the menu: Section A -- Introduction -- Testimonials Section B -- Introduction -- Testimonials Testimonials -- Section A -- Section B So 'Section A Testimonials' and 'Testimonials Section A' point to the same node. But regardless of which menu link people use, I want the person to be in Section A. The problem is that D6 doesn't like duplicate menu items, and it assigns the active and active-trail classes rather unpredictably. So my thought was to create a placeholder node for each item in the Testimonials menu, and then set the URL to something like "testimonials/redirect/section-a", and then use mod_rewrite to redirect over to "section-a/testimonials". With this solution, I will have no duplicate paths in the menu. I'm just hoping this doesn't somehow hurt my SEO. Does anyone know a better solution?

    Read the article

  • Active Record's SessionScope in BL or DL ?

    - by StupidDeveloper
    Imagine that I have 3 projects: DL, BL and WS. DL contains Active Record implementation with all the mappings, BL has some logic (calling various DL methods) and finally WebService project exposes some BL methods (using some DTO mappings). The questions are: Should I put all data related methods in DL or is it allowed to use SessionScope in BL ? There are some complicated stuff that is right now done on BL. Should/can BL operate on classes-mappings of the Active record? The question is where should be the translation to DTO be made (at the BL level? ) ?

    Read the article

  • How to enable an active/active file server cluster in windows 2008 r2 Enterprise

    - by Phygg
    I've just created a cluster for my file servers in Windows 2008 R2 Ent SP1 environment. The goal - an Active/Active cluster for web server data How do I go about telling the cluster to be active for both nodes? Do I have to tell the cluster to be active/active? Here is a link to the instructions I followed when configuring the failover cluster. http://technet.microsoft.com/en-us/library/ff182326(WS.10).aspx So if anyone can help me to grasp the concept or maybe I'm way off and I need a node that is not active along with 2 active nodes to do this, I would appreciate it.

    Read the article

  • how to update a record without worrying about primary key

    - by railsnew
    In ActiveRecord how can we update a record without worrying/knowing primary key. If I do Address.update(15, :user_name => 'Samuel') it corresponds to UPDATE addresses set user_name = 'Samuel' where id = 15 but what if i want to do: UPDATE addresses set user_name = 'Samuel' where cid = 15 what will be the ActiveRecord equivalent of that?? I tried: Address.update({:cid => 15}, :user_name => 'Samuel') but that does not work.

    Read the article

  • How to select display to record in recordmydesktop

    - by Tom
    I have a dual monitor setup and wish to only record the 1st monitor with recordmydesktop, but I am unsure of the settings when doing it via the command line, so far I have this: recordmydesktop --display=1 --width=1920 height=1080 --fps=15 --no-sound --delay=10 But I get this error message: Cannot connect to X server 1 How do I find the right X server to connect to and are the rest of my settings correct? I'm using 11.04, cheers.

    Read the article

  • How to simulate inner join on very large files in java (without running out of memory)

    - by Constantin
    I am trying to simulate SQL joins using java and very large text files (INNER, RIGHT OUTER and LEFT OUTER). The files have already been sorted using an external sort routine. The issue I have is I am trying to find the most efficient way to deal with the INNER join part of the algorithm. Right now I am using two Lists to store the lines that have the same key and iterate through the set of lines in the right file once for every line in the left file (provided the keys still match). In other words, the join key is not unique in each file so would need to account for the Cartesian product situations ... left_01, 1 left_02, 1 right_01, 1 right_02, 1 right_03, 1 left_01 joins to right_01 using key 1 left_01 joins to right_02 using key 1 left_01 joins to right_03 using key 1 left_02 joins to right_01 using key 1 left_02 joins to right_02 using key 1 left_02 joins to right_03 using key 1 My concern is one of memory. I will run out of memory if i use the approach below but still want the inner join part to work fairly quickly. What is the best approach to deal with the INNER join part keeping in mind that these files may potentially be huge public class Joiner { private void join(BufferedReader left, BufferedReader right, BufferedWriter output) throws Throwable { BufferedReader _left = left; BufferedReader _right = right; BufferedWriter _output = output; Record _leftRecord; Record _rightRecord; _leftRecord = read(_left); _rightRecord = read(_right); while( _leftRecord != null && _rightRecord != null ) { if( _leftRecord.getKey() < _rightRecord.getKey() ) { write(_output, _leftRecord, null); _leftRecord = read(_left); } else if( _leftRecord.getKey() > _rightRecord.getKey() ) { write(_output, null, _rightRecord); _rightRecord = read(_right); } else { List<Record> leftList = new ArrayList<Record>(); List<Record> rightList = new ArrayList<Record>(); _leftRecord = readRecords(leftList, _leftRecord, _left); _rightRecord = readRecords(rightList, _rightRecord, _right); for( Record equalKeyLeftRecord : leftList ){ for( Record equalKeyRightRecord : rightList ){ write(_output, equalKeyLeftRecord, equalKeyRightRecord); } } } } if( _leftRecord != null ) { write(_output, _leftRecord, null); _leftRecord = read(_left); while(_leftRecord != null) { write(_output, _leftRecord, null); _leftRecord = read(_left); } } else { if( _rightRecord != null ) { write(_output, null, _rightRecord); _rightRecord = read(_right); while(_rightRecord != null) { write(_output, null, _rightRecord); _rightRecord = read(_right); } } } _left.close(); _right.close(); _output.flush(); _output.close(); } private Record read(BufferedReader reader) throws Throwable { Record record = null; String data = reader.readLine(); if( data != null ) { record = new Record(data.split("\t")); } return record; } private Record readRecords(List<Record> list, Record record, BufferedReader reader) throws Throwable { int key = record.getKey(); list.add(record); record = read(reader); while( record != null && record.getKey() == key) { list.add(record); record = read(reader); } return record; } private void write(BufferedWriter writer, Record left, Record right) throws Throwable { String leftKey = (left == null ? "null" : Integer.toString(left.getKey())); String leftData = (left == null ? "null" : left.getData()); String rightKey = (right == null ? "null" : Integer.toString(right.getKey())); String rightData = (right == null ? "null" : right.getData()); writer.write("[" + leftKey + "][" + leftData + "][" + rightKey + "][" + rightData + "]\n"); } public static void main(String[] args) { try { BufferedReader leftReader = new BufferedReader(new FileReader("LEFT.DAT")); BufferedReader rightReader = new BufferedReader(new FileReader("RIGHT.DAT")); BufferedWriter output = new BufferedWriter(new FileWriter("OUTPUT.DAT")); Joiner joiner = new Joiner(); joiner.join(leftReader, rightReader, output); } catch (Throwable e) { e.printStackTrace(); } } } After applying the ideas from the proposed answer, I changed the loop to this private void join(RandomAccessFile left, RandomAccessFile right, BufferedWriter output) throws Throwable { long _pointer = 0; RandomAccessFile _left = left; RandomAccessFile _right = right; BufferedWriter _output = output; Record _leftRecord; Record _rightRecord; _leftRecord = read(_left); _rightRecord = read(_right); while( _leftRecord != null && _rightRecord != null ) { if( _leftRecord.getKey() < _rightRecord.getKey() ) { write(_output, _leftRecord, null); _leftRecord = read(_left); } else if( _leftRecord.getKey() > _rightRecord.getKey() ) { write(_output, null, _rightRecord); _pointer = _right.getFilePointer(); _rightRecord = read(_right); } else { long _tempPointer = 0; int key = _leftRecord.getKey(); while( _leftRecord != null && _leftRecord.getKey() == key ) { _right.seek(_pointer); _rightRecord = read(_right); while( _rightRecord != null && _rightRecord.getKey() == key ) { write(_output, _leftRecord, _rightRecord ); _tempPointer = _right.getFilePointer(); _rightRecord = read(_right); } _leftRecord = read(_left); } _pointer = _tempPointer; } } if( _leftRecord != null ) { write(_output, _leftRecord, null); _leftRecord = read(_left); while(_leftRecord != null) { write(_output, _leftRecord, null); _leftRecord = read(_left); } } else { if( _rightRecord != null ) { write(_output, null, _rightRecord); _rightRecord = read(_right); while(_rightRecord != null) { write(_output, null, _rightRecord); _rightRecord = read(_right); } } } _left.close(); _right.close(); _output.flush(); _output.close(); } UPDATE While this approach worked, it was terribly slow and so I have modified this to create files as buffers and this works very well. Here is the update ... private long getMaxBufferedLines(File file) throws Throwable { long freeBytes = Runtime.getRuntime().freeMemory() / 2; return (freeBytes / (file.length() / getLineCount(file))); } private void join(File left, File right, File output, JoinType joinType) throws Throwable { BufferedReader leftFile = new BufferedReader(new FileReader(left)); BufferedReader rightFile = new BufferedReader(new FileReader(right)); BufferedWriter outputFile = new BufferedWriter(new FileWriter(output)); long maxBufferedLines = getMaxBufferedLines(right); Record leftRecord; Record rightRecord; leftRecord = read(leftFile); rightRecord = read(rightFile); while( leftRecord != null && rightRecord != null ) { if( leftRecord.getKey().compareTo(rightRecord.getKey()) < 0) { if( joinType == JoinType.LeftOuterJoin || joinType == JoinType.LeftExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, leftRecord, null); } leftRecord = read(leftFile); } else if( leftRecord.getKey().compareTo(rightRecord.getKey()) > 0 ) { if( joinType == JoinType.RightOuterJoin || joinType == JoinType.RightExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, null, rightRecord); } rightRecord = read(rightFile); } else if( leftRecord.getKey().compareTo(rightRecord.getKey()) == 0 ) { String key = leftRecord.getKey(); List<File> rightRecordFileList = new ArrayList<File>(); List<Record> rightRecordList = new ArrayList<Record>(); rightRecordList.add(rightRecord); rightRecord = consume(key, rightFile, rightRecordList, rightRecordFileList, maxBufferedLines); while( leftRecord != null && leftRecord.getKey().compareTo(key) == 0 ) { processRightRecords(outputFile, leftRecord, rightRecordFileList, rightRecordList, joinType); leftRecord = read(leftFile); } // need a dispose for deleting files in list } else { throw new Exception("DATA IS NOT SORTED"); } } if( leftRecord != null ) { if( joinType == JoinType.LeftOuterJoin || joinType == JoinType.LeftExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, leftRecord, null); } leftRecord = read(leftFile); while(leftRecord != null) { if( joinType == JoinType.LeftOuterJoin || joinType == JoinType.LeftExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, leftRecord, null); } leftRecord = read(leftFile); } } else { if( rightRecord != null ) { if( joinType == JoinType.RightOuterJoin || joinType == JoinType.RightExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, null, rightRecord); } rightRecord = read(rightFile); while(rightRecord != null) { if( joinType == JoinType.RightOuterJoin || joinType == JoinType.RightExclusiveJoin || joinType == JoinType.FullExclusiveJoin || joinType == JoinType.FullOuterJoin ) { write(outputFile, null, rightRecord); } rightRecord = read(rightFile); } } } leftFile.close(); rightFile.close(); outputFile.flush(); outputFile.close(); } public void processRightRecords(BufferedWriter outputFile, Record leftRecord, List<File> rightFiles, List<Record> rightRecords, JoinType joinType) throws Throwable { for(File rightFile : rightFiles) { BufferedReader rightReader = new BufferedReader(new FileReader(rightFile)); Record rightRecord = read(rightReader); while(rightRecord != null){ if( joinType == JoinType.LeftOuterJoin || joinType == JoinType.RightOuterJoin || joinType == JoinType.FullOuterJoin || joinType == JoinType.InnerJoin ) { write(outputFile, leftRecord, rightRecord); } rightRecord = read(rightReader); } rightReader.close(); } for(Record rightRecord : rightRecords) { if( joinType == JoinType.LeftOuterJoin || joinType == JoinType.RightOuterJoin || joinType == JoinType.FullOuterJoin || joinType == JoinType.InnerJoin ) { write(outputFile, leftRecord, rightRecord); } } } /** * consume all records having key (either to a single list or multiple files) each file will * store a buffer full of data. The right record returned represents the outside flow (key is * already positioned to next one or null) so we can't use this record in below while loop or * within this block in general when comparing current key. The trick is to keep consuming * from a List. When it becomes empty, re-fill it from the next file until all files have * been consumed (and the last node in the list is read). The next outside iteration will be * ready to be processed (either it will be null or it points to the next biggest key * @throws Throwable * */ private Record consume(String key, BufferedReader reader, List<Record> records, List<File> files, long bufferMaxRecordLines ) throws Throwable { boolean processComplete = false; Record record = records.get(records.size() - 1); while(!processComplete){ long recordCount = records.size(); if( record.getKey().compareTo(key) == 0 ){ record = read(reader); while( record != null && record.getKey().compareTo(key) == 0 && recordCount < bufferMaxRecordLines ) { records.add(record); recordCount++; record = read(reader); } } processComplete = true; // if record is null, we are done if( record != null ) { // if the key has changed, we are done if( record.getKey().compareTo(key) == 0 ) { // Same key means we have exhausted the buffer. // Dump entire buffer into a file. The list of file // pointers will keep track of the files ... processComplete = false; dumpBufferToFile(records, files); records.clear(); records.add(record); } } } return record; } /** * Dump all records in List of Record objects to a file. Then, add that * file to List of File objects * * NEED TO PLACE A LIMIT ON NUMBER OF FILE POINTERS (check size of file list) * * @param records * @param files * @throws Throwable */ private void dumpBufferToFile(List<Record> records, List<File> files) throws Throwable { String prefix = "joiner_" + files.size() + 1; String suffix = ".dat"; File file = File.createTempFile(prefix, suffix, new File("cache")); BufferedWriter writer = new BufferedWriter(new FileWriter(file)); for( Record record : records ) { writer.write( record.dump() ); } files.add(file); writer.flush(); writer.close(); }

    Read the article

  • Can't get SubSonic insert to work

    - by Darkwater23
    I'm trying to insert a record into a table without using the SubSonic object in a VB.Net Windows app. (It will take too long to explain why.) Dim q As New SubSonic.Query("tablename") q.QueryType = SubSonic.QueryType.Insert q.AddUpdateSetting("Description", txtDescription.Text) q.Execute() This just updates all the rows in the table. I read in one post that instead of AddUpdateSetting, I should use AddWhere, but that didn't make any sense to me. I don't need a where clause at all. Searching for all:QueryType.Insert at subsonicproject.com didn't return anything (which I thought was weird). Can anyone tell me how to fix this query? Thanks!

    Read the article

  • Getting latest Subsonic builds

    - by Alex Yakunin
    I need the latest Subsonic build or build it by my own. Subsonic project web site shows the latest available version is Subsonic v3.0.0.3 released at July 15, 2009. Questions: Are there any later builds - e.g. maintained by community members? If so, how can I get the latest one? In worst case I'm ready to get the latest source code and try to build it by my own. Are there any instructions for this? Please note, that I'm not interested in almost 1 year old builds - I need a build based on the latest code for tests (LINQ, performance), ideally - compiled for .NET 4.0.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >