Search Results

Search found 7897 results on 316 pages for 'generate'.

Page 90/316 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Problem with setVisible (true)

    - by Jessy
    The two examples shown below are same. Both are supposed to produce same result e.g. generate the coordinates of images displayed on JPanel. Example 1, works perfectly (print the coordinates of images), however example 2 returning 0 for the coordinate. I was wondering why because, I have put the setvisible (true) after adding the panel, in both examples. The only difference is that example 1 used extends JPanel and example 2 extends JFrame EXAMPLE 1: public class Grid extends JPanel{ public static void main(String[] args){ JFrame jf=new JFrame(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); final Grid grid = new Grid(); jf.add(grid); jf.pack(); Component[] components = grid.getComponents(); for (Component component : components) { System.out.println("Coordinate: "+ component.getBounds()); } jf.setVisible(true); } } EXAMPLE 2: public class Grid extends JFrame { public Grid () { setLayout(new GridBagLayout()); GridBagLayout m = new GridBagLayout(); Container c = getContentPane(); c.setLayout (m); GridBagConstraints con = new GridBagConstraints(); //construct the JPanel pDraw = new JPanel(); ... m.setConstraints(pDraw, con); pDraw.add (new GetCoordinate ()); // call new class to generate the coordinate c.add(pDraw); pack(); setVisible(true); } public static void main(String[] args) { new Grid(); } }

    Read the article

  • Httaccess Rewriting URL issue: how to distinguish Listing and detail page

    - by Asad kamran
    I am developing an commerce site, Where users can post items in any categories( categories can be 2 to 4 levels) I want to generate URL for listing and details pages: Listing page will show list of items in inner category Detail Page will show all information for item in inner category (Inner category means Last Category in hierarchic i.e. in classified/autos4x4s/mitsubishi/lancer/ inner mean "lancer" Here are the Links i want to generate 1) www.example.com/classified/autos4x4s/mitsubishi/lancer/ (for Listing) 2) www.example.com/classified/autos4x4s/mitsubishi/lancer/2011/3/12/lanc er-2002-in-good-condition-14/ (for detail) I want to redirect to ads.php if just 4 categories exist in url and to detail.php if 6 items are passed(4 category name + 2 date and title) I write these rules: listing ads RewriteRule ^(.)/(.)/(.)/(.)/?$ ads.php?c1=$1&c2=$2&c3=$3&c4=$4 [NC,L] Detail pages RewriteRule ^(.)/(.)/(.)/(.)/(.)/(.)/?$ detail.php?c1=$1&c2=$2&c3=$3&c4=$4&dt=$5&at=$6 [NC,L] But all the sites page redirect to ads.php (Listing page) even home page. I changes the rules as follow: (Even though i donot want to Use Listing and Detail in start of url Why as i see on some site as i want:: dubai.dubizzle.com/classified/autos4x4s/mitsubishi/lancer/2011/3/12/l ancer-2002-in-good-condition-14/) Listing pages RewriteRule ^Listing/(.)/(.)/(.)/(.)/?$ ads.php?c1=$1&c2=$2&c3=$3&c4=$4 [NC,L] Detail pages RewriteRule ^Detail/(.)/(.)/(.)/(.)/(.)/(.)/?$ detail.php?c1=$1&c2=$2&c3=$3&c4=$4&dt=$5&at=$6 [NC,L] Now all other pages are fine, but when i pass www.example.com/classified/autos4x4s/mitsubishi/lancer/2011/3/12/lanc er-2002-in-good-condition-14/ it always goes to Listing page (ads.php) not to detail page. Any help would be appreciated.

    Read the article

  • How can i use complextype class or multi type class is it generic collection?

    - by programmerist
    i need a complex returning type. i have 4 class returning types COMPLEXTYPE must include Company, Muayene, Radyoloji, Satis because i must return data switch case situation how can i do? Maybe i need generic collections How can i do that? public class GenoTipController { public COMPLEXTYPE Generate(DataModelType modeltype) { _Company company = null; _Muayene muayene = null; _Radyoloji radyoloji = null; _Satis satis = null; switch (modeltype) { case DataModelType.Radyoloji: radyoloji = new Radyoloji(); return radyoloji; break; case DataModelType.Satis: satis = new Satis(); return satis; break; case DataModelType.Muayene: muayene = new Muayene(); return muayene; break; case DataModelType.Company: company = new Company(); return company; break; default: break; } } } public class CompanyView { public static List GetPersonel() { GenoTipController controller = new GenoTipController(); _Company company = controller.Generate(DataModelType.Company); return company.GetPersonel(); } } public enum DataModelType { Radyoloji, Satis, Muayene, Company }

    Read the article

  • Generating dynamic css using php and javascript

    - by Onkar Deshpande
    I want to generate tooltip based on a dynamically changing background image in css. This is my my_css.php file. <?php header('content-type: text/css'); $i = $_GET['index']; if($i == 0) $bg_image_path = "../bg_red.jpg"; elseif ($i == 1) $bg_image_path = "../bg_yellow.jpg"; elseif ($i == 2) $bg_image_path = "../bg_green.jpg"; elseif ($i == 3) $bg_image_path = "../bg_blue.jpg"; ?> .tooltip { white-space: nowrap; color:green; font-weight:bold; border:1px solid black;; font-size:14px; background-color: white; margin: 0; padding: 7px 4px; border: 1px solid black; background-image: url(<?php echo $bg_image_path; ?>); background-repeat:repeat-x; font-family: Helvetica,Arial,Sans-Serif; font-family: Times New Roman,Georgia,Serif; filter:alpha(opacity=85); opacity:0.85; zoom: 1; } In order to use this css I added <link rel="stylesheet" href="css/my_css.php" type="text/css" media="screen" /> in my html <head> tag of javascript code. I am thinking of passing different values of 'index' so that it would generate the background image dynamically. Can anyone tell me how should I pass such values from a javascript ? I am creating the tooltip using var tooltip = document.createElement("div"); document.getElementById("map").appendChild(tooltip); tooltip.style.visibility="hidden"; and I think before calling this createElement, I should set background image.

    Read the article

  • How to export Oracle statistics

    - by A_M
    Hi, I am writing some new SQL queries and want to check the query plans that the Oracle query optimiser would come up with in production. My development database doesn't have anything like the data volumes of the production database. How can I export database statistics from a production database and re-import them into a development database? I don't have access to the production database, so I can't simply generate explain plans on production without going through a third party hosting organisation. This is painful. So I want a local database which is in some way representative of production on which I can try out different things. Also, this is for a legacy application. I'd like to "improve" the schema, by adding appropriate indexes. constraints, etc. I need to do this in my development database first, before rolling out to test and production. If I add an index and re-generate statistics in development, then the statistics will be generated around the development data volumes, which makes it difficult to assess the impact my changes on production. Does anyone have any tips on how to deal with this? Or is it just a case of fixing unexpected behaviour once we've discovered it on production? I do have a staging database with production volumes, but again I have to go through a third party to run queries against this, which is painful. So I'm looking for ways to cut out the middle man as much as possible. All this is using Oracle 9i. Thanks.

    Read the article

  • Jquery: how to call the function again?

    - by bakazero
    I'm making the script for easy upload many files. I've tried fyneworks plugin, but the file name does not appear in a form that uses tiny_mce. This is the code: $("document").ready(function () { var i = 0; //iteration for Inputted File var max = 5; //max file uploaded createStatus(); //generate status container $('.imageNow').change(function() { if($(this).val()) { var ext = $(this).val().split('.').pop().toLowerCase(); var allow = [ 'gif', 'png', 'jpg', 'jpeg' ]; if (jQuery.inArray(ext, allow) != -1) { //validation true addImgInput($(this).clone()); $(this).addClass('imgOK'); $(this).removeClass('imageNow'); addImgList($(this).val()); removeImgStatus(); i++; } else { addImgStatus(); $(this).remove(); addImgInput(); } } return false; }); }); This is another function that I use: function addImgInput(inputClone) { $(inputClone).prependTo( $('#upload_images') ); //div container for generated InputFileImg }; function addImgList(listingImg) { $('#list_image_file').append('<li>' + listingImg + '</li>' ); //list all images that have been inputted } function createStatus() { $('#upload_images').append('<small class="status"></small>'); //error display container } function addImgStatus() { $('.status').append('* Wrong File Extension'); //error display text } function removeImgStatus() { $('.status').empty(); } Mmm..yeah is't not finished yet, because when I try to generate another Inputfile with imageNow class, the $('.imageNow').change(function() is not going to work anymore. Does anyone can help me? Thanks

    Read the article

  • How can I superimpose modified loess lines on a ggplot2 qplot?

    - by briandk
    Background Right now, I'm creating a multiple-predictor linear model and generating diagnostic plots to assess regression assumptions. (It's for a multiple regression analysis stats class that I'm loving at the moment :-) My textbook (Cohen, Cohen, West, and Aiken 2003) recommends plotting each predictor against the residuals to make sure that: The residuals don't systematically covary with the predictor The residuals are homoscedastic with respect to each predictor in the model On point (2), my textbook has this to say: Some statistical packages allow the analyst to plot lowess fit lines at the mean of the residuals (0-line), 1 standard deviation above the mean, and 1 standard deviation below the mean of the residuals....In the present case {their example}, the two lines {mean + 1sd and mean - 1sd} remain roughly parallel to the lowess {0} line, consistent with the interpretation that the variance of the residuals does not change as a function of X. (p. 131) How can I modify loess lines? I know how to generate a scatterplot with a "0-line,": # First, I'll make a simple linear model and get its diagnostic stats library(ggplot2) data(cars) mod <- fortify(lm(speed ~ dist, data = cars)) attach(mod) str(mod) # Now I want to make sure the residuals are homoscedastic qplot (x = dist, y = .resid, data = mod) + geom_smooth(se = FALSE) # "se = FALSE" Removes the standard error bands But does anyone know how I can use ggplot2 and qplot to generate plots where the 0-line, "mean + 1sd" AND "mean - 1sd" lines would be superimposed? Is that a weird/complex question to be asking?

    Read the article

  • Deterministic and non uniform long string generation from seed

    - by Limonup
    I had this weird idea for an encryption that I wanted to try out, it may be bad, and it may have done before, but I'm just doing it for fun. The short version of the question is: Is it possible to generate a long, deterministic and non-uniformly distributed string/sequence of numbers from a small seed? Long(er) version: I was thinking to encrypt a text by changing encoding. The new encoding would be generated via Huffman algorithm. To work well, the Huffman algorithm would need a fairly long text with non uniform distribution. Then characters can have different bit-lengths which would be the primary strength of this encryption. The problem is that its impractical to enter in/remember a long text each time you want to decrypt the text. So I was wondering if it was possible to generate a text from password seed? It doesn't matter what the text is, as long as it has non uniform distribution of characters and that the exact same sequence can be recreated each time you give it the same seed. Preferably, are there any functions/extensions in Python that can do this? EDIT: To expand on the "strength" of varying bit length: if I have a string "test", ASCII values 116, 101, 115, 116, which gives bit values of 1110100 1100101 1110011 1110100 Then, say my Huffman algorithm generates encoding like t = 101 e = 1100111 s = 10001 The final string is 101 1100111 10001 101, if we encode this back to ASCII, we get 1011100 1111000 1101000, which is 3 entirely different characters. Obviously its impossible to perform any kind of frequency analysis or something like that on this.

    Read the article

  • JQuery UI Tabs - replace tab and contents

    - by Tauren
    What is the best way to replace the currently selected tab and its contents? The content is dynamically generated with jquery, not loaded via a URL. I need to do this from outside of any tab code or tab event handler (show, add, etc.). There is a link elsewhere on the page that should do the following when clicked: Change the tab's title Change the tab's className Clear out all elements of the tabcontent div Change the tabcontent div's className Generate new content inside the tabcontent div Note that the only reference this link's click() handler has is to the JQuery tabs object ($Tabs). I can get the selected tab with $Tabs.tabs('option','selected'). But how can I get a reference to the selected tab's tab and panel? Inside of a jquery tab handler (show, add, etc.), I have access to ui.tab and ui.panel, but is there a way to get them from a tabs option? Would it be better to simply remove the currently selected tab and then add a new tab in the same index location? I'd have to put the code to generate the tab content into the add() handler then I suppose.

    Read the article

  • URL shortening: using inode as short name?

    - by Licky Lindsay
    The site I am working on wants to generate its own shortened URLs rather than rely on a third party like tinyurl or bit.ly. Obviously I could keep a running count new URLs as they are added to the site and use that to generate the short URLs. But I am trying to avoid that if possible since it seems like a lot of work just to make this one thing work. As the things that need short URLs are all real physical files on the webserver my current solution is to use their inode numbers as those are already generated for me ready to use and guaranteed to be unique. function short_name($file) { $ino = @fileinode($file); $s = base_convert($ino, 10, 36); return $s; } This seems to work. Question is, what can I do to make the short URL even shorter? On the system where this is being used, the inodes for newly added files are in a range that makes the function above return a string 7 characters long. Can I safely throw away some (half?) of the bits of the inode? And if so, should it be the high bits or the low bits? I thought of using the crc32 of the filename, but that actually makes my short names longer than using the inode. Would something like this have any risk of collisions? I've been able to get down to single digits by picking the right value of "$referencefile". function short_name($file) { $ino = @fileinode($file); // arbitrarily selected pre-existing file, // as all newer files will have higher inodes $ino = $ino - @fileinode($referencefile); $s = base_convert($ino, 10, 36); return $s; }

    Read the article

  • Getting Hprof dump for other processes from application code

    - by Natarajan
    Hi, In my application , i have an option to capture the hprof dump. I used android.os.Debug.dumpHprofData (String fileName) Initially i though the hprof data generated by the method above is for the entire device , which is not so . The hprof data generated is only for my process. Now i am trying to generate hprof data for other process as well. I need to get the Hprof dump for all the running processes from application code. from adb shell i tried "kill -10 " , This command will generate the hprof file for the corresponding process in the data/misc folder. Now the problem is this command is working perfectly from the adb shell prompt , but i am not able to embed the command to mycode. My code is like Runtime.getRuntime().exec("chmod 777 /data/misc") Runtime.getRunTime().exec("kill -10 ") No exceptions are thrown , but somehow it is not working. The same code above is capturing Hprof dump for my process, when i give my process ID. I tried with "android.os.Process.sendSignal (int pid, android.os.Process.SIGNAL_USR1) ;" also.Getting the same problem.It is capturing Hprof dump for my process. For other processes it is not working. Do we need to have any special permission to kill other process from our process ? Or is it a built issue ? can you please suggest some possible way to get Hprof dump for other processes from application code? Thanks

    Read the article

  • CGLIB proxy error after spring bean definition loading into XmlWebApplicationContext at runtime

    - by VasylV
    I load additional singleton beans definitions at runtime from external jar file into existing XmlWebApplicationContext of my application: BeanFactory beanFactory = xmlWebApplicationContext.getBeanFactory(); DefaultListableBeanFactory defaultFactory = (DefaultListableBeanFactory)beanFactory; final URL url = new URL("external.jar"); final URL[] urls = {url}; ClassLoader loader = new URLClassLoader(urls, this.getClass().getClassLoader()); defaultFactory.setBeanClassLoader(loader); final ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(defaultFactory); final DefaultResourceLoader resourceLoader = new DefaultResourceLoader(); resourceLoader.setClassLoader(loader); scanner.setResourceLoader(resourceLoader); scanner.scan("com.*"); Object bean = xmlWebApplicationContext.getBean("externalBean"); After all above xmlWebApplicationContext contains all external definitions of beans. But when i am trying to get bean from context exception is thrown: Couldn't generate CGLIB proxy for class ... I saw in debug mode that in the bean initialization process first time proxy is generated by org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator and than it is tried to generate proxy with org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator but fails with mentioned exception.

    Read the article

  • C# DynamicMethod prelink

    - by soywiz
    I'm the author of a psp emulator made in C#. I'm generating lots of "DynamicMethod" using ILGenerator. I'm converting assembly code into an AST, and then generating IL code and building that DynamicMethod. I'm doing this in another thread, so I can generate new methods while the program is executing others so it can run smoothly. My problem is that the native code generation is lazy, so the machine code is generated when the function is called, not when the IL is generated. So it generates in the program executing thread, native code generation is prettly slow as it is the asm-ast-il step. I have tried the Marshal.Prelink method that it is suposed to generate the machine code before executing the function. It does work on Mono, but it doesn't work on MS .NET. Marshal.Prelink(MethodInfo); Is there a way of prelinking a DynamicMethod on MS .NET? I thought adding a boolean parameter to the function that if set, exits the function immediately so no code is actually executed. I could "prelink" that way, but I think that's a nasty solution I want to avoid. Any idea?

    Read the article

  • PHP's openssl_sign generates different signature than SSCrypto's sign

    - by pascalj
    I'm writing an OS X client for a software that is written in PHP. This software uses a simple RPC interface to receive and execute commands. The RPC client has to sign the commands he sends to ensure that no MITM can modify any of them. However, as the server was not accepting the signatures I sent from my OS X client, I started investigating and found out that PHP's openssl_sign function generates a different signature for a given private key/data combination than the Objective-C SSCrypto framework (which is only a wrapper for the openssl lib): SSCrypto *crypto = [[SSCrypto alloc] initWithPrivateKey:self.localPrivKey]; NSData *shaed = [self sha1:@"hello"]; [crypto setClearTextWithData:shaed]; NSData *data = [crypto sign]; generates a signature like CtbkSxvqNZ+mAN... The PHP code openssl_sign("hello", $signature, $privateKey); generates a signature like 6u0d2qjFiMbZ+... (For my certain key, of course. base64 encoded) I'm not quite shure why this is happening and I unsuccessfully experimented with different hash-algorithms. As the PHP documentation states SHA1 is used by default. So why do these two functions generate different signatures and how can I get my Objective-C part to generate a signature that PHPs openssl_verify will accept? Note: I double checked that the keys and the data is correct!

    Read the article

  • How to create closed areas (convex polygons) from set of line segments ?

    - by Marten
    The following problem is in 2D, so some simplifications can be made when suggesting answers. I need to create closed areas (defined either by line segments or just set of points - convex polygon) from a set of points/line segments. Basically I used Voronoi to generate "roads". Then I changed some of the data. Now I need a way to loop through that data (which is still line segments but doesn't comply with Voronoi anymore) and generate "neigbourhoods" that are bordered with the "roads". I looked at some graph diagrams and shortest path theories, but I could not figure it out. Logically it could be done by starting at left edge from one point, finding the way back to that point using the shortest path with available lines (using only clockwise directions). Then mark this line set down and remove from the data. Then you can repeat the same process and get all the areas like that. I tried to implement that but it did not get me anywhere as I could not figure out a way to write a C++ code that could do that. Problem was with choosing the most counterclockwise line from available lines from a specific point. All angle based math I did gave wrong answers because the way sin/cos are implemented in c++. So to summarize - if you can help me with a totally new approach to the problem its good, if not could you help me find a way to write the part of the code that finds the shortest clockwise path back to the beginning point using the line segment set as paths back. Thank you for your help!

    Read the article

  • Encrypt a file base upon a pregenerated "key" C#

    - by Anubis
    Hello everyone. I'm trying to determine the best course of action to implement a simple "licensing" system with a partner of mine. The concept is: Generate an encrypted value based upon several internal hardware components. Have the customer send this value to us which we will implement into our key generator. Once we have that, we add any other restrictions on the license (user, expires, etc.). From there we generate a file which we send to the customer they can add to their installation and voila, happy people about. I have the first part all done. My next part is trying to figure out which encryption methodology I would need to use. I already know Symmetric Encryption is pretty much the only route I can take. Most of the information I have found involves .NET already creating a key from its own internal methods. That's a bit of background, my question is: "Which encryption method could I use which would allow me to encrypt the restrictions based upon the "id" I was given from the customer's computer?" I'm writing this in C# by the way. Any ideas would be greatly appreciated! Take Care!

    Read the article

  • QT4 Designer - Implement Widget

    - by MOnsDaR
    I'm currently trying to get into QT4 and figure out a workflow for myself. While trying to create a widget which allows the user to connect to a hostname:port some questions appeared. The widget itself contains a LineEdit for entering the hostname, a SpinBox for entering the port and a PushButton which should emit a connect(QString hostname, unsigned int port) signal. In QTDesigner I created the necessary Form. It is saved as a .ui-File. Now the big question is how could I implement the widget? Is there a place in QTDesigner where I could add my signal to the Widget? Where could I add custom Properties? I've learned in another tutorial, which showed how to create a Widget in C++, how signals, slots, Q_PROPERTIES etc are defined and added to the widget. But there is no sourcecode in QTDesigner. Another option would be to generate sourcecode using uic. But the header says, that another generate would overwrite any changes to the sourcefiles. So how can I create a QT-widget completely with my own signals, slots and properties by using the QTDesigner for creating the UI and not having to recode everything whenever the UI is changing. Is there some kind of Roundtrip-Engineering? If thats not possible: Whats the sense of creating a Widget with QTDesigner then?

    Read the article

  • I need to speed up a function. Should I use cython, ctypes, or something else?

    - by Peter Stewart
    I'm having a lot of fun learning Python by writing a genetic programming type of application. I've had some great advice from Torsten Marek, Paul Hankin and Alex Martelli on this site. The program has 4 main functions: generate (randomly) an expression tree. evaluate the fitness of the tree crossbreed mutate As all of generate, crossbreed and mutate call 'evaluate the fitness'. it is the busiest function and is the primary bottleneck speedwise. As is the nature of genetic algorithms, it has to search an immense solution space so the faster the better. I want to speed up each of these functions. I'll start with the fitness evaluator. My question is what is the best way to do this. I've been looking into cython, ctypes and 'linking and embedding'. They are all new to me and quite beyond me at the moment but I look forward to learning one and eventually all of them. The 'fitness function' needs to compare the value of the expression tree to the value of the target expression. So it will consist of a postfix evaluator which will read the tree in a postfix order. I have all the code in python. I need advice on which I should learn and use now: cython, ctypes or linking and embedding. Thank you.

    Read the article

  • Howto create dynamic named folders with Maven2 Archetype?

    - by chrsk
    Hey, i try to build a structure like this +---src +---main +---webapp +---WEB-INF +---cfg ¦ +---log4j ¦ +---resources ¦ +---extensions ¦ +---${artifactIdKey}-business ¦ +---${artifactIdKey}-layout +---lib I added a required property to my archetype-metadata.xml to have an short-name for the project, which is used among other things for generating unique folders. <requiredProperties> <requiredProperty key="artifactIdKey" /> </requiredProperties> The property artifactIdKey i use in a fileSet: <fileSet> <directory>[..]/resources/extensions/${artifactIdKey}-business</directory> </fileSet> <fileSet> <directory>[..]/resources/extensions/${artifactIdKey}-layout</directory> </fileSet> The command to generate the archetype: mvn archetype:generate -B \ -DgroupId=com.stackoverflow \ -DartifactId=stackoverflow-question -DarchetypeGroupId=com.stackoverflow \ -DarchetypeArtifactId=stackoverflow-archetype -DarchetypeVersion=1.0 \ -DartifactIdKey=soq I assume to get the following folder structure, but i get the ${artifactIdKey} property as folder. Without beeing replaces. ..\ +---soq-business +---soq-layout ..\ +---${artifactIdKey}-business +---${artifactIdKey}-layout How can i achieve this? And how can i place files below soq-business? Without knowing the folder name at this time?

    Read the article

  • Multiple UIWebViewNavigationTypeBackForward not only false but make inferring the actual url impossi

    - by SG1
    I have a UIWebView and a UITextField for the url. Naturally, I want the textField to always show the current document url. This works fine for urls directly input in the field, but I also have some buttons attached to the view for reload, back, and forward. So I've added all the UIWebViewDelegate methods to my controller, so it can listen to whenever the webView navigates and change the url in the textField as needed. Here's how I'm using the shouldStartLoadWithRequest: method: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { NSLog(@"navigated via %d", navigationType); //loads the user cares about if ( navigationType == UIWebViewNavigationTypeLinkClicked || navigationType == UIWebViewNavigationTypeBackForward ) { //URL setting [self setUrlQuietly:request.URL]; } return YES; } Now, my problem here is that an actual click will generate a single navigation of type "LinkClicked" followed by a dozen type "Other" (redirects and ad loads I assume), which gets handled correctly by the code, but a back/forward action will generate all its requests as back/forward requests. In other words, a click calls setUrlQuietly: once, but a back/forward calls it multiple times. I am trying to use this method to determine if the user actually initiated the action (and I'd like to catch page redirects too). But if the method has no way of distinguishing between an actual "back" and a "load initiated as a result of a back", how can I make this assessment? Without this, I am completely stumped as to how I can only show the actual url and not intermediate urls. Thank you!

    Read the article

  • Website: Make printable version with footnotes?

    - by DavidR
    I have a website that uses editable divs so that a user can modify or make notes to a text. Is there a way I can have the website generate a pdf or some printable document with footnotes, such that if a user has this: <div class="text" id="text_1"> <div class="bodyTest">This is the body text</div> <div class="notes">These are the notes</div> </div> <div class="text" id="text_2"> <div class="bodyTest">This is the body text</div> <div class="notes">These are the notes</div> </div> the website will generate a printable version (or document) in such a way thatdiv.notes will appear as a footnote on the same page on which div#text_1 appears? I don't need a full answer, just a shove in the general direction will be amazing. Thanks.

    Read the article

  • Advice Please: SQL Server Identity vs Unique Identifier keys when using Entity Framework

    - by c.batt
    I'm in the process of designing a fairly complex system. One of our primary concerns is supporting SQL Server peer-to-peer replication. The idea is to support several geographically separated nodes. A secondary concern has been using a modern ORM in the middle tier. Our first choice has always been Entity Framework, mainly because the developers like to work with it. (They love the LiNQ support.) So here's the problem: With peer-to-peer replication in mind, I settled on using uniqueidentifier with a default value of newsequentialid() for the primary key of every table. This seemed to provide a good balance between avoiding key collisions and reducing index fragmentation. However, it turns out that the current version of Entity Framework has a very strange limitation: if an entity's key column is a uniqueidentifier (GUID) then it cannot be configured to use the default value (newsequentialid()) provided by the database. The application layer must generate the GUID and populate the key value. So here's the debate: abandon Entity Framework and use another ORM: use NHibernate and give up LiNQ support use linq2sql and give up future support (not to mention get bound to SQL Server on DB) abandon GUIDs and go with another PK strategy devise a method to generate sequential GUIDs (COMBs?) at the application layer I'm leaning towards option 1 with linq2sql (my developers really like linq2[stuff]) and 3. That's mainly because I'm somewhat ignorant of alternate key strategies that support the replication scheme we're aiming for while also keeping things sane from a developer's perspective. Any insight or opinion would be greatly appreciated.

    Read the article

  • Event feed implementation - will it scale?

    - by SlappyTheFish
    Situation: I am currently designing a feed system for a social website whereby each user has a feed of their friends' activities. I have two possible methods how to generate the feeds and I would like to ask which is best in terms of ability to scale. Events from all users are collected in one central database table, event_log. Users are paired as friends in the table friends. The RDBMS we are using is MySQL. Standard method: When a user requests their feed page, the system generates the feed by inner joining event_log with friends. The result is then cached and set to timeout after 5 minutes. Scaling is achieved by varying this timeout. Hypothesised method: A task runs in the background and for each new, unprocessed item in event_log, it creates entries in the database table user_feed pairing that event with all of the users who are friends with the user who initiated the event. One table row pairs one event with one user. The problems with the standard method are well known – what if a lot of people's caches expire at the same time? The solution also does not scale well – the brief is for feeds to update as close to real-time as possible The hypothesised solution in my eyes seems much better; all processing is done offline so no user waits for a page to generate and there are no joins so database tables can be sharded across physical machines. However, if a user has 100,000 friends and creates 20 events in one session, then that results in inserting 2,000,000 rows into the database. Question: The question boils down to two points: Is this worst-case scenario mentioned above problematic, i.e. does table size have an impact on MySQL performance and are there any issues with this mass inserting of data for each event? Is there anything else I have missed?

    Read the article

  • Family Tree :- myheritage.com

    - by Nitesh Panchal
    Hello, The other day i just accidently visited the site myheritage.com. I was just wondering, how they must have created one? Can anybody tell me what can be their database design? and if possible, algorithm that we can use to generate such a tree? Generating simple binary tree is very easy using recursion. But if you have a look at the site(if you have time please make account on it and add few nodes to feel) when we add son to a father, it's mother is automatically added(if you don't add explicitly). Mother's family tree is also generated side by side and many such fancy things are happening. In a simple binary tree we have a root node and then many nodes below it. Thus we cannot show wife and husband in the tree and then show a line from wife and husband to child. In spare time, can anybody discuss what can be it's database design and the recursive algorithm that we can follow to generate it? I hope i am not asking too much from you :).

    Read the article

  • template files in python

    - by saminny
    I am trying to use python for translating a set of templates to a set of configuration files based on values taken from a main configuration file. However, I am having certain issues. Consider the following example of a template file. file1.cfg.template %(CLIENT1)s %(HOST1)s %(PORT1)d C %(COMPID1)s %(CLIENT2)s %(HOST2)s %(PORT2)d C %(COMPID2)s This file contains an entry for each client. There are hundreds of config files like this and I don't want to have logic for each type of config file. Python should do the replacements and generate config files automatically given a set of global values read from a main xml config file. However, in the above example, if CLIENT2 does not exist, how do I delete that line? I expect Python would generate the config file using the following simple code: os.open("file1.cfg.template").read() & myhash where myhash is hash of all configuration parameters which may not contain CLIENT2 at all. In the case it does not contain CLIENT2, I want that line to disappear from the file. Is it possible to insert some 'IF' block in the file and have python evaluate it? Thanks for your help. Any suggestions most welcome.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >