Search Results

Search found 21001 results on 841 pages for 'spelling check'.

Page 179/841 | < Previous Page | 175 176 177 178 179 180 181 182 183 184 185 186  | Next Page >

  • C error expected specifier-qualifier-list before ‘time_t’

    - by ambika
    I got the error from error.c:31: /usr/include/ap/mas.h:254: error: expected specifier-qualifier-list before ‘time_t’ make: *** [error.o] Error 1 Feedback We at least need to see line 31 of error.c and line 254 of mas.h, with preferably a few lines of context around each. This error may have nothing to do with how time_t is being declared. – John Bode Then I check in error.c (line no 31) -- #include "mas.h" then I check line no 254 in mas.h. in mas.h #include <sys/types.h> typedef struct _x{ time_t time; }x; Can anybody suggest where I am going wrong?

    Read the article

  • Git - Committing Machine Specific Configuration Files

    - by Gordon
    A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other developers will always accidentally check them back in and break someone else's configuration. A simple solution to this would be to just not check them in to Git, or even to additionally add a .gitignore entry for them. However, I find that it is much more elegant to have some sensible defaults in the file which the developer can modify to suit his needs. Is there an elegant way to make Git play nicely with such files? I would like to be able to modify a machine-specific configuration file and then be able to run "git commit -a" without checking that file in.

    Read the article

  • permutation need help to code

    - by Hunt
    Thank for your reply, first thing i wish to thank you for trying to help me out, and i have post this in few website also no one trying to help at all. For my code, what i wish to do is permutation count. it will count from top to bottom 1,2,3 1,2,3 1,2,3 output to 111 = 1 112 = 1 113 = 1 121 = 1 122 = 1 123 = 1 133 = 1 211 = 1 212 = 1 213 = 1 333 = 1 and continue till all number is count and also store to the array which can check how many count after all code will check the input number and count how many outcome and show the results with how many outcome and each have how many after permutation count. Its hard to do?. Anyway thank you for help.

    Read the article

  • Why is it a bad idea to use ClientLogin for web apps in the Google API?

    - by Onema
    I just picked up the Google API today to allow some users of our site to upload videos to our own organization YouTube account. I Don't want our users to know our user name and password, but rather give them the option if they want to upload videos to youtube or not. If they choose to do it, they check on a check box and hit the submit button. I keep seeing over, and over in the Developers guide that ClientLogin, which to me looks like the best option to implement what I want to do, is not a good idea for user authentication in web applicaitons. The "AuthSub for web applications" doesn't seem to be the best mechanism for what I want to implement! Any ideas on what to do? Thank you

    Read the article

  • C#, MEF - Sign trusted plugins for abuse reduction

    - by Marks
    Hi there. I have a program that is extendable by plugins using the Microsoft Extensibility Framework. But i dont want untrusted sources to give out plugins that may be insecure. So i want to sign the plugins (maybe with Visual Studio's built in signing) and check if the plugins are trustworthy at program start. I didn't find a way to check DLL signing from inside C#. And also there is the problem, that I load the plugins with a DirectoryCatalog. There is no way to tell, which plugin is from which file. Anyone knows a way to do this? Thanks for any help, Marks

    Read the article

  • How to create conditions in mysql (use of 'if')?

    - by Audel
    This code works fine to find an available room within certain date, but it does not work to show a room that has been booked and canceled The "hotel" has 4 rooms and 1 of them has been booked an canceled So even if I make a cancelation, the select method keeps giving me 3 results. Maybe because the second AND is still running. So basically what I need is check if the room is booked in the selected dates if it has been booked, check if its canceled if it has been canceled, or not booked display it. Otherwise not   SELECT RoomNo, NightCost FROM room, room_types, booking WHERE typeid = fk1_typeid and double_bed=1 and single_bed=0 AND canceled = '1' in (SELECT canceled from booking, room_booking where bookingid = fk2_bookingid) AND RoomNo not in (SELECT fk1_RoomNo FROM room_booking WHERE '2010-04-02' between Check_in and Check_Out or '2010-04-03' between Check_in and Check_Out) ; I tried to be as clear as possible, i will be around to give more details if needed

    Read the article

  • Find Date From Non Contiguous Ranges

    - by AGoodDisplayName
    I am looking to find an best way to find a date from date ranges that may or may not be contiguous (I am trying to avoid a cursor, or a heavy function if possible). Lets say I have hotel guests that come and go (check in, check out). I want to find the date that a certain guest stayed their 45th night with us. The database we use records the data as so: Create Table #GuestLog( ClientId int, StartDate DateTime, EndDate DateTime) Here is some data Insert Into #GuestLog Values(1, '01/01/2010', '01/10/2010') Insert Into #GuestLog Values(1, '01/16/2010', '01/29/2010') Insert Into #GuestLog Values(1, '02/13/2010', '02/26/2010') Insert Into #GuestLog Values(1, '04/05/2010', '06/01/2010') Insert Into #GuestLog Values(1, '07/01/2010', '07/21/2010') So far I can only think of solutions that involve functions with temp tables and crazy stuff like that, I feel like I'm over thinking it. Thanks ahead of time.

    Read the article

  • Most efficient way for testing links

    - by Burnzy
    I'm currently developping an app that is going through all the files on a server and checking every single hrefs to check wether they are valid or not. Using a WebClient or a HttpWebRequest/HttpWebResponse is kinda overkilling the process because it downloads the whole page each time, which is useless, I only need to check if the link do not return 404. What would be the most efficient way? Socket seems to be a good way of doing it, however I'm not quite sure how this works. Thanks for sharing your expertise!

    Read the article

  • Can I make a LaTeX macro 'return' a filename?

    - by drfrogsplat
    I'm writing my thesis/dissertation and since its an on-going work I don't always have the actual images ready for the figures I put into my document, but for various reasons want to automatically have it substitute a dummy figure in place when the included graphics file doesn't exist. E.g. I can do something like \includegraphics[width=8cm]{\chapdir/figures/fluxcapacitor} (where \chapdir is a macro for my 'current' chapter directory, e.g. \def\chapdir{./ch_timetravel} and if there's no ./ch_timetravel/figures/fluxcapacitor.jpg it'll insert ./commands/dummy.jpg instead. I've structured my macros (perhaps naïvely?) so that I have a macro (\figFileOrDummy) that determines the appropriate file to include by checking if the argument provided to it exists, so that I can call \includegraphics[properties]{\figFileOrDummy{\chapdir/figures/fluxcapacitor}}. Except I'm getting various errors depending on how I try to call this, which seem to suggest that I'm approaching the problem in a fundamentally flawed way as far as 'good LaTeX programming' goes. Here's the macro to check if the file exists (and 'return' either filename or the dummy filename): \newcommand{\figFileOrDummy}[1]{% % Figure base name (no extension) to be used if the file exists \def\fodname{#1}% \def\dummyfig{commands/dummy}% % Check if output is PS (.EPS) or PDF (.JPG/.PDF/.PNG/...) figures \ifx\pdfoutput\undefined% % EPS figures only \IfFileExists{\fodname.eps}{}{\def\fodname{\dummyfig}}% \else% % Check existence of various extensions: PDF, TIF, TIFF, JPG, JPEG, PNG, MPS \def\figtest{0}% flag below compared to this value \IfFileExists{\fodname.pdf}{\def\figfilenamefound{1}}{\def\figfilenamefound{0}}% \IfFileExists{\fodname.jpg}{\def\figfilenamefound{1}}{}% \IfFileExists{\fodname.png}{\def\figfilenamefound{1}}{}% % and so on... % If no files found matching the filename (flag is 0) then use the dummy figure \ifx\figfilenamefound\figtest% \def\fodname{\dummyfig}% \fi% \fi% % 'return' the filename \fodname% }% Alternatively, here's a much simpler version which seems to have similar problems: \newcommand{\figFileOrDummy}[1]{% \def\dummyfig{commands/dummy}% \dummyfig% } The \def commands seems to be processed after the expansion of the macro they're trying to define, so it ends up being \def {commands/dummy}... (note the space after \def) and obviously complains. Also it seems to treat the literal contents of the macro as the filename for \includegraphics, rather than resolving/expanding it first, so complains that the file '\def {commands/dummy}... .png' doesn't exist.. I've tried also doing something like \edef\figfilename{\figFileOrDummy{\chapdir/figures/fluxcapacitor}} to try to force it to make \figfilename hold just the value rather than the full macro, but I get an Undefined control sequence error complaining the variables I'm trying to \def in the \figFileOrDummy macro are undefined. So my question is either How do I make this macro expand properly?; or If this is the wrong way of structuring my macros, how should I actually structure such a macro, in order to be able to insert dummy/real figures automatically?; or Is there a package that already handles this type of thing nicely that I've overlooked? I feel like I'm missing something pretty fundamental here...

    Read the article

  • How to maintain status of gridview checkbox

    - by Royson
    Hi, On my form on left side i have tree-view with check-boxes and on right side grid-view with check-box column. Treeview shows all folders. if user clicked on treenode their files all displayed in gridview. If user checked some files and selects another node and return back it should display checked files as it is. How do i maintain grid-view checked-box column status..? One more query If i checked specific node it should checked all rows of a gridview. Thanks. I am using VS-2008 2.0

    Read the article

  • Extend MySQL implementation of PiP Algorithm?

    - by Mike
    I need to make a point in polygon MySQL query. I already found these two great solutions: http://forums.mysql.com/read.php?23,286574,286574 MySQL implementation of ray-casting Algorithm? But these functions can only check if one point is inside a poly. I have a query where the PiP part should only be one part of the query and check for x points inside a polygon. Something like this: $points = list/array/whatever of points in language of favour SELECT d.name FROM data AS d WHERE d.name LIKE %red% // just bla bla // how to do this ? AND $points INSIDE d.polygon AND myWithin( $points, d.polygo ) // or UPDATE I tried it with MBR functions like this: SET @g1 = GeomFromText('Polygon((13.43971 52.55757,13.41293 52.49825,13.53378 52.49574, 13.43971 52.55757))'); SET @g2 = GeomFromText('Point(13.497834 52.540489)'); SELECT MBRContains(@g1,@g2); G2 should NOT be inside G1 but MBR says it is.

    Read the article

  • Reading and writing dates to the registry for trial version purposes.

    - by LeeW
    Hi all, Here's what I want to do, I want to store the date the first time the program is installed and also store a date when was the program was last run. I want the code to check to see if it was more than 30 days since the installation so I can turn off features. I also want to check if the system date is less than the last opened date and if so write the installed date to 1/1/1901 to prevent the program from running. Keeping in mind that this is not a consumer program but a business program I don't expect hackers to crack it, they may do but that is fine I simply want to give potential customers a reason to consider purchasing the program and the end of the trial will prompt this. 1: Does this sound reasonable? 2: How should I hide the fact this is a date so it's not easily changed? Many thanks Lee

    Read the article

  • how to force ejb3 to reload value from data base and not use those of the context

    - by Kohan95
    Hello here I have a big problem that I hope to find help here I have two entities @Entity @Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="Role", discriminatorType=DiscriminatorType.STRING) public class Utilisateur implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="id") private Long id; @Column(name="nom",nullable=false) private String nom; @Column(name="Role",nullable=false, insertable=false) private String Role ; //... } @Entity @Table(name="ResCom") @DiscriminatorValue("ResCom") public class ResCom extends Utilisateur { /... } the first thing I do ResCom rsCom= new ResCom(nom,prenom, email,civilite, SysQl.crypePasse(pass)); gr.create(rsCom); I check my database I see that property is ResCom insert but when I check the value of role I get null Utilisateur tets= gr.findByEmail(email); message=tets.getEmail()+" and Role :"+tets.getRole()+""; but in my bass it ResCom !!!!! the problem disappears when I deploy the project again I hope you have a solution And thank you in advance sorry for my English

    Read the article

  • How do I enumerate installed OleDb providers for current processor architecture?

    - by Rowland Shaw
    I've a project that connects to a dBase format database file, that I've always done in the past with a connection string of the form of: PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=MyData.dbf;Extended Properties=dBASE 5.0 I've had to revisit this recently, and have found that when attempting to create an OleDbConnection with that connection string on x64 machines, that have an x86 install of Office on it, it throws an exception. A quick hack of a fix shows that forcing the application to target x86 only makes it work, but I was hoping to be able to tidy this up and check in advance whether it would fail to create the connection, so that I could customise my import options to suit the available providers. Is it possible to enumerate the available data providers for the current processor architecture? (other than relying on catching the exception -- after all, the Framework Design Guidelines suggest that you should only throw in exceptional circumstances, and you have a method to check if something would throw an exception)

    Read the article

  • Nested for loop error with !null checking an element that doesn't exist

    - by Programatt
    I am currently using nested for loops in a 2D array of size 4,2. When I run my program, I get index out of bounds Exception on the following line else if (state[i][j+1] != null && state[i][j].getFlash() <= state[i][j].getCycleLength() && state[i][j+1].getCycleLength() == state[i][j].getCycleLength()){ } It says the index out of bounds is 2. I would understand the error if I wasn't checking to see if [i][j+1] wasn't null, but I don't understand the exception with the check? I tried moving around the !null check but the program still fails on this line. Any help would be greatly appreciated. Stack trace: Exception in thread "Timer-0" java.lang.ArrayIndexOutOfBoundsException: 2 at NatComp.data$1.run(data.java:67) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462)

    Read the article

  • MySQL with Java: Open connection only if possible

    - by emempe
    I'm running a database-heavy Java application on a cluster, using Connector/J 5.1.14. Therefore, I have up to 150 concurrent tasks accessing the same MySQL database. I get the following error: Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections This happens because the server can't handle so many connections. I can't change anything on the database server. So my question is: Can I check if a connection is possible BEFORE I actually connect to the database? Something like this (pseudo code): check database for open connection slots if (slot is free) { Connection cn = DriverManager.getConnection(url, username, password); } else { wait ... } Cheers

    Read the article

  • No-argument method on window.external is invoked when checking with typeof

    - by janko
    Hi, I am trying to display an HTML page with embedded JavaScript code inside a System.Windows.Forms.WebBrowser control. The JavaScript code is expected to interact with the embedding environment through the window.external object. Before invoking a method on window.external, JavaScript is supposed to check for the existance of the method. If it is not there, the code should invoke a generic fallback method. // basic idea if (typeof(window.external.MyMethod) != 'undefined') { window.external.MyMethod(args); } else { window.external.Generic("MyMethod", args); } However, checking for a no-argument method with typeof seems to invoke the method already. That is, if MyMethod accepts any positive number of arguments, the code above will work perfectly; but, if MyMethod is a no-argument method, then the expression typeof(window.external.MyMethod) will not check for its type but invoke it, too. Is there any work-around to this behavior? Can I somehow escape the expression window.external.MyMethod to prevent the method call from occurring?

    Read the article

  • No progress bar in IE8 while executing the download using PHP

    - by user292918
    I am giving downloads to user using the PHP code below but when user downloading they are not able to see the progressbar in IE8 when clicked on save button. Please solve this. Thanks in advance. header('Content-Description: Songsbin.com - Downlaod'); header('Content-type: audio/mpeg'); header('Content-Disposition: attachment; filename='.$filename1); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.filesize($file)); ob_clean(); flush(); readfile($file);

    Read the article

  • How to find validity of a string of parentheses, curly brackets and square brackets?

    - by Rajendra
    I recently came in contact with this interesting problem. You are given a string containing just the characters '(', ')', '{', '}', '[' and ']', for example, "[{()}]", you need to write a function which will check validity of such an input string, function may be like this: bool isValid(char* s); these brackets have to close in the correct order, for example "()" and "()[]{}" are all valid but "(]", "([)]" and "{{{{" are not! I came out with following O(n) time and O(n) space complexity solution, which works fine: Maintain a stack of characters. Whenever you find opening braces '(', '{' OR '[' push it on the stack. Whenever you find closing braces ')', '}' OR ']' , check if top of stack is corresponding opening bracket, if yes, then pop the stack, else break the loop and return false. Repeat steps 2 - 3 until end of the string. This works, but can we optimize it for space, may be constant extra space, I understand that time complexity cannot be less than O(n) as we have to look at every character. So my question is can we solve this problem in O(1) space?

    Read the article

  • Two collections and a for loop. (Urgent help needed) Checking an object variable against an inputted

    - by Elliott
    Hi there, I'm relatively new to java, I'm certain the error is trivial. But can't for the life of me spot it. I have an end of term exam on monday and currently trying to get to grips with past papers! Anyway heregoes, in another method (ALGO_1) I search over elements of and check the value H_NAME equals a value entered in the main. When I attempt to run the code I get a null pointer exception, also upon trying to print (with System.out.println etc) the H_NAME value after each for loop in the snippet I also get a null statement returned to me. I am fairly certain that the collection is simply not storing the data gathered up by the Scanner. But then again when I check the collection size with size() it is about the right size. Either way I'm pretty lost and would appreciate the help. Main questions I guess to ask are: from the readBackground method is the data.add in the wrong place? is the snippet simply structured wrongly? oh and another point when I use System.out.println to check the Background object values name, starttime, increment etc they print out fine. Thanks in advance.(PS im guessing the formatting is terrible, apologies.) snippet of code: for(Hydro hd: hydros){ System.out.println(hd.H_NAME); for(Background back : backgs){ System.out.println(back.H_NAME); if(back.H_NAME.equals(hydroName)){ //get error here public static Collection<Background> readBackground(String url) throws IOException { URL u = new URL(url); InputStream is = u.openStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader b = new BufferedReader(isr); String line =""; Vector<Background> data = new Vector<Background>(); while((line = b.readLine())!= null){ Scanner s = new Scanner(line); String name = s.next(); double starttime = Double.parseDouble(s.next()); double increment = Double.parseDouble(s.next()); double sum = 0; double p = 0; double nterms = 0; while((s.hasNextDouble())){ p = Double.parseDouble(s.next()); nterms++; sum += p; } double pbmean = sum/nterms; Background SAMP = new Background(name, starttime, increment, pbmean); data.add(SAMP); } return data; } Edit/Delete Message

    Read the article

  • checking boolean property in XML(Spring)

    - by Abhishek Bhandari
    I am using Spring Framework . While writing coustum SQL queries , i am unable check a parameter of boolean value. For example this is not working .. do some SQl cods The above checking is not working , it is evaluating as equal in both the cases when booleanVariable is true and false . i tried to replace compareValue ="tree" and "false". As that is a monkey work i do sometimes . is it possible to check the boolean property in XML like above .

    Read the article

  • Showing custom model validation exceptions in the Django admin site.

    - by Guy Bowden
    I have a booking model that needs to check if the item being booked out is available. I would like to have the logic behind figuring out if the item is available centralised so that no matter where I save the instance this code validates that it can be saved. At the moment I have this code in a custom save function of my model class: def save(self): if self.is_available(): # my custom check availability function super(MyObj, self).save() else: # this is the bit I'm stuck with.. raise forms.ValidationError('Item already booked for those dates') This works fine - the error is raised if the item is unavailable, and my item is not saved. I can capture the exception from my front end form code, but what about the Django admin site? How can I get my exception to be displayed like any other validation error in the admin site?

    Read the article

  • Why do I need to give my options a value attribute in my dropdown? JQuery.

    - by Alex
    So far in my web developing experiences, I've noticed that almost all web developers/designers choose to give their options in a select a value like so: <select name="foo"> <option value="bar">BarCheese</option> // etc. // etc. </select> Is this because it is best practice to do so? I ask this because I have done a lot of work with jQuery and dropdown's lately, and sometimes I get really annoyed when I have to check something like: $('select[name=foo]').val() == "bar"); To me, many times that seems less clear than just being able to check the val() against BarCheese. So why is it that most web developers/designers specify a value paramater instead of just letting the options actual value be its value?

    Read the article

  • inode_operations , warning: initialization from incompatible pointer type

    - by djTeller
    Hi everyone, I'm trying to compile a simple Kernel program that read and write from a proc file. I'm trying to set permission to that file by overriding the permission fp in inode_operations struct (.permission) static int module_permission(struct inode *inode, int op, struct nameidata *foo) { . . . } static struct inode_operations Inode_Ops_4_Our_Proc_File = { .permission = module_permission, /* check for permissions */ }; Our_Proc_File->proc_iops = &Inode_Ops_4_Our_Proc_File; For some reason, when I compile this i get - warning: initialization from incompatible pointer type on the following line: .permission = module_permission, /* check for permissions */ Any idea how to solve this? Thanks!

    Read the article

< Previous Page | 175 176 177 178 179 180 181 182 183 184 185 186  | Next Page >