Search Results

Search found 1105 results on 45 pages for 'thx'.

Page 38/45 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • jquery newbie: combine validate with hidding submit button.

    - by Jeffb
    I'm new a jQuery. I have gotten validate to work with my form (MVC 1.0 / C#) with this: <script type="text/javascript"> if (document.forms.length > 0) { document.forms[0].id = "PageForm"; document.forms[0].name = "PageForm"; } $(document).ready(function() { $("#PageForm").validate({ rules: { SigP: { required: true } }, messages: { SigP: "<font color='red'><b>A Sig Value is required. </b></font>" } }); }); </script> I also want to hide the Submit button to prevent twitchy mouse syndrome from causing duplicate entry before the controller completes and redirects (I'm using an GPR pattern). The following works for this purpose: <script type="text/javascript"> // // prevent double-click on submit // jQuery('input[type=submit]').click(function() { if (jQuery.data(this, 'clicked')) { return false; } else { jQuery.data(this, 'clicked', true); return true; } }); </script> However, I can't get the two to work together. Specifically, if validate fails after the Submit button is clicked (which happens given how the form works), then I can't get the form submitted again unless I do a browser refresh that resets the 'clicked' property. How can I rewrite the second method above to not set the clicked property unless the form validates? Thx.

    Read the article

  • RedirectToAction and validate MVC 2

    - by Dan
    Hi, my problem is the View where the user typed, the validation. I have to take RedirectToAction on the site because on the site upload a file. Thats my code. My model class public class Person { [Required(ErrorMessage= "Please enter name")] public string name { get; set; } } My View <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcWebRole1.Models.Person>" %> Name <h2>Information Data</h2> <%= Html.ValidationSummary() %> <%using (Html.BeginForm ("upload","Home", FormMethod.Post, new{ enctype ="multipart/form-data" })) {%> <fieldset> <legend>Fields</legend> <p> <label for="name">name:</label> <%= Html.TextBox("name") %> <%= Html.ValidationMessage("name", "*") %> </p> </fieldset> <% } %> and the Controller [AcceptVerbs(HttpVerbs.Post)] public ActionResult upload(FormCollection form) { Person lastname = new Person(); lastname.name = form["name"]; return RedirectToAction("Index"); } Thx for answer my question In advance

    Read the article

  • Problems using a library in Xcode

    - by Pablo
    Hi! I'm actually developping an application for iPhone and I need to use a library, initially dedicated to a Linux environment. Since I'm using a Mac (with Snow Leopard and Intel Core Duo), I guess it's possible to use this library in my app. My library has 3 files: a file .h, a file .a and a file .so (both .a and .so are in /Developer/usr/lib). In addition I have included the .h i nmy code and I've added the .a in XCode has a framework (and it works because XCode find the .so compiling). For your info when I use the command "file" for the file .so, I have: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped When I compile for the Xcode Simulator, I have a warning and an error. The warning is: In /Developer/usr/lib/mylib.so, file was built for unsupported file format which is not the architecture being linked (i386) The error is: "_mylib_fct", referenced from: -[MyAppAppDelegate applicationDidBecomeActive:] in MyAppAppDelegate.o Symbol(s) not found Collect2: ld returned 1 exit status When I compile for the Device 3.0 with architecture arm6, I also have the same error, but the warning is quite different: ln /Users/Pablo/MyApp/mylib.a file is not of required architecture I try to solve this and make the app working with this lib since days, and I don't understand why the compiler is complaining... is it a 32/64 bits issues ? How can I deal with that ? Your help will be very appreciated. Thx!

    Read the article

  • Cannot return view model after POST

    - by Interfector
    HI, I am trying to return a model after a POST but I receive the following error: Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object. Line 29: public UsersModel getUser(Int32 id) { Line 30: return ( Line 31: from users in db.NUsers Line 32: join userSettings in db.NUsersSettings The code in the controller looks like this: [AcceptVerbs( HttpVerbs.Post )] public ActionResult Edit( NUsers user ) { //Other code that doesn't affect the error :) UsersModel userDetails = this.usersObj.getUser( user.UserID ); return View( userDetails ); } The getUser method looks like this: public UsersModel getUser(Int32 id) { return ( from users in db.NUsers join userSettings in db.NUsersSettings on users.UserID equals userSettings.UserID where users.UserID == id select new UsersModel { UserId = Convert.ToInt32( users.UserID ), Email = Convert.ToString( users.Email ), FirstName = Convert.ToString( users.FirstName ), LastName = Convert.ToString( users.LastName ), Language = Convert.ToString( userSettings.Language ), Phone = Convert.ToString( users.Phone ) } ).First(); } and finally the UsersModel if you think it is relevant: public class UsersModel { public int UserId; public string Email; public string FirstName; public string LastName; public string Language; public string Phone; public List<NLanguages> Languages; public UsersModel() { Models.Languages languagesObj = new Models.Languages(); Languages = languagesObj.getLanguages(); } } Any thoughts on what might be causing the error and what can I do to fix it? Thx

    Read the article

  • Concatenate javascript to a string/parameter in a function

    - by Gerry S
    I am using kottke.org's old JAH example to return some html to a div in a webpage. The code works fine if I use static text. However I need to get the value of a field to add to the string that is getting passed as the parameter to the function. var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } function getMyHTML(serverPage, objID) { var obj = document.getElementById(objID); xmlhttp.open("GET", serverPage); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } And on the page.... <a href="javascript://" onclick="getMyHTML('/WStepsDE?open&category="+document.getElementById('Employee').value;+"','goeshere')">Change it!</a></p> <div id ="goeshere">Hey, this text will be replaced.</div> It fails (with the help of Firebug) with the getMyHTML call where I try to get the value of Employee to include in the first parameter. The error is "Unterminated string literal". Thx in advance for your help.

    Read the article

  • How to access generic property without knowing the closed generic type

    - by Martin Booka Weser
    I have a generic Type as follows public class TestGeneric<T> { public T Data { get; set; } public TestGeneric(T data) { this.Data = data; } } If i have now an object (which is coming from some external source) from which i know that it's type is of some closed TestGeneric<, but i don't know the TypeParameter T. Now I need to access the Data of my object. Problem is that i can't cast the object, since i don't know exactly to which closed TestGeneric. I use // thx to http://stackoverflow.com/questions/457676/c-reflection-check-if-a-class-is-derived-from-a-generic-class private static bool IsSubclassOfRawGeneric(Type rawGeneric, Type subclass) { while (subclass != typeof(object)) { var cur = subclass.IsGenericType ? subclass.GetGenericTypeDefinition() : subclass; if (rawGeneric == cur) { return true; } subclass = subclass.BaseType; } return false; } to make sure, my object is of the generic type. The code in question is as follows: public static void Main() { object myObject = new TestGeneric<string>("test"); // or from another source if (IsSubclassOfRawGeneric(typeof(TestGeneric<>), myObject.GetType())) { // the following gives an InvalidCastException // var data = ((TestGeneric<object>)myObject).Data; // if i try to access the property with reflection // i get an InvalidOperationException var dataProperty = typeof(TestGeneric<>).GetProperty("Data"); object data = dataProperty.GetValue(myObject, new object[] { }); } } I need the Data regardless of its type (well, if i could ask for its type using GetType() would be fine, but not necessary) since i just want to dump it in xml using ToString(). Any suggestions? Thanx.

    Read the article

  • asp.net does not Redirect when in frameset

    - by Snoop Dogg
    I have developed an application on asp.net. I uploaded it to my host. lets say http://myhost/app. My manager wrapped this address into an empty frameset on http://anotherhost/somename and sets the src of frame to http://myhost/ap. And so nobody can login. When the button is hit, it posts back (browser loads stuff, progress bar fills up and ends) but nothing happens. Does not redirect. (I have set IE to alwaysAllowCookies and it now does work, but other people still cannot) I think there is something that I have no clue about framesets and ASP.NET ps: I never use frames but could not convince my manager in doing so. He likes to develop in front page :) Whatz happening? Thx in advance protected void btnLogin_Click(object sender, ImageClickEventArgs e) { Member member = Logic.DoLogin(txtUsername.Text.Trim(), txtPassword.Text.Trim()); if (null == member) { lblError.Text = "Invalid Login !"; return; } CurrentMember = member; ///CurrentMember is an inherited property that accesses Session["member"] = member Response.Redirect("Default.aspx");

    Read the article

  • phpmyadmin shows numbers or blob for mysql's utf8_bin callation columns?

    - by marc40000
    Hi ! I have a table with a varchar column. Its collation is set to utf8_bin. My software using this table and column works perfectly. But when I look at the content in phpmyadmin, I only see some hex values or [Blob xB]. Can I make phpmyadmin show the content correctly? Besides, when I set the collation to utf8_general_ci or utf8_unicode_ci, the phpmyadmin shows the content correctly. Thx Marc [edit]Hah, I found out, there is a small "+Options" link above every table in phpmyadmin. It opens several options including "Show BLOB contents" - which makes the [blob] to readable text when enabled and "Show binary contents as HEX" which shows the hex codes as text when disabled. No idea why there are two options though and why sometimes there is a [Blob] and sometimes hex values. Well. Now I'm still wondering: Setting these options get lost when I go to another table. I have to set them every time I go there. Is there a way to save those options? [/edit]

    Read the article

  • BASH if conditions

    - by Daniil
    Hi, I did ask a question before. The answer made sense, but I could never get it to work. And now I gotta get it working. But I cannot figure out BASH's if statements. What am I doing wrong below: START_TIME=9 STOP_TIME=17 HOUR=$((`date +"%k"`)) if [[ "$HOUR" -ge "9" ]] && [[ "$HOUR" -le "17" ]] && [[ "$2" != "-force" ]] ; then echo "Cannot run this script without -force at this time" exit 1 fi The idea is that I don't want this script to continue executing, unless forced to, during hours of 9am to 5pm. But it will always evaluate the condition to true and thus won't allow me to run the script. ./script.sh [action] (-force) Thx Edit: The output of set -x: $ ./test2.sh restart + START_TIME=9 + STOP_TIME=17 ++ date +%k + HOUR=11 + [[ 11 -ge 9 ]] + [[ 11 -le 17 ]] + [[ '' != \-\f\o\r\c\e ]] + echo 'Cannot run this script without -force at this time' Cannot run this script without -force at this time + exit 1 and then with -force $ ./test2.sh restart -force + START_TIME=9 + STOP_TIME=17 ++ date +%k + HOUR=11 + [[ 11 -ge 9 ]] + [[ 11 -le 17 ]] + [[ '' != \-\f\o\r\c\e ]] + echo 'Cannot run this script without -force at this time' Cannot run this script without -force at this time + exit 1

    Read the article

  • awk + sorting file according to values in the file and write two diffrent files

    - by yael
    hi I have in file file_test values of right eye and left eye How to separate the file_test to file1 and file2 by awk in order to write the equal values on file1 and different values on file2 as the following example down THX file_test: NAME: jim LAST NAME: bakker right eye: |5|< left eye VALUE: |5|< NAME: Jorg LAST NAME: mitchel right eye: |3|< left eye VALUE: |5|< NAME: jimmy LAST NAME: kartter right eye: |6|< left eye VALUE: |5|< NAME: david LAST NAME: kann right eye: |9|< left eye VALUE: |9|< file1: NAME: jim LAST NAME: bakker right eye: |5|< left eye VALUE: |5|< NAME: david LAST NAME: kann right eye: |9|< left eye VALUE: |9|< file2: NAME: Jorg LAST NAME: mitchel right eye: |3|< left eye VALUE: |5|< NAME: jimmy LAST NAME: kartter right eye: |6|< left eye VALUE: |5|<

    Read the article

  • How to call a .NET COM method with an array from delphi using PSafeArray?

    - by Sebastian Godelet
    Hello. I have an .NET (4.0) interface which is implemented with a ServicedComponent COM+ class: interface DotNetIface { void MethodRef(var System.Guid guid); void MethodArray(System.Guid[] guids, params object[] parameters); void MethodCStyle([MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeConst=5)]System.Guid[] guids); } Now I used the Delphi 2007 import wizard to import the type library, and as expected I get the following signatures: procedure MethodRef(var guid : TGuid); procedure MethodArray(guids : PSafeArray); procedure MethodCStyle(var guids : ClrGuid /* from mscorlib_TLB */); If i now call the "ref" method like this it works fine: procedure CallByRef(guid : TGuid); var test : TGuid; begin test := ... comRef.MethodRef(guid); end; Now I also need the array method procedure CallArray(); var localGuid : TGuid; arrayVariant : OleVariant; begin arrayVariant := VarArrayCreate([0,4], varVariant /* dont know here */); arrayVariant[0] := localGuid; /* compile error, cannot cast implicitly */ comRef.MethodArray(PSafeArray(TVarData(arrayVariant.VArray)), /* here this object... PSafeArray works actually*/); end; Now lastly i tried with a c array procedure CallCStyle(); var localGuid : TGuid; arrayOfGuid : array [0..4] of ClrGuid; begin arrayOfGuid[0] := ClrGuid(localGuid); comRef.MethodCStyle(PSafeArray(/* now i dont know put it*/, /* here this object... PSafeArray works actually*/); end; I seriously dont know how to make this work. I hope someone has more experience with COM marshalling thx Side node: I found VT_CLSID which i think can be passed for SafeArrayCreate, but I am not sure how to sue that

    Read the article

  • Using VSTO in a standalone application to access Excel sheets

    - by chiccodoro
    Dear all, tried to research on that but sometimes I seem to lack some googling skills... I want to develop a (standalone) WinForms application which uses automation for communicating with Excel. I already know how to use the Interop, but I thought the VSTO tools would provide a more comfortable or sophisticated way to do that. My idea was: I could build a new standalone project with the excel references prepared. I could use a more sophisticated object model supplied by VSTO to communicate with Excel. However, my findings so far make me think that: VSTO can only be used to build add-ins/worksheets for Excel, not to build standalone application. There is no more sophisticated object model than the one provided by the Interop (which has such ugly things as a locale bug, a "Open(Missing, Missing, Missing...)" method and so on. I found a Worksheet and a Workbook class in the VSTO namespace, but as far as I understand it, these always refer to the CS classes for sheets and workbook which you implement when defining an Excel add-in or a workbook extension. - They cannot be used as comfortable wrappers in a standalone application. Can anybody confirm these statements or correct me where I am wrong? Further, if there should be a way to use VSTO and its "Workbook" class to load an excel workbook from a standalone application, then how do I do that? Thx, chiccodoro

    Read the article

  • Architecture Guidance Needed?

    - by vijay
    We are about to automate number of process for our reporting team. (The reports are like daily reports, weekly reports, monthly reports, etc..) Mostly the process is like pulling some data from the oracle and then fill them in particular excel template files. Each reports and so their templates are different from each other. Except the excel file manipulation, there are hardly any business logic behind these. Client wanted an integrated tool and all the automated processes are placed as menus/submenus. Right now roughly there are around 30 process waiting to be automated. And we are expecting more new reports in the next quarter. I am nowhere to near having any practical experience when comes to architecuring. Already i have been maintaining two or three systems(they are more than 4yrs old.) for this prestegious client.The possiblity of the above mentioned tool will be manintained for another 3 yrs is very likely. From my past experience i've been through the pain of implmenting change requests to the rigd & undocumented code base resulting in the break down of the system and then eventually myself. So My main and top most concern is the maintainablity. When i was searching for these i came across this link, Smart Clients Using CAB and SCSF is the above link appropriate for my requirement? Also Should i place each automated processes in separate forms under a single project, or place them in separate projects under a single solution.. Please correct me if have missed any other important information. Thx.

    Read the article

  • How to stop my firefox extension which interferes other extension?

    - by ccppjava
    Hi, I have tried very hard to make my extension as simple as possible, it now do not contain any skin/css, it just have 'statusbar' in one single 'overlay'. The issue is that when installed, it hides the top three icon of 'all-in-one toolbar' extension of my firefox 3.6.3. On other two machine which do not have 'all-in-one toolbar', it hide all the icons of the web-development toolbar! chrome.manifest content stackoverflow content/ content stackoverflow content/ contentaccessible=yes overlay chrome://browser/content/browser.xul chrome://stackoverflow/content/browser.xul locale stackoverflow en-US locale/en-US/ browser.xul <overlay id="dch-browser-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/x-javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"/> <script src="stackoverflow.js" /> <statusbar id="status-bar"> <statusbarpanel id="stackoverflow-status-bar-icon" class="statusbarpanel-iconic" src="chrome://stackoverflow/content/icon_small.png" tooltiptext="&runstackoverflow;" onclick="stackoverflow.run()" /> </statusbar> </overlay> I have tried very hard to simplify the extension to find the reason, but failed, any suggestion/ideas would be welcome. thx.

    Read the article

  • PHP: Echo function output in function-line, not line of function call

    - by Brill
    I have a problem with my self-coded template system. The content is inserted by Include(). Now I need to add a meta redirect to one page. I know, meta redirect is not the safest way, but I need it because of it's delay possibility. Now i'm looking for a way to influence the wrapping page (template) by the wrapped page (content). So I thought a function can do this job. <?php function test($testvar){ echo $testvar;} ?> <hr /> <?php test("testtext"); ?> Of course the text echos in the line of the function call, not in the function line. Is there a way to make the function echo in the line of the function itself? In this case above the horizontal rule, not below? Of course every other best pratice for this "template problem" ist welcome! THX

    Read the article

  • log4net creates log file but does not write to it (windows service in C#)

    - by user1825172
    I am trying to use basic logging for a windows service. I added the reference to log4net I added the following in AssemblyInfo.cs: [assembly: log4net.Config.XmlConfigurator(Watch = true)] I added the following to my App.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821" requirePermission="false" /> </configSections> <!-- Log4net Logging Setup --> <log4net> <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender,log4net"> <file value="c:\\CGSD\\log\\logfile.txt" /> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %level %logger - %message%newline" /> </layout> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="INFO" /> <levelMax value="FATAL" /> </filter> </appender> <root> <level value="ALL"/> <appender-ref ref="RollingFileAppender"/> </root> </log4net> </configuration> I have the following code in my service: log4net.Config.XmlConfigurator.Configure(); log4net.ILog log = log4net.LogManager.GetLogger(typeof(Program)); log.Debug("test"); the file c:\CGSD\log\logfile.txt is created but nothing is ever written to it. i've been thru the forums all day trying to trac this one down, but if i overlooked an already posted solution i apologize. thx!

    Read the article

  • Save has_and_belongs_to_many link in basic RoR app

    - by Stéphane V
    I try to learn the has_and_belongs_to_many relationship between my 2 fresh new and simple models Product and Author, where a Product can have many authors and where author can have a lots of products. I wrote this : class Author < ActiveRecord::Base has_and_belongs_to_many :products end class Product < ActiveRecord::Base has_and_belongs_to_many :authors end In the partial form of view for the products, I have : <p>Products</p> <%= collection_select(:product, :author_ids, @authors, :id, :name, :prompt => " ", :multiple => true) %> but when I hit the update button, I get this strange message I can't resolve myself : NoMethodError in ProductsController#update undefined method `reject' for "1":String Rails.root: /home/stephane/www/HABTM Application Trace | Framework Trace | Full Trace app/controllers/products_controller.rb:63:in block in update' app/controllers/products_controller.rb:62:inupdate' Request Parameters: {"utf8"="✓", "_method"="put", "authenticity_token"="2GlTssOFjTVZ9BikrIFgx22cdTOIJuAB70liYhhLf+4=", "product"={"title"="Le trésor des Templiers", "original_title"="", "number"="1", "added_by"="", "author_ids"="1"}, "commit"="Update Product", "id"="1"} What's wrong ? Is there a problem with :product_ids... I saw on internet I had to pu a "s" but I'm not sure of what it represents.... How can I link the table authors_products to the key which is given back by the drop-down menu ? (here "author_ids"="1") Thx !

    Read the article

  • How to configure RetryAdvice and ExceptionTranslation for Deadlocks using NHibernate and Spring

    - by zoidbeck
    Hi, i am using Spring.net 1.2 with NHibernate 2.0.1. Within my project i'am facing some Deadlock issues and besides the database tweaks to minimize the occurence i would like to implement Springs RetryAdvice to handle this. I can't find any working example how to configure a this. The reference seems to be clear about how to use it but somehow i can't get it working. <!--Used to translate NHibernate exception to Spring.DataAccessExceptions--> <object type="Spring.Dao.Attributes.PersistenceExceptionTranslationPostProcessor, Spring.Data"/> <!--ExceptionHandler performing Retry on Deadlocks--> <object name="ExceptionHandlingAdvice" type="Spring.Aspects.RetryAdvice, Spring.Aop"> <property name="retryExpression" value="on exception name DeadLockLoserException retry 3x rate (1*#n + 0.5)"/> </object> I have added the [Repository] attribute to my DAOs to get ExceptionTranslation enabled and tried to add the RetryAdvice to the TransactionProxyFactoryObject i am using but it won't work. I don't understand where to put this Advice. Do i have to declare a PointCut to add it or how could i get it to work as expected. Thx in advance - any help appreciated.

    Read the article

  • Where to put a textfile I want to use in eclipse?

    - by Jayomat
    hi there, I need to read a text file when I start my program. I'm using eclipse and started a new java project. In my project folder I got the "src" folder and the standard "JRE System Library"... I just don't know where to put the text file. I cannot use a "hard coded" path because the text file needs to be included with my app... I also tried to create a new folder like "Files" and use the pathe "Files/staedteliste.txt".. doesn't work too... I use the following code to read the file, but I get this error: Error:java.io.FileNotFoundException:staedteliste.txt(No such file or directory) import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; public class Test { ArrayList<String[]> values; public static void main(String[] args) { // TODO Auto-generated method stub loadList(); } public static void loadList() { BufferedReader reader; String zeile = null; try { reader = new BufferedReader(new FileReader("staedteliste.txt")); zeile = reader.readLine(); ArrayList<String[]> values = new ArrayList<String[]>(); while (zeile != null) { values.add(zeile.split(";")); zeile = reader.readLine(); } System.out.println(values.size()); System.out.println(zeile); } catch (IOException e) { System.err.println("Error :"+e); } } } thx for help!

    Read the article

  • CONFUSING : CGAffineTransform - rotation on uibutton resizes buttonimage ?! (iPad)

    - by Michael
    hi there, i've got a strange problem using uibuttons, type custom. i'm placing 4 of those buttons on a scrollview, rotating each button by a random angle using CGAffineTransform. now it seems, that the buttons itself change size depending on the angle of rotation. can't get this problem solved :( UIGraphicsBeginImageContext(tempCtxSize); [cookbookImage drawInRect:CGRectMake(imgOffsetX, imgOffsetY+frmOffsetY, cookbookImage.size.width, cookbookImage.size.height)]; [cookbookFrame drawInRect:CGRectMake(0.0f, frmOffsetY, cookbookFrame.size.width, cookbookFrame.size.height)]; UIImage *combinedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); ... ... UIButton *cookbookViewButton = [UIButton buttonWithType:UIButtonTypeCustom]; [cookbookViewButton setFrame:CGRectMake(0.0f, 0.0f, combinedImage.size.width, combinedImage.size.height)]; [cookbookViewButton setBackgroundColor:[UIColor clearColor]]; [cookbookViewButton setBackgroundImage:combinedImage forState:UIControlStateNormal]; CGAffineTransform rotation = [cookbookViewButton transform]; rotation = CGAffineTransformRotate(rotation, angle); // some random angle [cookbookViewButton setTransform:rotation]; thx for your help in advance!

    Read the article

  • Squid handling of concurrent cache misses

    - by Oliver H-H
    We're using a Squid cache to off-load traffic from our web servers, ie. it's setup as a reverse-proxy responding to inbound requests before they hit our web servers. When we get blitzed with concurrent requests for the same request that's not in the cache, Squid proxies all the requests through to our web ("origin") servers. For us, this behavior isn't ideal: our origin servers gets bogged down trying to fulfill N identical requests concurrently. Instead, we'd like the first request to proxy through to the origin server, the rest of the requests to queue at the Squid layer, and then all be fulfilled by Squid when the origin server has responded to that first request. Does anyone know how to configure Squid to do this? We've read through the documentation multiple times and thoroughly web-searched the topic, but can't figure out how to do it. We use Akamai too and, interestingly, this is its default behavior. (However, Akamai has so many nodes that we still see lots of concurrent requests in certain traffic spike scenarios, even with Akamai's super-node feature enabled.) This behavior is clearly configurable for some other caches, eg. the Ehcache documentation offers the option "Concurrent Cache Misses: A cache miss will cause the filter chain, upstream of the caching filter to be processed. To avoid threads requesting the same key to do useless duplicate work, these threads block behind the first thread." Some folks call this behavior a "blocking cache," since the subsequent concurrent requests block behind the first request until it's fulfilled or timed-out. Thx for looking over my noob question! Oliver

    Read the article

  • Multiple forms on a single page

    - by normalocity
    I've got an app that's in invite-only beta right now. Problem is, I can't get the invite system to work. :( On my root page there's a login form (which works just fine), and I'm trying to add a "request invite" form on the same page. I started doing it by putting the form for InviteRequest (ActiveRecord) inside a partial, in the "views" folder for "InviteRequest". The app is definitely calling this partial, but I'm getting the following error: NoMethodError in User_sessions#new Showing app/views/invite_request/_new.html.erb where line #2 raised: undefined method `invite_requests_path' for #<ActionView::Base:0x25b3248> Extracted source (around line #2): 1: <% @invite_request = InviteRequest.new() %> 2: <% form_for @invite_request do |ir| %> 3: <%= ir.label :email %> 4: <%= ir.text_field :email %> 5: <% end %> I also read through the "Multiple Models in a Form" section of my trusty copy of "Agile Web Development with Rails", about maybe doing this with a "fieldset" tag, but not sure if this is the right approach. Thx.

    Read the article

  • Which book should I choose?

    - by sebastianlarsson
    Hi guys, I'm looking for a good read on object oriented design. The two books I'm currently looking Head First Design Patterns and Head First Object object-oriented analysis & design. They seem very similar when looking at the contents and browsing through available sample text. Which one would be the best choice? About myself: I have a bachelor in computer science and I am currently studying Msc. Software Quality Engineering (read Software Engineering with focus on Quality). I am already confident in object-oriented design and have a lot of programming courses in my backpack. I have done games in c++, courses in advanced java programming (I am SCJP certified), but my preferred language is C#. I have also worked with Java for the last 7 months while studying. I am currently also studying for certificates in C# (apart from my usual studies). So I believe I have the prerequisites of actually understanding the contents of both books. Reason: I just want to be better and keep evolving as a programmer. I think it is fun. I believe Bert Bates and Kathy Sierra are involved in both these books and I have previously read their SCJP preparation book in java. I really do enjoy their style of writing. Other books which I am considering are: Clean Code: A Handbook Of Agile Software Craftsmanship Thx in advance Sebastian

    Read the article

  • Need events to execute on timer events, metronome precision.

    - by user295734
    I setup a timer to call an event in my application. The problme is the event execution is being skewed by other windows operations. Ex. openning and window, loading a webpage. I need the event to excute exactly on time, every time. When i first set up the app, used a sound file, like a metronome to listen to the even firing, in a steady state, its firing right on, but as soon do something in the windows environment, the sound fires slower, then sort of sppeds up a bit to catch up. So i added a logging method to the event to ctahc the timer ticks. From that data, it appears that the timer is not being affected by the windows app, but my application event calls are being affected. I figured this out by checking the datetime.now in the event, and if i set it to 250 milliseconds, which is 4 clicks per second. You get data something like below. (sec):(ms) 1:000 1:250 1:500 1:750 2:000 2:250 2:500 2:750 3:000 3:250 3:500 3:750 (lets say i execute some windows event)(time will skew) 4:122 4:388 4:600 4:876 (stop doing what i was doing in windows) (going to shorten the data for simplicit, my list was 30sec long) 5:124 5:268 5:500 5:750 (you would se the time go back the same milliseconds it was at the begining) 6:000 6:250 6:500 6:750 7:000 7:250 7:500 7:750 So i'm thinking the timer continues to fire on the same millisecond every time, but its the event that is being skewed to fire off time by other windows operations. Its not a huge skew, but for what i need to accomplish, its unacceptable. Is there anyhting i can do in .NET, hoping to use XAML/WPF application, thats will correct the skewing of events? thx.

    Read the article

  • Google map API v3 event click raise when clickingMarkerClusterer?

    - by lucian.jp
    I have a Google Map API v3 map object on a page that uses MarkerClusterer. I have a function that need to run when we click on the map to it is registered as: google.maps.event.addListener(map, 'click', function (event) { CallMe(event.latLng); }); So my problem is as follows: When I click on a cluster of MarkerClusterer instead of behaving like a marker and not raise the click event on the map but only the one from the marker it calls the click from the map. To test this I have generated an alert from the markerclusterer click: google.maps.event.addListener(markerClusterer, "clusterclick", function (cluster) { alert('MarkerClusterer click event'); }); So the clusterclick rises after the click event of map object. I then can't remove the listener of map object as a solution. Is there any way to test if there was a clusterer click in the click event of the map? Or a way to replicate the marker behaviour and do not raise the click event of map when clustererclick is called? Google and documentation didn’t help me. Thx

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >