Search Results

Search found 27766 results on 1111 pages for 'bad idea jeans'.

Page 128/1111 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • how to create local dynamic varables

    - by xielingyun
    this is my code, i want to use eval() to get the rule status and eval() nead local varables, there is many classes inherit class base, so i should to rewrite get_stat() in every class.i just want to avoid this, an idea is to create dynamic varables in get_stat(),eg. in class b it dynamic create var a and b how to create dynamic varables in function? or any other way to avoid this stupid idea i use python 3.2.3, locals() does not work class base(object): def check(self): stat = get_stat() def get_stat(self): pass class b(base): rule = 'a > 5 and b < 3' a = 0 b = 0 def update_data(self, a, b): self.a = a self.b = b def get_stat(self): a = self.a b = self.b return eval(rule) class b(base): rule = 'd > 5 and e < 3' d = 0 e = 0 def update_data(self, d, e): self.d = d self.e = e def get_stat(self): d = self.d e = self.e return eval(rule)

    Read the article

  • DMX Analysis Services question

    - by user282382
    Hi, I am have two mining models, both are time series. One is [Company_Inputs] and the other is [Booking_Projections]. What I want to do is use EXTEND_MODEL_CASES to join the results of [Company_Inputs] as the extended cases. So basically something like: Select Flattened PredictTimeSeries([Bookings], 1, 6, EXTEND_MODEL_CASES) FROM [Booking_Projections] Natural Prediction Join (Select Flattened PredictTimeSeries([Metric1], 1, 6) From [Company_Inputs]) AS T This code of course doesn't work, but the idea is to use the predictions made from [Company_Inputs] as cases for predicting future values of [Booking_Projections] If anyone has an idea of how I can accomplish this I would appreciate it very much.

    Read the article

  • Converting an AWT application to SWT/JFace

    - by data
    I am currently toying with the idea of converting a small/medium sized project from AWT to SWT, although Swing is not totally out of the picture yet. I was thinking about converting the main window to an SWT_AWT bridge object, but I have no idea how the semantics for this work. After that, I plan to update dialog for dialog, but not necessarily within one release. Is this possible? Has someone done a conversion like this and can give me some hints? Is there maybe even a tutorial somewhere out there? Is there maybe even a tool that can automate parts of this? I have tried googling, but to no avail. Update: One additional thing is: Currently, this is a netbeans project. Might be of help or not, I don't know.

    Read the article

  • Any "trick" to use some keys to launch an application?

    - by Profete162
    Hello, I am currently developing an free application (TaskOS ) that allow users to have multitasking and switch easily between applications on their mobile ( like alt+tab in Windows ) That work pretty well and user can launch my application by a long press on the "search" button" by adding this line in the manifest: <action android:name="android.intent.action.SEARCH_LONG_PRESS" /> I also succeed to allow to the users to Use the camera button ( they can of course disable that in application settings) and the way to do that is slighlty different: <receiver android:name=".CameraPressed"> <intent-filter android:priority="10000"> <action android:name="android.intent.action.CAMERA_BUTTON"/> </intent-filter> I am now wondering if there are other ways to launch easily my task switcher? ( long press on Home key, long press on trackball, or any other idea.) Reading the Google documentation does not help me a lot. Any other idea/suggestion would be warmly welcome. Christophe

    Read the article

  • WPF Animate a Maxtrix using interpolation

    - by Mark
    Im having a issue with my application that is using touch gestures to scale, translate and rotate my scene. I was using a TransformGroup which contained TranslateTransform, ScaleTransform and a RotateTransform but I could not get the movement correct, it always jumps and skips, so I moved to a MaxtrixTransform which I was able to use much easier to get my scene to be zoomable, rotatable and panable nicely. However, what I later found out was that you cannot animate smoothly (using interpolation) the values of a Matrix, for what reason I have no idea, but its part of the MSDN doco and the properties of the Matrix are not dependency properties anyways... Has anyone had any luck animating a maxtrix to make it smooth? The only idea(s) I have had is to animate a few different, custom DP which all have callbacks that I update the Matrix from OR To convert the Maxtix to a set of Transform object that I then animate and then afterwords convert back. Is there a smarter way to do this?

    Read the article

  • Connecting Android XML and Code

    - by Nick
    I'm new to android and have gotten used to doing all my previous UI in code. I can understand the simple examples, but I'm trying something more complex and have no idea how to do it in code and XML. I'm trying to use the google map api and draw text on the map at a specified spot. I have succeeded in doing so by extending overlay and overriding the draw method using drawtext. This has pretty much accomplished what I'm looking to do, but I want have read that is poor practice. I now want to add a second line below the first and just using \n does not work. I can work it out using another drawtext method, but I figured it would be better to create a custom textview, I just have no idea how to position it using code and encapsulate it inside the overlay. Maybe the way I'm doing it is the best way...

    Read the article

  • Ideas for building vulnerabilities into your site?

    - by Jaco Pretorius
    I'm trying to create a programming challenge that would require developers to hack into the MVC site I create. The idea is obviously to teach them about preventing these types of attacks. The current idea I have is to build multiple vulnerabilities into the site - but the second vulnerability would require the first to be completed, etc. So I was thinking the first could be a sql injection attack, the second would require a modified GET request, etc. Exploiting the final vulnerability would reveal a specific piece of information which is proof that you have completed the entire challenge. This will not be deployed on a public site - it's simply a learning tool for developers at my company. I'm not looking for MVC-specific vulnerabilities - I'm simply using MVC because it allows me to work with the 'raw' HTML. Any ideas on the different vulnerabilities I can use?

    Read the article

  • Implement a WebDAV server in C#?

    - by HaukurHaf
    We've got a CMS system written in .NET C#. This system has editing facilities for templates (essentially HTML files) and various other support files such as CSS and javascript files. These "files" are not really files, but database records and they are edited using plain old textareas within the CMS system. To make editing these "files" easier, on idea was to implement WebDAV support in the CMS system for these files, so users could use some WebDAV client software to connect to the CMS and then open these in VS 2008 for example. Firstly, is this a feasible idea? Secondly, if so ... where do start? Any good articles out there about implementing a WebDAV server in C# to provide access to either physical documents or "pseudo" documents which are in reality just records in a database? Any input appreciated ....

    Read the article

  • correct approach to store in database

    - by John
    I'm developing an online website (using Django and Mysql). I have a Tests table and User table. I have 50 tests within the table and each user completes them at their own pace. How do I store the status of the tests in my DB? One idea that came to my mind is to create an additional column in User table. That column containing testid's separated by comma or any other delimiter. userid | username | testscompleted 1 john 1, 5, 34 2 tom 1, 10, 23, 25 Another idea was to create a seperate table to store userid and testid. So, I'll have only 2 columns but thousands of rows (no of tests * no of users) and they will always continue to increase. userid | testid 1 1 1 5 2 1 1 34 2 10

    Read the article

  • Hashing a python method to regenerate output when method is modified

    - by Seth Johnson
    I have a python method that has a deterministic result. It takes a long time to run and generates a large output: def time_consuming_method(): # lots_of_computing_time to come up with the_result return the_result I modify time_consuming_method from time to time, but I would like to avoid having it run again while it's unchanged. [Time_consuming_method only depends on functions that are immutable for the purposes considered here; i.e. it might have functions from Python libraries but not from other pieces of my code that I'd change.] The solution that suggests itself to me is to cache the output and also cache some "hash" of the function. If the hash changes, the function will have been modified, and we have to re-generate the output. Is this possible or a ridiculous idea? If this isn't a terrible idea, is the best implementation to write f = """ def ridiculous_method(): a = # # lots_of_computing_time return a """ , use the hashlib module to compute a hash for f, and use compile or eval to run it as code?

    Read the article

  • JMP instruction in Flex/bison

    - by Imran
    Hallo everybody, Can someone help me out of my situation, im searching for a instrucior that implements the JMP (Jump) instructior like in Assembler. I've found out that it could be withe the goto function of Flex/Bison but i have no really idea how to do. Have got anyone idea. Im very grateful of yours help. Thanks. Here is an example how it looks like. with the JMP instructor, he goes to the label L1. :L1 IF FLAG AND X"0001" EVT 23; ELSE WAIT 500 ms; JMP L1; END IF;

    Read the article

  • Aldon and .Net Development

    - by David Stratton
    I'm looking for feedback from .Net developers who have experience with Aldon as a lifecycle management platform. We're seriously considering using Aldon for lifecycle management including source control, automated builds, etc. I know there are a lot of other options out there, but ours is primary an AS/400 shop (with AS/400 programmers outnumbering .Net developers 6 to 1), and Aldon is used already by our iSeries team. The benefit we're looking for is having one lifecycle management suite. Basically, I'm looking for opinions from people who have used Aldon and another set of tools (perhaps TFS, or a combination of SVN, Cruise Control, etc). If you've worked with both, do you have a recommendation on whether this is a good idea, or a bad idea? It's obviously a big choice, so any feedback would be helpful.

    Read the article

  • Should we create Virtual Machine environment so a consultant can develop in similiar environment?

    - by ChrisNel52
    This is a large project and currently there are only 3 developers working on it. We have some money in the budget to contract development help from a software consulting firm. However, because the location of our business it would be beneficial if the consultant could do their development off-site. Also, our company policy doesn't allow contract help to VPN into our network, so that is not an option. My question is, would it be a good idea to create a Virtual Machine that copies our internal environment (particularly our database and WCF service) and give the consultant the Virtual Machine image so that they can replicate the environment at their place of work? I haven't worked much with Virtual Machines, so I'm not sure if this is a good idea or if there are huge obstacles that I'm not thinking of. If anyone has ever done anything like this, it would be great to hear the pros/cons. Any help would be appreciated.

    Read the article

  • Can I find and import files into an Ant buildfile at run time?

    - by Mnementh
    I want to create an Ant buildfile, that includes some files as a sort of plugin. So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the build. But the 'import' task can only be used as a top-level task, so I have no idea how to relize this functionality. Is this possible with Ant and if so, how can I do it? EDIT: I would prefer a solution, that allows new targets to show up in the listing presented by ant -p.

    Read the article

  • List replies in a winform

    - by andrew
    In my C# app I get an xml from a server that contains some replies like in a forum thread (with elements like author, time, body, title, whatever). When I get this xml, I create a new form in which i want to display these replies, and a little text box with an "add reply" button. I'd also like some edit buttons on perhaps my own replies in the reply list displayed in the form. The simplest way that came to my mind to display the replies is to put a web browser control in the form, generate a full html page in a string from the xml, and throw it in that web browser control. And under it i can put the text box with the add reply button. Everything is ok, except that i have no idea of how i could implement the edit function on my own replies (i mean i could add a link in there... but link to what) I would like to know if there is a way to get that edit event from the web browser control (my guess is i can't) or another (maybe simple/easy) idea of displaying the replies in a winform using other controls

    Read the article

  • segmented reduction with scattered segments

    - by Christian Rau
    I got to solve a pretty standard problem on the GPU, but I'm quite new to practical GPGPU, so I'm looking for ideas to approach this problem. I have many points in 3-space which are assigned to a very small number of groups (each point belongs to one group), specifically 15 in this case (doesn't ever change). Now I want to compute the mean and covariance matrix of all the groups. So on the CPU it's roughly the same as: for each point p { mean[p.group] += p.pos; covariance[p.group] += p.pos * p.pos; ++count[p.group]; } for each group g { mean[g] /= count[g]; covariance[g] = covariance[g]/count[g] - mean[g]*mean[g]; } Since the number of groups is extremely small, the last step can be done on the CPU (I need those values on the CPU, anyway). The first step is actually just a segmented reduction, but with the segments scattered around. So the first idea I came up with, was to first sort the points by their groups. I thought about a simple bucket sort using atomic_inc to compute bucket sizes and per-point relocation indices (got a better idea for sorting?, atomics may not be the best idea). After that they're sorted by groups and I could possibly come up with an adaption of the segmented scan algorithms presented here. But in this special case, I got a very large amount of data per point (9-10 floats, maybe even doubles if the need arises), so the standard algorithms using a shared memory element per thread and a thread per point might make problems regarding per-multiprocessor resources as shared memory or registers (Ok, much more on compute capability 1.x than 2.x, but still). Due to the very small and constant number of groups I thought there might be better approaches. Maybe there are already existing ideas suited for these specific properties of such a standard problem. Or maybe my general approach isn't that bad and you got ideas for improving the individual steps, like a good sorting algorithm suited for a very small number of keys or some segmented reduction algorithm minimizing shared memory/register usage. I'm looking for general approaches and don't want to use external libraries. FWIW I'm using OpenCL, but it shouldn't really matter as the general concepts of GPU computing don't really differ over the major frameworks.

    Read the article

  • Shipping jar with default .properties file configurations

    - by Maxim Veksler
    Hello, I would like to include a default default.properties file in my .jar library. The idea is to allow the user to override my default is he so desires. I'm having trouble getting the classloader to play nicely with this setup, I've tried to look a at popular jars such as log4j, common-* and others and it seems that no one is implementing this idea. Am I going the wrong way? The second best thing is hard coding the values, and using the default if no .properties key has been found, but this sound oh so wrong. Suggestions?

    Read the article

  • [Tkinter/Python] Different line widths with canvas.create_line?

    - by Sam
    Does anyone have any idea why I get different line widths on the canvas in the following example? from Tkinter import * bigBoxSize = 150 class cFrame(Frame): def __init__(self, master, cwidth=450, cheight=450): Frame.__init__(self, master, relief=RAISED, height=550, width=600, bg = "grey") self.canvasWidth = cwidth self.canvasHeight = cheight self.canvas = Canvas(self, bg="white", width=cwidth, height=cheight, border =0) self.drawGridLines() self.canvas.pack(side=TOP, pady=20, padx=20) def drawGridLines(self, linewidth = 10): self.canvas.create_line(0, 0, self.canvasWidth, 0, width= linewidth ) self.canvas.create_line(0, 0, 0, self.canvasHeight, width= linewidth ) self.canvas.create_line(0, self.canvasHeight, self.canvasWidth + 2, self.canvasHeight, width= linewidth ) self.canvas.create_line(self.canvasWidth, self.canvasHeight, self.canvasWidth, 1, width= linewidth ) self.canvas.create_line(0, bigBoxSize, self.canvasWidth, bigBoxSize, width= linewidth ) self.canvas.create_line(0, bigBoxSize * 2, self.canvasWidth, bigBoxSize * 2, width= linewidth) root = Tk() C = cFrame(root) C.pack() root.mainloop() It's really frustrating me as I have no idea what's happening. If anyone can help me out then that'd be fantastic. Thanks!

    Read the article

  • How to fix the header and first row in a UITableView

    - by Arturo Guzman
    I´m new trying to make some apps using objective c, so I´ve an idea using uitableview but I don't imagine how can I get this. I´m trying to do something like you do in a spreadsheet where you have a fixed header and the first column too So when scroll the uitableview vertically the header will stay visible at top of the table and rows will change And finally when you scroll in horizontal direction the first cell of the row will stay visible and will change the header depending of how you scroll the uitableview I hope you could give me an idea how to get this, because I don't imagine how to do this, also I don´t have a lot of experience with this programming language. Thanks!

    Read the article

  • Drawing Sprites for iOS games on iPad

    - by TheGamingArt
    So, I'm quite new and confused on the way to tackle creating sprites/sprite sheets for iOS games. I own the full CS5 sweet and have been told that fireworks is the best way to go for creating these (although I don't have the slightest idea in how yet and would love some tutorials/books specifying sprite sheet creation). My thoughts directed me towards tablet drawing, as I am awful at drawing with a mouse and/or tablet without a screen on it (such as a basic wacom). I was thinking about getting an iPad, as this would provide me with an iPad for testing purposes and a tablet. Does anyone know if it's possible (or even a good idea) to draw out your sprites on the iPad. Is it possible to export them out into Fireworks and such?

    Read the article

  • split double in c wihout any libary

    - by DoomStone
    Hello I have a question for a c programmer out there, we have a tast at school to create a soft real time system in an operation system made by our teacher. Well that is all fine and dandy, we have chosen to create a system that calcuate how many unites of medicine a diabetic need based on his or hers blood sugar. It does not need to be correct just that we have the idea of a real time system :D But we have hit a little snag our formula for calculating the units of medicine is [blood sugar] * 1.2 But the only way we can send messages between processes is via a structure that contains 8 longs, but here is where my knowledge of c ends, we need for some way to split this double into 2 longs, example: the whole number in long 0 and the decimals in long 1 and then assemble it on the other side. But I have no idea who to do this, and therefore need a little help. We have tried but we do not have access to c standard libraries

    Read the article

  • Split String in C# without delimiter (sort of)

    - by Zach
    Hi, I want to split a string in C#.NET that looks like this: string Letters = "hello"; and put each letter (h, e, l, l, o) into an array or ArrayList. I have no idea what to use as the delimiter in String.Split(delimiter). I can do it if the original string has commas (or anything else): string Letters = "H,e,l,l,o"; string[] AllLettersArray = Letters.Split(",".ToCharArray()); But I have no idea what to use in a case with (supposedly) no delimiter. Is there a special character like Environment.Newline? Thanks.

    Read the article

  • How to detect default printer properties from browser?

    - by Annan
    Regardless of if this is a good idea or not, is it possible to detect printer attributes from the browser? The idea is that you want to print out a brochure that's selling something. Depending on different things such as if the printer is black&white/colour, high/low resolution, laser/inkjet, printing to a file, etc, you want to print out the page differently. For example you might choose different text colours or fonts, different image sizes, etc. My initial thoughts are: ActiveX, Flash, Java, Silverlight, browser plugins. Kudos if it's possible in javascript. I'm interested in all ways to do this, cross browser or not. Please no reasons about why this shouldn't be done ^_^

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >