Posts

Showing posts from February, 2011

Where in a domain model is it best to keep a reference to the current user? -

How should the current user pass the repository classes? The connection string used by the repositories requires the current user's credentials. Should each repository be replaced immediately after the user name and password pass as the controller parameters? This would mean that every domain object should be having a repository and be aware of the current user. Is it best to keep a reference to the current user in my domain model? Looking at your details, I pass the current user some kind of "ApplicationContext" object Will happen. It will be similar to ATP.NET in the form of the HTTC Contex / session or any kind of singleton form.

stored procedures - How can I copy all fields of one table to another, wider table in SQL Server 2005 Express? -

I know that my title is not quite right, so make me clear. I'm using SQL Server 2005 Express. I have a table that basically stores "template", if you do. Using a car as an example, the field will look something like this: Template ID color make model Now, I have another table that The template "represents the instance" contains all the fields in the template table and some fields that are unique to an example: Instant VIN Serial Number Color Make Model I'm typing a new row in the "Instance" table Stored procedure Alne will input parameters for the stored procedure "VIN" and "serial number", but I want to copy it to the appropriate "template" and "color", "make" and "model". The template is located by "Template ID", which is already known. I am looking for advice on how to write this stored procedure. It would be easy if this is not the fact that 100 fields in ...

PeopleSoft Crystal process remains queued if part of PSJob -

I'm being mad with some people, which I'm scheduling. Job group and PSJbS crystal processes with crystal will not initiate the process (or I'm trying any other Cyrstal process) if independently scheduled but PSJob or job form with any of the crystal job conditions before they Living = Queued. I have spent Google one day reading Metallank, etc. Anyone got any ideas? Cheers Carl I did this when it worked on the Unix process scheduler And, as you probably know, the crystal will only run on a window process scheduler, the solution was to force the entire task to run on a window process scheduler.

javascript - Cross domain and google CDN for jquery -

Google does not use CDN to break jquery rules on not using cross domain requests on a web page Do you rely on Google to do enough? The use of script tags from any foreign website is allowed to own the browser because it is believed that you Want to load functionality? The loaded scripts are not able to directly communicate with the foreign domain (except for the CRS, the core of the XHR), it is just that you do not want to allow for un-checked user input, Can load a script from It is possible for a foreign script that you do not want, but if it is from a reliable source, then it should be fine. If Google was caught in order to use injections through his CDN, there would be serious reactions, and I suspect that it will happen anytime, and if this happens, then faster than that You will also be rectified as much as you will pay attention to this issue.

newline - awk won't print new line characters -

I am using the code below to replace the existing code so that I can get more and more cases with a simple command Can add ancho 'ajek' {if ("# $ 1") = "\" "$ 0" \ n "} and {print $ 0"}} 'Tf.a Note that the first print "pref" is "$ 1" '= 0 \ n " so it is referring to the variable $ 1 In your environment, no awk . Command ./tfb.a "c" should be replaced with code: BEGIN {# append1} ... to: BEGIN {prefc = 0 # append1} ... Does anyone know why this is? If you take awk out of the equation, then you can see what's happening: # Use a small test file Which is an awk script $ cat xxx hello there $ echo `cat xxx` hello is e $ echo" cat xxx` "hello there $ echo" $ (cat xxx) "hello there $ The backtick operator quickly expands the output in the shell "words". You can play with the $ IFS variable in the shell (yoke), or you can onl...

unicode - MonoTouch Comparing Strings -

I have an app that lists many languages. In the app I compare language names. When I do not compare the names of languages ​​with any accent, it works and its comparison is correct. When I compare languages ​​with accents, it does not seem that they are equal. In this case they are not equal (but must be). language = "español"; MonoTouch.Foundation.NSString s = New MonoTouch.Foundation.NSString (language); MonoTouch.Foundation.NSString = New MonoTouch.Foundation.NSString ("Español"); In this example, they are equal (notice not accent). language = "Deutsch"; MonoTouch.Foundation.NSString s = New MonoTouch.Foundation.NSString (language); MonoTouch.Foundation.NSString = New MonoTouch.Foundation.NSString ("Deutsch"); I have tried the cultures, no benefit. Am I missing some basic point here? I am using MonoTouch 1.4.4 The following matches like you Ignoring the accent: var language = "español"; MonoTouch.Foun...

c++ - utf-8 to/from utf-16 problem -

I am based on an answer on these two conversion functions and stack overflow, but changing back and forth does not work : std :: wstring MultiByteToWideString (const char * szSrc) {unsigned int iSizeOfStr = MultiByteToWideChar (CP_ACP, 0, szSrc, -1, NULL, 0); Wchar_t * wszTgt = new wchar_t [iSizeOfStr]; If (! WszTgt) thrust (0); Multibytovider (CP_ACCP, 0, SSRC, -1, WSJTTGT, ISIEFFST); Std :: wstring wstr (wszTgt); Delete (wszTgt); Return (wstr); } Std :: string WideStringToMultiByte (const wchar_t * wszSrc) {int iSizeOfStr = WideCharToMultiByte (CP_ACP, 0, wszSrc, -1, zero, 0, zero, zero); Four * szTgt = new four [iSizeOfStr]; If (! SzTgt) Returns (NULL); Wide-Chartamultibout (CP_ACP, 0, VSSSCR, -1, SGTGT, ISIEF, Null, Faucet); Std :: string str (szTgt); Delete (szTgt); Return (STR); } [...] // は て な ブ utf-16 wchar_t wTestUTF16 [] = L "\ u306f \ u3066 \ u306a \ u30d6 \ u306f \ u306f"; // shows the text correctly: messagebox (zero, wTestUTF16, L "message", MB...

urllib - Parsing Python Response using httplib -

After connecting to the socket and using the response .read () how I parse the input stream and read the lines Can i I think the data is any CRLF gt; And & gt; Title & gt; Title & gt; ApacheTamac / 6.0.16 - Error Report & lt; / Title & gt; & Lt; Style & gt; & Lt ;! - H1 {font-family: temohoma, aerial, non-serif; color white; Background color: # 525D76; Font-size: 22px;} H2 {font-family: Tahoma, aerial, sans-serif, color: white; Background color: # 525D76; Font-size: 16px;} H3 {font-family: Tahoma, Ariel, non-serif; color white; Background color: # 525D76; Font-size: 14px;} body {font-family: Tahoma, Ariel, Sans-Serif; color black; Background-color: white;} b [font-family: Tahoma, aerial, non-serif, color: white; Background-color: # 525D76;} p {font-family: temohoma, ariel, non-serif; Background: white; color black; Font-size: 12px;} a {color: black;} anonymous {color: black; } Hr {color: # 525D76;} - & gt; & Lt; / Style & gt; & ...

Code reuse tools -

I usually maintain the code snippet which I can change in Wikipedia personalized wiki with a small index page I can take any code that I want. I want to share these snippets with my team and I'm looking for easy ways to do this. Is there any device that will help me set up such repositories? Or should I just install a wiki and close my personal wiki? Thanksgiving Google Docs, maybe? The search-key key is for anyone to have time to organize cross-indexes, keyword-stuffs, and complex snapets. Also, remember that when any code is rediscovered, then they also use the bugs, limitations, and display problems again later in the revision the code may be used again. The best way to do this is not a copy, but rather to document it and make it accessible to direct for reuse.

problem with mysql query when password like \/' -

mysql तालिका नाम (user_login) में और मुझे login_name और password जैसे क्षेत्र हैं I मैंने login_name के रूप में एबीसी और पासवर्ड के रूप में / '(विशेष प्रतीकों जैसे \ /') दर्ज किया है। और मेरी क्वेरी है लॉगिन से पासवर्ड का चयन करें जहां पासवर्ड की तरह '/' 'और मुझे एसक्यूएल सिंटैक्स त्रुटि मिलती है आप कॉल किए जाने वाले किसी भी भाषा में पैरामीटरयुक्त क्वेरीज़ का उपयोग करना चाहिए। सावधान रहना

Unicode symbols (arrows) in Java -

I want to use the following symbols for the button in my app: My code here: button goToFirstButton = new button ("\ uE318"); Button prevPageButton = new button ("\ uE312"); Button nextPAGE button = new button ("\ uE313"); Button goToLastButton = new button ("\ uE319"); More results It looks like \ uE318 and \ u331 are wrong. What should I use instead? I like to use these images for GoToLastButton and goToFirstButton But I can not find what code I should use. I would recommend using symbols on buttons instead of special characters, because the ability to display the client The availability of fonts on the workstation can be greatly affected.

android:background="" is giving error -

I do not have to give any background to the activity. When I leave this property empty, I get an error. And I have tried to use @null as a code, but it shows a black background. Can someone guide me, how can I make it transparent? You should use styles such as res / values ​​/ styles.xml , there is a theme definition: & lt; Style name = "myself" & gt; & Lt; Item name = "Android: Background" & gt; @Android: Color / Transparent & lt; / Item & gt; & Lt; Item name = "android: windowIs floating" & gt; True & lt; / Item & gt; & Lt; / Style & gt; As far as I know, you have to set the window floating, otherwise the runtime will not bring a translucent backdrop (possibly due to the performance reasons ... but I did this between the platform reload Seen behavior change, you can try without first). Then set the topic of your activity in the manifest: & lt; Activity Android: name = ".....

iis 7 - Programmatically retrieve requested protocol with c# from web farm load balanced with ISA -

Scenario: A basic framework on which a website has been created in front of ISA Server Web form, This ISA server eliminates any website's SSL and requests between ISA server and IIS 7 server are always on port 80 (HT). Therefore: Clients> [Https]> ISA> [http]> WebFarm (IIS) Question: What is the original request in C # ISA) It is possible to get protocol information from the IIS always think that the request is being made at http (as it is). I can obviously use this JavaScript but for various reasons (when the information in the life of the page is required). I want to be able to do this before rendering / presentation I am My thoughts: I feel as if some information can be added, the information of the head of the OIS on going through ISAs

multithreading - Is this really returning a local addess? -

I have some code that creates a synchronized queue that I use to use data in a data gathering class I use The method that creates a queue is kicking a warning: line %% datagram :: addOutputQueue () {Queue ^ outputQueue = que :: Synchronize (gcn queue); AddOutputQueue (outputQueue); Return output queue; } 1>. DataGatherer.cpp (21): Warning C4172: Local variable or temporary back address Is this a warning: Should I be worried about this matter or am I in this case safe and this Just confusing queue :: synchronized to the compiler Queue ^ is returning? The code runs fine, but the warnings bother me; -) Q ^% indicates that the handle is passed by reference going. However, the handle inside the funk is a local variable which can not be passed by reference because it is probably destroyed when the function is finished. Remove % from return type and you're okay. EDIT: This does not mean that your code is not anything to work on. It can stop it from happening...

javascript - Jquery autocomplete -

I want to activate jQuery auto-complete in a text box when the user enters a particular character like @ Is when the user reads after typing "joi" in their email address like john@gmail.com when the user enters text in "@", then autocomplete should be activated , And the list should display the mail extension ("Gmail.com," "Hotmail.com," "rediffmail.com," D). var mail provider / {@ @ gmail.com}: 'Google Mail': It is difficult to read your exact question / problem, but perhaps you are looking for something like: 'Hotmail.com.com': 'Windows Live Mail', '@ Blizzard.com': 'Omgi GIF Gold! 1 '}; $ ("#InputFIELD") Change (function () {Provider = string ($ (this) .val ()). Partition ('@'); if (provider.length == 2) $ ("# infospan") .HTML (Mail Provider [Provider [ 1]] and $ ("# infospan"). Html ('');}); This & lt; span id = "infospan...

actionscript 3 - How to get the memory size of an ArrayCollection in Flex -

I have created an image cache, which has an array of images, I have created the functionality so that the maximum amount in the cache is 250 Can be images. However, images can be of a different size, so it would be better to limit the total memory size of all the images in ArrayCollection. Does anyone know how I can get the total memory size of an ArrayCollection without loop without all the objects in ArrayCollection? I'm not sure that you can do my advice based on ArrayCollection (say, ImageCacheCollection) A new collection class keeps track of the archive the current memory size and its memory limit before adding an image to the collection, you make sure that Memory limit will not exceed If it is not, then you should compile the collection of the current memory size Switch to image file adding process to add size.

database - Stock movement in PHP -

I have a software in PHP and Postgrades that I use for invoicing I am running a stock management system I have made that I am trying to create a stock movement page where I can see when a part came, where it was released and when and when was given credit (if it was). I am running 5 tables for stock. My main part is part2vendor, parts, expense, wo_parts and int_part_issue. When I receive the stock, this table goes into Part Vendor 2 (the increase in the number of increments increases) expenditure table provides details of the part number, supplier invoice and date received. Wo_parts stores the part number issued to a program Int_part_issue occurs when I make stock adjustments or use any part internally. I am looking to create a PHP table which lists the part of the 'Paper Trail' (in the order of the date). If necessary I can tell you table names and columns Thank you. Looks like you need a simple history table? Column part_history id part_id date_modified (timestamp...

internet explorer 8 - Ajax modal popup extender not working in IE 8 -

मैं एएसपी.नेट 3.5 वेब फ़ॉर्म, एएसपी.नेट एजेएक्स और एएसपी.नेट एजेएक्स कंट्रोल टूलकिट का उपयोग कर रहा हूं। मेरे पास छवियों की एक श्रृंखला है, जो छोटे आकार में भरी हुई है। जब मैं उस पर क्लिक करता हूं, तो मैं एक बड़े आकार पर एक मॉडल पॉपअप के रूप में प्रदर्शित करना चाहता हूं। मैंने इसे लागू किया है, बड़ी छवि को एक पैनल में दिखाया गया है यह मोज़िला फ़ायरफ़ॉक्स 3.6, गूगल क्रोम 4 में ठीक काम करता है, लेकिन मोडल पॉपुल को IE 8 में पेज के निचले भाग में दिखाया गया है। पॉपअप देखने के लिए मुझे इसे नीचे स्क्रॉल करना है, इसके बजाय इसे बीच में दिखाया गया है फ़ायरफ़ॉक्स और क्रोम के लिए स्क्रीन। मुझे क्या करना चाहिए? पर्यावरण: विंडोज 7 एक्स 32, वीएस 2008 एसपी 1, .नेट फ्रेमवर्क 3.5 एसपी 1। धन्यवाद संपादित करें एक updatepanel सामग्री सामग्री के अंदर मेरे पास एक सूची दृश्य है जिसका आइटमटप्लेट है: & gt; आइटममेटलेट & gt; & LT; टीडी & gt; & Lt; एएसपी: इमेज की चौड़ाई = "200 पीएक्स" ऊँचाई = "200 पीएक्स" आईडी = "थंबनेल" रनत = "सर्वर" इमे...

perl - Is there a module which gives me an output of two colums ( or more ) on STDOUT? -

Is there a module that gives me the output of two columns (or more) on STDOUT? #! Use / usr / bin / env perl warnings; Strict use; Printf "% 0.3d \ n", for $ 1.1 .. 100; I have to make 1-50 in the first column and 51-100 in the second. Use text: column qw (format_array_table); Print Format_Are_Table ([Map [$ _, 50 + $ _], 1..50], [6, 6], [QW (First Second)]); Or, if you are on a Unix system, then through pipes. Open column, '| - ', QW (PR-T2); Print Column "$ _ \ n" for 1..100;

How do I store an NSMutableArray to Disk on an iPhone app for later retrieval? -

How can I archive NSMutableArray on disk on an iPhone app for recovery later? Easy saving in NSArray (as well as other Asset List Objects) file / + (id) array content contentoff: (NSString *) write aPath - (BOOL )Foli: (NSString *) path atom: (BOOL) flag For more information this may be useful for reading in Apple documents.

c# - Response.Redirect results in "Object moved to here" -

I am working on a C # ASP.Net page which usually redirects to a "file:" URL . It seems that in majority of cases, they work fine in most of the time, but occasionally (and, on my examination system, apparently always) instead of redirecting a file, I have the text "Move the object here" A page is found, where is the link to the "here" file that I was trying to redirect, but with two four slashes of colon (i.e., "file: ////testersver/docs/testdoc.doc" ) It is common A "system. Threading. Thread Ebert exception was being canceled thread" is the message. I looked elsewhere for the solution and found some interesting things about the reaction. ThreadAbort exception, but this does not appear to be a fundamental problem - it seems to me that the real problem is "the object is moved here" is the message that causes the exception to be thrown out. Any suggestions on why I am getting ...? Edit: I forgot to mention I'm...

c - Is my Switch statement incorrect when using strtol? -

# अधिकतम 100 पूर्णांक * पी परिभाषित करें; Int * tos; Int * bos; शून्य पुश (इंट आई); इंट पॉप (शून्य); Int main () {int a, b; चारों [80]; P = (int *) malloc (अधिकतम आकार * (int)); / * स्टैक मेमोरी * / if (! P) {printf ("आवंटन विफलता \ n"); बाहर निकलने के (1); } Tos = p; बोस = पी + मैक्स -1; Printf ("\ n आरपीएन कैलक्यूलेटर \ n"); Printf ("पूर्णांक मोड के लिए 'आई दर्ज करें \ n"); Printf ("फ्लोटिंग प्वाइंट मोड के लिए 'एफ' दर्ज करें \ n"); Printf ("छोड़ने के लिए 'q' दर्ज करें \ n"); Char * endptr; करना {printf ("& gt;"); Scanf ("% s", s); इंट वेल = स्ट्रॉटल (एस एंड एंडप्टर, 10); If (* endptr == '\ 0') {// printf ("केवल पूर्णांक:% d \ n", val) मिला; } अन्य {printf ("ऑपरेटर:% s \ n", एंडप्टर); Printf ("पूर्णांक मिला:% d \ n", val); } / * परीक्षण * / स्विच (* एंडिप्ट) {केस 'आई': प्रिंटफ़ ("(पूर्णांक मोड) \ n"); टूटना; मामले 'एफ': prin...

Find out what classes implement an interface in .NET-documentation -

It may be a little silly, but where can I find a reference (no code) that tells me which class .NET-Framework) Apply an Interface? Is it also available? I'm thinking about a list obtained in a Java-API documentation "All Known Implementation Classes" (for example here :). Currently, I am thinking that if classes are done to implement " IDictionary " if this is the case but I had met this problem many times ... By the way, I have come to know how to do this in code, like this: kind regards There is no relevant official document that will tell you. Whenever I should find out which comes from a given interface, I use it. Valid, it will only report the derived types that are currently present in the assembly list you load on the device, but this is a good start, and you can always load more assemblies to get a more receptive answer.

assemblies - How to reference WPF style keys defined in a separate assembly in another library -

I have two libraries and one application assembly layout and I'm thinking how I can reference their keys. WpfControls.dll - Common reusable controls such as a WPF based NumericUpDown control as well as other basic controls and some styles as well as I reuse Somewhere I want to make. For example, the key of my style is defined as MyButtonStyle . SpecializedControls.dll - Our application is specific to those that control such as custom composite controls and user controls in WPF. This is where I would like to refer to the MyButtonStyle style defined in the WpfControls.dll assembly. Application.exe - This is the use of defined controls in the assembly SpecializedControls.dll assembly. I have explained some examples of how to do this with a simple single control library and application assembly, but in my case I have two assemblies and one application then in my case other words In, I do not have App.XML in my second control library where I can use the concept of...

php - Using values inside a function out side -

Is it possible to use values ​​that are received within loop / function outside the loop / function, where Is it used or called? Below is my job function closed ($ border) {$ string = file_get_contents ("feed.xml"); $ XML = simplexml_load_string ($ string); Forex Currency ($ xml-> Found-> as CAT $ location) {$ limits = $ place-> CORDS; $ Rate = $ place-> Stars; $ Phone = $ place-> phone; }} Calling it in a php file containing html tag is it possible to get values ​​that are returned in the rows by the function which marked xxxx to display goes? & lt; Html & gt; & Lt; Body & gt; & Lt ;? Php off ('57854'); ? & Gt; & Lt; The width of the table = "200" range = "1" & gt; & Lt; TR & gt; & Lt; TD & gt; Xxxxx & lt; / TD & gt; & Lt; TD & gt; Xxxxx & lt; / TD & gt; & Lt; TD & gt; Xxxxx & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR ...

Best technique to search for matching substrings with Linq & SQL Server -

I need to find rows in the table with 200,000 entries. Some people can not think of this 'big' , But enough to tell performance ideas. In the table, strings are only digits, for example, the user can enter something like '12340-0560-78', or some fraction of it, e.g. '0560', and I need to match prices 12345678 and 123405678 and 0123456780 etc. These NDCs are national drug codes, and in spite of the standard manufacturers have given them their By adding or subtracting zero in different positions in barcode, in different ways. I remove the zero and non-numeric characters from the search string and work on the column after removing all its zeroes. It is very slow. So I added a calculation column to the table, in which the Search column contains all the zeros. It's better, but I'm still scanning a table due to joining. Then I prepared a full text index, but I realized that with full text index I can not search for substring, only words, phrase...

asp.net - How do I design the file storage issue? -

I am working on an application that creates video files and stores them in a folder in C: \ Drive I think that in future there will be a large number of these files and we will end up out of disk space some time (on our VPS). When the time comes that we have to upgrade, we either plan to store files to any of the cloud providers, or our current provider can add another disc (called D: \ drive). Either way, I would like to design the app in a way that in the future, going to different places will not be an issue and will be transparent to the end user. The code that creates these files supports 2 methods: myObj.SetOutputToDisk (& lt; path to store & gt;); Or myObj.SetOutputToMemoryStream (MS); If we go with Cloud Architecture, I think we can have the following combination: Cloud files + existing VPS or Cloud Files + Cloud Windows Server Looking at the unknown at this time, how do I design it? The files are served from the subdomain: media.yourdomain.c...

c# - Binding a BindingList to a collection -

I have a library that provides a collection like this: Public IEnumerable Alert {. .} And I want to convert this collection to a binding list for use in the GUI. What is the best way to get a bindings list synchronized with an inimerable collection? Edit: For this problem, assume that I have no control over the library and uses the actual implementation list. But I do not want to touch this code This library has a good interface with AddAlert, RemoveAlert etc. What is the best way to synchronize the GUI with all these changes? Assume the class you are wrapping, assume that insert Things like, you just click the from the bidding list & lt; T & gt; , overriding some major methods - like something: class MyList & lt; T & gt; : Baiding list & lt; T & gt; {Private Redoni Fu & lt; T & gt; wrapped; Public Malice (Foo & Lt; T & gt; Wrapped): Base (new list; T & gt; (wrapped. ITIs)) {this.wrapped = wrapped; } Secure Override Ze...

Find records that do not have related records in SQL -

I have 2 tables (order, order items) that are based on column order ID. I need to find all the orders that do not have any order. meets the table, then selects without any order items. Using `IN 'is considered to be more efficient. Select from the order * Left Out Exclude Sequence Items I at I.OrderId = O.Id where I.Id is empty

Java wiki engine -

There are so many I am currently looking for a good light wiki, like some community wikis on some stack overflow, Which can be easily integrated into the execution. I personally use it lightweight, easy to use, and clearly java Uses you leave it in only one application server, you can make some small conversion changes and you are golden! I set it as a wiki of my company and it works very well.

Getting facebox to work in the qcodo/qcube php framework -

I am using a framework called qcodo (which is made as qcubed) and one PHP framework is When someone clicks a link and is shown in the bottom line 47. Here is the file: & lt; A href = "full_profile_popup.php? AllyId = & lt;? = $ This-> objAllyUser-> ID? & Gt;" Rel = "facebox" title = "full profile" & gt; Invite as Partner & lt; / A & gt; & Lt; Br / & gt; Facebook instantly worked fine, it just tested to open simple HTML and PHP files. I just have Facebox pop-up Update: According to a suggestion, iframe is used, but still nothing is found: / P> You should print the error you get I will try to guess: Have you publicly declared your method? In the template you can only access public properties and methods. This is a very common mistake.

ruby - Create an Array of Fixed Length Given an Array of Arbitrary Length -

I am looking to write a method that an array of any array from a certain length (12 in my case) The line is repeated by repeating the object (although the length should always be 12 or less) is provided. For example given to the array: a = [1, 2, 3, 4] come back to me Is: a = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4] Another example: b = ["peach", "tail", "peer", "apple", "banana", "orange"] will return: , "Pear", "apple", "banana", "orange"] and so on if an array is given with 12 objects, then it will return only to that array . So far the methods I have written to fulfill it are very ugly and very rubei; 1.8 in .7 & amp; 1.9 You a = [1,2,3,4] # = & gt; Can do good stuff with [1,2,3,4] a.cycle.take12 # = & gt; [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]

pickle - python 2.6 cPickle.load results in EOFError -

I use cipickle to list integers, using HIGHEST_PROTOCOL, CPickle.dump (L, f, HIGHEST_PROTOCOL) When I try to unplick it using the following code, I get an EOFError. I tried to offset 0 before uniquely, but the error persists. l = cPickle.load (f) Any thoughts? (file name,

jquery - How to I use ajax and PHP to create and populate div elements? -

I had asked a similar question before, and it took me to the right path, but I am still a little stumped though, Now I know how to ask a more educated question. I have a database that I connect to a table of products. Within the products there are column IDs, stocks, SHORTNAME, descriptions, PRICE and shipping. If the user clicks on a button, then I need to send a request to find all the rows in the products. I believe that the following file.php completes (DB Connect Code Does not show up). $ query = "SELECT` ID` to` PRODUCTS '"; $ Result = mysql_query ($ query) or die ('query failed:'. Mysql_error ()); $ Num = mysql_numrows ($ Result); When a user clicks on the button, and it becomes $ num, then there are many div elements that make up the line because I have it for () But I'm 100% sure how to do this. Besides, I'm not sure how to do this with J.K.R in JQR, rather than just JS. function ajax function (phpFunction) {var ajaxRequest; Try...

c# - C++ calling managed COM object can't find dependent assemblies -

I have created and managed a managed COM library in C # on my development machine and I have successfully registered it and An .lb file is created with regasm, and successfully imported TLB in the C ++ console app used for testing. My COM assembly is called "efcAPI.dll" and it gives reference to another assembly that has not been installed for COM or registered as "efcServerDiscovery.dll" anyway. This second DLL is some code used by my com DLL and exists in the folder similar to the FTP dll. Everything related to loading a COM assembly is working properly I can define examples of my classes in COM and call methods by them. But when I call some methods which uses the code defined in efcServerDiscovery.dll, then I get a _com_error that reports that this file or assembly can not load 'efcServerDiscovery'. I have verified that copy of efcServerDiscovery.dll (where only I created and registered the location with efcAPI.dll) is everywhere on my hard driv...

c - pthread_t to gdb thread id -

Does anyone know how to display threads GDB information pthread_t? I: (gdb) info threads 37 Thread 22887 0xb7704422 __kernel_vsyscall (36) Thread 22926 0xb7704422 __kernel_vsyscall (35) Thread 22925 0xb7704422 __kernel_vsyscall (in) 34 Thread 22924 0xb7704422 __kernel_vsyscall () 33 Thread 22922 __kernel_vsyscall (in 0xb7704422) 32 Thread 22 921 (__kernel_vsyscall in 0xb7704422) (gdb) p m_messageQueue- & gt; M_creationThread $ 3 = 2694822768 (gdb) p / x m_messageQueue- & gt; m_creationThread $ 4 = 0xa09fbb70 What am does anyone know know how I know who this little thread? It will be 22768, but none of my threads is short. pthread_t value is not that thread ID based on the thread system (Linux gettid (2) ) which you see in GDB. AFAIK, there is no function to convert between two. You need to keep track of yourself.

design - Is there any value in separating wcf service contracts from your interface definition? -

मेरे पास इंटरफ़ेस आईसी ग्राहक एस सेवा है: सार्वजनिक इंटरफ़ेस ICustomerService {CustomerList FindAll (); } और उस इंटरफ़ेस को लागू करने वाला एक ठोस वर्ग। अब मुझे WCF / बाकी का उपयोग कर वेब पर विधि का पर्दाफाश करने की आवश्यकता है और मुझे इंटरफ़ेस की परिभाषा को इसमें बदलना होगा: [serviceContract] सार्वजनिक इंटरफ़ेस ICustomerService {[ऑपरेशन कॉन्ट्रैक्ट] [WebInvoke ( विधि = "प्राप्त", उरीटेमप्लेट = "ग्राहक")] ग्राहक सूची खोज (सभी); } मेरा प्रश्न यह है कि क्या इन इंटरफेस से जुड़ी इन विशेषताओं को अगर कोई क्लाइंट है जो डीएलएल संदर्भ का उपयोग करके बाकी एपीआई का उपयोग करने के बजाय कार्यान्वयन का उपयोग करना चाहते हैं? मुझे लगता है कि आपके मानदंडों को टाइप स्ट्रिंग के रूप में REST का उपयोग करने में कमियों की जानकारी है यदि यह यूरी में है। कोड पठनीयता (अगर आपके ग्राहकों को आपके इंटरफ़ेस स्रोत को देखना होगा) के अलावा गुणों का कोई डाउनसाइड नहीं होना चाहिए। विशेषताएँ किसी को भी दिलचस्पी से पढ़ा जा सकती हैं (जैसे WCF फ्रेमवर्क) या अनदेखी की जाएगी। असल में वे क...

c++ - linking <iostream.h> in linux using gcc -

I'm trying to run my first C ++ program in Linux (linux mint 8). I use both GCC or G ++ with the same problem: the compiler is not able to find the library, which I am trying to import. I have some doubts as if I should copy the iostream.h file in the work folder (which I do not know), move my file somewhere else to compile or use some option Sort Sort Thank you for your suggestions. Here is the GCC command, the C ++ code and the error message: GCC -o addition list2 .5.c . #include & lt; Iostream.h & gt; Int edition (int a, int b) {return (a + b); } Int main () {cout & lt; & Lt; "Results:" & lt; & Lt; Addition (2, 4) & lt; & Lt; "\ N"; Return 0; } . listing2.5.c: 1: 22: error: iostream.h: No such file or directory is listed.2. Cc: Function in 'Main': listing2.5.c: 10: Error: 'Cout' undeclared (first use in this function) listing.2.5.c: 10: Error: (Each unauthorized identifier is reported onl...

c# - Retrieving cookies from HttpResponse -

I have a controller action that I call through Ajax in which I set a cookie like this: / P> feedback. Cookies ["notifications"]. Value = "wrong"; answer. Cookies ["notifications"]. = Timeout expires. Now. Add Actual (1); In another controller action I am checking this cookie such as: if (requests. Cookies ["notifications"]! = Null & Amp; amp; The problem is that the request [cookies] ["notifications"] is always null. I have verified that the cookie is being set up through firebug, Testing through the studio in the studio web. The problem is That I was also setting this: feedback. Cookies ["notifications"]. Secured = true; and of course not a cookie Is being sent because I am not using HTTP.

How do I move (INSERT+DELETE) the last n rows from a table in Jet SQL / Access 2003? -

I have a system that receives input from the public each day. When it starts every morning, I use a VB script Which will move every input into more than 500 backup tables. This system is a complete collection of activity. I want to proceed from every line (from table 'active' to table 'active' in table 'collection' and then remove row from 'active') initial 500 rows (sorted by column Has been) from one table to another. I was hoping to be able to do this as a single SQL statement, but I have not had much success. Is this a proper way to do a proper (nested) jet in the form of a SQL statement? Need to write some intermediate VB scripts to handle this action? Thanks in advance, It seems that I may have to do something like this . Log in ChatArt (MsgId, MsgText, Filtered, LostFetched) SELECT MsgID, MsgText, Filtered, Last Feast with WHERE id & lt; = (Select from ChatCurrent MAX (id) - 500; Delete from ChatCurrent MsgId & lt; = (Sel...

c++ - implicit promotion to avoid overflow in std::partial_sum -

This code suffers from overflow because the intermediate result type is not dependent on the destination type: vector & lt; Uint8_t & gt; pay raise; ... vector & lt; Uint32_t & gt; Increasing (increments.size ()); Partial_sum (increments.begin (), increments.end (), increasing; beta ()); However, this does (GCC 4.2): partial_sam (increments.begin (), increments.end (), increasing. ), Plus & lt; uint32_t & gt; ()); plus Edit: I'm very addictive. After a short break, I sat back and checked the implementation of this: / * Input_utetter :: value_type * / __value = __binary_op (__ value, * __ earlier); * ++ __ Results = __value; I think it's not compliant, so I'll look at the latest version and maybe file a bug ... and here we are going: According to "post-text" itemprop = "text"> , partial_sum has been completely redefined since the n3000 (latest release): Effect: Enter the value type of InputIterato...

inheritance - Can you specialize inherited Java annotations -

I have an intangible superclass on which JPA annotations are mapped to some of its fields, only in the @mapped spaceslass Annotation is there. Can I specialize / add or change only one element of a successor annotation without completely redefining the entire annotation? You can do the same thing with annotations and comment on a comment and a library It considers it as a form of heritage. The problem is that if you re-specify the entire annotation, then any library expects that the mappsparclass will ignore it.

Replying to an SMS sent from a modem of SMS service? -

I am trying to implement my theoretical SMS web service (to understand how it works, I have posted some other related questions, I think this is). Set up a PC. It requests a website which I do to send SMS messages: The destination phone number entered by the user and the text message entered by the user I get the GSM modem or just GSM phone I connect it to the computer I do I get a service plan from Verizon or whatever, some unlimited SMS messaging plans. They gave me a SIM card, in which my unique phone # connected to it (ex: 555-5555) I stop it in GSM modem. I get some applications (like Kanal) which interfaces with the modem and sends messages from my machine. Now user enter my theoretical website, a phone # and message I capture that data, it moves forward. Canal interacted with the modem, passing the data for this message. Modem communicates with the carrier network signing up with me, and transmits the actual SMS about it. Carrier Network routing messages to the ...

social networking - Free API to broadcast to Twitter, Facebook, Youtube, etc -

I was thinking that someone has come to some sophisticated API that will send you updates from all these different social outlets Allows links, images, videos etc? You can use an API on ping.fm if it includes all services / etc You want to use. Their APIs are intuitive to support the rest, so you should work on the use of any technology.

Access JavaScript function in a programatically iFrame -

I am trying to exclude a Javascript function from a JavaScript function in a programmatically created IFrame. I tried several ways, but was not successful in LIC window.frame ['frame'] , etc. Can you please provide me the correct syntax? Yes, they are in the same domain. Actually, I am using ExtJs Framework. I have a JSP inside an iframe, I would like to call Javascript functions in JSP with a Javascript function which is basically in JS file

multithreading - Can Prism EventAggregator be used for threading needs? -

itemprop = "text"> I was looking at the Prism EventAgator and its' Great part I was the most worried UI thread correctly for martial threads It had its potential. I was thinking that I can use this capability to provide a class to module developers, which can be used to make the thread similar to the background worker. Class interface to some extent Public Interface IMyTask {event DoWorkEventHandler DoWork; Can be similar to; Event RunWorkerCompletedEventHandler RunWorker Complete; Zero run-task async (object obj); } I have created similar types of backgroundworkers to do better. In the implementation I am registering TaskStart and Functional Events Public class TaskStartEventPayload { Public Subscription Token Token {get; Set; } The argument of the public object {get; Set; }} Public Class TaskStart Document: Composite Presentation Event & amp; Task Start AventPeload & gt; {} Public Sector Efficient EventPayload {Public Subscription Token Token {g...

asp.net - Update SQL Server from GridView with a Checkbox -

The page has a gridview with a checkbox field. And there is a button on the same page. There is an area related to the checkbox in SQL Is there an easy way to update SQL? Line not by line Best Relationship, You can use the following snippet to select all To return the value of the checkboxes as a comma separated strings: string value = string. Empty; Foreach (list item items in the list checkbox.) {If (item selected) value + = item. Value + ","; } You can use this value in SQL as follows: string sql = String.Format ("Update Table SET = selected where in Id ({0}) ", value);

regex - Regular expression for accepting alphnumeric characters (6-10 chars) .NET, C# -

I am creating a user registration form using C # with .NET. I have to validate the user entering the password. The validation requirement is as follows. It should be alphanumeric (az, AZ, 0-9) It should accept 6-10 characters (minimum 6 letters, maximum 10 With at least 1 alphabet and number (example: stack1over ) I am using a regular expression below. ^ ([a-zA-Z0- 9] {6,10}) $ This satisfies my first 2 terms when it fails I only enter letters or numbers. If you can If they are, then pass it through many regexes. It will be much cleaner than those looking-ahead monstrosities: -) [/ a> While some people may understand it clever, with a single regex all It is not necessary to do something (or even with any regex, sometimes - only witnesses) that people want to regex to find numbers between 75 and 4093). Do you want to see some good clean code like: If not checked then rijks (str, "^ [0- 9] + $") returned incorrectly Value = string_to_in (str)...

delphi - How can I get the color for a themed tabsheet -

How can I determine the background color of a TTB sheet when running on OS with XP and above versions Ho? I will try. Edit: But note that tab sheets have a gradient under standard XP theming, so a color maybe not which you want.

c# - Is using linq in this situation overkill -

I'm thinking of a re-factor, but I do not know the end result is overwork only at present I have iialit Is it forEach m_items.ToList () to use linq and / or to be less efficient. ForEach (x => increment + = x.getincurment ()); Can the cast be an important overhead here? The ToList method is an extension method that is used with LINQ, but forEach method is only the list class. There is a method in The main overhead here calls the ToList method, which creates a new list from the archive. There is also a slight overhead because every item has to call a representative. If you want to use LINQ methods, then the overall method looks more appropriate: Public Ink GateInCentment () {Returns M_ts.Egrait (0, (T , I) => T + i.GetIncrement ()); } or the sum: public int GetIncrementTotal () {return m_items.Sum (i = & gt; i.GetIncrement ()); } Either your original version has a little overhead, so if you want the most efficient, just paste it on a simp...

sql - Specifying which record to return from a GROUP BY clause -

साफ़ करने के लिए संपादित करें मुझे संभवतः ग्रुप द्वारा इसलिए मैं समस्या को हल करने के बारे में मान्यताओं के बिना अपने प्रश्न को दोबारा बताऊँगा: मेरे पास term_id s की एक सूची है और इसमें एक तालिका है ऑब्जेक्ट्स (जिनके पास अन्य क्षेत्रों के बीच एफके के रूप में एक object_id पीके और term_id है), मुझे ऑब्जेक्ट को सर्वोच्च object_id के साथ प्रत्येक टर्म_आईड आपूर्ति की गई ऐसा करने का सही तरीका क्या है? मूल प्रश्न मुझे यकीन है कि मुझे कुछ स्पष्ट नहीं है, लेकिन मैं यह नहीं समझ सकता कि कैसे निर्दिष्ट करें जो रिकॉर्ड को GROUP BY के साथ एक क्वेरी से वापस किया जाएगा। मूलभूत रूप से ग्रुप द्वारा ग्रुप में पहला रिकार्ड देता है, मैं एक सबक्व्यरी का उपयोग किए बिना पिछले एक प्राप्त कर सकता हूं? मूल क्वेरी का पहला रिकॉर्ड वापस आता है: SELECT * से wp_term_relationships WHERE शब्द_टाक्कोनी_आईडी IN (20, 21, 22) ग्रुप द्वारा term_taxonomy_id यह काम करता है, लेकिन एक subquery के साथ यह वाक्यविन्यास त्रुटि है SELECT * से wp_term_relationships WHERE शब्द_टाकनता_...

security - Prevent Users Creating Table -

I am trying to secure MS Access 2003 MDB using workgroup security. I have most of it set up (using a new MDW etc.), but I can not stop people creating new tables in the database, if they have access to open it, do I forget something? There is no permission to allow any account, I am doing it through all groups. Users only have access to open runs in the database, do not have access to and "read data" on all other tables, including MSys * tables only. Any ideas or am trying to make it impossible? - Update - I have tried to use the magician, but it still leaves me the same problem. I have a blank database & amp; The wizard ran away to 2 users, M & amp; All access to users, and standard groups was deleted I added to the Admin Group & amp; The user's read-only group. Denies not using MDW, as expected. Logging allows me to enter full access (design stuff, add data, delete data, etc.), allowing user to log in as a login, but do not add or design dat...

asp.net mvc - Html.RenderAction performance? -

I can do multiple renderings on my point of view, but one thing to consider is that in this case the render action returns. For example, I have many modules and I would like to render it on the scene, there are two ways to do this: In the controller to call the query, which is too long, here we are Async In the view, call the renderer, each presentation will be called by the query Can you tell which is better and which Is a fast? Thanks There are no general answers here. On the basis of the case you should be made a case of this decision. Personally, I tend to make as much a single query as possible as it reduces the goaltries to the database. But if your query contains cartesian products, then you are generally better at sharing in many questions (render action approach). You also have to consider that more reusable actions are generated from the renderation point of view, if reusable is necessary then you can also select render action, when it is not optimal disp...

Android: Changing an ImageView src depending on database field data -

I am quite new to Android development (started 2 days ago) and already done through several tutorials. is. I am preparing a test app from the Notepad Workout (in Android SDK) and as part of the list of notes, I want to display a different image based on the contents of the database field called "No Type". I would like this image to appear in the list view before each notepad entry. The code in my .java file is: private zero fillData () {cursor notes = MDBHlp; fatalnotes (); Notes = MDBHLper.FatNalotes (); StartManagingCursor (notesCursor); String [] = new string [] {NotesDbAdapter.KEY_NOTENAME, NotesDbAdapter.KEY_NOTETYPE}; Int for [] = new int [] {R.id.note_name, R.id.note_type}; // Now create a simple cursor adapter and set it to display simple cursor adapter notes = new simple cursor adapter (from it, R. layout.notes_o, from notices, from); SetListAdapter (Notes); } and my layout xml file (note_ro.xml) looks like this: Android: Image = "id =" @ + i...

android - How to I make TableView Cells spanning over multiple rows? -

There is a way to create a tableview in which the cell can be more than one line, as two "X" here ? 1 2 3 4 5 2 1 x 1 2 1 2 x 4 5 This scenario is only duplicated at the first glance. How to divide the table in nested tables without closing the columns incorrectly? You must keep the first row in a separate table, which means that the columns are not called coalitions. Imagine: 1 222 3 4 5 2 1 x 1 2 1 2 x 4 5 Both of you do not combine "4" cells.

java - XML namespace defaulting/inheritance -

What are the namespaces of a, c, d and e in the XML snippet given below? The references to the documentation or specifications will be appreciated. & lt; A xmlns = "http: // domain / a" & gt; & Lt; Pre: b xmlns: pre = "http: // domain / b" & gt; & Lt; C / & gt; & Lt; D xmlns = "" & gt; & Lt; E / & gt; & Lt; / D & gt; & Lt; / East: p & gt; & Lt; / A & gt; In addition, do the Java framework respect the exchange of official namespace? Me tride org.w2c * DOM packages, although this namespace does not seem to solve the URI correctly? For example, something with the same functionality. String namespace = DocumentPerpers. PRSE () GetElement ("A"). GetElement ("B"). GetElement ("C"). GetNamespaceURI (); To make the best of my knowledge, Java support namespaces have all the standard XML APIs. I Many APIs were written before or after namespace creation (o...

c# - User interface design for bi-directional searching of enumerations -

I have a file that stores the list of enumeration with its associated values. The following is an illustration of what the file looks like (instead of its original contents): month Code> I am writing a C # program so that the user can get permission to view animated values ​​and their associated texts between them. In other words, they should be able to see the text with a value, and vice versa. I wonder what is the best way to design user interfaces? I have several ideas: Two text boxes are user can fill in any of them and others automatically populate as user type. If the value is invalid, leave the other text box blank. Take a text box to fill the information in favor of the user, specify a radio button what information they are filling in the text box, an OK button that is pressed, the result or error Update text labels with message Similar to 2, but not ok button, just update the text label as the user type (i.e. control control. Kepress event). Have two sep...

asp.net 3.5 - how to remove item from one combobox -

I am using 5 comboboxes in my asp.net 3.5 c # project. There I want to remove the item from the other combo box which has been selected in the other combo box. On the selected index, in the converted event, just the combo box. Call ITEMS. Remove method As a commentator below, make sure that you set AutoPostBack = True, when you actually change your selection.

python - Convert Chrome history date/time stamp to readable format -

I have originally posted this question in search of an answer with using Python, get some good help Has gone, but has not yet found a trick. I have a script running OS X 10.5 client machines that captures internet browsing history (required in my USS public school as part of the administrative duties of my system). Firefox 3.x stores history in a sqlite DB, and I have figured out how information on using Python / sqlite3 uses a traditional unicastemstamp to mark Firefox 3.x visits and It is not difficult to convert ... Chrome also stores browser history in Eclipse DB, but its timestamp has been used for microseconds since January, 1601. Formatted as number. I like to use Python to figure it out, but as far as I know, the SQLite3 module does not support that UTC format. Is there another tool for converting Chrome timestamps into human readable formats? Use the module, for example, if the number of microsconds in questions is 10 ** 16: / P> gt; & Gt; & Gt; Datetime....

javascript - How to Run an External jar file from within a firefox extension -

Even I have the code ... // external Run encryption process var file exe = Components.classes ["@ mozilla.org/file/local;1"] .createInstance (Components.interfaces.nsILocalFile); FileExe.initWithPath ("~ / tmp / Encrypt.jar"); Var Process = Component. Classes ["@MOZILOGG / PROCESS / UTL; 1"] .Corate Instructions (Components Enerfus. NIPPrice); Process.init (fileExe); Var Argis = ["Java-Zer Encrypt.car-A to Encrypt"]; Process.run (true, args, args.length); Document.getElementById ('hello-world-status-bar-icon'). Label = "Done"; Any suggestions that does not currently work ?? Edit I have also tried .. // Run external encryption process var file axis = component Class ["@ mozilla.org/file/ local; 1"] .createInstance (Components.interfaces.nsILocalFile); FileExe.initWithPath ("Java"); Var Process = Component. Classes ["@MOZILOGG / PROCESS / UTL; 1"] .Corate Instructions (Components Enerfu...

objective c - Getting the Current font of a NSTextView -

मैं NSTextView के वर्तमान फ़ॉन्ट को कैसे प्राप्त करूं? एक NSTextView एक प्रकार का NSText है। इसलिए, इसे भेजें।

windows - Error installing Rails (after installing nearly 20 dlls one by one) rl_attempted_completion_over (readline.dll) -

Every time I typed: Mani installed Rail asked me for a DLL. So I downloaded the following: datasvcs.dll, icudt24l.dll, icuin24.dll, icuio24.dll, icuuc24.dll, libeay32.dll, libmex.dll, libmwservices.dll, libmx . Dll, libut.dll, libz.dll, mpath.dll, msvcrt-ruby191.dll, mvalue.dll, m_dispatcher.dll, nscrt.dll, readline.dll, ssleay32.dll, xerces-c_2_1_0.dll, zlib.dll. Finally it said: This place can not be found rl_attempted_completion_over (readline.dll) (I already readline.dll!) I am using Windows XP After installing Ruby 1.9, The same "rl_attempted_completion_over" encountered the problem. On a Windows 7 machine which is running Ruby 1.8.6.1.376 is just fine. Unfortunately, I have downloaded all the DLS from econsultant.com/dll-database/ manually, they do not have readline.dll correct. Their DLLs were 5,632 bytes DLL Ruby is required size of 136,192 bytes. I found on the correct DL Copy this dll in my environment on a path I had put my DLS in Ruby's bin dir...

javascript - Solving bug with single quotes in names of friends -

My Javascript application uses Facebook Connect to display profile pictures of a user's friend. This work is fine until a recent update at the end of Facebook created a bug in Safari. Essentially, everything works fine until a user's friend does not have an apostrophe (single bid) in their name. For example, learn Irish last names such as oaknaur. An apostrophe breaks the rendering of all profile pictures completely, and instead silhouettes are displayed only. Generally when FB: profile pictures, the friend's name becomes the value of the alt and title attributes of the image. However, with a name with an apostrophe, it is instead (using the name Gregory O'Connor for this example): & lt; Fb: profile-pic class = "FB_profile_pic_renderedFB_ElementReady" & gt; & Lt ;! - Funny new "connor" attribute notice - & gt; & Lt; Img class = "FB_profile_pic fb_profile_pic_rendered" style = "connor =" "title...

blackberry - How do I send an EOF for a Java InputStream element? -

Then I have the code to open an input stream and successfully collect the information: HttpInput = httpConnection.openInputStream (); Sb = new stringbuffer (); While (ch! = -1) {ch = httpInput.read (); Sb.append ((four) ch); } However, when I try to use the same string (sb.toString ()) in another method, then let me say "end of expectation of file" Get the error. So how do I add an EOF character to my string? Note: The response is basically an XML document coming from a remote server. So when the code reaches the "pars" line, then gives me an error above: bis = new ByteArrayInputStream (sb.toString () getBytes ().); Doc = docBuilder.parse (bis); I am coding for a Blackberry app. AC If you want to read the stream in the byte array, / P>

vb.net - LINQ-TO-XML using UNION -

After I am trying to create a XML file to resolve the questions. T-SQL works itself as a query, but "the expression could not be translated ..." error. I'm asking the wrong question as the LINQ-to-XML fails with my implementation? Is this view wrong? I'm new to LINQ How can I create a single XML from 2 queries? DD DB New SOMEDataContext Smoke members as New XElement ("Member", as _ (c db.Employees in _CF Join Database in BowlingTeams on c.id. cf. BowlingTeam_Text equals _ where c.DEPARTMENT = "household items" _New XElement ("Member", _New XElement ("ID", c.ID), _New XElement ("Title", select C. TITLE))) _Union (in the D.B. Implications where E. Department = "Homeware" _ where E. position "* XYZ *" select _New Eximplements ("Member", _NewExample ("id", E.id), _New XElement ("title", e.TITLE))) Here's how I will do that in VB: Blind members = & l...

c# - Bitfield enum extension method to return dictionary of included values -

Enums can definitely be confused I'm trying to make an extension method on Enum type which would be considered one and Will return the names of all the bits that match. [flag] public enum PlanetsEnum {Mercury = 1, Venus = 2, Earth = 4, Mars = 8, Jupiter = 16, // etc ....} I want to create an extension method that returns the dictionary of only selected values ​​if: planets of planets = planets.nem.mars | PlanetEnum.Venus; // 10 IDZIN tan = neighbor Foreign Language (KeyWeekeeper & Lift; String, int 32 & gt; kvp in dict) {Console.WriteLine (kvp.Key); } / * * Print: * Mars * Venus * / I hope Mars & amp; Venus has been written on the console, but I'm looking at all the values ​​of Planet Names. Here is my extension method code: Public Fixed IDictionary & lt; String, int32 & gt; ToDictionary (this enum calculation) {type type = counting GetType (); Return Enum.GetValues ​​(type) .Cast & amp; Lt; Int32 & gt; (). ToDictionary (Field =...