Posts

Showing posts from September, 2012

c preprocessor - Defining Binary Macros in C++ -

Can someone explain why the following error occurs: #define bla "\ XA" four A [2] = {0}; Memcopy (A, BLA, 1); // a [0] = 0x0a & lt; - right // a [1] = bla; // '=': 'const char [2]' to 'four' can not be converted thanks, rm Try: #define bla '\ xA' However this memcpy will stop working.

menu - CSS: Cancelling properties at the start and end of a list -

I have a menu list. I am not using UL / Lie, just nested div is the menu item between the graphic The separator is the first item in the list needs to suppress the left padding; The last item needs to press the correct padding and graphic separator. Here's the CSS: .platformItem {float: left; Padding: 0 12px; Background: URL (/includes/themes/22RWO/images/assets/separator.gif) No-repeat top right; } .PlastMythm. First {padding-left: 0! Important; } .platformItem .last {padding-right: 0! Important; Background image: None! Important; } And here is HTML: & lt; Div id = "platform menu" & gt; & Lt; Div class = "platformItem first" & gt; & Lt; A href = "" & gt; All & lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "platformItem" & gt; & Lt; A href = "" & gt; Windows & lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "platformItem" & g...

How do I change the title and link colors of a Google Custom Search Element? -

Status: Take a look at this page and search for "photos" on both: Top search engine refreshes the page and displays results with orange link titles and blue links. The bottom search engine shows tabbed results with blue link titles and blue links. I found an answer on Google Forum; However, I'm not naive with AJAX, so I do not know what to answer this. I've read about various Google documents about custom search engines and web elements, but I still can not understand it. I've tried whatever ... A class was added to the class (class = "gsc-result gsc-webResult") and the same on the page Adding CSS (# GSC-results GSC-WebRashult) to see if it works, but it does not work. To see if I can make changes, see the reference XML file. This only affects the top search box. What can you do to help Explain what I'm doing wrong Where should I look, Give it a description Show me the sample of code that shows the actual color changes and ...

asp.net - PreRender event is not fired -

Recently I have seen that the Page_PreRender event is not being dropped. If the protected override zero OnPreRender is used - everything is fine. AutoWire is enabled and the same code works fine on other machines ... Where should I dig? There are some things that can not put it in the fire View Asset is being set to false Reaction. End ()

asp.net mvc - When implementing RESTful services should lookup values / tables get their own URI? -

Image
Based on a modified version of I am creating permanent services for many database organizations. Some of these organizations are linked to lookup tables, as shown below: Lookup tables are associated with one and only one table. Additionally, lookup tables will be used to populate dropdown lists, previewviews, and comboboxes by the client application for editable areas of their respective unit tables. To see the values ​​/ table should get their own URR or do they "share" with their parents? What are the pros / cons of each? Option 1: / Entities / Space / Space credentials / Option 2: Lookup / Space credentials / In a rental system, the methods of building your URLs are not as important as identifying resources and the names you give them. From what you have shown, it seems that you have three resources: Space Spacequery Lookup The URI, which you give to these resources, is a matter of great taste. For example, someone in REST prevents you from ...

switch statement - Java application if/case recommendation -

I am writing an application for a Java course, I am completely starting up I have learned from This application is showing some behavior and I am not sure what is happening due to it. The application is GUI based and calculates on user input. For the verb listener category, if I have a set of statements: "If this button does this then this button does this" All in a row like this. It seems that instead of pressing the application button, instead of running the matching user, all if statements are running. Would it be better to use case / switch structure for this type of thing? If necessary, I can post my code, I am new to this site and I am not sure whether this is acceptable or not. Until I see my code, I have to guess, but seeing my accepted newness If you like this statement if (condition); {...} This type of if (condition) {...}

sql server - Checking rule violations before deleting a record -

I would like to implement the "soft-delete" scheme for many organizations in my SQL Server 2005 database. That means, I mean that I would like to delete a line from the table if there is no referenced integrity rule violation, otherwise I will set the flag on the record, indicating that it has been removed. In the table that I wish to apply this "soft-delete" pattern, should be applied in the form of "insert / update specificity" as "no action". How can I check to see if the foreign key barriers will be violated to run what I am excluding? I do not want to capture exceptions - I want to see clearly whether the rules will be violated or not. I do not even want to manually check it through the SELECT statement (Maintenance Nightmare) manually. I would prefer a solution in T-SQL; But I am using unit framework, so if one exists for this task then it would be possible to use an API. Note that there is a similar question, but the submitted ...

asp.net - Oracle: tracing SQL statements -

I am maintaining a home-frame web based help desk solution and we experience a false change in a db field The code included in some situations is quite clearly a mess, a mix of different methods for database access (the worst and most dangerous that is creating SQL strings through concatenation). The entire solution did not help in finding a full-text search of the problematic area (the field was shown only in the selection and only one in the valid) so I could not even get the offensive code. Do you know the fastest way to enable SPL tracing I did some goggles And I found this one: alternative system SET sql_trace = true scope = memory; But I would like to know what is the best way to solve the problem (and perhaps without rewriting the application to create a simple SQL logging mechanism). The way to enable tracing is to know, but if you are having trouble working, Try to see if you can find references to the offending column in the sql_text column of SYS.v $ sql. Ass...

R function for testing if a vector contains a given element -

