Daily Archives

Articles indexed Monday September 24 2012

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

  • Syncing large personal school-material -git-repo with things such as casual notes? Rsync, wget and Git -- or some ready tool?

    - by hhh
    My friend wants to store electrically her school -notes and process them fast, with backups. She has over 2GB -size repo already and growing all the time (mostly appended material i.e. more school notes, different formats, pdf, pictures and scanned, some text -files, etc). The goal of my friend is to process fast the notes. I suggested command like this here i.e. "# crontab -e @weekly wget --random-wait -e robots=off -U mozilla -mirror http://VeryLong.com". But I think plugging in Rsync somewhere could make it much better with Git. How would you help my friend to process and store the school -material under Git-version-controlling and still keep the size reasonable? Perhaps related rsync .git directory rsync git big repository Different scope Git/rsync mix for projects with large binaries and text files What's a good way to organize a large collection of personal scripts using git?

    Read the article

  • s3cmd setacl to grant 'Authenticated Users'

    - by rynop
    I'm using jgit to create a remote in s3. Problem I'm having is when I do a jgit push s3 master it creates the files in s3 as owned by me. I want to keep the files private, and be read/write by 'Authenticated users'. I'd like to be able to either set acl: authenticated-read in the ~/.jgit file OR be able to modify the acl after the push: s3cmd --add-header=x-amz-acl:authenticated-read setacl --acl-private s3://my.bucket/repo/* Neither of these work. How do i use jgit and push to s3 and keep it private, and let anyone with auth read/write?

    Read the article

  • show activity indicator while loading ViewController

    - by Crystal
    I have a ViewController that takes time to load its views. When I run Instruments, I see from the home screen, if I tap on the icon that pushes that view controller onto the stack, it's half laying out the views, and half getting the data for the views. I tried adding an activity indicator to display on the home screen over the button when the button is pressed to push the LongRunningViewController onto the stack. So I basically do this: - (IBAction)puzzleView:(id)sender { dispatch_async(dispatch_get_main_queue(), ^{ [self.activityIndicator startAnimating]; }); PuzzleViewController *detailViewController = [[[PuzzleViewController alloc] init] autorelease]; [self.navigationController pushViewController:detailViewController animated:YES]; [self.activityIndicator stopAnimating]; }

    Read the article

  • Notify a content resolver when normal sql insert or update

    - by user1400538
    I have created a small content provider (which I only use to query a db table and fetch some value). I have confirmed that the provider works fine. The table values get updated on a regular basis through normal sql insertions(and not through anycontent provider) Whenever an insert/update or delete occurs through a normal sqlite operation as mentioned above, I need to notify the content resolvers which was written to communicate with the content provider just for quering database and fetch some values. Is this, possible? If yes what need to be done? Any help is appreciated.

    Read the article

  • Need help searching a MySQL db using a SELECT DISTINCT result

    - by user1695645
    So I am new to MySQL and am having a bit of trouble. I have one table called book_genres and another called books. book_genres +-------+---------+ |book_id| genre | +-------+---------+ | 1 | Horror | | 1 | Comedy | | 2 | Romance | | 2 | Comedy | +-------+---------+ books +-------+---------+ |book_id| title | +-------+---------+ | 1 | A Book | | 2 | B Book | | 3 | C Book | +-------+---------+ I am using the following command to pull all the book_ids that have 3 selected genres: SELECT DISTINCT a.book_id, b.genre AS genre1, c.genre AS genre2, d.genre AS genre3 FROM book_genres a JOIN book_genres b ON a.book_id = b.book_id AND b.genre LIKE 'Romance' JOIN book_genres c ON a.book_id = c.book_id AND c.genre LIKE 'Action' JOIN book_genres d ON a.book_id = d.book_id AND d.genre LIKE 'Comedy' GROUP BY book_id What I want to do is now pull all of the book titles from the books table using the book_ids found in this search. I'm not sure if there is an easier way to do this or not, but this was all that I could come up with. Thank you for anyone who can help!

    Read the article

  • What is the fastest way to get the persisted object after calling Hibernate's saveOrUpdate?

    - by Dave
    I'm using Hibernate 3.2.1.ga, hibernate annotations 3.2.1.ga, and hibernate-jpa-2.0-api. I can't upgrade at this time as I'm working with legacy code. I have this generic method for saving or updating objects ... protected void saveOrUpdate(Object obj) { final Session session = sessionFactory.getCurrentSession(); session.saveOrUpdate(obj); } You can assume that every argument, "obj," will have a member field that is marked with the "@Id" annotation. I would like to change the return type to return an Object that represents the persisted object in the database (meaning if "obj" didn't contain an id before, what is returned is the database object with a populated id. What is the fastest way to do this given my versioning and generic constraints?

    Read the article

  • PHP inheriting/extending a particular instance of an Object

    - by delta9
    Is there any way to force PHP to extend an existing/particular (and for that matter, already instantiated) instance of an object? This imaginary code should explain what I am wondering: class Base { public $var; function __construct($var){ $this->var = $name; } } class Extender extends Base { function __construct($parent) { parent = $parent; } } $base = new Base('yay!'); $extender = new Extender($base); echo 'Extended base var value: '.$extender->var.'<br/>'; Output (would be): Extended base var value: yay! To be clear, I am wanting to instantiate an object that extends a PARTICULAR INSTANCE of another object, one that has already been instantiated. I am aware that I can pass a reference to an object to another object (via it's constructor function) and then add it as a property of the receiving object, I'm wondering if there is a real way to do this?

    Read the article

  • Can I upgrade UIRequiredDeviceCapabilities from opengles-1 to opengles-2 in iOS app

    - by michael
    Hi I’m upgrading my app from cocos2d-x 1.x to 2.x that means change from OpenGLES 1.0 to 2.0, I've updated my Info.plist settings to reflect the change <key>UIRequiredDeviceCapabilities</key> <dict> <key>accelerometer</key> <true/> <key>opengles-2</key> <true/> </dict> Change from opengles-1 to opengles-2 But while installing application from XCode 4.5 GM (the older version was compiled with prevoius XCode) I receive error: Could not change executable permissions on the application

    Read the article

  • XCode with boost "Sematic Issue - undeclared identifier va_start"

    - by Paulo Henrique
    C++locale.h ->Semantic Issue -->Use of undeclared identifier 'va_start' ->Semantic Issue -->Use of undeclared identifier 'va_end' First time using boost, downloaded it using ports and created a command line project in XCode. Header Search Path: /usr/include/** There is nothing in the code yet, just the main function that comes with the default proj. Just don't know what to do, never expected this to happen.

    Read the article

  • Error using 'send_file' for ruby/rails - help appreciated

    - by user1653279
    I am trying to create a link to download a file from the file system. For this, I define the following in the "license_helper.rb" file: def license_download_link(license, link_text = nil) if link_text.blank? link_text = image_tag("download_icon.png", :border => 0, :width => 32, :height =>32, :alt => 'Download License', :title => 'Download License') end tempLicenseFile = "tempLicense.xml" File.open("#{tempLicenseFile}", 'w') do |tf| tf.puts license.data end command = "./runLicenseEncoder.bat #{tempLicenseFile}" generateEncryptedLicenseFile = `#{command}` theLicenseFile = "license.xml" link_to link_text, "license/download" end My "view" just calls this helper class: <td><%= license_download_link(license, ' ') %></td> In the 'routes.rb' file, I have defined the following: map.licensedownload "license.xml", :controller = 'licenses', :action = 'download' map.download "/licenses/download", :controller = 'licenses', :action = 'download' In the 'controller', I have 'licenses_controller.rb' which includes the following: def download theLicense = @license licenseFileName = "license.xml" send_file "#{licenseFileName}" , :type => "application/xml", :filename => "#{licenseFileName}" end However, I am unable to obtain the '@license' attribute from the database in the controller. Could someone please let me know what I am doing wrong here and why I am unable to get the value for "@license". Thanks for your time, Regards, --- AJ

    Read the article

  • perror() give seg. fault

    - by Jack
    After an error occurs, I call perror(), naturally. But I'm getting a segmentation fault when I do this or printf("error: %s\n", strerror(errno)); I have no idea what is happing. int fd; if((fd = open(FILENAME, O_RDONLY)) == -1) { perror("fbi"); exit(1); } for(;;) { readed = read(fd, buffer, BUFSIZE); if(readed == 0) break; if(readed == -1) { perror("fbi"); // <- here's the error exit(1); } How to fix this?

    Read the article

  • java regex illegal escape character error not occurring from command line arguments

    - by Shades88
    This simple regex program import java.util.regex.*; class Regex { public static void main(String [] args) { System.out.println(args[0]); // #1 Pattern p = Pattern.compile(args[0]); // #2 Matcher m = p.matcher(args[1]); boolean b = false; while(b = m.find()) { System.out.println(m.start()+" "+m.group()); } } } invoked by java regex "\d" "sfdd1" compiles and runs fine. But if #1 is replaced by Pattern p = Pattern.compile("\d");, it gives compiler error saying illegal escape character. In #1 I also tried printing the pattern specified in the command line arguments. It prints \d, which means it is just getting replaced by \d in #2. So then why won't it throw any exception? At the end it's string argument that Pattern.compile() is taking, doesn't it detect illegal escape character then? Can someone please explain why is this behaviour?

    Read the article

  • Incorrect output on changing sequence of declarations

    - by max
    Writing C++ code to implement Sutherland-Hodgeman polygon clipping. This order of declaration of these 2 statements gives correct output, reverse does not. int numberOfVertices = 5; Point pointList[] = { {50,50}, {200,300}, {310,110}, {130,90}, {70,40} }; I am passing the polygon vertex set to clippers in order - LEFT, RIGHT, TOP, BOTTOM. The exact error which comes when the declarations are reversed is that the bottom clipper, produces an empty set of vertices so no polygon is displayed after clipping. Correct: Incorrent: Confirmed by outputting the number of vertices produced after each pass: Correct: Incorrect: What is the reason for this error? Code: #include <iostream> #include <GL/glut.h> #define MAXVERTICES 10 #define LEFT 0 #define RIGHT 1 #define TOP 2 #define BOTTOM 3 using namespace std; /* Clipping window */ struct Window { double xmin; double xmax; double ymin; double ymax; }; struct Point { double x; double y; }; /* If I interchange these two lines, the code doesn't work. */ /**************/ int numberOfVertices = 5; Point pointList[] = { {50,50}, {200,300}, {310,110}, {130,90}, {70,40} }; /**************/ const Window w = { 100, 400, 60, 200 }; /* Checks whether a point is inside or outside a window side */ int isInside(Point p, int side) { switch(side) { case LEFT: return p.x >= w.xmin; case RIGHT: return p.x <= w.xmax; case TOP: return p.y <= w.ymax; case BOTTOM: return p.y >= w.ymin; } } /* Calculates intersection of a segment and a window side */ Point intersection(Point p1, Point p2, int side) { Point temp; double slope, intercept; bool infinite; /* Find slope and intercept of segment, taking care of inf slope */ if(p2.x - p1.x != 0) { slope = (p2.y - p1.y) / (p2.x - p1.x); infinite = false; } else { infinite = true; } intercept = p1.y - p1.x * slope; /* Calculate intersections */ switch(side) { case LEFT: temp.x = w.xmin; temp.y = temp.x * slope + intercept; break; case RIGHT: temp.x = w.xmax; temp.y = temp.x * slope + intercept; break; case TOP: temp.y = w.ymax; temp.x = infinite ? p1.x : (temp.y - intercept) / slope; break; case BOTTOM: temp.y = w.ymin; temp.x = infinite ? p1.x : (temp.y - intercept) / slope; break; } return temp; } /* Clips polygon against a side, updating the point list (called once for each side) */ void clipAgainstSide(int sideToClip) { int i, j=0; Point s,p; Point outputList[MAXVERTICES]; /* Main algorithm */ s = pointList[numberOfVertices-1]; for(i=0 ; i<numberOfVertices ; i++) { p = pointList[i]; if(isInside(p, sideToClip)) { /* p inside */ if(!isInside(s, sideToClip)) { /* p inside, s outside */ outputList[j] = intersection(p, s, sideToClip); j++; } outputList[j] = p; j++; } else if(isInside(s, sideToClip)) { /* s inside, p outside */ outputList[j] = intersection(s, p, sideToClip); j++; } s = p; } /* Updating number of points and point list */ numberOfVertices = j; /* ERROR: In last call with BOTTOM argument, numberOfVertices becomes 0 */ /* all earlier 3 calls have correct output */ cout<<numberOfVertices<<endl; for(i=0 ; i<numberOfVertices ; i++) { pointList[i] = outputList[i]; } } void SutherlandHodgemanPolygonClip() { clipAgainstSide(LEFT); clipAgainstSide(RIGHT); clipAgainstSide(TOP); clipAgainstSide(BOTTOM); } void init() { glClearColor(1,1,1,0); glMatrixMode(GL_PROJECTION); gluOrtho2D(0,1000,0,500); } void display() { glClear(GL_COLOR_BUFFER_BIT); /* Displaying ORIGINAL box and polygon */ glColor3f(0,0,1); glBegin(GL_LINE_LOOP); glVertex2i(w.xmin, w.ymin); glVertex2i(w.xmin, w.ymax); glVertex2i(w.xmax, w.ymax); glVertex2i(w.xmax, w.ymin); glEnd(); glColor3f(1,0,0); glBegin(GL_LINE_LOOP); for(int i=0 ; i<numberOfVertices ; i++) { glVertex2i(pointList[i].x, pointList[i].y); } glEnd(); /* Clipping */ SutherlandHodgemanPolygonClip(); /* Displaying CLIPPED box and polygon, 500px right */ glColor3f(0,0,1); glBegin(GL_LINE_LOOP); glVertex2i(w.xmin+500, w.ymin); glVertex2i(w.xmin+500, w.ymax); glVertex2i(w.xmax+500, w.ymax); glVertex2i(w.xmax+500, w.ymin); glEnd(); glColor3f(1,0,0); glBegin(GL_LINE_LOOP); for(int i=0 ; i<numberOfVertices ; i++) { glVertex2i(pointList[i].x+500, pointList[i].y); } glEnd(); glFlush(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(1000,500); glutCreateWindow("Sutherland-Hodgeman polygon clipping"); init(); glutDisplayFunc(display); glutMainLoop(); return 0; }

    Read the article

  • Force Hibernate To Save A Specific POJO

    - by user1695626
    I have some code calling a webservice and it returns an id. I am saving this id in the database using hibernate. I have a filter that opens the session and commits it, rolling back when any exception occurs within the contained code. Since there is no way to get back the id returned by the webservice I would like to save this in the database EVEN if there is an exception that occurred later on in the code. Is there anyway to do this using the same session?

    Read the article

  • What's the most DRY-appropriate way to execute an SQL command?

    - by Sean U
    I'm looking to figure out the best way to execute a database query using the least amount of boilerplate code. The method suggested in the SqlCommand documentation: private static void ReadOrderData(string connectionString) { string queryString = "SELECT OrderID, CustomerID FROM dbo.Orders;"; using (SqlConnection connection = new SqlConnection(connectionString)) { SqlCommand command = new SqlCommand(queryString, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); try { while (reader.Read()) { Console.WriteLine(String.Format("{0}, {1}", reader[0], reader[1])); } } finally { reader.Close(); } } } mostly consists of code that would have to be repeated in every method that interacts with the database. I'm already in the habit of factoring out the establishment of a connection, which would yield code more like the following. (I'm also modifying it so that it returns data, in order to make the example a bit less trivial.) private SQLConnection CreateConnection() { var connection = new SqlConnection(_connectionString); connection.Open(); return connection; } private List<int> ReadOrderData() { using(var connection = CreateConnection()) using(var command = connection.CreateCommand()) { command.CommandText = "SELECT OrderID FROM dbo.Orders;"; using(var reader = command.ExecuteReader()) { var results = new List<int>(); while(reader.Read()) results.Add(reader.GetInt32(0)); return results; } } } That's an improvement, but there's still enough boilerplate to nag at me. Can this be reduced further? In particular, I'd like to do something about the first two lines of the procedure. I don't feel like the method should be in charge of creating the SqlCommand. It's a tiny piece of repetition as it is in the example, but it seems to grow if transactions are being managed manually or timeouts are being altered or anything like that.

    Read the article

  • Excel VBA: Error Handling with Case Statement

    - by AME
    I am trying to validate a file that is uploaded by the user using the code below. The error handler checks the top row of the uploaded file for three specific column names. If one or more of the column names is not present, the program should return a prompt to the user notifying them which column(s) are missing from the file that they uploaded and then close the file. There are a couple issues with my current VBA code that I am seeking help with: The prompt doesn't specify which column(s) are missing to the user. The error handler is triggered even when all required columns are present in the uploaded file. Code: Sub getworkbook() ' Get workbook... Dim ws As Worksheet Dim filter As String Dim targetWorkbook As Workbook, wb As Workbook Dim Ret As Variant Set targetWorkbook = Application.ActiveWorkbook ' get the customer workbook filter = ".xlsx,.xls" caption = "Please select an input file " Ret = Application.GetOpenFilename(filter, , caption) If Ret = False Then Exit Sub Set wb = Workbooks.Open(Ret) On Error GoTo ErrorLine: 'Check for columns var1 = ActiveSheet.Range("1:1").Find("variable1", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var2 = ActiveSheet.Range("1:1").Find("variable2", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var3 = ActiveSheet.Range("1:1").Find("variable3", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column ErrorLine: MsgBox ("The selected file is missing a key data column, please upload a correctly formated file.") If Error = True Then ActiveWorkSheet.Close wb.Sheets(1).Move Before:=targetWorkbook.Sheets("Worksheet2") ActiveSheet.Name = "DATA" End Sub

    Read the article

  • Python Multiword Index

    - by Manab Chetia
    index = {'Michael': [['mj.com',1], ['Nine.com',9],['i.com', 34]], / 'Jackson': [['One.com',4],['mj.com', 2],['Nine.com', 10], ['i.com', 45]], / 'Thriller' : [['Seven.com', 7], ['Ten.com',10], ['One.com', 5], ['mj.com',3]} # In this dictionary (index), for eg: 'KEYWORD': # [['THE LINK in which KEYWORD is present,'POSITION # of KEYWORD in the page specified by link']] eg: Michael is present in MJ.com, NINE.com, and i.com at positions 1, 9, 34 of respective pages. Please help me with a python procedure which takes index and KEYWORDS as input. When i enter 'MICHAEL'. The result should be: >>['mj.com', 'nine.com', 'i.com'] When I enter 'MICHAEL JACKSON'. The result should be : >>['mj.com', 'Nine.com'] as 'Michael' and 'Jackson' are present at 'mj.com' and 'nine.com' consecutively i.e. in positions (1,2) & (9,10) respectively. The result should not show 'i.com' even though it contains both KEYWORDS but they are not placed consecutively. When I enter 'MICHAEL JACKSON THRILLER', the result should be ['mj.com'] as the 3 words 'MICHAEL', 'JACKSON', 'THRILLER' are placed consecutively in 'mj.com' ie positions (1, 2, 3) respectively. If I enter 'THRILLER JACKSON' or 'THRILLER FEDERER', the result should be NONE.

    Read the article

  • cygwin c sem_init

    - by RileyVanZeeland
    if((sem_init(sem, 1, 1)) == 1) perror("error initiating sem"); If I include this line of code my program simply starts and exits. I just started learning how to use semaphores. I'm using cygwin and when this line is commented out the printf's ABOVE this print to console but when include this, nothing happens. I did the following to get cygserver going- CYGWIN=server ran /bin/cygserver-config ran /usr/sbin/cygserver for the config it said the cygserver is already running And for the sygserver it saids- initailaizing complete failed to created named pipe: is the daemon already running? fatal error on IPC transport: closing down Any ideas?

    Read the article

  • Update list dom only if list displayed

    - by Nikolaj Borisik
    Sometimes we use one store for few views(list, carousel,dataviews) and when we refresh(load, filter) store data, dom of all view that use this store will be rebuild, but some views is not displayed in this time, and may be will not show with these data. How we can refresh list dom only if it displayed, not every time when it store refresh? Issue examle Ext.define("Test.view.Main", { extend: 'Ext.tab.Panel', config: { tabBarPosition: 'bottom', items: [ ] }, constructor : function(){ this.callParent(arguments); var store = Ext.create('Ext.data.Store',{ data :[ {title : 'One'}, {title : 'Two'}, {title : 'Three'} ] }), firstList = Ext.create('Ext.List',{ title : 'tab1', store : store, itemTpl : '{title}', onItemDisclosure : function(){ store.add({title : 'Four'}); } }), secondList = Ext.create('Ext.List',{ title : 'tab2' , store : store, itemTpl : '{title}' }), thirdList = Ext.create('Ext.List',{ title : 'tab3', store : store, itemTpl : '{title}' }); this.add([ firstList, secondList, thirdList ]) ; } }); When tap on item in the first list, in store will be added new item. And dom of all list will be change although second and third list not displayed I see one option. Create one main store and create separate stores for each views. And when view show fill it store from Main store. But it look not good. Any other ideas?

    Read the article

  • Runtime error in sml function

    - by Rpant
    I am writing this function in sml fun removeNodeswithNoIncoming((x:int,y)::xs,element:int) = if x=element then removeNodeswithNoIncoming (xs , element) else (x,y) :: removeNodeswithNoIncoming (xs , element) | removeNodeswithNoIncoming(nil,element) = nil; the function takes list of tuples [(0,0),(0,1)(1,2)] and another element 0 if first element of the tuples is same as second parameter , it removes it from the list The o/p for the above list should be [(1,2)] Unfortunately , the code is not working for the above input. Though there are other inputs for which it works - removeNodeswithNoIncomingEdge([(0,1),(0,2),(1,2)],0); stdIn:30.1-30.30 Error: unbound variable or constructor: removeNodeswithNoIncomi ngEdge - removeNodeswithNoIncomingEdge([(0,1),(0,2),(1,2),(1,4)],0); stdIn:1.2-1.31 Error: unbound variable or constructor: removeNodeswithNoIncoming Edge

    Read the article

  • jQuery clone chained selects

    - by Volkaria
    I just started from: http://jsfiddle.net/FJFFJ/1/ (by Chain dynamically created dropdowns with JQuery) It's really good but now I need to change a bit: clone the last group of selects. ie.: +- Argentina | San Juan | Rawson Chile | Santiago | Chiñihue Then, if I click at "+", it will clone Chile | Santiago | Chiñihue instead of the first one. Can someone help, please? Thanks on Advance!

    Read the article

  • itextsharp PdfCopy and landscape pages

    - by Andreas Rehm
    I'm using itextsharp to join mutiple pdf documents and add a footer. My code works fine - except for landscape pages - it isn't detecting the page rotation - the footer is not centerd for landscape: public static int AddPagesFromStream(Document document, PdfCopy pdfCopy, Stream m, bool addFooter, int detailPages, string footer, int footerPageNumOffset, int numPages, string pageLangString, string printLangString) { CreateFont(); try { m.Seek(0, SeekOrigin.Begin); var reader = new PdfReader(m); // get page count var pdfPages = reader.NumberOfPages; var i = 0; // add pages while (i < pdfPages) { i++; // import page with pdfcopy var page = pdfCopy.GetImportedPage(reader, i); // get page center float posX; float posY; var rotation = page.BoundingBox.Rotation; if (rotation == 0 || rotation == 180) { posX = page.Width / 2; posY = 0; } else { posX = page.Height / 2; posY = 20f; } var ps = pdfCopy.CreatePageStamp(page); var cb = ps.GetOverContent(); // add footer cb.SetColorFill(BaseColor.WHITE); var gs1 = new PdfGState {FillOpacity = 0.8f}; cb.SetGState(gs1); cb.Rectangle(0, 0, document.PageSize.Width, 46f + posY); cb.Fill(); // Text cb.SetColorFill(BaseColor.BLACK); cb.SetFontAndSize(baseFont, 7); cb.BeginText(); // create text var pages = string.Format(pageLangString, i + footerPageNumOffset, numPages); cb.ShowTextAligned(PdfContentByte.ALIGN_CENTER, printLangString, posX, 40f + posY, 0f); cb.ShowTextAligned(PdfContentByte.ALIGN_CENTER, footer, posX, 28f + posY, 0f); cb.ShowTextAligned(PdfContentByte.ALIGN_CENTER, pages, posX, 20f + posY, 0f); cb.EndText(); ps.AlterContents(); // add page to new pdf pdfCopy.AddPage(page); } // close PdfReader reader.Close(); // return number of pages return i; } catch (Exception e) { Console.WriteLine(e); return 0; } } How do I detect the page rotation (e.g. landscape) format in this case? The given example works for PdfReader but not for PdfCopy. Edit: Why do I need PdfCopy? I tried copying a word pdf export. Some word hyperlinks will not work when you try to copy pages with PdfReader. Only PdfCopy transfers all needed page informations. Edit: (SOLVED) You need to use reader.GetPageRotation(i);

    Read the article

  • How to hide action bar before activity is created, and then show it again?

    - by Ilya Izhovkin
    I need to implements splash screen in my honeycomb app. I use this code in activity's onCreate to show splash: setContentView(R.layout.splash); getActionBar().hide(); and this code to show main UI after some time: setContentView(R.layout.main); getActionBar().show(); But before onCreate is called and splash appears, there is small amount of time when action bar shown. How can I made it not to show? I tried to apply theme to activity without action bar: <item name="android:windowActionBar">false</item> but in that case getActionBar() always returns null and I found no way to show it again.

    Read the article

  • Select one column from a row in hibernate

    - by ComfortablyNumb
    I am trying to do a simple query to get a unique result back in hibernate here is my code. public String getName(Integer id) { Session session = getSessionFactory().openSession(); String name = (String)session.createSQLQuery("SELECT name FROM users WHERE user_id = :userId").setParameter("userId", id).uniqueResult(); return name; } The name that is being returned is stored as HTML text that includes html syntacx language. I think this is what is causing the problem but it doesnt make sense I just want to return it as a string. It is only happening on this one field name, I can get every other field in the row but this one it gives me the error. I am getting an exception. The exception I am getting is No Dialect mapping for JDBC type: -1; nested exception is org.hibernate.HibernateException How do you query for a specific column on a row in hibernate?

    Read the article

  • drupal display submenu when parent has been selected

    - by Steven Cheng
    I've have a menu structure that has a depth of 3 levels on a drupal 6 CMS. When I click on a level 1 that has children, the level 2 menu items display fine. If the level 2 has children, it is not showing the level 3. If I check the expanded box the level 3 is displayed however, it displays all the time irrespective of the level 2 that has been selected. It seems to display whenever it's parent level 1 is selected. For further information, the menu items are a mixture of custom links & content links. i.e. Links I've enetered manually when creating the menu and others generated by when creating a node or view display. All I want is to show the children if there are any for the selected parent. Am I missing something fundamental here? Thanks Steve

    Read the article

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