Posts

Showing posts from June, 2011

user interface - Blackberry 4.5 - How to click on a .jpg image? -

I am displaying a .jpg image in a bitmapfield; Adding it to a vertical field manager is showing, but I can not click on it. I'm liking it .. Bitmap bitmap = bitmap .getBitmapResource ("image.jpg"); Bitmapfield bitmapfield = new bitmapfield (bitmap, bitmapfield.focusable) {protected boolean navigationclick (integer position, int time) {// handle click event return true; }}; Vertical Field Manager vfm = New Vertical Field Manager (); Vfm.add (bitmapField); (Vfm_stamp); But if I take a .png image bitmap bitmap = bitmap .getBitmapResource ("image.png"); Why is it so clickable? BlackBerry supports 4.5. JPG image format. It displays a .jpg image, so why not click it? I want to make it clickable how to do it? You can override the method onFocus () and select it The behavior changes. You Netmant You can also create Bitmapubutan which will be net.rim.device.api.ui.File You will need setChangeListener () your bitmapfield for>

osx - Global hotkey poller via python for Mac OS X -

I use for Linux. And on windows But I do not know what to use to enter a key on Mac OSX (global - non-centered). How can this be done? I'm looking to enter mostly modifier keys (ctrl / alt / shift etc).

javascript - Search and replace all elements -

I need a script to attach to the text or if all the texts are present then remove all matched elements Please give it. I tried this: what is wrong there? Thank you. Try txt.replaceText (RegExp (elem, " G "), '');

ip protocol - What is IP security? -

Is there a brief explanation for IP Security? And why do we use it? If you mean it encrypts network traffic at the IP packet level. You use it to stop other people - in general - by removing data that travels through your network - especially sensitive data to be encrypted, although the application in question does not support encryption. .

PHP - Worth including the data type in the variable name? -

I am trying to understand my code as easy and easy as possible, and I think the data type is a variable Keeps in the name. Example: $ intCurrentLine = 1; $ CurrentLine = 1 instead; $ StrUser = 'blah'; $ User = 'Blah' instead; I do not think this is really necessary in the above example, but in some cases can this be useful? Is it possible to understand my code more? Am I really using it or should stay with the "normal" variable names? Do you know the script where it is used? Best regards, type variables The name is said to be added. It's a matter of style, like I do not like to use it in specific languages ​​like PPP and VB because there is no real need. This is a good article on the subject.

wcf - Prevent Named Pipes Conflict -

We have a .NET program that uses WCF to communicate with another process. We have used designated pipes. Service Host Host = New Service Host (Typef (Something), New URI [] (New Uriyi ("netpopi: // localhost")}); Host.AddServiceEndpoint (typeof (ISomething), New NetNamedPipeBinding (), "Something"); host.Open (); Code worked great till third party .NET program was installed. Now open "not on pipe name Can be heard with the message "net.pipe: // localhost / ', because another pipe endpoint is already listening on that name." My impression is that the other Program is already using named pipes Is there a workaround or is there a programmable pipe designated on the computer program? I get other questions that you can set a "name" for the pipe, so it You can not fight with other procedures, how do you do it? Can use the programming dub Take a look at Juwel Lovie's Service ModelX from your book of LCF Services. You will see

.net - is System.DirectoryServices.AccountManagement.GroupPrincipal thread safe? -

I am writing a program that will create users in bulk, I have an operation that will build blocks It is about 5 seconds, to get around it I was going to thread it and everything was sitting in a thread pool. My question is, if I make theory outside the thread and group theory to thread and call group.Members.Add (u) and group.Save () Can I get in trouble? Would it be better to create new group principals from within each thread? from: Any such public static (visual Share in Basic) Threads are safe Members of any instance are not guaranteed to secure thread. This small note is very common in documentation. To determine this, the programmer is up to you to understand what you mean by "thread safe" and how to control concurrent access.

How to mount network disks within Delphi Service? -

I'm a newbie in Delphi, but I have to fix the Delphi code to mount network disks when the service starts " By default, when my application is launched through the Windows service network disk, this is not accessible to the application, so the solution is to include the UNC mapping script in my service. Can this help me with this problem? Thocks lot. unit ALFTSASvcUnit; interface windows, messages, suusutils, classes, graphics, controls, SVCMGR, dialog, shellpi , TLHLP22 uses the strutels; Type TALFTSAService = Class (TService) Process Service Start (Sender: TService; var Start: Boolean); Process ServiceStop (Sender: TService; var Closed: Boolean); Process ServiceExecute (Sender: TService); Personal Private Functions} CountSAAProcs (Procname: string): Integer; Public Function GetServiceController: TServiceController; Override; {Public declaration} end; Var ALFTSAS Service: TALFTSAService; ALLIANCE: string; Arch: string; Implementation {$ R *. DFM} function TALFTSAService

visual studio 2008 - Why do the EnvDTE.dll and dte80a.olb files appear in Detected Dependencies in my VS2008 web deployment project? -

I have a VS2008 web project that was originally migrated from VS300. In my solution, I have a web deployment project that uses primarily output and content files (+ some support files) from this web project to create an MSI package. The problem is that under the "Detected Dependency", I file the .invdte.dll and dte80a.olb. In addition, the EnvDTE.dll file actually contains C: \ Program Files \ VS2008 is a VS 2005 installation folder that has been picked up from Microsoft Visual Studio 8 \ Common7 \ IDE \ PublicAssemblies \ EnvDTE.dll The original VS2003 solution, of course, does not raise such a VS 2005 file, but it does not raise anything equal. None use NVDTE in my solution (sub) projects. Can anyone tell me that under what circumstances the VS 2008 web deployment project will take these files into the dependency delivered (Given that there is no reference anywhere in the solution of ambition)?

iphone - How to load images from the Documents folder that have been saved dynamically? -

I have problem loading images from the document folder of iPhoneView in TableView. Different requests, I look at all the images on the server and download them in the "Pictures" folder under the documents. I'm pretty sure the images are saved properly. NSString * filePath = [imagesFolderPath stringByAppendingPathComponent: imageFileName]; [UrlData writeToFile: File path atomically: No]; NSLog (@ "saved in file:% @", filepath); 2010-01-22 17: 07: 27.307 Foo: [user / hoang / library / application support / iPhone simulator / user / application / 6133 A161-F9 DC-4C 92- 8 AE 6-6 ARA-51022 EA 94 / Documents / Images [NSBindal Main Bundle] is not suitable for loading images because at the runtime, the app tries to connect the server to download images, they Are not stable. P> But loading images from the document / image folder does not give an image to the table view Fixed NSString * CellIdentifier = @ "cell range "; UITableViewCell * cell

