Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 149/297 | < Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >

  • Code coverage (c++ code execution path)

    - by Poni
    Let's say I have this code: int function(bool b) { // execution path 1 int ret = 0; if(b) { // execution path 2 ret = 55; } else { // execution path 3 ret = 120; } return ret; } I need some sort of a mechanism to make sure that the code has gone in any possible path, i.e execution paths 1, 2 & 3 in the code above. I thought about having a global function, vector and a macro. This macro would simply call that function, passing as parameters the source file name and the line of code, and that function would mark that as "checked", by inserting to the vector the info that the macro passed. The problem is that I will not see anything about paths that did not "check". Any idea how do I do this? How to "register" a line of code at compile-time, so in run-time I can see that it didn't "check" yet? I hope I'm clear.

    Read the article

  • Why can't PHP script write a file on server 2008 via command line or task scheduler?

    - by rg89
    I have a PHP script. It runs well when I use a browser. It writes an XML file in the same directory. The script takes ~60 seconds to run, and the resulting XML file is ~16 MB. I am running PHP 5.2.13 via FastCGI on Server 2008 64 bit. I created a task in task scheduler to run c:\php5\php.exe "D:\inetpub\tools\something.php" No error returned, but no file created. If I run this same path and argument at a command line it does not error and does not create the file. I am doing a simple fopen fwrite fclose to save the contents of a php variable to a .xml file, and the file only gets created when the script is run through the browser. Thanks

    Read the article

  • Google Visualization legend format Jquery ui tabs

    - by Liam
    I've got an issue when using the Google Visualization api line chart with Jquery ui tabs. I've got two graphs on two tabs. The first graph, which is visible by default displays fine: the second chart on the hidden tab seems to be messing up the key: I've tried changing the options but nothing I do seems to make any difference. Here are my options: options = { 'title': title, titleTextStyle: { color: color, fontSize: 20 }, 'width': 950, 'height': 400, hAxis: { minorGridlines: { count: x } }, chartArea: { width: 880 }, legend: { position: 'bottom', textStyle: { fontSize: 10 } } }; // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.LineChart(document.getElementById(divId)); chart.draw(data, options); $('#tabs').tabs(); any thoughts on what is causing this and how to prevent it?? Edit If I remove the tabs() call it displays correctly. As per answer below from @Vipul tried setting the div to a fixed width, no difference.

    Read the article

  • Paypal subscription API - transaction variables not POSTed

    - by morpheous
    I am writing a payments system based around paypal, I am using the HTML 'API'. I am passing the following form fields to PayPal: 'rm' = 2 'return = http://www.example.com/payment-handler.php?token=sometoken Where 'token' is a token I generated. According to the paypal documentation, a return method (rm) of 2 indicates to Paypal that the transaction data be posted back to the callback url using the POST method. When processing items using 'buy_now' buttons, the transaction items are correctly POSTed to my callback url (payment-handler.php), but for 'subscribe' operations, although the callback url is called, no POST data is sent to the url, and also, the 'token' field is missing. Instead, there is a parameter called 'auth'. I cant see anything in the paypal docs about a 'auth' field - so I dont know whats generating it and if I can reliably using it. Can anyone shed some light on this?

    Read the article

  • groovy variable function

    - by bsreekanth
    I'm not even sure about how to title this qn. But, hope there is an easy way to do it in dynamic language like groovy. say I have a class Service, where I delegate the business logic. the methods in it are funA(), funB()... funX(). Now I have a controller class, where I call the service closure, which can be invoked like service.funA() . Now based on a variable (which can have values A, B ... X), I need to cal the correct service closure. Basically to avoid writing lot of if conditional statements. Something like service."fun+var"() would do. I'm not sure whether it is possible to substitute variable in closure (function)name. or any way by passing function (name) as a parameter...not sure I think PHP has a similar feature http://php.net/manual/en/functions.variable-functions.php thanks for any pointer..

    Read the article

  • jQuery AJAX not redirecting?

    - by MidnightLightning
    I have a simple PHP page (for testing) that simply calls header("Location: http://www.example.com");exit;, which resides on the same server, in the same directory as another file with the following jQuery Javascript: $(document).ready(function() { jQuery.ajax({ type : 'GET', url : 'bounce.php', error : function(xhr, status, error) { console.log("ERROR: ", xhr, xhr.status, xhr.getAllResponseHeaders()); }, complete : function(xhr, status) { // Get headers of the response console.log("COMPLETE: ", xhr, xhr.status, xhr.getAllResponseHeaders()); } }); }); I was expecting (from several other StackOverflow responses) for the xhr.status to return "302", but instead the AJAX call is triggering the "error" event (and then the "complete" event), and xhr.status is returning 0 (zero), and .getAllResponseHeaders() is coming back null (in both the error, and complete functions). Firebug is showing the "302 Moved Temporarily", and the response headers. So why is this triggering the error event, and not passing along the proper 302 code, and headers? Is this something to do with the Same Origin since the bouncing script and the fetching script are both on the same server? Is this jQuery or Javascript's fault?

    Read the article

  • Custom Display Form with Custom Workflow button

    - by Ifi
    I have created a new custom list form that will show 4 fields on the page from a Custom List called "Shipment". I have added Form Action button that I would like to run a custom action that is set inside of a Workflow. Currently, the form displays the fields for "Manifest Number", "Pickup Location", "Delivery Location", & "Scheduled Pickup Time". When the user clicks the Form Action button, what I want the Workflow to do is go to the ID field of the displayed content in the Form and change the value of the "Picked Up" column from No to Yes. The problem I am having is passing the ID of the displayed information from the Form to the Workflow as a variable. I can get the "Picked Up" column to update if I specify the value in the "Update List Item" window under the "Find the List Item" section, but I cannot figure out how to do this dynamically from the Form

    Read the article

  • Android - Convert Color Resource to Color in Domain Object

    - by Steve
    I have a domain object, where I created a method to return a text color based on the internal state of the domain object. I have defined the colors in a color.xml file as resources. The problem I have now, is that I would like to return a Color object instead of a resource ID from the domain object method. This way I can set the text color of a TextView by just calling textView.setTextColor(domainObj.getTextColor()) since it expects a Color object and not a resource ID. Currently, in an Activity, I can call getResources().getColor(domainObj.getTextColorResource()) to convert a resource ID to a color, but I would like this done in the domain object and I am not sure how I would do this when I do not have access to the getResources method. Are there any cleaner options than passing in a Resource object into the method, or domain object? Thanks

    Read the article

  • C# and MySQL .NET Connector - Any way of preventing SQL Injection attacks in a generic class?

    - by John M
    My idea is to create some generic classes for Insert/Update/Select via a C# (3.5) Winforms app talking with a MySQL database via MySQL .NET Connector 6.2.2. For example: public void Insert(string strSQL) { if (this.OpenConnection() == true) { MySqlCommand cmd = new MySqlCommand(strSQL, connection); cmd.ExecuteNonQuery(); this.CloseConnection(); } } Then from anywhere in the program I can run a query with/without user input by just passing a SQL query string. Reading around on SO is starting to give me the indication that this may lead to SQL injection attacks (for any user-input values). Is there anyway of scrubbing the inputted strSQL or do I need to go and create individual parameterized queries in every method that needs to do a database function?

    Read the article

  • Does removing admin rights really mitigate 90% of Critical Windows 7 vulnerabilities found to date?

    - by Jordan Weinstein
    Beyondtrust.com published a report, somewhat recently, claiming among other quite compelling things, "90% of Critical Microsoft Windows 7 Vulnerabilities are Mitigated by Eliminating Admin Rights" Other interesting 'facts' they provide say that these are also mitigated by NOT running as a local admin: 100% of Microsoft Office vulnerabilities reported in 2009 94% of Internet Explorer and 100% of IE 8 vulnerabilities reported in 2009 BUT, reading the first page or so of the report I saw this line: A vulnerability is considered mitigated by removing administrator rights if the following sentence is located in the Security Bulletin’s Mitigating Factors section, ?Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights. could be sounds pretty weak to me so and I wondered how valid all this really is. I'm NOT trying to say it's not safer to run without admin rights, I think that is well known. I just wonder if these stats are something you would use as ammo in an argument, or use to sell a change like that (removing users as local admins) to business side? Thoughts? Link to the report (pdf) [should this supposed to be a community wiki?]

    Read the article

  • Workflow foundation 4.0 message correlation and error reporting

    - by Lygpt
    I have a workflow service that runs and performs a number of different operations (such as web service calls). If one of these operations fails I call an error reporting web service to notify a seperate system that one of my workflow operations has failed. As the error could be something like the web service being down, I loop and retry this operation until it works. There can be times though when the data I'm passing to this web service is faulty and it needs changing. So I need to be able to hook into this running (but delayed) workflow and change local workflow variables and then re-run the operation. I've looked at message correlation in workflow 4.0 to achieve this but because the delay activity is active in my running workflow instance, any second service call doesn't do anything (it's like the delay activity is blocking any other requests). I've tried setting 'CanCreateInstance' to both true and false but it doesn't help. Thanks!

    Read the article

  • Lost in UTF-8 hell. (Django and Python)

    - by user140314
    I am working through the Django RSS reader project here. The RSS feed will read something like "OKLAHOMA CITY (AP) — James Harden let". The RSS feed's encoding reads encoding="UTF-8" so I believe I am passing utf-8 to markdown in the code snippet below. The em dash is where it chokes. I get the Django error of "'ascii' codec can't encode character u'\u2014' in position 109: ordinal not in range(128)" which is an UnicodeEncodeError. In the variables being passed I see "OKLAHOMA CITY (AP) \u2014 James Harden". The code line that is not working is: content = content.encode(parsed_feed.encoding, "xmlcharrefreplace") I am using markdown 2.0, django 1.1, and python 2.4. What is the magic sequence of encoding and decoding that I need to do to make this work? Thanks.

    Read the article

  • Is that a RESTFUL MVC Web Service?

    - by vsj
    I am aware of Web Services and WCF but I have generic question with services.I have a ASP.NET MVC Application which does some basic functionality. I just have a controller in which I am passing it the records and serializing the information to XML using XML Serializer. Then I return this information to the browser and it displays me the XML i got from the Controller Action. So I get the XML representation of my Class(Database Object) in XML and I am to give the URL of this application to the client and access and pull the information. Is this a Service then? I mean in the end all the Clients need is the Xml representation through services also right? I am not that experienced and probably being very silly but please help me out...if I provide xml this way to the client is that a Service ? Or is there something I need to undersatand here?.

    Read the article

  • Unexpected behavior in Bash

    - by cYrus
    From man bash: A simple command is a sequence of optional variable assignments followed by blank-separated words and redirections, and terminated by a control operator. The first word specifies the command to be executed, and is passed as argument zero. The remaining words are passed as arguments to the invoked command. So it's perfectly legal to write: foo=bar echo $foo but it doesn't work as I expect (it prints just a newline). It's quite strange to me since: $ foo=bar printenv foo=bar TERM=rxvt-unicode [...] Could someone please explain me where I'm doing wrong?

    Read the article

  • How to handle HTTPStatus Response 201 with AS3 / Flash / SWFUpload

    - by Praveen Sharma
    Hey all. I'm using SWFUpload on a Rails site to allow for MP3 Uploads direct to Sound Cloud. To avoid having to first upload a large file to my server and push to Sound Cloud, I'm hitting their API directly via SWFUpload, passing necessary OAuth token data. Everything works - EXCEPT - Flash can't handle the HTTP response code that Sound Cloud's API returns (201). This ALWAYS triggers an unhandled IO Error with Flash. Even though SWFUpload allows me to override that in the JS, it breaks any response data (the URI to the uploaded file). Does anyone know how I could somehow intercept the 201 code so that I can make it a 200 code for flash? I'm at a loss at how I can avoid this IO Error. I've tried try/catch statements around everything and have even recompiled SWFUpload to try new things to no avail. Any help would be greatly appreciated.

    Read the article

  • Add a custom Ribbon group to an existing custom Ribbon group in word 2007

    - by SwiftLion
    Hi How can I add a new group to an existing (3rd party) custom ribbon tab add-in? I know that I can add to out of box ribbons by specifying the Tabs idMSo value but how do I do that for a custom ribbon tab. I have already tried the ID value of the custom ribbon, but it juts duplicates the ribbon? have also tried idMso and idQ attributes passing in the required custom tab Id but no success. I can add it to out of box tab group by specifying the idMso value but not to custom tab regards

    Read the article

  • Sorting and indexing into a list in a Django template?

    - by slypete
    How can you perform complex sorting on an object before passing it to the template? For example, here is my view: @login_required def overview(request): physicians = PhysicianGroup.objects.get(pk=physician_group).physicians for physician in physicians.all(): physician.service_patients.order_by('bed__room__unit', 'bed__room__order', 'bed__order') return render_to_response('hospitalists/overview.html', RequestContext(request, {'physicians': physicians,})) The physicians object is not ordered correctly in the template. Why not? Additionally, how do you index into a list inside the template? For example, (this doesn't work): {% for note_type in note_types %} <div><h3>{{ note_type }}</h3> {% for notes in note_sets.index(parent.forloop.counter0) %} #only want to display the notes of this note_type! {% for note in notes %} <p>{{ note }}</p> {% endfor %} {% endfor %} </div> {% endfor %}

    Read the article

  • Postfix sendmail -f configuration

    - by William
    I have Postfix installed on two servers. One of them writes e-mail (satellite) and the other one delivers the e-mails (smarthost). When I write e-mail from the satellite server I'm using the sendmail command. My problem is that when e-mail arrives the Return-Path is set to the user@hostname where user is the user that is running sendmail and hostname is the servers hostname. If I use the parameter -f with sendmail I change that, but I'm hoping there is a way to do it in a configuration file for Postfix. Is this possible or should I just deal with having to configure all my software to add the -f argument? Thanks in advanced.

    Read the article

  • "cannot concatenate 'str' and 'list' objects" keeps coming up :(

    - by ratce003
    I'm writing a python program and passing in a html template but an error keeps coming up, "cannot concatenate 'str' and 'list' objects" here is is the program: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgi import cgitb cgitb.enable() def template(file, **vars): return open(file, 'r').read() % vars print "Content-type: text/html\n" print form = cgi.FieldStorage() # instantiate only once! num_1 = form.getfirst('num_1') num_2 = form.getfirst('num_2') int1r = str(num_1) int2r = str(num_2) def calc_range(int2r, int1r): start = range(int2r, int1r + 1) end = range(1, int2r) return start+end int1 = int(int1r) int2 = int(int2r) out_str = '' for i in range(0, int1): first_line_num = (int2 + i) % int1 if first_line_num == 0: first_line_num = int1 line = calc_range(first_line_num, int1) out_str += line print template('results.html', output=out_str, title="Latin Squares")

    Read the article

  • Generate PDF - how to create paged HTML content beforehand?

    - by Alt_Doru
    My task is to create ready-to-print invoices from a .NET web app. I am already generating the printer-friendly HTML for an invoice - it consists of an invoice header (that will actually need to appear on each printed page) and invoice positions (that may span multiple printed pages). Now, my task is to generate a PDF server-side, populate a header on each of its pages, then populate its pages with invoice positions. I need to generate the PDF from the existing HTML data - by simply passing HTML input to the PDF generator library. I've started using ABCPDF - I am using the AddImageHtml method. The problem I have is that ABCPDF seems to expect me to supply HTML content already paged. So, it won't work correctly when I feed it HTML content that would span on more than 1 PDF page. So, my question is - do you have any suggestions on making this work with ABCPDF? Or, more generally speaking, what other tools/approaches would you use for this - generating PDF doc with headers/footers from HTML input? Thanks

    Read the article

  • Help with linq to sql compiled query

    - by stackoverflowuser
    Hi I am trying to use compiled query for one of my linq to sql queries. This query contains 5 to 6 joins. I was able to create the compiled query but the issue I am facing is my query needs to check if the key is within a collection of keys passed as input. But compiled queries do not allow passing of collection (since collection can have varying number of items hence not allowed). For instance input to the function is a collection of keys. Say: List<Guid> InputKeys List<SomeClass> output = null; var compiledQuery = CompiledQueries.Compile<DataContext, IQueryable<SomeClass>>( (context) => from a in context.GetTable<A>() where InputKeys.Contains(a.Key) select a); using(var dataContext = new DataContext()) { output = compiledQuery(dataContext).ToList(); } return output; Is there any work around or better way to do the above?

    Read the article

  • SqlCommand() ExecuteNonQuery() truncates command text.

    - by H. Abraham Chavez
    I'm building a custom db deployment utility, I need to read text files containing sql scripts and execute them against the database. Pretty easy stuff, so far so good. However I've encountered a snag, the contents of the file are read successfully and entirely, but once passed into the SqlCommand and then executed with SqlCommand.ExecuteNonQuery only part of the script is executed. I fired up Profiler and confirmed that my code is not passing all of the script. private void ExecuteScript(string cmd, SqlConnection sqlConn, SqlTransaction trans) { SqlCommand sqlCmd = new SqlCommand(cmd, sqlConn, trans); sqlCmd.CommandType = CommandType.Text; sqlCmd.CommandTimeout = 9000000; // for testing sqlCmd.ExecuteNonQuery(); } // I call it like this, readDMLScript contains 543 lines of T-SQL string readDMLScript = ReadFile(dmlFile); ExecuteScript(readDMLScript, sqlConn, trans);

    Read the article

  • Using OpenGL drawing operations in an object-oriented setting?

    - by Lion Kabob
    I've been plowing through basic shaders and whatnot for an application I'm writing, and I've been having trouble figuring out a high-level organization for the drawing calls. I'm thinking of having a singleton class which implements a number of basic drawing operations, taking data from "user" classes and passing that to the appropriate opengl calls. I'm wondering how people do this when writing their own applications, as the internet is chock full of basic "Your first shader" tutorials, but very little on suggested organization of drawing code. My particular environment is targeted at iPad/OpenGL ES 2.0, but I think the question stands for most environments.

    Read the article

  • How many cron jobs are too many?

    - by guitar-
    I have a couple of cron jobs for basic maintenance which aren't very resource-intensive. I also have custom task scheduling (which is just calling a .php file and passing information via GET, ie: cronjob.php?param1=param ...). These can add up pretty quickly. These just call system commands and run external programs (Nmap is one of them). They usually don't take long either. Anyway, can anyone tell me, roughly what point is too many? I know it's hard to say since it depends on what job is being run and how often, but at what point does the crontab program start "struggling"? Anyone have any idea? Thanks.

    Read the article

  • android custom map marker bounds

    - by max4ever
    Hello i am using a resized version of this marker( http://www.clker.com/clipart-orange-pin-4.html ) for showing markers in google maps on android. The problem is i don't know how to make the marker point match the coordinates. The arrow point is at about 1/5 of the Width coordinates and MAX of the Height. here is my class public class GestionaleItemizedOverlay extends com.google.android.maps.ItemizedOverlay { public GestionaleItemizedOverlay(Drawable defaultMarker, Context context) { //super(boundCenterBottom(defaultMarker)); super(boundCenter(defaultMarker)); this.mContext = context; } ... And this this.marker_poi = this.getContext().getResources().getDrawable(R.drawable.marker); this.marker_poi.setBounds(this.marker_poi.getIntrinsicWidth() / 2, this.marker_poi.getIntrinsicHeight(), this.marker_poi.getIntrinsicWidth() / 2, 0); new GestionaleItemizedOverlay(this.poi, this.context); Do i need to setBounds on the marker before passing it to the constructor? and why does super(defaultMarker) makes all the markers not to show ?

    Read the article

< Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >