Search Results

Search found 943 results on 38 pages for 'np intermediate'.

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

  • Trying to understand why VLANs need to be created on intermediate switches

    - by Jon Reeves
    I'm currently studying for the Cisco switching exam and having trouble understanding exactly how 802.1q tagging works. Given three daisy chained switches (A,B, and C) with trunk ports between them and VLAN 101 defined on both end switches (A and C), I'm not sure why the VLAN also needs to be defined on the middle one (B)? Note that I am not disputing that it does need to be configured, I'm just trying to understand why exactly. As I understand it, traffic from VLAN 101 on switch A will be tagged as it goes through the trunk to switch B. According to the documentation I have read, trunks will pass all VLANs by default, and the .1q tag is only removed when the frame leaves through an access port on the relevant VLAN. From this I would expect switch B to simply forward the tagged frame unchanged through the trunk to switch C. Can anyone shed some light on how switch B processes this frame and why it does not get forwarded through the other trunk ?

    Read the article

  • Implementing dynamic scope when using CPS as intermediate language

    - by asandroq
    I am currently studying the implementation of programming languages and became interested in using Continuation-Passing Style as the intermediate language of the compiler. I also want to implement limited dynamic scope (for exception-handling or Scheme parameter objects) but I cannot find the relevant literature. I think it can be done with a separate environment passed as a variable to every closure, but this solution seems ugly to me. Could anyone point me to the relevant literature, or give me an idea of how this can be done?

    Read the article

  • ANTLR expressions rewrite intermediate tree

    - by user313856
    For expressions like 3+4 I would like to use the value 7 in an intermediate representation tree. I cannot work out how to get the returns value into a rewrite rule. expression returns [int v]: etc. How do I get expression.v into WR? At the moment I get (+ 3 4), I want (7) |^( WRITE c=expression) - ^(WRINT ^(INTC ^($c)) the next step is to emit 7 in an assembler.

    Read the article

  • Make seems to think a prerequisite is an intermediate file, removes it

    - by James
    For starters, this exercise in GNU make was admittedly just that: an exercise rather than a practicality, since a simple bash script would have sufficed. However, it brought up interesting behavior I don't quite understand. I've written a seemingly simple Makefile to handle generation of SSL key/cert pairs as necessary for MySQL. My goal was for make <name> to result in <name>-key.pem, <name>-cert.pem, and any other necessary files (specifically, the CA pair if any of it is missing or needs updating, which leads into another interesting follow-up exercise of handling reverse deps to reissue any certs that had been signed by a missing/updated CA cert). After executing all rules as expected, make seems to be too aggressive at identifying intermediate files for removal; it removes a file I thought would be "safe" since it should have been generated as a prereq to the main rule I'm invoking. (Humbly translated, I likely have misinterpreted make's documented behavior to suit my expectation, but don't understand how. ;-) Edited (thanks, Chris!) Adding %-cert.pem to .PRECIOUS does, of course, prevent the deletion. (I had been using the wrong syntax.) Makefile: OPENSSL = /usr/bin/openssl # Corrected, thanks Chris! .PHONY: clean default: ca clean: rm -I *.pem %: %-key.pem %-cert.pem @# Placeholder (to make this implicit create a rule and not cancel one) Makefile: @# Prevent the catch-all from matching Makefile ca-cert.pem: ca-key.pem $(OPENSSL) req -new -x509 -nodes -days 1000 -key ca-key.pem $@ %-key.pem: $(OPENSSL) genrsa 2048 $@ %-cert.pem: %-csr.pem ca-cert.pem ca-key.pem $(OPENSSL) x509 -req -in $ $@ Output: $ make host1 /usr/bin/openssl genrsa 2048 ca-key.pem /usr/bin/openssl req -new -x509 -nodes -days 1000 -key ca-key.pem ca-cert.pem /usr/bin/openssl genrsa 2048 host1-key.pem /usr/bin/openssl req -new -days 1000 -nodes -key host1-key.pem host1-csr.pem /usr/bin/openssl x509 -req -in host1-csr.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 host1-cert.pem rm host1-csr.pem host1-cert.pem This is driving me crazy, and I'll happily try any suggestions and post results. If I'm just totally noobing out on this one, feel free to jibe away. You can't possibly hurt my feelings. :)

    Read the article

  • Use of const double for intermediate results

    - by Arne
    Hi, I a writing a Simulation program and wondering if the use of const double is of any use when storing intermediate results. Consider this snippet: double DoSomeCalculation(const AcModel &model) { (...) const double V = model.GetVelocity(); const double m = model.GetMass(); const double cos_gamma = cos(model.GetFlightPathAngleRad()); (...) return m*V*cos_gamma*Chi_dot; } Note that the sample is there only to illustrate -- it might not make to much sense from the engineering side of things. The motivation of storing for example cos_gamma in a variable is that this cosine is used many time in other expressions covered by (...) and I feel that the code gets more readable when using cos_gamma rather than cos(model.GetFlightPathAngleRad()) in various expressions. Now the actual is question is this: since I expect the cosine to be the same througout the code section and I actually created the thing only as a placeholder and for convenience I tend to declare it const. Is there a etablished opinion on wether this is good or bad practive or whether it might bite me in the end? Does a compiler make any use of this additional information or am I actually hindering the compiler from performing useful optimizations? Arne

    Read the article

  • Configuring the GPS Intermediate Driver

    - by Zach Smith
    Hello, I have a Motorola MC75 with an integrated GPS system that I am trying to use for programming. I have done some research on it and tried setting it up by editing the remote registry of the device according to some specifications that I found on the internet on this blog, http://csharponphone.blogspot.com/2007/07/configuring-gps-intermediate-driver.html. I used the smart phone guide at the bottom of the page but to no avail. Currently, I am trying to test it with the GPS application provided in the Windows Mobile 6 SDK samples. The program will load and begin what looks like the search for satellites but will not locate anything. I do not think the GPS is set up correctly. Does anyone have any helpful insight onto this issue or a guide for configuring the GPSID? Thank you in advance. Also, I have already checked and tried some of the config help on MSDN which does not help me either. I will surely vote for the most helpful answer. Thanks, Zach

    Read the article

  • Create and use intermediate certificate authority on Windows Server 2012?

    - by Sid
    Background: Server OS is Windows Server 2012. GUI is installed as we come upto speed with powershell. Setup is staging, not production (yet). We have our (internal, domain limited) Root CA installed. I would like to take the Root CA offline to secure storage but before that I'd like to setup an intermediate CA which can take over actual live, online (int-RA-net) functionality Can someone guide me covering: creating the intermediate CA certificate request installing the intermediate CA certificate on domain controller (certification authority role already installed with Root CA online right now) use the intermediate CA to generate a certificate (any use certificate, just for demonstration purposes) Obviously this certification chain would be invalid on computers outside our domain (self trusted root - our root certificate is NOT from common 3rd parties). This last point is NOT a problem.

    Read the article

  • Distance by sea calculator, intermediate coordinates?

    - by Lucian2k
    How do I calculate distance between 2 coordinates by sea? I also want to be able to draw a route between the two coordinates. Only solution I found so far is to split a map into pixels, identify each pixel as LAND or SEA and then try to find the path using A* algorithm. Then transform pixels to relative coordinates. There are some software packages I could buy but none have online extensions. A service that calculates distances between sea ports and plots the path on a map is searates.com

    Read the article

  • Converting currencies via intermediate currencies.

    - by chillitom
    class FxRate { string Base { get; set; } string Target { get; set; } double Rate { get; set; } } private IList<FxRate> rates = new List<FxRate> { new FxRate {Base = "EUR", Target = "USD", Rate = 1.3668}, new FxRate {Base = "GBP", Target = "USD", Rate = 1.5039}, new FxRate {Base = "USD", Target = "CHF", Rate = 1.0694}, new FxRate {Base = "CHF", Target = "SEK", Rate = 8.12} // ... }; Given a large yet incomplete list of exchange rates where all currencies appear at least once (either as a target or base currency): What algorithm would I use to be able to derive rates for exchanges that aren't directly listed? I'm looking for a general purpose algorithm of the form: public double Rate(string baseCode, string targetCode, double currency) { return ... } In the example above a derived rate would be GBP-CHF or EUR-SEK (which would require using the conversions for EUR-USD, USD-CHF, CHF-SEK) Whilst I know how to do the conversions by hand I'm looking for a tidy way (perhaps using LINQ) to perform these derived conversions perhaps involving multiple currency hops, what's the nicest way to go about this?

    Read the article

  • SQL query through an intermediate table

    - by Bryan
    Given the following tables: Recipes | id | name | 1 | 'chocolate cream pie' | 2 | 'banana cream pie' | 3 | 'chocolate banana surprise' Ingredients | id | name | 1 | 'banana' | 2 | 'cream' | 3 | 'chocolate' RecipeIngredients | recipe_id | ingredient_id | 1 | 2 | 1 | 3 | 2 | 1 | 2 | 2 | 3 | 1 | 3 | 3 How do I construct a SQL query to find recipes where ingredients.name = 'chocolate' and ingredients.name = 'cream'?

    Read the article

  • SQL join to grab data from same table via intermediate table

    - by Sergio
    Hi Could someone help me with building the following query. I have a table called Sites, and one called Site_H. The two are joined by a foreign key relationship on page_id. So the Sites table contains pages, and the Site_H table shows which pages any given page is a child of by having another foreign key relation back to the site table with a column called ParentOf. So, a page can be have another page as a parent. Other data is stored in the Site_H table such as position etc, hence why it is separated out. I would like a query that returns the details of a page along with the details of its parent page. I just cant quite think about how to structure the SQL. Thanks

    Read the article

  • Using intermediate array for hashCode and equals

    - by Basilevs
    As its a pain to handle structural changes of the class in two places I often do: class A { private B bChild; private C cChild; private Object[] structure() { return new Object[]{bChild, cChild}; } int hashCode() { Arrays.hashCode(structure); } boolean equals(Object that) { return Arrays.equals(this.structure(), ((A)that).structure()); } } What's bad about this approach besides boxing of primitives? Can it be improved?

    Read the article

  • Can I bypass an intermediate object in hibernate

    - by Jherico
    I have top level entities TRACK, MEDIA_GROUP and MEDIA, each with an integer primary key. I also have a join table from TRACK to MEDIA_GROUP which is 1:1 and MEDIA has a FK column into MEDIA_GROUP. I'm trying to find a way in hibernate to map a collection of Media directly into the Track object, bypassing the creation of a MediaGroup object. Basically I want to turn this: TRACK <-> MEDIA_TRACK_MAP <-> MEDIA_GROUP <-> MEDIA into this: TRACK <-> MEDIA_TRACK_MAP <-> MEDIA But the join column between MEDIA_TRACK_MAP and MEDIA isn't the primary key of MEDIA.

    Read the article

  • nested list comprehension using intermediate result

    - by KentH
    I am trying to grok the output of a function which doesn't have the courtesy of setting a result code. I can tell it failed by the "error:" string which is mixed into the stderr stream, often in the middle of a different conversion status message. I have the following list comprehension which works, but scans for the "error:" string twice. Since it is only rescanning the actual error lines, it works fine, but it annoys me I can't figure out how to use a single scan. Here's the working code: errors = [e[e.find('error:'):] for e in err.splitlines() if 'error:' in e] The obvious (and wrong) way to simplify is to save the "find" result errors = [e[i:] for i in e.find('error:') if i != -1 for e in err.splitlines()] However, I get "UnboundLocalError: local variable 'e' referenced before assignment". Blindly reversing the 'for's in the comprehension also fails. How is this done? THanks. Kent

    Read the article

  • Intermediate values in C++

    - by sterh
    Hello. I can not find how to implement a design in C++. In the language of Delphi in case the operator can write the following design: case s[j] of '0'..'9','A'..'Z','a'..'z','_': doSomeThing(); How can i do the same in c++. Attracts me is the construction type 'a' .. 'z' and etc... Thank you

    Read the article

  • Is it bad form to stage a function's steps in intermediate variables (let bindings)?

    - by octopusgrabbus
    I find I tend to need intermediate variables. In Clojure that's in the form of let bindings, like cmp-result-1 and cmp-result-2 in the following function. (defn str-cmp "Takes two strings and compares them. Returns the string if a match; and nil if not." [str-1 str-2 start-pos substr-len] (let [cmp-result-1 (subs str-1 start-pos substr-len) cmp-result-2 (subs str-2 start-pos substr-len)] (compare cmp-result-1 cmp-result-2))) I could re-write this function without them, but to me, the function's purpose looks clearer. I tend to do this quite in a bit in my main, and that is primarily for debugging purposes, so I can pass a variable to print out intermediate output. Is this bad form, and, if so, why? Thanks.

    Read the article

  • async handler deleted by the wrong thread in django

    - by user3480706
    I'm run this algorithm in my django application.when i run several time from my GUI django local server will stopped and i got this error Exception RuntimeError: RuntimeError('main thread is not in main loop',) in ignored Tcl_AsyncDelete: async handler deleted by the wrong thread Aborted (core dumped) code print "Learning the sin function" network =MLP.MLP(2,10,1) samples = np.zeros(2000, dtype=[('x', float, 1), ('y', float, 1)]) samples['x'] = np.linspace(-5,5,2000) samples['y'] = np.sin(samples['x']) #samples['y'] = np.linspace(-4,4,2500) for i in range(100000): n = np.random.randint(samples.size) network.propagate_forward(samples['x'][n]) network.propagate_backward(samples['y'][n]) plt.figure(figsize=(10,5)) # Draw real function x = samples['x'] y = samples['y'] #x=np.linspace(-6.0,7.0,50) plt.plot(x,y,color='b',lw=1) samples1 = np.zeros(2000, dtype=[('x1', float, 1), ('y1', float, 1)]) samples1['x1'] = np.linspace(-4,4,2000) samples1['y1'] = np.sin(samples1['x1']) # Draw network approximated function for i in range(samples1.size): samples1['y1'][i] = network.propagate_forward(samples1['x1'][i]) plt.plot(samples1['x1'],samples1['y1'],color='r',lw=3) plt.axis([-2,2,-2,2]) plt.show() plt.close() return HttpResponseRedirect('/charts/charts') how can i fix this error ?need a quick help

    Read the article

  • mpirun -np N, what if N is larger than my core number?

    - by Daniel
    Say I have a 4-core workstation, what would linux (Ubuntu) do if I execute mpirun -np 9 XXX Q1. Will 9 run immediately together, or they will run 4 after 4? Q2. I suppose that using 9 is not good, because the remainder 1, it will make the computer confused, (I don't know is it going to be confused at all, or the "head" of the computer will decide which core among the 4 cores will be used?) Or it will be randomly picked. Who decide which one core to call? Q3. If I feel my cpu is not bad and my ram is okay and large enough, and my case is not very big. Is it a good idea in order to fully use my cpu and ram, that I do mpirun -np 8 XXX, or even mpirun -np 12 XXX. Q4. Who decides all of these effciency optimization, Ubuntu, or linux, or motherboard or cpu? Your enlightenment would be really appreciated.

    Read the article

  • Why do I get rows of zeros in my 2D fft?

    - by Nicholas Pringle
    I am trying to replicate the results from a paper. "Two-dimensional Fourier Transform (2D-FT) in space and time along sections of constant latitude (east-west) and longitude (north-south) were used to characterize the spectrum of the simulated flux variability south of 40degS." - Lenton et al(2006) The figures published show "the log of the variance of the 2D-FT". I have tried to create an array consisting of the seasonal cycle of similar data as well as the noise. I have defined the noise as the original array minus the signal array. Here is the code that I used to plot the 2D-FT of the signal array averaged in latitude: import numpy as np from numpy import ma from matplotlib import pyplot as plt from Scientific.IO.NetCDF import NetCDFFile ### input directory indir = '/home/nicholas/data/' ### get the flux data which is in ### [time(5day ave for 10 years),latitude,longitude] nc = NetCDFFile(indir + 'CFLX_2000_2009.nc','r') cflux_southern_ocean = nc.variables['Cflx'][:,10:50,:] cflux_southern_ocean = ma.masked_values(cflux_southern_ocean,1e+20) # mask land nc.close() cflux = cflux_southern_ocean*1e08 # change units of data from mmol/m^2/s ### create an array that consists of the seasonal signal fro each pixel year_stack = np.split(cflux, 10, axis=0) year_stack = np.array(year_stack) signal_array = np.tile(np.mean(year_stack, axis=0), (10, 1, 1)) signal_array = ma.masked_where(signal_array > 1e20, signal_array) # need to mask ### average the array over latitude(or longitude) signal_time_lon = ma.mean(signal_array, axis=1) ### do a 2D Fourier Transform of the time/space image ft = np.fft.fft2(signal_time_lon) mgft = np.abs(ft) ps = mgft**2 log_ps = np.log(mgft) log_mgft= np.log(mgft) Every second row of the ft consists completely of zeros. Why is this? Would it be acceptable to add a randomly small number to the signal to avoid this. signal_time_lon = signal_time_lon + np.random.randint(0,9,size=(730, 182))*1e-05 EDIT: Adding images and clarify meaning The output of rfft2 still appears to be a complex array. Using fftshift shifts the edges of the image to the centre; I still have a power spectrum regardless. I expect that the reason that I get rows of zeros is that I have re-created the timeseries for each pixel. The ft[0, 0] pixel contains the mean of the signal. So the ft[1, 0] corresponds to a sinusoid with one cycle over the entire signal in the rows of the starting image. Here are is the starting image using following code: plt.pcolormesh(signal_time_lon); plt.colorbar(); plt.axis('tight') Here is result using following code: ft = np.fft.rfft2(signal_time_lon) mgft = np.abs(ft) ps = mgft**2 log_ps = np.log1p(mgft) plt.pcolormesh(log_ps); plt.colorbar(); plt.axis('tight') It may not be clear in the image but it is only every second row that contains completely zeros. Every tenth pixel (log_ps[10, 0]) is a high value. The other pixels (log_ps[2, 0], log_ps[4, 0] etc) have very low values.

    Read the article

  • 3 dimensional bin packing algorithms

    - by BuschnicK
    I'm faced with a 3 dimensional bin packing problem and am currently conducting some preliminary research as to which algorithms/heuristics are currently yielding the best results. Since the problem is NP hard I do not expect to find the optimal solution in every case, but I was wondering: 1) what are the best exact solvers? Branch and Bound? What problem instance sizes can I expect to solve with reasonable computing resources? 2) what are the best heuristic solvers? 3) What off-the-shelf solutions exist to conduct some experiments with?

    Read the article

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