Search Results

Search found 4765 results on 191 pages for 'gh unit'.

Page 92/191 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • How can I implement lazy loading on a page with 500+ images?

    - by Fedor
    I basically have a booking engine unit results page which must show 40 units and per each unit there's 1 large image of the first thumbnail and an X number of accompanying thumbnail images. I've been using the jquery lazy load plugin, but it's not thorough enough ( I'm invoking it on DOM Ready ), plus it doesn't really work in IE ( 50% of the clients use IE so it's a big issue ). What I think I really need to do is not really spit out the image but a fake element such as a span, and possibly modify my code such that if the user views the span, render it into an image element. <span src="/images/foo.gif"> The booking engine relies on JS so I think I might be forced to just rely on ajaxifying all the thumbnails and have event handlers on window scroll, etc in order for the page to be "usable" and load at an average time ( 2-3 seconds instead of 5-30s on high speed DSL/Cable ). I'd appreciate any examples or ideas.

    Read the article

  • sorting group of lines

    - by benjamin button
    I have a text file like below iv_destination_code_10 TAP310_mapping_RATERUSG_iv_destination_code_10 RATERUSG.iv_destination_code_10 = WORK.maf_feature_info[53,6] iv_destination_code_2 TAP310_mapping_RATERUSG_iv_destination_code_2 RATERUSG.iv_destination_code_2 = WORK.maf_feature_info[1,6] iv_destination_code_3 TAP310_mapping_RATERUSG_iv_destination_code_3 RATERUSG.iv_destination_code_3 = WORK.maf_feature_info[7,6] iv_destination_code_4 TAP310_mapping_RATERUSG_iv_destination_code_4 RATERUSG.iv_destination_code_4 = WORK.maf_feature_info[13,6] iv_destination_code_5 TAP310_mapping_RATERUSG_iv_destination_code_5 RATERUSG.iv_destination_code_5 = WORK.maf_feature_info[19,6] iv_destination_code_6 TAP310_mapping_RATERUSG_iv_destination_code_6 RATERUSG.iv_destination_code_6 = WORK.maf_feature_info[29,6] iv_destination_code_7 TAP310_mapping_RATERUSG_iv_destination_code_7 RATERUSG.iv_destination_code_7 = WORK.maf_feature_info[35,6] iv_destination_code_8 TAP310_mapping_RATERUSG_iv_destination_code_8 RATERUSG.iv_destination_code_8 = WORK.maf_feature_info[41,6] iv_destination_code_9 TAP310_mapping_RATERUSG_iv_destination_code_9 RATERUSG.iv_destination_code_9 = WORK.maf_feature_info[47,6] combination of three lines form a unit: iv_destination_code_9 TAP310_mapping_RATERUSG_iv_destination_code_9 RATERUSG.iv_destination_code_9 = WORK.maf_feature_info[47,6] is one unit. iv_destination_code_9 9 indicates the number by which i have to sort 10 9 8.... i need a shell script/awk which will sort the units in a descending order. how is it possible?

    Read the article

  • Creating Delegates With Lambda Expressions in F#

    - by Matt H
    Why does... type IntDelegate = delegate of int -> unit type ListHelper = static member ApplyDelegate (l : int list) (d : IntDelegate) = l |> List.iter (fun x -> d.Invoke x) ListHelper.ApplyDelegate [1..10] (fun x -> printfn "%d" x) not compile, when: type IntDelegate = delegate of int -> unit type ListHelper = static member ApplyDelegate (l : int list, d : IntDelegate) = l |> List.iter (fun x -> d.Invoke x) ListHelper.ApplyDelegate ([1..10], (fun x -> printfn "%d" x)) does? The only difference that is that in the second one, ApplyDelegate takes its parameters as a tuple. Error 1 This function takes too many arguments, or is used in a context where a function is not expected

    Read the article

  • Junit Ant Task, output stack trace

    - by Benju
    I have a number of tests failing in the following JUnit Task. <target name="test-main" depends="build.modules" description="Main Integration/Unit tests"> <junit fork="yes" description="Main Integration/Unit Tests" showoutput="true" printsummary="true" outputtoformatters="true"> <classpath refid="test-main.runtime.classpath"/> <batchtest filtertrace="false" todir="${basedir}"> <fileset dir="${basedir}" includes="**/*Test.class" excludes="**/*MapSimulationTest.class"/> </batchtest> </junit> </target> How do I tell Junit to ouput the errors for each test so that I can look at the stack trace and debug the issues.

    Read the article

  • Why does the CPU window always appear when trying to debug my project after a rebuild in Delphi 2010

    - by James
    Hi, Whenever I rebuild my application and try to step into a break-point the CPU window always appears. From what I understand the CPU window appears when DCU does not match up with the source file, however, in my case the DCU's are defintely being re-compiled and there are no old ones lying around or anything like that. The strange thing here is if I close down the application and re-open the project, place the breakpoint and run it works fine. I can even modify files and just press F9 to run the project and it works fine....it only seems to be when I rebuild the project (via IDE Project menu or the project context menu) that this CPU window never breaks into the source (even though it can find it!). I also noticed in the callstack a unit called Generics is always the top of the stack, never the unit my break point is in, this is no way related to where my break point is. Any ideas?

    Read the article

  • Rails fixtures seem to be adding extra unexpected data

    - by Mason Jones
    Hello, all. I've got a dynamic fixture CSV file that's generating predictable data for a table in order for my unit tests to do their thing. It's working as expected and filling the table with the data, but when I check the table after the tests run, I'm seeing a number of additional rows of "blank" data (all zeros, etc). Those aren't being created by the fixture, and the unit tests are read-only, just doing selects, so I can't blame the code. There doesn't seem to be any logging done during the fixtures setup, so I can't see when the "blank" data is being inserted. Anyone ever run across this before, or have any ideas of how to log or otherwise see what the fixture setup is doing in order to trace down the source of the blank data?

    Read the article

  • JSON is not nested in rails view

    - by SeanGeneva
    I have a several models in a heirarchy, 1:many at each level. Each class is associated only with the class above it and the one below it, ie: L1 course, L2 unit, L3 unit layout, L4 layout fields, L5 table fields (not in code, but a sibling of layout fields) I am trying to build a JSON response of the entire hierarchy. def show @course = Course.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json do @course = Course.find(params[:id]) @units = @course.units.all @unit_layouts = UnitLayout.where(:unit_id => @units) @layout_fields = LayoutField.where(:unit_layout_id => @unit_layouts) response = {:course => @course, :units => @units, :unit_layouts => @unit_layouts, :layout_fields => @layout_fields} respond_to do |format| format.json {render :json => response } end end end end The code is bring back the correct values, but the units, unit_layouts and layout_fields are all nested at the same level under course. I would like them to be nested inside their parent.

    Read the article

  • Javascript text Resize

    - by blackessej
    Without getting into the "should a text resizer be used or not" debate, I'd like some help with this...suffice to say that my clientele are from and older generation and may be sight impaired... My script isn't functioning, and I'm not sure why. It's not live yet, so here's what I'm working with: function fsize(size,unit,id){ var vfontsize = document.getElementById("#colleft"); if(vfontsize){ vfontsize.style.fontSize = size + unit; } } var textsize = 14; function changetextsize(up){ if(up){ textsize = parseFloat(textsize)+2; }else{ textsize = parseFloat(textsize)-2; } } I'm using onclick events to trigger the size changes. Thanks for your help!

    Read the article

  • Ruby - Is there a way to overwrite the __FILE__ variable?

    - by Markus Orrelly
    I'm doing some unit testing, and some of the code is checking to see if files exist based on the relative path of the currently-executing script by using the FILE variable. I'm doing something like this: if File.directory?(File.join(File.dirname(__FILE__),'..','..','directory')) blah blah blah ... else raise "Can't find directory" end I'm trying to find a way to make it fail in the unit tests without doing anything drastic. Being able to overwrite the __ FILE __ variable would be easiest, but as far as I can tell, it's impossible. Any tips?

    Read the article

  • Returning different data types C#

    - by user1810659
    i have create a class library (DLL) with many different methods. and the return different types of data(string string[] double double[]). Therefore i have created one class i called CustomDataType for all the methods containing different data types so each method in the Library can return object of the custom class and this way be able to return multiple data types I have done it like this: public class CustomDataType { public double Value; public string Timestamp; public string Description; public string Unit; // special for GetparamterInfo public string OpcItemUrl; public string Source; public double Gain; public double Offset; public string ParameterName; public int ParameterID; public double[] arrayOfValue; public string[] arrayOfTimestamp; // public string[] arrayOfParameterName; public string[] arrayOfUnit; public string[] arrayOfDescription; public int[] arrayOfParameterID; public string[] arrayOfItemUrl; public string[] arrayOfSource; public string[] arrayOfModBusRegister; public string[] arrayOfGain; public string[] arrayOfOffset; } The Library contains methods like these: public CustomDataType GetDeviceParameters(string deviceName) { ...................... code getDeviceParametersObj.arrayOfParameterName; return getDeviceParametersObj; } public CustomDataType GetMaxMin(string parameterName, string period, string maxMin) { .....................................code getMaxMingObj.Value = (double)reader["MaxMinValue"]; getMaxMingObj.Timestamp = reader["MeasurementDateTime"].ToString(); getMaxMingObj.Unit = reader["Unit"].ToString(); getMaxMingObj.Description = reader["Description"].ToString(); return getMaxMingObj; } public CustomDataType GetSelectedMaxMinData(string[] parameterName, string period, string mode) {................................code selectedMaxMinObj.arrayOfValue = MaxMinvalueList.ToArray(); selectedMaxMinObj.arrayOfTimestamp = MaxMintimeStampList.ToArray(); selectedMaxMinObj.arrayOfDescription = MaxMindescriptionList.ToArray(); selectedMaxMinObj.arrayOfUnit = MaxMinunitList.ToArray(); return selectedMaxMinObj; } As illustrated thi different methods returns different data types,and it works fine for me but when i import the DLL and want to use the methods Visual studio shwos all the data types in the CustomDataType class as suggestion for all the methods even though the return different data.This is illusrtated in the picture below. As we can see from the picture with the suggestion of all the different return data the user can get confused and choose wrong return data for some of the methods. So my question is how can i improve this. so Visual studio suggest just the belonging return data type for each method.

    Read the article

  • Help in setting the setClientInfo with JPA

    - by enrique
    i am trying to set to jpa the new JDBC method which allows the application to be identified with a name it is the setClientInfo() and i could do it using pure JDBC using the lines Properties jdbcProperties = new Properties(); jdbcProperties.put("user", "system"); jdbcProperties.put("password", "sw01"); jdbcProperties.put("v$session.program", "Clients"); Connection connection = DriverManager.getConnection(url,jdbcProperties); However i have new requirements and i need to make it with JPA EclipseLink i have been googling and could not find something substantial on how to set this property out in JPA i guess it is by annotating something but i do not know what, i was trying to setting the persistence unit by putting the following in the persistence unit: <properties> <property name="toplink.ddl-generation" value="create-tables"/> <property name="v$session.program" value="Clients"/> </properties> but no lucky ...does somebody know how to do it or any idea...? thanks in advanced.-

    Read the article

  • When can we mock an object and its methods?

    - by Shailendra
    I am novice to the Moq and unit testing. I have to write unit tests to a lot of classes which has the objects of other classes. can i mock the methods of the class objects. Here is the exact scenerio- I have a class two classes A and B and A has a private object of B and in a method of A i am internally calling the method of B and then doing some calculation and returning the result. Can i mock the method of B in this scenerio? Please try to give me full detail about the conditions where i can mock the methods and functions of the class. Thanx

    Read the article

  • How to find Junit tests that are using a given Java method directly or indirectly

    - by IT-Worx
    Assume there are Java project and Junit project in an Eclipse workspace. And All the unit tests are located in the Junit project and dependent on the application Java project. When making changes to a Java method, I need to find the unit tests that are using the method directly or indirectly, so that I can run the corresponding tests locally in my PC before checking into source control. I don't want to run the entire junit project since it takes time. I could use Eclipse call hierarchy to expand caller methods one by one until I find a test method. But for a project including more than 1 million lines of source code, digging down the call hierarchy takes time too. The search scope within call hierarchy view doesn't seem help much. Appreciate any help.

    Read the article

  • Question About NerdDinner Controller Constructors

    - by Gavin Draper
    I've been looking at the Nerd Dinner app, more specifically how it handles its unit tests. The following constructors for the RSVPController are confusing my slightly public RSVPController() : this(new DinnerRepository()) { } public RSVPController(IDinnerRepository repository) { dinnerRepository = repository; } From what I can tell the second one is used by the unit tests so it can use Fake repositories. What I cant work out is what the first constructor does. It doesn't seem to ever set the dinnerRepository variable, it seems to imply its inheriting from something but I really don't get it. Can anyone explain? Thanks

    Read the article

  • get the list and input from one function and run them in different function

    - by rookie
    i have a programm that generate the list and then i ask them to tell me what they want to do from the menu and this is where my problem start i was able to get the input form the user to different function but when i try to use the if else condition it doesn't check, below are my code def menu(x,l): print (x) if x == 1: return make_table(l) if x == 2: y= input("enter a row (as a number) or a column (as an uppercase letter") if y in [ "1",'2','3']: print("Minmum is:",minimum(y,l)) if x== 3: print ('bye') def main(): bad_filename = True l =[] while bad_filename == True: try: filename = input("Enter the filename: ") fp = open(filename, "r") for f_line in fp: f_str=f_line.strip() f_str=f_str.split(',') for unit_str in f_str: unit=float(unit_str) l.append(unit) bad_filename = False except IOError: print("Error: The file was not found: ", filename) #print(l) condition=True while condition==True: print('1- open\n','2- maximum') x=input("Enter the choice") menu(x,l) main() from the bottom function i can get list and i can get the user input and i can get the data and move it in second function but it wont work after that.thank you

    Read the article

  • How to convert ms access data into pdf in vb.net

    - by user225269
    I want to convert the ms access data into a document so that the print function in vb.net will read it. Where do I start from here? Here is my form: http://screencast.com/t/MGU4N2UyNmY And here is the code for print preview. Try PrintPreviewDialog1.ShowDialog() Catch es As Exception MessageBox.Show(es.Message) End Try How do I incorporate the above code, to the code below so that there is something that can be seen when I hit the print button? Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb") Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn) cn.Open() Dim rdr As OleDbDataReader rdr = cmd.ExecuteReader If rdr.HasRows Then rdr.Read() NoAcc = rdr("NAME") If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER") If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT") If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE") End If Please help,thanks

    Read the article

  • Ruby getting the diagonal elements in a 2d Array

    - by Calm Storm
    Hi, I was trying some problems with my 2D ruby array and my LOC reduces a lot when I do array slicing. So for example, require "test/unit" class LibraryTest < Test::Unit::TestCase def test_box array = [[1,2,3,4],[3,4,5,6], [5,6,7,8], [2,3,4,5]] puts array[1][2..3] # 5, 6 puts array[1..2][1] # 5, 6, 7, 8 end end I want to know if there is a way to get a diagonal slice? Lets say I want to start at [0,0] and want a diagonal slice of 3. Then I would get elements from [0,0], [1,1], [2,2] and I will get an array like [1,4,7] for example above. Is there any magic one-liner ruby code that can achieve this? 3.times do {some magic stuff?}

    Read the article

  • If I don't odr-use a variable, can I have multiple definitions of it across translation units?

    - by sftrabbit
    The standard seems to imply that there is no restriction on the number of definitions of a variable if it is not odr-used (§3.2/3): Every program shall contain exactly one definition of every non-inline function or variable that is odr-used in that program; no diagnostic required. It does say that any variable can't be defined multiple times within a translation unit (§3.2/1): No translation unit shall contain more than one definition of any variable, function, class type, enumeration type, or template. But I can't find a restriction for non-odr-used variables across the entire program. So why can't I compile something like the following: // other.cpp int x; // main.cpp int x; int main() {} Compiling and linking these files with g++ 4.6.3, I get a linker error for multiple definition of 'x'. To be honest, I expect this, but since x is not odr-used anywhere (as far as I can tell), I can't see how the standard restricts this. Or is it undefined behaviour?

    Read the article

  • who uses a TCP port?

    - by dijxtra
    One of gen_servers in my app call gen_tcp:listen(Port, [{active, true}]). First time I run unit test, it returns {ok, Socket}, but second time I run the same unit test, it returns an {error, eaddrinuse}, but lsof -i TCP returns nothing. Also, when the same unit_test is run twice on another machine (WinXP), it works as expected (that is, returns {ok, Socket} both times). Therefore, my gen_server obviously releases the port, but Erlang somehow doesn't know that. So, how can I figure out who does Erlang think uses this address?

    Read the article

  • What is the role of `while`-loops in computation expressions in F#?

    - by MizardX
    If you define a While method of the builder-object, you can use while-loops in your computation expressions. The signature of the While method is: member b.While (predicate:unit->bool, body:M<'a>) : M<'a> For comparison, the signature of the For method is: member b.For (items:seq<'a>, body:unit->M<'a>) : M<'a> You should notice that, in the While-method, the body is a simple type, and not a function as in the For method. You can embed some other statements, like let and function-calls inside your computation-expressions, but those can impossibly execute in a while-loop more than once. builder { while foo() do printfn "step" yield bar() } Why is the while-loop not executed more than once, but merely repeated? Why the significant difference from for-loops? Better yet, is there some intended strategy for using while-loops in computation-expressions?

    Read the article

  • jQuery .ajax doesn't load Google Adsense

    - by Sahas Katta
    Hey Everyone, Just ran into an odd issue. I have a simple WP loop and instead of regular NEXT/BACK pages, I use a jQuery powered $.ajax get to append the following page to the current page. It works perfectly. However, I choose to insert a Google Adsense unit every 5th story. Unfortunately, the Adsense unit that is brought in with a second, third, or etc page load don't render. Here's my loop: 10 stories per page, Adsense after the 4th one. <?php $count = 0; ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php $count++; ?> <div class="card"> <div class="title"> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><span><?php the_title(); ?></span></a> </div> </div> <?php if ($count == 4) : ?> <div class="card"> <!-- ADSENSE CODE HERE (Straight from Google Adsense Panel, no tweaks.) --> </div> <?php endif; ?> As for my jQuery script, here's how that looks: $.ajax({ url: nextPageLink, type: 'GET', success: function(data) { $(data).find('#reviews .card').appendTo('#reviews'); }, error: function(xhr, status, error) { $('.loadination').addClass('hidden'); } }); Keep in mind, I just simplified my code to give you guys an example. The code above was just the essentials. All the loading stuff works perfectly. Images, text, links, etc all load just fine. However, the Google Adsense unit doesn't. Any help would be appreciated. Thanks and Happy Holidays!

    Read the article

  • Is this data set in third normal form?

    - by user2980802
    UNF: (Customer-name, Customer-id, Customer-address, (Unit-price, Order-id, Quantity, Product-id, Delivery-date) (Supplier-name, Supplier-id, Supplier-Address) 3NF: CUSTOMER (Customer-id, Order-id, Customer-name, Customer-address) ORDER (Order-id, Customer-id) ORDER/PRODUCT (Order-id, Quantity, Product-id) PRODUCT (Order-id, Product-id, Delivery-date, Supplier-id, Unit-price,) SUPPLIER (Supplier-name, Supplier-id, Supplier-Address, Product-id) Basically, the UNF is the un-normalised form. The information should have EXACTLY five tables, it's a hint we were given. The tables listed are the definite table names. We were told to make assumptions based on this information: Customer Invoice is generated from customer orders (Order & Order/Product entities) Supplier Order is generated for products that are low in stock (Product entity) Assumptions A customer can place many orders but an order is placed by only one customer An order can be for many products and a product can be ordered many times A product is supplied by only one supplier, a supplier may supply many products This is one of my modules in university and my lecturer is all but useful, I'm really struggling so any help is really appreciated.

    Read the article

  • Do I put ninject in my project that contains my service layer as well?

    - by chobo2
    Hi I have 3 project files(webui,framework that contains service layers and repos and unit tests). Most of my unit testing will be done in the service layer as this will contain all the business logic. So I will be mocking out the repo. In some cases I will query my a repo from my controller(say I just need all users in the database and I am not doing any business logic for it). So I am thinking that I need to have ninject used in my framework project. Where is the best place to put it so I can use them against my repos in my service layers?

    Read the article

  • Talks Submitted for Ann Arbor Day of .NET 2010

    - by PSteele
    Just submitted my session abstracts for Ann Arbor's Day of .NET 2010.   Getting up to speed with .NET 3.5 -- Just in time for 4.0! Yes, C# 4.0 is just around the corner.  But if you haven't had the chance to use C# 3.5 extensively, this session will start from the ground up with the new features of 3.5.  We'll assume everyone is coming from C# 2.0.  This session will show you the details of extension methods, partial methods and more.  We'll also show you how LINQ -- Language Integrated Query -- can help decrease your development time and increase your code's readability.  If time permits, we'll look at some .NET 4.0 features, but the goal is to get you up to speed on .NET 3.5.   Go Ahead and Mock Me! When testing specific parts of your application, there can be a lot of external dependencies required to make your tests work.  Writing fake or mock objects that act as stand-ins for the real dependencies can waste a lot of time.  This is where mocking frameworks come in.  In this session, Patrick Steele will introduce you to Rhino Mocks, a popular mocking framework for .NET.  You'll see how a mocking framework can make writing unit tests easier and leads to less brittle unit tests.   Inversion of Control: Who's got control and why is it being inverted? No doubt you've heard of "Inversion of Control".  If not, maybe you've heard the term "Dependency Injection"?  The two usually go hand-in-hand.  Inversion of Control (IoC) along with Dependency Injection (DI) helps simplify the connections and lifetime of all of the dependent objects in the software you write.  In this session, Patrick Steele will introduce you to the concepts of IoC and DI and will show you how to use a popular IoC container (Castle Windsor) to help simplify the way you build software and how your objects interact with each other. If you're interested in speaking, hurry up and get your submissions in!  The deadline is Monday, April 5th! Technorati Tags: .NET,Ann Arbor,Day of .NET

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >