Posts

Showing posts from April, 2012

Designing Web services for AJAX Consumption -

We're in the process of designing / creating web services that are comfortable using XHR calls from different web pages. Customer side will be consumed. These web pages will include those components that will come from data collected from web services. My question is, why would specifically customer-side components be needed for each page? Therefore, only one XHR call will be required to populate a specific AJAX component or to retrieve all the data needed to update a specific page. Or more advice is given to develop generic web services, for example, match a database schema, and many XHR call clients are needed so that all data can be retrieved to populate the AJAX component Could it? There is some messy coding to call the series from the second point of view, so that all the data needed before updating an AJAX component can be obtained. Hope this makes sense You always depend on those services Should design on what they have to provide. Unless you need any service ...

asp.net - How to programmatically clear outputcache for controller action method -

If there is a specified output cache attribute on an action in the controller action, then there is a way to clear the output cache without restarting IIS [OutputCache (duration = 3600, VaryByParam = "param1; param2")]? Public string AjaxHtmlOutputMethod (string param1, string param2) {var someModel = SomeModel.Find (param1, param2); // Set up ViewData ... Return RenderToString ("ViewName", some models); } I'm looking into using the HttpResponse.RemoveOutputCacheItem (string path) to make it clear, but I have trouble finding out for what path Getting it done in the action method map it I'm going to try again with the aspx page that is provided by ViewName. Maybe I'm just manually entering RenderToString in the output HttpContext.Cache instead if I can not understand this one Update Please note that the output cache is VaryByParam, and the test of a hardcoded path "/ controller / action" does not actually clear the output...

api - How to Communicate DLLs in C# -

That's what I want to achieve: There will be DLL which only includes methods that The actual methods are called by my application and I can share that DLL with the outside world, even though joining that method, the actual methods are in DLL in my application, but if someone uses it Work for something in my application May I wish limitations. I hope I can tell what I want. I do not know if you've ever used Skype4COM.dll. It actually works like this, it somehow connects to the Skype client and lets me call some people I want. For example: Skype s = new Skype (); S.PlaceCall ("PhoneNumber"); I import Skype 4 com DL in my project and when I write the code above in C #, it connects and calls to Skype. I think there is no real way to call Skype4Com.dll. I think that some types of methods that reach the real methods in the Skype API are used and what developers do in Skype Change, call, this is Skype 4 com DL. The cover does not affect, as long as the signat...

typesetting - Printing out LaTeX Variables -

I am using a latex class file that sets different parameters like margin, line spacing ... parameters According to it for any reason, the final result does not seem right. Some margins are not set properly. I want to print the values ​​of different variables which latex has to see where the problem is, along with the calculation. For example, I want to know that the value of \ oddsidemargin is in a certain line of code. Is there any way to ask latex to print any such information? For debugging page layouts, Peter Wilson's package is a way to see and use the page design Here's an example to see the dimensions made: \ documentclass {article} \ usepackage {layout} \ start {document} \ drawmarginparstrue \ currentpage \ pagedesign \ end {document} There are many features to properly correct the information given by the package. It also provides the \ prntlen command to print the size of a length, if you do not need more information.

iphone - Is there a way to figure out what's the current affecting speed in a timespace? -

Times Space problem: You create a large hierarchy of ideas, and give each layer a different speed value. Now all the Timespace are messing up in the lower part of the hierarchy, you do not know what time is your distortion. -10%? -90%? + 50%? UIKit has to calculate the speed in the hierarchy while animating somehow. So I wonder if there is any way to capture this calculated speed value? Of course, I can try to walk through the hierarchy and around all the motions. But maybe there is a simple way. This can be useful for you.

security - Shared SSL - Better or worse than resorting to OpenID? -

I am working on a project that requires user login / registration, I am using a private hosting provider I want to host more than one domain of the same plan, so I would like to avoid personal SSL set up (but when a dedicated IP for a personal SSL certificate is required, then I only plan ... but still All my sites Micro safe to do). I am debating between using OpenID (though all complaints for non-technical audiences I found that will be multiplied on the SO) Using the shared SSL of my host (which will pop up annoying certificate warnings in the browser, sites which do not match). What looks like a better option? Or would you suggest that they run away from both and only suggest to buy it and buy additional / better hosting plans? itemprop = "text"> With the experience of dealing with SO and Google App Engine (and their authentication system) Using a fairly simple site, I recommend the following: Do not use OpenID for identification, it can work for...

objective c - How can I retrieve the HTML to be loaded into a WebView (or WebFrame) from a local persistent store? -

Then, I have a group of SQL files being stored in the SQLite database, and they will be forward and forward Intermediate links when the user clicks to follow a link, then that request should be serviced by dragging the appropriate HTML of the database. This may require images to be loaded, which are also being stored in the database (this is a future thing; there is no image yet, but I want to be able to use them). I have seen through webkit documentation, but this can not be understood at all. I have mostly seen on webformloads delaygate and WebResourceloadsDeligate, but I have not seen what I have to capture the request, catch the appropriate content, and then send it in a response. Thoughts? I am very new to objective-c and cocoa, but I think that most of the things hangs me. How are each other pages stored in a database link? This is probably the easiest if they start using any type of customer URL scheme. The approach I use is to implement -webView: resource: willS...

comparison - Is there a good library for sorting a large array of numbers in C? -

If I have a large array of integers or floats, what is a good algorithm / implementation for the syringe? / P> It is a bit late in the game to edit ... but I'm looking for right and speed . Comparative cases will be trivial for these cases: Pre> int cmp_int (CONST WASTE * A, CONST blank * B) {const int * Ia = a; Const int * ib = b; If (* IA & lt; * ib) Return -1; If (* IIA = * IB) returns 1; Return 0; } Int cmp_float (constant empty zeros * a, const zero * b) {const float * fa = a; Const float * FB = B; If (* FA and LT; * FB) Return -1; If (* FA & gt; * FB) returns 1; Return 0; } (Edit: Depending on the signature overflow behavior, based on the deduction of B, this is not a good idea.)

How do I identify a user when working with iPhone StoreKit -

How do I identify a user who is shopping with storekit on the iPhone? I am planning to create a suite of iPhone apps that will be made available from an external server will sell the content. Storekit documentation describes that any external server has the transaction information How to send and how to verify the transaction from that store in the app store. But I can not find any details about the information that can be used to connect that transaction to the transaction that the user purchases. Is ideally located here with the user's AppleId iTunes? I would also be interested in the hands of the device ID, but there should not be any problem with what I have read in the iPhone Dev document. I know that this is not your answer, but the simple fact about this matter is: / P> You will not receive any personal information about any of your buyers,

c# - ASP.net Listview EditTemplate Hide/Show Options by Checkbox -

I have a list view that has a item template and an edit template. When I switch an item to editing mode, I have a bunch of checkboxes as an option. I now have problems. In the editmode, I want to make some options disappear (or replaced by "-") when some checkboxes are unchecked and are definitely re-checked when it checks again. I have tried to use an on-the-spot incident in an endemplate but it is not a fire as I will not see any other useful incidents that can do this for me to react. Have you set up autopost = "true" on your checkbox? The on-screen event will not do anything until it is set.

java - I need a uDIG tutorials -

Do you know any good tutorials - How to create a plug-in for the UIDG application? (Recovered from a tutorial page which is at the time of writing.) The above tutorial was referred to Google cache)

asp.net - XSLT. load xml document that contains escape characters -

I use XSLT to replace an XML document that I then load on the ASP.NET website. However, if the ' & lt; ', the XML goes wrong. & lt; Title & gt; & Lt; B & gt; & Lt; Left arrow & lt; B & gt; & Lt; / Title & gt; If I use disable-output-escaping = "yes" , then the XML can not be loaded and error is not with "name" "Characters". If I do not disable the escape to escape characters, then it is disregarded and this text appears as: & lt; title & gt; & lt; b & gt; & lt; left arrow & lt; b & gt; & lt; / title & gt; Need to have bold tags to work, but I do not want to use '& lt;' I want to avoid the character. & lt; b & gt; & lt; left arrow & lt; / b & gt; What do I want to achieve? What is the solution for this? Sign in to XML ( & Amp;; LT;), not literal & lt; character. XML is bad and any XML parser should reject...

php - Advantages Of MySQLi over MySQL -

पोस्ट-पाठ "आइटमप्रॉप =" टेक्स्ट "> देखें: PHP का मायस्कुलि एक्सटेंशन क्या है? mysqli एक्सटेंशन, या जैसा कि कभी-कभी ज्ञात होता है, MySQL के बेहतर विस्तार, MySQL सिस्टम संस्करण 4.1.3 और नए में पाया गया नई सुविधाओं का लाभ उठाने के लिए विकसित किया गया था। MySqli एक्सटेंशन को PHP संस्करण 5 और बाद में शामिल किया गया है। mysqli एक्सटेंशन में कई लाभ हैं, जो कि mysql एक्सटेंशन पर महत्वपूर्ण संवर्द्धन है: ऑब्जेक्ट-ओरिएंटेड तैयार किए गए वक्तव्य के लिए समर्थन एकाधिक वक्तव्यों के लिए समर्थन लेनदेन के लिए समर्थन बढ़ी हुई डीबगिंग क्षमताओं एंबेडेड सर्वर समर्थन

json - JQuery, XmlHttpRequest and Status Code 0 -

I am currently doing some cross-domain JavaScript using JSONP, and ASP.NET MVC. The special controller action answers only one post request, it is according to the design. In IE8, I can see (through Fiddler2) that the response is correct, and an HTTP 200 response is returning to JSONP JavaScript. In Firefox, Safari and Chrome, the response is still returning with the appropriate HTTP 200 code and JSONP content, the only difference is that the XmlHttpRequest object setting being used by JQuery is 0 Status code and response to blank. Basically, I thought this was due to the HTTP preflighting (HTTP access control), leaving an additional HTTP request (an option to send a content type other than custom headers or text / plain) With) cause of action. I can see in Fiddler2 that the option is responding to HTTP 404 with an HTTP request. The web server is IIS7 (but the production web server will be the IIS6 box). In IIS7, I can see that the standard options are listed in the VERbH...

delphi pointer address -

डेल्फी में: कैसे मैं एक संकेतक अंक को पता (0x2384293) प्राप्त करूं ? var iValue: = पूर्णांक; IptrValue: = PInteger; कार्यान्वयन प्रक्रिया TForm1.Button1Click (प्रेषक: TObject); शुरू iptrValue: = @ iValue; IValue: = 32342; // वही मूल्य वापस करना चाहिए: संपादन 1। पाठ: = GetAddressOf (iptrValue); Edit2.Text: = GetAddressOf (iValue); तो वास्तव में GetAddress क्या है:) करने के लिए प्राप्त करें, @ ऑपरेटर या Addr फ़ंक्शन का उपयोग करें आपने पहले से ही इसका सही इस्तेमाल किया है आपको iValue का पता मिला और उसे iptrValue में संग्रहीत किया गया। एक पते प्रदर्शित करने के लिए, आप प्रारूप फंक्शन एक पॉइंटर वैल्यू को स्ट्रिंग में परिवर्तित करने के लिए। % p प्रारूप स्ट्रिंग का प्रयोग करें: Edit1.Text: = प्रारूप ('% p - & gt;% p - & gt;% d', [@iptrValue, IptrValue, iptrValue ^]); यह iptrValue वेरिएबल का पता प्रदर्शित करेगा, फिर उस पते को में संग्रहीत किया जाता है और फिर मान iptrValue चर घोषणापत्र स्मृति में कुछ बाइट आरक्षित रखता है और उन...

Prototype for function that allocates memory on the heap (C/C++) -

I am quite new to C ++, so this is probably of some initial question. It relates to "proper" style to do something which I suspect is common. I am writing a function that allocates memory of the pile for use by the collar in adhering to its duties. I am curious about this function should look like a good prototype. I've just found it: int f (char ** buffer); To use it, I will write: four * data; Int data_length = f (more data); // ... Delete [] data; However, the fact is that I give the indicator an indicator, let me tell that I am probably doing it wrong. me? In C, this is more or less legal. Functions in C ++ should not normally do this. You are guaranteed that memory should not be leaked. And now you can say "how it will leak, I destroy [/]> just there!", But what if an exception // ... Is Throwed On Lines? Based on what is done to actually work, you have several options to consider, to change the array with a clear vector...

C#/Winforms: sorting a datagridview by a column that is not part of the DataSource -

I have a datagrid witch in which datastro has been added to database from database. All column headers are sorted by double clicking. Now I had added an extra column with the hand which contained only numbers. Strange I can not sort the datagrid view by this column. I have set up sorting myself. What am I missing here? This link should be the answer you need: Actually what you do Trying it is not supported. Good luck, hope that helps.

string - How can I refactor this C# code using Split()? -

How can I refact this so that it does not declare number of items as a variable Will it? // Method: Text is found in a string in front of a marker, if the marker is not there, then return the empty string / example: GetTextAfterMarker ("documents / jan / letter043.doc" , "/") "Letter043.doc" / Example: GetTextAfterMarker ("letter043.doc", "/") / Example: GetTextAfterMarker ("letter043.doc", ".") "Doctor" public Fixed string GetTextAfterMarker (string line, string marker) {int numberoffiths = line. Split (new string [] {marker}, string split option .one) .count (); String result = line. Split (new string [] {marker}, string split option. A) [number 1-1]; Return line Excel (result)? String Empty: Results; } If you are using 3.5 then it is trivial with Linq: Public Static String GetTextAfterMarker2 (string line, string marker) {string result = line.Split (new string [] {marker}, StringSplitOption...

asp.net - setting content to be viewable by friends only -

Say I have a table that contains the content: Contents (Content ID, title, body, Privacy type) The type of privacy can be: public = 1 (anyone can see it) Private = 2 (only the author can see it) friend = 3 (only friends see it User (User ID, Username) I have a Mapping Table for User Management: I have a User T Friends (User ID, Mediade) Now when I list all the content, should list the content that is either public or I'm the friend of that user (user for login) How do I do a query for this? Provide a field where the content author is stored, so I think that it is Content.author : Select WHERE public from public = 1 or (public = 3 and current (SELECT NULL FRO M friends WHERE userId = @ me AND friendID = content.author) ) , or better than: Select from content WHERE public = 1 union Select all * Content from where public = 3 and current ( SELECT NULL with friends where users If your author field is selective and is cheaper than sorting filtering....

How to enumerate bound UDP / TCP sockets on Windows in C -

Assume that you do not have access to socket managers. // requirement = Iphlpapi.lib and Ws2_32.lib to link with #include & lt; Winsock2.h & gt; # Include & lt; Ws2tcpip.h & gt; # Include & lt; Iphlpapi.h & gt; # Include & lt; Stdio.h & gt; Define #pragma comment (lib, "iphlpapi.lib") #pragma comment (lib, "ws2_32.lib") # MALLOC (x) Heepolok (GetProcessHeap), 0, (x)) #define FREE (x) Heepfri ( GetProcessHeap (), 0, (x)) / * Note: can also use malloc () and free () * / int main () {// declaration and variable start PMIB_TCPTABLE pTcpTable; DWORD dwSize = 0; DWORD dwRetVal = 0; Four szLocalAddr [128]; Four szRemoteAddr [128]; Struct in_addr IpAddr; Int i; PTcpTable = (MIB_TCPTABLE *) MALLOC (SizeOf (MIB_TCPTABLE)); If (pTcpTable == NULL) {printf ("Error in allocating memory \ n"); Return 1; } DwSize = sizeof (MIB_TCPTABLE); // GetTcpTable achieve the required size dwSize variables // initial call if ((dwRetVal = ...

asp.net mvc - How do I expose built-in security and user management to a MVC application? -

I have created an MVC website on IIS 6. I used the built-in ASP.NET security without membership, the way it was implemented in the template solution. It is easy to protect a contoller or action, but now I need to administer the user management to log on to the site. I understand that the builtin ASP controls are not "best practice" to do this and if there is a dog to work, what is the best practice to offer user management through an ASP.NET MVC application? I considered using the unit framework and enclosed it till myriad of stored procs. But it seems weird to get an option for the Account Membership Service and Forms Authentication Service. This is what the current project uses the account controller. But, I'm not either with either. I can not help, but it seems that this project should have already been from the template. This is the fundamental part of any website and you have been given 15%, why not balance? As far as I can tell you, as your membership provid...

java - Is it possible to have architecture guidelines? If so what should be in them? -

Similarly we have coding standards, what are the structures like architecture standards? These will be high level principals, which we can pass to our less experienced programmers so that when they start designing changes or small applications, they know that the more experienced programmers are able to fix them. What we expect to see without doing (Note that this is not a review, rather than just preventing possible mistakes as soon as possible) I think that potentially some things may be included in it such as "Always assume that your database is normal, unless a specific and clearly understood reason for not doing this", "always Separate out-of-presentation, logic and perseverance ". Do people think that this would be very high level for any practical use? Or is it almost impossible to diversify the functionality of such generalization, which can be called code? Or can this be useful? If you think that they are useful and realistic, what will you incl...

php - How to automatically route images, javascript, css to subdomain? -

So this is a deal, I am currently building a site and planning for it Regarding recent talks about keeping images, javascript, and CSS (all still) files on a separate subdomain, in terms of performance and in such a way, in the case of performance, and in such a display move Reading so that the client will get the experience of downloading fast, when they go to the site I understand why this works and is not looking for explanation about it, but when the site leaves my local god, then I will automatically refer to these subdomains for my How do I know about setting up a site? environment? Images can be found here in the local / dev site: http: //localhost/mysitename/assets/css/images/img1.gif Production site: http://www.mysitename.com/assets/css/images/img1.gif I would say the following points to my production (not just production, local / dev environment): http://images.mysitename.com/img1. GIF I wonder how this is some automated way to do it? All the sta...

vb.net - searching a list object -

I have a list: Dim list as new string Blockquote> What is an easy and fast way to find duplicates of "first block" plus "-" plus "second block" is already on the list. Example 290-7 items are displayed twice, 290-7-11 and 290-7-13. I am using .NET 2.0 If you only want to know Whether there are any duplicates but do not care what they are ... The easiest way (assuming two dashes). Boolean headplicet profiles = list .GroupBy (i => i.Substring (0, i.LastIndexOf ('-')) Anyone (g = & gt; g.Count ( ) & Gt; 1) Fastest method (for a large set of smallest strings). Hasheset & lt; string & gt; HashSet = New HashSet (); Boolean HeadplicetPfix = False; Forex (String Item in List) {String Prefix = Item. Tilting (0; Item. Last Index ('-')); HashSetConton (Prefix) {HeduplicatePf If there are more than two dashed cases, then use the following: it still with a single dash. Will be unsuccessful. stri...

android - Hacking RadioInfo.java to work -

I am looking at the Android source and developing some apps. However for my next app, I need information about cell phones when you go to "field test" mode what you see. Although I have not been successful in getting RadioInfo.java to work. Is RadioInfo. There is a way to hack Java, so that I can use it in my app or there is a way to get the data displayed in "field test" mode. I have seen the telephony API in telephony.Inline but yet they do not provide as much information as they want. I was asking around the net, but I have not got this information so far. You are not too far, I'm scared because the built-in file uses the baseband chip to interact through the internal API Is trying to get you to an app that you will not be able to use.

c - Laptop Battery Status? -

Is there a way to get battery status (charging / discharging / current charge / capacity / etc ...) + Programmable between Windows in a portable way; Linux I am doing a small program for my use and need some help with it. Please see the details of the program on your blog: In addition, there is actually a way to see if a computer is currently connected to the Internet or not. Currently looking at www.google.com and seeing if I get a "503 error" in return. Any better way to do this? I am using libCurl for the web interface portion of my program, but I would like to know what better options are ... There is no portable way to get battery status between windows and Linux. You have to ask a different API. You have to see if someone has a cover for this, but chances are you have to do it yourself (perhaps you were asking if there is a rapper or library?) There are so many ways to see that a computer is connected to the internet, but they basically all boil poss...

java - Widening equality check for Method type -

मान लीजिए मेरे पास एक इंटरफ़ेस है: सार्वजनिक इंटरफ़ेस FooInterface {सार्वजनिक शून्य कुछ विधि (); } और मैं एक वर्ग है कि इस इंटरफेस को लागू करता है: सार्वजनिक वर्ग FooClass लागू करता FooInterface {सार्वजनिक शून्य someMethod () {// शानदार चीज़ों} सार्वजनिक शून्य someOtherMethod () {// अन्य मज़ेदार चीज़ें}} वहाँ एक आसान तरीका खोजने के लिए है, संजीदगी से, FooClass पर विधि है कि FooInterface पर someMethod अप करने के लिए नक्शे? मुझे यह गणना करने के लिए निम्नलिखित के जैसा कुछ है, लेकिन मैं उत्सुक था अगर किसी को यह गणना करने के लिए जावा में सिस्टम में बनाया गया था? मैं यह करने के लिए निम्न कोड बाहर काम किया है (वहाँ कीड़े हो सकता है, इसलिए सावधान रहना): सार्वजनिक बूलियन isMethodEquality (विधि meth1, विधि meth2) {// समानता बूलियन isAssignable के लिए कक्षाओं की घोषणा की जाँच करें ; isAssignable = meth1.getDeclaringClass () isAssignableFrom (meth2.getDeclaringClass (); isAssignable | = meth2.getDeclaringClass () isAssignableFrom (meth1.getDeclaringClass ());। अगर (isAssignabl...

osx - OS X terminal command to resolve path of an alias -

I am writing a shell script that files files from a remote machine, some Linux, some Mac, a central backup server. There are folders at the root level of the macs in which all the files / folders have the nicknames that need to be backed up. What is a terminal command that I can use to solve the path of files / folders, which point to Elias? (I have to pass these paths to rsync) I had this problem and so I asked for a command line Applied Applied This is open source The important thing is that this nickname is also broken, even if I found that any AppleScript solution would work in contrast to. So you can use it to write slips so that aliases will be fine when many files change the volume, this is the reason I have written it. The source code is very small, but it is a summary of the key part, someone else needs to solve this problem in the code, or wants to see the relevant protocol. NSString * aliasPath = [NSString string withUTF8String: posixPathToAlias]; NSURL * ali...

sql server 2008 - Need help trying to RANK with a GROUP BY -

I am having difficulty in ranking each of my students in the house group, which they are inside. Example counterfeit data HomeGroup 1. Team Red 2. Team Blue 3. Team Skeet 4. Team Green Students 1. John, Score - 34, Team Red 2. Jill, Score - 87.3 Team Red 3. Fred , Score - 41, Team Green 4. Jane, Score 93, Team Blue ... etc. My Production Low Score student 1, score 34, rank - 5th student rectangle 2, score 87.3, rank - 1 student id 3, score 41, rank - 9th student 4, score 94, rank-1 I'm trying to use DENSE_RANK .. And if I run against a single homegroup (for example Homegroup = 1) then it works fine ... But I'm not sure how to do this on all HomeGroup. I'm guessing that I need an update query, which has a subquery ... and this subquery has its own subquery ... ?? I am very confused :( And I think of the evil cursor that I refuse to use until I get a gun on my head (because I believe this' set 'Notation can be handled correctly). Obtaining...

Google Calendar PHP Retrieve events by specified date range -

I know that you can retrieve events for a specified date range, but I have a specified date (a Single day)? I tried to set both the SetTestMin () and SetstartMax to the same date, but it is not working. It seems that there should be at least one day between Max and Max. I'm using code here: $ startDate = '2009-07- 23'; $ ENDDATE = '2009-07-23'; $ GdataCal = New Zend_Gdata_Calendar ($ customer); $ Query = $ gdataCal- & gt; New event (); $ Query-> SetUser ('default'); $ Query-> SetVisibility ('private'); $ Query-> SetProjection ('full'); $ Query-> SetOrderby ('StartTime'); $ Query-> SetStartMin ($ STARTDATE); $ Query-> SetStartMax ($ ENDDATE); $ EventFeed = $ gdataCal- & gt; GetCalendarEventFeed ($ query); Any ideas? Thank you ... EDIT: No problem, I just got it: "Note that while Startman is included, startMax is exclusive , So a startmax '2007-08-01' will include those events i...

iPhone app Preferences Reference -

Is there a better resource for the preference pane programming for the iPhone app than the following links? Side Question: What is the bundle version settings? Can be raised automatically from within the bundle?

How to use .pem file with Python M2Crypto -

I used openssl to generate an RSA key pair: openssl Genrsa -out my_key Private.pem 1024 openssl rsa-my_key.private.pem -pubout -out my_key.public.pem Now I use this my_key.public.pem file any other function I want to .pi file: Import MCCRCPO from RSA, SSL Def Encrypt (), imported: PK = Open ('my_key.public.pem', 'RB'). Read () RSA = MCCRPETo .RSA.load_pub_key (pk) file Brint RSA; Am I doing this right? Both files are in the same directory, but this function is not giving any output. code> load_pub_key is expected to have a file name in the form of a M2Crypto.RSA.RSA_pub , which does not seem to be printed. What are you actually trying to achieve?

c# - How to Format a string to be a part of URL? -

I need to delete all the characters that are not part of the URL, such as spaces, & lt;,> and more I am getting the data from the database. For example: if data has been received: Product number # 123! New string should be: Product number -123 Should I use Regex? Is there a regex pattern for that? Thanks An easy regex to do this: string Clean = Regex.Replace (url, @ "[^ a-zA-Z0- 9] +", "-");

Javascript image gallery not working -

I used an image gallery engine called prettyPhoto.js in a WordPress site was making. However, the image gallery has stopped working completely for some strange reason and I can not know how to overcome this problem for my life (without explicitly going to the entire site and rel = Prettyphoto " tag is all embedded in anchor links. I'm thinking that Javascript or CSS is not delivering properly to the browser, but the" Net "panel monitors the firebug In, without the problem No files load. I tried to look at the link link to refer to the pictures being opened, and they had all the necessary "prettyPhoto" attributes. The page in question is and try to click on any microcomputer's pictures. Another "front microscope video" link is on the front page. / P> P> For those who do not know about this. Ript, does a lot of work with others: 1. putting Sunderfoto JavaScript file on your server. 2. Put it Sunderfoto CSS file on your ...

php - Shell Script Segmentation Fault -

Hello, I have a script which should run on the basis of php code return: X = 1 while [["" $ x "! = 5]] Does the "Welcome $ x" php test.php x = $ resonate? Done and php code "testdfdf exam" echo .PHP_EOL; Exit (4); So whenever I have the desire to drop looping from power 5. But sometimes I get: ./ myshell: line 7: 20529 Segmentation fault PHP test.php What should be loop without problem? Perhaps due to this error which affects both Ubuntu and Debian ...

asp.net - Requirement to build a 'branded' site -

If I can tell where I am working, I was told that it will work. It seems possible and I am starting a head on this, so I do not shoot myself later on. This is a general reporting web site that looks and feels changing, in fact it is just different images and a title but I want to be as flexible as it is. A site will be created which I will start shortly. This will be done as a site registered in IIS and around 10 other sites will be pointing to the virtual directory on this site, this allows 10 sites to connect to the generic reporting site. Depending on the source site, branding will change. So for clarification I create a site called LongLegs.com Then under our 3 Sites, we create a VD so that we have www.GillianAnderson .com / LongLegs - So the site is Scully's picture! Babe Jolie.com/LongLegs - The site will be similar, but instead of Jolie's feature pictures, Mailserver.company.co.uk/LongLegs - the pictures of the site amazing mail server that we have met he...

asp.net - Filtering in Telerik RadGird not working -

I am developing a page with telerik RadGrid and the filtering feature is not working. I enable filtering at a table level on the grid, but it performs only the rebound action without filtering. I'm using NeedDataSource mode to fill the table. I'm not sure if this data may be connected to the grid system and if this problem can occur. This is an event that gets the data service from the service connecting with the DAO: protected content; grid data-source data (object source, griddaydataSourceAvensAgps E ) {Material Grid. Datasource = OrderSwive. Gatesless Orter Behavior (session service. Current content); } I am using a Template column exclusively but I am not enabling the filter on this column. I already had a similar problem with Telenonic RadGrid and it became due to passive viewer. Under the filtering category and filter template sample, you can check the grid's online demo on the site of Telereak (below 5th above). Dick

simplexml - How to Extract the URL from A String in PHP? -

I am using PHP's "simplexml_load_file" to get some data from Flickr. My goal is to get a photo url I am able to get the following value (specified in PHP variable): How can I remove this part? http://farm3.static.flickr.com/2298/ 2302759205_4fb109f367_m.jpg In case of bus it helps , Here's the code I'm working with: entry $ as child) {$ Flickr_content = $ child-> material; // img // url // html becomes / how can i get img url from "$ flickr_content" ??? }? & Gt; You probably can use a regular expression for it, the formation of HTML If there is a lot more going on, like: if (preg_match ('/ / lt; img src =' ([^ "+]" / i ', $ string, $ Matches)) {$ imageUrl = $ matches [1];} This is quite unsafe, and if the HTML is changing (such as the parameters of the parameters & lt; img & Gt; tag, the risk of perverted HTML etc.), then it would be better to use an HTML parser.

WPF Adding a Tooltip to the Track of a Slider -

I've added a tooltip (shown below) to the track in the slider template, but the binding value for the current value Instead of the slider, I would like to bind the value compared to the "track value" which is over the mouse. Similar to what the YouTube video slider allows. The user can actually mousewalk the track and view the related value without actually moving the thumb. & lt; Track grid Rows = "1" name = "PART_Track" tooltip = "{binding path = value}" tooltip service. Placement = "Mouse" & gt; & Lt; / Track & gt; Any ideas? Thanks! I thought that you are going to create a new control, slider. You will need to implement the mouse / out and Mousemov, calculate the value based on the mouse offset and change the tooltip. I do not think there is any property that you can use "out of the box" if you need to factor in the recovery of margins etc. calculation can also be difficult.

data binding - combobox in C# not getting populated -

I have a Windows Forms App in C # I Platform is VS 2005. The piece of the following code is: Namespace HostApp {Public Partial Class} Form 1: Form {Private Zero Combo Box 2 Selected Index (Object Sender, Event Argus E) {ComboBox2.Items.Add ("Apples"); ComboBox2.Items.Add ("orange"); ComboBox2.Items.Add ("ripe fruits"); }}} I run the app but do not see the full name in the drop down box of the combo box 2. I believe that with the entered values, for drop down, "I'm missing a few lines of code. You add items to the existing existing exchange of event in the handler for the event The code needs to be moved to initial component or to some other appropriate place.

Stackoverflow-like questions/answer functionality for Sharepoint -

Is there a solution address that provides functionality for Microsoft SharePoint that stack overflows like functionality? I will advise not to use SharePoint for such a feature What SharePoint does (document) Management, collaboration, etc.), but everything else is terrible at all. Are you compelled to develop for SharePoint, or can you just do it in ASP.NET / C?

git - How can I put a WebDAV filesystem in my DVCS when I can't write to the root? -

I have WebDAV access to a filesystem, where I can not write to the root of the file system but can write 2 folders Below it I want to: Tracking my changes in a single DVCS repo (GIT / HG Favorites) Work on WebDAV connections instead of pulling changes directly into it Assume the directory structure: $ ls -lR root drwxr-xr-x folder1 drwxr-Xr (this will harm my workflow). -x folder2 root / folder1: -rw-r - r-- file1.txt root / folder2: -r-r-r-file-file I do not want to make a repost on the root because it is not writable. I have a folder1 and folder2 symlink in a local folder Can not do because the simulations are not adherent to git and hg simulations due to the speed benefits of having all repo information locally stored. I have looked at the "related" column for your question and seen it: Apparently git (1.6.0 and earlier versions) do follow the simulation will it work for you? You may have to install GIT on that version, but it seems tha...

dependency injection - In Ninject, how can I run custom code on an object after it is created with Bind<..>.ToSelf()? -

In the dependency of Nanjject injection, if you set the bindings of a class as yourself: bind & lt; SomeClass & gt; () ToSelf () .; Ninject resolves any dependency very well and has some class and gives you back the object. I want to be able to do something for some class, it returns every time when a new processing event is created. I can use binding to make it new to Totemath (or tofetterm), but I would like to solve all my dependencies first by Ninject. It would be good to do something like this: Bind & lt; SomeClass & gt; (). Self (). After (sc = & gt; sc.MethodIWantToCall ()); // Then here, gives the negative object. Is it some way to do Ninject 1.0 / 1.1? If you can not insert the code that you want to execute in constructor, then you IInitializable or IStartable . The former provides a initial () method that is said after all the injections are completed, and later both have a start () and stop () The method is called, respectivel...

Relational UML Diagram inspired by SO -

My homework was to create a relational UML diagram about a discussion site. I used, and I made some amendments: Age deleted in user information Added delegates, who posted users by their user name (voluntary) Otherwise, the schema is similar, but it is rudimentary how will you improve it? Explanation The main idea of ​​delegates is to categorize the post. Only a handful of names in the list are in contrast to the badge, the idea is not strange, but organized is. If you ask questions about mathematics, then you can be Steve.math or just math . This helps other users to look just like you, and you are not wasted space for the username . Perhaps, there is an easy way to organize things, so do not hesitate to comment. vote Users To get rid of Upwits and downwots, which is information that can come from the vote table. Make it an 'integer' unless you have a really big site, then no GUID is required as a user ID. must have an ID GUID ...

ruby on rails - Shorter way of doing this - radio buttons -

ऐसा करने के रेल में एक अधिक कुशल तरीका होना चाहिए: & lt; p & gt; & Lt;% = f.label: level% & gt; & Lt;% = f.radio_button: स्तर, "0"% & gt; & Lt;% = f.label: स्तर, 0% & gt; & Lt;% = f.radio_button: स्तर, "1"% & gt; & Lt;% = f.label: स्तर, 1% & gt; & Lt;% = f.radio_button: स्तर, "2"% & gt; & Lt;% = f.label: स्तर, 2% & gt; & Lt;% = f.radio_button: स्तर, "3"% & gt; & Lt;% = f.label: स्तर, 3% & gt; & Lt;% = f.radio_button: स्तर, "4"% & gt; & Lt;% = f.label: स्तर, 4% & gt; & Lt;% = f.radio_button: स्तर, "5"% & gt; & Lt;% = f.label: स्तर, 5% & gt; & Lt; / p & gt; डीबी के कॉलम "स्तर" है जो 0-5 से मूल्य हो सकते हैं। मुझे वर्तमान मान को HTML में प्रदर्शित करने की आवश्यकता है (यानी चेक = "चेक") क्योंकि यह कोड करता है। ऐसा करने के रेल में एक अधिक संक्षिप्त तरीका होना चाहिए। कोई लेने वाला? ...

c++ - Mysterious oneliner template code, any one? -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब मैं यह पृष्ठ पढ़ रहा था: । लेखक ने स्थिर सरणियों के आकार को जानने के लिए कोड का एक टुकड़ा प्रस्तुत किया। टेम्पलेट & lt; typename T, int size & gt; Int GetArLLength (टी (& amp;) [आकार]) {वापसी का आकार;} // '(& amp;)' का क्या अर्थ है? । । । इंट एआर [17]; Int arrSize = GetArrLength (arr); // arrisize = 17 क्या कोई भी इस कोड पर प्रकाश डाला सकता है, क्योंकि मैं समझ नहीं सका कि यह कैसे काम करता है। फ़ंक्शन को एक संरेखित ( & amp; ) प्रकार की एक सरणी T और आकार आकार ।

ruby - Best way to generate order numbers for an online store? -

Every order in my online store has a user-chain order number, I am thinking of the best way to generate them. Easy to say on the phone (like "m" and "n" are unclear) Unique Li> I'm currently using the following method (no checksum): Generate DRF_name possible_value = 'abfhijlqrstuxy'.upcase.split (' ') | '123456789'.split (' ') record = true while the record is random = Array.new (5) {possible_values ​​[rand (possible_values.size)}}. Enter the record = order.find (: first,: conditions => ["number =?", Random]) end self.number = random end P> For example: 2009-07-27 / kt1e This gives approximately 33 ^ 4 ~ 1 MLL order for the day .

scripting - How to: assign vim cursor to a certain line in the window and have the text scroll underneath that cursor position? -

You can place the cursor line in the center of the screen, and then a large number of scrolloff prefix: : and scrolloff = 99 9 Read more about how this works: : Help Scrolloff I love this feature and have to use it all the time, but I would like the ability to place the cursor at other places in the center of the screen. For example I would like the ability to place the cursor at the top of the window and scroll down the file on it. I am pretty sure that nothing is available in VIM due to this, so I was thinking that anyone who came with light-like Vime Script snippet (or any such script could come) to do this. ? "Scrollfix shortcut function! Toggle MESCrolfix () if (G: Scrollfix == 5) let G: scrollfix = 50 otherwise (g: scrollfix == 50) f: Scrollfix = 95therif (g: scrollfix == 95) f: scrollfix = 5 and two g: scrollfix = 50 endif endfunction nnoremap & lt; mute & gt; zz: call togglemescrollix () L & c; > Check out. A few years ago, I do not know whet...

ruby on rails - RoutingError problems with Webrat -

I am currently rewriting a website in the rail. I have written a model, which will replace the old static url Map for new people, and in the App Control Controller, Routing Adores calls a method that searches for a new URL that maps to the old. It works perfectly well in applicaion; If I travel it, it is redirected, but I can not get the cucumber / WebRat test written to get it because I always get an error like this. When I get the old Notisboard # features / step_definitions / redirection_steps.rb: 7 with no root matches "/noticeboard.htm" {: method = & gt ;: get} (Action Controller :: Routing error) (Aval): 2: In 'visit' ./tips/step_definitions/readirection_steps.rb: 8: in `/ ^ I try to go in old (. +) $ / 'Features / old_urls.feature: 26: In 'when I try to go to the old noticesboard' Obviously it is most important that the code actually works, and it should be correctly installed in the browser But I must also pass that test too. Is there...

PHP class not found -

मैंने इस प्रश्न को अपना ही हल किया फाइल नाम गलत लोलज़ था। नमस्ते सब! मैं एक सीएमएस बना रहा हूँ जैसे कि द्रुपल और जूमला। मैं मॉड्यूल फीचर (प्लगइन्स) पर काम कर रहा हूं, और मुझे निम्न त्रुटि मिली: घातक त्रुटि: सी: \ wamp \ www \ SYSTEM \ view में क्लास 'सेटिंग्स' नहीं मिलीं। PHP पर लाइन 22 यह मेरा कोड है: start.php & lt;? Php // सबसे पहले, कुछ विज्ञापन शीर्षलेख ("X-Powered-By: ZOMFG सीएमएस, और बिल्कुल PHP, लेकिन यह कम महत्वपूर्ण है" के साथ शुरू करें); // फिर कम impotant सामान lololol session_start (); // एक सत्र प्रारंभ करें mysql_connect ($ db_host, $ db_user, $ db_pass); // डेटाबेस mysql_select_db ($ db_name) से कनेक्ट करें; // एक डेटाबेस का चयन करें // लोड कोर need_once ("core.php"); // लोड मॉड्यूल $ res_modules = mysql_query ("SELECT * FROM"। $ _ सर्वर ["db_prefix"]। "मॉड्यूल जहां सक्षम = 1"); Echo mysql_error (); $ Module_exists = सरणी (); जबकि ($ row_modules = mysql_fetch_array ($ res_modules)) {// लोड ...

java - Apache POI xls column Remove -

I do not have a way to remove a column with Apache POI API. I appreciate a sample code or help at this point. written package org.alanwilliamson openbd.plugin.spreadsheet; Import org.apache.poi.ss.usermodel.Cell; Import org.apache.poi.ss.usermodel.Row; Import org.apache.poi.ss.usermodel.Sheet; / * * To provide help in the management of sheets, auxiliary work / public class sheets provide utility items. {/ ** * Given a sheet, this method removes a column from a sheet and runs all the columns on the left side of the right one note * * Note, this method will not update any formula reference. * * Ultimate Sheet * @ Ultimate Column * / Public Static Zero Delete Columns (Sheet Sheet, Int Column Toddler) {int maxColumn = 0; For (int r = 0; r & lt; sheet.getLastRowNum () + 1; r ++) {row row = sheet.getRow (r); // if no row exists; So do not do anything; the upcoming! If (line == zero) will continue; // If there are not many columns in the line then we are good; the upcoming! I...

pattern matching - Composed Regular Expressions - breaking a regex down into a readable form -

I was reading by Martin Fowler putting an article, this is where you can take codes like this: const string pattern = @ "^ score \ s + (\ d +) \ s + for + s + (\ d +) \ s + nights \ s + on \ s +" (* .); and break it in something else: protected override string GetPattern () {const string pattern = @ "^ score \ s + ( \ D +) # digits \ s + for \ s + (\ d +) # number of nights + nights? #optional plural \ s + at + (. *) # Hotel name "; Return pattern; }} Or this: const string scorekeyword = @ "^ score \ s +"; Conf. String number of points = @ "(\ d +)"; Const string for the keyword = @ "\ s + for \ s +"; Const String NumberOffnets = @ "(\ d +)"; Const String Nights AtWord = @ "\ s + Nights? \ S + At \ s +"; Const String Hotelame = @ "(. *)"; Constant String Pattern = ScoreQuever + Number of Points + Career + Numberoffnights + NightsnightKeyword + Hostname; Or even: const string space =...

Is there anyway to find out the ssid of the wifi access point within the browser using javascript? -

Are you connected to the browser using Javascript to detect the SSID of the WiFi access point? If I do not have my guess, then you have to write a plugin for it. I'm sure ActiveX allows this. and for a good reason :) updates : I should be elaborated, Javascript is run inside a browser sandbox, which was designed to protect both security and privacy. The ESSID of AP is not a secret, but it is not a secret It is not even information which should be disclosed without any consensus.

sql - Creating VIEW in system level -

I created a create or change statement using VIEW At Domain Schema level Select Loop.Loop_services service, Component.cmpnt_id, Component from Component.Drop_Id, Change or replace service as component, where component. Loop_id = loop.loop_id union separate " , 0,0 from the component, loop; So if I login to the domain schema and run the query - then from select * to domain1.SERV then I have to get all the results. I have reused the above statement for all domain schemas, and if I want to see the same results in one result then I will use the query with "union selection" because since It is possible that the format of the scene has the same format. contact * domain from * Select Union All * Domain names from domain Select from server all * from domain 3 Select Union * * from all domain names. All and so on to the previous domain schema. Now, how can I create the same view in the system level by knowing that this is my view ( object_type = 'VIE...

Javascript Regex: Replacing multiple words with a space for all occurrences? -

How do I change the space of double quotes and single quotes with a space with javascript regex? var stripped = mystring.replace (/ ['' '] / g, "") ;

c++ - Problem with iterating over a lots of images in OpenCv with mac os -

I'm trying to iterator on some directories containing about 600 images. I load the image if the image is full, then I release it. This is the smallest program that I can write to reproduce the error. After loading and releasing 124 images the program prevents loading images. I think this is a memory issue but I do not know what is the reason for the program to stop loading images I use my Mac OpenCV on / strong>. I do not know which version I'm using, how can I really find out. bool facial detection strategy: detectFace (std :: string imagePath) {IplImage * img = cvLoadImage (imagePath.c_str), CV_LOAD_IMAGE_COLOR); If (IMG) {std :: cout & lt; & Lt; "Image loaded" & lt; & Lt; ImagePath & lt; & Lt; Std :: endl; CvReleaseImage (& amp; img); } And {std :: cout & lt; & Lt; "Image did not load" & lt; & Lt; ImagePath & lt; & Lt; Std :: endl; } Back true; } This method is called in the dire...

python - dynamic plotting in wxpython -

I am developing a GUI to read the data from the serial port continuously. After reading the data, some are calculated and the results are plotted and refreshed (aka Dynamic Plotting). I use the wx backend provided in the matplotlib for these purposes. To do this, I basically use an array to store my results, in which I keep adding it after each calculation, and the whole article I upload again. To make it "dynamic", I only set the X-axis lower and upper limit for each instance. Something found in: The problem, however, is that since the data is continuous, and if I plot it, eventually the system memory will end and the system crashes. Will go Is there any other way that I can conspirate to carry out my results continuously? To do this, I basically an array to store my results , In which I keep adding it to Try to limit the size of this array, by removing old data or entering every N-th (screen resolution Will block all entries from displaying anyway). I bel...

Linking jQuery Cycle Pager element -

I am using the jQuery Cycle plugin with pagers. I need navigation functionality, where I can provide a link for my customer and it can browse the page which is a project gallery I need a cycle plugin to show a special slide, perhaps on a specific slide Variables can be supplied in the URL to go. In that case, I will need to get a variable on pageload from the URL (a number 'N') and click on one of the NATH elements. Inside a div You can use the following to get the parameter from the query string: function $ _GET (q, s) {s = (s)? S: window.location.search; Var re = new RegExp ('& amp; amp;' + q + '= ([^ & amp;] *)', 'i'); Return (s = s.replace (/ ^ \? /, 'Amp; amp;'). Match (again))? S = s [1]: s = ''; } Then in the cycle declaration you can use start.slide (assuming the parameter param_num : Previous> $ .cycle ({start.slide: $ _GET ('param_num'), // your remaining cycle configuration}); Note t...

webbrowser control and memory problems -

My app is using around 300MB I have created all the objects with new ones and used around it, If this was the settlement interface now with web browser controls, I see those 450 pages that keep advertisements on them and many AJAX requests use so that there is a request for fixed 1k. How much memory the app is taking? I have noticed that I can go back to the page by clicking on the page, but after visiting the pages of APIs, I can not use several MBs (I do not want to kill 450 unique pages by hand to check ). So why do I have these memory problems? Which IE are you using? The problem you described is the least degree for IE5 and IE6. I remember when we had to recycle the IE 5 webbrose object due to memory leaks. I'm not sure, but I believe the situation should be better with IE of the current generation.

html - Can I set font-size relative to page size? -

Is there a way to create font-size relative to the size of the page? Applying percentages as a unit is standard font size (as 90% 12px is not 90% of the page!). This is different from most of the other tags of the tags. Any fonts to make the page 'scale up and down' too? Should I rely on em ? Thanks No, the size of the font in the relative percentage of the page size Can not set up. em in the form of shaping shapes, how normally the photo renders in 16 points. If you want your page to scale up and down and keep any type of scale automatically, box and font, then set it in em will be okay . This method will allow the fonts and boxes of the page to grow to each other in a relative shape and it is hoped that things should not be out of bounds and boundaries. >

what is the c# equivalent of public final static in java -

जावा में मैं लिख सकता हूँ: सार्वजनिक अंतिम स्थैतिक MyClass foo = नया MyClass (" foo "); क्या सी # में एक समकक्ष है? निकटतम बात जावा अंतिम क्षेत्रों के लिए मैं यह सोच सकता हूं कि: सार्वजनिक स्थैतिक पठन केवल MyClass फ़ील्ड = नया MyClass ("foo"); यदि आपके पास एक आदिम प्रकार (स्ट्रिंग, इंट, बूलियन) है, तो आप इसके बजाय const का उपयोग करना चाह सकते हैं। सार्वजनिक const स्ट्रिंग MAGIC_STRING = "Foo";

php - Doctrine migrations in symfony don't update model and forms -

I am testing theory broadcast in Symphony and in the end it has got to work, but I noticed These migrations only update the database. Forms and models are not being updated as I expect ... Is this normal? If this is normal, then is there any way to update the model with changes made to DB? This is normal. To update the model / form / filter etc., you . / Symfony principle: can work. During development, you are probably loading in your database, so they will load them with the principle: data load (or use build-all-reload work). But once your app is in production, you certainly do not want to dig all the data every time you change the DB schema. This is where migrations come. My process is: Update schema.iml Principles to run: All Build in dev-environment. Create a migration Do any Dev / Dev on Dev environment. Deploy the code for the output Migration to the production database.

c# - is it possible to read the column name of a cell in gridview? -

I want to find the column name of the cell in the event below a datagrid view. protected void grvDetailedStatus_ItemDataBound (object sender, DataGridItemEventArgs e) {(int i = 0; i & lt; = e.Item.Cells.Count - 1; i {System for ++) .DateTime cellDate = default (System.DateTime); If (System.DateTime.TryParse (e.Item.Cells [i] .text, cellDate out)) {e.Item.Cells [i] .text = String.Format ( "{0: d}", cellDate); }}} Am I getting a way to get the name of the cell column? Edit: Sorry for not giving a clear explanation. Let me explain it more clearly. I only want to do the formatting given below for specific column values: protected void grvDetailedStatus_ItemDataBound (object sender, DataGridItemEventArgs e) {(Int i = 0; i & lt; = e.Item.Cells.Count - 1; i ++) {System .DateTime CellDet = Default (System.DateTime); If (System.DateTime.TryParse (e.Item.Cells [i]. Text, out of salad)) {ITOM. Seals [i]. Text = string Format ("{0: d}", celadet); For ex...

N-Tiered vs N-Layered architecture/design -

What does it mean with n-tierd and n-layer architecture / design? Is there any difference between N-Tiered and N-layered architecture / design? If so, what's the difference? People often use two words interchangeably between each other, in which they describe an architecture As both are multi-layered and multi-tiered. I believe that usually a level refers to some physical separation, whereas one layer is more than a logical separation. For example, I say a specific web application that there is a front end - which is displayed in browser - and the actual application logic running on the application server and a database. It can be referred to as 3 tires, since there is a database server, an application server and a client machine. Just as easily, however, a database layer, logic level and presentation (or UI) can refer to the layer.