Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 185/332 | < Previous Page | 181 182 183 184 185 186 187 188 189 190 191 192  | Next Page >

  • Codeigniter Image Library Cropping an Image with 2 sets of coordinates to make square anywhere?

    - by chris
    Spending time reading through the docs, and searching for examples. I understand cropping an image from top 0, and left 0 is pretty straight forward. However. I would like to pass 2 sets of coordinates, a starting point and an ending point. Four Points, a Square that is defined anywhere. However from the examples I am finding, and from what I gather the rendition is not going to let me do this. codeigniter so I am seeking confirmation on this thought, is it true that I can only provide end points from 0, and it crops a square based on said end points or can I actually specify an x start, an x end, and similar for y? Or is there some other technique I can use within codeigniter that will allow me to pass for coordinates for starting and ending points?

    Read the article

  • SQLServer using too much memory

    - by Israel Pereira Valverde
    I have installed on my desktop machine (with windows 7) SQLServer 2008 R2 Express. I have only one local server running (./SQLEXPRESS) but the sqlserver process is taking ALL the RAM possible. With an machine with 3GB of RAM the things starts to get slow, so I limited the maximun amount of RAM in the server, and now, constantly the SQLServer give some error messages that the memory is not enought. It's using 1GB of RAM with only one LOCAL server with 2 databases completely empty, how 1GB of RAM isn't enought ? When the process start it's using an really acceptable amount of memory (around 80MB) but it's keep increasing until it reaches the maximun defined and start to complain about having not enought memory available. In that point I have to restart the server to use it again. I have read about an hotfix to solve one of the errors I got from sqlserver: There is insufficient system memory in resource pool 'internal' to run this query But it's already installed on my sqlserver. Why it's using so much memory?

    Read the article

  • How to validate a form reCaptcha in MVC C#

    - by Alexidze
    I have a page that contains several forms, by submitting each one of them, next form becomes visible. the last form contains a recaptcha validator, my problem starts here, if i declare an action result for that page like this [CaptchaValidator] public ActionResult myAction(SomeModel model, string lang) { return View("towing", model); } I'm getting an argument null exeption parameter "Challenge", which in fact means that you have to POST those fields from recaptcha for the validation to appear and I cannot post anyting untill the last for is visible and posted. then I've added a news ActionResult like myActionValidated, defined a route for it like: mypage/validate pointing to that actionresult and then i don't know where to go from here, i want simply do display a message if the reCaptcha did not validate and redirect to a URL if it succeeded. I hope I made myself clear. Thank you in advance

    Read the article

  • How do I construct a request for a WCF http post call?

    - by James Hay
    I have a really simple service that I'm messing about with defined by: [OperationContract] [WebInvoke(UriTemplate = "Review/{val}", RequestFormat = WebMessageFormat.Xml, Method = "POST", BodyStyle=WebMessageBodyStyle.Bare)] void SubmitReview(string val, UserReview review); UserReview is, at the moment, a class with no properties. All very basic. When I try and test this in Fiddler I get a bad request status (400) message. I'm trying to call the service using the details: POST http://127.0.0.1:85/Service.svc/Review/hello Headers User-Agent: Fiddler Content-Type: application/xml Host: 127.0.0.1:85 Content-Length: 25 Body <UserReview></UserReview> I would think i'm missing something fairly obvious. Any pointers?

    Read the article

  • Validating an Autocomplete field in Django

    - by anonymous coward
    I have models similar to the following: class Band(models.Model): name = models.CharField(unique=True) class Event(models.Model): name = models.CharField(max_length=50, unique=True) bands = models.ManyToManyField(Band) and essentially I want to use the validation capability offered by a ModelForm that already exists for Event, but I do not want to show the default Multi-Select list (for 'bands') on the page, because the potential length of the related models is extremely long. I have the following form defined: class AddEventForm(ModelForm): class Meta: model = Event fields = ('name', ) Which does what is expected for the Model, but of course, validation could care less about the 'bands' field. I've got it working enough to add bands correctly, but there's no correct validation, and it will simply drop bad band IDs. What should I do so that I can ensure that at least one (correct) band ID has been sent along with my form? For how I'm sending the band-IDs with auto-complete, see this related question: http://stackoverflow.com/questions/1528059/

    Read the article

  • C++ conditional compilation

    - by Shaown
    I have the following code snippet #ifdef DO_LOG #define log(p) record(p) #else #define log(p) #endif void record(char *data){ ..... ..... } Now if I call log("hello world") in my code and DO_LOG isn't defined, will the line be compiled, in other words will it eat up the memory for the string "hello world"? P.S. There are a lot of record calls in the program and it is memory sensitive, so is there any other way to conditionally compile so that it only depends on the #define DO_LOG? Thanks in advance.

    Read the article

  • How to prevent button/movieclip from interfering with mouse events

    - by webfac
    I have a few swf's that are loaded into a base file using levels. These clips can be cycled through by means of a setInterval function or when the user clicks the next or previous button. However, when the user hovers over a defined 'hit' area which is ultimately a blank movie clip, the setTimeout call is then canceled. This works fine, except that now the 'hit' clip - being above everything - prevents the movies below accepting hit states, and if I move it to below everything else, when one mouses over any element in the loaded movie, it then acts as though the user has mouse out of the hit area. Is there any way to have this 'hit' clip do its job simply by determining if the mouse is over it, but without using an onRollOver function or equivalent? Much appreciated

    Read the article

  • How should I declare default values for instance variables in Python?

    - by int3
    Should I give my class members default values like this: class Foo: num = 1 or like this? class Foo: def __init__(self): self.num = 1 In this question I discovered that in both cases, bar = Foo() bar.num += 1 is a well-defined operation. I understand that the first method will give me a class variable while the second one will not. However, if I do not require a class variable, but only need to set a default value for my instance variables, are both methods equally good? Or one of them more 'pythonic' than the other? One thing I've noticed is that in the Django tutorial, they use the second method to declare Models. Personally I think the second method is more elegant, but I'd like to know what the 'standard' way is.

    Read the article

  • Why the difference in speed?

    - by AngryHacker
    Consider this code: function Foo(ds as OtherDLL.BaseObj) dim lngRowIndex as long dim lngColIndex as long for lngRowIndex = 1 to ubound(ds.Data, 2) for lngColIndex = 1 to ds.Columns.Count Debug.Print ds.Data(lngRowIndex, lngColIndex) next next end function OK, a little context. Parameter ds is of type OtherDLL.BaseObj which is defined in a referenced ActiveX DLL. ds.Data is a variant 2-dimensional array (one dimension carries the data, the other one carries the column index. ds.Columns is a Collection of columns in 'ds.Data`. Assuming there are at least 400 rows of data and 25 columns, this code takes about 15 seconds to run on my machine. Kind of unbelievable. However if I copy the variant array to a local variable, so: function Foo(ds as OtherDLL.BaseObj) dim lngRowIndex as long dim lngColIndex as long dim v as variant v = ds.Data for lngRowIndex = 1 to ubound(v, 2) for lngColIndex = 1 to ds.Columns.Count Debug.Print v(lngRowIndex, lngColIndex) next next end function the entire thing processes in barely any noticeable time (basically close to 0). Why?

    Read the article

  • Most efficient way of checking for a return from a function call in Perl

    - by Gaurav Dadhania
    I want to add the return value from the function call to an array iff something is returned (not by default, i.e. if I have a return statement in the subroutine.) so I'm using unshift @{$errors}, "HashValidator::$vfunction($hashref)"; but this actually adds the string of the function call to the array. I also tried unshift @{$errors}, $temp if defined my $temp = "HashValidator::$vfunction($hashref)"; with the same result. What would a perl one-liner look like that does this efficiently (I know I can do the ugly, multi-line check but I want to learn). Thanks,

    Read the article

  • <jaxrs:client> not getting autowired

    - by himangshu
    I am trying to build a restful client using jaxrs:client as defined in http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml In my test class I am getting org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.abc.service.ExportServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.bankbazaar.service.ExportService com.abc.service.ExportServiceTest.exportClient; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.abc.service.ExportService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=exportClient)} this is my spring config However exportClient=(ExportService)applicationContext.getBean("exportClient"); this works. Thanks Himangshu

    Read the article

  • scrum and specifications

    - by zachary
    So we start Scrum today and start going over story points estimates. The first story that comes up is a new screen that needs to be developed. It has 1 sentence to describe the screen and 3 user acceptance tests. This starts a fight between the development team and the product owner. Product owner says that stories do not need to be speced out and they will just be fleshed out during the sprint. We say that the story needs to be completely speced out for the sprint. But now I am starting to be unsure about who is right.... Any good articles on this that I can send to the team about how defined a user story has to be?

    Read the article

  • How to Execute Page_Load() in Page's Base Class?

    - by DaveDev
    I have the following PerformanceFactsheet.aspx.cs page class public partial class PerformanceFactsheet : FactsheetBase { protected void Page_Load(object sender, EventArgs e) { // do stuff with the data extracted in FactsheetBase divPerformance.Controls.Add(this.Data); } } where FactsheetBase is defined as public class FactsheetBase : System.Web.UI.Page { public MyPageData Data { get; set; } protected void Page_Load(object sender, EventArgs e) { // get data that's common to all implementors of FactsheetBase // and store the values in FactsheetBase's properties this.Data = ExtractPageData(Request.QueryString["data"]); } } The problem is that FactsheetBase's Page_Load is not executing. Can anyone tell me what I'm doing wrong? Is there a better way to get the result I'm after? Thanks

    Read the article

  • Make a Method of the Business Layer secure. best practice / best pattern

    - by gsharp
    We are using ASP.NET with a lot of AJAX "Page Method" calls. The WebServices defined in the Page invokes methods from our BusinessLayer. To prevent hackers to call the Page Methods, we want to implement some security in the BusinessLayer. We are struggling with two different issues. First one: public List<Employees> GetAllEmployees() { // do stuff } This Method should be called by Authorized Users with the Role "HR". Second one: public Order GetMyOrder(int orderId) { // do sutff } This Method should only be called by the owner of the Order. I know it's easy to implement the security for each method like: public List<Employees> GetAllEmployees() { // check if the user is in Role HR } or public Order GetMyOrder(int orderId) { // check if the order.Owner = user } What I'm looking for is some pattern/best practice to implement this kind of security in a generic way (without coding the the if then else every time) I hope you get what i mean :-)

    Read the article

  • Import part with specific meta data using MEF Preview 5

    - by Riri
    I have a export defined as as follows in MEF preview 5 [ExportMetadata("Application", "CheckFolderApplication")] [Export(typeof(ExtendedArtifactBase))] public class CheckFolderArtifact2 : ExtendedArtifactBase { ... Then I only want those imports with the "Application" "CheckFolderApplication" metadata. To currenly do that I read all the imports and then filter the result. [Import(typeof(ExtendedApplicationBase))] private ExportCollection<IApplication> _applications { get; set; } public IApplication GetApplication(string applicationName) { return _applications.Single(a => a.GetExportedObject().Name == applicationName).GetExportedObject(); } This feels really inefficient. What if I have thousands of plug-ins - do I have to read them all via MEF to just get one with the right metadata? If so how do you cache the result?

    Read the article

  • Nhibernate Complex Type binding

    - by user329983
    I have two oracle user defined types: Audit_Type – A normal object with two fields a string and a number Audit_Table_Type – A table of audit_types, (an array) I have a stored procedure that takes as a parameter an Audit_Table_Type. List<Audit_Type> table = new List<Audit_Type>(); var query = session.CreateSQLQuery("call Audit_Rows(Audit_Table_Type(:table))") .SetParameterList("table", table, NHibernateUtil.Custom(typeof(AuditTypeUDT))) This is what I did intuativly created the ICompositeType and just set in a list of them in but this gives me nothing close to what I wanted. I couldn’t figure out how to bind to a table at all. I have built the inline sql that would do this for me but it would destroy my shared pool (not using binds). So a General question how do I bind to complex/composite types using Nhibernate?

    Read the article

  • Column.DbType affecting runtime behavior

    - by leppie
    Hi According to the MSDN docs, the DbType property/attribute of a Column type/element is only used for database creation. Yet, today, when trying to submit data to an IMAGE column on a SQLCE database (not sure if only on CE), I got an exception of 'Data truncated to 8000 bytes'. This was due to the DbType still being defined as VARBINARY(MAX) which SQLCE does not support. Changing the type to IMAGE in the DbType fixes the issue. So what other surprises does Linq2SQL attributes hold in store? Is this a bug or intended? Should I report it to MS? UPDATE After getting the answer from Guffa, I tested it, but it seems for NVARCHAR(10) adding a 11 char length string causes a SQL exception, and not Linq2SQL one. The data was truncated while converting from one data type to another. [ Name of function(if known) = ] A first chance exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll

    Read the article

  • SSRS Column Grouping with specific order

    - by AmiT
    Hi Experts, Is it possible to change order of records/groups in a result-set from a query using Group By? =I have a query: SELECT Category, Subcategory, ProductName, CreatedDate, Sales From TableCategory tc INNER JOIN TableSubCategory ts ON tc.col1 = ts.col2 INNER JOIN TableProductName tp ON ts.col2 = tp.col3 Group By Category, SubCategory, ProductName, CreatedDate, Sales = Now, I am creating a ssrs report where Category is Primary row group, then SubCategory is its child row group. Then ProductName is a Primary Column Group. It works perfect, But it shows the ProductNames in alphabatic order. I want it to show the ProductNames in custom order(defined by me).Like, ProductNo5 in 3rd column, ProductNo8 in 4th column, ProductNo1 in 5th column ... and so on!

    Read the article

  • How do you modify a modal popup from ASP codebehind instead of letting it close?

    - by user328422
    I'm using SimpleModal to create a popup on an ASP.net application. The OK button calls a server-side function - and based on the resulta of that function I'd like to modify the popup (make some things visible, etc.) instead of letting it close. If that's too difficult, I'd like to open the popup again without the user having to re-click on anything. I'm just not sure what the best way to do this is. Currently the OK button in the popup looks like this: <asp:ImageButton ID="submitInfoBtn" OnClick="btnSubmitInfo_Click" ImageUrl="css/assets/btn_ok.png" runat="server"/> and there is nothing defined that tells anything that the OK button should close the popup (the Cancel button has class="simplemodal-close", so I would expect it to do just that, but not the OK button) - anyone have any ideas on the best way through this? Thanks in advance!!

    Read the article

  • Implicit array casting in C#

    - by Malki
    Hi, I have the following classes with an implicit cast operator defined: class A { ... } class B { private A m_a; public B(A a) { this.m_a = a; } public static implicit operator B(A a) { return new B(a); } } Now, I can implicitly cast A to B. But why can't I implicitly cast A[] to B[] ? static void Main(string[] args) { // compiles A a = new A(); B b = a; // doesn't compile A[] arrA = new A[] {new A(), new A()}; B[] arrB = arrA; } Thanks, Malki.

    Read the article

  • Circular dock/menu in css or jquery

    - by sasidhar
    Is it possible to have a circular menu or dock using css or jquery.? I have a set of images as the dock items that need to be displayed as a circular dock... however the number of items in the dock are not constant and may vary.... so i cannot tend to use constant values for positioning each item in a pre-defined manner. Ajax loads some images into this particular div and i need to use css or jquery to style this so that they get displayed as circular dock items. Any idea on how this can be implemented..? I would like a browser in-specific implementation, but i also welcome if some one has some solutions specific to few browsers... UPDATE I don't think i exactly want a pie menu... it easily gets messed up as the number of dock items increase. I am looking for a spiral dock. and by spiral i mean that the menu items must be in the following alignment..

    Read the article

  • PostgeSQL: Arrays Data Type with PHP

    - by ArchJ
    I'm working on PostgeSQL with PHP and I know that PosrgeSQL allow columns of a table to be defined as arrays. So let's say I have a table like this: CREATE TABLE sal_emp ( a text ARRAY, b text ARRAY, c text ARRAY, ); These are my arrays: $a = array(aa,bb,cc); $b = array(dd,dd,aa); $c = array(bb,ff,ee); and I want to insert them into respective column each like this: a | b | c -----------+------------+------------ {aa,bb,cc} | {dd,dd,aa} | {bb,ff,ee} Can I insert it this way? $a = implode(',', $a); $b = implode(',', $b); $c = implode(',', $c); $a = array('a' => $a, 'b' => $b, 'c' => $c); pg_insert($dbconn, 'table', $a); Or is there a better way to achieve the same result?

    Read the article

  • tuProlog unknow behavior

    - by Josh Guzman
    I'm using tuProlog to integrate Prolog with Java, to do so I'v been defined a .pl file wich contains this code: go:-write('hello world!'),nl. In my Java File at NetBeans i Have a Main Class that invokes this: Prolog engine = new Prolog(); Theory theory = new Theory(new FileInputStream("facultad.pl")); try { engine.setTheory(theory); } catch (InvalidTheoryException ex) { } SolveInfo solution = engine.solve("go."); if (solution.isSuccess()) { System.out.println(solution.getSolution()); } This Code must returns 'hello world', but instead of that it answer 'go', any ideas about this erratic behavior ??

    Read the article

  • How to position columns in select list based on a variable.

    - by Rohit
    I am creating a dynamic grid which is created by selecting the format defined in the below XML.My select list includes all columns in this XML,I want to position these columns columns on the basic of position attribute in XML. <gridFormat> <column property="CustomerID" dbName="CustName" HeaderText="Customer" IsVisible="0" Position="1" /> <column property="CustomerName" dbName="FacilityName" HeaderText="Facility" IsVisible="1" Position="3" /> <column property="FacilityInternalID" dbName="Pname" HeaderText="Patient" IsVisible="1" Position="2" /> </gridFormat> I cannot select them in the order specified by the position attribute. I can do it in C# by looping around the returned datatable and specifically position columns using datatable.columns.setordinal() method. Is there any better way in SQL or C# to accomplish this.

    Read the article

  • Perl Strip Comments with Regex Unique Request

    - by YoDar
    Hello, I'm running a code that read files, do some parsing but need to ignore all comments. There are good explanations how to conduct it. like this link $/ = undef; $_ = <>; s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse; print; My first problem is that after run this line $/ = undef; my code doesn't work properly. Actually, I don't know what it does. But if I could turn it back after ignoring all comments it will be helpful. In general, What is the useful way to ignore all comments without changing the rest of the code ? Thanks, YoDar

    Read the article

< Previous Page | 181 182 183 184 185 186 187 188 189 190 191 192  | Next Page >