Posts

Showing posts from April, 2015

asp.net - Change default value of EnableViewState -

I know that with other properties you can define their default value by using the skins. But for some reasons they will not let me do this for competentwoststats. I do not want anything to set EnableViewState = "false", I just want to default to them wrong, if I enable them manually by going through them I want to You can. The cleaner's solution is better. I'm hoping to be shy by running some horsework function in pageload which disables all the scenes because this recursive nature can be expensive and in my head it's useless Feels. It is not possible with the current version of asp.net, but the new one which fixes me like this Remember from Here's a link:

c# - How do I figure out which items' selected state was changed in a DataGridView? -

I have a DataGridView that has multiple selections turned on. When the selective playful event is removed, then I want to know which item was selected for new item and which items were selected new. For example, if you have multiple items selected (by Ctrl-clicking) and then you release the Ctrl key and select an item, then I want to know which items were not selected I have Could track the collection of selected items, but I wanted to make sure that I was not thinking very hard. Event does not tell you exactly what's changed If you need to know for some reason You have to keep track of the previous selection. What are you trying to do in response to this incident? There can be a very easy way to accomplish your real goal.

tsql - T-SQL - How to write query to get records that match ALL records in a many to many join -

(I do not think I have given this question correctly - but I do not know how to describe it ) This is what I am trying to do: Assuming that I have a person table with a PersonID field and I say that a person has many The groups can be related to the groups, so the group has a group table and group membership table with field, which is two Likaon and group membership tables are being added between a many-to-many, one PersonID field and a Smuhaidi field. So far, it is very easy for many people to join. Looking at a list of groupings, I would like to be able to write a query that gives to all the people involved in those groups (none of those groups). And any number of queries should be able to handle group edits. I would like to avoid dynamic SQL. Is there any easy way to do this that I remember? Thanks, blank select person_id, count (*) from group membership in group_id ([ Your Edit <>:

Correct way to write console applications on GNU/Linux with C++ -

I really like the console and recently used in conjunction with the C programming language, it is used primarily on programming console applications using nCurses. Unfortunately I think the ncurses API is totally vigorous and very difficult to use, and C + bindings are inappropriate. So my question is, the API to use for C ++ console applications? Maybe you want better?

dynamic - ASP Menu driving me insane -

I am trying to create a menu using ASP (I have not used ASP before, PHP man has made) a database. Basically I want the HTML layout to be as follows: & lt; Ul & gt; & Lt; Li & gt; & Lt; Ul class = "sub-menu" & gt; & Lt; Li class = "sub-menu-li" & gt; Test & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; I have root menu items around ("AD_Level") which is equal to 0 for root objects, so that inside the loop, there is nothing like the same parent ID that surrounds Side loop loop is needed if the current record is AD_Level = 0 and AD_Parent = 5 then loop around all objects with AD_Parent 5 and AD_Level! = 0 and html in the values ​​and so on and so on. Please help! I am struggling with a new language and can not see one way to do this without losing consciousness. Edit (Comment by OP Exclude rsAdmin.eof base structures = rsAdmin ("ad_parent" if rsAdm

sessionid - What is the best way to generate unique session IDs? -

I want to generate a 16 character alphanumeric session ID string. What is the best way to do this so that it is guaranteed that the strings generated each time will be unique? Note: I am using C ++ to create session IDs. Usually you use whatever language / OS services you provide such a service. Normally available GUIDs are 16 byte long, which will be 32 characters in hex representation. You can convert it to symbolic words and make it slightly smaller (22 characters or so). Are you really ok 16 characters ? Required

Ruby Quiz for Python -

Is there a blog / forum / lists that are equivalent to RubyQuiz.com for Python language? How about? This is not a weekly challenge, a set set of challenges is difficult but it is not fun and educational - a great way to learn at least dragon and solve fun puzzles. Try to deceive yourself without them!

C++ can native type char hold End of File character? -

शीर्षक बहुत आत्म व्याख्यात्मक है। char c = std :: cin.peek (); / Div> संक्षिप्त उत्तर: नहीं char के बजाय int का उपयोग करें। < / P> थोड़ा लंबा उत्तर: नहीं। यदि आप एक फंक्शन से ईओएफ या तो एक चरित्र या मूल्य प्राप्त कर सकते हैं, जैसे कि सी getchar और C ++ के झांकना , स्पष्ट रूप से एक सामान्य char वेरिएबल दोनों वैध वर्ण और मूल्य EOF को पकड़ने के लिए पर्याप्त नहीं होगा। अब भी उत्तर: यह निर्भर करता है, लेकिन यह कभी भी काम नहीं करेगा जैसा कि आप उम्मीद कर सकते हैं। सी और सी ++ में तीन वर्ण प्रकार हैं ("व्यापक" प्रकारों को छोड़कर): char , हस्ताक्षरित वर्ण और अहस्ताक्षरित चार ईओएफ एक नकारात्मक पूर्णांक है, आम तौर पर -1, तो आप स्पष्ट रूप से इसे एक अहस्ताक्षरित चार में या एक सादे चार में संसाधित नहीं किया जा सकता जो कि अहस्ताक्षरित नहीं है। यह मानते हुए कि आपका सिस्टम 8-बिट वर्ण (जो लगभग सभी करता है) का उपयोग करता है, EOF को 255 में (दशमलव) रूपांतरित किया जाएगा, और आपका प्रोग्राम काम नहीं करेगा। लेकिन यदि आपका चार प्र

c++ - reasons for choosing com -

I was wondering why com should be chosen as its software development "technology" Although my first machine / programming _language independence what's yours? com is the standard standard for automation and IPC on Windows (although net starts to move focus There are areas where you have no choice (or was): Shell extension Expand the MS Office Explorer < / Li> Transliteration for JScript, VBSScript, ... with a binary Prior to the Net incident, almost all automation of MS applications was done through COM and quite a few companies were found in that train. In addition to DCOM, if you are ready to confine a reliable and proven technology to distributed components to windows itself.

ruby on rails - Best way to output a tag who's name is dynamically created? -

In my rail application, I'm partly called partly. Partial I want to output a & lt; H1 & gt; , & lt; H2 & gt; , & lt; H3 & gt; ... Depending on the level (definitely cap on level 6) Something like this: ------- & gt; & Lt;% open_h (1)% & gt; & Lt; P & gt; & Lt;% = ...% & gt; & Lt; / P & gt; & Lt;% books.each do | Book | & Gt%; ... & lt;% end% & gt; & Lt;% close_h (1)% & gt; For now, I have cut two tasks together as helpers, but what is the best way to do this really? Post-text "itemprop =" text "> You can do something like # _book.html .rb <% content_tag" h # {Level} "do this> gt; & lt; p & gt; & lt;% = ...% & gt; & lt; / p & gt; & lt;% if level & lt; 6% & gt; & Lt;% = Render: collection = & gt; Books ,: local = & gt; {: Level = & gt; Level + 1} & lt;% end% & gt; & lt;% end% &

java - Maven stuck on old version of system dependency -

My Maven project has a reliance on non-Maven libraries, which is coded as a system dependency: Dependency & Gt;> pre & lt; & Lt; Group & gt; Com.example & lt; / Group & gt; & Lt; ArtifactId & gt; Foo & lt; / ArtifactId> & Lt; Version & gt; $ {Foo.version} & lt; / Edition & gt; & Lt; Scope & gt; System & lt; / Scope & gt; & Lt; SystemPath & gt; $ {Foo.jar} & lt; / SystemPath & gt; & Lt; / Dependencies & gt; Where the location of the library can be controlled through local properties: Recently, the library closed version 2.1.1 on version 2.2.0, so I changed the property to foo.version , but stuck on Maven Older version: ... [Error] Build error [INFO] ------------------------- - ---------------------------------------------- [INFO] Artwork Failed to solve missing: ---------- 1) com.example: foo: jar: 2.1.1 ... I have the mvn dependency Run: Pure-local-repository (many

vim - Make { and } ignore lines containing only whitespace -

When you navigate through parameters using parameters in {and}, they release lines, where white space But there is nothing, though they are otherwise 'empty'. How can I understand Vim for the treatment of "Veerspace Only" lines as a breakdown of the parameters? There is a modified version that handles correctly: Function! Paragraph Mauve (Delta, Visual, Counting) Normal I 'normal | If a: Visual General GV ATIf if a: Count == 0 Enter range = 1 and limit = one: the end of the count is I = 0 while i

web services - Microsoft CRM 4 : What user privileges are needed to access the webservice API? -

I am trying to use Microsoft CRM 4 webservices. However, I receive a 401 unauthorized error for any request sent to me. I am running under my own user account, which has access to CRM. Which user's privileges do I need to gain access? no problem The problem was that organization name On CrmAuthenticationToken must be set correctly, or you will get 401 unauthorized. I made a typo while typing it.

telephonymanager - Retrieve incoming call's phone number in Android -

I would like to retrieve the phone number of the incoming call and would like to do something with it Help because I have not got any information about this where I start and how can I get phononumber? Ok so my code looks like when I call, the custombugspect receiver catches it and the log message is printed. I can retrieve the telephone number from the bundle but! I can not get the hte customphonestate lustner to work as you can see that I have registered my customphonestate listener for receiver, but the log message has never been printed with the customphonestate listener class. What am I missing here? Is my thinking right? & lt; Receiver Android: name = "CustomBroadcastReceiver" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.PHONE_STATE" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; / Application & gt; & Lt; Use-sdk android: minSdkVersion = "5&

file io - appending in C failing, simply overwriting -

Instead of adding "ABC" (and thus finally a file is filled with abcabcabc ....), no matter how many The times I run it, only include myfile "abc" .... How can I add? #include & lt; Stdio.h & gt; #include & lt; String.h & gt; Int main () {char strng [10]; Strcpy (strng, "abc"); File * my_file; My_file = fopen ("myfile", "a +"); If (my_file == NULL) {printf ("problem \ n");} filitt (strng, sizeof (strng), 1, my_file); Printf ("add% s \ n", strng); Fclose (my_file); } except for this fact: (Strang, strang, 1, my_file); should be: filitt (strng, strlen (strng), 1, my_file); This works for me.

Can't seem to change value of text input with jQuery -

If I have a specific function nearby, I want to change the value of a text input with jQuery. I used this code: $ ('# find'). Attr ("value", "newvalue"); But this is not changing it is the markup of the input that I want to change: I know that this code is going to take this pie because it executes and works both sides of jQuery. Any help would be appreciated, thanks. $ ("# find"). Val ("newvalue"); Not sure why your job does not work though. You may also need the name attribute on the input? It is not certain if this is the case ... This can also be done even before the input becomes in what case it wraps in $ (document) .ready (function () {// want to do anything, when you are all of the elements once.}); Or stick to script block after element in your source (this can be a controversial suggestion).

javascript - Should I worry about "window is not defined" JSLint strict mode error? -

This will not pass JSLint in strong mode: "strict use"; (Function (W) {W. Alert (W);} (Window)); Error - From jslint.com - looks like this: Problem in line 4 character 3: 'Window' is not defined. } (window)); Improved Global: Window 4 Do I need to ignore the error of JSLint or am I seriously doing something wrong? Am I Try adding / * jslint browser: correct * / (or check Edit : Now I see, in the documentation: The browser option is not the alias of the global object, Window and manually . So you should add the / * global window: wrong * / by yourself

How small is too small for a project plan? -

I have friends who asked me to make a website and are the smallest, I usually get annoyed with the technical plan I am not, but in particular, a friend clearly had a big goal compared to my own and the project is dragging for ever if I imagined this project before, I think that it does not happen and our relationship Solid as before Gay So my question is how can you tell how small is small? How can you tell that when the project you are starting is ending in a nightmare in a crime-bearded scope? If you are going to charge money (or do not want to stop this project forever) , A project plan is always a good idea, even if it is the only outline of a pager that what will happen on the web site (how many pages, any special features) and who is responsible for it, you should be the factor that you Documentation or non-coding type works on your 20% time (or whatever Experience has taught you), you can give better estimation of the necessary efforts. If this is a friend, then you w

How to do an action when a checkbox is checked with JQuery? -

I want to do one thing when a user checks the checkbox, but I can not get it to work, If I am if ($ ("# home") is going wrong? So basically, a user goes to my page, the box Ticks (": check")) {Warning (''); } What you are looking for is called an event. Provides simple event binding methods like jQuery $ ("# home"). Click (function () {// this function is clicked on #home element (or tab - spacebar has changed) if ($ (this) .is (":" has been checked) // " This "refers to the element that removes the event (warning ('home is checked');}});

Java: When a program is .jar 'ed, it no longer reads the images in the jar file? -

I need to run the computer without exporting the files. For the time being, there are images to store my code: image icon icon = new image ("images \\ images2.gif"); This is not just an image because I am adding it to jlabal. When I issue the entire program, it stores the image file in the jar. When I go to run the real problem, then there is no image. Again, I can not just leave .jar in a folder with images already it has to work on a different computer by itself. System class loader: You want to get through the picture system class loader: < Code> URL url = ClassLoader.getSystemClassLoader (). GetResource ("Pictures / images2.gif"); Icon icon = new image icon (url) image is in the root of the square. Note that the Java runtime will translate into OS specific divider ( / ) ( \ for Windows).

javascript - let jquery know which was the last visited php page? -

This is a bit tricky. Usually when someone clicks the link that requires registration, this person will be redirected to the registration page and will be sent back to the previous visit page. This is the possible reason that the link is registered through the url. PHP, which uses the key to return to the previous visit page. But I want to use jquery ajax for registration basically Ive got 3 different php pages. All of them include the same header.php and there is a registration button in the header.php Iive in which I have an ID tag. When this button is clicked ($ (# registration_button). Click () ... ) Jquery will display a box (a division hidden in the center of the browser), with registration information, it will be registered and I will be taken to the last visit page, which means that at present she sees I can see a registered user To be able to show all the links, the php-page has to be refreshed, so I have to use the window. place. For the question now. How do I know

python - How to create a zip archive of a directory -

How do I create a zip archive of a directory structure in Python? As others have said, you should use. The documentation tells you which tasks are available, but in reality it is not understood how you can zip a complete directory. I think it's easy to explain with some example code: #! / Usr / bin / env python import os import zipfile def zipdir (path, zip): zipfile handle for # ziph root, file in OS valkel (path) for files in: ZIP, files: ziph.write (os. Path.join (root, file)) if __name__ == '__main__': zipf = zipfile.zipfile ('Python.zip', 'w', zipfile.ZIP_DEFLATED) zipdir ('tmp /', zipf) zipf.close ( ) Optimized from:

haskell - Avoiding boilerplate when dealing with many unrelated types -

I am writing code which is related to values, where many types of types are defined that the structure of the Haskell module To mirror: data module l = ... data decl l = ... data exp = t ... ... etc I like to be able to write the tasks that these data structures run and make different changes on them. Because there is no normal data type, I can not write a task that does everything. So far, I have typed a tree that wraps each of these types of my conversion function tree L -> Tree l : Data Tree L = Module T (Module L). DCLT (DCLL) | EXPT (XPL) - Copy & amp; Paste Although I'm now writing a lot of code which takes a module , it wraps it to moduleT , one Function calls, then reopens the result back to the module . I have: class annotated tree ast where tree :: Este L -> gt; Tree L Untry :: Tree L - & gt; Just L Image AnnotatedTree module where tree = module unit (module T x) = X unity _ = error "expected module" - etc. Advertise: <

php - How to implement a personalized event stream? -

I am going to work on an inspiration site for a non-governmental organization, and I have some kind of Facebook- The stream, like "Michael recommended apple pie ", John commented on chocolate cake , " Carmel Fadge Posted 8 hours First by Alice ", etc.. This is the fact that these incidents are based on interest, so anyone should only be interested in caramel and cherry And then you should not see apple pages or chocolate cake, there are many arrangements for this, and to create a user's personal event stream on the fly means some expensive database-queries will mean. I was thinking that there is a connection between receiving the user and an action event is going on when post events doing some kind of background processing (maybe a simple SQL JOIN TABLE). The work required to weight the preferences of hundreds of users against an incident is sufficient, so this post can not be done as a part of the request that triggers the work, So I have to do a

asp.net - how to redirect to default page on logout -

मेरे पास एक मास्टरपेज है जिसमें लॉगिनस्टैटस कंट्रोल & lt; asp: LoginStatus ID = " LoginStatus1 "runat =" सर्वर "लॉगआउटएक्शन =" पुनर्निर्देशन "लॉगआउट पृष्ठ = url =" default.aspx "/ & gt; लॉगआउट पर अब मैं पृष्ठ को default.aspx पर रीडायरेक्ट करना चाहता हूं लेकिन यह काम नहीं कर रहा है मैं हाल ही में लॉगिन नियंत्रण के साथ खेल रहा हूं और मेरे पास क्या है और तुम्हारा है, केवल लॉगआउट पेजरल संपत्ति में "~ /" के बीच अंतर है। तो कोशिश करें; & asp: LoginStatus ID = "LoginStatus1" runat = "server" लॉगआउटएक्शन = "पुनर्निर्देशन" लॉगआउट पृष्ठ = url = "~ / default.aspx" / & gt; आशा है कि यह मदद करता है।

statistics - 1 vs 1 vote: calculate ratings (Flickchart.com) -

Instead of items rated from grades 1 to 10, I would like to versus 1 versus 1 "fight" Items are displayed and you choose the one you like most. Based on these "fight" results, each algorithm should calculate the ratings of an algorithm. You can see this approach that movies have been rated using this approach. It looks like: As you can see, if they win "fight" the items are pushing upwards. Rankings are always " The battle "varies depending on the outcome, but it is not based on the winning quote (54% here) because it is difficult to win against" Titanic "compared to" 25th hour "or more. There are some things that are quite unclear to me: - How is the rating calculated? Which film is set at the first place in the rankings, how do you decide? You have to consider how often the item wins and how well the beaten items are - what is to choose what is "fight"? Of course, you can not tell me that Flickchart

iPhone SDK shake and vibrate -

How can vibrations be used while moving the iPhone? Here's my code: #pragma mark - - (zero) accelerometer: (UIAccelerometer *) Accelerometer did the speed: (UIAcceleration *) acceleration {{if (acceleration.x> KAccelerationThreshold) acceleration .y & gt; KAcalAltration Threshold || Acceleration.exe> KAkcAlertation Threshold) {** // Vibrate it! You can do this: Audio service place system (kSystemSoundID_Vibrate); Be sure to ensure the audio toolbox framework.

regex - Regular expression to verify that string contains { } -

I need to write a regular expression to verify that {} but not {or} in a string. Any light can shine any light Valid: {abc}, as09 {02} dd, {/ p> for example, Sdf), sdjafkl} sdjk, sfdsjakl, 00 {00 } 00, aaaaa {d} invalid: {sdsf, sdfadf}, sdf {Sdfs, 333} 333 ***** **** UPDATE **** ******************************************************************************************************** }) [A-zA-Z0-9_- ?. ] $ is $ for your requirement, thanks for all your help :) /.** {. * \}. * / This ensures that the string has a curved curly bracket that is preceded by a closed curl bracket, string Anywhere in However, it will not be able to ensure that there is only one opening and closing curling bracket - to do this, . * The pattern has to be changed in something more restrictive. If you want to use these regexes and test, then.

string concatenation - Need a Concatenating VBA code to prevent memory issue workaround -

My installation: There are 50,000 lines of data (my line number will increase in the future, so also I have 64000+ Rows have a complete worksheet.) All data is text, no formulas, etc. The data should be included in column A. open column B is I, in which the data in columns one in the column A will be 60,000 digits or 6kb in the file size. After additional manipulation each cell will become a file. I have tried to engage in Excel and I go into memory issues. Memory problem occurs when I select the concatenating function in the worksheet and fill it. It crashes at 8200 +/- line My system is 2 GB RAM, Windows XP Professional and Excel 2003. There is a 4 GB disk space Expect to find the VBA code that will save the memory and will not crash as it is in Excel. Thanks Although this is an unusual use for Excel, suppose that Each combination involves emptying some memory before running the operation memory. It is not that elegant, although you can do 2000 rows, you can copy a

python - Proper way to implement a Direct Connect client in Twisted? -

I am working on writing a Python client for Direct Connect P2P network. Basically, it works by connecting to a central server, and answering the files which other users are searching for. Occasionally, another customer asks us to join them, and they can start downloading a file to us. This is a direct connection to other clients, and does not go away from the central server. What is the best way to handle these connections with other connections? I am currently using a twisted reactor to connect to the server, but is it better that many reactors, each customer is running in a different thread? Or is it a completely different Python script that makes the connection to the client better? If there is any other solution that I do not know about, then I would love to hear it. I'm new to twisted programming, so I'm open to suggestions and other resources. Thank you! Without knowing all the details of the protocol, I still have a reactor - a reactor scale Quite well

php - jQuery AJAX Post not working -

I do not understand why this script does not work. It has something to do within AJAX PostScript / Function. Right now, when I submit my form, it runs php code on the same page. What it should do, send the values ​​of the form for Project_Azax.fp, then there will be a refund of success on the page which is correct or false. $ (document) .ready (function () {$ ('div # didIt'). Hide (); $ ('form [name = adminForm]'). Submit (function () ($ {'.post' ('/ project_ajax.php', {action: $ ('[name = action]') Val (), pId: $ ('[name = pId]'). Val (), name ('[Name = name]'. Val (), url: $ ('[url = url]'). Val (), summary: ('[summary = summary]'). Val ()}, Function (data) {if (data.success) {$ ('div # didIt') .Sliddown ('slow');} and {warning ('unsuccessful SA!');}}, 'Jason'); return false ;});}); What is the code for project_ajax.php below ... if ($ _ POST ['action'] == &quo

iphone - Signer not valid error -

I have created an ad hoc design of my app and want to install it to someone else. My Provisioning profile contains their device ID (actually two). My certificate is similar to ad hoc and app store provision. I certification is valid in keychain. I have selected Ad Hawk profile in Xcode for this build, which The distribution is related to the certificate. I send the provision file and .app file to the user. If they leave and sync both in iTunes, then this error is found on both devices: The application "iPad" was not installed on the iPhone "iPhone" because the signer is not valid. I have removed all profiles from my iPhone, removed the above two files in iTunes, is synchronized and installed the application successfully, I condemn it to me Can not get me to solve this problem. I need to exploit this problem locally. How can I get any ideas? Did you add the entitlement? Sign the target level, not at the project level? Select Ad Hawk Profile? Make a c

Ruby on Rails: Passing argument to singleton -

I have a railway app that repeatedly talks to another web server through a cover, and I want to stick in the cover is a single square, so it has not been created for every request. Quite easy, I thought: class AppWrapper & lt; Cover singleton is included in the end ... Cover = AppWrapper.instance "Url" Only this does not work: Wrong number of arguments (0 1) /usr/lib/ruby/1.8/singleton.rb:94:in`start '/usr/lib/ruby/1.8/singleton.rb: 94: in` new' /usr/lib/ruby/1.8 / Singleton .rb: 94: `example 'in Wrapper.in initialization requires an argument, and apparently it is not being passed, since the question is in line 94 @__ example__ = new # showing, no logic How do I work on it? Start in AppWrapper does not seem to help redefine, and mucking around with the wrapper seems to be different from "starting" to "set url". postproduct = A) @pdf = @pdf end DEF self.instance (P) a put @@ example start = Parameterized_Singleton

c - How to resolve the segmentation fault due to strtok()? -

I'm getting a segment error when the bottom line is executed: result = Stroke (data, delimiter); I have given backtrace: Program received signal SIGSEGV, backtrace from segmentation fault 0x44359e85 / lib / libc.so.6 (gdb) 0444 9 885 from strtok () to /lib/libc.so.6 # 1 0x08048c02 in main () multiply.c on: 36 How to solve it? There are some reasonable possibilities for partitioning. You have a problem: null as data in the first call on strtok () passing zero as the delimiter . Using the read-only string as the data, which is forbidden, because strtok () modifies the source string. I know that you know how to use GDB, so before calling, apply a breakpoint to strtok () and see Which values ​​have been passed to the function. You can also use Valgrind to help you find a specific problem. But, if you want a better answer in stack-overflow, then you have to give some more code and other information.

setting a default apache virtual host -

Is there a better way than setting up the default appetizer virtual host, it only chooses the first configuration? I have servers with multiple domains, some of which are only configured with httpd, but separating the default virtual host is for example aaa.com where i actually know it mmm.com Would like to default on instead? Something like parking domain without having to go through the hassle of setting up a configuration for each one - so can I serve a "content this domain has not been created yet" page? Cheers You can create a default virtual host and assign it to 000-default so that it is loaded and used before any verbosity that matches the requested domain is not available here bare-bones 000-default : & lt; VirtualHost *: 80 & gt; DocumentRoot / var / www & lt; Directory / var / www & gt; AllowOverride Allow all orders, Deny from all & lt; / Directory & gt; & Lt; / VirtualHost & gt; Then you can set up a PHP fil

FDF to PDF using PHP -

I was trying to create a PDF from an FDF file. I have successfully created the FDF file but when I try to convert it to PDF then I get some errors. I am part of my code below. The test.pdf file opens in a download box and when I try to open it I get the error "test.pdf can not be opened because this file type is not supported or is damaged" if ($ fp = fopen ($ fdf_file, 'w' )) {Fwrite ($ fp, $ fdf_data, strlen ($ fdf_data)) ; Echo $ fdf_file, 'Written successfully.'; Header ('content-type: application / pdf'); Header ('content-dispute: attachment; file name = "test.pdf"'); Passastra ("PDFTec Test. PDF BHEL Test Test. FDF Output -"); Go out; } Else {Dead ('U if ($ fp = fopen ( $ Fdf_file, 'w')) {fwrite ($ fp, $ fdf_data, strlen ($ fdf_data)); // echo $ fdf_file; 'written successfully.'; Header ('Content-Type: Application / PDF'); Header ('Content-dispute: attachment; filename = &q

php - Using nl2br and mysql_real_escape_string at same time -

The correct way to use nl2br is as follows. I have post data that has a text field input $ data = $ _POST; $ Escaped_data = array (); Forex currency ($ data as $ key = & gt; $ val) {$ escaped_data [$ key] = mysql_real_escape_string ($ val); } $ Desc = $ escaped_data [description]; $ Desc = nl2br ($ desc); In fact, the correct way to use nl2br () is to use it at all. When you store your data - this is when you read from the database and the client is going to output it. The data should be formatted when the database is installed, what if you want to create a restore service later and you really need those newlines instead of the HTML-element?

c# - When to use memory-mapped files? -

I have an application that receives part of the data on the network, and writes it on disk. Once all the parts are received, they can actually be decoded / recombined in a file that represents it. I am wondering if it is useful to use memory-mapped files - to write the first single section My own feeling is that it is the second case Can anyone find some ideas on this? Edit P: This is a C # app, and I'm just planning a x64 version (hence the 'biggest disputed free space' problem is running in, this The problem should not be relevant) Memory-map file is beneficial for scenarios where large file files A relatively small portion (view) requires frequent access In this scenario, the operating system map Only recently used parts of the file can help to optimize paging behavior by using paging throughout the memory usage and application. In addition, memory-mapped files can expose interesting features such as serving as the basis of copy-on-written or shared-memo

Android stack size -

How can I get the stack size of my Android application (also for the main thread)?

encryption - in php how to find already encrypted file in specific folder -

I am using PGP (GNU Privacy Guard) to encrypt the file. While encrypting, I deleted the '.pgp' extension of the encrypted file. Now how do I know which file is already encrypted in a specific folder? Note: - My goal is to ... do not encrypt any file twice ... then before encrypting any file. I want to see that the file is already encrypted. In PHP, we can find out which file is already encrypted? PGP file all "----- BEGIN PGP message -----" Then you can do something like this: $ content = file_get_contents ($ filename); $ Encrypted = Stropo ($ content, '----- BEGIN PGP message -----') === 0;

iphone - how to display read advertisment in our application? -

I have implemented the demo application. Now I want to show ads in my application. Application.It is working properly.Now I want to add real to my applcation. Which change is necessary? Please give me advice? AD: I am using the AdMob Framework. So please help me For help, see: Feeling very straight forward without further information, nobody will be able to help.

Hurdles with Grails development -

is now evolving with Grails for two weeks, although I love the experience And the possibilities, I have started the following problems. Please share if you have similar issues .. and treatment will also help. AOP is not working with the domain object Grails IDE-Plugins are too old in Transaction Management ( < Li> GWT plugin installation (abnormally unsuccessful) plug-ins are not sufficiently mature. Lack of comprehensive documentation (although what is available is very good) < Li> debugging support If you really want to address these issues then you shouldTo post a different question for each other, with the maximum information you provided here. For example, I probably can not diagnose the cause of this problem when I know that < Blockquote> Transaction Management (In-built) does not work under certain circumstances. I have these opinions on: Transactions Management (in-built) does not work under certain circumstances. I AOP

asp.net mvc - mvc 1.0 doesnt work on IIS6 -

I have a strange problem with my MVC 1.0 application which has been published on IIS6. When I try to surf on pages, there is no way and I do not find any page. I have installed 3.5 SP1 on the webserver and everything is necessary. It seems that there are so many / m what files are missing (?) Did you set up wildcard mapping?

rest - Create request with POST, which response codes 200 or 201 and content -

Suppose I will write a REST service whose intention is to add a new data item to a system. I plan to post http: // myhost / serviceX / someResources Suppose that works, me Which response code should be used? And what content can I return I am looking at the HTTP response code and looking at these possibilities: 200: Return An entity whose result is description or contains action; 201: Which means the created. Meaning * The request has been completed and as a result a new resource is being created, the reply to the newly created resource can be referenced by Uri (s), in which the location header field is the most unique URI for the resource given. The response will include an entity consisting of resource features and location (location) from which user or user agent can choose one of the most suitable. The unit format is specified by the media type given in the content-type header area. The latter looks more with the HPP spec, but I am not quite clear that The re

ASP.NET MVC - Navigation Approach -

I have ASP New to MVC My background is in ASP.NET web form, I think this is causing my confusion. I understand that "M" basically represents the data source, "V" represents the resource that I am requesting and "C" indicates whether the end-user is shown. But then I got confused. For example, I'm just trying to create a login screen. I visit a visitor and they will be presented with a traditional login screen. To accomplish this, I've added the following in the RegisterRoutes method in my Global.asax file: route. MapRoute ("login", "{administrator} / {action}", new {administrator = "account", verb = "login", id = ""}}}); The login process is executed, but this is where I get confused. You see, the login screen is loading for the first time, I just want to show the username / password field. Then on the post, I hope the form is valid and processed. In one attempt to do this, I have made t

build automation - Avoiding re-building prerequisites in Ant -

I have an existing ant project and want to speed up the build process by rescinding the building components that already date. The ant allows you to specify that one goal depends on another, but by default, each predefined item is always recreated, even if it is already up-to-date. (This is an important difference between ant and make. By default, if necessary, only create one goal again - that is, if some is prerequisite.) & lt; Uptodate property = "mytarget.uptodate" & gt; // set.mytarget.uptodate in action ... & lt; / Uptodate & gt; & Lt ;! - Anything else is checked before "unless" is checked. - & gt; & Lt; Goal name = "mytarget" depends = "set.mytarget.uptodate" until no = "mytarget.uptodate" & gt; ... & lt; / Target & gt; To make the need for the re-creation of the ant, there are two general perspectives within the ant. The first method is to set up a property by uptodate aft

C# visual studio - Properties.Settings.Default.SomeValueOrAnother has me baffled -

C # Visual Studio Project: Properties. Settings. Default. Some values ​​or others have amazed me. A relatively simple project with me saves a bunch of values ​​that were last recorded between sessions, and restores them to the next charge. I was working fine, I have changed a control so that the minimum permission The value was 1, but now there was no 100. Last usage value was 3. At startup, it now complains that 3 is not a valid value. OK, two, of course - but listen to the rest. I've edited the settings in VS at default in 500. I've edited the exename.config file to include in 500 instead of 3. I have checked in every possible config file (vshost.exe.config, files bin / debug, bin / release, oz / debug, oz / release. They all have value = 500. I have made it again and again. Just copy one exchange and config file to a different PC, so the development environment was not a factor. I still get this error message. Dev on PC, if I (not directly in the debugger ,) / Ob

c - convert values in string to float array -

I have a string in C that I got from some algorithms. Its format has numeric values ​​ < Pre- 0.100 0.840 0.030 0.460 0.760 -0.090 and so on requires numerical processing to store these numerical values ​​in the float array. New to C and string handling in C should be complicated Can someone tell me how I can apply it Yes. Do all the values ​​in a string, such as "0.100 0.840 0.030 ..." or you have different A bunch of strings, like "0.100", "0.840", "0.030", etc.? If they are in a string, are they different from whitespace (tabs, spaces, newlines) or printing characters (commas, semicolons)? Do you know how much value you have ahead of time (i.e., how big will your float array be)? 123.45 "; four * unchanged; double value; value = strotode (value text, and unbalanced); if (! Uninstaller (* unchanged) & amp; amp; amp; * unbelievable! = 0 ) {/ ** * Input string contains a character which is not valid * In a

c# - Is there a quick way to pull all of the users from Active Directory? -

I am trying to drag the username of every user available through Active Directory. Here is the first code to use my code, but this method pulls out all memory and removes memory exceptions. Is there a quick alternative? Arrayylist as a slow user = string = new altillist like dim split = "LDAP: //test.ca/OU=foo,OU=bar,OU=foobar, DC = Test, DC = Ca "Reduce as the new directory entry" (spath, nothing, nothing, authentication type.) Protect my directory as my directory directory (myDirectory) mySearcher.Filter = ("(objectClass = user)" I) Integer for I = MySearcher.FindAll (). Calculation - 1 user list add (mySearcher.FindAll.Item (i) .propert ("DisplayName"). Item (0)) Next FindAll Every time the call goes back to the LDAP server, it means that every time you go into the loop, you are executing it (and killing the server) above it, in the middle of the data If the data changes, you will probably see some weird bugs (and difficult to diagnos

android - How do I bypass the "Complete Action Using ..." -

I have a question to choose an application program when showing the dialog "use full-action" in Android. will be followed as an example: in my code, I have this statement startActivity (new intent (Intent.ACTION_VIEW, Uri.parse ("http : //www.youtube .com / clock V = 98yl260nMEA "))); Then I will show a dialog box with two options: to complete the action via browser or YouTube Any ideas how I can choose YouTube without showing the dialog Am I box Thank you! Nicholas I think the app that launches you by default More information about filters will be needed (in this case the YouTube app). That goal app can have multiple intention-filters and one of them can be more specific. You can call start with that specific purpose, and then the desired app will be launched directly. However, for this, you need to have more knowledge of the goal app (which is difficult in most cases like the YouTube app). Besides, I do not think you can do a lot from with

video - How can I programmatically extract a preview image - like the first frame - from an FLV file in Java? -

नवीनीकृत: चूंकि मेरा मूल अनुरोध लगभग असंभव प्रतीत होता है, अगला सरल समाधान क्या है? Swftools ऐप को आमंत्रित करें? एफएमपीएपी जीबी को जेएनआई कॉल करें? मूल: यह "" से संबंधित है, लेकिन मैं हूँ से विवश जावा लाइब्रेरी केवल (और कोई जेएनआई कॉल सी कृपया) यह भी ऐप की तरह कंसोल करने के लिए कोई कॉल नहीं है। मैं शुद्ध जावा (या कम से कम जेवीएम) समाधान की तलाश कर रहा हूं। या यदि आप चाहते हैं यह सीधे जावा से करते हैं, आप उपयोग कर सकते हैं यह जावा से एन्कोडिंग और डीकोडिंग वीडियो के लिए एक ओपन सोर्स लाइब्रेरी का उपयोग करता है। जुग्लर एफएफ़एमपीईजी के लिए पर्दे के पीछे जेएनआई का उपयोग करता है, लेकिन जब इसे इस्तेमाल करना आपके लिए बिल्कुल अदृश्य है। हॉप में मदद करता है। कला

java - Can an EJB be called from a desktop application? -

मैं जावा ईजेबी 3.0 में नया हूँ। पाठ "आइटमप्रॉप =" पाठ "> हाँ आप कर सकते हैं कुछ विशेष बातें यहां हैं (संदर्भ EJB2 लेकिन यह ईजेबी 3 के लिए एक ही है जब यह दूरस्थ क्लाइंट पर आता है): पैराफ्रस्त: हॅशटेबल env = new Hashtable (); Env.put ("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); Env.put ("java.naming.provider.url", "jnp: // localhost: 1099"); Env.put ("java.naming.factory.url.pkgs", "org.jboss.naming: org.jnp.interfaces"); संदर्भ सीटीएक्स = नया इनिशियल कंसटेक्स (एन्वी); // नाम JNDI नाम है जिसे आपने इसे ओबैक ओ = सीटीएक्स। लुकअप ("होम नेम") दिया था; ईजेबीहोम ईजबहोम = (ईजेबीहोम) पोर्टेबलरेमोटऑब्जेक्ट.नेरो (ओ, ईजेबीहोम। क्लास); // यह userID होना चाहिए एक पास ईजेबी ईजब = ejbHome.create (..);

Django: Overriding form save? -

Is there a document on this? I could not cure anything. I have a custom ModelForm to create an article, whenever I use this form, I pass in a article example so that I can set myself a writer: article = article (author = req.user) form = example / article from inside How can I use the form inside? .ave () ? Should I know something else while writing this method? Or does it just need to return a article and it's too much? I think the answer I'm looking for is: article = super .ave (commit = false)

design - Help designing database for a twitter web application -

I am trying to create a small website in ASP.NET MVC which uses Twitter. I want to be able to draw some information about twitter users and store it in the database, which I can update from time to time. I am using the following tables: User user_id - Uses Twitter ID (int) twitter_name - Nvarchar (255) last_expected - datetime TwitterData user_id date num_tweets num_favorites num_lists < P> Unfortunately I'm not really good with the database, so is this a good design? Can I use a table instead? Thank you in advance, Sasha If there is a record and Twitter data in user There is a 1-1 relationship between a record, so you can use a table if you were going to other types of data (for example, FacebookData), then you want to keep two tables, But maybe take TwitterDame to TwitterData. Read this for introduction of generalization, which will help you get started in designing a table.

php - AJAX AND JSON within Codeigniter -

I have a website where I want to get some query results through AJAX and JSON, but I do not know at all How to do this, I have this function, public function range () {$ table = $ this-> Uri-> Segment (2); $ Content_id = $ this- & gt; Yuri- & gt; Segment (3); $ Data ['content'] = $ this- & gt; Site_model- & gt; Get_content ($ table, $ content_id); $ This- & gt; Load-> View ('template / right-content', $ data); } The query that is being run is dynamic, how the URL is passing, what I want, the user clicks on some link & lt; A href = "/ category / blog / 1" id = "blog" & gt; Read the blog & lt; / A & gt; With this link, I get the blog and pass it through 1 question, but I have to load the loaded results in my main template and then click on a link every time. The same thing without writing on the previous data is done, does anyone have any idea how to do this? If I understand you correctl

c# - regex negation question -

Does anyone know how to codify a regular expression (for the use of some grep like tools) 'VAT' but exclude the word 'P' VAT e. I have occupied a project in which there are hundreds of references to VAT (some hard coded, nothing) and VAT rates in the UK Changing on 1 January, so I need to update project source file at the right rate . For the time being, when I do a global search for the word 'VAT' in Visual Studio, even then the line returns a line which has a private zero definition. Also, I would like to exclude any line of '15' (search current VAT rate) but I would like to exclude any line before or after '15'. For example, for example, 0.15 or 15 or 15% True, 015 or 150 or 15 A will be false. As you might imagine, there is no trivial task to do this manually, so any help would be greatly appreciated. / P> Thanks, Tim Using Visual Studio ( As I read that you had already done) you can use it: For VAT ~ (pri) vat ~ (e)

svn - How to use Git as content distribution network -

To use GIT as a peer to peer the content distribution network on PATR in book 'GIT Internal' , But there is not much in it detail. Specifically, there are different branches which have tracked different files. Example: (working DIR) a00.exe a01.exe b00.exe c00.exe c01.exe c02.exe The master branch tracks all the files, while the branch is only a .exe and a01.exe, branch B track b00.exe and so on. The next commitment will update a00.exe b00.exe c00.exe. How to make branches in this way? Once all the branches are committed, can I get some branches from remote only? Thanks! You will need some type of script which can create different branches of content for you. The basic way to do this is to add content to the database (in your case, by making them in the master branch), then in the temporary index, reading in all the materials reading in all the branches (read git -Tree / GIT Update- Index), writing that tree (GIT script-tree), writing a committed object (GIT commit

design patterns - What is a Domain Model -

I have read Wikipedia definition of a domain model. I still do not get it. I have been reading several posts for NHibernate And in almost every post, I look at the word domain model. In fact what it is and someone has an example of a domain model. Actually, it is necessary for "model". You were creating a sales tracking website - you are potentially clouded in the cloud, vendors, transactions, etc. Well the relationship between them will be your consensus.

c# - I am trying to send an email from my asp.net web application but the following exception come at SmtpMail.Send(mess); -

रनटाइम अपवाद है: परिवहन सर्वर से कनेक्ट होने में विफल [/ p] कृपया मुझे अपना कोई सुझाव दें जैसा कि मैं अपने पीसी पर काम कर रहा हूं इसलिए मेरे पास कोई मेल सर्वर नहीं है इसलिए मैं अपने इंटरनेट ब्रॉडबैंड प्रदाता ( SmtpMail.SmtpServer = "smtp.virginmedia.com") का नाम रखता हूं; ) क्या यह सही तरीके से? सुनिश्चित करें कि सर्वर आपका कनेक्शन स्वीकार करता है। < / html>

firefox - Why doesn't my expires headers make my files stay in cache? -

I am using valid termination and no-cache headers for my static files and as long as I keep browsing , But when I close my browser and use it after a while, I'm still reloading the fixed file, even Ctrl (+ shift) + R < P> But even if I'm not refreshing with Firefox, the size of the cache size is up to 250MB and I can not get it any Provides passenger or not from the cached data. Header: Accept-Category: Bytes Cache-Control: Max-age = 29030400, Public Content-Length: 142061 Content-type: image / png Date: Tuesday, 08 December 200 9: 18:43 GMT Expiration: Tuesday, 09 November 2010 19:18:43 GMT The last modified: Sun, 18 January 2009 18:33:48 GMT Share this: ASPA2.2.14 (EL) Which version of Firefox? Is the server sending etags for stable files? You can see details about Firefox cache by visiting about: cache and poking around. This will give you an idea about how Firefox is caching. Update: After looking at your header tags, it seems that the maximum-age

php - Kohana - subfolders within views folder -

I'm working on the admin section of a site using Kohana. Built within an "admin" subfolder. I am also using a modified example of the Template Controller for the admin section called Admin Template Controller: Abstract class Admin_Template_Controller Template_Controller {public $ template = 'admin / template'; Public function __ composition () {origin: __ creation (); $ This- & gt; Template = View :: Set_filename ($ this-> Template); $ This- & gt; Template-> Css = 'adminstyles'; $ This- & gt; Template-> Js = 'html5'; }} However, I'm getting an error that the CSS variable is not defined in the "Admin / Template" file. At this point, the template file is similar to a template file in the view folder, which I used to successfully create more intervals, so it is not there. Apart from this, one important fact is that when I use the template file in the footage folder (for front end), this page loads correctly

c# - Understanding Streams and their lifetime (Flush, Dispose, Close) -

Note: I have already read the following two questions: I am coding in C # Almost all code samples, which use currents, dispute (). Flush (),. Close () is almost always called. In the concept of a stream, what is accomplished? If I do not settle a stream which I store in a variable, then should my application be touched somewhere? Why do I need to call any of these tasks? I have seen code samples that do not do and still work (without breaking clear ) I currently In my application, I am creating a class that has a primary method (it is called GetStream () ) which gives a stream through myWebRequest.GetResponse (). GetResponseStream () gives the primary method GetStream () a stream object which can be used for any operation One stream (streamreader, bitmap) is required. To handle manually .getStream () caller What is one way of automatically streaming the stream after your last use (garbage collection?) Without compelling? This? You can probably

javascript - Web Workers and Canvas -

क्या वेब श्रमिकों को कैनवास वस्तु का उपयोग करने की अनुमति है? छोटा अपडेट, क्योंकि प्रश्न अब आधे से अधिक साल पुराना है: क्रोम / क्रोमियम 6 में आप अब कैनवास 'छविडेटा ऑब्जेक्ट भेज सकते हैं एक वेब कर्मचारी, वेब कर्मचारी को ऑब्जेक्ट में परिवर्तन करने दें और फिर इसे putImageData (..) का उपयोग करके इसे वापस कैनवास पर लिखें। Google इसका ऐसा तरीका है, स्रोत -कोड यहां पाया जा सकता है: अपडेट: ओपेरा (10.70) और फ़ायरफ़ॉक्स (4.0 बी 1) के नवीनतम विकास स्नैपशॉट्स भी वेब वर्कर के लिए इमेजेडाटा ऑब्जेक्ट्स का समर्थन करते हैं।

triplestore - Duplicate triple in RDF, authoritative view? -

If triple is twice triple in the store, then what is it (if any) is the official position about this redundancy ? In addition, should one third be allowed to store twice in the same context twice in the same triple? I ask this because in rdflib you can store twice (or more) of the same triple. Rdfib.plugin.get ( 'MySQL', store.Store) ( 'rdfstore') config_string = "host = localhost, password = Foo, user = foo, db = foo" rt = s.open (config_string, create = false) If rt! = Store.VALID_STORE: s.open (config_string, create = true) Graph = rdflib.ConjunctiveGraph (s, identifier = rdflib.URIRef ( "urn: UUID: a19f9b78-cc43-4866-b9a1-4b009fe91f52")) rows = graph. For r in the query ("Select ID value? {Id from value}") for r: print r [0], r [1] and this is the author import rdflib from rdflib import store = rdflib.plugin.get ('mysql', store.store) ('rdfstore') Config_string = "host = localhost, password = foo, user

parsing items by line and comma php -

I have a text on the page that will type items by user lines and commas. For example, there are 2 items per line Data 1, Data 1 Info Data 2, Data2 Info Data 3, Data 3 Info < / P> thnx $ x = 'data1, data 1 input data 2, Data 2 Info Data 3, Data 3 Info '; Foreign (explosion ("\ n", $ x) as $ line) {$ item = explosion (",", $ line); // resonant $ item [0]. $ Item [1]; }

how to deal with error return in c -

How does one function with error returning of a routine in C if the function call goes deeper? Since the exception does not provide throwing mechanism, we will have to look at the returns values ​​for each function. For example, the regularity of "A" can be called "B", and "B" can be said by several other routines, so if "A" returns an error, then we should call it "B" and others Calling "B" must be checked in all routines. If "A" is a very basic routine then this code can be complicated. Is there a solution to such a problem? Actually, here I want to get a quick return path if such an error occurs, then we only have to solve this error in one place. I'm afraid that the way it is. Without exceptions, you have to check the return value of each function in the call series.

ruby on rails undefined method(s) for active record -

(in / users / sayedgamal / apps / test) / उपयोगकर्ता / sayedgamal / apps / test / config / boot .rb: 20: चेतावनी: रत्न :: स्रोतइंडेक्स # स्ट्रिंग पैटर्न के लिए खोज का समर्थन नहीं किया जाता है == CreatePeople: माइग्रेट करना ========================== ================================================================================================ # & Lt; ActiveRecord :: कनेक्शन ऍडापॉर्टर :: टेबल डिफाइनिशन: 0x238e97c & gt; के लिए अपरिभाषित विधि `स्ट्रिंग ' (--trace के साथ कार्य चलकर पूरा पता लगाएं) मुझे यह त्रुटि मिलती है जब मैं जारी कर रहा हूं rake db: migrate कमांड .. मेरे रेल परियोजना के मूल फ़ोल्डर में .. माइग्रेट / 001_create_people.rb सामग्री: < / ब्लॉकक्वाइट> वर्ग CreatePeople & lt; ActiveRecord :: माइग्रेशन डीएफ़ self.up create_table: people do | t | T.string: first_name t.string: second_name t.string: company t.string: ईमेल t.string: फोन अंत अंत डीएफ़ self.down drop_table: people end end नोट: वह मैंने भी पूर्णांक और पाठ क्षेत्रों का

c# - ToolStrip memory leak -

I have a problem with the memory leak with SWF-ToolStrip and it has been resolved according to this. None of this knows the problem with .NET 3.5 SP1 as well as in .NET 4.0 appears to be. To reproduce the problem, you should create a toolstrip with as many items as possible that can cause this overflow button. The problem only appears when you actually overflow When you click on the button, it creates a ToolStripOverflow object that subscribes to the Microsoft.Win32.UserPreferenceChangedEventHandler event. Toolstrip toolstrip does not resolve overflow objects, so the event handler can not be removed and causes leakage. This caused large scale problems in the big app, which made forms with toolstrip on them. Protected Override Zero Dispos (Boole Disposal) {if (Disposing) {Var overflow = toolStrip1.OverflowButton.DropDown as ToolStripOverflow; If (overflow! = Null) overflow.define (); } If (settlement & amp; components (= null)) {components.Dispose (); } Base.Dispo