Search Results

Search found 1557 results on 63 pages for 'daniel gollas'.

Page 47/63 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • 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

  • Android dev time vs iPhone dev time

    - by Daniel Benedykt
    Hi IF someone has to develop the same application for Android and iPhone, is it more difficult to develop in one platform than on the other? Does it take more time? Lets think about the average app. Lists, text , buttons, fetch information from the internet. Thanks

    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

  • 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

  • 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

  • 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

  • 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

  • Cleaning up when exiting an OpenGL app

    - by Daniel
    This might be a dumb question but I've spent some time asking Google and haven't been able to find anything. I have an an OSX OpenGL app I'm trying to modify. When I create the app a whole bunch of initialisation functions are called -- including methods where I can specify my own mouse and keyboard handlers etc. For example: glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100, 100); glutInitWindowSize(700, 700); glutCreateWindow("Map Abstraction"); glutReshapeFunc(resizeWindow); glutDisplayFunc(renderScene); glutIdleFunc(renderScene); glutMouseFunc(mousePressedButton); glutMotionFunc(mouseMovedButton); glutKeyboardFunc(keyPressed); At some point I pass control to glutMainLoop and my application runs. In the process of running I create a whole bunch of objects. I'd like to clean these up. Is there any way I can tell GLUT to call a cleanup method before it quits?

    Read the article

  • Getting a UIImage from MySQL using PHP and jSON

    - by Daniel
    I'm developing a little news reader that retrieves the info from a website by doing a POST request to a URL. The response is a jSON object with the unread-news. E.g. the last news on the App has a timeStamp of "2013-03-01". When the user refreshes the table, it POSTS "domain.com/api/api.php?newer-than=2013-03-01". The api.php script goes to the MySQL database and fetches all the news posted after 2013-03-01 and prints them json_encoded. This is // do something to get the data in an array echo $array_of_fetched_data; for example the response would be [{"title": "new app is coming to the market", "text": "lorem ipsum dolor sit amet...", image: XXX}] the App then gets the response and parses it, obtaining an NSDictionary and adds it to a Core Data db. NSDictionary* obtainedNews = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error]; My question is: How can I add an image to the MySQL database, store it, pass it using jSON trough a POST HTTP Request and then interpret it as an UIImage. It's clear that to store an UIImage in CoreData, they must be transform into/from NSData. How can I pass the NSData back and forth to a MySQL db using php and jSON? How should I upload the image to the db? (Serialized, as a BLOB, etc)

    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

  • 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

  • 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

  • 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

  • How to refresh a GridView?

    - by Daniel
    Hello everyone, I have a GridView which is pretty similar to the Google tutorial, except that I want to add the ImageViews on runtime (via a subactivity). The results are okay, but the layout of the View is messed up: The GridView doesn't fill the content of its parent, what do I have to do to design it properly? Here the code of adding the children: public void initializeWorkbench(GridView gv, Vector<String> items) { Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height()); Prototype.workbench.activateWorkbench(); // this measures the workbench correctly Log.d(Prototype.TAG, "workbench width: "+Prototype.workbench.getMeasuredWidth()); // 320 Log.d(Prototype.TAG, "workbench height: "+Prototype.workbench.getMeasuredHeight()); // 30 ImageAdapter imgAdapter = new ImageAdapter(this.getContext(), items); gv.setAdapter(imgAdapter); gv.measure(screenWidth, screenHeight); gv.requestLayout(); gv.forceLayout(); Log.d(Prototype.TAG, "gv width: "+gv.getMeasuredWidth()); // 22 Log.d(Prototype.TAG, "gv height: "+gv.getMeasuredHeight()); // 119 Prototype.workbench.setDimension(screenWidth, divider.height()+workbenchArea.height()); } } activateWorkbench, setDimension and measure in the workbench (LinearLayout above the GridView): public void activateWorkbench() { if(this.equals(Prototype.workbench)) { this.setOrientation(VERTICAL); show = true; measure(); } } public void setDimension(int w, int h) { width = w; height = h; this.setLayoutParams(new LinearLayout.LayoutParams(width, height)); this.invalidate(); } private void measure() { if (this.getOrientation() == LinearLayout.VERTICAL) { int h = 0; int w = 0; this.measureChildren(0, 0); for (int i = 0; i < this.getChildCount(); i++) { View v = this.getChildAt(i); h += v.getMeasuredHeight(); w = (w < v.getMeasuredWidth()) ? v.getMeasuredWidth() : w; } if (this.equals(Prototype.tagarea)) height = (h < height) ? height : h; if (this.equals(Prototype.tagarea)) width = (w < width) ? width : w; } this.setMeasuredDimension(width, height); } The ImageAdapter constructor: public ImageAdapter(Context c, Vector<String> items) { mContext = c; boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { // We can read and write the media mExternalStorageAvailable = mExternalStorageWriteable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { // We can only read the media mExternalStorageAvailable = true; mExternalStorageWriteable = false; } else { // Something else is wrong. It may be one of many other states, but // all we need // to know is we can neither read nor write mExternalStorageAvailable = mExternalStorageWriteable = false; } if (mExternalStorageAvailable && mExternalStorageWriteable) { for (String item : items) { File f = new File(item); if (f.exists()) { try { FileInputStream fis = new FileInputStream(f); Bitmap b = BitmapFactory.decodeStream(fis); bitmaps.add(b); files.add(f); } catch (FileNotFoundException e) { Log.e(Prototype.TAG, "", e); } } } } } And the xml layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="bottom" android:paddingLeft="0px" android:paddingTop="0px" android:paddingRight="0px"> <com.unimelb.pt3.ui.TransparentPanel android:id="@+id/workbench" android:layout_width="fill_parent" android:layout_height="10px" android:paddingTop="0px" android:paddingLeft="0px" android:paddingBottom="0px" android:paddingRight="0px"> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="90dp" android:numColumns="auto_fit" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:stretchMode="columnWidth" android:gravity="center" /> </com.unimelb.pt3.ui.TransparentPanel> </LinearLayout>

    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

  • Copy an array backwards? Array.Copy?

    - by daniel
    I have a List<T> that I want to be able to copy to an array backwards, meaning start from List.Count and copy maybe 5 items starting at the end of the list and working its way backwards. I could do this with a simple reverse for loop; however there is probably a faster/more efficient way of doing this so I thought I should ask. Can I use Array.Copy somehow? Originally I was using a Queue as that pops it off in the correct order I need, but I now need to pop off multiple items at once into an array and I thought a list would be faster.

    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

  • Will C++1x support __stdcall or extern "C" capture-nothing lambdas?

    - by Daniel Trebbien
    Yesterday I was thinking about whether it would be possible to use the convenience of C++1x lambda functions to write callbacks for Windows API functions. For example, what if I wanted to use a lambda as an EnumChildProc with EnumChildWindows? Something like: EnumChildWindows(hTrayWnd, CALLBACK [](HWND hWnd, LPARAM lParam) { // ... return static_cast<BOOL>(TRUE); // continue enumerating }, reinterpret_cast<LPARAM>(&myData)); Another use would be to write extern "C" callbacks for C routines. E.g.: my_class *pRes = static_cast<my_class*>(bsearch(&key, myClassObjectsArr, myClassObjectsArr_size, sizeof(my_class), extern "C" [](const void *pV1, const void *pV2) { const my_class& o1 = *static_cast<const my_class*>(pV1); const my_class& o2 = *static_cast<const my_class*>(pV2); int res; // ... return res; })); Is this possible?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >