Search Results

Search found 11972 results on 479 pages for 'writing'.

Page 29/479 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Writing a query to find MAX number in PL/SQL

    - by user2461116
    I am suppose to Write a query that will display the largest number of movies rented by one member and that member's name. Give the output column a meaningful name such as MAXIMUM NUMBER. This is what I have. select max(maximum_movies) from (select count(*)maximum_movies from mm_member join mm_rental on mm_rental.member_id = mm_member.member_id group by first, last); I got the maximum number but the output should be like this. First Last Maximum_movies John Doe 4 But the output is Maximum_movies 4 Any suggestions?

    Read the article

  • Writing custom Django fields and widgets

    - by hekevintran
    Django has very good documentation that describes how to write custom database fields and custom template tags and filters. I cannot find the document that describes how to write custom form fields and widgets. Does this document exist? The way I've been able to write custom form fields and widgets is by reading the Django source code and imitating what I see there. I know that there are still things about implementing fields and widgets that I do not completely understand because I have not read any high level document that describes their interfaces.

    Read the article

  • Writing a batch file to delete files with wildcards

    - by iamthejeff
    I have multiple websites set up in the same folder, and I want to create a batch file that will delete the cache in each of them without having to add a new line for each site. For example I am using this: del /S /Q D:\www\site-name\cache\* Which works, but I have to add a new line for every site in D:\www. The del command doesn't support: del /S /Q D:\www\*\cache\* So what is a better way to do this?

    Read the article

  • Haskell: writing the result of a computation to file

    - by peterwkc
    I have a function which creates a tuple after computation, but I would like to write it to file. I know how to write to a file using writeFile, but do not know how to combine the computation and monads IO together in the type signature. This is my code. invest :: ([Char]->Int->Int->([Char], Int) ) -> [Char]->Int->Int->([Char], Int) invest myinvest x y = myinvest x y myinvest :: [Char]->Int->Int->([Char], Int) myinvest w x y | y > 0 = (w, x + y) | otherwise = error "Invest amount must greater than zero" where I have a function which computes the maximum value from a list, but I want this function to receive input from a file, and then perform the computation of maximum value. maximuminvest :: (Ord a) => [a] -> a maximuminvest [] = error "Empty Invest Amount List" maximuminvest [x] = x maximuminvest (x:xs) | x > maxTail = x | otherwise = maxTail where maxTail = maximuminvest xs Please help. Thanks.

    Read the article

  • Resources for writing kernel in C

    - by anon
    I don't want to write my own boot loader -- happy to use Grub. I just want to implement pre-emptive multi threading, a basic file system, and virtual memory. I want something that can run on top of qemu. What's a good resource (book / tutorial) for accomplishing this goal? Thanks!

    Read the article

  • fopen / fopen_s and writing to files

    - by yCalleecharan
    Hi, I'm using fopen in C to write the output to a text file. The function declaration is (where ARRAY_SIZE has been defined earlier): void create_out_file(char file_name[],long double *z1){ FILE *out; int i; if((out = fopen(file_name, "w+")) == NULL){ fprintf(stderr, "* Open error on output file %s", file_name); exit(-1); } for(i = 0; i < ARRAY_SIZE; i++) fprintf(out, "%.16Le\n", z1[i]); fclose(out); } My questions: On compilation with MVS2008 I get the warning: warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. I haven't see much information on fopen_s so that I can change my code. Any suggestions? Can one instruct fprintf to write at desired precision? If I'm using long double then I assume that my answers are good till 15 digits after the decimal point. Am I right? Thanks a lot...

    Read the article

  • Batch file writing to log then ending process

    - by Andrew Service
    I have a batch file that calls a process and in that process I have: IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% Now I wanted to upgrade this a bit and give some meaningful message to an output log when if the process fails, also I do not want the main batch to continue processing because the next processes are dependent on data from previous calls; I wonder if this would be correct but not sure: CALL Process 1 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInfirstProcess /B %ERRORLEVEL% :ErrorInfirstProcess ECHO Process 1 Failed on %Date% at %Time%. >>C:\Log.txt" CALL Process 2 IF %ERRORLEVEL% NEQ 0 GOTO ErrorInSecondProcess /B %ERRORLEVEL% :ErrorInSecondProcess ECHO Process 2 Failed on %Date% at %Time%. >>C:\Log.txt" I also want to know if I still need the /B or do I need to put an EXIT command after the echo? Thanks A

    Read the article

  • Writing OLAP SQL query

    - by user1859596
    I have a project I am working on that requires the following : create a normalized sample rdbms (5 tables) using Java I entered 1 million rows of data to each table run two OLTP and two OLAP queries on the normalized tables. Denormalized tables. run the same OLTP and OLAP queries on them and compare time. What does OLAP query mean? I've searched the internet and all that I can find is that I have to make a cube, and apply queries on it. How can I write an OLAP query on a RDBMS? I have a sample : tables normalized(orders,product,customer,branch,sales) sales : order_id,product_id,quantity product : product_id,name,description,price,sales_tax customer : customer_id,f_name,l_name,tel_no,addr,nic,city branch : branch_id,name,tel_no,addr,city orders : order_id,customer_id,order_date,branch_id I want to write an OLAP query on the above tables. I am using Oracle Express with SQL Developer.

    Read the article

  • Writing secure java code with RMI

    - by jtnire
    Hi Everyone, This may seem like a very broad question, but any help is appreciated. I have a client/server solution written in java which uses the Cajo project (which uses RMI). I just want to try and make my solution as secure as possible, given the sensitive data that will be transferred between server and client. So far, my ideas are to make all my classes "final" as well as throw a "non-serializable" exception for all my classes in the server (except for the object bound in the RMI registry, and any objects that actually do need to be transferred of course). Can anyone think of any other ideas? I know that someone could write a malicious client - this isn't hard to do as you can find out the remote object's API using reflection. However is there anything I can do to protect a malicious client access classes/objects within the server that they are not supposed to access? Many Thanks

    Read the article

  • Writing iPhone apps on linux - What tools do you need

    - by Sia.G
    Hello. I wanted to know if it's possible to WRITE and COMPILE/TEST iPhone apps on a linux platform. I've been on google for a couple of days now, and people either talk about "Mac OS X only!", or "Develop jailbroke apps on Linux". My dev partner has a mac and has a certificate to sign the apps. I don't have a mac, but I will be doing most of the development. So what I want to do is simply develop/test the app in linux, and when it's finished, simply hand over the code to him, who will then compile the finalized app and sign it ready for submission to the app store. Could anyone tell me what linux tools I would need to accomplish this?

    Read the article

  • writing something in jList

    - by bigbluedragon
    hey i have another problem. I created jList in my main window and now i want to add something to it. I do it this way... private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { Dodaj_Przedmiot dodaj_przedmiot = new Dodaj_Przedmiot(null, true); dodaj_przedmiot.setVisible(true); SterowanieBazy instance = SterowanieBazy.getInstance(); Zmienne_pomocnicze zp = new Zmienne_pomocnicze(); instance.dodajPrzedmiot(przedmiot); String przedm[] = instance.zwrocPrzedmioty(); jList1.setListData(przedm); } what i want to write in that list is what i collect from my jDialogForm: dodaj_przedmiot private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String sciezka = jTextField1.getText(); if (sciezka.length() > 0) { Zmienne_pomocnicze zp = new Zmienne_pomocnicze(); zp.setPrzechowaj(sciezka); } this.setVisible(false); } and i collect try to copy that date using this class public class Zmienne_pomocnicze { public String n; public int a; public void setPrzechowaj (String neew) { n = neew; } public String getPrzechowaj () { return n; } } i would be grateful for any ideas how to make it works^^

    Read the article

  • file_operations Question, how do i know if a process that opened a file for writing has decided to c

    - by djTeller
    Hi Kernel Gurus, I'm currently writing a simple "multicaster" module. Only one process can open a proc filesystem file for writing, and the rest can open it for reading. To do so i use the inode_operation .permission callback, I check the operation and when i detect someone open a file for writing I set a flag ON. i need a way to detect if a process that opened a file for writing has decided to close the file so i can set the flag OFF, so someone else can open for writing. Currently in case someone is open for writing i save the current-pid of that process and when the .close callback is called I check if that process is the one I saved earlier. Is there a better way to do that? Without saving the pid, perhaps checking the files that the current process has opened and it's permission... Thanks!

    Read the article

  • Problems writing a query to join two tables

    - by Psyche
    Hello, I'm working on a script which purpose is to grant site users access to different sections of the site menu. For this I have created two tables, "menu" and "rights": menu - id - section_name rights - id - menu_id (references column id from menu table) - user_id (references column id from users table) How can a query be written in order to get all menu sections and mark the ones where a given user has access. I'm using PHP and Postgres. Thank you.

    Read the article

  • Writing a Python extension in Go (golang)

    - by tehwalrus
    I currently use Cython to link C and Python, and get speedup in slow bits of python code. However, I'd like to use go routines to implement a really slow (and very parallelizable) bit of code, but it must be callable from python. (I've already seen this question) I'm (sort of) happy to go via C (or Cython) to set up data structures etc if necessary, but avoiding this extra layer would be good from a bug fix/avoidance point of view. What is the simplest way to do this without having to reinvent any wheels?

    Read the article

  • Giving writing permissions for IIS user at Windows 2003 Server

    - by Steve
    I am running a website over Windows 2003 Server and IIS6 and I am having problems to write or delete files in some temporary folder obtaining this kind of warmings: Warning: unlink(C:\Inetpub\wwwroot\cakephp\app\tmp\cache\persistent\myapp_cake_core_cake_): Permission denied in C:\Inetpub\wwwroot\cakephp\lib\Cake\Cache\Engine\FileEngine.php on line 254 I went to the tmp directory and at the properties I gave the IIS User the following permissions: Read & Execute List folder Contents Read And it still showing the same warnings. When I am on the properties window, if I click on Advanced the IIS username appears twice. One with Allow type and read & execute permissions and the other with Deny type and Special permissions. My question is: Should I give this user not only the Read & Execute permissions but also this ones?: Create Attributes Create Files/ Write Data Create Folders/ Append Data Delete Subfolders and Files Delete They are available to select if I Click on the edit button over the username. Wouldn't I be opening a security hole if I do this? Otherwise, how can I do to read and delete the files my website uses? Thanks.

    Read the article

  • In python writing from XML to CSV, encoding error

    - by user574435
    Hi, I am trying to convert an XML file to CSV, but the encoding of the XML ("ISO-8859-1") apparently contains characters that are not in the ascii codec which Python uses to write rows. I get the error: Traceback (most recent call last): File "convert_folder_to_csv_PLAYER.py", line 139, in <module> xml2csv_PLAYER(filename) File "convert_folder_to_csv_PLAYER.py", line 121, in xml2csv_PLAYER fout.writerow(row) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 4: ordinal not in range(128) I have tried opening the file as follows: dom1 = parse(input_filename.encode( "utf-8" ) ) and I have tried replacing the \xe1 character in each row before it is written. Any suggestions?

    Read the article

  • writing a meta refresh method for rails

    - by aaronstacy
    I want a method in app/controllers/application.rb that can prepend/append text to whatever template gets rendered. Of course I can't call render twice w/o getting a double render error, so is this possible? I want to redirect after a delay using a meta refresh. Here's what I've got: app/controllers/application_controller.rb: def redirect_after_delay (url, delay) @redirect_delay = delay @redirect_url = url render end app/views/layouts/application.html.erb <!DOCTYPE html> <html lang="en"> <head> <%= yield :refresh_tag %> </head> <body> <%= yield %> </body> </html> So then if I want to add a redirect-after-delay, I add the following to 1) my controller and 2) the action's view: app/controllers/my_controller.rb def my_action redirect_after_delay 'http://www.google.com', 3 if some_condition end app/views/my_controller/my_action.html.erb <% content_for :refresh_tag do %> <meta http-equiv='refresh' content='<%=@redirect_delay%>;url=<%=@redirect_url%>'> <% end %> <h1>Please wait while you are redirected...</h1> Since the content_for block never changes, is it possible to do this in some generic way so that I don't have to put <%= yield :refresh_tag %> in each template? (e.g. could redirect_after_delay add it into whatever template is going to be rendered?)

    Read the article

  • Writing a line in a JTextArea from another class

    - by Christopher Nastovski
    I'm trying to use a Method in my class 'Visual' to write a line of code into a JTextArea and it prints when I call it from 'Visual' but when I call it from 'Login' It only prints Text into the Console, not to the TextArea. private static Visual Visual; Visual.WriteLine("I'm sorry, your username or password is incorrect. Please try again."); or private static Visual Visual = new Visual(); Visual.WriteLine("I'm sorry, your username or password is incorrect. Please try again."); Dont work form 'Login' But, WriteLine("Test"); works from 'Visual', the class that the method is in. Here's the method in 'Visual' public void WriteLine(String Text) { System.out.println(Text); SystemFeed.append(Text.toString() + "\n"); SystemFeed.setCaretPosition(SystemFeed.getDocument().getLength()); }

    Read the article

  • Writing custom Django form fields and widgets

    - by hekevintran
    Django has very good documentation that describes how to write custom database fields and custom template tags and filters. I cannot find the document that describes how to write custom form fields and widgets. Does this document exist? The way I've been able to write custom form fields and widgets is by reading the Django source code and imitating what I see there. I know that there are still things about implementing fields and widgets that I do not completely understand because I have not read any high level document that describes their interfaces.

    Read the article

  • Python having problems writing/reading and testing in a correct format

    - by Ionut
    I’m trying to make a program that will do the following: check if auth_file exists if yes - read file and try to login using data from that file - if data is wrong - request new data if no - request some data and then create the file and fill it with requested data So far: import json import getpass import os import requests filename = ".auth_data" auth_file = os.path.realpath(filename) url = 'http://example.com/api' headers = {'content-type': 'application/json'} def load_auth_file(): try: f = open(auth_file, "r") auth_data = f.read() r = requests.get(url, auth=auth_data, headers=headers) if r.reason == 'OK': return auth_data else: print "Incorrect login..." req_auth() except IOError: f = file(auth_file, "w") f.write(req_auth()) f.close() def req_auth(): user = str(raw_input('Username: ')) password = getpass.getpass('Password: ') auth_data = (user, password) r = requests.get(url, auth=auth_data, headers=headers) if r.reason == 'OK': return user, password elif r.reason == "FORBIDDEN": print "Incorrect login information..." req_auth() return False I have the following problems(understanding and applying the correct way): I can't find a correct way of storing the returned data from req_auth() to auth_file in a format that can be read and used in load_auth file PS: Of course I'm a beginner in Python and I'm sure I have missed some key elements here :(

    Read the article

  • Writing a PHP web crawler using cron

    - by Horse
    Hi all I have written myself a web crawler using simplehtmldom, and have got the crawl process working quite nicely. It crawls the start page, adds all links into a database table, sets a session pointer, and meta refreshes the page to carry onto the next page. That keeps going until it runs out of links That works fine however obviously the crawl time for larger websites is pretty tedious. I wanted to be able to speed things up a bit though, and possibly make it a cron job. Any ideas on making it as quick and efficient as possible other than setting the memory limit / execution time higher?

    Read the article

  • Child service not writing to event log

    - by Tommy Fisk
    I am having a very simple (but incredibly frustrating) issue with a parent service and the child service. Let's call the parent service "Service A" and the child "Service B". Both services reside on the same box. Using WCF Storm, when I send Service B a message, I see lots of entries in the event viewer for it. However, if I send a message to Service A, which calls Service B, I only see entries from Service A. So for some reason, the child logs are not written when the parent calls it, but if I call it myself, the logs do indeed show up, so I know it's not a problem with the logging or anything like that. Here is what I am using to write to the event log. // in some random static class private static EventLog el = new EventLog(); el.WriteEntry("In " + location + ", " + message); // params passed in Does anyone know why this is happening? And more importantly what I can do about it?

    Read the article

  • Best Practices & Considerations when writing HTML Emails

    - by Jonathan Sampson
    I've been developing websites for over a decade now, but quickly found that many of my habits in developing for the web are useless when developing for email clients. This has caused me an enormous amount of frustration, so I thought I would ask a question that would hopefully surface the best practices and necessary considerations for others like myself who may find themselves designing for gmail, outlook, etc. from time to time. Example: <style>...</style> vs inline CSS. In short: what transfers over from the web-world to the email-world, and what doesn't.

    Read the article

  • Writing out sheet to text file using POI event model

    - by Eduardo Dennis
    I am using XLSX2CSV example to parse large sheets from a workbook. Since I only need to output the data for specific sheets I added an if statement in the process method to test for the specific sheets. When the condition is met I continue with the process. public void process() throws IOException, OpenXML4JException, ParserConfigurationException, SAXException { ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(this.xlsxPackage); XSSFReader xssfReader = new XSSFReader(this.xlsxPackage); StylesTable styles = xssfReader.getStylesTable(); XSSFReader.SheetIterator iter = (XSSFReader.SheetIterator) xssfReader.getSheetsData(); while (iter.hasNext()) { InputStream stream = iter.next(); String sheetName = iter.getSheetName(); if (sheetName.equals("SHEET1")||sheetName.equals("SHEET2")||sheetName.equals("SHEET3")||sheetName.equals("SHEET4")||sheetName.equals("SHEET5")){ processSheet(styles, strings, stream); try { System.setOut(new PrintStream( new FileOutputStream("C:\\Users\\edennis.AD\\Desktop\\test\\"+sheetName+".txt"))); } catch (Exception e) { e.printStackTrace(); } stream.close(); } } } But I need to output text file and not sure how to do it. I tried to use the System.set() method to output everything from system.out to text but that's not working I just get blank files.

    Read the article

  • Drupal 6 devel module dd() function not writing to drupal_debug.txt file

    - by Mike Munroe
    I am running a local development Drupal site on a Windows machine. I am trying to use the dd($data, $label = NULL) function from the devel module to help debug. Using this function, should write debug info to a drupal_debug.txt file in the /tmp folder on the machine where the Drupal site is hosted. On my Windows machine, although I am using this function, the drupal_debug.txt file is not getting created anywhere, leading me to believe I am using the function incorrectly. Here is a snippet of how I am using it, <?php $test = "this is my test"; dd($test, $label = NULL); I am looking for an example of the correct syntax for the dd($data, $label = NULL) function. I have the Devel module enabled.

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >