Search Results

Search found 20065 results on 803 pages for 'practice problems'.

Page 64/803 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Problems finding classes in namespace and testing extend expected parent

    - by Matt
    So I am in the process of building a site in ASP.Net MVC, and in the process I am adding certain things to my Site.Master I want to make sure that all of my model classes extend a certain base class that contains all of the pieces the Site.Master needs to be operable. I want to test to make sure this assumption isn't broken (I believe this will save me time when I forget about it and can't figure out why a new combination isn't working.) I wrote a test that I thought would help with this, but I am running into two problems. First it isn't finding the one example model class I have so far in the LINQ call all of a sudden, I am admittedly still a bit new to LINQ. Second, I had it finding the class earlier, but I couldn't get it to verify that the class inherits from the base class. Here is the example test. [Test] public void AllModelClassesExtendAbstractViewModel() { var abstractViewModelType = typeof (AbstractViewModel); Assembly baseAssembly = Assembly.GetAssembly(abstractViewModelType); var modelTypes = baseAssembly.GetTypes() .Where(assemblyType => (assemblyType.Namespace.EndsWith("Models") && assemblyType.Name != "AbstractViewModel")) .Select(assemblyType => assemblyType); foreach (var modelType in modelTypes) { Assert.That(modelType.IsSubclassOf(abstractViewModelType), Is.True , modelType.Name + " does not extend AbstractViewModel"); } }

    Read the article

  • AudioRecord problems with non-HTC devices

    - by Marc
    I'm having troubles using AudioRecord. An example using some of the code derived from the splmeter project: private static final int FREQUENCY = 8000; private static final int CHANNEL = AudioFormat.CHANNEL_CONFIGURATION_MONO; private static final int ENCODING = AudioFormat.ENCODING_PCM_16BIT; private int BUFFSIZE = 50; private AudioRecord recordInstance = null; ... android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC, FREQUENCY, CHANNEL, ENCODING, 8000); recordInstance.startRecording(); short[] tempBuffer = new short[BUFFSIZE]; int retval = 0; while (this.isRunning) { for (int i = 0; i < BUFFSIZE - 1; i++) { tempBuffer[i] = 0; } retval = recordInstance.read(tempBuffer, 0, BUFFSIZE); ... // process the data } This works on the HTC Dream and the HTC Magic perfectly without any log warnings/errors, but causes problems on the emulators and Nexus One device. On the Nexus one, it simply never returns useful data. I cannot provide any other useful information as I'm having a remote friend do the testing. On the emulators (Android 1.5, 2.1 and 2.2), I get weird errors from the AudioFlinger and Buffer overflows with the AudioRecordThread. I also get a major slowdown in UI responsiveness (even though the recording takes place in a separate thread than the UI). Is there something apparent that I'm doing incorrectly? Do I have to do anything special for the Nexus One hardware?

    Read the article

  • Problems with my HTML/CSS

    - by Michael
    Note below is my CSS. This is a three column website. my main content is in the center. The problems that I am having is that my main content does not adjust correctly to IE. It is fine in FF but not in IE. .columns3headers2 #mainContent1 { margin: 0 22% 0 24%; width: 570px; background-color: #DDDDDD; height: 370px; padding: 0, 10, 0, 0; border: groove } .columns3headers2 #mainContent2 { margin: 0 22% 0 24%; width: 570px; background-color: #DDDDDD; height: 190px; border: groove } I do not have much in my main content. <div id="mainContent1"> <h1> Main Content </h1> <div id="cround"> <h3>Absolute Value</h3> <ul> <li>Test 1</li> <li>Test 2</li> <li>Test 3</li> <li>test 4</li> </ul> </p> </div>

    Read the article

  • Problems with objectatasource,giving attributes like delete insert and update

    - by kamal
    After going to the process of adding the various attributes like insert,delete and update.But when i run it through the browser ,editing works but updating and deleting doesn't !(for the update and shows the same thing for delete,my friends think i need to use codes to repair the problems,can you help me please.it shows this: Server Error in '/WebSite3' Application. ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: First_name, Surname, Original_author_id, First name, original_author id.] System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type type, String methodName, IDictionary allParameters, DataSourceOperation operation) +1119426 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +1008 System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92 System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +907 System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +704 System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118

    Read the article

  • Problems with overriding OnPaint and grabbing mouse events in C# UserControl containing other controls

    - by MoreThanChaos
    I've made a control which contains few other controls like PictureBox, Label and TextBox. But I'm having two problems: 1. I tried to paint some things on top of my control and when I'm overriding OnPaint, it results that things I try to draw are under controls that my control contains. Areas on which I would like to draw intersect with controls in ways that are not easy to predict. I mean that it includes something drawn on controls inside as well as on base of control. Is there a simple way to draw something on top of all contents of my control? Setting ForeColor to Transparent isn't a solution that would help me much. 2. I have a problem with grabbing mouse click events when I place my control on a form and add click event handling. It only works when I click on an area not occupied by controls inside. I would like the whole control to react to clicks and other actions like it was one consistent control. How can I redirect/handle these clicks to make them work the way I want? Thanks in advance for any tips

    Read the article

  • Problems solving oddly acting labels in ie7.

    - by Qwibble
    Okay so this is sort of a double question so I'll split it into two. First part In modern browsers the main bold labels sit above their corresponding form elements, and align to the left as is expected. However in ie7, they randomly site 10-15px inset. I went through the developer tools and could find nothing to fix it. I've made sure all my margins and padding is reset so I don't really understand =S Here's the page demo - link Maybe some of you ie bug fixing genius's know what the problem is? =D Second part Again with labels, this time the in-line ones resident next to the check boxes and radio buttons. In modern browsers again, the side beside the form elements as expected, but not so in ie7 where they take a new line. I've tried floating, changing margins and everything but to no effect in sitting it in-line with the div.checker or div.radio that is created by the uniform Jquery plugin. Here's the page demo - link Sorry for troubling you with my ie7 problems, I know they arent the most fun to solve. Hopefully someone has the patience to help. Matt

    Read the article

  • Two Problems I'm having with UIButton and UIView.

    - by Andy
    Hi all, I haven't been programming on the iPhone for very long, but I'm picking it up slowly by googling problems I get. Unfortunately I haven't been able to find an answer for these. I have started a new View-based application in Xcode 3.2.2 and immediately added the following files: myUIView.m and myUIView.h, which are subclasses of UIView. In Interface Builder, I set the subclass of the default UIView to be myUIView. I made a button in the drawRect method. Problem one: The title of the button only appears AFTER I click the screen, why? Problem two: I want the button to produce the modalview - is this possible? The code is as follow: #import "myUIView.h" @implementation myUIView - (void)drawRect:(CGRect)rect { // Drawing code button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(0,0,100,100); [button setTitle:@"butty" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:button]; } -(void)buttonPressed:(id)sender{ NSLog(@"Button pressed"); //present modal view somehow..? } I can't see how to post attachments, but if anyone thinks it will help I can upload the source. Many thanks, Andy

    Read the article

  • Python 3.3 Webserver restarting problems

    - by IPDGino
    I have made a simple webserver in python, and had some problems with it before as described here: Python (3.3) Webserver script with an interesting error In that question, the answer was to use a While True: loop so that any crashes or errors would be resolved instantly, because it would just start itself again. I've used this for a while, and still want to make the server restart itself every few minutes, but on Linux for some reason it won't work for me. On windows the code below works fine, but on linux it keeps saying Handler class up here ... ... class Server: def __init__(self): self.server_class = HTTPServer self.server_adress = ('MY IP GOES HERE, or localhost', 8080) global httpd httpd = self.server_class(self.server_adress, Handler) self.main() def main(self): if count > 1: global SERVER_UP_SINCE HOUR_CHECK = int(((count - 1) * RESTART_INTERVAL) / 60) SERVER_UPTIME = str(HOUR_CHECK) + " MINUTES" if HOUR_CHECK > 60: minutes = int(HOUR_CHECK % 60) hours = int(HOUR_CHECK // 60) SERVER_UPTIME = ("%s HOURS, %s MINUTES" % (str(hours), str(minutes))) SERVING_ON_ADDR = self.server_adress SERVER_UP_SINCE = str(SERVER_UP_SINCE) SERVER_RESTART_NUMBER = count - 1 print(""" SERVER INFO ------------------------------------- SERVER_UPTIME: %s SERVER_UP_SINCE: %s TOTAL_FILES_SERVED: %d SERVING_ON_ADDR: %s SERVER_RESTART_NUMBER: %s \n\nSERVER HAS RESTARTED """ % (SERVER_UPTIME, SERVER_UP_SINCE, TOTAL_FILES, SERVING_ON_ADDR, SERVER_RESTART_NUMBER)) else: print("SERVER_BOOT=1\nSERVER_ONLINE=TRUE\nRESTART_LOOP=TRUE\nSERVING_ON_ADDR:%s" % str(self.server_adress)) while True: try: httpd.serve_forever() except KeyboardInterrupt: print("Shutting down...") break httpd.shutdown() httpd.socket.close() raise(SystemExit) return def server_restart(): """If you want the restart timer to be longer, replace the number after the RESTART_INTERVAL variable""" global RESTART_INTERVAL RESTART_INTERVAL = 10 threading.Timer(RESTART_INTERVAL, server_restart).start() global count count = count + 1 instance = Server() if __name__ == "__main__": global SERVER_UP_SINCE SERVER_UP_SINCE = strftime("%d-%m-%Y %H:%M:%S", gmtime()) server_restart() Basically, I make a thread to restart it every 10 seconds (For testing purposes) and start the server. After ten seconds it will say File "/home/username/Desktop/Webserver/server.py", line 199, in __init__ httpd = self.server_class(self.server_adress, Handler) File "/usr/lib/python3.3/socketserver.py", line 430, in __init__ self.server_bind() File "/usr/lib/python3.3/http/server.py", line 135, in server_bind socketserver.TCPServer.server_bind(self) File "/usr/lib/python3.3/socketserver.py", line 441, in server_bind self.socket.bind(self.server_address) OSError: [Errno 98] Address already in use As you can see in the except KeyboardInterruption line, I tried everything to make the server stop, and the program stop, but it will NOT stop. But the thing I really want to know is how to make this server able to restart, without giving some wonky errors.

    Read the article

  • CSS Experts required - problems with Z-Index stack in my page design

    - by Jack W-H
    Howdy y'all! Basically I'm having some problems with Z-Index. Although I'm not amazing at CSS I would reckon I was reasonably good, but really can't work this out. You'll see at the URL... http://howcode.com/code/ ... that my problem is that links in the returned 'Popular' results aren't clickable or anything. I've concluded this is due to their Z-Index being messed up. I had to fiddle and tweak with Z-Index to get the tabs - Popular, Top Rated, Featured etc. - to show above the codebg div. When I adjusted the Z-Index so that the results were definitely on top, they acted as normal - text could be selected, the ratings images hovered, etc. etc. However the downside to this was that my Popular, Top Rated, Featured tabs were all placed BENEATH the background image for the returned results. If anyone can post a workaround or alteration to my CSS that would be much appreciated. Please don't forget this is a test site and design and any other URLs are likely not to work, I haven't uploaded any database configs yet or whatever! Attached are a couple of screenshots to clarify what I mean: This is what I WANT to happen (not that in actual fact in this screenshots link aren't clickable, just to demo my point though): This is what DOES happen when I adjust the Z-Index properties (I don't want this!): Thanks y'all!

    Read the article

  • Problems migrating databinding in VB.NET from Winforms to ASP.NET 2.0

    - by David
    And this was supposed to be so easy... I have existing business and data access layers that handle the retrieval and update of the data in question. These work great with the existing Winforms application (.Net V2.0) Now, in trying to write a new web-based UI, I'm running into all sorts of problems (last time I wrote asp.net code was in 1.1). Specifically, I can't data bind a text box to a business object. Oh, sure there's the ObjectDataSource but that wants to know how to do CRUD operations on the data. What I'm looking for is something that acts like the 'classic' binding objects so that, in my code, it's as simple as retrieving the object and doing a a refresh. The data component like FormView and DetailsView are so generic-looking that it's ridiculous. The existing application would have tabbed dialogs, text boxes grouped by panels, etc. On top of that, I have a directive to use master pages and unless one control causes it, I can't seem to get the content section to expand. I can't just put a text box 'below' the bottom of "Content1" and have it resize the content section - which gives me the same results as an earlier question I posted when the footer wasn't being 'pushed down' - relative position solved that but doesn't seem to solve it with placing small text boxes in the area. What I want is fairly simple. Something like: bindingobject.datasource = businessdataobject bindingobject.refresh ...and have the text boxes refresh with the new values. Likewise to have 'businessdataobject' properties updated as the user enters new data. I was able to do this with the GridView (grdRequests.DataSource = lstRequests) by making a list of asp:BoundField tags inside the collection of the GridView. Am I tilting at windmills here?

    Read the article

  • Piping EOF problems with stdio and C++/Python

    - by yeus
    I got some problems with EOF and stdio. I have no idea what I am doing wrong. When I see an EOF in my program I clear the stdin and next round I try to read in a new line. The problem is: for some reason the getline function immediatly (from the second run always, the first works just as intended) returns an EOF instead of waiting for a new input from py python process... Any idea? alright Here is the code: #include <string> #include <iostream> #include <iomanip> #include <limits> using namespace std; int main(int argc, char **argv) { for (;;) { string buf; if (getline(cin,buf)) { if (buf=="q") break; /*****///do some stuff with input //my actual filter program cout<<buf; /*****/ } else { if ((cin.rdstate() & istream::eofbit)!=0)cout<<"eofbit"<<endl; if ((cin.rdstate() & istream::failbit)!=0)cout<<"failbit"<<endl; if ((cin.rdstate() & istream::badbit)!=0)cout<<"badbit"<<endl; if ((cin.rdstate() & istream::goodbit)!=0)cout<<"goodbit"<<endl; cin.clear(); cin.ignore(numeric_limits<streamsize>::max()); //break;//I am not using break, because I //want more input when the parent //process puts data into stdin; } } return 0; } and in python: from subprocess import Popen, PIPE import os from time import sleep proc=Popen(os.getcwd()+"/Pipingtest",stdout=PIPE,stdin=PIPE,stderr=PIPE); while(1): sleep(0.5) print proc.communicate("1 1 1") print "running"

    Read the article

  • Strange problems with the Spring RestTemplate in Android application

    - by HarryCater
    I begin to use RESTful api of the Spring Framework in my android client application. But I have encountered with problems when I tried to execute HTTP request via postForObject/postForEntity methods. Here is my code: public String _URL = "https://noticemed.com/app/mobile/login"; public void BeginAuthorization(View view) { HttpHeaders requestHeaders = new HttpHeaders(); requestHeaders.setContentType(MediaType.APPLICATION_JSON); HttpEntity<String> _entity = new HttpEntity<String>(requestHeaders); RestTemplate templ = new RestTemplate(); templ.setRequestFactory(new HttpComponentsClientHttpRequestFactory()); templ.getMessageConverters().add(new MappingJacksonHttpMessageConverter()); ResponseEntity<String> _response = templ.postForEntity(_URL,_entity,String.class); //HERE APP CRASHES String _body = _response.getBody(); And here is a stack trace in logcat after app crashing. As you see there is no definite error message. So the question what am I doing wrong? How to fix this? May there is other way to do it?I really need a help. Thanks in advance!

    Read the article

  • Problems breaking out of nested loops

    - by user1040281
    I have problems breaking out off these nested loops correctly. What the code is trying to do is to indicate that a customer has rented a certain movie. Both the movie and customer are compared to properties of arraylist objects and then if all checks out the name property and ID property of a movie object are added as a string to another arraylist. All this works correctly as long as I use the first movie (from movies) and the first customer (from customers) but if I try renting other movies further down my arraylist with other customers then it adds the rented movie to the customerRentedMovies arraylist but prints out the "else message". I figure I need to break out of the foreach(blabla) loops aswell? or could goto be used? Comments was removed (looked kinda messy, can explain further if needed) public void RentMovie(string titel, int movieID, string name, int customerID) { foreach (Customer customer in customers) { if (name == customer.Name && customerID == customer.CustomerID) { foreach (MovieInfo movie in movies) { if (titel == movie.Titel && movieID == movie.MovieID) { movie.rented = true; string rentedMovie = string.Format("{0} ID: {1}", movie.Titel, movie.MovieID); customer.customerRentedMovies.Add(rentedMovie); break; } else { Console.WriteLine("No movie with that titel and ID!"); } } break; } else { Console.WriteLine("No customer with that ID and name"); } } }

    Read the article

  • Problems with variadic function

    - by morpheous
    I have the following function from some legacy code that I am maintaining. long getMaxStart(long start, long count, const myStruct *s1, ...) { long i1, maxstart; myStruct *s2; va_list marker; maxstart = start; /*BUGFIX: 003 */ /*(va_start(marker, count);*/ va_start(marker, s1); for (i1 = 1; i1 <= count; i1++) { s2 = va_arg(marker, myStruct *); /* <- s2 is assigned null here */ maxstart = MAX(maxstart, s2->firstvalid); /* <- SEGV here */ } va_end(marker); return (maxstart); } When the function is called with only one myStruct argument, it causes a SEGV. The code compiled and run without crashing on Windows XP when I compiled it using VS2005. I have now moved the code to Ubuntu Karmic and I am having problems with the stricter compiler on Linux. Is anyone able to spot what is causing the parameter not to be read correctly in the var_arg() statement? I am compiling using gcc version 4.4.1 Edit The statement that causes the SEGV is this one: start = getMaxStart(start, 1, ms1); The variables 'start' and 'ms1' have valid values when the code execution first reaches this line.

    Read the article

  • Collision detection problems...

    - by thyrgle
    Hi, I have written the following: -(void) checkIfLineCollidesWithAll { float slope = ((160-L1Circle1.position.y)-(160-L1Circle2.position.y))/((240-L1Circle1.position.x)-(240-L1Circle2.position.x)); float b = (160-L1Circle1.position.y) - slope * (240-L1Circle1.position.x); if ((240-L1Sensor1.position.x) < (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) < (240-L1Circle2.position.x) || ((240-L1Sensor1.position.x) > (240-L1Circle1.position.x) && (240-L1Sensor1.position.x) > (240-L1Circle2.position.x))) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } else if (slope == INFINITY || slope == -INFINITY) { if (L1Circle1.position.y + 16 >= L1Sensor1.position.y || L1Circle1.position.y - 16 <= L1Sensor1.position.y) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } else if (160-L1Sensor1.position.y + 12 >= slope*(240-L1Sensor1.position.x) + b && 160-L1Sensor1.position.y - 12 <= slope*(240-L1Sensor1.position.x) + b) { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorBad.png"]]; } else { [L1Sensor1 setTexture:[[CCTextureCache sharedTextureCache] addImage:@"SensorOk.png"]]; } } Basically what this does is finds m and b in the well known equation: y = mx + b and then substitutes coordinates of the L1Sensor1 (the circle I'm trying to detect if it it intersects with the line segment) to see if y = mx + b hold true. But, there are two problems, first, when slope approaches infinity the range of what the L1Sensor1 should "react" to (it "reacts" by changing its image) becomes smaller. Also, the code that should handle infinity is not working. Thanks for the help in advanced.

    Read the article

  • Problems with variadic function (C)

    - by morpheous
    I have the following function from some legacy code that I am maintaining. long getMaxStart(long start, long count, const myStruct *s1, ...) { long i1, maxstart; myStruct *s2; va_list marker; maxstart = start; /*BUGFIX: 003 */ /*(va_start(marker, count);*/ va_start(marker, s1); for (i1 = 1; i1 <= count; i1++) { s2 = va_arg(marker, myStruct *); /* <- s2 is assigned null here */ maxstart = MAX(maxstart, s2->firstvalid); /* <- SEGV here */ } va_end(marker); return (maxstart); } When the function is called with only one myStruct argument, it causes a SEGV. The code compiled and run without crashing on an XP, when I compiled it using VS2005. I have now moved the code to Ubuntu Karmic and I am having problems with the stricter compiler on Linux. Is anyone able to spot what is causing the parameter not to be read correctly in the var_arg() statement? I am compiling using gcc version 4.4.1

    Read the article

  • Problems with binding to Window Height and Width

    - by D.H.
    I have some problems when I try to bind the height and width of a window to properties in my view model. Here is a small sample app to illustrate the problem. This is the code in app.xaml.xs public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); MainWindow mainWindow = new MainWindow(); MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(); mainWindow.DataContext = mainWindowViewModel; mainWindow.Show(); } } This is MainWindow.xaml: <Window x:Class="TestApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="{Binding WindowHeight}" Width="{Binding WindowWidth}" BorderThickness="{Binding WindowBorderThickness}"> </Window> And this is the view model: public class MainWindowViewModel { public int WindowWidth { get { return 100; } } public int WindowHeight { get { return 200; } } public int WindowBorderThickness { get { return 8; } } } When the program is started the getters of WindowHeight and WindowBorderThickness (but not WindowWidth) are called, so the height and the border of the window is set properly, but not the width. I then add button that will trigger PropertyChanged for all properties, so that the view model now looks like this: public class MainWindowViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public void TriggerPropertyChanges() { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("WindowWidth")); PropertyChanged(this, new PropertyChangedEventArgs("WindowHeight")); PropertyChanged(this, new PropertyChangedEventArgs("WindowBorderThickness")); } } public ICommand ButtonCommand { get { return new RelayCommand(delegate { TriggerPropertyChanges(); }); } } public int WindowWidth { get { return 100; } } public int WindowHeight { get { return 200; } } public int WindowBorderThickness { get { return 8; } } } Now, when I click the button, the getter of WindowBorderThickness is called, but not the ones for WindowWidth and WindowHeight. It all just seems very weird and inconsistent to me. What am I missing?

    Read the article

  • Problems with Window Functions Wndproc and about

    - by BrianHuangverinem
    I really having problems with this problem ,it would be nice if someone help me on this. Every time I try to build my source file the same errors occur every time for the two window functions CALLBACK Wndproc and CALLBACK About. error: "local function definitions are illegal" Can you tell me what mistake I made? LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); switch (message) { case WM_COMMAND: // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); CaptureImage(hWnd); EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // Message handler for about box. INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: return (INT_PTR)TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; } break; } return (INT_PTR)FALSE; }

    Read the article

  • Problems installing a package from PyPI: root files not installed

    - by intuited
    After installing the BitTorrent-bencode package, either via easy_install BitTorrent-bencode or pip install BitTorrent-bencode, or by downloading the tarball and installing that via easy_install $tarball, I discover that /usr/local/lib/python2.6/dist-packages/BitTorrent_bencode-5.0.8-py2.6.egg/ contains EGG-INFO/ and test/ directories. Although both of these subdirectories contain files, there are no files in the BitTorr* directory itself. The tarball does contain bencode.py, which is meant to be the actual source for this package, but it's not installed by either of those utils. I'm pretty new to all of this so I'm not sure if this is a problem with the package or with what I'm doing. The package was packaged a while ago (2007), so perhaps it's using some deprecated configuration aspect that I need to supply a command-line flag for. I'm more interested in learning what's wrong with either the package or my procedures than in getting this particular package installed; there is another package called hunnyb that seems to do a decent enough job of decoding bencoded data. Mostly I'd like to know how to deal with such problems in other packages.

    Read the article

  • Solving problems with near infinite potential solutions

    - by Zonda333
    Today I read the following problem: Use the digits 2, 0, 1, 1 and the operations +, -, x, ÷, sqrt, ^ , !, (), combinations, and permutations to write equations for the counting numbers 1 through 100. All four digits must be used in each expression. Only the digits 2, 0, 1, 1 may be used, and each must be used exactly once. Decimals may be used, as in .1, .02, etc. Digits may be combined; numbers such as 20 or 101 may be used. Example: 60 = 10*(2+1)!, 54 = ¹¹C2 - 0! Though I was able to quickly find around 50 solutions quite easily in my head, I thought programming it would be a far superior solution. However, I then realized I had no clue how to go about solving a problem like this. I am not asking for complete code for me to copy and paste, but for ideas about how I would solve this problems, and others like it that have nearly infinite potential solutions. As I will be writing it in python, where I have the most experience, I would prefer if the answers were more python based, but general ideas are great too.

    Read the article

  • javascript: Problems with multiple setIntervals running simultaniously

    - by user340879
    Hello, My first post here. I want to make a horizontal menu with submenu's sliding down on mouseover. I know I could use jQuery but this is to practice my javascript skills. I use the following code: var up = new Array() var down = new Array() var submenustart function titleover(headmenu, inter) { submenu = headmenu.lastChild up[inter] = window.clearInterval(up[inter]) down[inter] = window.setInterval("slidedown(submenu)",1) } function slidedown(submenu) { if(submenu.offsetTop < submenustart) { submenu.style.top = submenu.offsetTop + 1 + "px" } } function titleout(headmenu, inter) { submenu = headmenu.lastChild down[inter] = window.clearInterval(down[inter]) up[inter] = window.setInterval("slideup(submenu)", 1) } function slideup(submenu) { if(submenu.offsetTop > submenustart - submenu.clientHeight + 1) { submenu.style.top = submenu.offsetTop - 1 + "px" } } The variable submenustart gets appointed a value in another function which is not relevant for my question. HTML looks like this: <table class="hoofding" id="hoofding"> <tr> <td onmouseover="titleover(this, 0)" onmouseout="titleout(this, 0)"><a href="#" class="hoofdinglink" id="hoofd1">AAAA</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> </table></td> <td onmouseover="titleover(this, 1)" onmouseout="titleout(this, 1)"><a href="#" class="hoofdinglink">BBBB</a> <table class="menu"> <tr><td><a href="...">1111</a></td></tr> <tr><td><a href="...">2222</a></td></tr> <tr><td><a href="...">3333</a></td></tr> <tr><td><a href="...">4444</a></td></tr> <tr><td><a href="...">5555</a></td></tr> </table></td> ... </tr> </table> What happens is the following: If I go over and out (for ex) menu A it works fine. If i go now over menu B the interval applied to A is now applied to B. There are now 2 interval functions applied to B. The one originally for A and a new one triggered by the mouseover on B. If I would go to A all the intervals are now applied to A. I have been searching for hours but and I am completely stuck. Thanks in advance.

    Read the article

  • Zend_Controller_Router_Route_Chain more routes - more problems

    - by epmspec
    When i use only langRoute and moduleRoute i have not any problems. But when i add pageRoute it is not work properly. I have tried many another ways do it (Regex etc) but none gives the desired result. Can anybody help me? $front = Zend_Controller_Front::getInstance(); $router = $front->getRouter(); //Route_page needs dispatcher and request $dispatcher = $front->getDispatcher(); $request = $front->getRequest(); // Add languag routes $langRoute = new Zend_Controller_Router_Route_Hostname( ':language.domain.com', array( 'language' => 'ru', ), array( 'language' => '^(ru|en)$', ) ); // Add module routes $moduleRoute = new Zend_Controller_Router_Route_Module(array(),$dispatcher,$request); // Add page routes $pageRoute = new Zend_Controller_Router_Route( ':uri\.html', array( 'controller' => 'index', 'module' => 'default', 'action' => 'index', 'uri' => 'index', ), array ('uri' => '[0-9a-z\-]+') ); // Add chain routes $chainedRoute = new Zend_Controller_Router_Route_Chain(); $chainedRoute->chain($pageRoute); $chainedRoute->chain($langRoute)->chain($moduleRoute); $router->addRoute('default', $chainedRoute);

    Read the article

  • jQuery: Problems cookies internet explorer

    - by user1140479
    I have made a login page. When the user logs in a request to an API is send. This API is PHP and checks the username and password. When both are correct an unique key is send back (this is placed in the database for further use: userid and other stuff needed in the website). After that key is sent back it is placed in a cookie: $.cookie("session", JSON.stringify(result)); After the cookie is set I send the user to a new page: location.href = 'dashboard.htm'; In this page jQuery checks if the cookie "session" is present. If not, the user is send back to the login page. sessionId = ($.cookie("session") ? JSON.parse($.cookie("session")).SessionId : 0); return sessionId; This works fine in Chrome, but IE (8/9) has some problems with this. I figured out that when you get to dashboard.htm the session is present. As soon as I hit F5 the session is gone. And sometimes the cookie isn't set at all! I can't seem to figure out why this is happening in IE. Has someone any idea? Other options/ideas to save that unique key are also welcome. Thanks in advance.

    Read the article

  • Glassfish v3 / JNDI entry cannot be found problems!

    - by REMP
    I've been having problems trying to call an EJB's method from a Java Application Client. Here is the code. EJB Remote Interface package com.test; import javax.ejb.Remote; @Remote public interface HelloBeanRemote { public String sayHello(); } EJB package com.test; import javax.ejb.Stateless; @Stateless (name="HelloBeanExample" , mappedName="ejb/HelloBean") public class HelloBean implements HelloBeanRemote { @Override public String sayHello(){ return "hola"; } } Main class (another project) import com.test.HelloBeanRemote; import javax.naming.Context; import javax.naming.InitialContext; public class Main { public void runTest()throws Exception{ Context ctx = new InitialContext(); HelloBeanRemote bean = (HelloBeanRemote)ctx.lookup("java:global/Test/HelloBeanExample!com.test.HelloBeanRemote"); System.out.println(bean.sayHello()); } public static void main(String[] args)throws Exception { Main main = new Main(); main.runTest(); } } Well, what is my problem? JNDI entry for this EJB cannot be found! java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430) at javax.naming.InitialContext.lookup(InitialContext.java:392) at testdesktop.Main.runTest(Main.java:22) at testdesktop.Main.main(Main.java:31) Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:global/Test/HelloBeanExample!com.test.HelloBeanRemote' in SerialContext [Root exception is javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException]] at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442) at javax.naming.InitialContext.lookup(InitialContext.java:392) at testdesktop.Main.runTest(Main.java:22) at testdesktop.Main.main(Main.java:31) Caused by: javax.naming.NamingException: Unable to acquire SerialContextProvider for SerialContext [Root exception is java.lang.NullPointerException] at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:276) at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:430) ... 3 more Caused by: java.lang.NullPointerException at com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:297) at com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:271) ... 4 more Java Result: 1 I've trying with different JNDI entries but nothing works (I got this entries from NetBeans console): INFO: Portable JNDI names for EJB HelloBeanExample : [java:global/Test/HelloBeanExample, java:global/Test/HelloBeanExample!com.test.HelloBeanRemote] INFO: Glassfish-specific (Non-portable) JNDI names for EJB HelloBeanExample : [ejb/HelloBean, ejb/HelloBean#com.test.HelloBeanRemote] So I tried with the following entries but I got the same exception : java:global/Test/HelloBeanExample java:global/Test/HelloBeanExample!com.test.HelloBeanRemote ejb/HelloBean ejb/HelloBean#com.test.HelloBeanRemote I'm using Netbeans 6.8 and Glassfish v3!

    Read the article

  • Configuration problems with django and mod_wsgi

    - by Jimbo
    Hi, I've got problems on getting django to work on apache 2.2 with mod_wsgi. Django is installed and mod_wsgi too. I can even see a 404 page when accessing the path and I can login to django admin. But if I want to install the tagging module I get the following error: Traceback (most recent call last): File "setup.py", line 49, in <module> version_tuple = __import__('tagging').VERSION File "/home/jim/django-tagging/tagging/__init__.py", line 3, in <module> from tagging.managers import ModelTaggedItemManager, TagDescriptor File "/home/jim/django-tagging/tagging/managers.py", line 5, in <module> from django.contrib.contenttypes.models import ContentType File "/usr/lib/python2.5/site-packages/django/contrib/contenttypes/models.py", line 1, in <module> from django.db import models File "/usr/lib/python2.5/site-packages/django/db/__init__.py", line 10, in <module> if not settings.DATABASE_ENGINE: File "/usr/lib/python2.5/site-packages/django/utils/functional.py", line 269, in __getattr__ self._setup() File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 40, in _setup self._wrapped = Settings(settings_module) File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 75, in __init__ raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e) ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax errors?): No module named mysite.settings My httpd.conf: Alias /media/ /home/jim/django/mysite/media/ <Directory /home/jim/django/mysite/media> Order deny,allow Allow from all </Directory> Alias /admin/media/ "/usr/lib/python2.5/site-packages/django/contrib/admin/media/" <Directory "/usr/lib/python2.5/site-packages/django/contrib/admin/media/"> Order allow,deny Allow from all </Directory> WSGIScriptAlias /dj /home/jim/django/mysite/apache/django.wsgi <Directory /home/jim/django/mysite/apache> Order deny,allow Allow from all </Directory> My django.wsgi: import sys, os sys.path.append('/home/jim/django') sys.path.append('/home/jim/django/mysite') os.chdir('/home/jim/django/mysite') os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() I try to get this to work since a few days and have read several blogs and answers here on so but nothing worked.

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >