Posts

Showing posts from January, 2010

objective c - Snap to grid effect with Quartz 2d? iphone dev -

Still trying on an iphone dev starter. I want the user to see the screen on the screen, which indicates that the pin will be placed on the scene. I have fulfilled it (yes), but I want to catch hold effect, and can not come with the solution. It is such that I am keeping that dot: CGPETE Drepount = CP pointmack (lastTouch.x - horizontal offset, last RTO-> vertical offset); [Dryage drawpoint: dropout]; // Tell the image to attract yourself I have a grid in the background as a view controller, overlapping that grid I have a custom diagram with one UIView is the screen that touches the user every time. (And for some reasons the user already appears before touching the user ... although this is another query that I am currently seeing) then grid Snap in effect. any idea? Assume that your method faucets the user, and then the nearest grid intersection of the pin, this basic form There is only one spherical problem. // The constant value / kVGridOffset, kHGridOffs...

Mono: MONO_THEME has no effect under Ubuntu? -

I'm not entirely sure whether mono_thEM has to do anything for WinForms applications running under Ubuntu, but I It was an impression that I should be able to see the Gnome by using it. I can not get it to do this. Here's what I have tried: Export MONO_THEME = Visualstyle Mono MyApp.exe Export MONO_THEME = Clear View Mono MyApp.exe Export MONO_THEME = Good Mono MyApp.exe But there was absolutely no effect on the appearance of my application. I can apply for the first time in my phone. Enable enable gynecological style (). How do I enable themes in Ubuntu? They were deleted several years ago because they were not maintained. Is there a place that still presents these documents? If this is somewhere on the mono site, I would like to remove them

PHP - How to replace empty alt tag on image -

वर्तमान छवि दिखती है & lt; img src = "images / example.jpg" / & gt; अब अगर img src में alt = "" नहीं है, तो कोड ही छवि को प्रतिस्थापित करेगा & lt; img src = "चित्र / उदाहरण.जेपीजी" alt = "" / & gt; पीएचपी के साथ कैसे किया जा सकता है? यहाँ एक उदाहरण है सरलएक्सएमएल के साथ ऐसा करने का। & lt;? Php $ html = '& lt; html & gt; & LT; बॉडी & gt; & Lt; img src = "foo.jpg" / & gt; & Lt; / body & gt; & Lt; / html & gt; '; $ Xml = नया सरल एक्सएमलेमेंट ($ html); Foreach ($ xml- & gt; xpath ('// img') $ img के रूप में) {if (! Array_key_exists ('alt', $ img- & gt; विशेषताएँ ())) {$ img- & gt; addAttribute ('alt' , ''); }} Echo $ xml- & gt; asXML (); आउटपुट हो जाएगा: & lt;? Xml संस्करण = "1.0"? & Gt; & LT; html & gt; & LT; बॉडी & gt; & Lt; img src = "foo.jpg"...

ASP.NET: JavaScript object Component for Composite Control -

I have two doubts: 1. I would like to add some server side support for my server's overall control but I can not find the right way to add javascript to it. 2. I have another feature which I would like to do for the customer - Side support is returned through my Javascript component object $ search (id, parent) (shortcut to search the content method of Sys.Application). Can anyone help me? I can not get clear information about this: | Regards, Rodrigo S. Actually, the best article I've seen in the case of beginners

.net - SSIS - Importing variable format text files -

By "variable format" I mean that each line in the text file starts with a single character code, which represents the record type, and 0ThisIsAFileHeader 2IIsABatchHeader 4ThisIsDetailData 4ThisIsDetailData 6ThisIsamatchingBatchFooter 8ThisIsamatchingFileFooter 0/8 header / trailer record (each of their formats), 2/6 sub-headers / sub-trailer records (each of these formats also) and 4 indicates actual data or details records. SQL Server 2008, Visual Studio .NET 2008. Is a custom script work the only way to import this data? Given this, does anyone tell me about the resource that talks about doing so? Importing a fixed-width text file is very straightforward, but I'm not sure when the script will fall into the work control flow and how the data will be used in subsequent steps. It can be done within SSIS, although you will have to jump through some hoops Here's a way: The source file should be set as 2 columns, first character, and the rest of the str...

inotifypropertychanged - PropertyChanged Event, raise when OnClick? -

I have WinForms applications that implement INOTifyPropertyChanged with some business objects and through some controls the PropertyChanged event Hooks; Binding resource on the form that raises an event back on its business object layer ... There is only one problem - everything works well, except that when the control loses focus, for example, User changes some text fields, but before clicking on the 'Save' button, you have to actually click on any other control (as it has to focus on any other control). How to wire some OnClick or something like this is that my business object layer will be changed because the type of user type (or after a drop down value has changed) I do not have to force the user to click before he can save a different text box? Googling has given me examples for example, but for example, how it can easily be done in WPF =. But any WinForms example ... If you are using the binding class to connect the object to UserControl, you can try se...

Java .properties files as strongly typed classes -

Is there a way to get properties as strongly typed sections? I think code generators, but with annotation it will be very cool. What do I mean; foo.properties file keyFoo = valuefoo keyBar = valuebar @properties (file = " Foo.properties ") can be class foo {} class foo {string getKeyFoo () {} string getKeyBar () {}} If I will not start an open source project for that? In addition to the question; We think we have a foo.properties file with more than 10 entries; And it seems that this is used as a simple configuration file. I believe that these configuration entries should be provided in the other parts of the design with the getXXX methods as the configuration class. Then the rest of the system reaches the configuration through the provided class instead of dealing with the major names and there is no need to notice when the configuration comes. Then you can change this class with a duplicate when you are testing the caller and the dependency of th...

salesforce - question about URLs -

Is it possible to have a URL that includes a & amp; Value embedded (such as & amp; firmname = test and firm) and browser not treated & amp; You need urlencode - & quot; Amp; is % 26 : and the formname = test% 26Firm

security - Is it possbile to write files with MySQL via SQL injection? -

Little story short, we found files promoting drugs on our servers that we did not put there. There are very old applications in Windows Server and run MySQL 5.1.11. Beyond other security loopholes, can SQL injection files be used to write to the server file system? I'm sure some of these older applications are weak for SQL injection attacks. I do not think this is possible, but I think remember reading somewhere that MySQL can access "command line" and write files through it, although I can not find a source for that information Then, my mind can play tricks on me. If it is possible, is there a setting that can disable it? In addition, I am not looking for an answer that says that SQL injection gets rid of the vulnerability. Although it is necessary to be done clearly; I'm looking for a quick short-term fix which will prevent the bad files from reappearing, while SQL injection vulnerabilities are being fixed. It is a long time to decide all the old apps Than...

java - Using JavaHelp with a web app -

We have a system where our front end is either in the rich client application or web interface back-up. We are working to add context-sensitive help in our system, but we have to use the same basic configuration files - that means context-sensitive help files should be the same, and preferably the same system should be used in JavaHelp , Which is using XML / XHTML files for its formatting. Does anyone know if it is usable in web-based applications, or should you expect to use only in a rich customer setting? Thank you. JavaHelp can be used in server-based applications, see - Section 5.7 Server based JavaHelp Helpsets (page 112) Text-mail "itemprop =" text "html>

.net - Compiler options for C# project -

Where can I change compiler options for C # projects in Visual Studio 2008 (without command prompt) To compare code and untested IL-code, optimization needs to be stopped. [right click on project] -> properties -> build -> customization code

Converting RGB data into a bitmap in Objective-C++ Cocoa -

I have a buffer of RGB unsigned char which I would like to convert to a bitmap file, does anyone know that how? R [(0,0)], g [(0,0)], b [(0,0)], r [(0, 1)], g [( 0,1)], b [(0,1)], r [(0,2)], g [(0,2)], b [[0,2]]. .... Each data unit has a value of 0 to 255. Anyone have any idea how can I do this conversion? You can use CGBitmapContextCreate to create a bitmap context with your raw data. Then you can create a CGImageRef from the bitmap context and save it. Unfortunately, CGBITMap CONTACT content is a small pickup about the format of data. It does not support 24-bit RGB data Initially, for loop RGB data in RGB, swizzles with zero alpha values ​​at the end. You must include and link with the application services framework. four * rgba = (four *) malloc (width * height * 4); (Int i = 0; i & lt; width * height; ++ i) {RGBA [4 * i] = mayebfur [3 * i]; RGBA [4 * I + 1] = Myobfar [3 * I + 1]; RGBA [4 * I + 2] = Myobfar [3 * I + 2]; RGBA [4 * i + 3] = 0; } CGColorSpaceRef c...

ruby on rails - getting the flash hash to persist through redirects -

My original use case is processing something, set flash [: notice] , and Redirect to a new page that I can tell, the redirect resets the Flash tag (Please correct me if I am wrong) Is there a way to gain persistence? Using the session is not an option, and I've used cookies to hack around the problem, but I think that should be a better way. The Flash Hash remains true for a redirect or render. So you should be ok with the default settings. If you need to keep Flash Hash for another request / Redirect, you can call Flash. Keep .keep Flash. Keep an entire flash hash around for an additional request. Flash.keep (: Notice) # Place Flash [: Notice] for just one additional request.

Memory profiling tool for Delphi? -

I have set up a project and participated it, and seen it in the process explorer, and it has come to know that Using 5x more I would have guessed compared to RAM, just to get started. Now if my program is progressing slowly, then I hook it up to a profiler and tell me that what is the use of all my chakras, is such a tool that I can hook it and tell me this What is the use of all my Ram? The acoutime can also help with it.

How to implement own tag jump in VIM with CTRL-]? -

If: H is used in VIM, it will automatically follow. Link | Through CTRL + ] , open a new help topic and maintain the tag jumps list ( CTRL + T ) Jumps History) How to implement such behavior in my own file format? For example, to open a file named something.txt, type CTRL + ] + ] and CTRL + T How to implement this to return? This is done with all tags, basically the Vim files are simple text files, The file is supported by the file in the same directory called 'tag'. All files contain entries that appear: 'bg' options.txt / * 'bg' * 'bh' options.txt / * 'bh' * 'bin' options.txt / * 'Bin' * 'binary' option. Txt / * 'Binary' * 'Biosk' option. Txt / * 'biosk' * 'Bioski' options.txt / * 'Bioski' * * Each line is a tag entry, is divided into three areas: tag identifier, tag File, and pre-command to search for that tag: Any previous command works; As seen in t...

python - How to avoid excessive parameter passing? -

I am developing a medium-sized program in Python spread in 5 modules. The program accepts command line arguments using OptionParser in the main module. Main.py The use of these options is determined later on in ways that behave in other modules (eg. A.py, b.py). As I give the user the ability to adapt behavior or program, I think I need this user-defined parameter in a method that is called main.py directly, but it is called the second A. Py: import ap = some_command_line_argument_value a.meth1 (p) method in A. Py: meth1 (p): # some code res = meth2 (p) # and some code w / res meth2 (p): do something with #p This excessive passing parameter looks useless and wrong, but I try not to think about a design pattern that can solve this problem. When I had some formal CS education (minor in my BSc during CS), I have come to appreciate only really good coding practices since I started using Python. Please help me become a better programmer! Maybe you should organize your ...

multithreading - Future Protections in Managed Languages and Runtimes -

In the future, will the Runtime provide additional protection against issues related to soft data corruption? Managed runtime, such as Java and .NET CLR, is generally to reduce or eliminate the possibility of many memory corruption worms in native languages ​​like C #. Nonetheless, they are not surprisingly immune to all memory corruption problems, an intermediate hope that a method that confirms its input is no bug, and with a fairly handling exceptions, always an object is valid Will change from state to second, but it is not so. (It is fair to say that this is not using the prevailing programming conventions - object applicants need to avoid the problems I have told.) Consider the following scenarios: The threading collar can share the object with another thread and make a concurrent call on it. If the object does not apply locking, then the field may be corrupted (probably - unless it is notified that the object is thread-protected - to run an exception to runtime, each...

mysql - Split data into two columns using CSS -

What I want to create is the page that gets results from my DB and CSS (like CSS better way) ... line 1 | Line 6 line 2 Line 7 row 3 Line 8 row 4 Line 9 row 5 Line 10 If there are more than 5 rows then the second column should be empty. So if your goal is a list to be wrapped in two columns, then in the CSS There is no standard way. One way that the CSS3 offer (but most browsers are not supported) is the column property, but the bad part about this rule (the last time I checked) is that it should choose the front Forces you want to have multiple columns and you can not specify the idea of ​​"max-column". But the best solution I found is here: But if you just want multiple columns of data, then use the best solution HTML table is .

Is it possible for PHP to follow a URL? -

Is it possible to take a URL, wait for the redirects to go through, and then the URL of the page Get on? $ cr = curl_init ("http://example.com"); Curl_setopt ($ cr, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ cr, CURLOPT_FOLLOWLOCATION, 1); Curl_exec ($ Crores); $ Info = curl_getinfo ($ cr); Echo "url =". $ Info ["url"];

c# - A very basic question about the way GUI integrated with the Logic classes -

Assuming I have a large input form, which represent classes, I can load this input into class instances Need to do this i clearly include this input (some very complex verification) check, obviously the logic level already contains these input validation The question is what am I doing with Gui. Would I just rewrite those beliefs in a very ugly manner in the GUI or in some static methods in the logic level, those methods are used in GUI and the logic level , But still it is making a duplicate of validating itself (firstly Guai admits himself, then logic confirms what it has been sent to) Or just believe me Should i Cover the code that use the logic layer, with an attempt block, and then, if the exception is thrown, inform the user that something is not right (without giving it a chance to know Or should I expose the exception, the way I expose them to the names of parameters, squares and names that they probably will not understand. Or for every error I want A special exc...

Has anyone attempted and succeeded in getting Apple's iPhone PageControl demo to render correctly in Landscape mode? -

I have had many success in programming the iPhone in landscape mode, but I am unable to run Apple PageControl demo Landscape mode And the content rendering correctly Demo AppDelegate uses a classified Visual Control Panel as a controller, which manages a UIScrollView, and creates a set of UIViewControllers for the content of AppDelegate ScrollView, Controller 1 per page. Apart from this, there is a UIPAZ control-object that manages the epidetalate. I can get the demo code to run in landscape mode, but the content always render as if it is in portrait mode, so when the simulator shows that it is always in the device in landscape mode, page control always Is on the edge of the screen. If someone has found the material to rotate properly, then I really appreciate how to do this job. I think this does not work because the scroll is connected to the window, and the window is not It is an autorotate method like a sequence, it seems that if you put a scrollview in a scene and th...

documentation - The difference between "hit enter" and "hit the enter key" -

उन दोनों के बारे में आपकी क्याियत है? माइक्रोसॉफ्ट मैनुअल ऑफ़ स्टाइल तीसरा संस्करण उदाहरण दिखाता है" अपना पासवर्ड टाइप करें, और फिर Enter दबाएं। " अंत में "कुंजी" नहीं, और उन्होंने बोल्ड में प्रमुख नाम रखे। (पी .54) सूर्य के पहले मुझे पढ़ें! शैली गाइड एक ही कहते हैं (p.60-61), लेकिन वे बोल्ड में दर्ज नहीं करते हैं। आईबीएम की 200 9 शैली गाइड सूर्य के समान सम्मेलन है। (पी .144) ऐप्पल की 2008 की शैली गाइड "एन्टर कुंजी" का उपयोग करता है (पी .66)

python - Using SWIG with pointer to function in C struct -

I am trying to write a SWIG wrapper for a C library that points to the pointer to work in its strings Uses. I have no idea how to handle the strings containing function pointers, a simple example is below. test.i: / * test.i * /% module exam% {typedef struct {int (* my_func) (int); } Test_struct; Int add1 (int n) {return n + 1; } Test_struct * init_test () {test_struct * t = (test_struct *) malloc (sizeof (test_struct)); T- & gt; My_func = add1; }%} Typingfile {int (* my_func) (int); } Test_struct; Extern test_struct * init_test (); Sample session: Python 2.6.2 (Release 26-Ash, 19 April, 01:56:41) [GCC 4.3.3] On Linux2 type "help", "copyright", "credit" or "license" for more information & gt; & Gt; & Gt; Import test & gt; & Gt; & Gt; T = test.init_test () & gt; & Gt; & Gt; T & lt; Test.test_struct; & Lt; The type of stroller object of 'test_struct *' at 0xa1cafd0> & Gt;...

Find distance between two cities in Excel using Google Maps API -

I want a table of the following form: point one point B mileage Los Angeles Miami 292100 Palo Alto San Francisco 90 I was hoping to use Google Maps or some other Geogebi API to generate profit based on Dynamically Input Cities. Any ideas about doing this? UPDATE It looks like I can use the GDirections in the getDistance () function. I could write javascript for no difficulty, but how do I include it in Excel? I can put JS in an html file that takes the query string and gives the distance of the route. After that, I could set up Excel to use that connection. Or is it an excessive amount of work? And it has not been done like that before? So, you can have Google's latitude and longitude for each point (in your case , You want any point in those cities) After this you can use the Halssein distance formula: For VBA, I have this function in my library which I have got from somewhere. At first glance, it looks correct and it produces distance in kilometers (j...

What are git's thin packs? -

I have not found much on thin packs, and man page information is secret about this. I know that this slow connection What to do, but what will be the "slow connection"? What are its professional and opposition? When should I use it, when should I not use it? For records, states: create "thin" pack It is possible for to record the items in a deltified form based on the items contained in the pack to reduce network traffic . The achievers are hoping to be present at the end and for those packs they should be included in the pack so that they can be self contained and indexable This will complete the - Thin option: Spend extra chunks to reduce the number of thin transit objects and send it over a slow connection Meaning of being used In this case a "slow" Network "is a connection where you probably want to send at least the data. In , a little more (in reference to the use of GIT GC on the remote side as well as the remote ...

Why must I define a variable outside a javascript function definition? (jQuery / #anchor question) -

I am writing a jQuery function, depending on the details of the current # of the page. I'm using the jQuery URL Parser plugin to get anchor. $ .fn.vtabs = function () {Warning ("Your anchor is" + $. Url.attr ('anchor')); } This code gives me the interval "#nav" (I use #NU in some of my links) I can type "# shipping" in the browser bar in endless time I'll click on this page on URL, which uses different anchors, but this code always gives me "# NAV". I changed my problem to code: var current_anchor = $ .url.attr ('anchor'); $ .fn.vtabs = function () {warnings ("your anchor" + current_changer); } Now it always gives me the correct anchor but why I do not know, and it appears that the variables defined outside of that function are misguided. It seems that some caching may be turned on with that plugin, why not leave the plugin and anchor Just use window.location.hash to get it?

objective c - App modal NSPanel / sheet / dialog + NSThread == window hangs? -

I am in the midst of debugging a very unusual problem, and I was wondering if anyone could be It's going wrong: In an controller class from NIB, I take an NSPanel from the same NIB, and then shows an application on an NSWindow (this code was created by hand in this code): [[NSAPCitration ShareApp] Startup: myPanel modalForWindow: Windows ModemAgget: Automatically Dsecur: @ selector (Shitdidand: Return code: Sndrbinfo :) Sndrbinfo: zero]; [[NSAPC Sharing ShareApp] RunModelForvando: MyPlanel]; Now, when the "finish" button is clicked on that sheet, then some code is run to disable some buttons and to ensure that user input Valid (valid with a remote service) This thread has been removed from a different validator object: // Controller call: [Validate validation credits: Notify credits: @Selector (Validation) on object: ]; // Validate validator objectInfo: (SSL) notify the Selective On Object: (ID) Notification Object {// Builders with Parameters and Notify Infor...

c++ - Visual Studio Debugger can't view arrays after they have been passed to functions -

I have a function like this: My Function (double matrix [4] [4] I am telling it from an external function (the function of the Outer Function Class is a member, if the case happens): > External function () {double [4] [4] x; start (x); // This function wants data in matrix myfunction (x);} I want to debug this projector to the Visual Studio Debugger The problem is that when I look at the locals for external functions, I can see all the elements of the array right, but when I see the locals for myfunction, then I Only see the first line of the array and say that it is a matrix instead of matrix [4] [4] [4] It happens even when I pass only through one dimensional array - passing in matrix [4] Does it So, the debugger recognizes it as a matrix * and only lets me see the first element of the array. Is it possible to fix all the arrays in the debugger? Using vector vectors or matrix variables like "matrix, 4" windows Can be solved by using "4," is...

cocoa - Problem with NSDocument and writeToURL:ofType:error: -

I am working on a document-based application, and I want to use the document package as my file format I am To do this, it seems that the NSDcast method needs to be overridden. I> -writeToURL: ofType: error: . It sometimes works, but under some conditions, for example, this code works: - (BOOL) writeToURL: (NSURL * ) Type of absoluteURL: (NSString *) type name error: (NSError **) outError {NSFileWrapper * wrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers: zero]; [Rapper Adrenal Filipino Content: [Please "Datujing encoding: NSUFF 8 string encoding] work" Favorite Filename: @ "Fobour"]; [Wrapper writeToURL: absoluteURL Option: NSFileWrapperWritingAtomic originalContentsURL: Zero Error: outError]; NSDictionary * Metadata = [object with NSDictionary dictionary: @ "0.1" forKey: @ "version"]; NSURL * mdURL = [NSUr File URL Thath Path: [[Absolute Colonel Path] Stringbapping Path Companent: @ "SiteInfo.Plist"]]; [Metad...

java - Powerbook compiler queries -

I'm thinking of buying an Apple PowerBook 1.5 GHz machine. While my main focus for that machine will be internet, I can do some programming on that machine because this machine will be what I will take to college ... I should have known that there will be a big difference in the context etc. Compilers? Do I have to create a completely different environment for the power PC? To be quite clear, my primary categories include: * Python (I know right outside the Mac box) * PHP / MySQL * HTML / CSS * JavaScript * Java - I I will start learning Java, it is very important. I am related to Mac OS, as far as I am a complete NXB. PS: If it falls in the wrong category, then I apologize. Keep in mind, with the latest release of OS X, 10.6 or Snow Leopard, Apple Power Have pulled the plug on the Mac: 10.6 No PPC runs on the Mac. Depending on your previous support policies, you can expect that Apple will continue to provide security updates and possibly some bug fixes and minor fea...

javascript - How to open print-preview page upon clicking on hyperlink? -

Each browser has a print preview command in their file menu, I want to create a "print" button on the HTML page and click me Clicking to do is it possible to open the print preview page? With it we can print option & lt; A href = "javascript: window.print ()" & gt; Can print & gt; & Lt; / A & gt; But can we open the print-preview page instead of the print option? windows .print () is the only print-related function. However, if you have defined a dedicated CSS-file for print, you can create a page that imitates print-preview using only the print stylesheet and then it's a popup Or open in a new window.

asp.net-mvc ajax query on keypress rather than submit button -

I am using Ajax.BeginForm to update the data on a webpage (as per the code below). Anyway, I can stop backend server pressing every key instead of waiting to kill the submit button In this way, when I type "a", then this query on "a" And will show all the DB results, so if I type "B" then it will filter the list of "now" and so forth ... Current code using the submit button & lt;% (Ajax.BeginForm ("GetPeople", "Contact", New AjaxOptions {UpdateTargetId = "Contact", Loading ElementId = "updating", OnSucces S = "done"})} {%> gt; & lt; fieldet style = "text-align: left:"> legend & gt; contact search & lt; / legend> gt; & gt; & lt; Tr & gt; & lt; td & gt; 1st Name: & lt; / td & gt; & lt; td & gt; & lt; Input style = "width: 300px" type = "text" name = "firstpost" /> Gt; & lt; / ...

javascript - Google Maps API: Trouble with GDirections object literals -

I successfully GDirections to get maps with directions between point A and point B I'm calling. I have specified, however, I can not get some return value. Calculate DistanceFromRoute.js: var map = new GMAP2 (document.getElementById ("map_canvas")); Function initialize () {if (GBrowserIsCompatible ()) {var map = new GMap2 (document.getElementById ("map_canvas")); Map.setUIToDefault (); Var route = new gedication (map); Route.load ("From: 500 Memorial Drive, Cambridge, MA: 4 Yokie Way, Boston, MA 02215 (Fenway Park)"); Var distance = route.gettastan (); $ ("# District") text (distance ['html']). . $ ("# Moar") text (.root.getStatus () code); $ ("# Moar") attached (route.getSummaryHtml ()). }} Mileage. HTML: & lt ;! DOCTYPE html "- // W3C // DTT XHTML 1.0 Strongly //n http: //www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" ...

c - Error in msgrcv: Invalid Arguments -

I am writing a code on a UNIX system in C. I have created a message queue server every time I get a new message I The fork and baby process handles the new customer. The server waits for the new customer here is the code. for (;;) {struct my_msgbuf buf; If (MSGRCV (MScDID, and (BF.M.T.P.), Size (BF), 1, 0) == -1) Peer ("MSGRCV"); If ((pid = fork ()) MSGRCV a msgsz parameter, but it It is not the size of a struct my_msgbuf ; rather, it is the number of bytes in the mtext [] area of ​​the structure. You are not really going to use struct msgbuf , I think it would be normal to define your own with the appropriate place. You have this method, your Buf declaration allocates only 1 byte, and then the code tells the kernel that you have sizeof buf bytes, which you do not. As a result, the code is called to call undefined behavior or UB. This can not be understood by EINVAL , but one must always correct known bugs and retest because UB taints further an...

css - How can I add the "--watch" flag to this TextMate snippet? -

I love TextMate as my editor for everything in the web, and that's why I use it for a style.less Files to basically take advantage of files without compiling CSS files when flying files originally $ Lessc {filepath} --Watch My thanks (which is written some TM bundle!) The current systematic snippet works well to write the currently open file, on the .css file, but I want to take advantage of the - watch parameter so that each change in the file automatically unknowingly has a .css file Compile in This works well when using the terminal command line, so I'm sure it would be possible to use textmile in a customized version of the current low command because only the file is compiled Invites the command to How do I add - watch flag to this command ?? #! / Usr / bin / env ruby ​​file = STDIN.read [/ lessc: ([^ *] + less.) /, 1] || ENV ["TM_FILEPATH"] system ("lessc \" # {file} \ "") I think that should be something like this: ...

iis 7 - PHP Error output - Plesk 9.2 with IIS7 and FastCGI -

How can I see PHP errors that are generated by a Plesk 9.2 website? I currently have a Generic 500 error when I create a test PHP error: 500 - Internal server error is a problem with the resource you are searching for, and It can not be displayed. I have tried to activate error reporting in the failed, plesk global php.ini file: ... \ Plesk \ Extra \ PleskPHP5 \ Phs.ini display_errors = on Plesk 9.2 uses the IIS7 and FastCGI for my best knowledge. Is there any Plesk Wizard out there, which debugging PHP errors on a Plesk website? Thank you! As far as I know. You have to ask the administrator to give you access. In my case he was the best he was about to do, giving me a readable link for it. And he added this line to .htaccess Follow the symlink

html - Compatibility between Browsers in ASPNET -

I am using HTML editor in my website, it is not visible in IE8 and Google Chrome Giving is any other free HTML editor link that will support all browsers. (Also, after clicking on the HTML editor, Ajax is not working for me in that page.) I need any other HTML editor Types of browsers especially Google Chrome will support thanks in advance !!!!! Most browsers support I have also used CKEditor in Chrome. From: Officially, we will announce support for the following browsers: Internet Explorer 6 + Firefox 2 + Safari 3 + Opera 9.5+ The editor can be downloaded from the file after downloading you To find a "sample" -foulder.

perl - Why does SQLite complain about the syntax of my prepared statement? -

I'm having problems in getting a ready statement in sqlite3 for working I work with Perl and Pearl DBD Framework I'm using the code below: # This is a function that I want to sub query ($ @) {my $ st = $ db- & gt; Ready (change) is set; $ St- & gt; Execute (@_); } # And this is used like a lot of queries ("UPDATE rooms SET name = ?, SET capability = = WHERE id =?", $ Name, $ capacity, $ id); When I try, I get the following error: DBD :: SQLite :: db failed to fail: near "SET": syntax error ( 1) Dbdimp.c line 271 database. Pm at line 80. Why do I get that error? If I try without using this prepared statement, then it works, except for my unchanged query, every other prepared statement in my application work Your query is the standard (and Sqlite) syntax UPDATE room set name = ?, capacity =? WHERE id =? Without Repeated SET

Django database scalability -

We have a new dynamic power project that has a potentially heavy-traffic feature (a heavy DB interaction means). Therefore, we have to understand database scalability in advance. With some research, the following questions are still not clear to us: Broadly: How to make a DB table (a diesen model) for a specific DB (probably in any other server) Please, specify? OK: How to specify a group of table rows for a specific DB (so-called sharding, can also do in other db servers)? How to specify and read We are finding solutions with this: To be transparent to the application program ( This means that we do not have to have additional code in the idea) must be in the ORM level (this only means to specify in models.py) Current Compatible with (or future) of the demo release (Keeping the minimum change of the regime for future upgrades For the sector) I will share still am researching and later in the formula that will give me some fruit. Hope that anyone can answer wi...

HTML/JSP visual design mode -

I'm wondering if the Surface Netbeans IDE HTML or JSP (no problem for JSF) support the Visual Design Editor Can or not? itemprop = "text"> There is no visible designer for HTML / jsp there was a long back, But never implemented.

asp.net - Binding entities with foreign key to datalist -

मेरे पास निम्न कोड है: var devices = d से ctx.Devices। शामिल करें ("DeviceGroups") जहां d.eviceEnabled == सही चुनें d; DlTerminals.DataSource = डिवाइस; सामने के अंत में मैं निम्नलिखित करता हूं: & lt; asp: DataList ID = "dlTerminals" runat = "server" DataKeyField = "DeviceId" ग्रिडलाइन = "कोई नहीं" दोहराएं कॉलम = "2" दोहराएं निर्देशन = "क्षैतिज" चौड़ाई = "100%" & gt; & LT; ItemTemplate & gt; & Lt;% # Eval ("DeviceGroups.GroupName")% & gt; & Lt; / ItemTemplate & gt; & Lt; / एएसपी: DataList & gt; लेकिन मुझे निम्न त्रुटि मिलती है: नाम 'GroupName' नाम के साथ एक संपत्ति नहीं है। एक समाधान मिला: नया चुनें {d.DeviceId, d.MAC, d। DeviceType, d.LastConnectTime, d.DeviceGroups.FirstOrDefault ()। GroupName};

cocoa touch - Core Animation performance on iphone -

I am trying to do some animation using the core animation on iPhone. I'm using CABasicAnimation on Caller. It is a straightforward future animation from the random space at the top of the screen which is at the lower speed of the screen, I have 30 elements which do the same action continuously until someone else The action should not happen. But when animation starts, the display on iPhone 3G is very sluggish. The image is only 8k. Is this the right approach? How should I improve this so that it can perform better. // image cached somewhere else CGImageRef imageRef = [[UIImage imageWithContentsOfFile: [[NSBundle main bundle] pathForResource: name ofType: @ "png"]] CGImage]; - (zero) animate: (nstimer *) timer {int startX = round (radom)% 320); Speed ​​of float = 1 / goal (random ()% 100 + 2); CALayer * Layer = [Calair layer]; Layer.name = @ "Layer" layer; cittens = ifrafar; // cached image layer. Frames = cgartactmake (0, 0, cgmjetwidth (imagerof), cgim...

Project on remote drive in VIM -

Is it possible to create a project using the project plugin based on a remote directory (on an FTP server) in VIM? It is not true that there are no internal capabilities in the VIM to open the remote files. The first poster was correct , Was made in later versions of NetWire Vim and it is amazing I use it all the time to edit pages on the website and sometimes via STP Try: : : e I think a Netrc file so that I do not have to type in my user or pass all the time. For man FTP (and .NETRC, say that you are using Vim on Unix and not windows)

winapi - How can I detect if there is a webcam connected to the PC? -

I have a source code to take a picture through the webcam, but I have to know whether the webcam connected to the PC is. If there is no webcam, the program will not call the function to take the photo. If necessary, I have to know that in which case I have to use the API's API. Languages: Visual Basic 6 using Windows API The problem with WIA is that not all devices are compatible. But I found a solution of myself: Work together with SendMessage and capCreateCaptureWindowA. If there is no camera, SendMessage returns a "0" code: mCapHwnd = capCreateCaptureWindowA ("webcaps", 0, 0, 0, m_Width, m_Height, Me.hwnd, 0) DoEvents if SendMessage (mCapHwnd, WM_CAP_CONNECT, 0, 0) & lt; & Gt; 0 Then send a call message (MCA handheld, WMCAPCNATT, 0) Doveentes call send message (MCA handheld, WMCCP_SECPEEfe, 0, 0) LSE MSBBbox "No camera found" and if I hope It is useful that anyone can find :)

html - Is https retained on relative form action URLs? -

Consider a page with a form visited via https if the form action form page has a relative URL , Is the https protocol retained? Ex: You can go to: https://example.com/cart .html containing form tags : & lt; Form name = "form1" method = "post" action = "submitOrder.aspx" id = "form1" & gt; Whether the form submitted through https or http

sql server - Execute stored procedure with an Output parameter? -

I have a stored procedure that I am trying to test. I am trying to test it through SQL Management Studio, to enter this test I enter ... exec my_stored_procedure 'param1value', 'param2value' The last parameter is a output parameter . However, I do not know how to test a stored procedure with output parameters. How do I run an stored procedure with an output parameter? right-click on SQL Server Management Studio (SSMS), Perform the archived operation on the and select In the form of the input parameter SSMS will then generate a code to run the proc in a new query window, and it will execute it for you. You can study the code generated how it is done.

c# - How do I get/set a winforms application's working directory? -

I'm currently using to get the root of the application: path . Get Directional Name (GetExecutingAssembly Assembly) GetName (). CodeBase) .Substring (6) But it seems to me scary to get the root directory of the application and the directory that works Is there a better way to set up? Therefore, you can change the directory using only Envrionment.CurrentDirectory = (the yoga directory). There are several ways to get the original performance director, one way is essentially through the way you described it and through another directory. The gatecontent directory () if you have not changed the directory. using the system; Using System.IO; Classroom test {public static zero main () {try {// Get current directory. String path = directory GetCurrentDirectory (); String target = @ "c: \ temp"; Console.light line ("current directory {0}", is the path); If (! Directory.Exists (target)) {Directory.CreateDirectory (target); } // Change the current directo...

sql - MySQL find authors without posts (one-to-many relationship) -

I have a MySQL problem: I have two tables (posts and authors) from one Many relationships (because each post is written by the author and one writer can write many posts). Then there are tables: Author: id: BIGINT, Name: How do I get all the authors with any post? What I am trying to do is is: Select not from author, where not in (select author; But this is taking ages! There are 300,000 writers and 1,000,000 posts in two tables! Any faster way? Thanks guys See this question: The answer must be the same. / P> Also, make sure that your ID and the Author_ID are indexed.

visual studio 2008 - How can I use SCM on linked files in VS2008 projects? -

पृष्ठभूमि: मैं दृश्य-एसवीएन वी। 1.7 का उपयोग कर रहा हूं वीएस 2008 के साथ .5 मैं एसवीएन के लिए काफी नया हूं। मेरे पास एक समाधान है जो स्रोत फ़ाइलों का उपयोग करता है जिन्हें अन्य समाधान के साथ साझा किया जाएगा। मैंने इन फ़ाइलों को "साझा ", और " ऐड-> मौजूदा आइटम ... -> लिंक के रूप में जोड़ें "का उपयोग करके अपने समाधान में उन्हें जोड़ा गया है। जो VS2008 के संबंध में ठीक काम करता है। लेकिन जब मैं फ़ाइल के संदर्भ मेनू पर "एड टू टू प्रवर्यूशन" मेनू आइटम का उपयोग करके एसवीएन में लिंक्ड फाइलों को जोड़ने का प्रयास करता हूं, तो मुझे एक चेतावनी मिलती है: "... में नहीं जोड़ा गया उपवर्सन क्योंकि यह काम की कॉपी से बाहर है। कृपया दृश्य एसवीएन -> सेट वर्किंग कॉपी रूट मेन्यू का उपयोग कर काम कर कॉपी रूट करें। " मैंने इसे करने की कोशिश की है, लेकिन यह पूरे समाधान की मूल निर्देशिका को बदलता है - नहीं, मैं क्या करना चाहता हूं। Googling और खोज SO इंगित करता है कि मैं कुछ एसवीएन एक्सटर्नल को सेट करना चाहूंगा। मैंने दृश्य-एसवीएन के साथ पहली...

drawing - Cairo test if text overlaps -

Using Cairo, I'm keeping some text in random situations, and I have to know whether they are already ready Overlap the arbitrary shapes that occur. I could clip the path of the previous diagrams, and if there is a clipping, it means that there is overlap. However, there is no work to tell Cairo that clipping or not. Do I have no way to fulfill it easily? I think I just basically want to see if two shapes should be detected or not. To get the quality you want, you get to cairo_stroke_extents , Can work on cairo_fill_extents and cairo_text_extents and border boxes. A better method to calculate only the text box of text and check the four corners against cairo_in_fill or cairo_in_stroke against the final code. The maximum error will be the distance from a single glyph to its bounding box, but perhaps it is enough for your purpose. The last option is to level the text and check any point the previous step.

zend framework - Can (and should?) Zend_Auth return class as the Identity? -

I have a class R00_Model_User, which is eagerly enough, it's the user as it is. Can $ result-> getIdentity () return an object of this class to me? (Or maybe it's stupid?) (R00_Model_User has a factory method that prevents duplicating of objects. I like Zend_Auth to use it instead of creating a new object) two options: Write your own authentication adapter Best match for your scenario class R00_Auth_Adapter extends Zend_Auth_Adapter_ * * {/ ** * Authentication () - by Zend_Auth_Adapter_Interface This defined defining method is called to attempt authentication. Prior to this call, this adapter was already configured with * all required information so that the database could be successfully connected * and try to enter the matching identity provided. * * @thread_and_ath_adapter_expressation is impossible to answer authentication queries * @Return Zend_Auth_Result * / Public Function Authentication () {$ result = parent :: authentic (); If ($ result-> inval...

c# - Delete using 2 tables join and wheres -

मेरे पास 2 टेबल हैं, POST (आईडीपॉस्ट, यूज़र, टेक्स्ट) COMMENT (idcomment , आईडीपॉस्ट, टेक्स्ट) मैं सभी टिप्पणियों को उस पोस्ट के साथ हटाना चाहता हूं, जिसमें "यूजरटेस्ट" जैसे उपयोगकर्ता हैं, COMMENT सी से हटाएं POST पी में जोड़ें पर c.idpost = p.idpost जहां p.user जैसे 'usertest' मैं यह सबसोनिक 3 में कैसे करूँ? मैंने ऐसा कुछ करने की कोशिश की, लेकिन , ऑफ कोर्स, यह काम नहीं करता है, COMMENT.Delete (x = & gt; x.POST.where (y = & gt; y.user == "usertest")); मैं एक सबसोनिक प्रोग्रामर नहीं हूं, लेकिन स्टैक ओवरफ्लो में हटाने के बारे में एक और लेख है। तालिका में सभी रिकॉर्ड: ऐसा लग रहा था कि यह एक अच्छी शुरुआत स्थान हो सकती है, लेकिन यह सिर्फ एक अनुमान है।

.pls with SafariMobile no more works on iPhone OS 3.1.2? -

क्या आप iPhone OS 3.1.2 पर SafariMobile के साथ .pls चला सकते हैं? ex: धन्यवाद थियरी मैंने आपके पास क्या टाइप किया है सफारी में ऊपर और यह काम नहीं करता। मैन्युअल रूप से मैंने विज़िट किया और पाया कि यह एक रीडायरेक्ट करता है इसलिए मैंने सोफ़ायर में somafm.com/startstream=groovesalad.pls टाइप करने की कोशिश की और

sharepoint - MOSS web service to find out if a user has access to a document library -

What box is any motion from the web service that allows us to check that the user has a document library or I have a URL address for the document library. I have the URL for the SharePoint document library, the user name and the password. Thank you. Yes, please, if a user allows "to read" on the document library. If none of the boxes are out of the web service, and we develop our web service, should it be installed on any server where MOSS is dependable? There is nothing obo with MOSS 2007 / WSS 3.0 look for a useful library Which can help you as a starting point or a component in your final solution.

visual studio - Is there any way for a .NET application to read a variable defined at installation time? -

With the Visual Studio setup project, I can ask the user for some input, such as the location of the folder. Any way to install user input, is there any way? The easiest way to do this is to store the value in the registry: Right-click on your setup project and see -> User Interface Install and move it to the right place in order In each of the dialogs, a property property , such as Edit1Property or ButtonProperty Rti name must be a unique value, by default it's EDITA1 as some. Right-click on your setup project and select -> Registry HKCU \ Software \ [creator] or HKCU \ Software \ [creator] depends on whether you want to store this setting only for the current user or Machine wide You can also create a new entry under user / machine hive after which the entry will be stored under HKCU or HKLM, depending on whether the installation is per-user or per-machine. Create a new value under the selected key in 5 In the view of the ...

django - How to use nested template tags with arguments? -

I would like to know how I can use nested template tags where the hair template tag takes an argument below: / P> {% parent_tag {% child_tag ​​arguments%} rest_of_parent_arguments%} In the above row, I return the value of the hair tag as an Arabic Parents' tags would like to use. I will replace child_tag ​​with a custom filter like this: {% parent_tag argument1 | Filnetame: argument2 rest_of_parent_arguments%} Considering "logic" there are mostly 2 arguments. For custom filters see here:

c# - Generate a pdf thumbnail (open source/free) -

Seeing other posts for this could not find enough solutions for my needs. Just trying to get the first page of a PDF document as a thumbnail, it can be run as a server application so that it can not be said to call a third application to write a PDF document that Reads PDF to generate image on disk Doctor = New PDF Document ("Some PDFs"); Page = doctor page (1); Image Image = Page Image; Thanks. Matthew Ephraim released an open source cover Ghostscript which you think does the same way Does and is in C #. The source code for the link: Link to the blog post: You can call GeneratePageThumb method to generate a simple thumbnail (or Use pagepayments generated with start and end page numbers to create thumbnails for multiple different pages, each page with different output files), the default file format is JPEG, but you can change it, and many other options, Optional generator Specify options such as Ut method using the call and file format, page size etc ... ...

Collapse all the tabs in a Accordion on jquery? -

How can I hide all the addendance tabs when I load a page, using the teleic extension for ASP.NET MVC? By default, this page will expand the first Açon tab when it loads! Thanks a lot! Try it: This is all active open pane. $ ('.eadrean'). Adrian ({active: false, openable: true});

ruby on rails - How can I scope acts_as_taggable_on_stereoids by Account? -

If I have my website logically divided into accounts (like acme.mywebsite.com, xyz.mywebsite.com) , How can I apply the act-edge-tag-on-steroid and extract the tags through an existing account? To give a bit more detail, if I'm entering Acme, T xyz wants to see the tag from the subdomain. I have considered work-to-taggable, but the reference is provided only if you want different sections of the tag for the same model. Assume I have understood your question that you have more than one account in your account Tags that can be applied to any model in your application that says that the_work_ass_tagetable should do the following which you want class ApplicationController You can add the following application controller to make the subdomain accessible to all tasks. ActionController :: Base before_filter: getSubdomain def getSubdomain @current_subdomain (Self.request.subdomains [0]) Ends Assuming that you link a tag to a subdomain, how can you create a designat...

How to draw on the entire area of a resized TImage in Delphi? -

I've narrowed down a problem on which I painted in Delphi 2009 at TImage.Canvas The reproducible case has been given: given: a form, a TImage , TLabel and TButton on it . TImage is anchored on all four edges so changing the size of the form will change the size of the TImage . What I want to be able to do is attract me to the maximum area of ​​available Image1 after resizing, in case of my trial, I have the button's OnClick Handler is: Process TForm1.Button1Click (Sender: Tubaxide); Start Label1.Caption: = IntToStr (Image1.Width) + 'x' + IntToStr (Image1.Height); Image1.Canvas.Pen.Color: = 0; Image 1 Canvas. Reference (0,0, Image 1. With, Image 1. Height); End; You will see that if the form is resized, the Image1.Width and .ighted varies in expected form, yet the rectangle drawn The size of the original size is large , it would be incomplete, should only be painted on the area which was previously. How do I use the whole size area? In ...

core data - Displaying count of the value of a to-many relationship in an iPhone app -

I need help with a few things I use core data to do this I have the main table view where the categories are stored I when one of the categories is pressed, another table view is pushed and the contents of that particular categories are displayed. There is one-to-many relationships between category and content I want to display the total number of categories for each of the categories. I manage to do this for a single category by inserting this code after fetchrequest in the content table view controller: NSUserDefaults * defaults = [NSUserDefaults StandardUserDefaults]; NSString * Number String = [NSString stringWithFormat: @ "% i", [contentArray count]]; [Default set object: number string fork: kContentNumber]; And then in the View View Controller, I simply loads the number from NSUserDefault, and it displays in TableView. Of course, the numbers for all the lines of the series have become the same. My challenge is to get a specific number from each content...

how to do a rendertransform on control but not content/children? -

I'm trying to create a specific control without having to shorten my content. I use control. Resourceform, child's content will also be converted. Any ideas?

modem - GPRS communication -

I want to establish communication between GSM / GPRS modem and remote server or PC. How to do it Do we need some applications on the PC which will contact GSM modem? I should process 2 ways I want to interface GSM / GPRS modem with some microprocessor which has some LCD display. Anyone can help me in this. Thank you, Manoj Your question is very beautiful with a GSM modem Communications A GSM modem will connect to the computer using a serial or USB port. You can open the serial port and talk with it. Since you have not specified the platform, I can not suggest how to do this, so how to do it. In C #, you will use the class. You use the standard for different tasks with it. Communication with GPRS modem The GPRS modem associated with the external device will usually be on the Internet. If you know the IP address of the target device, you can use TCP / IP sockets for communication with it. I want to interface GSM / GPRS modem with some microprocessor Not sure wha...

python - getpos() coding -

How to write the getpos () command that should return an existing (X, Y) / P> It starts like this: DEF DPOPO (X100, Y100) definitely do not need help It's a bit underspecified, but it can work : def getpos (self): return (self x .f, sfa) how to back it a tuple , The value of the example is assumed.

javascript - For a Google Wave Gadget, is there a defined point at which it's ok to modify UI? -

I want to keep two gadgets separate from my gadget: when it has just been added, then enter some information to the user To do, and, once he is done with that, another who shows some data based on that information. First of all I can decide on what to do from the two scenes, when I get the state for the first time in the State Call, i.e. when I change the UI there, however, It does not always show - apparently there are some time-related problems involved. Sometimes the UI does not appear at all, sometimes it looks fine, sometimes it appears in front of the animation loading the gadget. Here is a simple test case: & Lt; / ModulePrefs & gt; & Lt; Content type = "html" & gt; & Lt ;! [CDATA [& lt; Script type = "text / javascript" & gt; Function vsform () {document.write (" ");} & lt; / script> & lt; script type =" text / javascript "> function stateUpdated () {createForm ();} Function init () {...

r - How do I best simulate an arbitrary univariate random variate using its probability function? -

आर: एक मनमाना असुरक्षित यादृच्छिक विविधता को अनुकरण करने का सबसे अच्छा तरीका क्या है यदि केवल इसकी संभावना / घनत्व फ़ंक्शन उपलब्ध है? इनवर्स सीडीएफ पद्धति का एक (धीमा) कार्यान्वयन है जब आप केवल घनत्व ही देते हैं। अपने स्वयं के घनत्व के साथ डेन एंड लेफ्टिनो -नोरम # रीप्ले # सीडीएफ को संख्यात्मक एकीकरण से सीडीएफ तक पहुंचाता है; एलसीटी; -फंक्शन (एक्स) एकीकृत (डेन, -इन्फ़, एक्स) [[1]] # इंवेस्टमेंट्स सीडीएफ व्युत्क्रम सीडीएफ और लेफ्टिनेंट; -फंक्शन (एक्स, सीडीएफ, शुरूआकारमूल्य = 0) {लोअरफ़ाउंड & lt; -FALSE निचला & lt; -प्रारंभ करना.मूल्य जबकि (! लोअर। फ़ाउंड) {if (सीडीएफ (निचला) & gt; = (x-.000001 )) कम और लेफ्टिनेंट; -लूर- (निम्न-शुरुआत.व्यू) ^ 2-1 और निचला। फ़ाउंड एंड लेफ्टिनेंट; -आरआरईई} ऊपरी.फ़ीन्ड & lt; -FALSE ऊपरी & lt; -प्रारंभ करना.गुणित जबकि (ऊपरी.फ़ाउंड) {if (cdf ( ऊपरी) & lt; = (x + .000001)) ऊपरी & lt; -upper + (ऊपरी-शुरुआत.विशेषतः) ^ 2 + 1 और ऊपरी। फल & lt; -TRUE} uniroot (फ़ंक्शन (y) cdf (y) -x, c (lower , ऊपरी)) $ रूट} # जनरेट करता ह...