java - Declaring Integers, Doubles, Floats, Strings etc. in Spring XML -

Occasionally, Spring can not understand how a "value" should be. This happens when the property or manufacturer is of "java.lang.Object" type. In these cases, this is sometimes not the right option for Spring Default "java.lang.String", for example: & lt; G: jndi-lookup id = "test" jndi-name = "Java: comp / env / test" default-value = "10" expected-type = "java.lang.Integer" /> If lookup fails and it needs to come back to the default-value, then there is one kind of mismatch. Therefore, instead, it needs to: & lt; Bean id = "test" category = "org.springframework.jndi.JndiObjectFactoryBean" & gt; & Lt; Property Name = "jndiName" value = "java: comp / env / test" /> & Lt; Property Name = "Default Object" & gt; & Lt; Bean class = "java.lang.Integer" & gt; & Lt; Constructor-erg standard = "10" />

c++ - stl vector assign vs insert -

I understand the words of 2 tasks, assigns before replacing the supply values, insert - value at the specified location Inserts (allocates new memory if necessary). Is there any reason to preferring one over each other? Or to keep it in any other way, there is a reason to move rather than insert. To apply the words of assign if you prefer, Assign call - If you want to call the semantics of insert , call a call is not interchangeable. To call them on an empty vector, the only difference is that when you call , you do not need to give an iterator to enter it. . . There may be a performance difference in this, but this implementation is specific and almost certainly careless.

asp.net mvc - Entity Framework: LINQ Include() does not work after DB update, why? -

I'm new to the unit framework and LINQ and went into a strange scenario. I have been using the following question to return the account information: var account = (acct at _entities.account from _entities.account at ACT On iDem, m.Account.Id is equal to where acct. Id == account id & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp ;IMI (item number) select acct) & lt; account & Please include ("Item.ItemDetails"); We've recently made some changes to the database and created a new ADMX file. The open query still returns the account and related items but the item is not being included anymore. I have certified SQL with the query and there is nothing wrong in it, the correct data is being returned. In addition to these items I do not see anything different in the edmx file between the items and the items as these were the change and the navigation property is there. < P> Thanks Include (...) the name of the naviga

Displaying multidimensional array in php -

मेरे पास इस तरह एक सरणी है: $ tset = "MAIN_TEST_SET"; $ Gettc = "101"; $ Getbid = "b12"; $ Getresultsid = "4587879"; $ उपयोगकर्ता ["$ tset"] = सरणी ("टेस्टकेस" = & gt; "$ gettc", "बिल्डिड" = & gt; "$ getbid", "resultsid" = & gt; "$ getresultsid"); PHP में arrays मुझे भ्रमित कर रहा है। मुझे कुछ इस तरह दिखाना है: MAIN_TEST_SET 101 b12 4587879 102 बी 134546464 103 बी 14 5545465 MAIN_TEST_SET3 201 एन 12 45454464 MAIN_TEST_SET4 302 के 32 36545445 यह कैसे प्रदर्शित करें? धन्यवाद। print_r ($ उपयोगकर्ता) वह सहज रूप से अपनी सरणी को बार-बार मुद्रित करेगा मैनुअल देखें: यदि आप इसे विशिष्ट तरीके से मुद्रित करना चाहते हैं जिस पर आप इसे स्वरूपित करते हैं तो आप कस्टम फ़ंक्शन लिखना चाहते हैं, जो कि इस तरह से अग्रविकल्प पाशन सिंटैक्स का उपयोग करता है: & lt;? Php echo "& lt; तालिका & gt;"; विदेशी मुद्रा ($ उपयोगकर्ता $ testSetNam

Try Catch blocks inside or outside of functions and error handing -

This is a more general purpose programming question than a language specific. I have seen many performances for trying and catching. Whatever process you need to preprocess, call a function with appropriate arguments and wrap it in an attempt / catch block. The second thing is that to pass data to a function and rely on the attempt to capture within the function, if a true / false flag is returned in case of errors. There is a combination with the third attempt to hold out of the ceremony and inside. However, if the function tries to catch something, then it catches another exception to the catch block outside the function to capture it. Any ideas / standards are accepted on the professionals / ideas of these methods for error control? My Googling Ninja skills have failed me to find exact data on this. In general, an exception can only be caught if it can actually be handled There is no point in catching the exceptions for any other purpose than logging in. The excep

Why does the .net world not have application servers like the Java world? -

I know that IIS is a web / application server I is a fully growing enterprise application server like web logic / tomcat / jbys Why are not those, which are so big in the Java world? EDIT1: I am not a Java developer myself, I called those servers because only "scalable and configurable and optimized" I have read about them in most words associated with them. For example, look at the stack overflow I'm not flaming, only curious Mainly because the Java world is free The vendor and the platform tries to be independent, it requires a consistent specification and execution environment for server side development - and it is for BEEEING JETI. On the other hand .NET is Microsoft - so they can provide the whole stack. Windows, libraries, frameworks etc. (IIS, WCF, Com to mention something) In fact a J2ee server. NET version is.

c++ - Why doesn't this << overload compile -

I can not understand why the following code does not compile. Syntax is similar to my other operator overload. & Lt; & Lt; Should be Overload Friend? If so, why? Thanks for any help. This does not work - #include "stdafx.h" #include & lt; Iostream & gt; # Include & lt; Fstream & gt; #include & lt; String & gt; Class test {public: Clear test: M_vir (var) {} std :: ostream & amp; For operator & lt; & Lt; (Stud :: Ostream End Stream) {Return Stream & lt; & Lt; M_Var; } Private: int m_Var; }; Int _tmain (int argc, _TCHAR * argv []) {test temp (5); Std :: cout & lt; & Lt; Temporary; Return 0; } This works - #include "stdafx.h" #include & lt; Iostream & gt; # Include & lt; Fstream & gt; #include & lt; String & gt; Class Test {Public: Clear Test: M_vir (var) {} Friend Study :: Ostream & amp; For operator & lt; & Lt; (Study :: Ostream End Stream, Test and Tump); Pr

php - Web CMS Performance: pages/second (Joomla, Drupal, Plone, WP) -

Note: I am not in web programming, so please forgive my ignorance if the question is trivial. Besides, Do not comment about "how wrong" the question is, how they compete against one another, but about the reason behind the incredible slowness of them all. Just read about one, where Joomla, Drupal, WordPress, Plon 3 & amp; 4 was tested. Am I wondering this: They displayed around 4-14 pages / seconds outside the box. How is this possible, why are they so slow? CMS should only interrogate one DB and churn the packed data in good templates. DBS is fast templates should be fast (text replacement, no big deal) Our machines are superfast and still, these high profile CMS can only produce a few pages / second how can ? A CMS should only inquire with a DB and pack the data well Templates. Not so prominent, modern CMS systems are incredibly complex animals. A typical page is not just body text and a title, but dynamic category-based content queries that consolidat

asp.net - UserControl Combined ListItems & ContentTemplate -

Is it possible to create a UserControl, which takes both ListItems and ContentTemplate? Something like this: & lt; Custom: UserControl ID = "ucTest" runat = "server" & gt; & Lt; Items & gt; & Lt; Asp: ListItem text = "test1" value = "1" /> & Lt; Asp: ListItem text = "Test2" value = "2" /> & Lt; / Item & gt; & Lt; ContentTemplate & gt; Here's some content! & Lt; Br / & gt; & Lt; Asp: button id = "btnTest" runat = "server" OnClick = "SomeFunc" /> & Lt; / ContentTemplate & gt; & Lt; / Custom: UserControl & gt; I liked them the same way and it works correctly: used: & lt ; Cc: Test ID = "jqTestTest01" runat = "server" OnTestClick = " JqTestTest01_TestClick "> gt; TestItems & gt; asp: ListItem text =" Tab one "value =" 1 "selected =" true

php - How to get number of rows without SELECTING all rows? -

How do I get the number of rows such as mysql_num_rows but without working for a mysql Resources because I do not know the future level of my webpage and it may take an hour to get the number of rows;) Thanks! SELECT COUNT (*) as tblName from num_rows; - and retrieve num_rows columns from that statement

java - How to "white label" spring beans -

We have a white labeled app (an app that supports a branded experience for multiple applications) custom components per customer To support, we want to be able to load the co-brand version of a component. For example something like: & lt ;! - Default service - & gt; & Lt; Bean id = "service" class = "com.blah.myService" primary = "true" & gt; & Lt; Property Name = "myBean" Ref = "Bean" /> & Lt; / Bean & gt; & Lt ;! - Custom service for customer 123 - & gt; & Lt; Bean id = "service_123" class = "com.blah.myService" & gt; & Lt; Property Name = "myBean" Ref = "Bean" /> & Lt; / Bean & gt; & Lt ;! - Default Bean - & gt; & Lt; Bean id = "bean" class = "com.blah.beean" primary = "true" /> & Lt ;! - Bean 123 for client - & gt; & Lt; Bean id = "Bean_123" class = "comm. B

http - Grade F on Add Expires headers -

I have used the YSlow Firefox add-on and the result behind it is returned: FX Explorer header on grade F There are 8 static components without the end date of a remote future. * (no expiration) http: // localhost: 63808 / website / css / global k? ... * (no expiration) http: // localhost: 63808 / website / css / bamwindo css? ... * (no expiration) http: // localhost: 63808 / website / js / global.js? ... * (no expiration) http: // localhost: 63808 / website / js / bamwindo.js? ... * (no time limit) http://www.maplist.com. Br / img / faixa_verde.png * (no end) http://www.maplist.com.br/img/logo_home.png * (no time limit) http://www.maplist.com.br/ Img / wait_bar Codeproject.com/KB/aspnet/CssAndJavaScriptOptimizer.aspx Any easy way to resolve the problem? Maybe global.asax? Anyway, I am using this meta in my page: & lt; Meta HTTP-EQUIV = "CACHE-CONTROL" content = "public" & gt; & Lt; Meta HTTP-EQUIV = "EXPIRES" CONT

normalization - Designing a SQL table with hierarchy/sub-categories -

I have a table that looks like this: ID | Keywords | Category | Sub-category Sub-sub-category Sub-sub-sub-category Is a keyword related to only one category, sub-category, let me split it into two tables (a table table with a keyword table and parent ID) Will happen. ..e.t.c. Which means that there is no repetition, does it still need to be divided? You only have one table mapping 1-1. To represent 1 or several or several-mapping, you must use multiple tables. If a keyword is consistent with only one category / sub-category / sub-sub-category, then your current layout should be fine. A Warning: If you want to search by keyword, you can have performance advantages to separate tables, it is very fast to find an integer. The discussion of storing the keyword values ​​in another table can be some of the important advantages of using a different table in the country's names (which are mostly static) in another table (spoken) Ease of language freedom, sharp search and

c# - Change "ToString" for a sealed class -

I have a class with which I'm working: public sealed class WorkItemType This toasting is weak (just shows from Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemType.) Does it show the name of WorkItemType override it To do? Normally I will add the value to a new class, but I am using it for binding in WPF (I have to create a list of work type in a combo box and the selected value is bound Specify in the worktime type variable.) I think I'm out of luck, but I thought I would ask. Do you need to override toString < / Code>? If you are in control of the code where the object is displayed, you can always provide a FormatWorkItemType method, or something for that effect.

reset - Git: How to move back and forth between commits -

I have a newbie question about Git: I need to move forward in history a branch. That means, I have to get all those files in those states which are in some old amendments, and then I have to go back to the latest position in the repository. I do not have to commit. To sync pre-> svn up with the repository. I think I want to know the hash of committed to return, so I tried git reset & lt; Hash & gt; That's what I'm getting there but then I tried git pull but it's about protest Complains in So what is the right way to go through history? I am thinking in terms of SVN, so do not be too excited to point me to some good tutorials. Note that I have already checked. Thank you, Ondre. Well, I am also a former SVN user, and now use GIT for all my projects . When you use GIT, you should change the way you think with the client-server architecture used in SVN. In Svn, each change requires a connection with the server. Using G

c# - How can I combine these linq queries into one? -

After being new to LINQ, I have created some questions and want to add them in one, but I'm not sure How do it Here are these: var u = dc.Users.Where (w = & gt; w.UserName == Username) .SingleOrDefault (); Var M = DC. Amberships Where (w = & gt; w.UserId == u.UserId) .SingleOrDefault (); M.PasswordQuestion = Security Question; M.PasswordAnswer = securityAnswer; Dc.SubmitChanges (); dc.Users is aspnet_Users table dc.memberhip aspnet_embership table In addition, SingleOrDefault and FirstOrDefault ? What is the difference between? Not sure that they have a relationship (they should). If they do, the linq-to-sql designer will give you a user property on the membership object (or on the other side). Then you can write something like this: var membership = DC Amberships Where (x = & gt; x.User.UserName == Username) .SingleOrDefault (); If they do not have relationships, then you can write something like this: var membership = (in meters b

actionscript 3 - LocalConnection working in local browser but NOT in remote site -

Really surprised using the debug utility (LuminicBox) from the local connection's Flaky behavior that is to use the local connection Works for When swf is loaded locally in a browser, the local connection works. When the same page and SWF were seen 'live' on a remote site, the local connection fails. Anyone encounter this ?? By default, local connections allow communication between swfs loaded from the same domain. When you are loading SWFs in the browser, the debug utility has to be loaded in the browser from the same domain. You can get local connections to work on local domains but more configuration is required for this. There is a link here for Flex documents on this subject. This problem is similar to Flash / Flex. .

c# - Get encompassing class, then access a property of it inside custom attribute -

I am using ASP.NET MVC through custom attributes / data annotations on my model and implement custom verification I am doing Is it possible to use the property on the original class of the object inside my custom attribute? public class MyModel {[MyCustomValidator} public string var1 {get; Set;} public string var2 {get; Using asp.net mvc public class MyCustomValidatorAttribute: Validation attribute {Public Bull override IsValid (object value) {// Access anyway var2 in MyModel}} So basically, check the verification of other assets for a specific value. I tried to pass the value of var2 as the parameter of MyCustomValidator but that does not work No, basically. After a prey through a reflector, you have only been examining the member's value - which does not have any item or member / information of the property / region / member also. I agree that it is very limited and frustrating, but it seems that it has been fixed in 4.0 - on my last answer sign , but

compression - Compressing High Resolution Satellite Images -

Please suggest the best way to shorten satellite imagery. Description Uncompressed size - 60 GB uncompressed format - IMG4 band (retained after compression) Favorite compression format - JPEG 2000 is enough to help with visual analysis. Thanks Monica

java - How to refactor Netbeans generated GUI code? -

I created a GUI in Netbeans through the Netbeans Swing GUI manufacturer, so I just drag the swing component from the "palette" window and Dropped and all the code were generated by Netbeen. Now the code is too long to maintain (approximately 10,000 lines). So some experts suggested me to refactor my code. I can refer to the code that was generated by me but I do not know how to reboot the generated code by Netbeans because it does not allow editing in its generated code. Any suggestions? 10.000 lines of code sounds like you have everything in that single class. Start by dividing your source into the model, view and control (). You may also be able to remove some one way to do this in different classes, create a new JPNL (new file) and Cut / paste your composits from a main panel into that new JPanel . Save your new panel and compile it. Then go back to your main frame, select beans -> bean select from your palette and the newly created squa

flash - Adobe Flex: Why do I get intermittent SecurityErrorEvents on some browsers? -

Our Flex app interacts on the TCP-socket connection back to its original server. This requires an allowance from the server and thus we set up one on the host (source code at pastie.org/791060). It detected Firefox, Safari, Windows and Mac OS X, but then yesterday we found problems with IE 7 on Windows XP. About 50% of cases are raised on a SecurityErrorEvent socket. Security before adding. Despite the call to the load policy file ("xmlsocket: //: 843"), and the overview of transmitting socket policy data to the customer of the Socket Policy server (checked with TCPDump), this error is often reloaded in the flash app in question It can be reversed by the rest, while restarting IE is its return. Why do we see these intermittent errors, and what can we do about them? Regarding the issue, a bad socket policy Server implementation is fixed. It seems that it was hanging very quickly in the TCP negotiation with the flash client (did not wait for the string), due to the

c# - designing class hierarchy for typical characters in role playing game -

I am trying to design a game that is playing a simple role in which your specific character types like fighter, magician, Clerics, thieves, etc. I need advice in a good way to setup a class hierarchy. My initial effort was to make a type of "character" and make a fighter, magician, cleric, derivative type from "character". But then I thought it might be better to create a "character" class and then use the decorator pattern. So say a fighter decorator, magician decorator, etc. Or would any other way be better? I will use a combination of strategy and decorator patterns. Your initial suggestion is something like a strategy method approach. Try to differentiate between character types and character traits; Character types like fighter, magician, cleric, etc. will be something ... and should design it with a pattern of strategy, resulting in some hierarchy tree May be. Characteristic elements, fire, elemental, dark force, ... Example A fi

.net - Circular reference when convert Ilist<T> to Json in s#arp -

I have two squares, in which they have more than one relationship. When I s back to the list of classes of these tow, the ARP, everything is fine. But when I try to convert these two lists into a Jason format, I get the "circular reference" exception. I look for such an exception on the web, and this is a common question. So, can I get rid of # ARP architecture with some exceptions for some solutions? Thank you. How do you use "S # ARP" to return JSN? With "Jason return (list)"? So it's ASP. It's about Net / MVC only, there is no S # ARP business here, and you better add aspir net MVC tag in question to answer more people. For the problem, there are two possible solutions: The system. Web. Script Serialization. Scripted Ignorative attribute either parent attributes or child items collection mapping for a list of other classes, e.g. (Select the new TMPIT (CID, C.Name) in the list from C). But without looking at the actual

c# - Basics in Resizing Pictures or What happened to Picture Size? -

I am writing a program that resizes the image in such a way: Image original image = image fromFile (pathToOriginalPicture); Bitmap b = new bitmap (nudity, newhigh); Graphics G = Graphics. Framesize (b); G.DrawImage (Original Image, 0, 0, Nudity, NewHead); G.Dispose (); B Save (pathtoau output image, image format. Jpeg); I tried to set: newWidth = originalImage.Width; NewHeight = Original Image. height; The result was that the photo of the resize was created, whereas the original file was ~ 4M. Why is this happening? Is the quality of the original picture better than the re-size? how? I opened both photos in Photoshop and I think the original picture was 72 pp, while a resized person became 96 pp. Why is it like this ? Can you control it? Thank you very much for your time! Do not tell us the original form of your photo, but saving you as a JPEG : b.Save (pathToOutputPicture, ImageFormat.Jpeg); In addition to lossy, JPEG can also output different quality

c - way to send strings to stdout AND socket in 1 line -

मैं इसे केवल 1 लाइन में लिखना चाहता हूं: fprintf (stdout, "आरसीपीटी प्रति: & lt;% s & gt; \ r \ n ", argv [argc-1]); Fprintf (sockfd, "आरसीपीटी टू: & lt;% s & gt; \ r \ n", argv [argc-1]); इसलिए मैं एक ही स्ट्रिंग को stdout और मेरी खुली गर्तिका पर भेजना चाहता हूं। मैं यह कैसे कर सकता हूं? के साथ #include & lt; stdarg.h & gt; Int fprintf_both (FILE * a, FILE * b, const char * fmt, ...) {FILE * f [2]; Const int n = sizeof (f) / sizeof (f [0]); Int i; Int sum = 0; एफ [0] = ए; एफ [1] = बी; के लिए (i = 0; i & lt; n; i ++) {va_list एपी; इंट बाइट्स; Va_start (एपी, एफएमटी); बाइट्स = वीएफप्रिंटफ (एफ [आई], एफएमटी, एपी); va_end (एपी); यदि (बाइट्स & lt; 0) वापसी बाइट्स; अन्य राशि + = बाइट्स; } वापसी राशि; } आप कर सकते हैं fprintf_both (stdout, sockfd, "आरपीटीटी टू: & lt;% s & gt; \ r \ n", argv [argc-1 ]);

jquery - Using SimpleModal and ASP.NET MVC -

I am using simple model with asp.net MVC I have set it up using the OSX demo, Which loads a sequence in the dialog. I am using Javascript: jQuery (function ($) {$ ("Input.ema, a.ema"). Click (function E {e.preventDefault (); $ ("# osx-modal-content"). Modal ({appendTo: 'form', overlayId: 'osx' OSX-container ', closed HTML:' & lt; div class = "Closed"> X , , minHeight: 80, Opacity: 65, Position: ['0',], overlayclose: true, on open: OSX.open, onClose: OSX.close, onShow: OSX.show});}) var OSX = {container: blank, open: function (D) {var self = this; $ .ajax ({url: "/ message / user message /", Type: 'GET', Data type: 'html', // & lt; - - Success to expect an HTML response: doSubmitSuccess}; function doSubmitSuccess (result) {$ ('div # osx-modal-data ') .html (Results);} Self.container = d.container [0]; ("# Osx-modal-content", self.container) Show ($) (' div #

c# - WCF communication between 2 servers crashes after IIS7 process recycle -

I have been stumped like this, and hoping that I can get some answers. Actually, I have an ASP.NET application that is running in 2 servers. Server A has all the business logic / data access to appear as Web Services, and Server B is on that website which is related to those services (via WCF, with net.tcp binding). The problem is only a few seconds after the recurrence of my app pool started by IIS on server A After reclaimed time, recycle (using 29 hours of default set in IIS) happens. Server log (server A): 'AppPoolName' has requested a recycle '' #### 'A worker process with the process ID of the retired application pool Because the worker process has reached its accepted processing deadline. I believe that this is normal behavior, the problem is that after a few seconds, I get this exception on server b: Channel can no longer be used to send messages because the output session is a server-initiated stop, either Disable Auto-Close by setting Di

gtk - GIO example for opening a server port? -

Can you please tell me that there is an example for using the GIO server socket (I can open a port Can I hear more on socket requests?) I want to use this 'remote-control' in my GTK + application. I think you should do something like this: # MY_PORT 47110 / * Define, the listener's callback, it is called by GTK + when the socket activity is to handle * steady / gabolian cb_listener (GIOChannel * source, geocaching status, gpointer data {switch (status) { Case G_IO_IN: / * The data to be read. * / Break; default: / * An error has occurred, or the socket is closed * / return incorrect; / * To the EO, it can be harsh. * Returns TRUE; / * It tells GIO that everything is fine. * /} Then somewhere (in a function, Maybe main () ): GSKT listener * listener; listener = g_socket_listener_new (); g_socket_listener_add_inet_port (listener, MY_PORT, NULL, NULL); G_io_add_watch (G_IO_CHANNEL (listener) ), G_IO_IN | GIORER | GIIOHUP, CB-LISTER, FALL);

java - How do I get the type of the expression in a MemberSelectTree from a javac plugin? -

I am trying to write an annotation processor in JSR 269 format which will be used by javac compiler tree API uses it. I am interested in member selection expression, such as call method. I can easily choose the name of the method (or field, etc.). But I want to know how the member is being chosen, and I can not find a simple way of doing this. tree .getTypeMirror returns null for everything I try to call it (and Javadoc does not give any signals). I think I can completely analyze every kind, select the expression on the left side of the member and determine the constant type of expression by recursive analysis: NewClassTree , TypeCastTree , MethodInvocationTree , array asset , and many others. But it seems like a lot of error-prone work, and clearly Javac already knows the steady type of expression because it requires this information for many purposes. But how do I get this kind of information? Whatever I have done so far: import com.sun.source.tree.MemberSelectTr

wordpress - Rich text editor (WYSIWYG) for Custom Fields input -

I know about plugins that plug-in requires all function nity which will be required. The problem is that it is no longer supported and is being broken with the latest WordPress release. Do you have any suggestions on any other solution that would suit my needs? What I really need for custom field input is Rich Rich Text Editor (WYSIWYG) Thanks more fields were not abandoned has gone. You may be interested in the same plug-in called Custom Field Template . There is also a very popular plugin that allows you to customize all types of custom fields to your content type (Date, Wysiwyg, ...) - Meet the Magic Field . Here also it is that you want to do some research first. And when everything fails, you can do it yourself by fixing the function itself. Of course - some PHP skills are required to do this;) I am fairly new to WP, but it's my way of doing this for now, it's a lot of "searching the wheel again" but I also learn How do I work under WP Hood?

android - Creating dynamic controls -

I am trying to create a screen with some dynamic controls, to be accurate with the purpose of learning radio buttons well is. I have been able to add radio buttons by referring to the radio group in the main group. Radio Group RG = (radio group) searchWBIID (RID.price); Radiobutton RB = new radio button (this); Rb.setText ("some text!"); Rg.addView (RB); I did not know how do I set the radio button ID? If you want to use rb.setId () then this integer? I am trying to dynamically do the XML bits by default: RB (Int) is how you will set the ID. You say "it wants an integer?" As you feel that sounds strange, what else would you expect?

SQL Server stored procedure question -

I have a SQL Server stored procedure that is in use for years. This stored procedure tells many other processes. I want to take a time out of time and apply my business logic to a .NET class project. To do this, I have to call the .NET assembly from the parent stored process and the return result will be used by the original process. Since SQL Server 2005 and higher CLR integration, I think that executing NATT assembly inside a stored procedure [or any database objects] should not be a big deal, can you tell me some references where I have an example Or can this article be applied? Thank you very much for your help. I really think this is an inappropriate use of SQL CLR. CLR integration aims to create complex data types and operations Is to support that which is normally difficult to do in pure SQL (such as sequence, regular expression, hierarchy, geospatial, etc.) to not implement a domain model in your database. Domain models and business logic are different from the r

php - getElementById().value returns nothing -

& lt; td id = "'। $ पंक्ति [' आईडी ']।' 'शैली =" प्रदर्शन: कोई नहीं; "& gt; & Lt; इनपुट आईडी = "एडएडिट" प्रकार = "टेक्स्ट" मान = "" आकार = "4" / ​​& gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; input name = "add" value = "ए" प्रकार = "जमा करें" onClick = "addObs ('। $ पंक्ति [' आईडी ']।'); वापसी झूठी;" / & gt; & Lt; / टीडी & gt; । फ़ंक्शन addObs (id) {var addEditTD = document.getElementById (id); अगर (addEditTD! = Null & amp; addEditTD.style.display == 'कोई नहीं') {addEditTD.style.display = ''; } अगर (addEditTD.style.display == '' & amp; amp; दस्तावेज़.getElementById ('addEdit')। मूल्य! = "") {// कुछ कोड चेतावनी (document.getElementById ('addEdit')। मान); }} मुझे 'addEdit' इनपुट पाठ से कोई मान नहीं मिला, मुझे नहीं पता कि, क्यों, pl

php - I can't use imagecopyresized -

There is a problem with my work when I upload an image to the local host, everything works fine, and A thumbnail is created, but when I upload my website on hosting, then imagecopyresized just fails when I insert it into an empty page, that function (the full resizing function ), It works fine. What could be the problem? Actually, when the upload function attempts to upload the file then the GD functions do not work. If your script is blank (not okay and bound) page, then the problem is definitely the CMS you use Are going. It can be used by you or even on certain specifications of your website.

SQL Cursor value in single group -

I am using a SQL cursor. I want to select values ​​ Example: - while (@@ fetchstatus == 0) BEGIN (Choose Condom) rownumber, rowname to table end Answer: - When I am getting value during the first phase of the loop execution. 1, "first" (from the row selection) Next 2, "second line" The output is displayed as individual rows. Is it possible to combine and display as two outputs in this way 1, "firsta" 2, "second line" If you really need a loop on the cursor, it can be useful: - Create Temptable select top 0 rownumber, #temp table-loop from roverame while through your cursor (@@ fetchstatus == 0) BEGIN If start (cnd) start at #temp, select rowname from the table end Select END from rownumber, #temp drop #temp from rowname

PHP with Zend Framework can't start a SQLite database? -

Trying to get a simple PHP / Zend Framework setup to create and manipulate a SQLite databse. & lt ;? Php require_once ("Zend / Db.php"); // Zend Framework $ db = Zend_Db :: Factory ('Pdo_Sqlite', array ("dbname" = & gt; "./test.sqlite3")); $ Sql ​​= "If the table does not exist then" create tab ". $ Db- & quot; quoteIdentifier (" configs ")." (". $ Db-> quoteIdentifier (" name ")." Text tap primary key, "$ db -> Quotation marker (" value ")." Text not faucet); "; $ sql; $ per second DB-> Query ($ SQL); In the form of SQL "Exchange does not make" the configuration when creating "(" name "text null is not the primary key) , Tap "value" text); ", which looks correct. But I get ' Zend_Db_Statement_Exception ' with the 'SQLSTATE [HY000]' message: General Error: 14 Open the database file I h

Is there an html command to bypass an html filter? -

I am trying to add an html link to a website but the website exits html: When I look at the source, I get it: and I really want this to happen: & lt; A href = "www.soandso.com" & gt; Www.soandso.com & lt; / A & gt; Is there a html command to bypass filters? Almost certainly not. Most sites do not exactly do that injecting arbitrary HTML to users. This is the source of XSS (cross-site scripting) vulnerabilities. If the site strips (or migration) tag, then just enter it in www.example.com and have to do it.

jQuery, PHP deleting of directory does not work -

I'm trying to delete directories using jquery, it's 1A.P.P. But deletes and stays, which implements the code executes. What I need to do is delete a directory without refreshing the page refresh, and the directory has been removed to display a display. Please tell me what I am doing wrong here. Thanks advance Dave Please find the code given below ----------------------- -------- --- 1a.php if ($ _POST ['al_del']) {$ dir = $ _POST ['al_del']; // preg_replace ('/ (\ d +) /', '', $ _POST ['al_del']); Rmdir ('$ dir_path /'. Dir); Echo 'deleted the album'; } // /-----------------------------------1.php where directories are listed & lt; Script & gt; $ ('# Album_del_form'). AjaxForm ({target: '# diaper_', success: function () {$ ('# dir_del'). FadeOut (40000);}}); & Lt; / Script & gt; & Lt; Div style = "position: relative; top: 20px; left: 0px; background color: #bbbbb;

Qt dependencies between projects -

I have many projects that are loaded together in QtCreator and are not grouped under a unique project. I need to make dependencies between these modules and not only the telegeteds considered, which only checks if the library is present in the library. Dependency I request, in practice, it should emulate the action of the user in Qtcore to check the dependency list "Edit Project Settings" at the bottom of the page. Therefore, if a module is from another module, qtcreator depends on the first qmake / make / etc. How can I do the second one? Thanks daniele Because I use the scans for large multi-projects I'm having a Q-MAC sub-display, for whom you are searching for: There is a detailed explanation of how to use it here:

tsql - T-SQL View to select FULL OUTER JOIN and add additional rows on "A" based on "B" table -

I hope someone can help me. I need to solve the problem with a sequence, based on the following scenario. I have two tables: language and ReportDescription Pre> ID Tag Description ---- ---- ---------------- 1 en English 2D German 3 French 4 This Italian Report Statement LanguageEnd report ID details ---------- ------ ----- - ------------------ 1 Committee (Engineering) 2 1 Committee (German) 3 1 Committee (French) 4 1 Committee (ITA) 1 2 Appointment (Engineering) < / Code> Result I want this to happen: Language Indic Port ID Details ----- ----- ----------- ------------------- 1 Committee of 1 (Engineering ) 2 1 Committee (German) 3 1 Committee (French) 4 1 Committee (ITA) 1 2 Appointment (Engineering) 2 2 Appointment (Engineering) 3 2 Appointment (Engineering) 4 2 Any help would be greatly appreciated. If you have a specific report that is not available in a particular language, then this query will: Details as SELECT rd.LanguageId, rd.Rep

sql - Is there any difference between these two SELECT statements? -

One of my friends told me about Statement 2 , but in this way I have not yet been able to < Strong> Statement 1 . Is there any difference between these two SELECT statements? If so, what is it? Description 1: Selection 1 to Table 1; Select Details 2: Select Table1. Call 1 from Table1; There is no difference at all But when you have: Select Table 1 Table 1 from INNER to Table 2 ON (Table1.id = Table2.ref_id); The second statement is probably a better idea because it will remove any ambiguity for the Col1. In that case the call can be a field in Table 1 or Table 2. In fact if there is a field named "Call 1" in Table 2, then you have to use the second statement.

java - JMS interfaces and implementations -

The JMS API declares many common and solid interfaces (e.g., connection versus Qi connection). It is documented that the best practice is to use normal interfaces (eg session and queue session). If my application is using both queues and topics and I am going normal, then this is: connection -> session -> subject / line, and support of all JMS implementations (TBK, Weblog, WebSpace etc ...) Do I think that using normal institutions will work for both types of out-of-the-box (queue and subject)? To emphasize my point: Can I assume that all applicants apply Javascript? Can the connection interface work in both common types of cases? thanks, boy Java.jmx.Connection not optional in JMS 1.1 specification , So a valid implementation should be done. Most optional accessories in JM are listed in Chapter 8 "JMS Application Server Utilities". A notable issue is that according to the connection device for exception list is optional. I think the main point here

hash - Pseudorandom seed methodology for lookup tables -

Can somebody recommend a good way of assuming the global seed, e.g. "Hello World" and use that value to see values ​​in arrays or tables. I'm thinking that like the classic spacingfireing game "Elite" where there were different characteristics for the planets but they were not random, just get from the seed value for the universe. I was thinking of MD5 at input value and then using bytes from hash, had cast it into an integer and changed them to acceptable indexes for lookup tables, but I doubt Is that a better way to be? I've read something about Merson Toowaster, but maybe it will end. I'm expecting something that will break good values ​​in my lookup tables. Like red, orange, yellow, green, blue, purple, I also do not see random values, but every time I see constant values. Update: Probably being difficult to express my own problem domain here is an example of a site that uses generators and can generate X numbers: Additional criter

vb6 - MSN messenger type popup notification using classic visual basic 6.0 -

How to make MSN messenger type popup notice using Classic Visual Basic 6.0 I just found an excellent source code for the above requirement. Here is the link vbforums.com/showthread.php?t=320639 is Care -

wpf - Grouping and sorting for TreeView in xaml -

I'm having trouble grouping my head and sorting in janabhabe and hopefully someone can get me straight out ! I have created an XML file from a tree of files and folders (just like the windows explorer) which can be several levels deep I've bound a TreeView control on an XMLView data source and it's pretty good Works! It does everything alphabetically ... but I would like to sort it all the folders first, instead of the folders listed with the files, as it is now. xml: If you load it in a tree, it will display the first two files of the folder because they are in alpha order first. Here's my code: & lt;! - Will contain XML-data - - & gt; & Lt; XmlDataProvider x: key = "xmlDP" XPath = "*" & gt; & Lt; X: XData & gt; & Lt; Select_Project / & gt; & Lt; / X: XData & gt; & Lt; / XmlDataProvider & gt; & Lt ;! - This hierarchical data plate is all XML-nodes - & gt; & Lt; Hierarchical d

.net - c# Creatchildcontrols / RenderContents -

I'm trying to get a C # server control that I do not already have to make hair controls Used, but also rendercontents At the moment, my control uses the render content method to do some work and replaces XML using xslt. It works very well, yet I want to add some text box controls after this change. When I do this, the textbox controls do not show up in my server control and only the changes happen. I snatched my code for inclusion in two methods and the control was visible only with the rule of making, but as soon as I use the render content method, it overwrites the control and they disappear. Can someone advise me how should I do this? Foolish question, but do you remember that your render contents method is call basis. Restore? (Or render children, whatever ...)

C++ strcpy non-constant expression as array bound -

I came back to C ++ after a long time in C #, PHP and other stuff and I have some strange things : temp.name = new char [strlen (name) + strlen (r.name) + 1]; this compiled temp.name = (char *) malloc (size (four [strlen (name) + strlen (r.name) + 1 ])); it is not (temp.name is a char *) compiler error error C2540: non-array bindings Constant expression in form Do anyone know what the problem can be and how it can be treated? Thank you size (...) expects a continuous compilation- time expression. strlen is not a compile-time expression, it is a function that needs to be executed to get results. Therefore, the compiler is not able to reserve enough storage for the declared array as follows: Four C [Stellen ("Hello")]; Although the length of the string is clearly 5, the compiler does not know. To prevent this from getting worse, sizeof here. Instead: four * c = (four *) molk (strangle (name) + strannel +1); This gives you an ind

Is Java case-sensitive? -

I have read somewhere that Java is case-sensitive, I am unable to confirm it. Is this? If so, why? itemprop = "text"> I have read somewhere that Java is case-sensitive and I am unable to confirm it. The Java source code is case sensitive, if you mean that double is not same as double , and you have two Different and different variables can be myData and mydata . What is this? If so, why? The case sensitivity is ideal in most programming languages ​​and environments, because lower and upper case letters are represented separately at lower levels. For a computer, "A" and "A" two are completely different things, and it takes extra work to do the work as if they are the same. In addition to this, there are special rules very difficult to cover some languages, e.g. There is no uppercase version of German letter ß and is usually upper for "SS" - so should "VIS" and "VIS" be considered syntactically simi

java - How to diagnose File.delete() returning false / find unclosed streams? -

I am working with a 3rd party JPEG / EXIF ​​Manipulation Library () which is causing me some headache To do this, I want to change the EXIF ​​data of an image To do this, I have to write the updated version in a temporary file, delete the original and then name the temporary file in the original name. My problem is that File.delete () calls fail and returns false , probably because the library has opened it in some way But I have done all this in the API which can get it to stop all the currents. Worse: The problem is time-dependent, and unit testing where sometimes it fails and sometimes does not happen - but the code is not multithreaded. Oddly, a library call that removes the problem - but it also removes the EXIF ​​thumbnail, which I do not really want and seeing the code, I can not see at all that any Can stop the stream which can open otherwise. How does any idea attack this problem? Edit: This is on Windows XP, Java 6. And the second thing: I have come to know t

Google App Engine (python) authorization web services /third party client -

I have a Google app engine project and I want to make my remaining API available to third parties. Like Twitter API The Twitter user and password are being sent so that they can be authorized - can I do this with a Google user account? I have read somewhere on this site, this is not a preferred method because their credentials have been entered in third party ap / pass etc. I do not want to confuse a googles themselves login / captcha and so on. I have implemented it - it can not work with desktop / phone / widgets as well. There is a solution to the third party apps to call my service - the app calls a page on my site (which asks for logging - I just add login rights) then the user logs in And my app then creates a long token that is then sent back to the third party app, which then stores it in its own store and gives it as a token ARG post / put / delete requests Let my rest service then check against the token and lookup (token | the user key) pairs, and the method deni

logging incoming traffic from google Sponsored Links clicks -

A client asked me to write a script which added Google to reach the HT site (sponsored link) ). To track the idea: 1. Users' IP 2. What they added, what they added 3. What important words were given in Google search, resulting in that page being moved to the page displayed in it I will try in that php, is there any "tool" in my disposal (objects, constants, etc.), which can be used to fulfill it? Do you know that Google Analytics can be configured to track AdWords clicks? Edit: In your site Google Analytics To display the data: (Check Data Export API) To track visitor IP address:

How to make instance variables private in Ruby? -

Is there a way to create example variables in "Ruby" private (C ++ or Java definition)? In other words, I want to follow the code as a result of an error. class base def start () @ x = 10 end and received by class & lt; Base Def X @ X = 20 End and D = Detached.New Most of the things Like Ruby, the example variables are not actually "private" and can be accessed by any person with d.instance_variable_get: @x . Unlike Java / C ++, however, example variables are always private in Ruby, they are never part of the public API, as are the methods, because they are only those verbose Can be accessed with the guitar. So if there is any discretion in your API, then you do not have to worry about anyone who misuses your frequency variable, because they will use methods instead. (Of course, if someone wants to go wild and wants to use personal methods or example variables, there is no way to stop them.) The only concern is that if someone accidentally &

android - Force Screen On -

How can I force the screen to remain active and not be closed when my app is turned on? Please do not use a wake lock It is required that you have an additional permission from your app, and it is very easy to present bugs, where you suddenly stay awake and leave the screen on it. This window is far better to use the flag, FLAG_KEEP_SCREEN_ON , which you can do in your onCreate () Can enable: @Override Protected on Zero (Bundle Extractor) {super.onCreate (icicle); . GetWindow () addFlags (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } This will ensure that the screen remains in the foreground of your window only, and only as long as it is in the foreground, it makes this case of general use very simple, any joke There is a need to destroy what you want to do in the form of your app transition between the states.

java - Separate webapps in Jetty on different ports -

मुझे निम्नलिखित सेटअप की आवश्यकता है। जेटी को 8080 < / Strong> और 9090 प्रत्येक बंदरगाह में अपने स्वयं के अलग अनुप्रयोग (यानी webapp1 ) को 8080 और वेबपॉप 2 पर 9090 )। वेब-ऐप्स को अपने नामित बंदरगाहों पर पहुंच योग्य होना चाहिए (यानी webapp2 पोर्ट 8080 पर उपलब्ध नहीं होना चाहिए।)। मैंने सफलतापूर्वक अतिरिक्त कनेक्टर्स को आदि / जेटी.एक्सएम में जोड़ दिया है, इसलिए यह अब पोर्ट 8080 और 9 090 का उपयोग करता है। मैंने अतिरिक्त हैंडलर को भी जोड़ा है, इसलिए अब यह कई निर्देशिकाओं से वेबैप उठाती है (Dir1 / webapp1 और dir2 / webapp2)। मेरी समस्या यह है: जेटी हर कनेक्टर को हर हेन्डलर (यानी प्रत्येक बंदरगाह) से मिला सभी वेबपेज को तैनात करता है और इस प्रकार webapp1 और webapp2 दोनों सुलभ हो जाते हैं पोर्ट 8080 और 9090 पर कनेक्टर 1 (पोर्ट 8080 पर सुनता है) और < Strong> कनेक्टर 2 को पोर्ट पर 9090 पर केवल हैंडलर 2 (डायर 2 / वेबएप 2 संभालता है)। क्या यह पूरा करने का कोई तरीका है? पहले दो अलग-अलग सर्वर उदाहरण कॉन्फ़िगर करता है, और उन्हें कमा

c# - Tweaking my search functionality -

I have tested the functionality of searching on a live website. I came to some minor issues I used special characters in the search box Can not keep or my application crash I tried to solve it, using something using it to be replaced on crashed letters, but it will not cure pain when I put this sign: * I found the following error in the search box: < P> '& lt; %%> echo; ':' 'or'? ' Wildcardy is not allowed in the form of first character. I was stripped of empty space before and after all this error. Then the error was gone, however, when I change it: * with it: "" I will get the error described above. Is there any standard way with which I can solve the special character issue? I'll write some of my code here, so I can get a better response. Analyst Analyzer = New Standard Analyst (); QueryParser qpContent = New Query Parser (Index.ContentFieldName, Analyzer); Keyword.Trim (); Keyword = keyword Place ("*", "&qu