Daily Archives

Articles indexed Sunday May 16 2010

Page 15/75 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Moving from NHibernate to FluentNHibernate: assembly error (related to versions)?

    - by goober
    Not sure where to start, but I had gotten the most recent version of NHibernate, successfully mapped the most simple of business objects, etc. When trying to move to FluentNHibernate and do the same thing, I got this error message on build: "System.IO.FileLoadException: Could not load file or assembly 'NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference." Background: I'm new to Hibernate, NHibernate, and FluentNHibernate -- but not to .NET, C#, etc. Database I have a database table called Category: (PK) CategoryID (type: int), unique, auto-incrementing UserID (type: uniqueidentifier) -- given the value of the user Guid in ASP.NET database Title (type: varchar(50) -- the title of the category Components involved: I have a SessionProviderClass which creates the mapping to the database I have a Category class which has all the virtual methods for FluentNHibernate to override I have a CategoryMap : ClassMap class, which does the fluent mappings for the entity I have a CategoryRepository class that contains the method to add & save the category I have the TestCatAdd.aspx file which uses the CategoryRepository class. Would be happy to post code for any of those, but I'm not sure that it's necessary, as I think the issue is that somewhere there's a version conflict between what FluentNHibernate references and the NHibernate I have installed from before. Thanks in advance for any help you can give!

    Read the article

  • How to create a semi transparent window in WPF that allows mouse events to pass through

    - by RMK
    I am trying to create an effect similar to the Lights out /lights dim feature in Adobe Lightroom (http://www.youtube.com/watch?v=87hNd3vaENE) except in WPF. What I tried was to create another window over-top of my existing window, make it transparent and put a semi transparent Path geometry on it. But I want mouse events to be able to pass through this semi transparent window (on to windows below). This is a simplified version of what I have: <Window x:Class="LightsOut.MaskWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" AllowsTransparency="True" WindowStyle="None" ShowInTaskbar="False" Topmost="True" Background="Transparent"> <Grid> <Button HorizontalAlignment="Left" Height="20" Width="60">click</Button> <Path IsHitTestVisible="False" Stroke="Black" Fill="Black" Opacity="0.3"> <Path.Data> <RectangleGeometry Rect="0,0,1000,1000 "/> </Path.Data> </Path> </Grid> The window is fully transparent, so on places where the Path doesn't cover, mouse events pass right through. So far so good. The IsHitTestvisible is set to false on the path object. So mouse events will pass through it to other controls on the same form (ie you can click on the Button, because it is on the same form). But mouse events wont pass through the Path object onto windows that are below it. Any ideas? Or better ways to solve this problem? Thanks.

    Read the article

  • Using jquery with nested masterpages

    - by diver-d
    Hi everyone, Can anyone show me how to use jquery in an asp.net nested masterpage. I have my main masterpage where I have added the link to the jquery libaray and also the validation framework. I have then created another masterpage with some styling and created a aspx page based on that masterpage. How can I attach the validation framework to textboxes within my page? I have tried $("#aspnetForm").validate({ rules: { <%=txtPostCode.UniqueID %>: { minlength: 2, required: true }, <%=txtContactEmail.UniqueID %>: { required: true, email:true } }, messages: { <%=txtPostCode.UniqueID %>:{ required: "* Required Field *", minlength: "* Please enter atleast 2 characters *" } } }); However nothing happens. Can anyone point me in the right direction?

    Read the article

  • sql query to incrementally modify where condition until result contains what is required

    - by iamrohitbanga
    I need an sql query to select some items from a table based on some condition which is based on a category field. As an example consider a list of people and I fetch the people from a particular age group from the database. I want to check if the result contains at least one result from each of a number of categories. If not I want to modify the age group by extending it and check the results again. This is repeated until I get an age group for which one result is present for each category. Right now i am doing this by analyzing the results and modifying the sql query. So a number of sql select queries are sent. What is the most efficient way of doing this? I am invoking the select queries from a java program using jdbc. I am using mysql database.

    Read the article

  • Using multiple aggregate functions in an algebraic expression in (ANSI) SQL statement

    - by morpheous
    I have the following aggregate functions (AGG FUNCs): foo(), foobar(), fredstats(), barneystats(). I want to know if I can use multiple AGG FUNCs in an algebraic expression. This may seem a strange/simplistic question for seasoned SQL developers - however, the but the reason I ask is that so far, all AGG FUNCs examples I have seen are of the simplistic variety e.g. max(salary) < 100, rather than using the AGG FUNCs in an expression which involves using multiple AGG FUNCs in an expression (like agg_func1() agg_func2()). The information below should help clarify further. Given tables with the following schemas: CREATE TABLE item (id int, length float, weight float); CREATE TABLE item_info (item_id, name varchar(32)); # Is it legal (ANSI) SQL to write queries of this format ? SELECT id, name, foo, foobar, fredstats FROM A, B (SELECT id, foo(123) as foo, foobar('red') as foobar, fredstats('weight') as fredstats FROM item GROUP BY id HAVING [ALGEBRAIC EXPRESSION] ORDER BY id AS A), item_info AS B WHERE item.id = B.id Where: ALGEBRAIC EXPRESSION is the type of expression that can be used in a WHERE clause - for example: ((foo(x) < foobar(y)) AND foobar(y) IN (1,2,3)) OR (fredstats(x) <> 0)) I am using PostgreSQL as the db, but I would prefer to use ANSI SQL wherever possible. Assuming it is legal to include AGG FUNCS in the way I have done above, I'd like to know: Is there a more efficient way to write the above query ? Is there any way I can speed up the query in terms of a judicious choice of indexes on the tables item and item_info ? Is there a performance hit of using AGG FUNCs in an algebraic expression like I am (i.e. an expression involving the output of aggregate functions rather than constants? Can the expression also include 'scaled' AGG FUNC? (for example: 2*foo(123) < -3*foobar(456) ) - will scaling (i.e. multiplying an AGG FUNC by a number have an effect on performance?) How can I write the query above using INNER JOINS instead?

    Read the article

  • "Single NSMutableArray" vs. "Multiple C-arrays" --Which is more Efficient/Practical?

    - by RexOnRoids
    Situation: I have a DAY structure. The DAY structure has three variables or attributes: a Date (NSString*), a Temperature (float), and a Rainfall (float). Problem: I will be iterating through an array of about 5000 DAY structures and graphing a portion of these onto the screen using OpenGL. Question: As far as drawing performance, which is better? I could simply create an NSMutableArray of DAY structures (NSObjects) and iterate on the array on each draw call -- which I think would be hard on the CPU. Or, I could instead manually manage three different C-Arrays -- One for the Date String (2-Dimensional), One for the temperature (1-Dimensional) and One for the Rainfall (1-Dimensional). I could keep track of the current Day by referencing the current index of the iterated C-Arrays.

    Read the article

  • can I run new WP_Query inside the Loop with no affects to the Loop? (wordpress)

    - by Radek
    the bellow function is working fine but I need to run it inside the loop. If done so the post content is actually taken from the last post of my WP_Query. Not from the one that should appear. Is there any way to run my query and leave The Loop unaffected? function recent_post_by_author() { echo '<div class="recent_post_by_author">'; $my_query = new WP_Query('author_name=Radek&showposts=2'); while ($my_query->have_posts()) : $my_query->the_post(); ?> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php the_title(); ?></a><BR> <?php endwhile; echo '</div>'; }

    Read the article

  • how to get a part of a video

    - by George2
    Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 on Windows 7. I want to use Expression Encoder 3 to get a part of a video (original video in wmv format), in more details, in more details, I want to get the beginning 30 seconds of video (and save the 30-second video into another wmv file), and want to get the last 30 seconds of video (and save the 30-second video into another wmv file). Any reference code? I did not find MSDN provides too much reference sample code. thanks in advance, George

    Read the article

  • Strange performance behaviour

    - by plastilino
    I'm puzzled with this. In my machine Direct calculation: 375 ms Method calculation: 3594 ms, about TEN times SLOWER If I place the method calulation BEFORE the direct calculation, both times are SIMILAR. Woud you check it in your machine? class Test { static long COUNT = 50000 * 10000; private static long BEFORE; /*--------METHOD---------*/ public static final double hypotenuse(double a, double b) { return Math.sqrt(a * a + b * b); } /*--------TIMER---------*/ public static void getTime(String text) { if (BEFORE == 0) { BEFORE = System.currentTimeMillis(); return; } long now = System.currentTimeMillis(); long elapsed = (now - BEFORE); BEFORE = System.currentTimeMillis(); if (text.equals("")) { return; } String message = "\r\n" + text + "\r\n" + "Elapsed time: " + elapsed + " ms"; System.out.println(message); } public static void main(String[] args) { double a = 0.2223221101; double b = 122333.167; getTime(""); /*--------DIRECT CALCULATION---------*/ for (int i = 1; i < COUNT; i++) { Math.sqrt(a * a + b * b); } getTime("Direct: "); /*--------METHOD---------*/ for (int k = 1; k < COUNT; k++) { hypotenuse(a, b); } getTime("Method: "); } }

    Read the article

  • Typecast cross-platform compatibility

    - by kaykun
    Hi, what I'm trying to do is append a binary integer into a string object. So far I have this: int number = 5; cppstring.append((char*)&number, 4); It works fine on a x86 system with Windows, but some people are saying its not cross-platform and is unsafe. What is the preferred method to do this?

    Read the article

  • Getting output of a shell script in Cocoa

    - by Tristan Seifert
    Is there a way that lets me run a shell script, and display the output in an NSTextView? I do not want any input from the user to the shell script at all, since is is just called to compile a buch of files. The shell script part works fine so far, but I just can't figure out how to run it and show the output in an NSTextView. I know a shell script can be run using system() and NSTask, but how do I get it's output into an NSTextView?

    Read the article

  • What is microbenchmarking?

    - by polygenelubricants
    I've heard this term used, but I'm not entirely sure what it means, so: What DOES it mean and what DOESN'T it mean? What are some examples of what IS and ISN'T microbenchmarking? What are the dangers of microbenchmarking and how do you avoid it? (or is it a good thing?)

    Read the article

  • Migrate existing ROR app to GAE

    - by zengr
    I have managed to run a basic rails app1 on App Engine using: http://gist.github.com/268192 So, on my basic app2, I install CE, which works fine on local machine. (communityengine.org) But, when I follow the same steps on my actual app2, where community_engine plugin is installed and all the gems are frozen, the app engine installer script asks for to over write various files like boot.rb, routes.rb, which I don't allow. So, as expected, when I publish the rails + ce app to GAE, it's not published and it also screws the local installation of CE on app2. So, the problem is obvious, CE uses ActiveRecord, and GAE uses DataMapper. So, my question can also be rephrased as: Can we migrate an existing ROR App using Active Record to GAE which uses DataMapper? PS: This is my first project on ROR and GAE.

    Read the article

  • Recurring Apache 2.0.52 error on CentOS 4 - 'could not create `rewrite_log_lock`'

    - by warren
    I have been seeing a recurring issue on my web server: [Sun May 16 03:10:19 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 04:10:05 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 05:10:04 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed [Sun May 16 05:17:13 2010] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed So far, the only fix I have found to this when it happens is to reboot my server. This is non-ideal :-\ Restarting httpd does not clear the error. df indicates I have 20+ gigs free, and top and free both report 800+ megs (or 1.2 gigs) > df -h Filesystem Size Used Avail Use% Mounted on /dev/simfs 40G 18G 23G 44% / # > free total used free shared buffers cached Mem: 1474560 300832 1173728 0 0 0 -/+ buffers/cache: 300832 1173728 Any ideas on why this would recur, and how to prevent/fix it?

    Read the article

  • Unable to link to opengl libraries? DOS / MSVC

    - by Mark
    Is there something wrong with this link.exe command line? OpenGL32.lib and Glu32.lib are found at both of the LIBPATH directories. Is it possible the libraries are somehow incompatible? Is there a way to have the link.exe say that instead of unresolved external symbol? Googling shows that this error usually means the libraries are not found, but they are there. E:\mvs90\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:no /DEBUG /pdb:None /LIBPATH:E:\code\python\python\py26\libs /LIBPATH:E:\code\python\python\py26\PCbuild opengl32.lib glu32.lib /EXPORT:init_rabbyt build\temp.win32-2.6-pydebug\Debug\rabbyt/rabbyt._rabbyt.obj /OUT:build\lib.win32-2.6-pydebug\rabbyt\_rabbyt_d.pyd /IMPLIB:build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib /MANIFESTFILE:build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.pyd.manifest Creating library build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib and object build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.exp rabbyt._rabbyt.obj : error LNK2019: unresolved external symbol __imp__glOrtho re ferenced in function ___pyx_f_6rabbyt_7_rabbyt_set_viewport Directory of E:\code\python\python\py26\libs 09/27/2007 02:20 PM 12,672 GlU32.Lib 09/27/2007 02:20 PM 76,924 OpenGL32.Lib

    Read the article

  • Help setup my .git/config file for Heroku AND my Unfuddle Account

    - by 05WRXSTi
    Ok, I have three different computers that I work from and right now their configurations are all different so I have to push/pull a certain on each and its very bothersome. What I want to do is have ONE config file that I can use for all three that will allow me to do the following: git push unfuddle git pull heroku git push unfuddle git pull heroku And I'm new to git, so I know that maybe I need heroku master or 'heroku origin` or somethign? Here is what my config file looks like right now: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = [email protected]:HEROKU-APP.git [branch "master"] remote = origin merge = refs/heads/master [remote "unfuddle"] fetch = +refs/heads/*:refs/remotes/origin/* url = [email protected]:UNFUDDLE-APP/UNFUDDLE-APP.git obviously the git urls were changed to protect the innocent. What should I change so that I can easily push and pull to/from both of these repos? Thanks!

    Read the article

  • How do I remove accents from characters in a PHP string?

    - by georgebrock
    I'm attempting to remove accents from characters in PHP string as the first step to making the string usable in a URL. I'm using the following code: $input = "Fóø Bår"; setlocale(LC_ALL, "en_US.utf8"); $output = iconv("utf-8", "ascii//TRANSLIT", $input); print($output); The output I would expect would be something like this: F'oo Bar However, instead of the accented characters being transliterated they are replaced with question marks: F?? B?r Everything I can find online indicates that setting the locale will fix this problem, however I'm already doing this. I've already checked the following details: The locale I am setting is supported by the server (included in the list produced by locale -a) The source and target encodings (UTF-8 and ASCII) are supported by the server's version of iconv (included in the list produced by iconv -l) The input string is UTF-8 encoded (verified using PHP's mb_check_encoding function, as suggested in the answer by mercator) The call to setlocale is successful (it returns 'en_US.utf8' rather than FALSE) The cause of the problem: The server is using the wrong implementation of iconv. It has the glibc version instead of the required libiconv version. Note that the iconv function on some systems may not work as you expect. In such case, it'd be a good idea to install the GNU libiconv library. It will most likely end up with more consistent results. – PHP manual's introduction to iconv Details about the iconv implementation that is used by PHP are included in the output of the phpinfo function. (I'm not able to re-compile PHP with the correct iconv library on the server I'm working with for this project so the answer I've accepted below is the one that was most useful for removing accents without iconv support.)

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >