Daily Archives

Articles indexed Tuesday November 13 2012

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How do I debug xorg/fglrx related system freezes on Ubuntu 12.10?

    - by racerror
    My brand new system is randomly freezing and I don't know how to debug the issue. System: AMD A10-5800k Asus F2A85-M motherboard Integrated Radeon HD 7660D 8gb Samsung ddr3 1600 Ubuntu 12.10 Gnome shell / Unity (issue exists in both) xorg.conf (relevant parts): Section "Device" Identifier "aticonfig-Device[0]-0" Driver "fglrx" BusID "PCI:0:1:0" Option "TexturedVideoSync" "on" Option "UseFastTLS" "2" EndSection Section "Screen" Identifier "aticonfig-Screen[0]-0" Device "aticonfig-Device[0]-0" Monitor "Monitor0" DefaultDepth 24 Option "UseEDID" "False" Option "ExactModeTimingsDVI" "True" Option "NoBandWidthTest" "true" Option "ModeValidation" "AllowNon60hzmodesDFPModes, NoEDIDDFPMaxSizeCheck, NoVertRefreshCheck, NoHorizSyncCheck, NoDFPNativeResolutionCheck, NoMaxSizeCheck, NoMaxPClkCheck, NoEDIDModes" Option "UseEDIDDPI" "False" Option "UseEDIDFreqs" "0" Option "NoLogo" "True" Option "Coolbits" "1" Option "metamodes" "DFP-0: 2560x1440_60 +0+0" SubSection "Display" Depth 24 Modes "2560x1440" EndSubSection I ran memtest on my ram and it checks out fine. I have tried using the latest fglrx and fglrx-beta. I have loaded 3.6.x kernel. I do not see anything relevant in dmesg, kern.log, syslog, .xsession-errors or Xorg.log. I cannot ssh into the machine when frozen from another machine. I know that system resources not being stressed when the crashes happen. It seems that video and any gaming (very simple graphics games) contribute to the freezes most frequently. However, I have experienced the crash before when just using Chrome. I suspect the crashes are xorg/fglrx related, but I have no evidence to back that up. Where should I look? What should I grep for? What should I try next?

    Read the article

  • cannot open ubuntu software center

    - by success
    I deleted some unnecessary icon themes and now my application icons are changed. I cannot open Ubuntu software center also.... the following message is displayed.... success@user-pc:~$ software-center 2012-09-12 22:24:52,048 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None' 2012-09-12 22:24:52,055 - softwarecenter.db.database - INFO - open() database: path=None use_axi=True use_agent=True Traceback (most recent call last): File "/usr/bin/software-center", line 142, in <module> app = SoftwareCenterAppGtk3(datadir, xapian_base_path, options, args) File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py", line 387, in __init__ self.datadir) File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/historypane.py", line 78, in __init__ self._get_emblems(self.icons) File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/historypane.py", line 192, in _get_emblems pb = icons.load_icon(emblem, self.ICON_SIZE, 0) File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function return info.invoke(*args, **kwargs) gi._glib.GError: Icon 'package-install' not present in theme I also tried the following code to change the icon but no didnt work.... gksu gedit /usr/share/applications/ubuntu-software-center.desktop

    Read the article

  • How do I install Sublime Text 2?

    - by Michael Gruber
    I installed Sublime Text 2 on 12.04 as per this tutorial. However I don't have adequate permissions when launching the program from the Unity launcher. For example I cannot install packages, or if I add a folder to the sidebar when I close Sublime and reopen, the folder is no longer listed. If I run sudo sublime in the terminal all changes remain after closing. I've tried chown-ing the Sublime Text 2 folder in usr/lib sudo chown -R mylogin:mylogin /usr/lib/"Sublime Text 2" but this seemed to have no effect.

    Read the article

  • Remove "computer" and "network" categories from Nautilus sidebar (ubuntu 12.04 running Cinnamon 1.4)

    - by utnubu_user
    I am wondering if it is possibly to completely remove the "computer" and "network" categories from Nautilus sidebar. I would like to do this because the locations that fall under them cannot be edited and I don't use those. Instead, I prefer to specify my own locations which I can do through the Bookmarks. This is all fine, but the "computer" and "network" just sit there doing nothing (potentially distracting). It seems these categories are hardcoded in Nautilus 3.4.2? At least I can't find a way to remove them. Any suggestions are welcomed.

    Read the article

  • Cannot install ia32-libs on a 64 bit Ubuntu installation

    - by Swarnendu Biswas
    I am using a 64-bit installation of Oneiric. I need to install the ia32-libs package to get some applications (evince, adobe reader) to work. For example, adobe reader is giving the following error: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory. However, I am not able to install it since it is showing a dependency on ia32-libs-multiarch, which in turn is showing a dependency on gstreamer0.10-plugins-good:i386. This in turn depends on few other packages. How can I install these packages safely and still meet all the dependencies.

    Read the article

  • Installing chrome gives an error: "dependency is not satisfiable"

    - by Sled
    I just installed ubuntu on my laptop, everything works fine, but I'd like to use chrome instead of firefox. I downloaded the .deb file from the chrome website, and when I open it, the install buton inside the software center is inactive (I can't click it) and it's telling me dependency is not satisfiable: libcurl3 I did a search for libcurl3 in the Software Center, the three results I'm getting are already installed. Any ideas how to fix this? I also tried installing chromium-browser, but that's not working out neither. I'm getting Package dependencies not resolved and this details block: The following packages have unmet dependencies: chromium-browser: Depends: libgcc1 (>= 1:4.1.1) but 1:4.5.2-8ubuntu4 is to be installed Depends: libxdamage1 (>= 1:1.1) but 1:1.1.3-1ubuntu1 is to be installed Depends: zlib1g (>= 1:1.2.3.3.dfsg) but 1:1.2.3.4.dfsg-3ubuntu3 is to be installed Depends: libnss3-1d (>= 3.12.3) but it is not going to be installed

    Read the article

  • WordPress page title repeated in SOME pages

    - by cmykrgbb
    I have created a Wordpress site and titles were working just fine. Then, some time and plugins installed later, I noticed that in SOME pages I get the title repeated 2 times. Example of wrong page title: Contact - NAME | NAME Example of normal title: Our Services | NAME Now, if I go to General Settings and change title it will change both, no improvement. SEO by Yoast has the option to reset page titles, but that just removes all titles leaving the current URL as page title, so no good either. Here is the code I originally had: <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' | '; } ?><?php bloginfo('name'); ?></title> Here is the code I am using now: <title><?php wp_title('|'); ?></title> To sum up, I think somewhere in the database there's a wp_title repeated: once using '-' as separator, another one (the current one) using '|'. Any help will be most appreciated, thanks!

    Read the article

  • Sending Emails via Google SMTP - after some time quit working

    - by Chris
    on a website I use PHPMailer to send automated registration emails, etc and also a newsletter-tool (which loops through the emails and sends them one by one). Also, I configured in Gmail under Settings and confirmed @mydomain addresses, so I can send from @mydomain emails without the gmail address being displayed. Furthermore I authorized the website to send mails with this link: https://accounts.google.com/DisplayUnlockCaptcha Now, after 2 month where everything worked perfectly fine, suddenly users started not to receive emails anymore and most recently emails are not even being sent anymore. Also, I received many error messages like this: Technical details of permanent failure: Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.4.1 [email protected]: Recipient address rejected: Access Denied (state 13). When I check at this link: https://toolbox.googleapps.com/apps/checkmx/ It tells 2 none critical errors: Relayhost configuration detected. There SHOULD be a valid SPF record. So, the questions I would have were: does anybody have any hint why it stopped working, what the error messages mean? what to do to fix it? where do I set a SPF record (Cpanel?)? what is a relayhost and how to fix that? It is about 1000-1400 mails a day (gmail's limit is 2000). Also, what can I do wrong when setting up an SPF record? I've heard there are some testing tools for that. Thank you so much already in advance for your help!

    Read the article

  • Calculating the position of an object with regards to current position using OpenGL like matrices

    - by spartan2417
    i have a 1st person camera that collides with walls, i also have a small sphere in front of my camera denoted by the camera position plus the distance ahead. I cannot get the postion of the sphere but i have the position of my camera. e.g. i need to find the position of the point or at the very least find away of calculating the position using the camera positions. code: static Float P_z = 0; P_z = -15; PushMatrix(); LoadMatrix(&Inv); Material(SCEGU_AMBIENT, 0x00000066); TranslateXYZ(0,0,P_z); ScaleXYZ(0.1f,0.1f,0.1f); pointer.Render(); PopMatrix(); where Inv is the camera positions (Inv.w.x,Inv.w.z), pointer is the sphere.

    Read the article

  • 2D XNA Game Engine with a Good Wiki [closed]

    - by gcx
    I'm a newbie game developer. I'm planning to develop a XBOX (with a Kinect to double the fun) game. I've researched some 2D game engines that i can use in my project. After some research I've found IceCream engine and it looks delicious with its Milkshake editor. But I can't seem to find "working" game source examples for that engine and its own website's tutorial is not very sufficent. (If you are familiar with this engine) do you know any community that has helpful resources for this particular engine? If not, which engines do you recommend (that has a great wiki) for a XNA based XBOX - Kinect game?

    Read the article

  • Fighting Game and input buffering

    - by Pilispring
    In fighting game, there is an important thing called input buffering. When your character is doing an action, you can input the next action that will activate as soon as possible (the buffer is 5-10 frames). Is anyone had already done it or knows the most efficient way to do this? I thought of things like that: Enum list moves (a list of all my moves) if (moves = fireball) { if (Mycharacterisidle) { Do the fireball } else if (MycharacterisMoving) { if (lastspriteisnotfinished) { InputBuffer++; } else if(spriteisfinished && InputBuffer < 5) { Do the fireball } } } Any better ideas? Thx.

    Read the article

  • Update JSON file C# W8 development

    - by AndrewB
    At the moment, I've got a JSON file with content looking like this: { "username": "test", "someNumber":100 } I'm using JSON.Net to fetch the .JSON file from a webserver - C#: var http = new HttpClient(); http.MaxResponseContentBufferSize = Int32.MaxValue; var response = await http.GetStringAsync(URI); var result = JsonConvert.DeserializeObject<DatClass.Result>(response); This works great together with the class getting/setting the properties. However, what I would like to know is whether there's a good way for a user to update the .JSON file through a textbox UI? As in: [textbox - update username] [update button] - username sent to server - .JSON file updated - [textblock - showing updated username in UI]. I'm not looking for exact code solutions, I'm rather looking for good solutions on this, and/or if this is a terrible idea of an easy database(?).

    Read the article

  • Process Close does not close a process when performed in a SetTimer label

    - by NbdNnm
    The script below creates a child process to perform FileExist() separately from the main script so that it avoids halting the script when an unknown network path is passed. However, the command, Process close, does not close the given process despite its ErrorLevel indicates it succeeded to close. Task Manager shows the child process still exists. FileExistTimeout() ; this checks if the necessary parameters are passed ; this checks if the given path exists by creating a child process with the given timeout PathToCheck := "\\1.2.3.4\test" msgbox, 64, Test Result, % FileExistTimeout(PathToCheck) "`n" ErrorLevel FileExistTimeout(strPath="", nTimeout=1000, strSwitch="/fe") { global strParam1 = %1% strParam2 = %2% ; if the function is used to check the script parameters if (strPath="") { if (strParam2 = strSwitch) && strParam1 ; this means the function is placed at the beginning of the script. ExitApp % (FileExist(strParam1) != "") + 1 ; Return 1 or 2. Return } ; create a child process to check the path tooltip, RunWait is performing.... SetTimer, FileExistTimeout, % -1 * nTimeout RunWait "%A_AhkPath%" "%A_ScriptFullPath%" "%strPath%" "%strSwitch%",,, nPID SetTimer, FileExistTimeout, Off ; Disable the timer (if it hasn't fired already). tooltip ; ErrorLevel contains the exit code of the process (from RunWait). if ErrorLevel = 2 ; found return true else if ErrorLevel = 1 ; not found return return ; timeout FileExistTimeout: Process Close, %nPID% ; Timed out - terminate the process. tooltip, % "Process Closed: " ErrorLevel "`n" "Used Pid: " nPID,,, 2 return }

    Read the article

  • How do you pass SOME_LIB="-lmylib -lmylib2" in a BUILD_COMMAND for ExternalProject_Add()?

    - by Bill Katz
    I'm trying to pass a quoted string through BUILD_COMMAND in ExternalProject_Add() and every way I try it's getting mangled. The code is this: set (mylibs "-lmylib -lmylib2") ExternalProject_Add(Foo URL http://foo BUILD_COMMAND make SOME_LIB=${mylibs} BUILD_IN_SOURCE 1 ...) I've tried using backslash quotes, double quotes, inlining the whole thing, but every time, either the whole SOME_LIB=... part gets quoted or my injected quotes get escaped. Is it not possible to get quotes through to the command line?

    Read the article

  • delete function and upload

    - by Jesper Petersen
    it must be said that I download the database and all my function is in class. That's how I was incredible pleased function and think they are nice .. That's how I'm going to build a gallery where the id of the upload to the site if it fits with the id_session is log in page, you have the option to delete it. and so it must just go back to / latest pictures / when it delete it from the folder and database. but it comes up with an error as you can see here; Fatal error: Call to a member function bind_param () on a non-object in / home / jesperbo / public_html / mebe.dk / function / function.php on line 411 It is such that I am also in the process of building an upload system where the underlying database and make it smaller after what I have now set it and when it did the 2 things must send me back to / latest-images / but it do not reach the only available picture up on the server and do it with the picture but it will not go back in some way at all. So to / latest-images / Where wrong with it to delete, etc. I lie just here, $stm1->bind_param('i', $id_gallery); function img_slet_indhold(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { if($stmt = $this->mysqli->prepare('SELECT `title` FROM `gallery` WHERE `id_gallery` = ?')) { $stm1->bind_param('i', $id_gallery); $id_gallery = $_GET["id_gallery"]; $stm1->execute(); $stm1->store_result(); $stm1->bind_result($title); $UploadDir = "/gallery/"; //ligger i toppen af documentet, evt som en define if($stm1->fetch()) { $tmpfile = $UploadDir . "" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } $tmpfile = $UploadDir . "lille/" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } $tmpfile = $UploadDir . "store/" . $title; if(file_exists($tmpfile)) { unlink($tmpfile); } } $stm1->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } if($stmt = $this->mysqli->prepare('DELETE FROM `gallery` WHERE `id_gallery` = ?' )) { $stmt->bind_param('i', $id); $id = $_GET["id_gallery"]; $stmt->execute(); header('Location: /nyeste-billeder/'); $stmt->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } So into the file as it should delete from, I have chosen to do so here; <?php session_start(); require_once ("function/function.php"); $mebe = new mebe; $db = $mebe->db_c(); error_reporting(E_ERROR); $img_slet_indhold = $mebe->img_slet_indhold(); ?> So when I upload image to folder and database, and just after can be returned when uploading function img_indhold(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { include "function/class.upload.php"; $handle = new Upload($_FILES["filename"]); if($handle->uploaded) { //lidt mere store billeder $handle->image_resize = true; $handle->image_ratio_y = true; $handle->image_x = 220; $handle->Process("gallery/store"); //til profil billede lign.. $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_y = 115; $handle->image_x = 100; $handle->Process("gallery"); //til profil billede lign.. $handle->image_resize = true; $handle->image_ratio_crop = true; $handle->image_y = 75; $handle->image_x = 75; $handle->Process("gallery/lille"); $pb = $handle->file_dst_name; } if($stmt = $this->mysqli->prepare('INSERT INTO `gallery` (`title`, `id_bruger`) VALUES (?, ?)')) { $stmt->bind_param('si', $title, $id_bruger); $title = $pb; $id_bruger = $_SESSION["id"]; $stmt->execute(); header('Location: /nyeste-billeder/'); $stmt->close(); } } } So when I call it on the page when it is required to do so do it like this; <?php session_start(); require_once ("function/function.php"); $mebe = new mebe; $db = $mebe->db_c(); error_reporting(E_ERROR); $img_slet_indhold = $mebe->img_slet_indhold(); ?> it is here as to when I will upload to the site and show gallery / pictures on the page function vise_img(){ if ($stmt = $this->mysqli->prepare('SELECT `id_gallery`, `title`, `id_bruger` FROM `gallery` ORDER BY `gallery`.`id_gallery` DESC')) { $stmt->execute(); $stmt->store_result(); $stmt->bind_result($id_gallery, $title, $id_bruger); while ($stmt->fetch()) { echo "<div id=\"gallery_box\">"; echo "<a href=\"/profil/$id_bruger/\"><img src=\"/gallery/$title\" alt=\"\" height=\"115\" width=\"100\" border=\"0\"></a>"; if($_SESSION["logged_in"]) { if($id_bruger == $_SESSION["id"]) { echo "<ul>"; echo "<li><a href=\"/nyeste-billeder-slet/$id_gallery/\">Slet</a></li>"; echo "</ul>"; } } echo "</div>"; } /* Luk statement */ $stmt->close(); } else { /* Der er opstået en fejl */ echo 'Der opstod en fejl i erklæringen: ' . $mysqli->error; } } function upload_img(){ if($_SESSION["logged_in"] = true && $_SESSION["rank"] == '1' || $_SESSION["rank"] == 2) { ?> <form name="opslag" method="post" action="/nyeste-ok/" enctype="multipart/form-data"> <input type="file" name="filename" id="filename" onchange="checkFileExt(this)"> <input name="upload" value="Upload" id="background_indhold" onclick="return check()" type="submit"> </form> <?php } elseif ($_SESSION["logged_in"] != true && $_SESSION["rank"] != '1' || $_SESSION["rank"] != 2) { echo "<p>Du har ingen mulighed for at upload billeder på siden</p>"; } } Really hope you are able to help me further!

    Read the article

  • C++Math evaluating incorrectly

    - by Hayden
    I thought I can make life a little easier in data statistics by making a small program which returns the results of sampling distribution of the mean (with standard error). It does this part successfully but in an attempt to return the z-score by using the formula I found here, it returns -1#IND. My interpretation of that formula is: ((1/(sqrt(2*pi)*stdev))*pow(e, (normalpow)) where double normalpow=-0.5*((mean-popmean)*(mean-popmean)/stdev) I did a little more investigating and found that (mean-popmean)*(mean-popmean) was evaluating to 0 no matter what. How can I get around this problem of normalpow evaluating to 0.

    Read the article

  • You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

    - by user1810442
    Hi I keep getting SQL syntax error when i'm running my code in php, however when i remove the variables and do it manually in MYSQL, not a problem. I've tried 2 different versions of query one with (') and other with (") and nothing. Could you please help? Thank you. $produpdateid = $_GET ['id']; $varcat = $_POST['category']; $vartitle = strip_tags($_POST['title']); $varoverview = strip_tags($_POST['overview']); $varfeatures = strip_tags($_POST['features']); $varspecification = strip_tags($_POST['specification']); $varmaker = strip_tags($_POST['maker']); $varsize = $_POST['size']; $varprice = $_POST['price']; $varstock = $_POST['stock']; $vartype = $_POST['stock']; $q = 'UPDATE products SET products_category_id=' . $varcat . ', title=' . $vartitle . ', overview=' . $varoverview . ', features=' . $varfeatures . ', specification=' . $varspecification . ', size=' . $varsize . ', size_type=' . $vartype . ', maker=' . $varmaker . ', image=' . $varimg . ', price=' . $varprice . ', stock=' . $varstock .' WHERE id=' .$produpdateid; /*$test = "UPDATE products SET products_category_id=" . $varcat . ", title=" . $vartitle . ", overview=" . $varoverview . ", features=" . $varfeatures . ", specification=" . $varspecification . ", size=" . $varsize . ", size_type=" . $vartype . ", maker=" . $varmaker . ", image=" . $varimg . ", price=" . $varprice . ", stock=" . $varstock ." WHERE id=" .$produpdateid;*/ $updateresult = mysqli_query($dbc,$q);

    Read the article

  • Input html tag not parsing properly in php

    - by Akaash
    I have a database with names that I would like displayed in the form of a table with checkboxes. Everything works until I try to place the html tag into my php code. When I put the input tag in it gives me the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' I can't see where I would put a comma or semi colon. <form> <?php $name = $_POST['name']; $host = "mysql16.000webhost.com"; $user_name = "a1611480_akaash"; $pwd = "****"; $database_name = "a1611480_akaash"; $db = mysql_connect($host, $user_name, $pwd); mysql_select_db($database_name); $result = mysql_query("SELECT name FROM Sort"); $var = array(); while ($row = mysql_fetch_array($result)) { $var[] = $row['name']; } $unique = array_unique($var); foreach ($unique as $value) { echo "<p class = Body_text><label>$value</label> <input type="checkbox" name="name" value="$value" /> </p>\n"; } ?> </form>

    Read the article

  • Saving generated .wav file to server with PHP

    - by bionicOnion
    I am developing a website where users can compose their own music, and the site will generate a .wav file for their creation. This is working correctly (inasmuch as I can play it on the page). However, I would like to save this file to the server to be listened to/downloaded at a later time, and the saved version of the file can no longer be opened and played by the HTML audio tag. What, if anything, must I put into the file besides the file besides the raw data? Instead of setting the src attribute of the audio tag to the location of the file, will I actually need to open it and generate a URI?

    Read the article

  • How to build a tree from a list of items and their children recursively in php?

    - by k1lljoy
    I have a list of items stored in the DB, simplified schema is like this: id, parent, name I need to generate a tree structure (in a form of a multi-dimensional array) that can be infinite levels deep. Top level items would have parent = 0. Next level down would have parent equal to the the id of the parent item, fairly straight forward. What would be the best way to do this, while consuming as little resources as possible?

    Read the article

  • Equality and Assigment Operators

    - by Jeremy Smith
    I have a assembly compiled in VB.NET that contains two operators: Public Shared Operator =(quarterA As CalendarQuarter, quarterB As CalendarQuarter) As Boolean Return quarterA.StartDate = quarterB.StartDate AndAlso quarterA.EndDate = quarterB.EndDate AndAlso quarterA.Quarter = quarterB.Quarter End Operator Public Shared Operator <>(quarterA As CalendarQuarter, quarterB As CalendarQuarter) As Boolean Return Not (quarterA = quarterB) End Operator However, when using the assembly in C# to perform equality checks if (qtr != null) I receive the error: Cannot implicity convert type 'object' to 'bool' My original intent with the = operator was only for assignment purposes in VB, so I may be way off base (I don't use custom operators too often). What do I need to do to make the operator behave with both equality and assignment operations?

    Read the article

  • how to load files in python

    - by Alvaro
    I'm fairly new to python and would like some help on properly loading separate files. My codes purpose is to open a given file, search for customers of that file by the state or state abbreviation. However, i have a separate function to open a separate file where i have (name of state):(state abbreviation) Thanks. def file_state_search(fileid, state): z=0 indx = 0 while z<25: line=fileid.readline() data_list = ("Name:", "Address:", "City:", "State:", "Zipcode:") line_split = line.split(":") if state in line: while indx<5: print data_list[indx], line_split[indx] indx = indx + 1 elif state not in line: z = z + 1 def state_convert(fileid, state): line2=in_file2.readline() while state in line2: print line2 x=1 while x==1: print "Choose an option:" print print "Option '1': Search Record By State" print option = raw_input("Enter an option:") print if option == "1": state = raw_input("Enter A State:") in_file = open("AdrData.txt", 'r') line=in_file.readline() print in_file2 = open("States.txt", 'r') line2=in_file2.readline() converted_state = state_convert(in_file2, state) print converted_state state_find = file_state_search(in_file, state) print state_find x=raw_input("Enter '1' to continue, Enter '2' to stop: ") x=int(x) By the way, my first import statement works, for whatever reason my second one doesn't. Edit: My question is, what am i doing wrong in my state_convert function.

    Read the article

  • File Output in Powershell without Extension

    - by CaptHowdy
    Here is what I have so far: Get-ChildItem "C:\Folder" | Foreach-Object {$_.Name} > C:\Folder\File.txt When you open the output from above, File.txt, you see this: file1.txt file2.mpg file3.avi file4.txt How do I get the output so it drops the extension and only shows this: file1 file2 file3 file4 Thanks in advance! EDIT Figured it out with the help of the fellows below me. I ended up using: Get-ChildItem "C:\Folder" | Foreach-Object {$_.BaseName} > C:\Folder\File.txt

    Read the article

  • How to use jxl open file turn off gridlines and save

    - by sally
    I am new to jxl, but I have what I think is a pretty simple requirement. I want to take an existing .xls file with three tabs, turn off the gridlines on all 3, and then save it again. It looks from the API like there is a function to handle gridlines setPrintGridLines(boolean b) I would love it if someone could give me sample code - or a link pointing me in the right direction - on how to do this. Thank you in advance Here is what I've tried (bear with me, like I said I'm brand new to jxl) WorkbookSettings ws = new WorkbookSettings(); WritableWorkbook workbook = Workbook.createWorkbook(new File(xlsFile), ws); WritableSheet[] w = workbook.getSheets(); for ( WritableSheet sheet : w ) { sheet.getSettings().setPrintGridLines(false); } workbook.write(); workbook.close(); I get the error Could not generate XLS. Index: 0, Size: 0 but I may be totally off base in what I am trying

    Read the article

  • How do I resolve "Unable to resolve attribute [organizationType.id] against path" exception?

    - by Dave
    I'm using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, JUnit 4.8, and JPA 2.0 (hibernate-jpa-2.0-api). I'm trying to write a query and search based on fields of member fields. What I mean is I have this entity … @GenericGenerator(name = "uuid-strategy", strategy = "uuid.hex") @Entity @Table(name = "cb_organization", uniqueConstraints = {@UniqueConstraint(columnNames={"organization_id"})}) public class Organization implements Serializable { @Id @NotNull @GeneratedValue(generator = "uuid-strategy") @Column(name = "id") /* the database id of the Organization */ private String id; @ManyToOne @JoinColumn(name = "state_id", nullable = true, updatable = false) /* the State for the organization */ private State state; @ManyToOne @JoinColumn(name = "country_id", nullable = false, updatable = false) /* The country the Organization is in */ private Country country; @ManyToOne(optional = false) @JoinColumn(name = "organization_type_id", nullable = false, updatable = false) /* The type of the Organization */ private OrganizationType organizationType; Notice the members "organizationType," "state," and "country," which are all objects. I wish to build a query based on their id fields. This code @Override public List<Organization> findByOrgTypesCountryAndState(Set<String> organizationTypes, String countryId, String stateId) { CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Organization> criteria = builder.createQuery(Organization.class); Root<Organization> org = criteria.from(Organization.class); criteria.select(org).where(builder.and(org.get("organizationType.id").in(organizationTypes), builder.equal(org.get("state.id"), stateId), builder.equal(org.get("country.id"), countryId))); return entityManager.createQuery(criteria).getResultList(); } is throwing the exception below. How do I heal the pain? java.lang.IllegalArgumentException: Unable to resolve attribute [organizationType.id] against path at org.hibernate.ejb.criteria.path.AbstractPathImpl.unknownAttribute(AbstractPathImpl.java:116) at org.hibernate.ejb.criteria.path.AbstractPathImpl.locateAttribute(AbstractPathImpl.java:221) at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:192) at org.mainco.subco.organization.repo.OrganizationDaoImpl.findByOrgTypesCountryAndState(OrganizationDaoImpl.java:248) at org.mainco.subco.organization.repo.OrganizationDaoTest.testFindByOrgTypesCountryAndState(OrganizationDaoTest.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >