Search Results

Search found 5631 results on 226 pages for 'daniel a white'.

Page 83/226 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • What makes you trust that a piece of open source software is not malicious?

    - by Daniel DiPaolo
    We developers are in a unique position when it comes to the ability to not only be skeptical about the capabilities provided by open source software, but to actively analyze the code since it is freely available. In fact, one may even argue that open source software developers have a social responsibility to do so to contribute to the community. But at what point do you as a developer say, "I better take a look at what this is doing before I trust using it" for any given thing? Is it a matter of trusting code with your personal information? Does it depend on the source you're getting it from? What spurred this question on was a post on Hacker News to a javascript bookmarklet that supposedly tells you how "exposed" your information on Facebook is as well as recommending some fixes. I thought for a second "I'd rather not start blindly running this code over all my (fairly locked down) Facebook information so let me check it out". The bookmarklet is simple enough, but it calls another javascript function which at the time (but not anymore) was highly compressed and undecipherable. That's when I said "nope, not gonna do it". So even though I could have verified the original uncompressed javascript from the Github site and even saved a local copy to verify and then run without hitting their server, I wasn't going to. It's several thousand lines and I'm not a total javascript guru to begin with. Yet, folks are using it anyway. Even (supposedly) bright developers. What makes them trust the script? Did they all scrutinize it line by line? Do they know the guy personally and trust him not to do anything bad? Do they just take his word? What makes you trust that a piece of open source software is not malicious?

    Read the article

  • VS 2008 Code Snippet Indentation

    - by Daniel
    In VS 2008, there are XML code snippets that seem to be pretty awesome :) However, it seems that the snippets we created do not indent properly. For example if we have the following code: { ... { ... { InsertSnippet here. We get something like: { ... { ... { FirstLineofSnippet SecondLineOfSnippet ThirdLineOfSnippet Is there any way to make it so that all lines keep the same indentation?

    Read the article

  • Dynamic upsert in postgresql

    - by Daniel
    I have this upsert function that allows me to modify the fill_rate column of a row. CREATE FUNCTION upsert_fillrate_alarming(integer, boolean) RETURNS VOID AS ' DECLARE num ALIAS FOR $1; dat ALIAS FOR $2; BEGIN LOOP -- First try to update. UPDATE alarming SET fill_rate = dat WHERE equipid = num; IF FOUND THEN RETURN; END IF; -- Since its not there we try to insert the key -- Notice if we had a concurent key insertion we would error BEGIN INSERT INTO alarming (equipid, fill_rate) VALUES (num, dat); RETURN; EXCEPTION WHEN unique_violation THEN -- Loop and try the update again END; END LOOP; END; ' LANGUAGE 'plpgsql'; Is it possible to modify this function to take a column argument as well? Extra bonus points if there is a way to modify the function to take a column and a table.

    Read the article

  • jQuery Validate on form submitted by JavaScript

    - by Daniel
    My form is submitted by a link using JavaScript, but I am also trying to validate the from justing jQuery validate. The validation doesn't work when submitted by the link, but it does if I change the link to a submit button. What am I doing wrong? My form: <form id="findmatch" method="post" action="search"> <div> <label class="formlabel">Match Type <input type="text" name="matchtype" id="matchtype" class="forminput" /> </label> <label class="formlabel">Location (postcode) <input type="text" name="location" id="location" class="forminput" /> </label> <label class="formlabel">Radius (miles) <input type="text" name="Radius" id="Radius" class="forminput" /> </label> <label class="formlabel">Keywords <input type="text" onblur="javascript:usePointFromPostcode(document.getElementById('location').value, showCompleteLatLng)" onchange="javascript:usePointFromPostcode(document.getElementById('location').value, showCompleteLatLng)" name="keywords" id="keywords" class="forminput" /> </label> <input id="lat" class="hidden" name="lat" type="text" value="" /> <input id="lon" class="hidden" name="lon" type="text" value="" /> <a href="javascript:document.getElementById('findmatch').submit();" onmouseover="javascript:usePointFromPostcode(document.getElementById('location').value, showCompleteLatLng)" class="submit">Search</a> </div> </form> And my jQuery is <script type="text/javascript"> $(document).ready(function () { $("#findmatch").validate({ rules: { location: "required", Radius: { required: true, digits: true }, keywords: "required" }, messages: { location: "Please enter your postcode", Radius: { required: "Please enter a radius", digits: "Please only enter numbers" }, keywords: "Please enter the keywords you wish to search for" } }); }); </script>

    Read the article

  • How do you create a Google Maps-esque drop down dialog?

    - by Daniel Lew
    In the Google Maps application, when you open the menu and click on "Directions", it pops up a dialog that is unique to Google Maps. It keeps the MapView in the background, but displays the search dialog from the top (or bottom, if you're on an old version of Android). I was curious if anyone knew how they achieved this effect. I'm willing to create a custom Dialog, but it seems that Dialogs are designed to pop into the middle of the screen (any other types of dialogs are denied permission as system dialogs). What trick is Google Maps using?

    Read the article

  • How do I combine similar method calls into a delegate pattern?

    - by Daniel T.
    I have three methods: public void Save<T>(T entity) { using (new Transaction()) { Session.Save(entity); } } public void Create<T>(T entity) { using (new Transaction()) { Session.Create(entity); } } public void Delete<T>(T entity) { using (new Transaction()) { Session.Delete(entity); } } As you can see, the only thing that differs is the method call inside the using block. How can I rewrite this so it's something like this instead: public void Save<T>(T entity) { TransactionWrapper(Session.Save(entity)); } public void Create<T>(T entity) { TransactionWrapper(Session.Create(entity)); } public void Save<T>(T entity) { TransactionWrapper(Session.Save(entity)); } So in other words, I pass a method call as a parameter, and the TransactionWrapper method wraps a transaction around the method call.

    Read the article

  • what's the best way to learn C++ and Qt at the same time?

    - by Daniel Hill
    Hi I did A Google search and couldn't find anything, so I wanna learn Qt/C++ my University (I'm a first year CompSci Student) won't be teaching C++ next year which is a big disappointment I already know Python and dabbled in LaTeX, Javascript, C++ I'm currently helping out a free software project Clementine but it's programmed in Qt/C++ and I don't know enough of both to help out enough. Is there any tips, Tutorial, howtos out there?

    Read the article

  • Use JQuery to check a checkbox in a parent list-item?

    - by Daniel O'Connor
    Hey Everyone, I'm brand new to Javascript and JQuery, so I've been reading up on it and am trying to check (and set inactive) a checkbox in a parent list-item when one of the children are checked. If this doesn't make any sense, take a look at the list structure. <ul> <li><input type="checkbox" name="items[]" value="88712003" id="88712003" /> Parent 1</li> <li><input type="checkbox" name="items[]" value="88712003" id="88712003" /> Parent 2 <ul> <li><input type="checkbox" name="items[]" value="21312341" id="21312341" /> Child 1</li> <li><input type="checkbox" name="items[]" value="21312341" id="21312341" /> Child 2</li> </ul> </li> <li><input type="checkbox" name="items[]" value="88712003" id="88712003" /> Parent 3</li> <li><input type="checkbox" name="items[]" value="88712003" id="88712003" /> Parent 4</li> </ul> If Child 1 or Child 2 is checked, I want the input in Parent 2 to be checked and set inactive. I've started working on it, but got stuck here: $(function(){ $('.child').click(function() { $(this).parent().parent().parent().toggle(); }); }); As you can see, I didn't make it far. Any help would be appreciated. Thanks!

    Read the article

  • Which is the best pick?

    - by Daniel
    Hi, considering I have experience with Java SE: which language should I learn(and is best for that purpose) in order to build web applications some day with it? I have been contemplating PHP and Java EE. The latter does indeed seems as an obvious choice given my Java SE knowledge. But how does it fares in comparison with PHP and how good is it for the aforementioned purpose? If there is a better language for this purpose, feel free to recommend it. Thank you.

    Read the article

  • How to handle User Authentication for program in client’s local machine?

    - by Daniel
    Which user authentication scheme could be used at following scenario? 1.Application A developed by my company is installed at user's local computer. 2.Users login at my company's website. 3.If login is successful, access to the application A in user's local machine is granted. The development environment is .NET. Is there a secure way to authenticate the user to access the application? I've thought about encrypting the login information entered at the website, and then sending that information to the program at user's local machine for authentication. but I think as long as the client program has the decrypting ability, it is vulnerabe to decompiling,etc. Thanks in advance!

    Read the article

  • Can the lock function be used to implement thread-safe enumeration?

    - by Daniel
    I'm working on a thread-safe collection that uses Dictionary as a backing store. In C# you can do the following: private IEnumerable<KeyValuePair<K, V>> Enumerate() { if (_synchronize) { lock (_locker) { foreach (var entry in _dict) yield return entry; } } else { foreach (var entry in _dict) yield return entry; } } The only way I've found to do this in F# is using Monitor, e.g.: let enumerate() = if synchronize then seq { System.Threading.Monitor.Enter(locker) try for entry in dict -> entry finally System.Threading.Monitor.Exit(locker) } else seq { for entry in dict -> entry } Can this be done using the lock function? Or, is there a better way to do this in general? I don't think returning a copy of the collection for iteration will work because I need absolute synchronization.

    Read the article

  • iPad Simulator View

    - by Daniel
    I am looking to increase the size of my iPad simulator when it is fired up on my mac, how would I go about doing this? The size of the simulator right now is very very small, I can't even see the text on it!

    Read the article

  • Does the managed main UI thread stay on the same (unmanaged) Operation System thread?

    - by Daniel Rose
    I am creating a managed WPF UI front-end to a legacy Win32-application. The WPF front-end is the executable; as part of its startup routines I start the legacy app as a DLL in a second thread. Any UI-operation (including CreateWindowsEx, etc.) by the legacy app is invoked back on the main UI-thread. As part of the shutdown process of the app I want to clean up properly. Among other things, I want to call DestroyWindow on all unmanaged windows, so they can properly clean themselves up. Thus, during shutdown I use EnumWindows to try to find all my unmanaged windows. Then I call DestroyWindow one the list I generate. These run on the main UI-thread. After this background knowledge, on to my actual question: In the enumeration procedure of EnumWindows, I have to check if one of the returned top-level windows is one of my unmanaged windows. I do this by calling GetWindowThreadProcessId to get the process id and thread id of the window's creator. I can compare the process id with Process.GetCurrentProcess().Id to check if my app created it. For additional security, I also want to see if my main UI-thread created the window. However, the returned thread id is the OS's ThreadId (which is different than the managed thread id). As explained in this question, the CLR reserves the right to re-schedule the managed thread to different OS threads. Can I rely on the CLR to be "smart enough" to never do this for the main UI thread (due to thread-affinity of the UI)? Then I could call GetCurrentThreadId to get the main UI-thread's unmanaged thread id for comparison.

    Read the article

  • C# string equality operator returns false, but I'm pretty sure it should be true... What?!

    - by Daniel Schaffer
    I'm trying to write a unit test for a piece of code that generates a large amount of text. I've run into an issue where the "expected" and "actual" strings appear to be equal, but Assert.AreEqual throws, and both the equality operator and Equals() return false. The result of GetHashCode() is different for both values as well. However, putting both strings into text files and comparing with DiffMerge tells me they're the same. Additionally, using Encoding.ASCII.GetBytes() on both values and then using SequenceEquals to compare the resulting byte arrays returns true. The values are 34KB each, so I'll hold off putting them here for now. Any ideas? I'm completely stumped.

    Read the article

  • Counting vowels in a string using recursion

    - by Daniel Love Jr
    In my python class we are learning about recursion. I understand that it's when a function calls itself, however for this particular assignment I can't figure out how exactly to get my function to call it self to get the desired results. I need to simply count the vowels in the string given to the function. def recVowelCount(s): 'return the number of vowels in s using a recursive computation' vowelcount = 0 vowels = "aEiou".lower() if s[0] in vowels: vowelcount += 1 else: ??? I'm really not sure where to go with this, it's quite frustrating. I came up with this in the end, thanks to some insight from here. def recVowelCount(s): 'return the number of vowels in s using a recursive computation' vowels = "aeiouAEIOU" if s == "": return 0 elif s[0] in vowels: return 1 + recVowelCount(s[1:]) else: return 0 + recVowelCount(s[1:])

    Read the article

  • How can I make one Maven module depend on another?

    - by Daniel Pryden
    OK, I thought I understood how to use Maven... I have a master project M which has sub-projects A, B, and C. C contains some common functionality (interfaces mainly) which is needed by A and B. I can run mvn compile jar:jar from the project root directory (the M directory) and get JAR files A.jar, B.jar, and C.jar. (The versions for all these artifacts are currently 2.0-SNAPSHOT.) The master pom.xml file in the M directory lists C under its <dependencyManagement> tag, so that A and B can reference C by just including a reference, like so: <dependency> <groupId>my.project</groupId> <artifactId>C</artifactId> </dependency> So far, so good. I can run mvn compile from the command line and everything works fine. But when I open the project in NetBeans, it complains with the problem: "Some dependency artifacts are not in the local repository", and it says the missing artifact is C. Likewise from the command line, if I change into the A or B directories and try to run mvn compile I get "Build Error: Failed to resolve artifact." I expect I could manually go to where my C.jar was built and run mvn install:install-file, but I'd rather find a solution that enables me to just work directly in NetBeans (and/or in Eclipse using m2eclipse). What am I doing wrong?

    Read the article

  • I have a fucntion that create histogram of each Bitmap. How can i create another 3 histograms for R.G.B of each Bitmap?

    - by Daniel Lip
    This is the histogram function im using today and if im not worng it's creating an histogram by Gray color. What i want is another fucntion that will return me 3 histograms of each Bitmap: The first histogram will be of the Red color of the bitmap the second for the Green color and the last one for the Blue color. public static long[] GetHistogram(Bitmap b) { long[] myHistogram = new long[256]; BitmapData bmData = null; try { //Lock it fixed with 32bpp bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); int scanline = bmData.Stride; System.IntPtr Scan0 = bmData.Scan0; unsafe { byte* p = (byte*)(void*)Scan0; int nWidth = b.Width; int nHeight = b.Height; for (int y = 0; y < nHeight; y++) { for (int x = 0; x < nWidth; x++) { long Temp = 0; Temp += p[0]; // p[0] - blue, p[1] - green , p[2]-red Temp += p[1]; Temp += p[2]; Temp = (int)Temp / 3; myHistogram[Temp]++; //we do not need to use any offset, we always can increment by pixelsize when //locking in 32bppArgb - mode p += 4; } } } b.UnlockBits(bmData); } catch { try { b.UnlockBits(bmData); } catch { } } return myHistogram; } How may i do it ?

    Read the article

  • Consequences in PHP of implementing an interface through two different routes?

    - by Daniel Bingham
    What are the consequences of implementing the same interface through two different routes in PHP, are there any? What I mean, is something like this: interface baseInterface {} abstract class baseClass implements baseInterface { } interface myInterface extends baseInterface {} class myClass extends baseClass implements myInterface {} In this case myClass implements baseInterface from two different parents - myInterface and baseClass. Are there any consequences to this? My instinct is that PHP should handle this fine, but I just want to make sure. What exactly does PHP do in this case? Does it just check to see that the necessary functions are implemented for the interface each time it discovers it and call it a day or does it do something more?

    Read the article

  • EXCEL import to sql returning NULL for decimals when in VARCHAR data type

    - by Daniel
    Hi, I am working on a peice of software which has expodentially grown over the last few years and the database needs to be regularly updated. Customers are providing us with data now on large spreadsheets which we format and will start importing into the database. I am using the Import and Export Data (32-bit) Wizard. One column in the database contains values like '1.1.1.2' etc and i am importing them in as a Varchar as that is the data type in the database. However, for values like '8.5', 'NULL' is getting imported insead. It only occurs when there is one decimal point. Is this a formatting error with excel or is it the wrong datatype?

    Read the article

  • Assign weight to a integer column for Sphinx search

    - by Daniel
    Hello: I have a note table with columns: title :string content :text rating :integer and a thinking_sphinx configuration: define_index do indexes :title, :sortable => true indexes :content end Then I can search the notes and assign weights to title and content to define the order or the result: Note.search "abc", :match_mode => :extended, :field_weights => { :title => 10, :content => 3 } Now I want to assign a weight to the rating column The type of the rating column is integer. The range of the rating is [1, 2, 3, 4, 5]. Can I just add weight at the :field_weights :field_weights => { :title => 10, :content => 3, :rating => 5 } or I need to do something else to make the note which has higer rating display first?

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >