Search Results

Search found 6322 results on 253 pages for '108 im'.

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

  • Java and junit: derivative of polynomial method testing issue

    - by Curtis
    Hello all, im trying to finish up my junit testing for finding the derivative of a polynomial method and im having some trouble making it work. here is the method: public Polynomial derivative() { MyDouble a = new MyDouble(0); MyDouble b = this.a.add(this.a); MyDouble c = this.b; Polynomial poly = new Polynomial (a, b, c); return poly; } and here is the junit test: public void testDerivative() { MyDouble a = new MyDouble(2), b = new MyDouble(4), c = new MyDouble(8); MyDouble d = new MyDouble(0), e = new MyDouble(4), f = new MyDouble(4); Polynomial p1 = new Polynomial(a, b, c); Polynomial p2 = new Polynomial(d,e,f); assertTrue(p1.derivative().equals(p2)); } im not too sure why it isnt working...ive gone over it again and again and i know im missing something. thank you all for any help given, appreciate it

    Read the article

  • basic javascript question on geolocation and googlemaps

    - by ade
    hello all, Im hoping that somebody can help me out on what i feel is an easy answer but I just cant get it to work out. Im trying to trap the geolocation lat and long and place it into the google maps api so far i have var myOptions = { zoom:7, trips:1, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map"), myOptions); directionsDisplay.setMap(map); var request = { origin: 'newyork' destination: 'deleware', travelMode: google.maps.DirectionsTravelMode.DRIVING }; this works fine for what i want. how ever I want to be able to change Origin to the users lat long using the following script from google.maps.api. their code is: if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); var placeMarker = new google.maps.Marker({ position: initialLocation, map: map, }); map.setCenter(initialLocation); }, function() { handleNoGeolocation(browserSupportFlag); }); } else { // Browser doesn't support Geolocation handleNoGeolocation(); } function handleNoGeolocation() { initialLocation = newyork; map.setCenter(initialLocation); } I want to pull out the navigator.geolocation.getCurrentPosition(function(position) { initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); and allocate it two 2 varibles, myLat and myLong. I then want to be able to change my orignal script from var request = { origin: 'newyork' destination: 'deleware', travelMode: google.maps.DirectionsTravelMode.DRIVING }; to var request = { origin: myLat,myLong destination: 'deleware', travelMode: google.maps.DirectionsTravelMode.DRIVING }; Does this make sense..? Im currently having a pig with it and as im not a JS developer its what i think should be a simple bit of coding that im losing the battle with.. any thoughts..?

    Read the article

  • Django Admin drop down combobox and assigned values

    - by Daniel Garcia
    I have several question for the Django Admin feature. Im kind of new in Django so im not sure how to do it. Basically what Im looking to do is when Im adding information on the model. Some of the fields i want them to be drop-downs and maybe combo-boxes with AutoCompleteMode. Also looking for some fields to have the same information, for example if i have a datatime field I want that information to feed the fields day, month and year from hoti.hotiapp.models import Occurrence from django.contrib import admin class MyModelAdmin(admin.ModelAdmin): exclude = ['reference',] admin.site.register(Occurrence, MyModelAdmin) Anything helps Thanks in advance

    Read the article

  • dotnet nuke error

    - by donfigga
    Hi there im trying to degub a dot net nuke server error and im not sure where to start. I dnt have the code locally else I could debug (no that im familiar the dnn setup). This bug affects making cms updates to the site with the message 'A critical error has occured', I have been unsuccessfully trying to find out the cause and im finally throwing up my hands, I dont even need a fix , I just want to find out what is causing the error so I can provide an estimate for a fix and I can even seem to do that. I have tried looking at the logs but nothing seems to be logged about this error, is there a way to turn off custom error handling so as to get some clues as what the cause of this bug is? any suggestions would be welcome as i am getting desperate here :)

    Read the article

  • How do I set a matplotlib colorbar extents?

    - by Adam Fraser
    I'd like to display a colorbar representing an image's raw values along side a matplotlib imshow subplot which displays that image, normalized. I've been able to draw the image and a colorbar successfully like this, but the colorbar min and max values represent the normalized (0,1) image instead of the raw (0,99) image. f = plt.figure() # create toy image im = np.ones((100,100)) for x in range(100): im[x] = x # create imshow subplot ax = f.add_subplot(111) result = ax.imshow(im / im.max()) # Create the colorbar axc, kw = matplotlib.colorbar.make_axes(ax) cb = matplotlib.colorbar.Colorbar(axc, result) # Set the colorbar result.colorbar = cb If someone has a better mastery of the colorbar API, I'd love to hear from you. Thanks! Adam

    Read the article

  • Racket: change dotted pair to list

    - by user2963128
    I have a program that recursively calls a hashtable and prints out data from it. Unfortunately my hashtable seems to be saving data as dotted pairs so when I call the hashtable I get an error saying that there is no data for it because its tryign to search the hashtable for a dotted pair instead of a list. Is there an easy way to make the dotted pair into a regular list? IE im getting '("was" . "beginning") instead of '("was" "beginning") Is there a way to change this without re-writing how my hashtable store stuff? im using the let function to set a variable to this and then calling another function based on this variable (let ((data ( list-ref(hash-ref Ngram-table key) (random (length (hash-ref Ngram-table key)))))) is there a way to make the value stored in data just a list like this '("var1" "var2") instead of a dotted pair? edit: im getting dotted pairs because im using let to set data to the part of the hashtable's key and one of the elements in that hash.

    Read the article

  • Beginners php developer does using LiveDocx white Zend Framework is cpu resource eater ?

    - by user63898
    Hello all im beginner in the php world i need to build option in web application that can convert well defined structures into rtf/pdf from txt/html i found using this site search about LiveDocx php component that is dependent on Zend Framework now im not familiar white the php engine ( the parser ) so im asking you experts is it good solution to use this components ? or its just over head ?

    Read the article

  • C# Process flow - Datastream, XML and datagrid

    - by Farstucker
    Im looking for some advice/suggestions on how I should setup the work flow of a small application Im building. When the application is launched the datagrid will be populated via the XML file. Once running the application will receive a datastream that I hope to update the file and datagrid. So Im curious what you would suggest on how I setup the workflow (ie, split the data from the data stream and simultaneously populate the file and grid or would you suggest populating the XML file first and setting up a timer to have the grid read the file?) Im really looking for optimal performance.

    Read the article

  • how can i get user notifications with the new Graph API

    - by user63898
    hello all im making switch to the new Graph API , and i try to replace all the rest api with the new Graph api reading the docs i saw i have some kind of real time function ( im not sure its related to getting the user notifications ) that suppose to return me callback . but im my case i like to invoke simple http command and get the user notification like ( like the old notification api's ) how can i do it now ? Thanks

    Read the article

  • shift happens videos

    - by hasan
    im sure you guys must have seen the shift happens video series. here's a link to them : http://www.youtube.com/results?search_query=shift+happens&search_type=&aq=f also, the recent hungry beast video about google, which can be found here: (SO doesnt allow new users more than one hyperlink, so please search on youtube for this one) what i'd like to ask you guys is this: is there a program that enables such videos to be made quickly or is it really just the creative genius of the respective authors? i think vidoes like these are extremely useful when you want to make an impact and would find many uses for such a program in my line of work. im hoping somebody can point me in the right direction. ps. i DO know of animoto, so please dont suggest that :P the problem with animoto is that it doesnt allow text manipulation like these videos. to be fair, that is a great product in itself, but im sure if you take a look, you'll see the difference that im talking abuot.

    Read the article

  • How Linux system monitor gets process stats

    - by paultop6
    Hi all, Im making a simple alternative to the default linux system monitor. Im looking to know how it lifts the process stats, which is displays in the Processes tab. It probably runs off /proc, but im unsure. Also, where could i find the source code for the system monitor program? Regards Paul

    Read the article

  • Using ninject/autofac for a given scenario

    - by sandesh247
    I have some providers, say - <Providers> <Provider Type="Providers.IM" Name="Im"/> <Provider Type="Providers.Web" Name="Web"/> ... </Provider> Each of these providers can give me a session : <Sessions> <Session Name="GoogleIM" Provider="Im" URL="..." /> <Session Name="YahooIM" Provider="Im" URL="..." /> <Session Name="YahooWeb" Provider="Web" URL="..." /> ... </Session> Currently, I instantiate "named" sessions by looking at the provider, instantiating the type, and injecting the URL (manually). I could use a session factory, which would probably have to understand the url and return a proper session. Is there a way to handle this more elegantly/simply with ninject/autofac?

    Read the article

  • Java - simple division in Java ---> bug/feature?!

    - by msr
    Hello, Im astonished. Im trying this simple calculation in a Java application: System.out.println("b=" + (1 - 7/10)); Obviously Im wainting for "b=0.3" in the output but here's what I get: b=1 What?! Why this happens? If I make: System.out.println("b=" + (1-0.7)); I get the right result which is "b=0.3". What's going wrong here? Thanks!

    Read the article

  • How to render a Partial from a Model in Rails 2.3.5

    - by empire29
    I have a Rails 2.3.5 application and Im trying to render several Partials from within a Model (i know, i know -- im not supposed to). The reason im doing this is im integrating a Comet server (APE) into my Rails app and need to push updates out based on the Model's events (ex. after_create). I have tried doing this: ActionView::Base.new(Rails::Configuration.new.view_path).render(:partial => "pages/show", :locals => {:page => self}) Which allows me to render simple partials that don't user helpers, however if I try to user a link_to in my partial, i receive an error stating: undefined method `url_for' for nil:NilClass I've made sure that the object being passed into the "project_path(project)" is not nil. I've also tried including: include ActionView::Helpers::UrlHelper include ActionController::UrlWriter in the Module that contains the method that makes the above "render" call. Does anyone know how to work around this? Thanks

    Read the article

  • Java method missing (ala Ruby) for decorating?

    - by cibercitizen1
    Is there any technique available in Java for intercepting messages (method calls) like the method_missing technique in Ruby? This would allow coding decorators and proxies very easily, like in Ruby: :Client p:Proxy im:Implementation ------- ---------- ----------------- p.foo() -------> method_missing() do_something im.foo() ------------------> do_foo p.bar() --------> method_missing() do_something_more im.bar() -------------------> do_bar (Note: Proxy only has one method: method_missing())

    Read the article

  • Perl, regex, extract data from a line

    - by perlnoob
    Im trying to extract part of a line with perl use strict; use warnings; # Set path for my.txt and extract datadir my @myfile = "C:\backups\MySQL\my.txt"; my @datadir = ""; open READMYFILE, @myfile or die "Error, my.txt not found.\n"; while (<READMYFILE>) { # Read file and extract DataDir path if (/C:\backups/gi) { push @datadir, $_; } } # ensure the path was found print @datadir . " \n"; Basically at first im trying to set the location of the my.txt file. Next im trying to read it and pull part of the line with regex. The error Im getting is: Unrecognized escape \m passed through at 1130.pl line 17. I took a look at http://stackoverflow.com/questions/1040657/how-can-i-grab-multiple-lines-after-a-matching-line-in-perl to get an idea of how to read a file and match a line within it, however im not 100% sure I'm doing this right or in the best way. I also seem to produce the error: Error, my.txt not found. But the file does exist in the folder C:\backups\MySQL\

    Read the article

  • Creating spotlight in OpenGL scene

    - by Victor Oliveira
    Im studying OpenGL and trying to create a spot light at my application. The code that Im using for my #vertex-shader is below: #:vertex-shader #{ #version 150 core in vec3 in_pos; in vec2 in_tc; out vec2 tc; glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 20.0f); GLfloat spot_direction[] = { -1.0, -1.0, 0.0 }; glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, spot_direction); glEnable(GL_LIGHT0); void main() { vec4 pos= vec4(vec3(1.0)*in_pos - vec3(1.0), 1.0); pos.z=0.0; gl_Position = pos; tc = in_tc; } } The thing is, everytime Im trying to run the code an Error that says: Type: other, Source: api, ID: 131169, Severity: low Message: Framebuffer detailed info: The driver allocated storage for renderbuffer 1. len = 157, written = 0 failed to compile vertex shader of deferred: directional info log for shader deferred: directional vertex info log for shader deferred: directional: ERROR: Unbound variable: when Specifications: Renderer: GeForce GTX 580/PCIe/SSE2 Version: 3.3.0 NVIDIA 319.17 GLSL: 3.30 NVIDIA via Cg compiler Status: Using GLEW 1.9.0 1024 x 768 OS: Linux debian I guess to create this spotlight is pretty much simple, but since Im really new to OpenGL I dont have a clue how to do it until now, even reading sources like: http://www.glprogramming.com/red/chapter05.html#name3 Read also in some place that light spots can get really hard to understand, but I cant avoid this step right now since Im following my lecture schedule. Could anybody help me?

    Read the article

  • problem in displaying list using array adapters

    - by Rahul Varma
    Hi, I am trying to display the list of songs using array adapters. But the problem is i couldnt display the list and only empty screen with preset background is showing up. Here's the code...All the thee are seperate classes... Plz help me... public class SongsAdapter extends ArrayAdapter<SongsList>{ private Context context; TextView tvTitle; TextView tvMovie; TextView tvSinger; String s; public SongsAdapter(Context context, int resource, int textViewResourceId, String title) { super(context, resource, textViewResourceId); this.context=context; } public View getView(int position, View convertView, ViewGroup parent) { final int i=position; List<SongsList> listSongs = new ArrayList<SongsList>(); String title = listSongs.get(i).gettitleName().toString(); String album = listSongs.get(i).getmovieName().toString(); String artist = listSongs.get(i).getsingerName().toString(); String imgal = listSongs.get(i).gettitleName().toString(); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); View v = inflater.inflate(R.layout.row, null); tvTitle=(TextView)v.findViewById(R.id.text2); tvMovie=(TextView)v.findViewById(R.id.text3); tvSinger=(TextView)v.findViewById(R.id.text1); tvTitle.setText(title); tvMovie.setText(album); tvSinger.setText(artist); final ImageView im=(ImageView)v.findViewById(R.id.image); s="http://www.gorinka.com/"+imgal; String imgPath=s; AsyncImageLoaderv asyncImageLoaderv=new AsyncImageLoaderv(); Bitmap cachedImage = asyncImageLoaderv.loadDrawable(imgPath, new AsyncImageLoaderv.ImageCallback() { public void imageLoaded(Bitmap imageDrawable, String imageUrl) { im.setImageBitmap(imageDrawable); } }); im.setImageBitmap(cachedImage); return v; } public class imageloader implements Runnable{ private String ss; private ImageView im; public imageloader(String s, ImageView im) { this.ss=s; this.im=im; Thread thread = new Thread(this); thread.start(); } public void run(){ try { HttpGet httpRequest = null; httpRequest = new HttpGet(ss); HttpClient httpclient = new DefaultHttpClient(); HttpResponse response = (HttpResponse) httpclient.execute(httpRequest); HttpEntity entity = response.getEntity(); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); InputStream is = bufHttpEntity.getContent(); Bitmap bm = BitmapFactory.decodeStream(is); Log.d("img","img"); is.close(); im.setImageBitmap(bm); } catch (Exception t) { Log.e("bitmap url", "Exception in updateStatus()", t); } } } } public class SongsList { private String titleName; private String movieName; private String singerName; private String imagePath; private String mediaPath; // Constructor for the SongsList class public SongsList(String titleName, String movieName, String singerName,String imagePath,String mediaPath ) { super(); this.titleName = titleName; this.movieName = movieName; this.singerName = singerName; this.imagePath = imagePath; this.mediaPath = mediaPath; } public String gettitleName() { return titleName; } public void settitleName(String titleName) { this.titleName = titleName; } public String getmovieName() { return movieName; } public void setmovieName(String movieName) { this.movieName = movieName; } public String getsingerName() { return singerName; } public void setsingerName(String singerName) { this.singerName = singerName; } public String getimagePath() { return imagePath; } public void setimagePath(String imagePath) { this.imagePath = imagePath; } public String getmediaPath() { return mediaPath; } public void setmediaPath(String mediaPath) { this.mediaPath = mediaPath; } } public class MusicListActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.openadiuofile); ListView list = (ListView)findViewById(R.id.list1); SongsAdapter adapter = new SongsAdapter(this,R.layout.row, R.id.text2, null); list.setAdapter(adapter); } }

    Read the article

  • NDIS or TDI for packet redirection to a local proxy

    - by Enrico Detoma
    I need to develop a transparent filter to redirect outgoing HTTP packets to a local proxy, to do transparent content filtering. Which is the best technology to do it, TDI or NDIS IM? My main constraint is to avoid conflicts with antivirus software, which also do some kind of packet redirection to inspect HTTP content (I don't know whether antivirus programs use TDI, NDIS IM, or both). Rather than writing the driver myself, actually, I'm also considering two commercial SDKs for packet filtering/modification: one uses a TDI driver while the other uses a NDIS IM driver, so that's the origin of my question (I was only aware of NDIS IM, before looking at the two SDKs).

    Read the article

  • jquery scrollTo refuses to work

    - by hasan
    hey, ive read all the scrollTo questions and couldnt find the answer. im trying to use the scrollTo plugin for a simple horizontal scroll (the site is horizontally designed). im using the following code $(document).ready(function() { $('#contactlink').click(function(){ $.scrollTo("#conta", {duration: 8000 }); }); }); as is obvious, contactlink is the anchor link while conta is the anchor where the window should scroll to. i know im missing something very obvious, but as im a beginner with jquery, id appreciate all the help i can get. is there any way to debug the functioning of the plugin? thanks

    Read the article

  • Java - simple division in Java ---> bug?!

    - by msr
    Hello, Im astonished. Im trying this simple calculation in a Java application: System.out.println("b=" + (1 - 7/10)); Obviously Im wainting for "b=0.3" in the output but here's what I get: b=1 What?! Why this happens? If I make: System.out.println("b=" + (1-0.7)); I get the right result which is "b=0.3". What's going wrong here? Thanks!

    Read the article

  • C# Vector maths questions

    - by Mark
    Im working in a screen coordinate space that is different to that of the classical X/Y coordinate space, where my Y direction goes down in the positive instead of up. Im also trying to figure out how to make a Circle on my screen always face away from the center point of the screen. If the center point of my screen is at x(200) y(300) and the point of my circle's center is at x(150) and y(380) then I would like to calculate the angle that the circle should be facing. At the moment I have this: Point centerPoint = new Point(200, 300); Point middleBottom = new Point(200, 400); Vector middleVector = new Vector(centerPoint.X - middleBottom.X, centerPoint.Y - middleBottom.Y); Vector vectorOfCircle = new Vector(centerPoint.X - 150, centerPoint.Y - 400); middleVector.Normalize(); vectorOfCircle.Normalize(); var angle = Math.Acos(Vector.CrossProduct(vectorOfCircle, middleVector)); Console.WriteLine("Angle: {0}", angle * (180/Math.PI)); Im not getting what I would expect. I would say that when I enter in x(150) and y(300) of my circle, I would expect to see the rotation of 90 deg, but Im not getting that... Im getting 180!! Any help here would be greatly appreciated. Cheers, Mark

    Read the article

  • iphone facebook friend status.

    - by Syed Faraz Haider Zaidi
    NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; [params setValue:@"100000********" forKey:@"uid"]; [params setValue:@"1500" forKey:@"limit"]; [params setValue:@"results" forKey:@"callback"]; when im using this coding im getting my friend status... but when im using a dynamic value like this : [params setValue:[NSString stringWithFormat:@"%@", a] forKey:@"uid"]; im getting this error The operation couldn’t be completed. (facebookErrDomain error 10000.) looking forward for your help guys....

    Read the article

  • method with two parameters which both need to be double dispatched

    - by mixm
    lets say i have a method which has two parameters. i have been implementing them as: if(aObj instance of Marble) { if(bObj instance of Bomb) { this.resolve((Marble)aObj,(Bomb)bObj); } } as you can see its not a very pretty solution. i plan to implement using double dispatching, but with two parameters which both need double dispatching, im afraid im a bit stumped. any ideas please. im implementing in java btw.

    Read the article

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