In R, how do you see a vector, to see if there is an element in it? both mail () (first shows) and % In% (a ',' b ',' c ',' e ')' b 'in% v% v / Pre>

documentation - Python Wiki Style Doc Generator -

I export these to the Google Code wiki as an extension of the current docs I would like to be able to. Take a look at pydoc.TextDoc if there is very little markup in it, you can get it from And it can generate markup according to the syntax of your wiki.

SQL-like functionality in R -

I am used to write data manipulation in SQL and now when I am learning RI, I think that Sometimes you want to do something simple in SQL but will have to learn a bunch of stuff with R, which is to manipulate the R data frame itself. Is there a simple job? View package sqldf This is perfect for your needs.

php - How to store processed file in users desktop? -

I have created a website. An image option has been created in that scaling. Now I want to store the image of that scale in users. But its savings in the existing folder. Please help me by sending a php script to store that file in the desktop If your website is actually People are going to be on the web instead of the web locally on their computers, so you can not save it directly to your computer. As you download the file, with PHP it can provide a download link to the user, by using the correct mime-type and content header ( header). Therefore, they can choose to download it themselves. If your website is being used locally (a bit strange, but this could happen), then you fopen ( )

javascript - jQuery dynamic event binding -

I think this is a very basic question, but I'm struggling with this problem. On my form I have an option which dynamically adds a new line to the table, which is quite simple to do with jQuery. On any of the elements, I need to force an event, it is relatively simple, the part with which I have problems, is the incident which needs to be bound, it has to be taken parameters. Therefore, I have the code: $ (newrow) .find ("select"). Each (function () {var ochange = function (handle) {var thisselect = "select" + handle; var thislink = "link" + handle; var iscollate = "collate" + handle; if (document.getElementById (thisselect). Value == 4) {document.getElementById (thislink) style. visibility = 'visible';} and {document.getElementById (thislink) style. visibility = 'hidden'; document.getElementById (thiscollate) .value = " $ (This). $ (This). $ (This) atr ("name", "select" + numfields); $ (this) ...

c++ - NTLM authentication for a web server side application -

My Windows based application written in C + + (originally an HTTP / 1.1 proxy server) listens for requests from various users. Please, please, please redirect me to the correct positions if there are already threads that discuss something similar. Most of the research on the WWW does not give me client-side programming, very little or almost anyone - for coding that should be done in the HTTP server Thank you all great hacks here, a big advance. The short answer is that I think this sample is your best place and you need it The display of the required basic SSPI calls has been written for a plain TCP server, but the challenge / response data is sent over HTTP without much complexity. I recommend a second review Personally, I also try to attach to the IIS a low-level debugger and see that it is the SSPI How to call the work, but it can not be your cup of tea. SSPI, getting the user name should be the piece of cake (but ask if you need help) LDAP / AD properties for th...

deployment - How to disable the "autodeploy" to server feature in an Eclipse web project -

I am using Eclipse (J2 EEE Galileo) and I have created a dynamic web project and it is a server ( JBs). Now, whenever I make changes to one of my JSP pages, the eclipse server will create a war file and autoplayuplayer. It is sometimes useful, but sometimes it is more on the way for me. I would like to disable this feature, and use the "publish" feature whenever I want. I still want to run the server from Eclipse. But I can not find any setting for this, can someone give me a hint? Open the server view (window -> Show Show -> Server) Open your server configuration from the server and show a page with your server name, runtime environment etc. On that page will be a brief panel called 'Publishing', which lets you configure or disable automatic publishing.

How do I make side-by-side images equal height (CSS/HTML)? -

Two images, one 300x400 pixels (height x width), the other is 500x600. How can I reveal those two sides to scale, so that they are the same height on the screen (or the container / div) without changing the aspect ratio of the image either? I have an HTML / CSS method to do this - something that probably works possibly for more than 2 images, currently I manually calculate the width of each image (math below) I am Edit: An example of what I'm trying to do: The formula used below (or trial and error) to come up with the 79/20 split. Note that 79 + 20 & lt; 100- If I set it to 80/20, then wrap the images due to the limit. How can I do this without any calculations? The browser should be able to do this for me. ah1 = 300 // The actual height of the image is 1 aw1 = 400 // The actual width of the image is 1 aH 2 = 500 / actual height of the image 2 aw2 = 600 // Actual width 2 image / / These are needed to calculate: dw1 // the width of the image's display...

jquery - ASP.NET MVC routing with jqGrid -

I am trying to create a link in a URL such as home / details / 1 JqGrid column Documentation reveals: Sholink {baseLinkUrl: '', show action: 'show', adeparam: '& amp; Amp; Key = 2 '} Note: AddParam in & amp; For example: formatter: 'showlink', formatoptions: {baseLinkUrl: 'someurl.php', addParam: 'and action = edit'} This output will be: http: // localhost / someurl.php ? Id = 123 & amp; Action = edit Has anyone used the farmstate to create a path instead of the query string? I have not used jqGrid but as far as I can tell, you have addParam should not be set to anything, because it will only add as a query string, try setting your path on baseLinkUrl .

asp.net - How do I control reloads when using the back button in the browser? -

I have an ASP.NET application that has a heavily major page; the contents of this main page are seldom changed Apart from the action taken on the same page. When I retrieve the browser from the cache by pressing the "back" button in the user browser, to contact the server every time, is it being forced to render this page again? Thanks, Jonas The short answer is: You can not. I think the closest you can do is to include something related to your webpage, especially caching and termination like: & Lt; Meta HTTP-equivalent = "EXPIRES" content = "[some date / time in the future]" & gt; and & lt; Meta HTTP-EQUIV = "cache-control" content = "public" & gt; Once you are sent to the client browser in the web page provided to you, then you just hope the browser, on the user who clicks the back button, on one of your web servers Rather than inciting another request / reaction cycle, the "cached" v...

c# - OOP: composition samples please suggest which is better and why -

Please disregard the language syntax, I just want to discuss here Oh. I will present here two code snippets, each of which is a sample of a structure (if I am not mistaken). Problem Statement : I have an object that holds an entity's stats in the system. Give those statistics: Name Last name Pay * Whatever the fields are Can I just take these for example? So please do not think in terms of whether it is necessary for the field or not. Suppose all three are necessary. I created a square that matches these areas: public class stats {name of field; Region LatsName; Field salary; } Now I came in a situation where I should get information about a person. It is necessary to look at a point in the workflow system to present information about a person for all three steps. When she was a child. When he was young When he retired. Note here that name and lastname will not change, only because salary can change, because I thought I could probably creat...

database - SQL issue: Calculating percentages and using multiple joins to the same table -

Here's something I'm trying to do at work. It is said that I have been given this month's data for customers in this store - how much they have been divided by the type of food: Customer FOOD_TYPE FOOD_TYPE_VALUE 1 SWEET 52.6 1 Courage 31.0 1 Dairy 45.8 1 drink 12.1 2 sweet 15.1 Toilet 2 44.1 2 drinks 23.4 3 sweet 95.7 3 interview 20.0 3 induces lactation 10.8 3 drinks that 57.1 it has been decided that the client 3 are our ideal client because she demographic profile I each For every customer Can receive a percentage allocation to do: c1.customer, c1.food_type, 100 * c1.food_type_value / sum (c2.food_type_value) mytable the Mytable C1 Inner C2 Join c1.customer = c2 Customer is c1.customer, c1.food_type, c1.food_type_value by client but I am having trouble creating a query that gives me another column with matching percentage values ​​for my ideal customer Will give I.e.: Customer FOOD_TYPE FOOD_TYPE_PERC IDEAL_PERC 1 Sweets 37 52 1 Savoring 22 11 1 Dairy ...

Visual Studio Debugger - Automatic Variable Assignment -

I am working on a multi-developer project and the app developer is Launcher through the Launcher app, Such as users log in, their location etc. Right now when I debug an application, I set the breakpoint of the code parsing the input parameters and I assign the user name to my user name. I have a hard-code value of this: I believe this is bad behavior I'm worried that the file should be used by our VCS And have devastating wave effects. Many developers are working on the project, so my name, location assignment etc. Hard-coding is not really an option. I can not read the file because it is in active development and I need to get the updated version of the file which is constantly asked. My question is: Is there an underlying method or extension to automatically assign value to debug mode, right now I have the variable Highlighting and typing my text, can it be automated? Thank you in advance When I use these conditions Hit, I usually combine conditional...

Is there native support in Rails or Ruby for representing threaded comments -

I have a comment section in my app that looks like this: response1 Feedback: 1 Response 1B Reaction 1B1 Response 2 Reaction 2 Reaction 2 Reaction 2 Reactions Answer 2 Reactions 1 2 Reactions 1 2 1 2 3 4 1 1 2 3 4 5 1 1 2 3 4 5 6 = "Comment" & gt; ; Response 1 & lt; Div class = "comment" & gt; Response1a & lt; Div class = "comment" & gt; Response1a1 & lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "comment" & gt; Response 1b & lt; / Div & gt; & Lt; / Div & gt; And this CSS: .comment {margin-left: 50px; } The data structure is still a question of how to use in railways to represent comments and their relationships with each other. Is there a basic support for Ruby to represent tree data structure, which will work well for this structure of data? Or would I need to adapt something to this task? You can use one of the nested set plugins - one seems to be most active...

Vista and Oracle 10g -

I get this error message in Internet Explorer with Oracle 10G installed on Vista: 'Aurouleb .oracle.1' provider is not registered on the local machine I can connect to the Oracle database exactly with SQL Server 2008 linked database. However, my IE 7 does not see it. I have established it as an administrator and have tried many different things. Any advice? Thank you. post text" itemprop = "text"> This is a permission problem. Your IIS and ASPNET users do not have the necessary privileges to access the ORACLE_HOME folder. Right click your ORACLE_HOME folder, select Properties and go to Security name tab. Add 'User' group (or IIS and ASPNET), and provide them "List Folder Content", "Read", and "Read and Execute" Press Apply, then go to Advanced check and hit the "Change Entry Entry on All Child Objects" box.

jsf - Basic cache question -

Say I have a JSF backing bean, request scope, which has a list as a member. In the backing bean, I have a method that is connected to a button on the page. When the button is pressed first, the method uses EJB to populate the list. On the post-button press, I do not want to call DB. Then, I added a check: if (list == null || List.size () == 0) // Populate the list Otherwise, the list will be populated already, so no DB call is necessary. Is it satisfying for caching mechanisms? Because Bean's request is scope, its members will only be present for the lifetime of a single request, The page to be requested will be received. Whatever you can do, it may contain cached data in a different area (such as sessions or applications). & lt; Managed-Bean & gt; & Lt; Managed-name names & gt; ExpensiveBean & lt; / Managed-name names & gt; & Lt; Successful bean category & gt; Life.ExpensiveBean & lt; / Successful bean category & gt; ...

servlets - Java EE Filters not able to get cookies? -

Why can not the cookies referenced from a servlet filter be enabled? It just seems to me that Java EE will not allow you to clean the cookie values: Public Zero doFilter (Servlet Request Request, Servicelet Response Response, Filter China Series) Servlet Upation, IOException { request. } ServletRequest does not support getCookies (as is the case with HttpServletRequest). To get the cookie you need to put it on the HTTPReleaseLaired . HTPASRquareRequest http Rike = (HTTPServeletture) request; The reason is that the ServletResponse class does not support cookies because the protocol is not required in a ServletRequest , you can Make sure that there are cookies cookies are an HTP thing.

Programming language and compiler -

I was discussing this with my friend and realized that this is the best place to ask this question? How does a new language arise? This new language should be written in some new language (eg C ++ was written in C in the initial stages), or how is it made? And, how can this language work new if there is no compiler for it? So, there should be some compiler for this? Who writes compiler for this? So, how does all this work together, the new language and its compiler, the relationship of the new language with its native language? You write compiler in an implementation language, as long as the compiler starts to compile new languages So that everyone else can be implemented EDIT: Just to clarify, the commenter on this answer is also correct. The compiler does not need to be written in a new language, unless you want it. As stated, some people do not go that route and live with the basic implementation language.

Premium ASP.NET hosting -

I know there are a million ASP.NET hosting options, but you have premium options for spending some money at max. Want performance and uptime? Currently we use the maximum ASP and they are usually great. I know that there is another good option. Does the rackspace have any other suggestions? This is one of those things that is difficult for Google because everyone calls their hosting option premium or professional. I can say that the rackspace is a good option, but because I use discountasp.net I need hosting .NET 3.5 SP1 with SQL 2008 and they have distributed.

vb.net - LINQ to SQL delete producing "Specified cast is not valid" error -

I have found a painkiller simple table that is giving a "specified artist not valid" error while trying to delete me One or more rows have two columns in the table, in the form of an "id" primary key (INT), and "name" (VARCHAR (20)), which is the map for LINQ from LINQ to a string in the SQL dbml file. Both of these statements generated error: dc.DeleteOnSubmit (dc.MyTables.Where (function (x) x.id = 1) .SingleOrDefault) dc.DeleteAllOnSubmit (dc.MyTables) id = 1, name = "/> first" [InvalidCastException: specified cast is not valid is.] System.Data.Linq.SingleKeyManager`2.TryCreateKeyFromValues ​​(object [] values, V & amp; V) +59 system .Data.Linq.IdentityCache`2.Find (object [] keyValues) +28 system .Data.Linq.StandardIdentityManager.Find (MetaType type, vas Ye [] keyValues) +23 System.Data.Linq.CommonDataServices.GetCachedObject (MetaType type ,, object [] keyValues) +48 System.Data.Linq.ChangeProcessor.GetOtherItem (...

tsql - MS SQL Server 2005 sp_stored_procedures -

itemprop = "text"> I am currently running sp_stored_procedures Stored functionality to retrieve the list of SP for a given data source. I have to query this dataset via PROCEDURE_NAME and PROCEDURE_OWNER columns. However, PROCEDURE_NAME has a strange return value. It seems to attach a semicolon and a number at the end of the name sel_AppUser ;. 1 sel_AppUser_all; 1 sel_AppUser_by_login; 1 sel_Browsable; 1 Here is sel_Browsable create process [dbo]. Select [sel_Browsable] uniqueidentifier @BrowsableID * Browse from browsableID = @BrowsableID for XML Auto, select Elements * Properties from Where objectId = @BrowsableID Auto for XML, select Elements * Search from where browsableID = @ BrowseableID XML Auto, Order by searchOrder for element choosing attribute * Attributes from Insert XML to Auto Attribute on Search.objectID = Search.searchID where browsableID = @BrowsableID command by SearchOrder, Elements Selection Criteria. * Include Criterion.searchID ...

java - How to stop a process with time constraints -

I think the subject may not be accurate enough, but I really do not know how to describe it in very brief ways. What I want to do ... is as follows: I have some analysis (in Java) running and trying to give a return value, but once a barrier in the whole analysis Is, say 10 seconds If the analysis returns results within 10, then the result is flame Tie; Otherwise, while reaching Tenth, stop the process and return the dummy value I am a newbie in this area, any suggestions will be welcome. You can use to create a job and request results within a particular time (With timeout). If the window is being violated at that time, you will get an exception. At that point, you can call the method again with the parameter true , block the blockage and cancel the underlying task. Object result = dummy; Try {result = futureTask.get (5, TimeOut.SECONDS); } Hold (timeout Exception e) {futureTask.cancel (true); }

Django Template: Nested Dictionary "for" tag inside of List "for" tag -

I want to be able to repeat on a dictionary within the loop in the deegago template. For this sample, consider the following: items_list = [{key1 ':' value1 ',' key2 ':' value2 '}, {' key1 ':' Value5 ',' key2 ':' value9 '}] method # 1: {% of dict items_list%} {% Key for Direct, value%} & lt; Tr & gt; & Lt; Td> {{Key}} & lt; / Td> & Lt; Td> {{Value}} & lt; / Td> & Lt; / TR & gt; {% Endfor%} {% endfor%} Method # 2: {% items in dict for%} {% item%} & Lt; Tr & gt; & Lt; Td> {{Node.0}} & lt; / Td> & Lt; Td> {{Node.1}} & lt; / Td> & Lt; / TR & gt; {% Endfor%} {% endfor%} Question Why method # 1 does not work? It makes me feel comfortable. Is the way I am fixing it in Method # 2 or will it cause problems later? . ITEMS PROPERTY should be used in Method 1. Try it: key for {%, value item in dict%} dict.items...

.net - Regex that matches a newline (\n) in C# -

OK, this is driving me crazy .... I have a string that is made like this: var newContent = string.Format ("({0}) \ n {1}", tampered content, answer) New content will be displayed: (old text) New text I need a regular expression which removes the text between brackets with brackets and the text with new letters. The best I can come up with is: const string regex = @ "^ (\ (. * \) \ S)? (? & Quot; Capture & Gt ;. *) "; Var Match = Reggae Match (original_content, regex); Var stripped_content = match Group ["capture"]. Values; This works, but I want to match the new line ( \ n ) specifically, any empty space ( \ s ) is not changing with \ s with \ n \\ n or \\\ n Does not work. Please help capture my discretion! Edit: An example: public string reply (string old, string new) {const string regex = @ "^ (\ (* \)) .)? (& Quot; capture & gt ;. *) "; Var Match = Reggae Match (old, reggae); Var stripped_...

How can I select and upload multiple files with HTML and PHP, using HTTP POST? -

Image
मुझे & lt; input type = "file" & gt; । हालांकि, मुझे एक समय में एक से अधिक अपलोड करने में परेशानी हो रही है। उदाहरण के लिए, मैं छवियों की एक श्रृंखला का चयन करने में सक्षम होना चाहता हूं, फिर उन्हें सर्वर पर अपलोड करना, सभी एक ही बार में। यदि संभव हो तो एकल फ़ाइल इनपुट नियंत्रण का उपयोग करना बहुत अच्छा होगा। क्या किसी को भी यह पूरा करने का तरीका पता है? धन्यवाद! यह संभव है उदाहरण (PHP 5.4): & lt;; doctype html & gt; & LT; html & gt; & Lt; शीर्ष & gt; & Lt; title & gt; टेस्ट & lt; / title & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; form method = "post" enctype = "multipart / form-data" & gt; & Lt; इनपुट प्रकार = "फ़ाइल" नाम = "my_file []" एकाधिक & gt; & Lt; इनपुट प्रकार = "सबमिट करें" मान = "अपलोड करें" & gt; & Lt; / प्रपत्र & gt; & Lt;? Php if (isset ($ _ फ़ाइलें ['my_file'])) {$ myFile =...

count the number of existing tabs in jquery? -

I'm using a dynamic jQuery tab widget that adds / removed the tabs created from the program. How do I check through jQuery and count how many existing tabs exist in the widget? I am using this code, but it does not work: $ ('# container-1'> 'ul'). Tab ('add', tab name, name); Var newTab; If ($ ('$ container-1 & gt; li'). Size () & lt; 0) {newTab = $ (tabName) .css ('display', 'block')} other {newTab = $ (tabName ) CSS ('display', 'none'); } NewTab.html ('& lt; iframe src = "ViewPatient.aspx? Pname =' + name + '" width = "100%" framebroom = "0" scrolling = "no" height = "300"> & Lt; / iframe & gt; '); var tabCount = $ (tabContainer). Tabs ("length");

intranet - How do you handle internal systems development? -

We regularly consider the values ​​of a good quality intranet and systems to our customers, but such a thing within my organization We do not think we are "eating their dogfood" We actually have fewer intranet systems - a faster SharePoint has been installed together that does not really handle any. An extra leftover-legacy intranet system with which it was loaded into the frame and pulled "in" the sharepad. The general view is that senior developers are "very valuable" to ruin internal development, so its responsibilities come to the people at least qualified, work experience people, etc. At least as long as they do not get much more attractive and are sent to a customer, the fly-cohesive nature of our systems is therefore dispatched. The mechanic is a matter of running a poor car. How do you handle it? How can I accept management to spend the effort on my internal system? Is it really within a tech company that it is not worth it? Do non-te...

clone - In Java, what is a shallow copy? -

java.util.Calendar.clone () returns "a new calendar with the same properties" and returns "returns" This shallow copy of this calendar ". This is not a shallow copy as the answer has been tagged to the question language-agnostic, Java language does not follow the agnostic definition As I stepped through the code, I see that the structure and the elements are copied to this new object, the cave What is a shallow copy in Java? Is it different from a Java deep copy (if it exists)? A shallow copy just copies the values ​​of references given in the class, copies a deep copy values ​​given: class Foo {private bar myBar; ... public foo shallow (copyright) (Foo newFoo = new Foo ()); NewFoo.myBar = myBar; New Return;} Public Foo deepCopy () {Foo newFoo = new Foo (); NewFoo.myBar = myBar.clone (); // or newer bar (mayabara) or merchandise dip copy or ... take new afoo; }} Foo Miefu = New Foo (); Foo SFu = MaiFhu.Salopi (); Foo dfu = myFoo.deepCopy ();...

VIM: Zero-Indexed Line Numbers in :set number -

Using VIM, it is easy to display line numbers for any file: : Set number However, line numbering is 1-indexed, this means that the number starts with 1. Generally this is what I want, but my code reports zero-indexed line numbers - that is, a special tool I am using to compile - that line line starts with zero. How can I change the line numbering of Vim so that the numbers in the buffer can be matched by the errors given by viewing the device, and in addition to a particular number jump matches the device. That is, if the tool tells me that there is an error on line 98, then I want to jump from that line by typing "98G", not "97G", and this line Really have 97) want to display "98" in the line number list. Edit: While I can filter the output of tools, while quite easy it is not a trivial tas because the tool also outputs the hex values ​​corresponding to each line It has the same zero-indexed form, and it is output in informative messages...

javascript - Changing HTML content dynamically with JS before ActiveX component has finished loading -

मेरे पास एक HTML पृष्ठ है, जो निम्नलिखित क्रिया करता है (क्रम में): स्थिर HTML सामग्री दिखाता है JavaScript का उपयोग करके कुछ स्थिर सामग्री को बदलता है जावास्क्रिप्ट का उपयोग कर एक ActiveX घटक को लोड करता है समस्या यह है कि चरण 2 चरण 3 के बाद हमेशा निष्पादित किया जाता है, भले ही ActiveX घटक को प्रदर्शित करने के लिए कोड चरण 2 के बाद है (और ActiveX घटक को लोड करने में कई सेकंड लगते हैं)। मूल रूप से, ActiveX घटक पारंपरिक रूप से ऑब्जेक्ट टैग का उपयोग कर लोड किया गया था, लेकिन समस्या को हल करने के लिए, मैं लोडिंग को निम्नलिखित फ़ंक्शन (चरण 3 में निष्पादित) में ले जाया गया था: फंक्शन afterloadActiveX () {var मुख्यफ़ॉर्म = दस्तावेज़.फोर्स ['getupdates']; Var activeXObject = document.createElement ('ऑब्जेक्ट'); activeXObject.setAttribute ( 'आईडी', 'webagent'); activeXObject.setAttribute ( 'ClassID', 'CLSID: 53N50R3D-4246-65Z6-1234-44B989ECA335'); activeXObject.setAttribute ( 'ऊंचाई', '1'); activeXObject.setAttribu...

c# - Subsonic 3 - SimpleRepository -

I'm playing with the simple store of subsonic 3 and killing the walls to understand how to deal with foreign keys ... If I have a product object in which int id; String name; String description; Category category; Int Categarii Id (this is just to continue the category ID of the product in DB) and the class object with an id object; String name; How can I use the repository to return the list of all the products with the object of my class? At the moment I have written a Linux query which is Product.categoryID = category.ID which is all well and good, but when I do. If this list lists the results (), then the product category does not start. Is there a way to do this, or do I need to manually mentor the range for each product? Thank you, Paul Need to get linq, use something like # var query = from product in repo.All (product) category - include in category (category) product in repo.All Select CategoryItem.Id New Name = Product.name, Descr...

asp.net mvc - How can I use nHibernate to get a small subset of object properties for list view -

I am using ASP.NET MVC and nHibernate for the first time. Great tool, but the big learning curve! I have a list view of such items which are large (each has about 60 properties). In the list view, I'm only using these 10 properties. Performance is not very bad, but it seems wasted to completely hydrate these objects. What is the recommended exercise? I tried to use HQL to select fewer properties, but it seems that it will not partially hydrate an object. I also tried to create an asset on the main object, which was a header class with list view properties, but I think it can not be mapped properly. I think it should be easy, but I'm really struggling with it. Edit: I was coming back to this because I knew that Anton had given me a reply and I just could not see it. Make an object with the property you want. Import this object to create a mapping file. & lt; Hibernate-mapping xmlns = "vase: nibinet-mapping -2.2" namespace = "core.nittie...

c# - continue FTP download afther reconnect -

Is it possible to issue a FTP download after joining a FTP server? Yes At the protocol level, the server "REST"; Search & gt; Before looking for a post in the send file, before the RETR (so if you already have 1500 bytes of the file, execute "1500 hrs" and it will start sending by 1501 bytes). Here's an example: Switching to type I 200 binary mode. PASV 227 Passive Mode (140,186,70,20,223,87) Enter REST 800 350 Restart Status Accepted (800). Opening binary mode data connection for RETR welcome.msg 150 welcome.msg (9 54 bytes). 226 File OK

c# - Why is capitalising class names in Java (and others) only a suggestion and not a rule? -

I'm thinking that Java, due to its many security features and constraints, developers have a class with a lowercase letter Even though the name allows to start, it would be a very stupid idea to do so. Am I ignored a case where this can be useful? Or is it just a matter of not bossing a programmer? This is because it was thought that programming languages ​​should not be emphasized in conferences in the past years . But now the scene is changing slightly and there is a favorable environment for the "conference overconfiguration" approach like Rail on Ruby. In the future, we can see more conference-based programming languages ​​/ frameworks that will arise from time to time with programming patterns and best practices.

XML validation with an external DTD in Java -

How can I test an XML string to see if it is valid against the file and what is it? I have read, but they only talk about changing the dtd declaration on an XML file. Person.DTD & lt ;? Xml version = "1.0" encoding = "UTF-8" & gt; & Lt ;! ELEMENT person (id) & gt; & Lt ;! ELEMENT ID (#PCDATA) & gt; Test @Test Public Zero should_serialize_a_shootout_to_xml_and_validate_against_a_dtd () {string xml = "& lt; person & gt; & lt; id & gt; 12 & Lt; / id & gt; & lt; / person & gt; "; Assert.assertTrue (validate_xml ("person.dtd", XML)); } Boolean validator _xml (string dtd_filename, string xml) {// check xml and throw validation errors new NotImplementedException (); } Thanks! I can come back sometime later, but here is the process that my mind has springs : Wrap the string with StringReader SAX Parser Make valid, track the number of SAX handler error examples that ar...

configuration - How to change the set of characters that are considered word characters in Mysql (Without recompiling)? -

I run a MySQL 5.0.26 (Myisam tables). To improve search results, I'm doing some fine tuning. I have seen that the characters are considered as word characters (Swiss-) French ... and do not match English barriers. I would like to: ( I would like to: Add character to the list of "word characters" Remove the character "'' from the same list (it 5.0 is a bug in the branch which has been fixed in 5.1 ...) I have seen in the documentation that the macro can use true_word_char () but the document is a little for me How can I do this? Do I have to edit it as well? & Lt; charset name = "latin1" gt; Is a known bug / risk doing this? I can not recombile. Thank you for your help. Ture_word_char () will need to recomputate part about the editing of the macro. So leave the editing of the XML file for that character set. See the table of values ​​for each character. Find out - and 'And' em them To set the appropr...

jQuery Text Crossfade -

I know about various images crossfade plugins, but I have to crawl the text as , I have the text of one element or an element A and I want it to end, whereas, B takes its place. Any help really appreciated. Quick Demo & lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ('# test') .Fedaut (2000); $ ('# test1'). Feedin (2000);}); & Lt; / Script & gt; & Lt; Style & gt; H1 {font-size: 12em; Status: Absolute; Left: 0; Up: 0} # test1 {display: none} & lt; / Style & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 id = "test" & gt; A & lt; / H1> & Lt; H1 id = "test1" & gt; B & lt; / H1> & Lt; / Body & gt; & Lt; / Html & gt;

regex - Can a URL contain a semi-colon? -

I am using a regular expression to convert plain text URLs to a clickable link. @ (https: // ([- \ w \. +) + (????? \ d +) (/ ([\ w /_\.-] * (\ \ S +)))) @ However, sometimes in the body of the text, the URL finally calculates a per line with the semi-colon in the actual URL There is no. http://www.aaa.org/pressdetail.asp?PRESS_REL_ID=275; Http://www.aaa.org/pressdetail.asp?PRESS_REL_ID=123; Http://www.aaa.org/pressdetail.asp?PRESS_REL_ID=124 Is it a semicolon (;) in the URL or semicolon can be considered a marker at the end of a URL ? Unencoded can not be used except for its special purpose and how it will fit in my regular expression. (Which depends on this plan). Section 2.2: Many URL schemes reserve some letters for a particular meaning: their presence in the planning-specific part of the URL is a specified word. If the character corresponding to an octet is reserved in a scheme, the octet should be encoded. Characters ";", "/", "?...

c# - Change size of image control in javascript -

I want to change the size of images in javascript onmouseover. String () = Directory.GetFiles (Server.MapPath ("~ / Folder1 / Folder2 /"), "* .jpg") as the dim files File = file in the file as string for each file. Last index ("/") + 1, file. Lang) 'Response Write (file & amp; & lt; br & gt; ") file = file & dim image = new image (as image) & image.ImageUrl = file image.ight = 50 Image.Width = 50 Me.Controls.Add (image) image.Attributes.add ("onmouseover", Here is some HTML strong> & lt; ASP: button id = "button1" runat = "server" text = "button" validation group = "none" /> ; & Lt; ASP: panel id = "panel1" runat = "server" style = "display: none; background color: transparent; padding: 1am6px;" backcolor = "white" & gt; ; & Lt; ASP: panel id = "panel2" run = "server" style = ...

design patterns - How do I create a Null Object in C# -

In refactoring of Martin Fowler, there is talk of creating a null object to avoid a lot of If (myObject == empty) What is the correct way to do this test? My attempt is to violate the "Virtual Member Calls in the Constructor" rule. Here's my attempt: Public category animal {public virtual string name {get; Set; } Receive the public virtual string species {}; Set; } Public Virtual Bool Isolol {get {return false; }}} Public Sealed Class NullAnimal: Animals {Public Override String Name {get {return "NULL"; } Set {}} public override string species {return "tap"); } Set {}} Public Virtual Bool Isol {Get {Back Truth; } I agree that you should show patience in these "empty" He said the type of objects, there are some good reasons to do this. On occasion. I also believe that the whole point of an empty object does not need to check whether it is zero or not, so you should lose the IsNull property. If you really feel that you need the I...

vba - Load image file to clipboard -

I'm looking to get an image of Visio page in the clipboard using VBA. I can export an image of the page using the Page object's export method in question. But is there any way to load an image file on the clipboard within VBA? Should I use anything like VB6 and make a small command line tool which loads a JPG or BMP file path just in the clipboard using the clipboard. Setdown load image (" Pypath ")? If you copy page using VBA, Visio has given it several Not placed on the clipboard in formats, which includes CFBITMAP? If you paste it in an application that Visio does not understand, then I expect to use bitmap instead. If you have tried it and it does not work - or if I misunderstood the question.

c# - How can I pass a property of a class as a parameter of a method? -

I have a class in which there are dozens or more properties that represent different financial areas. I have another class which needs to be calculated separately on each of those areas. The code inside those calculation methods is the same, which calculates except the field. Is there any way that I can pass a property name as a parameter and there is a method that works for all the properties instead of 12 methods for each property? Besides, I'm sure it can be done through reflection, but I have seen in the second code where Lambda is used in this kind of fashion and wondering if This is a candidate where it can be used. According to the request, here is an example: public class financial information {public virtual date time audit date {get; Set; } Public Virtual Decimal ReleasedFederalAmount {get; Set; } Public Virtual Decimal ReleasedNonFederalAmount {get; Set; } Releasing public virtual decimalsStateMount {Received; Set; } Public Virtual Decimal ReleasedLocalAmoun...

python - Whats the best way to duplicate data in a django template? -

इस सवाल का पहले से ही एक उत्तर है: 13 उत्तर & lt; html & gt ; & Lt; शीर्ष & gt; & Lt; शीर्षक & gt; {% block title%} {% endblock%} & lt; / title & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; h1 & gt; {% ब्लॉक शीर्षक%} {% endblock%} & lt; / h1 & gt; & Lt; / body & gt; & Lt; / html & gt; यह मेरा टेम्पलेट है, अधिक या कम एच 1 हेडिंग हमेशा शीर्षक टैग के समान है। कोड का उपरोक्त स्निपेट मान्य नहीं है क्योंकि समान नाम के साथ दो ब्लॉक नहीं हो सकते। मैं खुद को दोहराए बिना इसे कैसे प्रबंधित कर सकता हूं? स्पष्ट करने के लिए संपादित करें: मेरे पास एक टन बच्चे टेम्पलेट हैं जो इस टेम्पलेट से विरासत में मिलते हैं, और इस प्रकार एक नया {{title}} चर बनाने के लिए प्रत्येक टेम्पलेट एक बहुत अच्छा समाधान नहीं है पहले मैंने इसे इस तरह सेट किया था: base.html: & lt; शीर्षक & gt; {% block title%} {% endblock%} & lt; / title & gt; फिर base_view.html (base.html) को विस्तारित करें: & l...

iphone - Can custom transforms be used (in theory) to create a water ripple effect on a CALayer? -

It is possible to create custom conversion metrics, but I wonder if they are suitable for making liquid effects of water on a calorie. Can anyone tell about 20 of them in the animation? A Callier is a rectangular text, given that core image filters are not available for iPhones (which You put liquid effects of water on the mac), you will not be able to produce the effect that you are looking for with a single calor. However, you may be able to tile a set of colliers and apply 3-D conversions for each so that they can translate into shapes that mimic the water waves. .

Numerical Conversion in C/C++ -

I need to convert from C / C + + duplex to a 64 bit two, where the Radix dot bit number 1 9 is included). This means that I want to convert the format to 0x0000 0000 0010 0000 number1 0xFFFF is FFFF FFF00000 - 1 0x0000 0000 0000 0001 0.95 x 10 ^ -6 0xFFFFFFFFFFFFFFF -0.95x10 ^ -6 So far I Although using the modf function from the C standard library, but it does not really cover my needs, I have also seen some types of conversion classes in Boost, but I Not found the right solution. Does anybody know the library or the easy way to do this conversion? Perhaps someone else familiar with Boost can point me in the right direction. If everyone gets help, here are some documents about how the doubles are deposited. Edit: I have a follow-up question, it really is for my own interest, what is 'Redx'? Here it's like a decimal point but, for the second time I've only heard the word radix when I was learning about the discrete fast for fourier conversion. If...

emacs style keyboard macros in visual studio -

I would like to use the emacs style keyboard macros in Visual Studio, which I can do most for it. But I can not understand a keyboard shortcut to repeat the next command X times. In Emacs, I can record my macro, then type esc, #, ctrl + x, e where # is the number I want to repeat my macro. In my opinion, it was almost as important as the macro. How can this get into Visual Studio? You probably want to try xkmax: I have tried your sequence and it has worked on a simple macro. However, it was quite slow ... Still, give it a shot.

blackberry - Preprocessor directives supported by the RIM compiler -

This is not really documented clearly, but a shallow search reveals that the RAPC compiler supports We are using simple #ifdef , #else , and #endif Instructions for some time now, a code base with a platform 4.1 to 4.7 is almost impossible without them, but recently I wonder if there are other supported instructions which are quite well Rlekit are not; For example, there are something similar to the C #alif , or even original assignment instructions? There is a complete list of commands for RAPC preprocessor here. Preprocessor is not very strong, but on purpose is. // # preprocess - To specify that the file should be pre-processed. This should be the first row of the file. // # Underlying tags - this file should be on the second line. If the tag is part of the command line, then the whole file must be compiled. If not, then it should be excluded. Then // # ifdef tag ... #sese ... #endif and // # ifndef tags ... #Ilss ... #Dendiff You have mentioned the in...

zend framework - Grouping WHERE clauses with Zend_Db_Table_Abstract -

Does anyone know the way to the group, where segment with Zend_Db? Basically I have this question $ sql = $ table- & gt; Select () - & gt; Where ('company_id =?', $ Company_id) - & gt; Where ('client_email =?', $ Client_email) - & gt; Or where ('client_email_alt =?', $ Client_email); This is giving me: SELECT `clients'. * From 'Clients' WHERE (company_id = '1') and (client_email = 'Email@address.com') or (client_email_alt = 'email@address.com') But me This is required, where or the statement is grouped: SELECT 'clients'. * From customers WHERE (company_id = '1') AND ((client_email = 'email@address.com') or (client_email_alt = 'email@address.com')) To achieve this, you will need to create a grouped section within a call where method. If both values ​​of the circumstances are the same, then you can: $ select-> where ('client_email =? Or client...

C# How to programmatically tab between controls -

I would like to be able to programmatically emulate keyboard navigation for dialog boxes. I have custom hardware devices which I would like to use for a dialog box with a keypad for navigation. I know about focus (), but I want to do something that is automatically respected by tab order. By emulating the keyboard navigation, I am not worried about rediscovering complex behavior for each type of control. Does anyone know how to do this? Thank you! Use P / AW to call the Windows API function to simulate you by pressing the tab key can do. Bonus: You can also use your device to enter tabs in the text editor! ;)

Disable Grails plugin -

In my Grails app, I want to stop detection of plug-ins by loading while running my unit tests. I tried to do this by using the following code in the bootstrap class def grailsApplication def init = {servletContext -> Def currentEnv = grails.util.Environment.current.name if (currentEnv == 'test') {def doNothing = {println "Searchable is disabled"} // This return is empty! DEF Searchable plugin class = grailsApplication.getClassForName ("Searchable Grilles Plugin") Searchable plugin class. MetaCalash.Davath DynamicMutts = No SearchPlugin Class. Metagascar.DavithSpring = There is no search plugin plugins. Metaclass.DudeApplicationContax = Doing No}} Although this is not work because grailsApplication.getClassForName ("SearchableGrailsPlugin") return zero, possibly because this class is not on classpath This code is when it runs. Is there any other way that I can disable this plug-in? I found a solution Add the following to Config.g...

sprite - XNA SpriteBatch and BasicEffect not compatible? -

I want to control ambient light for the 2D SpriteBatch rendered graphics set at a global level. I realized that I could do it by inserting the color passed in SpriteBatch. Draws, but I want to do it globally. The Basic Effect Shader Console for simple views sets the function pipeline style lights in XNA. Is Basic Effect Shader And SpriteBatch Incompatible? Does anyone have to work together? Yes, they are incompatible. This is because Spreadbatch CAS uses its custom vertex shader to do the rendering of the tray. You can use your own custom pixel shader, and there is a sample on the XAna Creator's Club Education site that shows you how to use custom pixel shader effects with the spreadbatch.

php - Get Twitter User Details without Authentication -

I have noticed that some Twitter applications use a specific user location, name, profile image etc. to use only Twitter usernames Manage? How is this possible? I ask because I have not come to Twitter in any way how you can do this. When the user permits my app, but I find that users use YouTube, I can use myself. If it can be clear, then be grateful. I hope that this is not a curl use because it is not a good idea in my eyes, if there is any other way, then there is a PHP implementation that I can use. Thanks for any help. Update I did not know that existed! Is any PHP wrapper or class written for someone to use that? Sorry, I'm totally noob and I relay on the wrapper and simple function call! This is returned by the API from the call. For example: A PHP library in the list FWIW.

Determine if a date is a Saturday or a Sunday using JavaScript -

Is it possible to determine whether a date is using javascript Saturday or Sunday? Do you have code for this? Sure it is! There is a function in the class which gives an integer between 0 and 6 (Sunday, 6 Saturdays). So, to see what is today during the weekend: var today = new date (); If (today.getDay () == 6 || Today .getDay () == 0) Alert ('Weekend!'); To see if there is an arbitrary date weekend, you can use the following: var myDate = new date (); MyDate.setFullYear (2009); MyDate.setMonth (7); MyDate.setDate (25); If (myDate.getDay () == 6 || myDate.getDay () == 0) Alert ('weekend!');

php in array error -

& lt; PHP $ bannedIPs = array ('127.0.0.1', '72.189.218.85'); फ़ंक्शन ipban () {यदि (in_array ($ _ SERVER ['REMOTE_ADDR'], $ प्रतिबंधित आईपी)) {गूंज 'परीक्षा'; }} Ipban (); ? & Gt; इस स्क्रिप्ट का उत्पादन है: चेतावनी: in_array () [function.in-array]: दूसरे तर्क के लिए गलत डेटाटाइप सी: \ webserver \ htdocs \ 93 \ test \ array.php पंक्ति 93 पर क्या कोई मुझे बता सकता है क्यों? मुझे यह नहीं मिलता और हाँ $ _SERVER ['REMOTE_ADDR'] 127.0.0.1 प्रदर्शित कर रहा है UPDATE के रूप में सुझाव दिया है कि अब मैं इसे करने की कोशिश की लेकिन फिर भी एक ही त्रुटि मिलती है फ़ंक्शन ipban () {$ bannedIPs = array ('127.0.0.1', '72.189.218.85'); अगर (in_array ($ _ सर्वर ['REMOTE_ADDR'], $ प्रतिबंधित आईपी)) {गूंज 'परीक्षा'; }} Ipban (); आप अपनी चर scoping के साथ एक छोटी सी समस्या में चला गया है। PHP में किसी फ़ंक्शन के बाहर कोई भी चर अंदर पहुंच योग्य नहीं है। फ़ंक्शन ipban () {$} BannedIPs = सरण...

Using JQuery with .NET 1.1 web app -

I added the jquery js file to a web page in the .NET 1.1 web app. Added this script & lt; Script type = "text / javascript" & gt; $ (Function () {$ ("Input"). Blur (function () {$ (this) .attr ("background-color", "# 000000");});}); & Lt; / Script & gt; But when I close a text box, then nothing happens. Should it work properly in 1.1 ?? Malcolm You do not have to use attr: $ (this) .css ("color", "# 000000");

postgresql - JDBC postgres statement_timeout -

मान लें कि मेरे पास है: untimedStatement = connection.createStatement (); समयबद्ध स्थान = connection.createStatement (); और फिर चलाएं समयबद्ध स्थान। Execute ("SET statement_timeout to" + टाइमआउट); क्या SET statement_timeout कमांड अप्रभावी स्थिति को भी प्रभावित करेगा? मैं उम्मीद कर रहा था कि यह नहीं होगा लेकिन कुछ व्यवहार जो मैं देख रहा हूँ सुझाव देता है कि SET statement_timeout का "सार्वभौमिक" प्रभाव होता है (कम से कम प्रोग्राम के जीवन के लिए) जी हाँ, जब तक वे एक ही कनेक्शन पर निष्पादित होते हैं। आप केवल मौजूदा लेन-देन को प्रभावित करने के लिए एसईटी लोकल वक्तव्य- टाइमआउट का उपयोग कर सकते हैं। ।