Search Results

Search found 6928 results on 278 pages for 'calling'.

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

  • When module calling gets ugly

    - by Pete
    Has this ever happened to you? You've got a suite of well designed, single-responsibility modules, covered by unit tests. In any higher-level function you code, you are (95% of the code) simply taking output from one module and passing it as input to the next. Then, you notice this higher-level function has turned into a 100+ line script with multiple responsibilities. Here is the problem. It is difficult (impossible) to test that script. At least, it seems so. Do you agree? In my current project, all of the bugs came from this script. Further detail: each script represents a unique solution, or algorithm, formed by using different modules in different ways. Question: how can you remedy this situation? Knee-jerk answer: break the script up into single-responsibility modules. Comment on knee-jerk answer: it already is! Best answer I can come up with so far: create higher-level connector objects which "wire" modules together in particular ways (take output from one module, feed it as input to another module). Thus if our script was: FooInput fooIn = new FooInput(1, 2); FooOutput fooOutput = fooModule(fooIn); Double runtimevalue = getsomething(fooOutput.whatever); BarInput barIn = new BarInput( runtimevalue, fooOutput.someOtherValue); BarOutput barOut = barModule(BarIn); It would become with a connector: FooBarConnectionAlgo fooBarConnector = new fooBarConnector(fooModule, barModule); FooInput fooIn = new FooInput(1, 2); BarOutput barOut = fooBarConnector(fooIn); So the advantage is, besides hiding some code and making things clearer, we can test FooBarConnectionAlgo. I'm sure this situation comes up a lot. What do you do?

    Read the article

  • Buyer Beware - Cold Calling Search Engine Optimisation Dodgy Companies

    Have you ever had those phone calls from companies claiming to get your site to the first page of Google within 28 days? Even as a search engine optimisation and marketing consultant, I still get them. I listen to their pitch and then ask a couple of questions. They usually have no clue how to answer them so what kind of service will they be providing?

    Read the article

  • Frame Buffer Objects vs calling TexCoord2f?

    - by sensae
    I'm learning the basics of OpenGL with lwjgl currently, and following a guide I've got textured quads that can move around a scene. I've been reading about Frame Buffer Objects, and I'm not really clear on their purpose and their benefit. My understanding is that I'll create a FBO with the texture I'd like, load the FBO, draw a quad, then unload the FBO. What would the technique I'm currently doing for texture management be called, and how does it differ from using FBOs? What are the benefits to using FBOs? How does it fit into the grand rendering scheme of things?

    Read the article

  • Calling a model from a controller from the 404 route [migrated]

    - by IrishRob
    Got a problem here where I can’t seem to load a method from a model after the page has been redirected after encountering a 404. Model name: Category_Model Method name: get_category_menu() In my routes, I’ve updated the 404 over-ride to: $route[‘404_override’] = ‘whoops’; I’ve also got my controller Whoops that reads… <?php class Whoops extends CI_Controller { function index() { $this->load->model('Category_Model'); $data['Categories'] = $this->Category_Model->get_category_menu(); $data['main_content'] = $this->load->view('messages/whoops', null, true); $this->load->view('includes/template', $data); } } So when I navigate to a page that doesn’t exist, I get the following error… Message: Undefined property: Whoops::$Category_Model Filename: controllers/whoops.php I’ve hard coded the loading of the model into the controller here, even though I have it in my autoload, but no luck. Everything else with the site so far works, just this 404 problem. Any pointers would be great, kinda new to CI so go easy on me. Cheers.

    Read the article

  • I get GL_INVALID_VALUE after calling glTexSubImage2D

    - by user892644
    I am trying to figure out why my texture allocation does not work. Here is the code: glTexStorage2D(GL_TEXTURE_2D, 2, GL_RGBA8, 2048, 2048); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 2048, 2048, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV, &BitMap[0]); glTexSubImage2D returns GL_INVALID_VALUE but the maximum texture allowed is 16384x16384 on my card. The source of the image is 16bit (Red 5, Green 6, Blue 5).

    Read the article

  • RasterizerState set to null after calling DrawText in Nuclex

    - by ProgrammerAtWork
    I have the following code in XNA: // class members Text t1; Text t2; Text t3; // init // Debugfont is size 24 vectorfont t1 = MM.DebugFont24.Fill("hello"); t1 = MM.DebugFont24.Extrude("hello"); t2 = MM.DebugFont24.Fill("hello"); t2 = MM.DebugFont24.Extrude("hello"); t3 = MM.DebugFont24.Fill("hello"); t3 = MM.DebugFont24.Extrude("hello"); // Draw TextBatch test = new TextBatch(MM.GD); test.DrawText(t1, Color.Red); test.DrawText(t2, Color.Red); test.DrawText(t3, Color.Red); test.End(); //After the second call to the TextBatch, RasterizerState of the GraphicsDevice is set to null //But I don't get any runtime errors or any indication of that something is wrong. Is this supposed to happen? Or am I doing something wrong? I've discovered that this happened because culling was set to None when I was rendering textures

    Read the article

  • Calling a web service through a reverse proxy

    - by Ken
    I had a w/s that when I first read the WSDL in test, was http, but needed to be accessed from behind a reverse proxy with https.  Here are the steps: Change the app.config, <httpTransport> to <httpsTransport> Change the app.config and the url address in the <endpoint>to the reverse proxy address Add System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };  to disable certificate validation.  This will validate all certificates (including invalid, expired or self-signed ones).

    Read the article

  • Class design for calling "the same method" on different classes from one place

    - by betatester07
    Let me introduce my situation: I have Java EE application and in one package, I want to have classes which will act primarily as cache for some data from database, for example: class that will hold all articles for our website class that will hold all categories etc. Every class should have some update() method, which will update data for that class from database and also some other methods for data manipulation specific for that data type. Now, I would like to call update() method for all class instances (there will be exactly one class instance for every class) from one place. What is the best design?

    Read the article

  • Calling a parameterized javascript function from php [migrated]

    - by Ginger
    I need to call a javascript function from php, by passing a value in php variable. My code goes like this: echo '<tr class="trlight"><td onclick="callVehicle('.$qry_vehicleid.');"><label>Call Vehicle</label>&nbsp;</td></tr>'; And in javascript file I try to execute the following code: function callVehicle(vid) { alert('Call '+vid); document.getElementById("SearchResult").style.visibility="hidden"; } and an error test is not defined occurs. test is the value that I assigned to variable $qry_vehicleid. Can someone please point out what the mistake is?

    Read the article

  • Calling a webservice via Javascript

    - by jeroenb
    If you want to consume a webservice, it's not allways necessary to do a postback. It's even not that hard! 1. Webservice You have to add the scriptservice attribute to the webservice. [System.Web.Script.Services.ScriptService]public class PersonsInCompany : System.Web.Services.WebService { Create a WebMethod [WebMethod] public Person GetPersonByFirstName(string name) { List<Person> personSelect = persons.Where(p => p.FirstName.ToLower().StartsWith(name.ToLower())).ToList(); if (personSelect.Count > 0) return personSelect.First(); else return null; } 2. webpage Add reference to your service to your scriptmanager <script type="text/javascript"> function GetPersonInCompany() { var val = document.getElementById("MainContent_TextBoxPersonName"); PersonsInCompany.GetPersonByFirstName(val.value, FinishCallback); } function FinishCallback(result) { document.getElementById("MainContent_LabelFirstName").innerHTML = result.FirstName; document.getElementById("MainContent_LabelName").innerHTML = result.Name; document.getElementById("MainContent_LabelAge").innerHTML = result.Age; document.getElementById("MainContent_LabelCompany").innerHTML = result.Company; } </script> Add some javascript, where you first call your webservice. Classname.Webmethod = PersonsInCompany.GetPersonByFirstName Add a callback to catch the result from the webservice. And use the result to update your page. <script type="text/javascript"> function GetPersonInCompany() { var val = document.getElementById("MainContent_TextBoxPersonName"); PersonsInCompany.GetPersonByFirstName(val.value, FinishCallback); } function FinishCallback(result) { document.getElementById("MainContent_LabelFirstName").innerHTML = result.FirstName; document.getElementById("MainContent_LabelName").innerHTML = result.Name; document.getElementById("MainContent_LabelAge").innerHTML = result.Age; document.getElementById("MainContent_LabelCompany").innerHTML = result.Company; } </script>   If you have any question, feel free to contact me! You can download the code here.

    Read the article

  • calling methods if previous call success

    - by New Developer
    I my c# program I have to perform 5 steps(tasks) sequentially. basically these five should execute one after the other only the previous task performed is success. Currently I have done it in following style. But this is not very good code style to follow. var isSuccess=false; isSuccess=a.method1(); if(isSuccess) isSuccess=a.method2(); if(isSuccess) isSuccess=a.method3(); if(isSuccess) isSuccess=a.method4(); if(isSuccess) isSuccess=a.method5(); How can I re factor this code. What is the best way I can follow?

    Read the article

  • How to ensure that a member variable is initialized before calling a class method

    - by Omkar Ekbote
    There's a class with a parametrized constructor that initializes a member variable. All public methods of the class then use this member variable to do something. I want to ensure that the caller always creates an object using the parametrized constructor (there is also a setter for this member variable) and then call that object's methods. In essence, it should be impossible for the caller to call any method without setting a value to the member variable (either by using the parametrized constructor or the setter). Currently, a caller can simply make an object using the default constructor and then call that object's method - I want to avoid checking whether or not the member variable is set in each and every one of the 20-odd methods of the class (and throw an exception if it is not). Though a runtime solution is acceptable (better than the one I mentioned above); a compile-time solution is preferable so that any developer will not be allowed to make that mistake and then waste hours debuggging it!

    Read the article

  • Calling Knowledge Workers: Make a Difference in the User Experience

    - by Charles Knapp
    Do you consider yourself a knowledge worker? Do you have ideas of how to make CRM software work smarter so you don't have to work harder? The Oracle Middleware User Experience team will be conducting customer feedback focus groups at Oracle OpenWorld, October 1-3. All it takes is a couple of hours or less for us to learn from you. Customer participation helps Oracle develop outstanding products and solutions. Knowledge workers of all types are invited to participate: Finance, Sales, Human Resources, Marketing, Recruiters, Budget Managers, Project & Product Managers and more. To participate in these sessions you do not have to be registered for Oracle OpenWorld. If you or someone you know is interested in participating, please email muxtesting_us at oracle.com with your name, company, job title, work and mobile phone numbers with country code, and email address.

    Read the article

  • khotkey script calling bindings stop to work on switching to Quantal

    - by Adobe
    I have many scripts which I call with khotkey. For example I have a hotkey which executes: bk_starts_or_brings.bash 'Konsole' konsole On updating to Quantal -- it stops to work: if I call that key -- it searches bk_starts_or_brings.bash 'Konsole' konsole in google in default web-browser. I tried: sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core sudo dpkg-reconfigure xserver-xorg sudo apt-get install build-essential cdbs dh-make dkms execstack dh-modaliases fakeroot libqtgui4 When I start the command from konsole -- it works as expected, but when I call it with khotkey -- it doesn't. I guess someone shadows my keybiding. Or some daemon is not run on startup.

    Read the article

  • Basic SDL2 Code which "Stop working" when calling SDL_Quit() [migrated]

    - by Rivten
    So I got into SDL2 with C++ quite recently and I did this very simple code : int main(int argc, char** argv) { SDL_Event *event; bool done = false; if(SDL_Init(SDL_INIT_VIDEO) != 0) { std::cerr << "Problèmes pour initialiser la SDL : " << SDL_GetError() << std::endl; return 1; } SDL_Window *window = 0; window = SDL_CreateWindow("Mopion", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); if(window == 0) { done = true; } while(!done) { while(SDL_PollEvent(event)) { switch(event->type) { case SDL_QUIT: done = true; break; case SDL_KEYUP: if(event->key.keysym.sym == SDLK_q) { done = true; } break; default: break; } } } SDL_DestroyWindow(window); SDL_Quit(); return 0; } While that code executes at first quite well, when I hit the "Q" key, the window closes but I got a Windows Error Window saying that "My program stopped working." which is not very convenient. Using the debugger, I found that everything is fine until SDL_Quit() is called. Anyone has any idea why this is going on ? Thanks a lot !

    Read the article

  • Calling Customer Service Leaders

    - by Charles Knapp
    and by Suzy Meriwether The Customer Service Leader is under greater pressure today than ever before. With rapid adoption of new communication technologies and devices by customers, customer expectations are on the rise and social media provides a venue to share their experiences. To respond to these industry change drivers, Customer Service Leaders need to deliver a superior customer experience, achieve operational excellence, and transform their service organization. Oracle is hosting a series of evening seminars to discuss these drivers and how to improve efficiency within the service organization while treating every interaction as an opportunity to deliver superior customer experiences and increase revenue throughout the entire customer lifecycle. • Miami – November 7th @ Marlins Park – Call to register: 1-800-820-5592 x 10996 • Dallas – November 8th @ Cowboys Stadium – Call to register: 1-800-820-5592 x 11016 • Philadelphia – November 13th @ Rodin Museum – Call to register: 1-800-820-5592 x 11013 Be sure to mention you heard about this event from the Oracle CX Blog. I hope to see you there.

    Read the article

  • Calling the Interviewer after the interview [closed]

    - by czchlong
    It's been a week after I had an interview with a bank. They told my recruiter that I had done well and it is looking good for me. However, it's been a week and my recruiter has not been able to reach any of them for feedback and neither have I heard anything, although they did not say to me or my recruiter that I didn't get the job. My recruiter has placed numerous people with this bank with other managers and never with this one, so my recruiter has no clue what's going on. I have already sent an email, however I have not gotten a response. Would it be appropriate for me to call my interviewer and ask for some feedback?

    Read the article

  • Calling All New Online Businesses!

    If you're a new business online then you will probably know that you're going to need as many visitors as fast as possible in order to succeed. Without a doubt, the only way this is going to happen is if you outrank your competitors in the search engine results pages (SERPS).

    Read the article

  • JAVE function call form JSP page is not returning value

    - by Satyendra
    I am calling a java function from JSP page which returns file name after creationg a XML file. In some cases where size of file is large(Java function execution takes much time due to large data) it is returning blank where as XML file is genertaed after some time. Can any one help me to get the file name in this case so that user can know the generated file name.

    Read the article

  • Start Daemonised GNU Screen from script a allow calling script to end

    - by tez
    I have a script on an embedded device that calls screen to start if a user logs in via a ssh session... #!/bin/sh SCREENRUNNING=`pgrep SCREEN` if [ -z "$SCREENRUNNING" ]; then echo "Screen not running so let's start the Master session sleep 2 screen -dmS Master sleep 2 screen -x root/Master else echo "Screen is already running let's connect to existing session" sleep 2 screen -x root/Master fi However this keeps the calling script active till the screen session exits,even if it's detached. What I want to do is have the calling script finish and exit while the screen session stays active. I've tried daemonising the screen -x lines and adding an & to the end of the screen -x lines neither of which work properly. Ideas?

    Read the article

  • Could someone explain __declspec(naked) please?

    - by Scott
    I'm looking into porting a script engine written for Windows to Linux; it's for Winamp's visualization platform AVS. I'm not sure if it's even possible at the moment. From what I can tell the code is taking the addresses of the C functions nseel_asm_atan and nseel_asm_atan_end and storing them inside a table that it can reference during code execution. I've looked at MS's documentation, but I'm unsure what __declspec(naked) really does. What is prolog and epilog code mentioned in the documentation? Is that related to Windows calling conventions? Is this portable? Know of any Linux-based examples using similar techniques? static double (*__atan)(double) = &atan; __declspec ( naked ) void nseel_asm_atan(void) { FUNC1_ENTER *__nextBlock = __atan(*parm_a); FUNC_LEAVE } __declspec ( naked ) void nseel_asm_atan_end(void) {}

    Read the article

  • C callback functions defined in an unnamed namespace?

    - by Johannes Schaub - litb
    Hi all. I have a C++ project that uses a C bison parser. The C parser uses a struct of function pointers to call functions that create proper AST nodes when productions are reduced by bison: typedef void Node; struct Actions { Node *(*newIntLit)(int val); Node *(*newAsgnExpr)(Node *left, Node *right); /* ... */ }; Now, in the C++ part of the project, i fill those pointers class AstNode { /* ... */ }; class IntLit : public AstNode { /* ... */ }; extern "C" { Node *newIntLit(int val) { return (Node*)new IntLit(val); } /* ... */ } Actions createActions() { Actions a; a.newIntLit = &newIntLit; /* ... */ return a; } Now the only reason i put them within extern "C" is because i want them to have C calling conventions. But optimally, i would like their names still be mangled. They are never called by-name from C code, so name mangling isn't an issue. Having them mangled will avoid name conflicts, since some actions are called like error, and the C++ callback function has ugly names like the following just to avoid name clashes with other modules. extern "C" { void uglyNameError(char const *str) { /* ... */ } /* ... */ } a.error = &uglyNameError; I wondered whether it could be possible by merely giving the function type C linkage extern "C" void fty(char const *str); namespace { fty error; /* Declared! But i can i define it with that type!? */ } Any ideas? I'm looking for Standard-C++ solutions.

    Read the article

  • video calling (center)

    - by rrejc
    We are starting to develop a new application and I'm searching for information/tips/guides on application architecture. Application should: read the data from an external (USB) device send the data to the remote server (through internet) receive the data from the remote server perform a video call with to the calling (support) center receive a video call call from the calling (support) center support touch screens In addition: some of the data should also be visible through the web page. So I was thinking about: On the server side: use the database (probably MS SQL) use ORM (nHibernate) to map the data from the DB to the domain objects create a layer with business logic in C# create a web (WCF) services (for client application) create an asp.net mvc application (for item 7.) to enable data view through the browser On the client side I would use WPF 4 application which will communicate with external device and the wcf services on the server. So far so good. Now the problem begins. I have no idea how to create a video call (outgoing or incoming) part of the application. I believe that there is no problem to communicate with microphone, speaker, camera with WPF/C#. But how to communicate with the call center? What protocol and encoding should be used? I think that I will need to create some kind of server which will: have a list of operators in the calling center and track which operator is occupied and which operator is free have a list of connected end users receive incoming calls from end users and delegate call to free operator delegate calls from calling center to the end user Any info, link, anything on where to start would be much appreciated. Many thanks!

    Read the article

  • Call methods in main method

    - by Niloo
    this is my main method that gets 3 integers from command line and I parse then in my validating method. However I have one operation method that calls 3 other methods, but i don't know what type of data and howmany I have to put in my operatinMethod() " cuase switch only gets one); AND also in my mainMethod() for calling the operationMehod(); itself? please let me know if i'm not clear? Thanx! main method: public class test { // Global Constants final static int MIN_NUMBER = 1; final static int MAX_PRIME = 10000; final static int MAX_FACTORIAL = 12; final static int MAX_LEAPYEAR = 4000; //Global Variables static int a,b,c; public static void main (String[] args) { for(int i =0; i< args.length; i++){} if(validateInput(args[0],args[1],args[2])){ performOperations(); } } //Validate User Input public static boolean validateInput(String num1,String num2,String num3){ boolean isValid = false; try{ try{ try{ a = Integer.parseInt(num1); if(!withinRange(a,MIN_NUMBER, MAX_PRIME)) { System.out.println("The entered value " + num1 +" is out of range [1 TO 10000]."); } isValid = true; } catch(Exception ex) { System.out.println("The entered value " + num1 + " is not a valid integer. Please try again."); } b = Integer.parseInt(num2); if(!withinRange(b,MIN_NUMBER, MAX_FACTORIAL)) { System.out.println("The entered value " + num2 +" is out of range [1 TO 12]."); } isValid = true; } catch(Exception ex) { System.out.println("The entered value " + num2 + " is not a valid integer. Please try again."); } c = Integer.parseInt(num3); if(!withinRange(c,MIN_NUMBER, MAX_LEAPYEAR)) { System.out.println("The entered value " + num3 +" is out of range [1 TO 4000]."); } isValid = true; } catch(Exception ex) { System.out.println("The entered value " + num3 + " is not a valid integer. Please try again."); } return isValid; } //Check the value within the specified range private static boolean withinRange(int userInput ,int min, int max){ boolean isInRange = true; if(userInput < min || userInput > max){ isInRange = false; } return isInRange; } //Perform operations private static void performOperations(int userInput) { switch(userInput) { case 1: // count Prime numbers countPrimes(a); break; case 2: // Calculate factorial getFactorial(b); break; case 3: // find Leap year isLeapYear(c); break; } } // Verify Prime Number private static boolean isPrime(int prime) { for(int i = 2; i <= Math.sqrt(prime) ; i++) { if ((prime % i) == 0) { return false; } } return true; } // Calculate Prime private static int countPrimes(int userInput){ int count =0; for(int i=userInput; i<=MAX_PRIME; i++) { if(isPrime(i)){ count++; } } System.out.println("Exactly "+ count + " prime numbers exist between "+ a + " and 10,000."); return count; } // Calculate the factorial value private static int getFactorial(int userInput){ int ans = userInput; if(userInput >1 ){ ans*= (getFactorial(userInput-1)); //System.out.println("The value of "+ b +"! is "+ getFactorial(userInput)); } return ans; } // Determine whether the integer represents a leap year private static boolean isLeapYear(int userInput){ if (userInput % 4 == 0 && userInput % 400 == 0 && userInput % 100 ==0){ System.out.println("The year "+ c +" is a leap year"); } else { System.out.println("The year "+ c +" is a not leap year"); } return false; } }

    Read the article

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