Search Results

Search found 1421 results on 57 pages for 'arbitrary'.

Page 7/57 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Can I ping via an arbitrary interface of a DD-WRT system? [migrated]

    - by bytebuster
    There's a Linksys WRT54GL router with DD-WRT firmware (v23SP2). The network has a simple dual-WAN configuration (standby mode, switching by a script): ~ # ip route 192.168.3.0/24 dev br0 proto kernel scope link src 192.168.3.1 192.168.2.0/24 dev vlan2 proto kernel scope link src 192.168.2.2 192.168.1.0/24 dev vlan1 proto kernel scope link src 192.168.1.67 127.0.0.0/8 dev lo scope link default via 192.168.2.1 dev vlan2 I'm trying to ping a certain server arbitrary via vlan1 or vlan2. What I tried, as suggested here: ping -I vlan2 <address> ping 192.168.2.1 <address> In both cases ping simply exits with no error messages. Also, ping ignores many other parameters, again, by exiting silently. I failed to find any references that DD-WRT has a limited version of ping whatsoever. I also don't think it can be a permissions issue as mentioned here since the only user with DD-WRT is root. What's wrong?

    Read the article

  • Can I set up arbitrary filesystem redirection in Windows?

    - by Jon
    I am sitting in front of a Windows 7 machine that has no drive Q:. Is it possible to arrange for accesses to Q:\somedir to be redirected to an arbitrary location on the existing filesystems (for example, C:\Windows)? I would especially like a "set it and forget it" option, if one exists. I am assuming (although I have not tried it) that it is possible to use SUBST to mount an existing (empty, created for this purpose) folder as drive Q: and then MKLINK /J to create a directory symbolic link from Q:\somedir to wherever I want. However, this approach has a couple of drawbacks that I would like to avoid if possible: The drive Q: will be visible in the system. It is not as clean as I would like (removing the mounted folder will break it; a batch script needs to be manually added to the system startup). Is there a better option? If there is none and I am forced to make compromises, what is the closest I could get to the ideal solution? Assume anything is up for discussion.

    Read the article

  • Modifying value of "Rating" column within Explorer for arbitrary file types.

    - by Fake Name
    Basically, I have a large body of assorted media (text, images, flash files, archives, folders, etc...) and I'm attempting to organize it. Windows Explorer has a rating column, but there seems to be no way to modify the rating of the files short of opening them in their type-specific software (e.g. Media player, or Photo viewer). However, this does not work when the file is of an unsupported type (.rar, .swf ...), or a directory. I'd be more than willing to consider a file-manager replacement (I've alreadly looked at quite a few, Directory Opus, Total Commander, etc...), or even a solution that stores the rating metadata in a hidden file in each folder, or a separate database. The one real critical requirement is the ability to sort by rating, and being filetype-agnostic. Basically, is there any way to categorize a large collection of assorted files by rating that will work with any file type, including directories? - Ideally, there would be an easy way to add arbitrary columns to windows explorer, and edit them directly. However, there seems to be no way to do this. The rating column is the next best thing.

    Read the article

  • Run arbitrary subprocesses on Windows and still terminate cleanly?

    - by Weeble
    I have an application A that I would like to be able to invoke arbitrary other processes as specified by a user in a configuration file. Batch script B is one such process a user would like to be invoked by A. B sets up some environment variables, shows some messages and invokes a compiler C to do some work. Does Windows provide a standard way for arbitrary processes to be terminated cleanly? Suppose A is run in a console and receives a CTRL+C. Can it pass this on to B and C? Suppose A runs in a window and the user tries to close the window, can it cancel B and C? TerminateProcess is an option, but not a very good one. If A uses TerminateProcess on B, C keeps running. This could cause nasty problems if C is long-running, since we might start another instance of C to operate on the same files while the first instance of C is still secretly at work. In addition, TerminateProcess doesn't result in a clean exit. GenerateConsoleCtrlEvent sounds nice, and might work when everything's running in a console, but the documentation says that you can only send CTRL+C to your own console, and so wouldn't help if A were running in a window. Is there any equivalent to SIGINT on Windows? I would love to find an article like this one: http://www.cons.org/cracauer/sigint.html for Windows.

    Read the article

  • Ant MXMLC task with arbitrary list of source/lib paths?

    - by sascha
    Does anyone know of a way to use the mxmlc task of the Flex Ant tasks with a user-definable list of source path or library paths? The idea is that the user can define an arbitrary list of source paths and/or library (swc) paths into an Ant properties file and the build file takes these values and evaluates them for use in the mxmlc task. Just wondering if there are any tricks (maybe utilizing filtering/string replacing) to get this working?

    Read the article

  • Convert arbitrary size of byte[] to BigInteger[] and then safely convert back to exactly the same by

    - by PatlaDJ
    I believe conversion exactly to BigInteger[] would be optimal in my case. Anyone had done or found this written in Java and willing to share? So imagine I have arbitrary size byte[] = {0xff,0x3e,0x12,0x45,0x1d,0x11,0x2a,0x80,0x81,0x45,0x1d,0x11,0x2a,0x80,0x81} How do I convert it to array of BigInteger's and then be able to recover it back the original byte array safely? ty in advance.

    Read the article

  • How to make OSX application that just runs opens some file type and runs arbitrary Ruby code?

    - by taw
    It's trivial to make a program executable from shell - just put #!/usr/bin/ruby on top, chmod +x it and done. Unfortunately OSX won't let me associate file type with such scripts - it requires its .apps instead. This sort of distinction doesn't seem to exist on other operating systems. What's the simplest way of making such .app, which would merely execute some arbitrary Ruby code?

    Read the article

  • How Would you Mimic an Arbitrary Directory Structure with Rails Routes?

    - by viatropos
    I want to be able to map Google Docs' folder system to urls in my application and am just wondering how I can say "route, I want you to match an arbitrary set of nodes, and the last one is the file (or possibly a directory, I can check in the controller)". So I could do things like: www.mysite.com/documents/folder1/childfolderA/document www.mysite.com/documents/root-level-doc Can the routes.rb file do something like this?

    Read the article

  • Can I get the "value" of an arbitrary statement in JavaScript (like eval does, but without eval)

    - by tlrobinson
    In JavaScript is there a way to get the "value" of a statement in the same way that function() { return eval("if (true) { 1 }"); } returns "1"; function() { return if (true) { 1 } } and all similar permutations I've tried are not valid syntax. Is eval just blessed with special powers to determine the "last" value of a statement in an expression? Use case is a REPL that evaluates arbitrary expressions and returns the result. eval works, but I want to wrap it in function.

    Read the article

  • How can I "best fit" an arbitrary cairo (pycairo) path?

    - by Daniel Straight
    It seems like given the information in stroke_extents() and the translate(x, y) and scale(x, y) functions, I should be able to take any arbitrary cairo (I'm using pycairo) path and "best fit" it. In other words, center it and expand it to fill the available space. Before drawing the path, I have scaled the canvas such that the origin is the lower left corner, up is y+, right is x+, and the height and width are both 1. Given these conditions, this code seems to correctly scale the path: # cr is the canvas extents = cr.stroke_extents() x_size = abs(extents[0]) + abs(extents[2]) y_size = abs(extents[1]) + abs(extents[3]) cr.scale(1.0 / x_size, 1.0 / y_size) I cannot for the life of me figure out the translating though. Is there a simpler approach? How can I "best fit" a cairo path on its canvas? Please ask for clarification if anything is unclear in this question.

    Read the article

  • How can I convert arbitrary strings to CLS-Compliant names?

    - by Brian Hinchey
    Does anyone know of an algorithm (or external library) that I could call to convert an arbitrary string (i.e. outside my control) to be CLS compliant? I am generating a dynamic RDLC (Client Report Definition) for an ASP.Net Report Viewer control and some of the field names need to be based on strings entered by the user. Unfortunately I have little control over the entry of the field names by the client (through a 3rd party CMS). But I am quite flexible around substitutions required to create the compliant string. I have a reactive hack algorithm for now along the lines of: public static string FormatForDynamicRdlc(this string s) { //We need to change this string to be CLS compliant. return s.Replace(Environment.NewLine, string.Empty) .Replace("\t", string.Empty) .Replace(",", string.Empty) .Replace("-", "_") .Replace(" ", "_"); } But I would love something more comprehensive. Any ideas? NOTE: If it is of any help, the algorithm I am using to create the dynamic RDLC is based on the BuildRDLC method found here: http://csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html

    Read the article

  • c# create an arbitrary length generic parameter string e.g. ?,?,?

    - by Sky Sanders
    I know I am forgetting to remember how to do this and it is late. I want to, in an elegant manner, build a placeholder list for a munged sql command. Have a command with an arbitrary number of parameters, need to build ?,?,? Did I mention that it was a wet brain fart? this is what came out: Regex.Replace(new string('?', _command.Parameters.Count), @"\?\?", @"\?,\?"); You are welcome to make me feel like more of an idiot if you just remember me what I am forgetting. ;-)

    Read the article

  • VST plugin : using FFT on audio input buffer with arbitrary size, how ?

    - by Led
    I'm getting interested in programming a VST plugin, and I have a basic knowledge of audio dsp's and FFT's. I'd like to use VST.Net, and I'm wondering how to implement an FFT-based effect. The process-code looks like public override void Process(VstAudioBuffer[] inChannels, VstAudioBuffer[] outChannels) If I'm correct, normally the FFT would be applied on the input, some processing would be done on the FFT'd data, and then an inverse-FFT would create the processed soundbuffer. But since the FFT works on a specified buffersize that will most probably be different then the (arbitrary) amount of input/output-samples, how would you handle this ?

    Read the article

  • How do I convert an arbitrary list of strings to a SQL rowset?

    - by Jim Kiley
    I have a simple list of strings, which may be of arbitrary length. I'd like to be able to use this list of strings as I would use a rowset. The app in question is running against SQL Server. To be clearer, if I do SELECT 'foo', 'bar', 'baz' I get 'foo', 'bar', and 'baz' as fields in a single row. I'd like to see each one of them as a separate row. Is there a SQL (or SQLServer-specific) function or technique that I'm missing, or am I going to have to resort to writing a function in an external scripting language?

    Read the article

  • Trying to zoom in on an arbitrary rect within a screen-aligned quad.

    - by mos
    I've got a screen-aligned quad, and I'd like to zoom into an arbitrary rectangle within that quad, but I'm not getting my math right. I think I've got the translate worked out, just not the scaling. Basically, my code is the following: // // render once zoomed in glPushMatrix(); glTranslatef(offX, offY, 0); glScalef(?wtf?, ?wtf?, 1.0f); RenderQuad(); glPopMatrix(); // // render PIP display glPushMatrix(); glTranslatef(0.7f, 0.7f, 0); glScalef(0.175f, 0.175f, 1.0f); RenderQuad(); glPopMatrix(); Anyone have any tips? The user selects a rect area, and then those values are passed to my rendering object as [x, y, w, h], where those values are percentages of the viewport's width and height.

    Read the article

  • How can I find if an arbitrary process is running under wow64?

    - by LCC
    I need a tool which will discover whether an arbitrary process is running in x86 or x64 mode on a machine. I need to do this programatically from C++, based on a process ID. There has to be some way to do this (as you can clearly see it from the task manager). Does anyone know of a windows api that will tell you, given a process ID, whether the application is running under wow64? Another approach would be to figure out, based on the process id, the executable name/path that is running and try to read the PE headers out of the file. Does anyone have a code snippet that would accomplish that?

    Read the article

  • How can I pass an arbitrary object to jasper report as parameter?

    - by spderosso
    Hi, I would like to pass as a parameter to my .jrxml an arbitrary object of my domain, e.g a Person. InputStream reportFile = MyPage.this.getClass().getResourceAsStream("test.jrxml"); HashMap<String, Person> parameters = new HashMap<String, Person>(); parameters.put("person", new Person("John", "Doe")); ... JasperReport report = JasperCompileManager.compileReport(reportFile); JasperPrint print = JasperFillManager.fillReport(report, parameters, new JREmptyDataSource()); return JasperExportManager.exportReportToPdf(print); And on the .jrxml do something like: <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="PERSON" isForPrompting="false" class="myApp.domain.person"/> <background> <band splitType="Stretch"/> </background> <title> <band height="20"> <staticText> <reportElement x="180" y="0" width="200" height="20"/> <text><![CDATA[$P{PERSON.lastName}]]></text> </staticText> </band> </title> ... Is something like this possible? Where can I find more complex tutorials that show more than just passing a java.lang.String? Thanks

    Read the article

  • How do I assert that two arbitrary type objects are equivalent, without requiring them to be equal?

    - by Tomas Lycken
    To accomplish this (but failing to do so) I'm reflecting over properties of an expected and actual object and making sure their values are equal. This works as expected as long as their properties are single objects, i.e. not lists, arrays, IEnumerable... If the property is a list of some sort, the test fails (on the Assert.AreEqual(...) inside the for loop). public void WithCorrectModel<TModelType>(TModelType expected, string error = "") where TModelType : class { var actual = _result.ViewData.Model as TModelType; Assert.IsNotNull(actual, error); Assert.IsInstanceOfType(actual, typeof(TModelType), error); foreach (var prop in typeof(TModelType).GetProperties()) { Assert.AreEqual(prop.GetValue(expected, null), prop.GetValue(actual, null), error); } } If dealing with a list property, I would get the expected results if I instead used CollectionAssert.AreEquivalent(...) but that requires me to cast to ICollection, which in turn requries me to know the type listed, which I don't (want to). It also requires me to know which properties are list types, which I don't know how to. So, how should I assert that two objects of an arbitrary type are equivalent? Note: I specifically don't want to require them to be equal, since one comes from my tested object and one is built in my test class to have something to compare with.

    Read the article

  • How to generate a number in arbitrary range using random()={0..1} preserving uniformness and density?

    - by psihodelia
    Generate a random number in range [x..y] where x and y are any arbitrary floating point numbers. Use function random(), which returns a random floating point number in range [0..1] from P uniformly distributed numbers (call it "density"). Uniform distribution must be preserved and P must be scaled as well. I think, there is no easy solution for such problem. To simplify it a bit, I ask you how to generate a number in interval [-0.5 .. 0.5], then in [0 .. 2], then in [-2 .. 0], preserving uniformness and density? Thus, for [0 .. 2] it must generate a random number from P*2 uniformly distributed numbers. The obvious simple solution random() * (x - y) + y will generate not all possible numbers because of the lower density for all abs(x-y)>1.0 cases. Many possible values will be missed. Remember, that random() returns only a number from P possible numbers. Then, if you multiply such number by Q, it will give you only one of P possible values, scaled by Q, but you have to scale density P by Q as well.

    Read the article

  • How do I daemonize an arbitrary script in unix?

    - by dreeves
    I'd like a daemonizer that can turn an arbitrary, generic script or command into a daemon. There are two common cases I'd like to deal with: I have a script that should run forever. If it ever dies (or on reboot), restart it. Don't let there ever be two copies running at once (detect if a copy is already running and don't launch it in that case). I have a simple script or command line command that I'd like to keep executing repeatedly forever (with a short pause between runs). Again, don't allow two copies of the script to ever be running at once. Of course it's trivial to write a "while(true)" loop around the script in case 2 and then apply a solution for case 1, but a more general solution will just solve case 2 directly since that applies to the script in case 1 as well (you may just want a shorter or no pause if the script is not intended to ever die (of course if the script really does never die then the pause doesn't actually matter)). Note that the solution should not involve, say, adding file-locking code or PID recording to the existing scripts. More specifically, I'd like a program "daemonize" that I can run like % daemonize myscript arg1 arg2 or, for example, % daemonize 'echo `date` >> /tmp/times.txt' which would keep a growing list of dates appended to times.txt. (Note that if the argument(s) to daemonize is a script that runs forever as in case 1 above, then daemonize will still do the right thing, restarting it when necessary.) I could then put a command like above in my .login and/or cron it hourly or minutely (depending on how worried I was about it dying unexpectedly). NB: The daemonize script will need to remember the command string it is daemonizing so that if the same command string is daemonized again it does not launch a second copy. Also, the solution should ideally work on both OS X and linux but solutions for one or the other are welcome. (If I'm thinking of this all wrong or there are quick-and-dirty partial solutions, I'd love to hear that too.)

    Read the article

  • Can arbitrary email addresses be stored in AD userPrincipalName?

    - by Rob Potter
    I have a web app that is front-ended by ISA, natively authenticating against AD. All users currently log on with sAMAccountName. I would like to allow users to provide a personal email address and be able to authenticate against this instead. From what I understand the AD userPrincipalName is typically used for an internally generated logon name, which by convention, is often their internally generated email address. The web app that I have is web scale (circa 3 million accounts*) and not an internal, corporate app, so the email addresses will be from diverse domains. Can I just set the AD userPrincipalName attribute to the user's email address, and then will ISA natively authenticate against this attribute instead? I heard rumours of AD having a maximum number of domain suffixes that it allows in AD userPrincipalName...? (presumably it catalogues them). [*I realise that AD is not the ideal authentication directory for a user population of this scale.]

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >