Search Results

Search found 3747 results on 150 pages for '500'.

Page 38/150 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • Unable to run WCAT against DotNetNuke with NTLM authentication

    - by David Neale
    I have a ubr file setup to stress test an internal DotNetNuke site with WCAT: transaction { id = "Intranet Home Page"; weight = 1000; cookies{clear = true;} sleep{delay = rand("1","500");} request { url = "/"; statuscode = 401; } request { url = "/"; authentication = ntlm; username = "mydomain\\accountname"; password = "password"; statuscode = 200; } close{ method = reset;} } When running this (wcat.wsf -run -clients localhost -s myserver -t test.ubr -f settings.ubr -x) I simply get lots of error 500s: 2010-03-08 10:29:31 192.168.11.239 GET / - 80 - 192.168.52.139 - 401 2 2148074254 2010-03-08 10:29:31 192.168.11.239 GET / - 80 - 192.168.52.139 - 401 1 0 2010-03-08 10:29:31 192.168.11.239 GET /Default.aspx - 80 mydomain\myaccount 192.168.52.139 - 500 0 0 DNN is reporting these errors as: AssemblyVersion: 5.2.3 PortalID: 0 PortalName: My Company UserID: -1 UserName: ActiveTabID: 39 ActiveTabName: Home RawURL: /Default.aspx AbsoluteURL: /Default.aspx AbsoluteURLReferrer: UserAgent: DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider ExceptionGUID: 28d8821f-1ef2-41db-8a65-d33e97a69130 InnerException: *Unhandled Error:* FileName: FileLineNumber: 0 FileColumnNumber: 0 Method: DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule.OnAuthenticateRequest StackTrace: Message: System.Exception: Unhandled Error: --- System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Authentication.ActiveDirectory.HttpModules.AuthenticationModule.OnAuthenticateRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace --- Source: Server Name: MYSERVER It seems to be losing the username somehow.

    Read the article

  • WCF Http Bindings, Require SSL

    - by JoshKraker
    I have the following binding I'm using with my wsHttpBinding webservice. <binding name="wsHttpConfig"> <security> <transport clientCredentialType="None"/> </security> </binding> The issue is that it allows for the client to connect using either Http or Https. I would like to require them to use SSL. I tried adding the following: <system.web.extensions> <scripting> <webServices> <authenticationService enabled="true" requireSSL = "true"/> </webServices> </scripting> </system.web.extensions> But it had no effect; client could still connect with Http. I then tried checking the "Require SSL" in the IIS7 SSL Settings and had client certificates radio set to Accept. Now, when I try to view the service I am getting the error "Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]." Anyone know exactly how to fix this error? I have been googling for the last 3 hours trying 500 different combinations (not 500, but too many to list) and could not get anything to run.

    Read the article

  • File Uploading In Google Application Engine Using Django

    - by Ayush
    I am using gae with django. I have an project named MusicSite with following url mapping- urls.py from django.conf.urls.defaults import * from MusicSite.views import MainHandler from MusicSite.views import UploadHandler from MusicSite.views import ServeHandler urlpatterns = patterns('',(r'^start/', MainHandler), (r'^upload/', UploadHandler), (r'^/serve/([^/]+)?', ServeHandler), ) There is an application MusicSite inside MusicFun with the following codes- views.py import os import urllib from google.appengine.ext import blobstore from google.appengine.ext import webapp from google.appengine.ext.webapp import blobstore_handlers from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app def MainHandler(request): response=HttpResponse() upload_url = blobstore.create_upload_url('http://localhost: 8000/upload/') response.write('') response.write('' % upload_url) response.write("""Upload File: """) return HttpResponse(response) def UploadHandler(request): upload_files=request.FILES['file'] blob_info = upload_files[0] response.redirect('http://localhost:8000/serve/%s' % blob_info.key()) class ServeHandler(blobstore_handlers.BlobstoreDownloadHandler): def get(self, resource): resource = str(urllib.unquote(resource)) blob_info = blobstore.BlobInfo.get(resource) self.send_blob(blob_info) now whenever a upload a file using /start and click Submit i am taken to a blank page with the following url- localhost:8000/_ah/upload/ahhnb29nbGUtYXBwLWVuZ2luZS1kamFuZ29yGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxgHDA These random alphabets keep varying but the result is same. A blank page after every upload. Somebody please help. The server responses are as below- INFO:root:"GET /start/ HTTP/1.1" 200 - INFO:root:"GET /favicon.ico HTTP/1.1" 404 - INFO:root:Internal redirection to http://localhost:8000/upload/ INFO:root:Upload handler returned 500 ERROR:root:Invalid upload handler response. Only 301, 302 and 303 statuses are permitted and it may not have a content body. INFO:root:"POST /_ah/upload/ ahhnb29nbGUtYXBwLWVuZ2luZS1kamFuZ29yGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxgCDA HTTP/1.1" 500 - INFO:root:"GET /favicon.ico HTTP/1.1" 404 -

    Read the article

  • Practical value for concurrent-request-timeout parameter

    - by Andrei
    In the Seam Reference Guide, one can find this paragraph: We can set a sensible default for the concurrent request timeout (in ms) in components.xml: <core:manager concurrent-request-timeout="500" /> However, we found that 500 ms is not nearly enough time for most of the cases we had to deal with, especially with the severe restriction seam places on conversation access. In our application we have a combination of page scoped ajax requests (triggered by various use actions), some global scoped polling notification logic (part of the header, so included in every page) and regular links that invoke actions and/or navigate to other pages. Therefore, we get the dreaded concurrent access to conversation exception way too often, even without any significant load on the site. After researching the options for quite a bit, we ended up bumping this value to several seconds (we're debating whether to bump it up to 10s), as none of the recommended solutions seemed able to solve our issue completely (even forcing a global queue for all the ajax requests would still leave us exposed to a user deciding to click a link right when one of our polling calls was in progress). And we'd much rather have the users wait for a second or two instead of getting an error page just because they clicked a link at the wrong moment. And now to the question: is there something obvious we're missing (like a way to allow concurrent access to conversations and taking care of the needed locking ourselves, for instance :)? How do people solve this problem (ajax requests mixed with user driven interaction) in seam? Disabling all the links on the page while ajax requests are in progress (as suggested by one blog page) is really not a viable option. Any other suggestions? TIA, Andrei

    Read the article

  • Programatically send SMS to email using Verizon Motorola Droid on Android

    - by Dave
    Hi, I was wondering if anyone knew the proper way to send an SMS message to an e-mail address using Verizon's CDMA Motorola Droid phone. The internal messaging application appears to automagically do this. While 3rd party applications like SMSPopup don't seem to be able to properly reply to e-mail addresses unless you compose the message inside the messaging application. When the internal messaging application sends a SMS message there's a corresponding 'RIL_REQUEST_CDMA_SEND_SMS' entry in the logcat (adb logcat -b radio). When you send a SMS to an e-mail address it prints the same thing, so behind the scenes it looks as though it is sending an sms. The interesting thing is that if you look at the content provider sent box the messages are addressed to various 1270XX-XXX-XXXX numbers. On other services you can send e-mail addresses by sending a SMS to a predefined short sms number. And then formatting your SMS as emailaddress subject message i.e. http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_SMS_to_E-Mail_Gateways For example, using T-mobile's number (500) you can send a SMS to an e-mail using the following: SmsManager smsMgr = SmsManager.getDefault(); smsMgr.sendTextMessage("500", null, "[email protected] message sent to an e-mail address from a SMS", null, null); Does anyone know if It is possible to programatically send SMS to email messages from a CDMA Android phone? Does Verizon actually send your replies as SMS messages or are they actually sent as MMS or normal http email messages? Any ideas about how to intercept what the raw message being sent to see what's going on? It might be possible that Verizon somehow generates a fake number temporarily tied to an e-mail address (since repeated messages are not sent to the same number). But, that seems pretty heavy handed. Thanks!

    Read the article

  • Problem with Chrome - embed windows media player

    - by nicolas
    Hi. I am having a problem. I embed WMP in my page, and I need to hide buttons from player. I make it to hide them in IE and FF, but I can't make it happen in Google Chrome. Here is the code <object id="MediaPlayer1" width="690" height="500" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" > <param name="FileName" value='<%= GetSource() %>' /> <param name="AutoStart" value="True" /> <param name="DefaultFrame" value="mainFrame" /> <param name="ShowStatusBar" value="0" /> <param name="ShowPositionControls" value="0" /> <param name="showcontrols" value="0" /> <param name="ShowAudioControls" value="0" /> <param name="ShowTracker" value="0" /> <param name="EnablePositionControls" value="0" /> <!-- BEGIN PLUG-IN HTML FOR FIREFOX--> <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src='<%= GetSource() %>' align="middle" width="600" height="500" defaultframe="rightFrame" id="MediaPlayer2" /> </object> and in the JS in a method i do var player = document.getElementById("MediaPlayer2"); player.uiMode="none"; to hide buttons in FF, but seems that not work for Chrome.

    Read the article

  • Marquee style progressbar in wxPython

    - by Mridang Agarwalla
    Hi, Could anyone tell me how to implement a marquee style progress bar in wxPython? As stated on MSDN: you can animate it in a way that shows activity but does not indicate what proportion of the task is complete. Thank you. I tried this but it doesn't seem to work. The timer ticks but the gauge doesn't scroll. Any help? import wx import time class MyForm(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, "Timer Tutorial 1", size=(500,500)) # Add a panel so it looks the correct on all platforms panel = wx.Panel(self, wx.ID_ANY) self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.update, self.timer) self.gauProgress = wx.Gauge(panel, range=1000, pos=(30, 50), size=(440, 20)) self.toggleBtn = wx.Button(panel, wx.ID_ANY, "Start") self.toggleBtn.Bind(wx.EVT_BUTTON, self.onToggle) def onToggle(self, event): btnLabel = self.toggleBtn.GetLabel() if btnLabel == "Start": print "starting timer..." self.timer.Start(1000) self.toggleBtn.SetLabel("Stop") else: print "timer stopped!" self.timer.Stop() self.toggleBtn.SetLabel("Start") def update(self, event): print "\nupdated: ", print time.ctime() self.gauProgress.Pulse() # Run the program if __name__ == "__main__": app = wx.PySimpleApp() frame = MyForm().Show() app.MainLoop()

    Read the article

  • while(1) block my recv thread

    - by zp26
    Hello. I have a problem with this code. As you can see a launch with an internal thread recv so that the program is blocked pending a given but will continue its execution, leaving the task to lock the thread. My program would continue to receive the recv data socket new_sd and so I entered an infinite loop (the commented code). The problem is that by entering the while (1) my program block before recv, but not inserting it correctly receives a string, but after that stop. Someone could help me make my recv always waiting for information? Thanks in advance for your help. -(IBAction)Chat{ [NSThread detachNewThreadSelector:@selector(riceviDatiServer) toTarget:self withObject:nil]; } -(void)riceviDatiServer{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; labelRicevuti.text = [[NSString alloc] initWithFormat:@"In attesa di ricevere i dati"]; char datiRicevuti[500]; int ricevuti; //while(1){ ricevuti = recv(new_sd, &datiRicevuti, 500, 0); labelRicevuti.text = [[NSString alloc] initWithFormat:@"%s", datiRicevuti]; //} [pool release]; }

    Read the article

  • How do I test OpenCL on GPU when logged in remotely on Mac?

    - by Christopher Bruns
    My OpenCL program can find the GPU device when I am logged in at the console, but not when I am logged in remotely with ssh. Further, if I run the program as root in the ssh session, the program can find the GPU. The computer is a Snow Leopard Mac with a GeForce 9400 GPU. If I run the program (see below) from the console or as root, the output is as follows (notice the "GeForce 9400" line): 2 devices found Device #0 name = GeForce 9400 Device #1 name = Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz but if it is just me, over ssh, there is no GeForce 9400 entry: 1 devices found Device #0 name = Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz I would like to test my code on the GPU without having to be root. Is that possible? Simplified GPU finding program below: #include <stdio.h> #include <OpenCL/opencl.h> int main(int argc, char** argv) { char dname[500]; size_t namesize; cl_device_id devices[10]; cl_uint num_devices; int d; clGetDeviceIDs(0, CL_DEVICE_TYPE_ALL, 10, devices, &num_devices); printf("%d devices found\n", num_devices); for (d = 0; d < num_devices; ++d) { clGetDeviceInfo(devices[d], CL_DEVICE_NAME, 500, dname, &namesize); printf("Device #%d name = %s\n", d, dname); } return 0; } EDIT: I found essentially the same question being asked on nvidia's forums. Unfortunately, the only answer was of the form "this is the wrong forum".

    Read the article

  • jQuery fadeIn/fadeOut loop problem

    - by liebgott
    Hi. I'm trying to do a sequentiall animation with a loop....but i can't accomplish it in a smooth way (some "lag" problems). jQuery var i = 0; var b = 0; var fades = function(){$(".caja").stop(0).each(function(){ $(this).delay(i * 500).fadeIn('slow', function(){ $(this).delay(5000).fadeOut('slow', function(){ $(".cajar").delay(1000).each(function(){ $(this).delay(b * 500).fadeIn('slow', function(){ $(this).delay(5000).fadeOut('slow', fades()); }); b++; }); }); }); i++; })} fades(); CSS .caja{ width: 150px; height: 150px; background-color: black; float: left; margin: 0 10px 0 0; display: none; } .cajar{ width: 150px; height: 150px; background-color: red; float: left; margin: 0 10px 0 0; display: none; } .cajav{ width: 150px; height: 150px; background-color: green; float: left; margin: 0 10px 0 0; display: none; } HTML <div class="caja"></div> <div class="caja"></div> <div class="caja"></div> <div class="cleaner"></div> <div class="cajar"></div> <div class="cajar"></div> <div class="cajar"></div> Thanks!

    Read the article

  • TinyMCE + jQuery + custom plugin = tinymce is undefined?

    - by user368691
    The problem occurs when I try to create small plugin to allow me toggle on and off WYSIWYG on all textareas in the website. //$('form.default textarea').each(function(){ // console.log( $('<a href="#">Enable WYSIWYG editor</a>').insertAfter('form.default textarea').prev('textarea.wysiwyg').tinymce().hide() ); //}); The full (a bit simplified) code looks like this: $('textarea.wysiwyg').tinymce({ skin : 'cirkuit', theme : 'advanced', plugins : 'pagebreak,style,layer,advlink,inlinepopups,contextmenu,paste,directionality,noneditable,nonbreaking,xhtmlxtras,template', // Theme options theme_advanced_buttons1 : 'formatselect,fontsizeselect,forecolor,|,bold,italic,strikethrough,|,bullist,numlist,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,|,code,paste,pastetext,pasteword,removeformat,|,backcolor,|,underline,justifyfull,sup,|,outdent,indent,|,hr,charmap,|,undo,redo', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '', theme_advanced_toolbar_location : 'top', theme_advanced_toolbar_align : 'left', theme_advanced_statusbar_location: 'bottom', theme_advanced_resizing : true, theme_advanced_resize_horizontal : false, height : 500, theme_advanced_resizing_min_height : 500, document_base_url : 'http://static.<?=$settings['system_host']?>/' }); $('textarea.wysiwyg').each(function() { $(this).tinymce().hide(); }); What is the error? FireBug says that tinymce() in undefined; this message occurs in each() loop. Thus, tinymce() is actually initialized. I am really lost towards, what could be causing this.

    Read the article

  • stock management of assemblys and its sub parts

    - by The Disintegrator
    I have to track the stock of individual parts and kits (assembly) and can't find a satisfactory way of doing this. Sample bogus and hyper simplified database: Table prod: prodID 1 prodName Flux capacitor prodCost 900 prodPrice 1350 (900*1.5) prodStock 3 - prodID 2 prodName Mr Fusion prodCost 300 prodPrice 600 (300*2) prodStock 2 - prodID 3 prodName Time travel kit prodCost 1650 (1350+300) prodPrice 2145 (1650*1.3) prodStock 2 Table rels relID 1 relSrc 1 (Flux capacitor) relType 4 (is a subpart of) relDst 3 (Time travel kit) - relID 2 relSrc 2 (Mr Fusion) relType 4 (is a subpart of) relDst 3 (Time travel kit) prodPrice: it's calculated based on the cost but not in a linear way. In this example for costs of 500 or less, the markup is a 200%. For costs of 500-1000 the markup is 150%. For costs of 1000+ the markup is 130% That's why the time travel kit is much cheaper than the individual parts prodStock: here is my problem. I can sell kits or the individual parts, So the stock of the kits is virtual. The problem when I buy: Some providers sell me the Time Travel kit as a whole (with one barcode) and some sells me the individual parts (with a different barcode) So when I load the stock I don't know how to impute it. The problem when I sell: If I only sell kits, calculate the stock would be easy: "I have 3 Flux capacitors and 2 Mr Fusions, so I have 2 Time travel kits and a Flux Capacitor" But I can sell Kits or individual parts. I have to track the stock of the individual parts and the possible kits at the same time (and I have to compensate for the sell price) Probably this is really simple, but I can't see a simple solution. Resuming: I have to find a way of tracking the stock and the database/program is the one who has to do it (I cant ask the clerk to correct the stock) I'm using php+MySql. But this is more a logical problem than a programing one

    Read the article

  • Show div on click — jquery

    - by Tom Julian Hume
    When a div is clicked, I want different div to appear. Thus, when '#music' is clicked, I want '#musicinfo' to appear. Here is the code: #music { float:left; height:25px; margin-left:25px; margin-top:25px; margin-right:80px; font-family: "p22-underground",sans-serif; font-style: normal; font-weight: 500; font-size:13pt; } #musicinfo { width:380px; margin:25px; font-family: "p22-underground",sans-serif; font-style: normal; font-weight: 500; font-size:13pt; line-height:1.1; display:none; } and jquery: <script type="text/javascript"> $("#music").click(function () { $("#musicinfo").show("slow"); }); </script> The current website is: here Any help whatsoever would be great :)

    Read the article

  • Relational vs. Dimensional Databases, what's the difference?

    - by grautur
    I'm trying to learn about OLAP and data warehousing, and I'm confused about the difference between relational and dimensional modeling. Is dimensional modeling basically relational modeling, but allowing for redundant/un-normalized data? For example, let's say I have historical sales data on (product, city, # sales). I understand that the following would be a relational point-of-view: Product | City | # Sales Apples, San Francisco, 400 Apples, Boston, 700 Apples, Seattle, 600 Oranges, San Francisco, 550 Oranges, Boston, 500 Oranges, Seattle, 600 While the following is a more dimensional point-of-view: Product | San Francisco | Boston | Seattle Apples, 400, 700, 600 Oranges, 550, 500, 600 But it seems like both points of view would nonetheless be implemented in an identical star schema: Fact table: Product ID, Region ID, # Sales Product dimension: Product ID, Product Name City dimension: City ID, City Name And it's not until you start adding some additional details to each dimension that the differences start popping up. For instance, if you wanted to track regions as well, a relational database would tend to have a separate region table, in order to keep everything normalized: City dimension: City ID, City Name, Region ID Region dimension: Region ID, Region Name, Region Manager, # Regional Stores While a dimensional database would allow for denormalization to keep the region data inside the city dimension, in order to make it easier to slice the data: City dimension: City ID, City Name, Region Name, Region Manager, # Regional Stores Is this correct?

    Read the article

  • Copy data from different worksheet to a master worksheet but no duplicates

    - by sam
    hi all, i want to clarify my initial question for a possible solutions from any savior out there. Say i have 3 excel sheets one for each user for data entry located in separate workbooks to avoid excel share workbook problems. I also have a master sheet in another workbook where i want individual data enter on those sheets precisely sheets 1 should copy to the next available row of sheet 1 in the master sheet as the users enter them. i need a vba code that can copy each record without copying a duplicate row in the master sheet but highlight the duplicate row and lookup the initial record in a master sheet and return the name of the Imputer looking up the row say column ( I) where each user sign there initials after every row of entry like below. All 4 worksheets are formatted as below: lastname account cardno. type tran amount date location comments initials JAME 65478923 1975 cash 500 4/10/2010 miles st. this acct is resolve MLK BEN 52436745 1880 CHECK 400 4/12/2010 CAREY ST Ongoing investigation MLK JAME 65478923 1975 cash 500 4/10/2010 miles st. this acct is resolve MLK I need the vba to recognize duplicates only if the account number and the card number matches the initial records. So if the duplicates exist a pop up message should be display that a duplicates exist and return the initial Imputer say MLK in COLUMN( I) to any user inputting in the individual worksheets other than warehouse sheets (master). So please any idea will be appreciated.

    Read the article

  • Fast way to get a list of group members in Active Directory with C#

    - by Jeremy
    In a web app, we're looking to display a list of sam accounts for users that are a member of a certain group. Groups could have 500 or more members in many cases and we need the page to be responsive. With a group of about 500 members it takes 7-8 seconds to get a list of sam accounts for all members of the group. Are there faster ways? I know the Active Directory Management Console does it in under a second. I've tried a few methods: 1) PrincipalContext pcRoot = new PrincipalContext(ContextType.Domain) GroupPrincipal grp = GroupPrincipal.FindByIdentity(pcRoot, "MyGroup"); List<string> lst = grp.Members.Select(g => g.SamAccountName).ToList(); 2) PrincipalContext pcRoot = new PrincipalContext(ContextType.Domain) GroupPrincipal grp = GroupPrincipal.FindByIdentity(pcRoot, "MyGroup"); PrincipalSearchResult<Principal> lstMembers = grp.GetMembers(true); List<string> lst = new List<string>(); foreach (Principal member in lstMembers ) { if (member.StructuralObjectClass.Equals("user")) { lst.Add(member .SamAccountName); } } 3) PrincipalContext pcRoot = new PrincipalContext(ContextType.Domain) GroupPrincipal grp = GroupPrincipal.FindByIdentity(pcRoot, "MyGroup"); System.DirectoryServices.DirectoryEntry de = (System.DirectoryServices.DirectoryEntry)grp.GetUnderlyingObject(); List<string> lst = new List<string>(); foreach (string sDN in de.Properties["member"]) { System.DirectoryServices.DirectoryEntry deMember = new System.DirectoryServices.DirectoryEntry("LDAP://" + sDN); lst.Add(deMember.Properties["samAccountName"].Value.ToString()); }

    Read the article

  • Sharing large objects between ruby processes without a performance hit

    - by Gdeglin
    I have a Ruby hash that reaches approximately 10 megabytes if written to a file using Marshal.dump. After gzip compression it is approximately 500 kilobytes. Iterating through and altering this hash is very fast in ruby (fractions of a millisecond). Even copying it is extremely fast. The problem is that I need to share the data in this hash between Ruby on Rails processes. In order to do this using the Rails cache (file_store or memcached) I need to Marshal.dump the file first, however this incurs a 1000 millisecond delay when serializing the file and a 400 millisecond delay when serializing it. Ideally I would want to be able to save and load this hash from each process in under 100 milliseconds. One idea is to spawn a new Ruby process to hold this hash that provides an API to the other processes to modify or process the data within it, but I want to avoid doing this unless I'm certain that there are no other ways to share this object quickly. Is there a way I can more directly share this hash between processes without needing to serialize or deserialize it? Here is the code I'm using to generate a hash similar to the one I'm working with: @a = [] 0.upto(500) do |r| @a[r] = [] 0.upto(10_000) do |c| if rand(10) == 0 @a[r][c] = 1 # 10% chance of being 1 else @a[r][c] = 0 end end end @c = Marshal.dump(@a) # 1000 milliseconds Marshal.load(@c) # 400 milliseconds

    Read the article

  • Detecting Asymptotes in a Graph

    - by nasufara
    I am creating a graphing calculator in Java as a project for my programming class. There are two main components to this calculator: the graph itself, which draws the line(s), and the equation evaluator, which takes in an equation as a String and... well, evaluates it. To create the line, I create a Path2D.Double instance, and loop through the points on the line. To do this, I calculate as many points as the graph is wide (e.g. if the graph itself is 500px wide, I calculate 500 points), and then scale it to the window of the graph. Now, this works perfectly for most any line. However, it does not when dealing with asymptotes. If, when calculating points, the graph encounters a domain error (such as 1/0), the graph closes the shape in the Path2D.Double instance and starts a new line, so that the line looks mathematically correct. Example: However, because of the way it scales, sometimes it is rendered correctly, sometimes it isn't. When it isn't, the actual asymptotic line is shown, because within those 500 points, it skipped over x = 2.0 in the equation 1 / (x-2), and only did x = 1.98 and x = 2.04, which are perfectly valid in that equation. Example: In that case, I increased the window on the left and right one unit each. My question is: Is there a way to deal with asymptotes using this method of scaling so that the resulting line looks mathematically correct? I myself have thought of implementing a binary search-esque method, where, if it finds that it calculates one point, and then the next point is wildly far away from the last point, it searches in between those points for a domain error. I had trouble figuring out how to make it work in practice, however. Thank you for any help you may give!

    Read the article

  • Starting one BlackBerry screen from another.

    - by DanG
    I've recently run into a snag while putting on the finishing touches for my BlackBerry app. I'm building a login screen which, if the user is successful in logging in, goes to a data loading screen, and then to a home screen. From the home screen, you can use the app. Everything works great but one thing, I can't seamlessly move from the login screen to the loading screen, to the home screen. I can move from the login screen to the loading screen ok, because I'm doing that via a button click which is on the GUI thread, but then I have the login screen at the bottom of the stack and can't get it out using the dismiss method. Once in the loading screen, I can't push the home screen because I'm not doing it via the gui method, though I'm able to update the GUI via the following piece of code: private void checkData(){ Timer loadingTimer = new Timer(); TimerTask loadingTask = new TimerTask() { public void run() { // set the progress bar progressGaugeField.setValue(DataManager.getDataLoaded()); // for repainting the screen invalidate(); } }; loadingTimer.scheduleAtFixedRate(loadingTask, 500, 500); } Does anyone know how to solve my problem of moving seamlessly from the login screen to the loading screen to the home screen? Note: once I'm at the home screen I'd like to have it be the only screen on the stack. Thanks!

    Read the article

  • Stock management of assemblies and its sub parts

    - by The Disintegrator
    I have to track the stock of individual parts and kits (assemblies) and can't find a satisfactory way of doing this. Sample bogus and hyper simplified database: Table prod: prodID 1 prodName Flux capacitor prodCost 900 prodPrice 1350 (900*1.5) prodStock 3 - prodID 2 prodName Mr Fusion prodCost 300 prodPrice 600 (300*2) prodStock 2 - prodID 3 prodName Time travel kit prodCost 1650 (1350+300) prodPrice 2145 (1650*1.3) prodStock 2 Table rels relID 1 relSrc 1 (Flux capacitor) relType 4 (is a subpart of) relDst 3 (Time travel kit) - relID 2 relSrc 2 (Mr Fusion) relType 4 (is a subpart of) relDst 3 (Time travel kit) prodPrice: it's calculated based on the cost but not in a linear way. In this example for costs of 500 or less, the markup is a 200%. For costs of 500-1000 the markup is 150%. For costs of 1000+ the markup is 130% That's why the time travel kit is much cheaper than the individual parts prodStock: here is my problem. I can sell kits or the individual parts, So the stock of the kits is virtual. The problem when I buy: Some providers sell me the Time Travel kit as a whole (with one barcode) and some sells me the individual parts (with a different barcode) So when I load the stock I don't know how to impute it. The problem when I sell: If I only sell kits, calculate the stock would be easy: "I have 3 Flux capacitors and 2 Mr Fusions, so I have 2 Time travel kits and a Flux Capacitor" But I can sell Kits or individual parts. So, I have to track the stock of the individual parts and the possible kits at the same time (and I have to compensate for the sell price) Probably this is really simple, but I can't see a simple solution. Resuming: I have to find a way of tracking the stock and the database/program is the one who has to do it (I cant ask the clerk to correct the stock) I'm using php+MySql. But this is more a logical problem than a programing one

    Read the article

  • how to store JSON into POJO using Jackson

    - by user2963680
    I am developing a module where i am using rest service to get data. i am not getting how to store JSON using Jackson and store it which has Queryparam also. Any help is really appreciated as I am new to this.I am trying to do server side filtering in extjs infinte grid which is sending the below request to rest service. when the page load first time, it sends http://myhost/mycontext/rest/populateGrid?_dc=9999999999999&page=1&start=0&limit=500 when you select filter on name and place, it sends http://myhost/mycontext/rest/populateGrid?_dc=9999999999999&filter=[{"type":"string","value":"Tom","field":"name"},{"type":"string","value":"London","field":"Location"}]&page=1&start=0&limit=500 I am trying to save this in POJO and then sending this to database to retrieve data. For this on rest side i have written something like this @Provider @Path("/rest") public interface restAccessPoint { @GET @Path("/populateGrid") @Produces({MediaType.APPLICATION_JSON}) public Response getallGridData(FilterJsonToJava filterparam,@QueryParam("page") String page,@QueryParam("start") String start,@QueryParam("limit") String limit); } public class FilterJsonToJava { @JsonProperty(value ="filter") private List<Filter> data; .. getter and setter below } public class Filter { @JsonProperty("type") private String type; @JsonProperty("value") private String value; @JsonProperty("field") private String field; ...getter and setters below } I am getting the below error The following warnings have been detected with resource and/or provider classes: WARNING: A HTTP GET method, public abstract javax.ws.rs.core.Response com.xx.xx.xx.xxxxx (com.xx.xx.xx.xx.json.FilterJsonToJava ,java.lang.String,java.lang.String,java.lang.String), should not consume any entity. com.xx.xx.xx.xx.json.FilterJsonToJava, and Java type class com.xx.xx.xx.FilterJsonToJava, and MIME media type application/octet-stream was not found [11/6/13 17:46:54:065] 0000001c ContainerRequ E The registered message body readers compatible with the MIME media type are: application/octet-stream com.sun.jersey.core.impl.provider.entity.ByteArrayProvider com.sun.jersey.core.impl.provider.entity.FileProvider com.sun.jersey.core.impl.provider.entity.InputStreamProvider com.sun.jersey.core.impl.provider.entity.DataSourceProvider com.sun.jersey.core.impl.provider.entity.RenderedImageProvider */* -> com.sun.jersey.core.impl.provider.entity.FormProvider ...

    Read the article

  • problem drawing gRaphaeljs pie chart

    - by Aswad
    Hi, I was trying to draw the raphaeljs piechart. I used the same example as shown on "http://g.raphaeljs.com/piechart2.html". It renders me the text but the pie charts goes missing.Can someone please help? please find the code below. g·Raphaël Dynamic Pie Chart Demo window.onload = function () { var r = Raphael("holder"); r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif"; r.g.text(320, 100, "Interactive Pie Chart Demo").attr({"font-size": 20}); var pie = r.g.piechart(320, 240, 100, [55, 20, 13, 32, 5, 1, 2, 10], {legend: ["%%.%% – Enterprise Users", "IE Users"], legendpos: "west", href: ["http://raphaeljs.com", "http://g.raphaeljs.com"]}); pie.hover(function () { this.sector.stop(); this.sector.scale(1.1, 1.1, this.cx, this.cy); if (this.label) { this.label[0].stop(); this.label[0].scale(1.5); this.label[1].attr({"font-weight": 800}); } }, function () { this.sector.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce"); if (this.label) { this.label[0].animate({scale: 1}, 500, "bounce"); this.label[1].attr({"font-weight": 400}); } }); }; </script> </head> <body class="raphael" id="g.raphael.dmitry.baranovskiy.com"> <div id="holder"></div> <p> Pie chart with legend, hyperlinks on two first sectors and hover effect. </p> <p> Demo of <a href="http://g.raphaeljs.com/">g·Raphaël</a> JavaScript library. </p> </body>

    Read the article

  • Save all xml nodes to db without looping through it

    - by AndreMiranda
    I have this xml: <Path> <Record> <ID>6534808</ID> <Distance>1.05553036073736</Distance> </Record> <Record> <ID>6542471</ID> <Distance>1.05553036073736</Distance> </Record> ... and about more 500 nodes </Path> And I'm using the code below to get all "Record" nodes: XmlNodeList paths = xDoc.SelectNodes("//Record"); And, after that, I save each record to database. But, the problem is that I'm using a foreach to loop through this nodes and the count of this nodes may be more than 500, sometimes it gets up to 1000 "Records" node. And this gets too long... Is there a way to save all of these nodes without looping through it? Thanks!!

    Read the article

  • Cannot get right height of text in java.awt.BufferdImage/Graphics2D

    - by Tommy
    Im creating a servlet that renders a jpg/png with a given text. I want the text to be centered on the rendered image. I can get the width, but the height i'm getting seems to be wrong Font myfont = new Font(Font.SANS_SERIF, Font.BOLD, 400); BufferedImage image = new BufferedImage(500, 500, BufferedImage.TYPE_INT_ARGB); Graphics2D g = image.createGraphics(); g.setFont(myfont); g.setColor(Color.BLACK); FontMetrics fm = g.getFontMetrics(); Integer textwidth = fm.stringWidth(imagetext); Integer textheight = fm.getHeight(); FontRenderContext fr = g.getFontRenderContext(); LineMetrics lm = myfont.getLineMetrics("5", fr ); float ascent = lm.getAscent(); float descent = lm.getDescent(); float height = lm.getHeight(); g.drawString("5", ((imagewidth - textwidth) / 2) , y?); g.dispose(); ImageIO.write(image, "png", outputstream); These are the values I get: textwidth = 222 textheight = 504 ascent = 402 descent = 87 height = 503 Anyone know how to get the exact height om the "5" ? The estimated height should be around 250

    Read the article

  • Just introducing myself to TMPing, and came across a quirk

    - by Justen
    I was just trying to learn the syntax of the beginner things, and how it worked when I was making this short bit of code. The code below works in adding numbers 1 to 499, but if I add 1 to 500, the compiler bugs out giving me: fatal error C1001: An internal error has occurred in the compiler. And I was just wondering why that is. Is there some limit to how much code the compiler can generate or something and it just happened to be a nice round number of 500 for me? #include <iostream> using namespace std; template < int b > struct loop { enum { sum = loop< b - 1 >::sum + b }; }; template <> struct loop< 0 > { enum { sum = 0 }; }; int main() { cout << "Adding the numbers from 1 to 499 = " << loop< 499 >::sum << endl; return 0; }

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >