Friday 15 May 2015

File Revision Control -


How can I add an amendment history to a file shown, to keep it simple and clean?

It seems that it was hand coded, but you can get something like the version control system Combination and a bug tracking system such as cumin and SVN.


cocoa - Easiest way to run shell script objective-c -


I'm an Objective-C Newboy and I am thinking that the purpose-how easy it is to run a shell script. I do not care about any output I have tried system (), exec () and execl () and a nastask they do not work for some reasons ... it is i trying to run the shell script I:

  "mount_webdav http://idisk.mac.com/idisk_username/ / version / Idisk_username"  

(Basically my iDisk mounting ) In addition, no password shows any sign of the box or its work. It will work in applescript, and I have created a mount point directory. None of the above methods do anything, or crashes the application for some strange reasons.

Whatever you need. This should work:

  NSArray * args = [NSArray arrayWithObjects: @ "http://idisk.mac.com/idisk_username/", @ "/ version / IDIsk_username", zero]; NSTask * Mountcash = [[Nstek Allok] Init]; [Mount Task Set Launchpath: @ "/ SBI / Mount Vaidad"]; [Mount task launch];  

Test all full command paths and arguments from the command line. I have not used mount_webdav but I think it requires more logic than you supplied.


Using a DiffGram in Java -


I am trying to create a web portal in Java which supports incremental change in an XML document. I like technology in the nets, but I have to use Java for this project. Is there any Java Library that can modify XML document objects using diffgrams? We will probably use JAXB, but I can always martial the data to create the original XML document.

I do not know anything like this in Java, at least, not based on diffgram probably in java Have a look for XML Diff solution or for more options

Actually, this project looks interesting: (Fugo Core XML Diff and Patch Tool) has never been tested individually anytime.


hudson build a project using junit maven and HSQLDB in server mode -


I have a project of persistence with spring and there is a hibernate built with Maven, I am testing the test and A test database HSQLDB , when I initially launch the HSQLDB database in server mode for test, did Hudson launch a database or someone with Maven Can you make the way?

I will use it and for this, you can use it for each exam case and / or setup data You can use (see JUnit 3 for example, see the post for JUnit 4 for example).

Another option is to use this section in a configuration that shows how to drop / create a database and schema, then submit it before the test phase, and after the test phase Drop the database).

The approach later gives you less control over data setup between tests, so I like debuting.


Insert text in the input file in Lex (with C) -


I am trying to help a friend at a college job, but I like one of the Lex Forgot a lot

That's it, we're trying to parse a HTML and a reporter CSS file and add the style of the tag.

Example:

HTML

& lt; Body & gt; & Lt; / Body & gt;

CSS

  body {color: black;}  

Modified HTML

  & lt; Body style = "color: black;" & Gt; & Lt; / Body & gt;  

All regex is done and the macro also

problem:. Input HTML and the modified HTML will be the same file. We tried to redirect yyin and yyout to the same file ... and then use the files (text, yyout); Where the text is a four * with all style information (and style = "") it does not work.

So ... can you help him?

It is not to lose the perception of space in its important file (hence the style = "" to tag it correctly).

Thanks

The yyin and yyout redirect file will not work for the same (As you already know). My approach will be:

  1. Create a temporary file
  2. Yyout temporary file
  3. writes to finish in parse, backup for the input file
  4. replace the input file with the temporary file

There is no other way, if yyout yyin is the same as your (original input) text will be overlaped .


Very interesting! Mysql do not support 𝑴 ?who know why? -


In Firefox you can see MK but can not see in IE8.

Hex F 9D91B4

And Google can convert it from% F0% 9D% 91% B4 to M.

Just look for two empty squares in Notepad.

Who knows?


Writing Django Unit Tests for Views -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 3 जवाब

क्या किसी के पास एक अच्छा tute है / विचारों के लिए अच्छे परीक्षण लिखने का उदाहरण? मुझे जो चीजें मिल रही थीं, उनमें से ज्यादातर चीज 2008 के मध्य में थीं जो कि केवल थोड़ी मददगार है।

एलेक्स Gaynor इस विषय के बारे में कुछ सुझाव लिखा था बस दूसरे दिन:


java - Are there any tools to visualize the objects being used in a program? -


I'm not sure how this would be useful, but I thought it was necessary to see the objects used in my items It may be obvious that the program and what is being referred to, I think it will generate some data that will be used by the program as a graphview. Is there a tool that does this, otherwise it would be difficult for me to do this? Ideally this would work for any arbitrary program, however, if I needed some modifications in code (such as a dump object () call or whatever can be added)

I would like to do this for Java Interested in doing so, but if there are solutions for other languages ​​then please post them also.

A profiler will allow you to view objects created at runtime, for example this output of JProfiler Is:


What is a trivial merge in git? -


Sometimes when I pull up instead of Rebase after a simple one file change, I see the following in the master log:

trivial merge

But there is no difference which has changed? What does this log message mean? Has anything changed which I did not know? it freaks me out.

git does not include this message in the log at any point . I'm going to make a wild guess and assume that you've seen this message in the Zeit Web.

If there is no output from any joint difference then gitweb prints this message so that when the only differences were in all the fission, only one side of the merge changed, and this change in merger Unmannedly brought. It basically meant that there was no conflict and no magic was added to the merge commit.


How can i write a program which reports on status of SQL Server replication -


Some of our end users are not IT savvy and can not know how to check the health of SQL replication system. Is there a tool that is simpler than SQL Server Management Studio that they can keep an eye on it? I am asking it because end users are non-programmers.

If not, what are the methods for admin in the client place to keep a tab on the health of SQL replication tasks, or central offices are in remote client sites?

Thanks and relation, Chuck

Built-in replication monitor;

Default Path C: \ Program Files \ Microsoft SQL Server \ 100 \ Tools \ Binn \ sqlmonitor.exe

See the following;


c# - Process.Start("IEXPLORE.EXE") immediately fires the Exited event after launch.. why? -


I have a strange problem with IE8 installed in XP I have a system. Trying to launch IE using Diagnostics Process.Start method in C #. And I need to trap the event to get out of IE and do some operations.

  process objProcess = Process.Start ("I" IEXPLORE.EXE "," http://google.com "); if (obj process! = Null) {objProcess.EnableRaisingEvents = true ; ObjProcess.Exited + = New EventHeader (myProcess_Exited);} Public Fixed Zero myProcess_Exited (Object Sender, System.EventArgs E) {MessageBox.Show ("You Exited");}  

But the above code works perfectly when encroaching on various processes (eg: Notepad) and it removes the exiting event when the exchange is closed.

This is the only problem Let's start IE 8. Can anyone explain to me what's the problem?

UPDATE

Most friends have posted my post And why did not you just use a URL? Why should I stay with IE?

Here cause

The last purpose of the app Launch a URL from the Windows application and hide an XE when working on IE and disconnecting IE after exe Show.

Thanks

Most likely that you are already a process , So when you try to start it again as a new process, it seems that there is an already running IEEE, it states that the user started a new window (hence the initial IE will create a "new" window instead of a new one) and exit.

Possible solutions: Try starting the process with the "-nomerge" command line option:

  process Objprrocess = Process.start ( "IEXPLORE.EXE", "-nomerge http://google.com/");  

Interesting overview : objProcess.ExitCode (for at least IE8) is equal to 0 If any other frequency has passed out of control, and 1 if it was actually closed by the user.


iphone - Photo browser with previous and next button , how? -


I want to create a gallery in my iPhone app with the previous and next buttons.

If someone has ideas, links, examiners or something that leads me to implement the gallery, please provide me.

, they have one


haskell - How to customize the readline keybindings of ghci -


I know that ghci supports readlines, and key bonding such as ^ w and ^ u are expected to work But I wonder if the GB has supported optimization of keybinding, such as to deal with input RC?

Thanks for any feedback.

What is your GHC version? GHCI stopped using Redline and started using around around 6.10 and 6.12.

libedit can be configured; Similarly, Hasklin for example, I have

 # ~ / .editrc (for debit) edit on the bine ^ rm-ink-search-pre bind ^ sm-ink-search- Advance Bind ^ [[5 ~ ed - Pre-Pre-History Bind ^ [6 ~ Ad-Search-Next-History 

To Match Me

 # ~ / Inputrc (for readline) "\ e [5 ~": History-search-backward "\ e [6 ~": History-search-forward 

Features of C++ that can't be implemented in C? -


I've read that C ++ is a super-set of C and provides real-time implementation by creating objects. Apart from this, C ++ is locked to the real world because it is rich in object-oriented concepts.

What are the concepts in C, which can not be implemented in C?

  1. Some say that we can not write methods in C, so how can we get different tastes printf () ? For example printf ("sachin"); will print sachin and printf ("% d,% s", count, name); print 1, sachin is a whole number whose value is 1 and the name is a letter that is initililsed with "sachin" .
  2. Some say data is acquired in intangible C ++, so what about structures?

Some respondents here argue that most things that are prepared with C ++ code Can be done, it can also be produced with C with ample ambition. This is true in some parts, but it is impossible to get some things naturally unless you modify the compiler to get out of the standard.

Fake:

  • (indicator for parent-structure in hair structure)
  • Polymorphism (Function Points
  • Impossible:

  • Data encapsulation Ul (
  • (which can also be called preprocessor step 2)
  • by logic (try to simulate it with some oval, but never really stops
  • (Constructors and destructors are automatically applied in C ++, so your stack resources are handled safely in their scope)
  • ( You can cast almost anything in C)

Check-out:

  • (a C library)
  • I once posted while using C instead of ELLOC

Explanation on RAII:

This concept is usually misinterpreted when its most important aspect - built-in Resource management, i.e. the concept of guarantee (usually at the language level) that resources are properly controlled, some believe that by obtaining RA, this responsibility can be done except for the programmer (eg. Clear Destruction Call on Geto Label), which unfortunately does not come close to providing RAI security principles as a design concept.

> A quote from a Wikipedia article which clarifies this aspect of RAI: ​​

"Therefore, resources need to be tied to the life of suitable objects.


iphone - uitableviewcell problem -


I am using a customized cell to show an image. But, when I add a picture to the first line, it gets loaded every fourth row. What could be the problem? I am using the uiimagepickercontroller to lift the image from the iFile Photo Library and give it to the first cell of the table.

  - (zero) Image Picture Controller: (UIImagePickerController *) Picker didFinishPickingImage: (UIImage *) Image EditingInfo: (Encryption *) EditingInfo {CGSEewsNews = CGSIMMake (80, 80); UIGRIFIiBIGIJJC Contex (NUCIES); [Image DrawRector: CGRactMake (0,0, new size.width, new size. Hi)]; UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); ImageView.image = newImage; [Picker Dismmandmodl Vij Niyntrkanumti: YES]; } - (NSInteger) numberOfSectionsInTableView: (UITableView *) tableview {return1; } - (UITableViewCell *) TableView: (UITableView *) Table View CellForOutPath: (NSIndexPath *) Index Pathway {Fixed NSString * CustomCellIdentifier = @ "CustomCellIdentifier"; Customcell * cell = (customcell *) [TableViewRequiredCalViewidentifier: customsendifier]; If (cell == zero) {NSArray * nib = [[NSBundle mainBundle] loadNib nominated: @ "customcell" owner: zero option: zero]; (Id current object niB) {if ([currentObject isKindOfClass: [CustomCell class]]) {cell = (CustomCell *) currentObject; // [cell loadflow comments: [Latest FML Commands ObjectAntx: IndexPath.ro]]; break; }}} NSUInteger r = [index line]; NSUnitor S = [IndexPath section]; // [cell settext: [NSString stringWithFormat: @ "I have cell% d", indexPath.row]]; // NSInteger r = indexPath.row; If (R == 1) if (S == 0) {UIImage * img = imageView.image; Cell.imageView.image = img; } Return cell; }   

iPhone SDK UITableView optimization UITableViewCell < / Code> Constructed using cells that are not visible at all time instead of re-creating new ones, this is the dequeueReusableCellWithIdentifier: of your call.

In the tableView: cellForRowAtIndexPath: is done through, you need to make sure that you have approved the cell containing the dequeue, so it only gives new cell contents In this case, if your before is cell.imageView.image = nil (r == 1) ... the statement will be sufficient.


c# - What's the meaning of the hashes at Enumerations? -


I use the GhostDoc for XML-documentation of my code, and there is a clean "Auto-document" - I use a lot of times, so now I used it on a calculation and it came with some weird hash code which I did not quite understand.

What is this? Looks like this:

{35A90EBF-F421-44A3-BE3A-47C72AFE47FE}

This is a string representation of a grid system for more details. See the guides type.

Goods are essentially random codes (some kinds of prose depend on mac-address or timing) which is unlikely to happen again in this corner of space time, it can be considered unique in all constructions. is.


c++ - C-Style Strings as template arguments? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 9 जवाब

Can सी-स्टाइल स्ट्रिंग्स हो सकता है टेम्पलेट तर्क के रूप में प्रयोग किया जाता है?

मैंने कोशिश की:

  टेम्पलेट & lt; char * str & gt; Struct X {const char * GetString () const {return str; }}; Int main () {X & lt; "स्ट्रिंग" & gt; एक्स; अदालत के & lt; & lt; x.GetString (); }  

और हालांकि मुझे क्लास की परिभाषा के बारे में कोई शिकायत नहीं मिलती है, तात्पर्य पैदावार 'X': 'str' के लिए एक टेम्प्लेट तर्क के रूप में अमान्य अभिव्यक्ति (वीसी) ।

अपडेट: आजकल, कुछ साल इस सवाल कहा गया था और उत्तर दिया, स्ट्रिंग साइकलल्स का उपयोग टेम्पलेट तर्क के रूप में संभव है। सी ++ 11 के साथ, हम वर्णों के रूप में टेम्पलेट तर्कों ( टेम्पलेट & lt; char ... c & gt; ) का उपयोग कर सकते हैं और इस तरह के एक टेम्पलेट पर एक शाब्दिक स्ट्रिंग पास कर सकते हैं।

यह काम करेगा, हालांकि:

  टेम्पलेट & lt; char const * str & gt; Struct X {const char * GetString () const {return str; }}; Char global_स्ट्रिंग [] = "स्ट्रिंग"; Int main () {X & lt; global_string & gt; एक्स; अदालत के & lt; & lt; x.GetString (); }  

The best way to join two dissimilar mySQL tables -- planning for django from python -


  तालिका a (t_a): आईडी नाम पिछले सबसे पहले ईमेल राज्य देश 0 sklass klass steve sklass@foo.com में ब्रिटेन 1 jabid आबिद जॉन abid@foo.com ny हमें 2 jcolle Colle जॉन jcolle@foo.com हमें वाई तालिका ख (t_b): आईडी एस.एन. ब्रिटेन 1 जॉन आबिद में दिए गए निक ईमेल नियंत्रण रेखा 0 स्टीवन क्लास स्टीव sklass@foo.com - abid_j@foo.com ny हमें 2 जॉनी कोल जॉन jcolle@foo.com वाई हमें 3 जॉन आबिद - abid@foo.com ny हमें  

क्या ऊपर सूचीबद्ध है है एक (संक्षिप्त) स्तंभ और पंक्ति mySQL टेबल दो तालिकाओं को देखते हुए यह स्पष्ट हो जाता है कि मूल्यों को सख्ती से देखकर (आईडी नहीं देखा गया है) और उन मूल्यों की मेलिंग संख्या की तुलना करें जिन्हें आप इन मूल्यों के मेल प्राप्त करेंगे।

  t_a t_b 0 0 1 3 2 2 - 1  

मैं आखिरकार क्या करने की कोशिश कर रहा हूं, ऐसा करने के लिए डीजेंगो में है - मुझे यकीन नहीं है कि अगर यह मामला है अतीत में मैंने यह शुद्ध अजगर का उपयोग करके किया है जिसमें मैं पुराने डेटा को नष्ट करता हूं और सिर्फ तीन नए टेबल बना देता हूं मैं अपने कार्यान्वयन से नीचे बदलाव करना चाहता हूं (नीचे सूचीबद्ध) क्योंकि जो समस्याएं मैं देख रहा हूं वह समय बदलता है और लोग आते हैं और जाते हैं अतीत में मैंने अभी डेटा को पुन: उत्पन्न किया है - लेकिन अब जब मैं लोगों को छोड़ देता हूं और केवल डेटा को प्रतिस्थापित नहीं करता (हटाएं) का ट्रैक रखना चाहता हूं। मेरा मानना ​​है कि एक एसक्यूएल अद्यतन करके और अधिक सुरुचिपूर्ण है और इतिहास को सुरक्षित रखता है।

मैं जानना चाहता हूं कि इस मर्ज किए गए उत्तर को सीधे mySQL से (या तो एक एसक्यूएल फ़ंक्शन या एक नई तालिका का निर्माण) जो निम्न तरीके से डेटा में विलीन हो। मैं यह शुद्ध एसक्यूएल का उपयोग करना चाहता हूँ (मुझे विश्वास है कि मैं यह Django में कर सकता हूँ)। इसलिए मैं एक ऐसे समाधान की तलाश कर रहा हूं जो निम्न मानदंडों को पूरा करता है:

  1. एक न्यूनतम_मैच है जो कि दोनों पंक्तियों के बीच की न्यूनतम संख्या को परिभाषित करता है जिसमें से गठबंधन होना चाहिए मान्य है।
  2. जबकि तालिकाओं में भिन्न लंबाई हो सकती है, यह 1-ते-1 मानचित्रण है दूसरे शब्दों में बहुत से एक हो सकता है (अभी तक)

अब मेरी पृष्ठभूमि अजगर है और मेरे लिए यह करने का सबसे आसान तरीका हमेशा से कम से कम लूप के लिए करना है दो तालिकाओं, जो फिर से अन्य टेबल पर लूप के लिए करता है जो मैचों की संख्या को देखता है। कोड में ऐसा लगता है

  t_a = [["sklass", "klass", "steve", "sklass@foo.com", "में", "uk",], ["jabid", " आबिद "," जॉन "," abid@foo.com "," एनवाई "," हमें ",], [" jcolle "," Colle "," जॉन "," jcolle@foo.com "," वाई ", "हम",],] ["स्टीवन", "क्लेश", "स्टीव", "स्क्लाज़ @ फ़ू डॉट कॉम", "इन", "ब्रिटेन",], ["जॉन", "अबिद" "एबीआईडी_ज@फ़ू डॉट कॉम", "एनवाई", "यू",], ["जॉनी", "कॉलीन", "जॉय", "जेकॉलले @ एफू डॉट", "वाई", "यू"), [ "जॉन", "आबिद", "abid@foo.com", "एनवाई", "हमें",],] min_match = 3 में t_a person_a के लिए: के लिए मैच = 0 match_pct = 0.0 match_a_index = t_a.index (person_a) Person_b में t_b: new_match_count = len (सूची (सेट (person_a) & amp; सेट (person_b))) अगर new_match_count & gt; मैच: से मेल = new_match_count match_b_index = t_b.index (person_b) match_pct = "% .2f"% (नाव (new_match_count) / \ नाव (लेन (सेट (person_a + person_b))) * 100) अगर मैच & gt; = min_match: प्रिंट match_a_index, match_b_index #, match_pct, मैच  

टिप्पणी सवाल पूछते हैं कि आप सिर्फ ईमेल पते पर क्यों नहीं जुड़ते हैं मुझे यह जरूरी नहीं पता है कि कॉलम के मान मैच होंगे। मैं हूँ निश्चित है कि t_a में दिए गए पंक्ति से मान t_b में एक पंक्ति के लिए मानों का मिलान करेंगे मैं टी_ए में टी_ए में एक पंक्ति के लिए सबसे अधिक (सबसे संभावित) मैच चाहता हूं और केवल अगर मैचों की संख्या min_match से अधिक है।

आप एक कर्सर एक संग्रहीत प्रक्रिया के माध्यम से निष्पादित के माध्यम से सीधे MySQL में ऐसा कर सकते हैं।

  परिसीमक $$ प्रक्रिया बनाएं `proc_name` () शुरू घोषित किया INT डिफ़ॉल्ट 0 ; DECLARE एआईआईडी BIGINT UNSIGNED; DECLARE b_id BIGINT UNSIGNED; DECLARE x_count INT; - निम्नलिखित t_a.id के लिए निम्नलिखित कर्सर cur1 कर्सर की तरह कुछ, t_b से T_b.id, t_b WHERE t_a.email = t_b.email; DECLARE सेट नहीं मिला के लिए HANDLER CONTINUE CONTINUE = 1; चयन संख्या (*) में x_ गणित से t_a, t_b WHERE t_a.email = t_b.email; यदि (x_count & gt; & lt; some_min_value & gt;) फिर से cur1; एक_आईडी, बी_आईडी में फिर से छूटे फेट करें; अगर नहीं तो - कुछ अद्यतन पंक्तियों की तरह यहां कुछ करें, पंक्तियाँ निकालें, आदि। - ए_आईडी और बी_आईड दो तालिकाओं के लिए दो आईडी मानों को पकड़ते हैं - जो प्राथमिक कुंजी के अंत में आती है IF; जब तक खत्म हो चुका है; बंद करो 1; अगर अंत; END $ $  

javascript - How do I fix PhoneGap build errors? -


I am trying to create a base iPhone application, but I continue the following two errors:

  ./ build-phonegap.sh: line 6: ./configure: Any such file or directory cp: lib / iphone / phonegap-min.js: Any such file or directory  

I created and installed the latest version of PhoneGap from source on the dot hit, I have checked to ensure that the PHONEGAPLIB variable is actually in XCode Set up.

Where do I get files listed? Where do I place them (what are the relative of those paths)? And why not?

Later

It seems that this project was made with a version of PhoneGrap (one such external lib does not refer to the directory, but I was trying to run it with a new one by reproving the project with our latest version and copying it to the www directory fixes the issue.

I'm skeptical what steps do I take? I do not know how to install it? Do I need to open it in Xcode before running some GIT commands or some build command?

Update:

Understand this Downloaded it went to the unzipped Phonegap folder, duplicate the iPhone folder, open the encoded and create and hit it. It worked.

Obviously your iPhone Inter Projects If you know what you are doing then it can possibly be fixed / changed

This video has helped me to verify that you have a subfolder. Whatever is to be done, it is to download, open and open. Files inside your www work by default


How to best get 3 prior image and 3 later image records in MySQL query? -


I will briefly explain it to complete with a functional perspective. I am working on an image gallery on the page Shows an image, I want the sidebar to show thumbnails of images uploaded by that user. At max, should be 6, 3, which were posted before the current main image, and 3 were posted after the main image. You can see it as a stream of images by the same user through which you can navigate. I believe Flickr has a similar thing.

Technically, in my image table there is an auto-iced ID, a user id and date-uploaded field among several other columns.

How do your advice implement this kind of query? Can I add it to a question? Is there any easier MySQL utilities that can offset and handle such?

PS: I do not want to create an additional "rank" column, because it makes deletion difficult. Also, using the autoincrement ID seems risky, I can change it later for a GUID. Finally, I definitely search for a query that works and scales.

I know that I ask for a lot, but it seems that it is simple?

The query may look like the following.
With a UserID + image_id index (possibly additional fields to cover the objectives), it should do relatively well.

  SELECT field1, field2, whichever is from myTable where userID = some_id - AND image_id & gt; Id_of_the_previously_first_image ORDER by image_id LIMIT 7;  

To help with scaling, you should consider using a larger LIMIT value and cache accordingly.

Edit (Answer the comments / questions):
United Index ... from many fields Make, note that

  create [UNIQUE] index UserId_Image_id_idx on myTable (UserId, image_ida [, field1 ...])  

Note that Alternative elements of this query are in brackets ([]). I think the unique obstacle would be a good thing, the additional "cover" field (field 1, ...) is probably the beneficiary, but depending on the "width" of such extra fields as well as the overall setup and usage pattern (Since [large] indexed INSERTs / UPDATEs / DELETE may want to limit the number and size of such indices.)

Such an index data such as "type" is neither numeric nor string . This is made only of personal data types, for example, if UserId is VARCHAR (10) and Image_id is INT, the resulting index will use these two types for the underlying search parameters, i.e.

... WHERE UserId = 'JohnDoe' and image_id> 12389

In other words, there is no need to combine these criteria into a key.

On image_id
When you say image_id, you mean joint user / image id, right?
No, I mean only image_id. I assume that there is a separate field in the table. User ID has taken care of other points of the WHERE clause, the basic question to write indicates that this field is automatically generated, and I believe that we can rely on this field for the intended purposes. Alternatively, we can rely on other areas such as timestamps when uploading the image.

In addition to this, a follow-up, whether [monotonically increasing] by Image_id or ordered by timestamp_off_upload, we want to use it for a DESC order, the latest "content" first Show.


.net - How can you redefine a property using in reflection in C#? -


मान लें कि हमारे पास निम्न श्रेणी है:

  सार्वजनिक वर्ग tx_fct {int _ok; सार्वजनिक एट ठीक {मिल {लौटें _ok; } सेट {_ok = value; }}}  

रिसेप्शन का उपयोग कर मैं ग्रहणकर्ता को कैसे ओवरराइड कर सकता हूं?

प्राप्तकर्ता प्रतीत नहीं होता है tx_fct1.ok.GetType ()। GetMethods ()

जब मुझे गेटर तक पहुंच मिलती है, तो मैं अपना खुद का गेटर कोड कैसे डालूं?

रिफ्लेक्शन एपीआई कक्षाओं और विधियों को बनाने के लिए केवल विधियों को प्रदान करता है, लेकिन मौजूदा वाले को संशोधित नहीं करता है। रनटाइम में मौजूदा विधि को संशोधित करना संभव नहीं है आप जो कुछ कर सकते हैं वह कुछ आईएल को विधानसभा में डालना है, जो अब तक AppDomain में लोड नहीं हुआ है।


c# - How would you create a Fancy Panel which applies extra styles? -


I have a fancy pane control which automatically implements the content in it, for example

  & Lt; Asp: FancyPanel runat = "server" id = "pnl1" & gt; & Lt; Header & gt; Header text & lt; / Header & gt; & Lt; Body & gt; // A regular ASPX markup & lt; / Body & gt; & Lt; Footer & gt; Footer Text & lt; / Footer & gt; & Lt; / ASP: FancyPanel & gt;  

So when it is sung, I will now wrap everything in the header with a bold text style in a top text and add rounded corners (I need advice for style Not only, just on the fence panel things, an empty div is good enough).

How do I create such control?

Thank you!

If I understand your question, then you need it.


Using LINQ to SQL to populate image -


Good afternoon, a little bit energetic for you.

I have a SQL table in which the account ID and an AccountLogoFilePath (the images are stored in the folder instead of the table).

How do I get to know how to make an image popular from LINQ using SQL in this file path method (in C #)

I did something in SSRS, So am I having some discomfort with those lines?

I do not think you want, "Use LINQ to SQL in populating an image using this file path ".

You can retrieve the file path, but then you have to use other squares in the framework to load the frame in a bitmap or memory stream ... depending on your desired output .


c# - Literal content is not allowed within a UserControl -


How does it include a text in the tag under my control?

  & lt; Uc: My Runat = "Server" & gt; Text & lt; / Uc: My & gt;  

There is a complex table in my control and I want to insert the text into one cell. How to do this?

  [resident (false)] [pars childon (true, "lesson")] Public Partial Class Required Field Marker: User Control, ItextControl {[Category ("Settings")] [DurabilityMode (StabilityMode.EncodedInter Default Property)] Get Public String Text {Return {return lblName.Text; } Set {lblName.Text = value; }}}  

javascript - check if jquery has been loaded, then load it if false -


Does anyone know how to know if jquery is loaded or not (with javascript) then load it if it loads Has not happened.

If something like this (! JQuery) {// load jquery file}

Something similar:

   

php - How to include CodeIgniter generated pages? -


What would be the easiest way to include a CI file? Suppose I want to include in example.com

example.com CI has not run and I can not include it ('ci / index.php / mycontroller').

< Div class = "post-text" itemprop = "text">

P>

  $ ('# myDiv'). Load ('ci / index.php / mycontroller', {}, function () {$ ('# myDiv #loading'). Hide (); $ ('#myDiv #data') Slidedown (500);}) ;  

php - workflow for a license server / selling software -


I have a product that I sell, buy a user license key and enter the config to enable that product. We do.

My first idea was ..

Licensed server w / license key pings on product launch, and fails if the server returns an authorized (license terminated, invalid etc.). But what if the license server is down?

Another idea was that the license should be entered only once, or maybe every 30 days, or just every time (the app was reinstated.).

Is there any safe way to go about this (good protection from at least some script ceds)? I have never sold the software, but I know how easy it is to reverse-engineer / modify software to avoid the need for a license and to complicate things, it is in PHP.

The answer to the new product is always:

About copy protection Do not worry, unless people are actively tampering your product already, there is no reason to add the 'phone-home' feature.

Large companies may be crazy about proper licenses, so they will pay you for the license. Most small companies are ethical and issues of any license are probably an inspection. Now you should have more worry about removing your name and introducing people to your product. Anyone using your product at home who has never paid for a license, it is a good thing for you now to get people using your code, do so that turning businesses into something else is a tough time Then, worry about ensuring that they are not using it for free, this is a version 3 problem, if you remove it.


flash - SSH Through Telnet Connection -


Is it possible to connect to an SSH server via Telnet connection?

I am trying to connect to Flash for an SSH server, but there is no OpenSSH implementation available in the Action Script. I can successfully connect to Telnet server and execute the command.

I can not make any changes on the machine with SSH server. The machine I'm connecting with is running Windows XP SP3. I'm also ready to receive any software for Windows machine.

I think the http server is on the machine with ssh server, you execute commands on php You can use scripts (use ssl to secure connections)

If you have control over the client machine, then you write (for example C) for SST proxy telnet proxy It would be so easy to write SSIT client in an action sequence


asp.net - Reload external javascript after asynchronous postback via UpdatePanel -


I have an external javascript on my page, e.g. Something like this:

  & lt; Script src = "http://foo.com/script.js" type = "text / javascript" & gt; & Lt; / Script & gt;  

And somewhere an UpdatePanel script writes some content, and it does this from within an anonymous JavaScript function in the JS file. I.e., there is something like this in the script:

  (function () {document.write ('content');}) ();  

Whenever UpdatePanel is updated via Asynchronous Postback, all scripts (or for any JavaScript on that page, for that matter) are undone For javascript, I just use it:

  Sys.WebForms.PageRequestManager.getInstance (). Add_endRequest (myFunction)  

To do all this again, but since the function in the script source file is anonymous and is called on definition, I am SOL! Any ideas?

Note: External JS source is from another domain and its content is outside of my control.

try it

  private string _myScript = @ "(function ( ) {Var ys = document.createElement ('script'); ys.type = 'text / javascript'; ys.async = true; ys.src = 'http: //foo.com/script.js'; var s = Document.getElementsByTagName ('script') [0]; s.parentNode.insertBefore (ys, S);}); ";  

Then your page_load

  ScriptManager.RegisterStartupScript (this.Page, this.Page.GetType (), "myScript", _myScript, true);  

django - Update model object with new dynamicaly created field? -


मेरे पास क्वेरी है:
queryset = status.objects.all () [: 10]
मॉडल स्थिति को फ़ील्ड नहीं मिला है टिप्पणी राशि इसलिए मैं इसे क्वेरी के हर वस्तु में जोड़ दूंगा:

  एस के लिए क्वेरीस में: s.commentAmount = s.getCommentAmount ()  

सब ठीक है, प्रिंट s.commentAmount अच्छे परिणाम दिखाता है, लेकिन बाद:

  प्रतिक्रिया = एचटीपीआरपीएसपॉन्शन () प्रतिक्रिया ['सामग्री-प्रकार'] = "पाठ / जावास्क्रिप्ट" प्रतिक्रिया। लिखें (सीरियललाइज़र्स। साइरियलाइज़ ("जेसन", क्वेरीस)) रिटर्न प्रतिक्रिया  

मेरे पास JSON फ़ाइल लौटने में फ़ील्ड नहीं है टिप्पणी राशि मेरी गलती कहां है?

कारण commentAmount प्रदर्शित नहीं हो रहा है जब डीजेेंजि सीरियललाइज़ेशन करता है, तो यह मॉडल पर घोषित फ़ील्ड के माध्यम से छोर जाता है और केवल उन फ़ील्ड

एक टेम्पलेट में अपनी क्वेरी के माध्यम से पाशन और मैन्युअल रूप से जेसन या एक अन्य सीरियललाइजेशन टूल जैसे का उपयोग करने का विचार करें।


Active Directory not finding all users in C# -


I have some code that asks the Active Directory to verify the existence of the user. I am trying to verify a long list of approximately 1300 IDs, I have a user account (Eddie from LINQ, Directory Search (with and without a directory entry) and a directory entry, which is linked to WinNT: // path) Have tried several ways to verify. Each time it will come back and say that many users are not present. If I code code in my user id code and execute it personally, then it validates the existence. If I try and do it in a forte loop, then I get many wrong negative.

Here is the code that I am currently using.

  Fixed string [] userIDs = new string [] "user1", "user2", " User 3 "," User 4 "," User 5 "," User 6 "," User 7 "," User 8 "...," User 1300 "}; & Lt; String & gt; NonExistingUsers = New List & lt; String & gt; (); & Lt; String & gt; Existing user = new list & lt; String & gt; (); Foreach (string in userIDs) {DirectorySearcher search = new DirectorySearcher (); Search.Filter = String.Format ("(SAMAccountName = {0})", s); Search.PropertiesToLoad.Add ("cn"); DirectorySearcher ds = new DirectorySearcher (de, "(and (objectClass = user) (cn =" + s + "))," New string [] {"name"}, SearchScope.Subtree); Search Result Collection Results Collection = D. Fidel (); SearchResult Results = search.FindOne (); If (result! = Zero) current user Add (s); Other non-current users Add (s); }  

Any suggestions or reasons why I am getting wrong negatives?

Some of the things:

  • First of all, Try using "anr =" (ambiguous name resolution) in your LDAP filter - it searches for many name-related features and makes easy search userID not part of the actual "normal name" (cn = user1) Maybe

  • Secondly, use object content instead of object - object cabant alone valuable and sequential And

  • In the third place: you are why call first stage.Films () and then Kfndon () on the next line? In fact it does not seem necessary ....

  • In fact, only for backward compatibility and if you need to deal with local computer accounts - try to avoid it Whenever possible, it displays very little properties compared to LDAP

  • Static String [] UserIDs = New string [] "User1", "User2", "User3", "User4", "User 5", "User6", "User 7", "Users Guy 8 "...," User 1300 "}; DirectoryEntry searchRoot = New directoryInterity ("LDAP: // cn = User, DC = YourComp, DC = com"); & Lt; String & gt; NonExistingUsers = New List & lt; String & gt; (); & Lt; String & gt; Existing user = new list & lt; String & gt; (); Foreach (string in userIDs) {DirectorySearcher search = new DirectorySearcher (searchRoot); Search.SearchScope = SearchScope.Subtree; Search.Filter = string.Format ("(and (object category = person) (anr = {0}))", s); Search Result Collection Results Collection = D. Fidel (); If (result! = Null & amp; result result.Count & gt; 0) existing user. Add (s); Other non-current users Add (s); }

    Is this work in your scenario ??

    In addition, if you use .NET 3.5 or later, things are very easy - see:


linux - How to query X11 display resolution? -


It looks like a simple problem, but I can not find the answer: How can you monitor (X11 By) and their proposal?

Check out and from

Specifically:

  • To: screen count () , ScreenOfDisplay ()
  • From: WidthOfScreen () , height offscreen ()

Django: ManyToMany Inline Admin view error -


यहां मॉडल की परिभाषा दी गई है:

  वर्ग ItemBrand (models.Model): name = models.CharField (MAX_LENGTH = 30, अद्वितीय = सच) डीईएफ़ __unicode __ (स्वयं): वापसी self.name वर्ग WantedItem (models.Model): नाम = models.CharField (MAX_LENGTH = 120) वर्णन = मॉडल = models.TextField () बनाया गया .DateTimeField (auto_now = झूठी, auto_now_add = सच) की समय सीमा समाप्त = models.DateTimeField (auto_now = झूठी, auto_now_add = झूठी) टाइप = models.ForeignKey (itemtype, related_name = "प्रकार चाहता था") GENDER_CHOICES = ((1, 'माले') , (2, 'महिला')) लिंग = models.IntegerField (विकल्प = GENDER_CHOICES) ब्रांडों = models.ManyToManyField (ItemBrand, related_name = "wantedbrands", सममित = false) रंग = models.ManyToManyField (ItemColor) आकार = models.ManyToManyField (मदसिखे) निर्माता = मॉडेल। फ़िनिगेकी (उपयोगकर्ता, संबंधित_नाम = "इच्छा सूची निर्माता") def __unicode __ (स्वयं): वापसी self.name  

यहां AdminModel कोड है:

  वर्ग BrandsInline (admin.TabularInline): मॉडल = WantedItem.brands। वर्ग WantedItemAdmin (admin.ModelAdmin) के माध्यम से: list_display = ( 'नाम', 'बनाया', 'समाप्त हो रहा है', 'प्रकार', 'लिंग', 'निर्माता') search_fields = ( 'नाम', 'विवरण') list_filter = ( 'निर्मित', 'ब्रांड',) क्रम = ('-कितित',) इनलाइनों = [ब्रांड्सइनलाइन,] = ('ब्रांड') बहिष्कृत करें  

यह मूल रूप से सही से खींच लिया गया है Django डॉक्स, और यहाँ त्रुटि मैं हो रही है:

'ReverseManyRelatedObjectsDescriptor' ऑब्जेक्ट कोई विशेषता 'से लेकर' है

मैं एक कुल नुकसान में हूँ ... किसी भी विचार? यहां तक ​​कि अगर मैं सचमुच एक लिंकर तालिका बना रहा हूं और मॉडल में "के माध्यम से" विशेषता सेट करता हूं तो मुझे एक ही त्रुटि मिलती है।

टूटी?

आपको ट्रांजैक्शन में जेगंगा को अपग्रेड करना होगा।

कई-से-कई क्षेत्रों के साथ इनलाइन का उपयोग करना डीजेंगो डेवलपमेंट वर्ज़न में नया ()।

अपने मॉडलों के सरलीकृत संस्करण का उपयोग करते हुए, मुझे Django 1.1.1 के लिए आपको एक ही त्रुटि मिलती है, लेकिन यह ट्रंक (संशोधन 11785) पर काम करता है।


एक तरफ के रूप में, आपको सममित = गलत को अपने आइटमब्रांड ManyToMany फ़ील्ड पर निर्दिष्ट करने की आवश्यकता नहीं है। सममित विकल्प केवल पुनरावर्ती संबंधों जैसे उपयोगकर्ता & lt; - & gt; उपयोगकर्ता

आप पर एक नज़र रखना चाहते हैं, और उन्हें और अधिक तार्किक रूप से भी नाम के बारे में सोच सकते हैं। यदि निर्माता एक उपयोगकर्ता ऑब्जेक्ट है, और वे जो इच्छा सूची तैयार कर चुके हैं, तो डिफ़ॉल्ट जब related_name निर्दिष्ट नहीं है संबंधित_नाम के लिए अपनी पसंद के साथ

  creator.wishlist_set.all ()  

(जब आप अंडरस्कोर जोड़ते हैं), यह < / P>

  creator.wishlist_creator.all ()  

लेकिन मैं related_name = 'wishlists' सुझाऊंगा, जिस स्थिति में आप उपयोग करेंगे

<पूर्व> creator.wishlists.all ()

Boolean expressions for a tagging system in SQL -


To keep this SQL Tables for the tagging system:

  create table tag (id serial primary)  

The user's Boolean expression query in SQL is " Tag 1 and tag2 ":

  SELECT items. * Inner joins items from items tagged_items as i1 (items.id = i1.item_id) on interiors (i1.tag_id = t1.id) included as inline tag t1 included as i2 on tagged_items (items.id = I2.item_id) Tagged as JOIN (I2.tag_id = t2.id) on the inside where T1name = 'tag1' and 't2.name =' tag2 ';  

How do you translate other questions with Boolean expressions like " Tag 1 or Tag2 and Tag 3 " ... or more complex questions like " Tag1 and (Tag2 or Tag3) and not Tag4 or Tag 5 "From SQL?

Assume that data -> items, words -> names and tagged_item -.> Tagged_items

This is for " tag1 and (tag2 or tag3) and tag4 or tag5 ". I'm sure you can find out the rest.

  SELECT items. * Skip items from (select I1.item_id i1 INNER AS i1 INNER i1.tag_id = t1 as the tag ID and t1.name = 'tag1') as ti1 on items.id = ti1. Item_id Left Join (i2.item_id from tagged_items as i2.tag_id = t2.id and t2.name tag as in i2 interiose selection = 'tag2') as ti2 on items.id = ti2.item_id I3.tag_id = t3.id and t3.name = 'tag3' on the left join (as tagged as i3.item_id as i3.item_id selection in the form of i3.item_id as the T3), on the objects as ti3 .id = ti3.item_id Left join (i4.titem_id from tagged_items as i4.t Ag_id = t4.id and t4.name = 'tag4' tags as T-4) as items ti4 at items.id = ti4.item_id Left JOIN (select tags i5.item_id from tag_items i5 in the form of tag t5 I5.tag_id = t5.id and t5.name = 'tag5') in ti5 as items.id = ti5.item_id Where ti1.item_id is not zero and (Ti2.item_id is not null or not ti3.item_id Is) and ti4.item_id is not faucet or ti5.item_id;  Edit:  If you want to avoid subclasses, you can: 

  SELECT items. * Leave the tag on item IIT ON I1 ON items.id = i1.item_id Add tag as i1.tag_id = t1.id and t1.name = 'tag1' ... WHERE t1.item_id faucet ... I do not believe that you want to do this because because of the addition of extra left, there will be a slow result. 


Rails: Clear page cache without controller -


When I am modifying the model through the controller, I have set up clean workers to clean specific pages in the Page Cache.

How can I use a clean worker from the Railway Console (IRB)?

When I modify a model object in the console, either the sweeper will run automatically, or I need a simple way of manually running the sweeper for the modified object. Take a look at the expire_page for creating the path of the cache file from the cached file's URL;

One is the case, and then deleting that file. Unfortunately, cleanup workers are only in the controller layer because you need the url generation (i.e. url_for), so you need to manually generate the path of the cached page manually or the street level / identity level Drag to recognize.


iphone - Problem with uibutton in UItableViewCell -


In my application, I am using a customized table, each cell has a rubbish and uiimage. When a touch-up button is indicated, I want to call the IIMAgpController method to select a photo from the iPhone Library and display it in the image view. I wrote it but got a warning ... 'custom cell' presentmodalviewcontroller can not answer animated ... Here Kstmsel My main class subclasses my app, also named nib custom cell. Anyone knows this issue ???? Thank you ...

Edit

  - (IBAction) selectExistingPicture1 {if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypePhotoLibrary]) {UIImagePickerController * picker = [[UIImagePickerController alloc] init]; Picker.delegate = self; Picker.allowsImageEditing = Yes; Picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [Self current model visual controller: animated picker: yes]; [Picker release]; } Else {UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ message "Error Accessing Photo Library": @ representatives "device does not support the Photo Library" CancelButtonTitle zero: "Drat" @ OtherButtonTitles: nil]; [Alerts show]; [Warning issued]; }} - (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingImage: (UIImage *) image editingInfo: (NSDictionary *) editingInfo {CGSize newSize = CGSizeMake (80, 80); UIGRIFIiBIGIJJC Contex (NUCIES); [Image DrawRector: CGRactMake (0,0, new size.width, new size. Hi)]; UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext (); UIGraphicsEndImageContext (); ImageView.image = newImage; [Picker Dismmandmodl Vij Niyntrkanumti: YES]; // warnings are shown here}  

This is a custom cell class .. and viewController is in the class ...

  - (UITableViewCell *) Table view : (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * CustomCellIdentifier = @ "CustomCellIdentifier"; Customcell * cell = (customcell *) [TableViewRequiredCalViewidentifier: customsendifier]; If (cell == zero) {NSArray * nib = [[NSBundle mainBundle] loadNib nominated: @ "customcell" owner: zero option: zero]; (Id current object niB) {if ([currentObject isKindOfClass: [CustomCell class]]) {cell = (CustomCell *) currentObject; break; }}} NSUInteger s = indexPath.section; // [cell settext: [NSString stringWithFormat: @ "I have cell% d", indexPath.row]]; NSUnitor R = IndexPath.ro; Cell.imageView.image = Zero; For (S; == 0; s ++) (R; R == 0; R ++) {UIImage * img = imageView.image; Cell.imageView.image = img; } Return cell; }    

UITableViewCell gives no response -presentModalViewController : Animated:

You might give your CustomCell pointer to your views controller, and then -presentModelViewController Phone:. Animated: on view controller.

Add an example variable to your custom cell class:

  @interface customcell: UITableViewCell {UIViewController * viewController; } @protecti (nanatomic, assign) UIViewController * viewController; @end  

In the -tableView: cellForRowAtIndexPath: , after you create a new CustomCell, set the property:

  if ( Cell == zero) {NSArray * nib = [[NSBundle mainBundle] loadNibNamed: @ "customcell" owner: zero option: zero]; (Id current object niB) {if ([currentObject isKindOfClass: [CustomCell class]]) {cell = (CustomCell *) currentObject; Cell.viewController = self; // & lt; - Add this break; }}}  

Then, in your customcell class

  [Self current model view controller: animated picker: yes];  

with

  [self.viewController presentModalViewController: animated picker: yes];  

tsql - I really really want to use an INSERT nested in a SELECT -


I know this is something that can not be unique, but I can not find any way to do this I am thinking of reading my discoveries and, so if this is not possible, then I would like to know if I am choosing the best option.

The simple case of information about people from the old database is new. The problem is that the old schema has an address in every line, and we are breaking it into our own address table for a new address.

What I want to do is something to do [person] [person] ([first name], [last name], [address id], [ssn]) Selection p. [First name], like this:

  INSERT [new db] P [last name], addressID = (- the result of entering the address in the table or existing address' id), p. [SSN] FOR [Old DB] [DBO]. [TLPrisens] P  

Is there any way to do this that I am unable to find, or I get the address first and then match, or am I missing something? Any help would be appreciated, this is the first time that I had to work on advancing someone else's data and my improper optimism would not have much hole in it. ;)

Yes, you must first address & amp; Then the person matches the record to specify the ID when entering the record.

i.e. You can not do an inclusion in the sub query.


iphone - how to create array string -


I have NSMutableArray with student information, now I just want to remove the student's name and their average score, so did I

  NSMutableArray * stuCollection = [[NSMutableArray alloc] initWithCapacity: [student count]]; For (Int i = 0; I & lt; [Student count]; i ++) {If ([Object ot & amp; Ax: i]! = Null) {NSDrivement * DYK = [Student ObjectEndex: I]; NSString * temp = [Dick ObjectForcae: @ "name"]; [Stuckuction Ad Object: Name]; }} For (int jm = 0; jum [l} [stuCollection count]; j ++) {NSLOG (@ "name% @", [stew collection objectindex: j]); }  

I am able to run it for the first time, but when I auto scan, I can exe for loop 1, 2, 3, but then the apps can be down In the end of the show, the app ended due to the reason:

2009-12-02 14: 57: 37.908 AppBuzz [13073: 207] * Expected exception 'NSInvalidArgumentException' * - [NSCFArray insertObject: atIndex:]: 57: 37.916 AppBuzz [13073: 207] Heap: Attempt to insert zero 2009-12-02 14 (820,145,437, 837,578,260, 819,694,387, 819,694,291, 814,683,071, 814,716,415 , 814, 716,245, 17529, 24,097, 814,480, 795, 819,893,443, 819,891,231, 85 8682228, 861592624, 861585968, 8997, 8860) are terminated after throwing an example of the 'NSException' program received. "SIGABRT"

How this can be improved

thanks

Do you understand logic?

  emphasis (students); Emphasizing ([count of students]); NSMutableArray * stuCollection = [[NSMutableArray alloc] initWithCapacity: [student count]]; StuCollection; (Int i = 0; i & lt; [students count]; i ++) {if ([students objectAtIndex: I] = zero!) {NSDictionary * DIC = [students objectAtIndex: i]; Emphasis (DIC); NSString * temp = [Dick ObjectForcae: @ "name"]; Emphasis (temporary); Emphasis (name); [Stuckuction Ad Object: Name]; }} ...  

settings - How to set a fixed width of editor window in Eclipse? -


Recently I got a new 22 "monitor. Finally, while being the main editor, It is possible to open all the 120 columns in order to display the window. The problem occurs when I widen the window to the left or right side of the editor or narrow it downwards. The width of the editor decreases or Extends and other windows Take a look at this.

You should use , so your main editor is not affected by the size of the operations by other windows.


dialog - Problem with facebook showPermissionDialog -


I am able to pop up the dialog with this funciton It works fine if the user has not given any permission. After allowing me to, I refresh the whole app page, the permission dialog shows and disappears. Immediately after the dialog disappears, it started redirecting to the home page www.facebook.com.

I checked my settings and I have not found any problems? Do anyone have any idea that is the problem

You specify the xd_receiver.htm file correctly is required.


c# - Can I control labels when using RadioButtonLists? -


यह

  संरक्षित शून्य पेज_लोड (ऑब्जेक्ट प्रेषक, इवेंटएरग्स ई) {रेडियोबटन लिस्ट 1। जोड़ें (नई सूचीइटम ("लंदन", "1")); रेडियोबटन लिस्ट 1। आइटम। जोड़ें (नई सूचीइटम ("पेरिस", "2")); }  

और यह

  & lt; एएसपी: रेडियोबटन लिस्ट आईडी = "रेडियोबटन लिस्ट 1" रनैट = "सर्वर" दोहराना = "फ्लो" & gt; & Lt; / एएसपी: RadioButtonList & gt; & lt; / div & gt;  

एचटीएमएल कुछ इस तरह से तैयार करें

  & lt; इनपुट आईडी = "रेडियोबटन लिस्ट 1_0" प्रकार = "रेडियो" नाम = "रेडियोबटन लिस्ट 1" मान = "1" / & gt; & Lt; label = "RadioButtonList1_0" & gt; लंदन & lt; / label & gt; & Lt; इनपुट आईडी = "RadioButtonList1_1" प्रकार = "रेडियो" नाम = "RadioButtonList1" मान = "2" / & gt; & Lt; label = "RadioButtonList1_1" & gt; पेरिस & lt; / label & gt;  

लेकिन मैं वास्तव में यह चाहता हूं कि & lt; label & gt; टैग में वर्ग को नोट करें।

  & lt; इनपुट प्रकार = "रेडियो" नाम = "ईवेंट" id = "जो भी" मान = "1" /> & Lt; label = "लंदन" वर्ग के लिए = "लंदन" & gt; लंदन & lt; / label & gt; & Lt; इनपुट प्रकार = "रेडियो" नाम = "ईवेंट" id = "जो भी" मान = "2" /> & Lt; लेबल = "पेरिस" वर्ग = "पेरिस" & gt; पेरिस & lt; / label & gt;  

क्या मैं स्वचालित रूप से जेनरेट किया गया & lt; label & gt; टैग

आप रेडियोबटन लिस्ट से दिखाया जा सकता है, जैसे कि दिखाया गया है या।

अंतिम लिंक संभवतया आपसे क्या चाहते हैं। < / P>

आप को केवल RenderItem विधि को ओवरराइड करना होगा, जैसे:

<प्री> संरक्षित ओवरराइड रहित रेंडरआईटम (लिस्टइस्टमैम टाइप आइपॉड टाइप, इंट रेपैट इंडेक्स, दोहराएंइन्फो दोहराएन्फ़ो, एचटीएमएलटेक्स्टवेयर लेखक) {रेडियोबटन रेडियोबटन = नया रेडियोबटन (); रेडियोबटन। पृष्ठ = यह.पृष्ठ; रेडियोबटन। समूहनाम = यह.यूनिकआईडी; रेडियोबूटन.आईडी = यह। क्लाइंटआईडी + "_" + दोहराएंइंडैक्स। टॉस्ट्रिंग (); रेडियो बटटन। पाठ = यह.आइटम [दोहराइंडएक्स]। पाठ; रेडियोबटन। विशेषता ["मूल्य"] = यह.आइटम [दोहराना इंडैक्स]। मूल्य; रेडियोबटन। चेक किया हुआ = यह.आइटम [दोहराने सूचकांक]। चयनित; रेडियोबटन। टेक्स्टअलाइंस = यह.TextAlign; रेडियो बटन। एटोपोस्टबैक = यह.ऑटो पोस्टबैक; रेडियोबटन। टैब इंडैक्स = यह.TabIndex; रेडियोबटन। सक्षम = this.Enabled; रेडियोबूटन। सीएसएस क्लास = इनरसीएसएस क्लास; रेडियो बटन। स्टाइल.एड (एचटीएमएल टेक्स्टवर्टरस्टाइल। बैकग्राउंड कॉइलर, यह.आइटम [दोहराने इंडैक्स]। पाठ); radioButton.RenderControl (लेखक); // नया लेबल लेबल जोड़ें radioLabel = नया लेबल (); रेडियो लेबेल। पाठ = यह.यह [दोहराने सूचकांक]। पाठ; रेडियो लेबेल। सीएसएस क्लास = यह.आइटम [दोहराने इंडैक्स]। पाठ; रेडियोलाबेल.आसियोजितटैंट्रोलआईडी = यह। क्लाइंटआईडी + "_" + दोहराएंइंडैक्स। टॉस्ट्रिंग (); radioLabel.RenderControl (लेखक); }

ध्यान दें, मैंने वास्तव में कोड को ऊपर संकलित नहीं किया है, लेकिन आपको उचित दिशा में मार्गदर्शन करने के लिए पर्याप्त होना चाहिए:)


iphone - How to save the order in the rearranged uitable view? -


I have come to the state that the user has taped on editing and the table changes to edit mode, One goes to the rows

So my question is: Currently the source array comes from the web service, so after the transfer of the rows where the rearrangement can be protected, that is, the user next time the user comes back to the tab or < / P>

Thanks

There are some options you can make, one to your webmaster On the returning entries will be the entry, and the user's cess In order to store new orders (perhaps in a file), when the user comes back, you should be able to use the stored calculation to switch around the entries coming from the website and you can go there. ... there are other options such as data caching to the phone (if it is not fixed and large size), then archiving users' orders in the server (although you probably do this No you do not want). Hope this helps


Java milli second precision -


What is a suggestion to use for a Java API / system System.currentTimeMillis () - two later requirements At the time of sleep, 1 MMS should be given two separate times - I currently have to sleep for 15 ms to get different time.

Do not try to use time to create unique values ​​Recor A unique ID (key field I'm assuming) use the database to generate. Either use an auto incremental field or create a separate table with a single record of the counter, which you can lock and update safely.

When you can get a solution that works, the resources will eventually catch up with you.


c++ - Not able execute CreateProcess with PhotoViewer.dll -


In my application there is an interface where the user can choose any file based on the file association and open it in its default application.

I am using FindExecutable and CreateProcessAsUser with Explorer Token

The problem is now in the case of picture files. Jpg, FindExecutable Returns "C: \ Program Files \ Windows Photo Gallery \ PhotoViewer.dll", then CreateProcessAsUser returns "ERROR_BAD_EXE_FORMAT (1 9 3)% 1 is not a valid Win32 application." I see NULL as the second parameter of CreateProcessAsUser Was passing in, sending executable route to lpCommandLine (example: CreateProcessAsUser (hToken, NULL, szCmdline, ...)).

Can anyone help me solve this?

Regards, Manoj

There is a Win32 executable extension. EXE; A DLL is not executable CreateProcess can not create a single process with just one .dll. Missing. EXE is "rundll32.exe"

However, it is not what you want after that: if you want shell behavior ShellExecuteEx () is usually the most convenient function ASCAction String () may be appropriate in this case, with the correct flag: ASSOCSTR_EXECUTABLE is still not running in the case of getting executable, and ASSOCSTR_DDEAPPLICATION etc. If the application already runs


testing - Substitute reference to a remote script with local one -


This is my developing phase and the practice of testing all JS before releasing it.

Unfortunately, there are some hard references in our code and this is the reason that there is no way to test the new version of test.js on the Stage Server for me.

Now, I know that I should use Relative Path etc. But I was wondering if there is a Firefox plugin that could possibly /remote.site/test with http: / pageload / code / / /dev_path/to/test.js .js

I have tried to use the host file for this purpose but it does not work in my scenario because I need to map it only in 1 context, the whole domain No.

Do you prevent some hard-coded references from changing? This is actually the easiest answer to your problem.

Find and replace your files to replace the full link for the relative. Unless the site hierarchy is the same for development and production, then there should be no problem.


Bash alias of an svn command piped to awk -


I often type in this order, and it was trying to nick, and for no reason Was there.

for the file svn stat | Awk '{print $ 2}' `` Svn back $ FILE;

This obviously does a large number of svn reverse.

When I named it:

  alias revert_all = "for` FILE 'svn stat | awk' in {print $ 2} '`; svn back $ FILE  

svn stat goes immediately - no good

Then I try to quote double part:

  alias revert_all = 'FIV' for svn stat. Awk "{print $ 2}" `; Svn back $ FILE; Done ' 

but it does not run properly - Ajaz part is not executed (I see M value and attempts to return svn M).

Next attempt, with the single tick quotes escaped:

  alias revert_all = 'FIV' for svn stat. Awk \ '{Print $ 2} \' `; Svn back $ FILE;  

The command is not complete, is Bash waiting for another tick?

I know I can script it, or put the awk command in the file, but I'm not looking for an alternate solution, here's something I do not know. what is this?

TIA

It is very difficult to quote backpacks

Try it out:

  alias revert_all = '$ s for file (svn stat | awk' {print $ 2} '); Svn back "$ FILE"; By using  $ () , it allows quotes to be exempted from outside quotes. 

It is always $ () and more.


Is debugging complex HTML/CSS/JavaScript pages feasible? -


itemprop = "text">

Consider a complex with many user interactions, Thinking of dragging UI controls such as Outlook-like Calendar, Real-Time UI Feedback, etc. ... will such an application be debugable? I mean, you can easily move through the source code, location breakpoints, see the content of the variable, see the current call stack, use a professor to solve performance issues, Etc ...

Yes, why would not it be?

Complication means more code just to dig, but makes tools like console (.asas) easier than Firebug.


python regex escape characters -


हमारे पास:

  & gt; & gt; & gt; Str 'exit \ r \ ndrwxr-xr-x 2 रूट रूट 0 जनवरी 1 2000 \ x1b [1; 34mbin \ x1b [0m \ r \ ndrwxr-xr-x 3 रूट रूट 0 जनवरी 1 2000 \ x1b [1; 34mlib \ X1b [0m \ r \ ndrwxr-xr-x 10 root root 0 जनवरी 1 1970 \ x1b [1; 34mlocal \ x1b [0m \ r \ ndrwxr-xr-x 2 रूट रूट 0 जनवरी 1 2000 \ x1b [1; 34msbin \ X1b [0m \ r \ ndrwxr-xr-x5 रूट रूट 0 जनवरी 1 2000 \ x1b [1; 34mshare \ x1b [0m \ r \ n # बाहर निकलना \ r \ n '& gt; & gt; & gt; Print str exit drwxr-xr-x 2 रूट रूट 0 जनवरी 1 2000 बिन drwxr-xr-x 3 root root 0 जनवरी 1 2000 lib drwxr-xr-x 10 root रूट 0 जनवरी 1 1970 स्थानीय drwxr-xr-x 2 रूट रूट 0 जनवरी 1 2000 एसबीएन ड्र्वाक्सआर-एक्सआर-एक्स 5 रूट रूट 0 जनवरी 1 2000 शेयर # बाहर निकलें  

मैं सभी '\ xblah [0m' बकवास का उपयोग कर regexp का उपयोग करना चाहते हैं मैंने कोशिश की है

  re.sub (str, r '(\ x। * M)', '')  

लेकिन ऐसा नहीं है चाल किया किसी भी विचार?

आपके पास कुछ समस्याएं हैं:

  • आप गलत क्रम में गलत re.ub के लिए तर्क भेज रहे हैं। यह होना चाहिए:

    re.sub (regexp_pattern, प्रतिस्थापन, स्रोत_स्ट्रिंग)

  • स्ट्रिंग में "\ x" नहीं है कि "\ x1b" एस्केप वर्ण है, और यह एक एकल वर्ण है।

  • इंटरजे के रूप में बताया गया है, आप चाहते हैं "। *?" "। *" के बजाय, क्योंकि अन्यथा यह आखिरी "मी" के माध्यम से पहली एस्केप से सब कुछ मेल कर देगा।

re.sub के लिए सही कॉल है:

  प्रिंट re.sub ('\ x1b। *? M', '', s)  

वैकल्पिक रूप से, आप इसका उपयोग कर सकते हैं:

  प्रिंट re.sub ('\ x1b [^ m] * m', '', s)  

c# - What line(s) this code might throw a "Index was outside the bounds of the array" exception? -


A small background of this error: the customer is able to obtain this error message in his log file and reproduce the support Is not it yet? That's why I am trying to determine what may be happening. I reviewed my log file and restricted it to this section of code I had not written this code, but the purpose of this is to FTP a ZIP file on the remote server. The question is ....

What is the line that was outside the range of the "index" array? exception?

  FtpLib.FTPFactoryFF = new FTPLB FTPPFF (); Try {ff.setRemoteHost (job.FTPHost); Ff.setRemoteUser (job.FTPUser); Ff.setRemotePass (job.FTPPW); Ff.login (); // Various additional commands executed in foreach (string command in job.Commands) {if (log.IsDebugEnabled) logs. Debug ("JOB:" + job.ID + "- FTP command \" + command + "\" sent ... "); Ff.sendCommand (order); If log (enable .sdbues) log Debug ("JOB:" + job.ID + "- Response:" + ff.getLastMessage ()); } Try {{Ff.mkdir (job.FTPRemoteDir); } Hold (IOException) {} ff.chdir (job.fTPRemoteDir); Ff.setBinaryMode (true); If (log.IsInfoEnabled) log.Info ("JOB:" + job.ID + "- FTP upload: \" "+ zipfile.Name +" \ "to \" "+ job.FTPHost +" / "+ job .FTPRemoteDir + "/ \" "); Ff.upload (zipfile.FullName); If (log.IsInfoEnabled) log.Info ("JOB:" + job.ID + "- full"); BFTPSuccess = true; break; thank you in advanced! 

Update: I think we all very much agree that the problem is going to be in FTPLib, I will see that we have its source. I came to know that this is a vague bug, the customer can not be constantly reproduced, so it will be a fun pin pin. I've added extra debug logging using the exception. StackTrace and Exception After the toothstring function is resolved, I will update once more and try to give the correct answer with the right person, although everyone has given good suggestions. Thanks for the help!

I recommend that you log in with the exception. StackTrace at the point where you are currently holding boundary exceptions. Exception. ToString () is also very useful, because it gives most important information. This will tell you the exact location where the exception is being thrown (without guessing). However, be careful of that code, which spreads and hides exception - I think that the code you post has "hold (IOE expansion) {}" in addition to being careful of code which spreads the exception and then a different Throw an exception, which will hide the original error.

There should be no need to wrap in the effort ... Grab the personal lines which are suspicious - as long as any exceptions are logged and logged on to a point in the series.


Error 404 with JSP and Servlet -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 1 उत्तर

मेरे टैग का रूप टैग है JSP

  & lt; सर्वलेट-मैपिंग & gt; & LT; सर्वलेट-नाम & gt; AdminFacultyLogin & lt; / सर्वलेट-नाम & gt; & LT; यूआरएल पैटर्न & gt; / AdminFacultyLogin & lt; / यूआरएल पैटर्न & gt; & Lt; / सर्वलेट-मैपिंग & gt; & LT; सर्वलेट & gt; & LT; सर्वलेट-नाम & gt; AdminFacultyLogin & lt; / सर्वलेट-नाम & gt; & LT; सर्वलेट श्रेणी & gt; adminPackage.AdminFacultyLogin & lt; / सर्वलेट श्रेणी & gt; & Lt; / सर्वलेट & gt;  

मेरे सबलेट में हैं

नमस्ते मैं अपने आवेदन के लिए लॉगिन पृष्ठ बनाना चाहूंगा मेरे पास एक जेएसपी और सर्वलेट है मेरे जेएसपी पेज के दो रूप हैं जब मैं सबमिट बटन पर क्लिक करता हूं तो यह 404 त्रुटि कहता है। मेरे पास सर्वलेट है मैंने सबलेट मैपिंग के लिए web.xml की जांच की। मैंने पाया है कि सर्वलेट मानचित्रण सही है मैं त्रुटि 404

के कारण का कारण समझ नहीं पा रहा था सर्वलेट।


sql - MySQL syntax for Join Update -


I have two tables that look like this

train

 < Code> + ---------- + ------------- + ------ + ----- + --------- + - ------ + | Field | Type | Faucet Key | Default | Extra | + ---------- + ------------- + ------ + ----- + --------- + - ------ + | TrainID | Varchar (11) | No | PRI | Faucet | | Capacity Int (11) | No | | 50 | | + ---------- + ------------- + ------ + ----- + --------- + - ------ +  

Reservation

  + --------------- + ---- --------- + ------ + ----- + --------- + ---------------- + | Field | Type | Faucet Key | Default | Extra | + --------------- + ------------- + ------ + ----- + ------ --- + ---------------- + | Reserve | Int (11) | No | PRI | Faucet Auto_interpretation | | First name Varchar (30) | No | | Faucet | | Last name | Varchar (30) | No | | Faucet | | Deedit | Date | No | | Faucet | | Luck | Int (2) | No | | Faucet | | Route | Varchar (11) | No | | Faucet | | Train | Varchar (11) | No | | Faucet | + --------------- + ------------- + ------ + ----- + ------ --- + ---------------- +  

Currently, I am trying to create a query that increases the capacity of the train If the reservation is canceled I know that I have to be one of the participants, but I am not sure how to do this in the update statement. For example, I know how to get the strength of a train, in which a fixed reserved Given, such as:

  Select the reservation on the train. Region = Reserved. Train where Reservation ID = 15 ";  

But I would like to create a query that does this -

  Increase train. Capacity by reservation. If possible, I would like to know how to increase one arbitrary seats. As one side, after the increase in the Java transaction I I am planning to remove the reservation. Will the transaction be removed?  

Thanks for the help!

MySQL supports A, which Looks like this: Resume reservation reserved on train T (R. Train = T. TRIIDID) STT T. Capacity = T. Capacity + R. No where the R reservation ID =?

You can update the train table and remove it from the reservation table in the same transaction. Update times and If you want to delete the other, should work as long.


javascript - ID Divs in For Loops -


Working in Javascript I'm trying to duplicate a div and dynamically name it for this. None of the following appear to be done:

  var origiviv = document.getElementById ("outer square"); For (i = 1; i  

Here's the bella:

The funny thing is, it only appears repeating the div inside the "outer square". If I try to reset the ID, then all this fails. Any insights will be appreciated

Thanks, Dan P.

Use sections:

   

No ID duplication, not styling problem.

By changing the ID, you can not apply the old CSS styles. The problem was the script now if you need it then you can add the ID.


ruby on rails - How to Test JavaScript error in Capybara/Poltergeist -


I have to check that the page has a JavaScript error.

CAPBRARA-WEBKIT solution

'Prec_helper' feature 'Home' is required 'Javascript errors should not be' ,: JS => expect true (root_path) (page) .not_to has_errors end end

How do you look the same for one?

spec_helper.rb

  ... 'capybara / rails' is required 'capibara / selenium / driver' ... selenium_hb_host = "selenium" selenium_hub_port = " 100 "selenium_url =" http: // # selenium_hub_host}: # {selenium_hub_port} / wd / hub "... capebara Registrar: selenium_remote do | App | Options = {} Option [: Browser] =: Remote Capabilities = Selenium :: WebDriver :: Remote :: Capabilities Firefox capabilities [: platform] =: any ability [: le_sertence] = true option [: url] = selenium_url option [: desired_capabilities] = abilities capybara :: selenium :: driver. New (app, option) end Capybara.javascript_driver =: selenium_remote Capybara.default_max_wait_time = 30 Capybara.server do | App, harbor | Rack / Handler / Thin 'Rack :: Handler :: Thin. Roun (app, host = & gt; 0.0.0.0 ',: port = & gt; port) end is required ...  

Try this configuration:

  Capybara.register_driver: poltergeist do | App | Capybara :: Poltergeist :: Driver.new (app, {debug: true, poltergeist debug mode js_errors is turned on: true, turn on javascript errors on page timeout: 10000, pretz_pection: ['- load-images = yes',' --ignore-ssl-errors = yes', '-ssl-protocol = any']}) end cabiber. Javascript_driver =: poltergeist Capybara.current_driver =: poltergeist Capybara.default_wait_time = 5 Capybara.server_port = '3000' Capybara.app_host = "http://127.0.0.1:3000"  

images Loading and Pottage Debug mode if you do not need it.

In BTW, Capepara does not contain a has_errors matures. To use that maiture, you must use the Capibera-Webkit gem / driver instead of selenium

< P> If you use the PhantomJS / Pottage Registry with Cappaber to run your test, this test will fail and will output any error (including JS errors) ...

Also It will also output JS alerts, Which does not fail the test, but still gives visibility of the disturbances in your site ...

If JS errors are a great deal to test your product, then I use it By doing teaspoon ... ...

I suggest suggestions about Selenium WD, this is nothing for monitoring JS, on the given page errors are special tools given there. ..


ubuntu - MongoDB auth will not work -


I am running MongoDB on an Azure Ubuntu server and I can not seem to activate the authorization. So far nobody can login remotely from my DB. I have set up an administrator, set auth = true to mongod.conf , and when specified in the - auth option when starting my server has been done; Although nothing is working, do I have any options for the methods?


vba - Excel UDF to return array from ACE SQL recordset -


I'm trying to use AE SQL to return the array from the reset set. The function works well with table categories.

Issue: The function returns the correct number of records if the query returns 2 or more records. However, if only one record is found, then all rows are duplicated with one line. This is wrong but I do not know the reason.

In addition, I want my function to return the column names from the recordsetset. I do not know how to set up with the array to return from the record set

Here is the code, credits are due to the author of another solution which I am trying to adapt to my needs:

  function different application as SQL (string in the form of the datestrain, in the form of crates). Volatile Dim cn ADODB.Connection as ADODB.Recordset dim currAddress in the form of a dim string string currAddress = ActiveSheet.Name & amp; "$" & Amp; DataRange.Address (false, false) strFile = ThisWorkbook.FullName strCon = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source =" & amp; Strong_ and amp; "; Extended Properties =" "Excel 12.0; HDR = Yes; IMX =" 1 ";" Set cn = CreateObject ("ADODB.Connection") set rs = CreateObject ("ADODB.Recordset") cn.Open strCon strSQL = "SELECT * FROM [" & amp; CurrAddress & amp; "]" & Amp; _ "Where [a] = '" & amp; Crit A & A "'" & "Amp" _ "1 order by command" rs.Open strSQL, cn 'sq = rs.getString sql = application.Transpose (rs.GetRows) set RS = nothing set CN = nothing end function  

If you want a field name, you must also loop through the array from the records:

< If not for IOF again (vData, 2) + 1, LBound (vData, 1) for vdata = .getrows () redeem vDataOut (Udaada (vData, 1)) with pre> For I = 1 for Fields Count vDataOut (0, i - 1) = .filds (i - 1) .Name forward, I copy data for U = Bound (vData, 2) for V = Bound (vData, 2) Y = Lbound (vData, 1) For Example with UBound (vData, 1) vDataOut (x + 1, y) = vData (y, x) next y next x end if end end with

.


MySQL SUM cells with same ID and insert it in table -


Please help me with that: I have this table:

 id key value 1 word 1 35 1 term 2 1 word 3 40 2 word 1 12 2 word 2 2 words 3 11 3 word 1 51 3 word 2 3 word 3 23 

In every id Key column Term2 which is the sum of word1 and Term3 . And that amount should be entered in the value column. In this way:

 Value of ID Key 1 word 1 35 1 Term 2 75 1 Term 3 40 2 Term 1 12 2 Term 2 23 2 Term 3 11 3 Term 1 51 3 Term 2 743 Term 3 23 

Thanks!

If you want to update the table, use join :

  Add the update table to T (add value id to sum as yoga (id 'by' '1', 'term3') key in the group) T.id = tt.id TT set T.value = tt.sumvalue where t.key = 'term1';  

Note that the key is a keyword in MySQL (and in general SQL). I keep the name, because in this way the question is a question.


Multiply nested pairs of list values in Clojure -


I'm finally trying to do, increases two vectors together and returns to a vector of the same size As is:

  [6 7 8 9 10] * [0 1 3 1 0] => [0 7 24 9]  

I was trying to do something like this:

  (Partition 2 (Interleave [6 7 8 9 10] [0 1 3 1 0])) =) (6 0) (7 1) (8 3) (9 1) (10 0))  

... then multiply each nested list value and flatten To get:

  (0 7 24 9)  

But I can not understand how I can increase nested list values ?

In order to combine each sequence with the respective member of the other sequences, more than one sequence and one Takes the function.

<> User & gt; (Map * [6 7 8 9 10] [0 1 3 1 0]) (0 7 2490) User & gt; (Map * * [6 7 8 9 10] [0 1 3 1 0]) [0 7 24 9]

In this case, this code will be sent to * Creates a number of calls from each list first, then from each list to another, and so on, if you prefer output in a vector mapv it is convenient


c++ - Is there and neat equivalent to view a member function/variable? -


To view a category by the member function

is a clean map function whether there is a similar view is?

What would see: transform? be the only option?

Example from the article:

  std :: vector widgets = * ... * / std :: set ids = stream :: MakeStream :: from (widgets) .map (& widget :: getId) .to_set (); Ignore random template arguments for  

( std :: vector and std :: set - v3 will:

  std :: vector & lt; widget & gt; widget = // ... std :: set & gt; widget :: id> id = widgets :: borders :: view :: Change (& widget :: getId);  

Yes, change is the equivalent of the map in the stream.

Accept all algorithms in category-v3 to allow algorithm to select category elements based on conversion For example, we can sort the widget by our code:

  widgets | = categories :: Action :: Sort (Study :: more :: Widget :: id> gt;;}, and Widget :: getId);  

What is "Cloud SQL connection error 2" on Google Cloud SQL? -


कृपया App Engine / Cloud SQL टीम के साथ इस मुद्दे को वोट दें:

< P> मैं अपने चालक के रूप में Google क्लाउड एसक्यूएल को एक्सेस करने के लिए App Engine पर जा रहा हूं। जैसे-जैसे मैं कई लेन-देन जोड़ रहा हूं, मुझे यह त्रुटि मिलती है:

क्लाउड SQL कनेक्शन त्रुटि 2

Google पर इसके लिए खोज कोई भी वापस नहीं लौटाता है परिणाम है। इसका क्या मतलब है? मुझे लेन-देन शुरू करने की कोशिश में त्रुटि मिल रही है।

मेरा कोड ज्यादातर समय काम करता है और केवल अंतर से विफल रहता है, इसलिए मुझे विश्वास है कि यह मेरा कोड या एसक्यूएल स्टेटमेंट नहीं है।

  • अद्यतन :

    • डेटाबेस को पुनरारंभ करना एक अंतर बनाने में प्रतीत नहीं होता
    • मैंने एक वैकल्पिक MySQL ड्राइवर का उपयोग करने की कोशिश की < कोड> github.com/ziutek/mymysql और सटीक समान परिणाम प्राप्त हुए।
    • मैंने लेनदेन को समस्या के एक स्रोत के रूप में भी समाप्त कर दिया है।
    • यह केवल कुछ समवर्ती प्रश्नों के साथ होता है
  • >

    मैंने बादल एसक्यूएल के साथ ऐप इंजिन पर जाने का उपयोग करते हुए इसी तरह के मुद्दों में भाग लिया, जो बादलों के उदाहरण के लिए बहुत सारे कनेक्शन बनाने से संबंधित था। मैंने अपने कोड को init के दौरान डीबी के लिए एक एकल कनेक्शन बनाने के लिए बदल दिया है, जिसमे मैंने पूरे कार्यक्रम में पुन: उपयोग किया और क्या लगता है, काम करने के समान है।


    Ruby temporary variable assignment and modification -


    I have a word "cap", and I want to create a new word that is exactly the same, but different final characters . The word "word # word" is "temporarily # # {temporary}", which is called "temporary" # {# temporarily} "

      word =" hat "temp = word temp [temp.length-1] =" d " # Output: # temporary had # words  

    Now I had the temporary = "was" and word = "hat" but both The words have to be changed!

    I have a hump that can be with both variables pointing to one place in memory?

    Why is this happening, And how can I keep both values?

    How can I keep it?

    Use dup this object

      word = "cap "Temp = word.dup temp [temp.length-1] =" d "puts" temporary # # temporary} "," word # {word} "# output: # temporary word is #hat  < / Pre> 

    c# - How should I save country in database with .NET backend -


    Using NAT in the backend, I asked myself what is the best way to store the name of the country with the customer service email address.

    Should I use two linguistic language names or LCID

    Is it more unique or better suited?

    Neither culture than that of both countries, if it really is what you want, then LCID .

    If you want to deposit the country, then the name of the country (the guarantee of being unique) or two letters the country code of that country (not the language name).


    ios - Adding section and index list with custom cell, searchdisplaycontroller -


    I have created a UITableView with custom code; Archived names, no, these cells have pincode.

    My code for array here: -

      for (int i = 0; i & lt; [tempArr count]; I ++) {NSString * RawData = [tempArr ObjectAddindex: i]; If (raw data! = Zero) {individuals * newpros = [[person alloted] init]; NSArray * Data = [Raw Data Component Separated Bettering: @ "\ t"]; NewPerson.name = [NSString stringWithFormat: @ "% @", [Data ObjectTitaxx: 0]]; NewPerson.no = [[Data ObjectTitx: 1] Integer Value]; NewPerson.pincode = [[Data ObjectTitx: 2] Integer Value]; [All Parson adobject: Nupeter]; }}  

    This is my Customcell.h

      @ interface Kstmsel: UITableViewCell @property (weak) person * person; UITableView Datasrouce method: -  
      - (UITableViewCell *) Talikadrishy: (UITableView *) Table View Selforruatindappath: (NSIndexPath *) Suckankpth {Kstmsel * cell = [tblStations dequeueReusableCellWithIdentifier: @ "personCell"]; If (tabular view == self .searchDisplayController.searchResultsTableView) {cell.person = filteredContentList [indexPath.row]; [Cell.textLabel setText: cell.person.name]; } And {cell.person = allPersons [indexPath.row]; [Cell.textLabel setText: cell.person.name]; } Return cell; }  

    How do I stream & amp; Index list for all names of J & amp; A; Title from Cell.textLabel.text?

    But it has a stable key & amp; Name to association , NSArray . has been added to.

    In my example, I do not know how to get started in the name array starting from the same letter. I am also using UISearchDisplayController for the search person name.

    I have the number of sections and amp; Name for those classes that are dynamically named in the title or cell.textLabel.text.

    I do not know about UISearchDisplayController, these sections & amp; The index list will be displayed in the UISearchDisplayController, so I have these sections & amp; Pointer list during search.

    You need to spend some more time in trying to make their questions more clearly.

    Add the required UITableView is a custom implementation of the data source and delegate methods ...

    Note My impression is that your variable allPersons a NSMutableArray .

    Note that these are not included in the data sets of your search results!

    Return a NSInteger to your UITableView ...

      - (NSInteger) numberOfSectionsInTableView the number of sections in: ( UITableView *) table view {NSSet * setData = zero; NSInteger integerData = 0; SetData = [NSSet set defers: allPersons]; Fulldata = [set data count]; Return full data; }  

    UPDATE

    Return a NSString for the section heading title ...

      - (NSString *) Table view: (UITableView *) Table view title ForHeaderInSection: (NSInteger) section {NSOrderedSet * setData = zero; NSString * stringData = Zero; SetData = [ordered by NSOrderedSetSat with Array: allPersons]; Stringdata = [[setData allObjects] componentsjointedbest string: @ ""]; Return string data; }  

    ... plus others if I have the time ...


    swift - Add a scroll view to a set view hierarchy -


    I have a visual controller with many sub-views, all connections have been created. I've found that now let me see to allow all the contents of a scroll smaller screen sizes.

    My question is how do I add a scroll view to the top of the visual hierarchy and scroll all the scenes?

    In advance thank you

    Make the first UIScrollView Will require all your subviews, then you can repeat through all your top-level subviews and transfer them from your supervision and instead of the scroll view.

    Your UIViewController :

      // You need to handle auto-size, frame adjustments, and auto-layout content, view it in the view itself For scrollView = UIScrollView (frame: self.view.frame), go to {//} Take all the subviews in the main view of the scroll view for the subView in the selfview.view.subviews [UIView] {subView.removeFromSuperview () scrollView Enter the .addSubview (subView)}} // scroll view as the first subview self.view.insertSubview (scrollView) As mentioned, you can see these views (automatically Layout and facade, barriers, etc.) will handle. 


    sql server - How do I monitor a subset of logins with sysadmin role to find out if they are still in use? -


    How do I see a fixed sub-logon of log-in, to find out that they are still in use I would like to remove them, but they should not run the risk of deactivation if used.

    I got the following code on mssqltips.com which works almost, but this test generates about 5 million records a day on the server and I do not know why anyone has another solution Or know how to fix this code, it will only be hosted when the system logs in with sysadm role?

      Make Table Tabo. Auditis EdinLogin (AuditEndIntInt Identity (1,1) No, Event Time Datetam Null, ServerLogin NYAARAAR (100) Faucet, Contract PK_ Audit SysAdminOologin Primary Key Clustered (Audit AventIDIDID)); Go Master Master; To create a trigger, start on logon at triglogon_heckForSysAdmin if you start (sysserver_role_members srm from sysserver_role_members srm srm.member_principal_id = sp.principal_id WHERE role_trustion_id = (SELECTSERVER_principals WHERE NAME = Sysadmin ') and sysserver_role_members srm from JOIN sys.server_principals sp sr Enter ORIGINAL_LOGIN () = sp.NAME) DBAWork.dbo.AuditSysAdminLogin (Event Time, Server Login) Value (GETDATE (), ORIGINAL_LOGIN ()) end; End; Your script sees that it will work as a design. GO  

    Looks like you have In reality, Sisdomin accounts for 5 lakh times per day. If you do not need to enter every single login, and you are okay with accumulating recent login time, then you can change your trigger to merge as follows (table by applying this First must be chipped):

      Using Merge AuditSysAdminLogin AS (selections from SP Principal_ID) sys.server_role_members srm JOIN sys.server_principals sp sr srm.member_principal_id = sp.principal_id WHERE ROLE_principal_id = (SELECTSERVER_principals From SELECT principal_id WHERE NAME = 'Sysadmin') and new as ORIGINAL_LOGIN () = sp.NAME) Login.Principal_Id = NewLogin.ServerLogin on audit when the audit set is updated. Eventime = GETDATE () when INSERT (ServerLogin, EventTime) values ​​(Principal_ID, GETDATE) ());  

    If you want to capture the number of logins, you can also add a BIGINT field and increase the merge statement.

    Note - Running this type of trigger can have a dramatic effect on the performance of your SQL Server. I do not recommend running it for a long time.


    Deploying Yii2 app to shared host steps -


    I find it weird that it is too low, (if any) to employ a shared host to the Yii2 app Details of ideas

    Is there a process you follow which minimizes issues / errors?

    > How does DB migrate (with data)? I am convinced that I can export / import DB, copy the UI app folder directly, but is it very simple?

    read this page first

    Yes about files, just copy them If your host allows you SSH access (but not guit) then you can copy them very quickly with rsync (so that you can use composer on your computer etc.) and deploy via SSH Are). I have made a script which does the same thing with FTP at 1 point but it was very slow because I have closed the websites for shared hosting.

    In relation to the migration, For example, make sure you read the answers and comments as well as follow that link.


    sql - Postgres trigger after insert accessing NEW -


    itemprop = "text">

    I have a very simple trigger:

      can be created or repositioned FUNCTION f_log_datei ( ) Log back in to TRIGGER $$ (Actions, Tabel, Bennetzer_ID) Value (TGOP, 'Dedan', New. Banner_ID); End; $$ language 'plpgsql'; The process executed by each statement f_log_datei (); After updating or removing or deleting the date, create the logger_log_data.  

    My table log is as follows:

      CREATE TABLE logs (ID int primary key default NEXTVAL ('logs_id_seq'), now the title timestamp default (), Ekton Kerr (6), Tabell Warker (32), Alt Varkar (256), Nur Vararar (256), Bennetzer_IndeInte Banner (ID) references);  

    After entering something into the files, I get the following error:

      Error: The record "new" is not assigned yet: DETAIL does not have one taple The structure-assigned assign records are uncertain. Context: Enter the SQL statement "Log (Aktion, tabelle, benutzer_id) value (TG_OP, 'files', NEW.benutzer_id)" PL / pgSQL function "f_log_datei" SQL statement line 3 < / Code> 

    Why did I get this error? I looked into the documentation and it seems that they use it in a new way the same way.

    / Strong>
    [...]
    For a row-level trigger, enter NEW in line INSERT and UPDATE code> trigger, and / or OLD for the line UPDATE and DELETE . Statement-level triggers There is currently no way to check individual row (s) modified by the statement.

    and from:

    new
    data type records ; The variable that holds the new database line for INSERT / UPDATE is in the row-level trigger. This variable is for NULL statement level triggers and DELETE functions.

    Note that this line-level triggers and statement -live trigger.

    You have a statement-level trigger:

      ... process executed for each statement f_log_datei (); Statement-level triggers are triggered once per statement, and one statement can be applied to multiple rows, so that  the affected row  (which is  NEW  and  about OLD  are not applicable). 

    If you want to use NEW (or OLD ) in a trigger then you trigger to execute for each affected row And this means that you are a line-level trigger:

      After inserting or updating, you can create TRIGGER log_datei or DELETE RAW out execution process on files for each f_log_datei () ;  

    I have just changed for every statement to for each line .


    Also need your trigger:

    A trigger function should return either NULL or a record / row value The table was properly triggered.
    . .]
    The return value of a line-level trigger is removed after or a statement-level trigger is removed by first or after are given ; It may also be as null as well, however, any of these types of triggers can still cause an entire operation by lifting the error.

    Then you should new Return; or returns zero; In your trigger you have one after the trigger, so no matter what returns you use, but I back new; .