Search Results

Search found 230 results on 10 pages for 'chau chee yang'.

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

  • MySqlDataAdapter or MySqlDataReader for bulk transfer?

    - by Jeff Meatball Yang
    I'm using the MySql connector for .NET to copy data from MySql servers to SQL Server 2008. Has anyone experienced better performance using one of the following, versus the other? DataAdapter and calling Fill to a DataTable in chunks of 500 DataReader.Read to a DataTable in a loop of 500 I am then using SqlBulkCopy to load the 500 DataTable rows, then continue looping until the MySql record set is completely transferred. I am primarily concerned with using a reasonable amount of memory and completing in a short amount of time. Any help would be appreciated!

    Read the article

  • How to use OUTPUT statement inside a SQL trigger?

    - by Jeff Meatball Yang
    From MSDN: If a statement that includes an OUTPUT clause is used inside the body of a trigger, table aliases must be used to reference the trigger inserted and deleted tables to avoid duplicating column references with the INSERTED and DELETED tables associated with OUTPUT. Can someone give me an example of this? I'm not sure if this is correct: create trigger MyInterestingTrigger on TransactionalTable123 AFTER insert, update, delete AS declare @batchId table(batchId int) insert SomeBatch (batchDate, employeeId) output SomeBatch.INSERTED.batchId into @batchId insert HistoryTable select b.batchId, i.col1, i.col2, i.col3 from TransactionalTable123.inserted i cross join @batchId b

    Read the article

  • What data structures and algorithms are applied within data warehouse cubes?

    - by Jeff Meatball Yang
    I understand that cubes are optimized data structures for aggregating and "slicing" large amounts of data. I just don't know how they are implemented. I can imagine a lot of this technology is proprietary, but are there any resources that I could use to start implementing my own cube technology? Set theory and lots of math are probably involved (and welcome as suggestions!), but I'm primarily interested in implementations: the data structures and query algorithms. Thanks!

    Read the article

  • Generate SQL script to insert XML from files, using Powershell

    - by Jeff Meatball Yang
    I have a bunch of (50+) XML files in a directory that I would like to insert into a SQL server 2008 table. How can I create a SQL script from the command prompt or Powershell that will let me insert the files into a simple table with the following schema: XMLDataFiles ( xmlFileName varchar(255) , content xml ) All I need is for something to generate a script with a bunch of insert statements. Right now, I'm contemplating writing a silly little .NET console app to write the SQL script. Thanks.

    Read the article

  • How to recognize whether a web site is opened in a mobile or a PC

    - by Yogi Yang 007
    We have a site developed in PHP. It is working just fine. We have used JQuery for every kind of situation like slide shows, menus, etc. This site contains a lot of images which are large in size. because of this when viewed in a mobile phone user has to scroll a lot. How can we recognize whether the client (browser) trying to access our site is a mobile phone or a standard PC. Is there any standard way to build site for such situations? TIA

    Read the article

  • Hibernate can't load Custom SQL collection

    - by Geln Yang
    Hi, There is a table Item like, code,name 01,parent1 02,parent2 0101,child11 0102,child12 0201,child21 0202,child22 Create a java object and hbm xml to map the table.The Item.parent is a Item whose code is equal to the first two characters of its code : class Item{ String code; String name; Item parent; List<Item> children; .... setter/getter.... } <hibernate-mapping> <class name="Item" table="Item"> <id name="code" length="4" type="string"> <generator class="assigned" /> </id> <property name="name" column="name" length="50" not-null="true" /> <many-to-one name="parent" class="Item" not-found="ignore"> <formula> <![CDATA[ (select i.code,r.name from Item i where (case length(code) when 4 then i.code=SUBSTRING(code,1,2) else false end)) ]]> </formula> </many-to-one> <bag name="children"></bag> </class> </hibernate-mapping> I try to use formula to define the many-to-one relationship,but it doesn't work!Is there something wrong?Or is there other method? Thanks! ps,I use mysql database. add 2010/05/23 Pascal's answer is right,but the "false" value must be replaced with other expression,like "1=2".Because the "false" value would be considered to be a column of the table. select i.code from Item i where ( case length(code) when 4 then i.code=SUBSTRING(code,1,2) else 1=2 end) And I have another question about the children "bag" mapping.There isn't formula configuration option for "bag",but we can use "loader" to load a sql-query.I configure the "bag" as following.But it get a list whose size is 0.What's wrong with it? <class> ... ... <bag name="children"> <key /> <one-to-many class="Item"></one-to-many> <loader query-ref="getChildren"></loader> </bag> </class> <sql-query name="getChildren"> <load-collection alias="r" role="Item.children" /> <![CDATA[(select {r.*} from Item r join Item o where o.code=:code and ( case length(o.code) when 2 then (length(r.code)=4 and SUBSTRING(r.code,1,2)=o.code) else 1=2 end ))]]> </sql-query>

    Read the article

  • Making Javascript and HTML5 games

    - by Jeff Meatball Yang
    A long time ago (Netscape 4-era), I wrote Javascript-based games: Pong, Minesweeper, and John Conway's Life among them. I'm getting back into it, and want to get my hands even dirtier. I have a few games in mind: Axis & Allies clone, with rugged maps and complex rules. Tetris clone, possibly with real-time player-vs-player or player-vs-computer mode Breakout clone, with a couple weapons and particle velocities In all of these, I have only a few objectives: Use JavaScript and HTML 5 - it should run on Chrome, Safari, or maybe an iPad. Start small and simple, then build-up features. Learn something new about game design and implementation. So my questions are: How would you implement these games? Do you have any technology recommendations? If you've written these games, what was the hardest part? N.B. I also want to start from first-principles - if you recommend a framework/library, I would appreciate some theory or implementation details behind it. These games are different enough that I should learn something new from each one.

    Read the article

  • rails convert string to number

    - by Yang
    hi guys, i am wondering is there a convenient function in rails to convert string with negative signs into a number. e.g. -1005.32 when i use to_f method, the number will simply become 1005 with the negative sign and decimal part being ignored. thanks in advance!

    Read the article

  • Get_user running at kernel mode returns error

    - by Fangkai Yang
    Hi, all, I have a problem with get_user() macro. What I did is as follows: I run the following program int main() { int a = 20; printf("address of a: %p", &a); sleep(200); return 0; } When the program runs, it outputs the address of a, say, 0xbff91914. Then I pass this address to a module running in Kernel Mode that retrieves the contents at this address (at the time when I did this, I also made sure the process didn't terminate, because I put it to sleep for 200 seconds... ): The address is firstly sent as a string, and I cast them into pointer type. int * ptr = (int*)simple_strtol(buffer, NULL,16); printk("address: %p",ptr); // I use this line to make sure the cast is correct. When running, it outputs bff91914, as expected. int val = 0; int res; res= get_user(val, (int*) ptr); However, res is always not 0, meaning that get_user returns error. I am wondering what is the problem.... Thank you!! -- Fangkai

    Read the article

  • How do I selectively round UITableViewCell corners?

    - by Michael Yang
    I'm trying to recreate the feel of the upper part of the iPhone Stocks application. Using cornerRadius I have been able to round all the corners of the UITableView, but when the user drags too far down or up the rectangular edges of the first and last cells show. How can I round only the top or bottom part of the UITableViewCell?

    Read the article

  • How to create stackoverflow's post voting like ajax function?

    - by Daoming Yang
    Can I use Ajax or Jquery to call a action and change the image, just like stackoverflow's post voting function? In my view, I'm using the following code, but I don't want to refresh the browser. Can anyone provide some code about this? <%if (!item.IsPrinted) { %> <%=Html.ImageLink("~/Content/images/web/delete.png", "printed", "MarkAsPrinted", "Order", item.TaskID, null, null)%> <%} else {%> <img src="~/Content/images/web/star.png" alt="printed" /> <% } %>

    Read the article

  • DataAnnotationsModelBinder with MVC2 RTM

    - by yang
    Trying to validate models with DataAnnotations but DefaulModelBinder overrides my Required property error messages and never uses my error messages for invalid data entry. Always show 'value' is invalid for 'property name'. In another question I saw that MVC 2 uses DefaultModelBinder but I couldn't find any class in MVC 2 binaries. I downloaded the source for MVC futures and changed some source to compile it for .Net 4.0 but although I had success to compile, it has compatability problems and doesn't work as expected. Any help is aprreciated.

    Read the article

  • Java multi Generic collection parameters complie error

    - by Geln Yang
    Hi, So strange!Please have a look the code first: public class A { } public class B extends A { } public class C extends A { } public class TestMain { public <T extends A> void test(T a, T b) { } public <T extends A> void test(List<T> a, List<T> b) { } public static void main(String[] args) { new TestMain().test(new B(), new C()); new TestMain().test(new ArrayList<B>(), new ArrayList<C>()); } } The statement "new TestMain().test(new ArrayList(), new ArrayList())" get a "Bound mismatch" compile error, while "new TestMain().test(new B(), new C())" is compiled ok. Bound mismatch: The generic method test(T, T) of type TestMain is not applicable for the arguments (ArrayList, ArrayList). The inferred type ArrayList is not a valid substitute for the bounded parameter It seems the type of the second generic List parameter is limited by the Type of the first.Is it a feature or a bug of the compile program? ps, jdk:1.6,IDE:Eclipse 3.5.1

    Read the article

  • What is a simple way to combine two Emacs major modes, or to change an existing mode?

    - by Winston C. Yang
    In Emacs, I'm working with a file that is a hybrid of two languages. Question 1: Is there a simple way to write a major mode file that combines two major modes? Details: The language is called "brew" (not the "BREW" of "Binary Runtime Environment for Wireless"). brew is made up of the languages R and Latex, whose modes are R-mode and latex-mode. The R code appears between the tags <% and %. Everything else is Latex. How can I write a brew-mode.el file? (Or is one already available?) One idea, which I got from this posting, is to use Latex mode, and treat the code of the form <% ... % as a comment. Question 2: How do you change the .emacs file or the latex.el file to have Latex mode treat code of the form <% ... % as a comment?

    Read the article

  • Extract parts of html using regex

    - by Fred Yang
    I have a simple requirement to extract text in html. Suppose the html is <h1>hello</h1> ... <img moduleType="calendar" /> ...<h2>bye</h2> I want to convert it into three parts <h1>hello</h1> <img moduleType="calendar" /> <h2>bye</h2> The aim is to extract text in two categories, simple html and special tags with <img moduleType="Calender".

    Read the article

  • Serialize HTMLDocument and then rendering it in the server?

    - by Yang Bo
    Hi, After some Google search, I did not find anything fill my need. I want to save the current web page just as what it is. I mean, many web pages has Javascript executed and CSS changed, so after some user interactive, the web page may be different from the one when it is firstly loaded into browser. And I want to save the current web page state to the sever and rendering it in the server. Is there any Javascript library for this task? Thanks!

    Read the article

  • Func<T> injecting with Windsor container

    - by yang
    Here is a code excerpt from AspComet project that works with Autofac. public MessageBus(IClientRepository clientRepository, Func<IMessagesProcessor> messagesProcessorFactoryMethod) { this.clientRepository = clientRepository; this.messagesProcessorFactoryMethod = messagesProcessorFactoryMethod; } How can I inject "Func<IMessagesProcessor> messagesProcessorFactoryMethod" with Windsor, is it possible? Thanks.

    Read the article

  • Hos to group the complex list objects by using Linq

    - by Daoming Yang
    I want to select and group the products, and rank them by the number of times they occur. For example, I have an OrderList each of order object has a OrderProductVariantList(OrderLineList), and each of OrderProductVariant object has ProductVariant, and then the ProductVariant object will have a Product object which contains product information. A friend helped me with the following code. It could be compiled, but it did not return any value/result. I used the watch window for the query and it gave me "The name 'query' does not exist in the current context". Can anyone help me? Many thanks. var query = orderList.SelectMany( o => o.OrderLineList ) // results in IEnumerable<OrderProductVariant> .Select( opv => opv.ProductVariant ) .Select( pv => p.Product ) .GroupBy( p => p ) .Select( g => new { Product = g.Key, Count = g.Count() });

    Read the article

  • Concatenate SQL script from Powershell

    - by Jeff Meatball Yang
    I have a bunch of (50+) XML files in a directory that I would like to insert into a SQL server 2008 table. How can I create a SQL script from the command prompt or Powershell that will let me insert the files into a simple table with the following schema: XMLDataFiles ( xmlFileName varchar(255) , content xml ) All I need is for something to generate a script with a bunch of insert statements. Right now, I'm contemplating writing a silly little .NET console app to write the SQL script. Thanks.

    Read the article

  • How to create stackoverflow's post voting like jquery/ajax function?

    - by Daoming Yang
    Can I use Jquery to call an action and then change the image when it success, just like stackoverflow's post voting function? In my view, I'm using the following code, but I don't want to refresh the browser. Can anyone provide some code about this for me? Many thanks. <%if (!item.IsPrinted) { %> <%=Html.ImageLink("~/Content/images/web/delete.png", "printed", "MarkAsPrinted", "Order", item.TaskID, null, null)%> <%} else {%> <img src="~/Content/images/web/star.png" alt="printed" /> <% } %>

    Read the article

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