Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

Page 24/448 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Checking version of Applications installed in ~/Applications with unknown username

    - by ridogi
    I'd like to check the version of Firefox through Apple Remote Desktop of all managed computers. I have written this, but it only checks for Firefox in /Applications /bin/cat /Applications/Firefox.app/Contents/Info.plist | grep -A 1 CFBundleShortVersionString | grep string | sed 's/[/]//' | sed 's/<string>//g' For standard users Firefox auto update breaks if it is in /Applications so I instead have it installed in ~/Applications I'd like to check that copy (if it exists), but I can't specify the path in the command since it is unique to each computer. For example: /Users/jon/Applications/Firefox.app /Users/arya/Applications/Firefox.app Presumably I want to use find and pipe the result to my command. This should work for 10.6 through 10.8

    Read the article

  • HAProxy, health checking multiple servers with different host names

    - by Marco Bettiolo
    I need to load balance between multiple running servers with different host names. I cannot set-up the same virtual host on each one. Is it possible to have only one listen configuration with multiple server and make the Health Checks apply the http-send-name-header Host directive? I am using HAProxy 1.5. I came up with this working haproxy.cfg, as you can see, I had to set a different hostname for each health check as the health check ignores the http-send-name-header Host. I would have preferred to use variables or other methods and keep things more concise. global log 127.0.0.1 local0 notice maxconn 2000 user haproxy group haproxy defaults log global mode http option httplog option dontlognull retries 3 option redispatch timeout connect 5000 timeout client 10000 timeout server 10000 stats enable stats uri /haproxy?stats stats refresh 5s balance roundrobin option httpclose listen inbound :80 option httpchk HEAD / HTTP/1.1\r\n server instance1 127.0.0.101 check inter 3000 fall 1 rise 1 server instance2 127.0.0.102 check inter 3000 fall 1 rise 1 listen instance1 127.0.0.101:80 option forwardfor http-send-name-header Host option httpchk HEAD / HTTP/1.1\r\nHost:\ www.example.com server www.example.com www.example.com:80 check inter 5000 fall 3 rise 2 listen instance2 127.0.0.102:80 option forwardfor http-send-name-header Host option httpchk HEAD / HTTP/1.1\r\nHost:\ www.bing.com server www.bing.com www.bing.com:80 check inter 5000 fall 3 rise 2

    Read the article

  • Web service for checking out / leasing a token

    - by JP Slavinsky
    I run a web site on AWS that has a number of web servers (say 4 of them) running behind a load balancer. For this particular web site, I have one license key of New Relic for doing instrumentation. At any one time, I only want one of the 4 web servers to be using the key. If that server goes offline, I want one of the remaining web servers to be able to begin using the license key. Does anyone know of a service that would let me manage this process? The service would not particularly need to store the key itself but rather just manage the fact that only one web server can lease out the right to use the key at any time. Something where the web servers would have to come back every few minutes and renew their lease, and if they don't it becomes available to someone else. I just realized I could maybe accomplish a hacked version of this using a file on S3, but that doesn't prevent race conditions / etc and is definitely hackish. Any thoughts welcome. FWIW, this site is built on Ruby on Rails. Thanks! JP

    Read the article

  • Why don't we store the syntax tree instead of the source code?

    - by Calmarius
    We have a lot of programming languages. Every language is parsed and syntax checked before translated into code so an abstract syntax tree is built. We have this abstract syntax tree, why don't we store this syntax tree instead of the source code (or next to the source code)? By using an AST instead of the source code. Every programmer in a team can serialize this tree to any language, they want (with the appropriate context free grammar) and parse back to AST when they finished. So this would eliminate the debate about the coding style questions (where to put the { and }, where to put whitespace, indentation, etc.) What are the pros and cons of this approach?

    Read the article

  • Cron job checking for changes in Git repository

    - by HNygard
    We have just moved our server configs to a Git repository. Therefore there should not be any changes in any of the repository folders. I was thinking about how I could set up a cron job to check for any uncommited changes. How could a cron job be set up to check for changes in a Git repository? Greping the output of the git status command might just do it. Grep and cron jobs are not my strong side. Here are some sample outputs from git status: Standing the folder containing the git repository (e.g. /path/gitrepo/) with changed files: $ git status # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: apache2/sites-enabled/000-default # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # apache2/conf.d/test no changes added to commit (use "git add" and/or "git commit -a") Standing in the folder when there is no changes: $ git status # On branch master nothing to commit (working directory clean) Update: Synced up with origin is not important. There should be no local changes. Local files that must be in place go into the .gitignore file. In addition to the server configs there are also git repos for content (static web sites, web apps, wordpress, etc). None of the repositories should have local changes. We might use Puppet in the long run since its being used for development of one of the web apps.

    Read the article

  • Checking for valid document files

    - by sweb
    I need a simple way to check if my files are valid documents (pdf, doc, docx, ppt, pptx, xls, xlsx, odt, ods, odp and etc). I can't use file because magic does not work well at all. For example, for PDF files, this is my output. sweb@sweb-laptop: /media/files/ebooks/PDF and CHM$ file --mime *. Pdf PHP 5 for Dummies. Pdf: application/pdf; charset=binary PHP 6 and MySQL 5 for Dynamic Web Sites. Pdf: application/octet-stream; charset=binary PHP6 and MySQL Bible. Pdf: application/pdf; charset=binary PHP6.pdf: application/octet-stream; charset=binary PHP and MySQL for Dummies SE. Pdf: application/pdf; charset=binary For example, I use abiword – which is a good tool – but it converts any format. It doesn't check for valid documents: abiword --to=txt --to-name=output.txt audio.mp3 Is there any command available to check for valid documents then?

    Read the article

  • Checking that tasks are executed

    - by homer5439
    I'm not sure how to explain this. Once one starts having dozens or hundres of servers, each running some sort of periodic jobs (mostly from cron), there is a problem of making sure (or as sure as possible) that these tasks are actually ran. I mean, I get an email if a job fails fails, and no mail if it succeeds, but also no mail if it doesn't run for whatever reason. Sure, I could change them and have them send a "successfully ran" email, only to be flooded by mails that most of the time I don't want to see. Basically, I want to be notified only if: a task ran and failed a task didn't run at the expected time. Is there a way to do this?

    Read the article

  • Creating a Anti-Virus softwre for URL Checking in my Website and also checking the data in the URL...

    - by Rezu
    If we give the anti-virus a URL it should be able to scan it and give us a report, Else, it should be able to scan the folder that we put all the links into... i.e. if we download the entire content of the webpage from the 10 Child links... and 1 parent webpage... and put them into a folder, the anti-virus solution should be able to scan all the 10 CHild and 1 Parent data.. and give us a report, Else, the anti-virus solution should be able to scan any incoming virus in any file or entity that is coming into our server and generate the report for that file, Please help me thanks in advance...

    Read the article

  • malloc: error checking and freeing memory

    - by yCalleecharan
    Hi, I'm using malloc to make an error check of whether memory can be allocated or not for the particular array z1. ARRAY_SIZE is a predefined with a numerical value. I use casting as I've read it's safe to do so. long double *z1 = (long double *)malloc(sizeof (long double) * ARRAY_SIZE); if(z1 == NULL){ printf("Out of memory\n"); exit(-1); } The above is just a snippet of my code, but when I add the error checking part (contained in the if statement above), I get a lot of compile time errors with visual studio 2008. It is this error checking part that's generating all the errors. What am I doing wrong? On a related issue with malloc, I understand that the memory needs to be deallocated/freed after the variable/array z1 has been used. For the array z1, I use: free(z1); z1 = NULL; Is the second line z1 = NULL necessary? Thanks a lot...

    Read the article

  • Checking for nil in view in Ruby on Rails

    - by seaneshbaugh
    I've been working with Rails for a while now and one thing I find myself constantly doing is checking to see if some attribute or object is nil in my view code before I display it. I'm starting to wonder if this is always the best idea. My rationale so far has been that since my application(s) rely on user input unexpected things can occur. If I've learned one thing from programming in general it's that users inputting things the programmer didn't think of is one of the biggest sources of run-time errors. By checking for nil values I'm hoping to sidestep that and have my views gracefully handle the problem. The thing is though I typically for various reasons have similar nil or invalid value checks in either my model or controller code. I wouldn't call it code duplication in the strictest sense, but it just doesn't seem very DRY. If I've already checked for nil objects in my controller is it okay if my view just assumes the object truly isn't nil? For attributes that can be nil that are displayed it makes sense to me to check every time, but for the objects themselves I'm not sure what is the best practice. Here's a simplified, but typical example of what I'm talking about: controller code def show @item = Item.find_by_id(params[:id]) @folders = Folder.find(:all, :order => 'display_order') if @item == nil or @item.folder == nil redirect_to(root_url) and return end end view code <% if @item != nil %> display the item's attributes here <% if @item.folder != nil %> <%= link_to @item.folder.name, folder_path(@item.folder) %> <% end %> <% else %> Oops! Looks like something went horribly wrong! <% end %> Is this a good idea or is it just silly?

    Read the article

  • Python Error-Checking Standard Practice

    - by chaindriver
    Hi, I have a question regarding error checking in Python. Let's say I have a function that takes a file path as an input: def myFunction(filepath): infile = open(filepath) #etc etc... One possible precondition would be that the file should exist. There are a few possible ways to check for this precondition, and I'm just wondering what's the best way to do it. i) Check with an if-statement: if not os.path.exists(filepath): raise IOException('File does not exist: %s' % filepath) This is the way that I would usually do it, though the same IOException would be raised by Python if the file does not exist, even if I don't raise it. ii) Use assert to check for the precondition: assert os.path.exists(filepath), 'File does not exist: %s' % filepath Using asserts seems to be the "standard" way of checking for pre/postconditions, so I am tempted to use these. However, it is possible that these asserts are turned off when the -o flag is used during execution, which means that this check might potentially be turned off and that seems risky. iii) Don't handle the precondition at all This is because if filepath does not exist, there will be an exception generated anyway and the exception message is detailed enough for user to know that the file does not exist I'm just wondering which of the above is the standard practice that I should use for my codes.

    Read the article

  • Checking if any of a list of values falls within a table of ranges

    - by Conspicuous Compiler
    I'm looking to check whether any of a list of integers fall in a list of ranges. The ranges are defined in a table defined something like: # Extra Type Field Default Null Key 0 int(11) rangeid 0 NO PRI 1 int(11) max 0 NO MUL 2 int(11) min 0 NO MUL Using MySQL 5.1 and Perl 5.10. I can check whether a single value, say 7, is in any of the ranges with a statement like SELECT 1 FROM range WHERE 7 BETWEEN min AND max If 7 is in any of those ranges, I get a single row back. If it isn't, no rows are returned. Now I have a list of, say, 50 of these values, not stored in a table at present. I assemble them using map: my $value_list = '(' . ( join ', ', map { int $_ } @values ) . ')' ; I want to see if any of the items in the list fall inside of any of the ranges, but am not particularly concerned with which number nor which range. I'd like to use a syntax such as: SELECT 1 FROM range WHERE (1, 2, 3, 4, 5, 6, 7, 42, 309, 10000) BETWEEN min AND max MySQL kindly chastises me for such syntax: Operand should contain 1 column(s) I pinged #mysql who were quite helpful. However, having already written this up by the time they responded and thinking it'd be helpful to fix the answer in a more permanent medium, I figured I'd post the question anyhow. Maybe SO will provide a different solution?

    Read the article

  • odd behavior when checking if radio button selected in jQuery

    - by RememberME
    I had the following check in my jQuery which I thought was working fine to see if a radio button was checked. if ($("input[@name='companyType']:checked").attr('id') == "primary") { ... } Here's the radiobuttons: <p> <label>Company Type:</label> <label for="primary"><input onclick="javascript: $('#sec').hide('slow');$('#primary_company').find('option:first').attr('selected','selected');" type="radio" name="companyType" id="primary" checked />Primary</label> <label for="secondary"><input onclick="javascript: $('#sec').show('slow');" type="radio" name="companyType" id="secondary" />Subsidiary</label> </p> Then, it suddenly stopped working (or so I thought). I did some debugging and finally realized that it was returning an id of "approved_status". Elsewhere on my form I have a checkbox called "approved_status". I realized that when I originally tested this, I must have testing it on records where approved_status is false. And, now most of my approved_statuses are true/checked. I changed the code to this: var id = $("input:radio[@name='companyType']:checked").attr('id'); alert(id); if (id == "primary") { And it's now properly returning "primary" or "secondary" as the id. So, it is working, but it seems that it's not checking the name at all and now just checking radio buttons. I just want to know for future use, what's wrong with the original code b/c I can see possibly having 2 different radio sets on a page and then my new fix probably wouldn't work. Thanks!

    Read the article

  • Checking Selected Radio Button after POST

    - by coffeeaddict
    I've been using ASP.NET controls which perform a lot of the manual for you. But I'm going back to the basics, what everyone else does. I'm using standard input tags. So for example if I have a radio button group and I select a button. When the form submits and does a POST back to whatever action="MyPage.aspx" then to grab and check the radio button's value that was selected is it always done like this below? <label><input type="radio" name="rbGroup" value='<%# ((Action)Container.DataItem).ID %>'/><%# ((Action)Container.DataItem).Name %></label> So here I'm appending the ID to the value. And then when it hits the page that my action specifies, I'm checking to see which was selected by trimming off and getting that ID from the value: string selection = Request.Form["rbGroup"]; string dbRecordIdSelected = int.Parse(selection.Substring(1)); so now I can check the id they selected...that is the ID of the db record that gave that selected radio it's name. Is that how you basically always check what radio was selected by checking the name/value pair that comes across for that selected radioButton group name? And then you can append stuff like IDs or whatever you want to grab and parse out to then do additional logic on the server-side once that header reaches the server and your specified page in the action attribute? The above code is not production code, just something to explain what I'm talking about.

    Read the article

  • INNER JOIN syntax for mySQL using phpmyadmin

    - by David van Dugteren
    SELECT Question.userid, user.uid FROM `question` WHERE NOT `userid`=2 LIMIT 0, 60 INNER JOIN `user` ON `question`.userid=`user`.uid ORDER BY `question`.userid returns Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN User ON question.userid=user.uid ORDER BY question.userid' at line 5 Can't for the life of me figure out what I'm doing wrong here.

    Read the article

  • UITextView w/ Syntax Highlighting

    - by Travis
    Is there a common library, parser, etc. for Cocoa or Cocoa-Touch that can take a chunk of text and do the proper syntax highlighting? As a simple example, I'd like to have a UITextView that has C/C++ syntax highlighting.

    Read the article

  • How to use the AAA syntax to do an AssertWasCalled but ignore arguments

    - by Toran Billups
    I'm using the new AAA syntax and wanted to know the syntax to do the below and have the mock ignore the agruments. mockAccount.AssertWasCalled(account = account.SetPassword("dsfdslkj")); I think the below is how I would do this with the record/ replay model but I wanted to see if this could be done with AAA using 3.6 mockAccount.Expect(account = account.SetPassword("sdfdsf")).IgnoreArguments(); mockAccount.VerifyAllExpectations(); Thank you in advance

    Read the article

  • Getting syntax errors when building with python 3.1 and not with python 2.6

    - by mathan
    Hi All, Using Mac os X 10.6, python 3.1 and gcc 4.0 trying to build pyfsevent implemented in python2.6 by converting it to python 3.1. Wondering when getting the following errors while building in python 3.1 alone. Why not when building with python 2.6? error: syntax error before ‘CFFileDescriptorRef’ warning: no semicolon at end of struct or union error: syntax error before ‘}’ token warning: data definition has no type or storage clas

    Read the article

  • Sqlite table constraint - unique on multiple columns

    - by Rich
    I can find syntax "charts" on this on the sqlite website, but no examples and my code is crashing. I have other tables with unique constraints on a single column, but I want to add a constraint to the table on two columns. This is what I have that is causing a SQLiteException with the message "syntax error". CREATE TABLE name (column defs) UNIQUE (col_name1, col_name2) ON CONFLICT REPLACE I'm doing this based on the following: table-constraint

    Read the article

  • perl + export param in to perl syntax in shell script

    - by yael
    hi I have the following script that replace a param to b param and match only the c parameter in line how to change the perl syntax: "if /$c/" in order to export c param to the follwoing perl syntax !/bin/bash export a='@d&' export b='new text' export c='bla bla' echo $c | perl -pe 'next if /^#/; s/(^|\s)\Q$ENV{a}\E(\s|$)/$1$ENV{b}$2/ if /$c/'

    Read the article

  • SQL Query to truncate table in IBM DB2

    - by Cshah
    Hi, Can any one give me the syntax to truncate a table in IBM DB2. I m running the following command: truncate table tableName immediate; The eror is DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=table;truncate ;JOIN , DRIVER=3.50.152 Message: An unexpected token "table" was found following "truncate ". Expected tokens may include: "JOIN ".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.50.152 The syntax matches the one specified in the reference docs of IBM : http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_sql_truncate.htm

    Read the article

  • bing api 2.0 sdk json samples got syntax error in Firefox browser

    - by Jazure
    I just downloaded the Bing API 2.0 SDK. There are several html files in Bing API 2.0 SDK\Samples\JSON directory. I replaced the AppId in the JavaScript with my new AppId. These pages run fine in IE but I got 'syntax error' in Firefox, Firebug console. Does anyone have similar issues? What is in the page that is causing the 'syntax error'? Thank you very much. Jazure

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >