Posts

Showing posts from September, 2014

model - Rails 3 - validation of checkboxes -

I have a form 2 checkbox and I have tried to find a way, how to validate it - I want to know, if A user clicked on one of the two checkboxes ... I tried to do this with validates_presence_of , but unfortunately, without success ... Anybody help me, please, how? You can use custom valid work for it. Valid: custom_checkbox_validation def custom_checkbox_validation errors.add (: base, "Please check a checkbox.") Unless chkbox1 || Chkbox2 end To make this work, you must have 2 checkboxes in your view files. & lt;% = form.check_box: chkbox1% & gt; & Lt;% = form.check_box: chkbox2% & gt;

asp.net mvc 3 - Using buttons in MVC3 -

In my opinion, I am using the button like this and thus handle them in the controller [HTTP post] Public ActionRashult Index (BuilderGone model model, string button) {If (button == " Add ") {} if (button ==" save ") {} if (button ==" cancel ") {} return view (model); } Is there any way i can do something gt; add & lt; / a & gt; & lt; a Href = "#" onclick = "javascript: location.href = '@ Url.Action (" "," ")"' class = "redbutton" & gt; Save & lt; / A & gt; & Lt; A href = "#" onclick = "javascript: location.href = '@ Url.Action (" Home "," Index ")," class = "redbutton" & gt; cancel & lt; / a & gt; Anchors should not be used for posting and submitting forms. They are used to issue redirects and GET requests An anchor can not submit a form. You will need to fill out the form to write...

javascript - How to apply JS on data from Jquery's load method? -

यहां जेएस का एक स्निपेट है: ... $ (this) .load ('Html_fragment.html', फ़ंक्शन (डेटा) {console.log (डेटा); $ (डेटा) .पुस्तक ('। एडेरियन')। Accordion ();}); ... यहां मैं जो दस्तावेज़ लोड कर रहा हूं (html_fragment.html) की सामग्री है: & lt; form & gt; & Lt; div class = "accordion" & gt; & Lt; h3 & gt; & lt; a href = "#" & gt; अनुभाग 1 & lt; / a & gt; & lt; / h3 & gt; & Lt; div & gt; & Lt; p & gt; मॉरीस मॉरीस पहले, ब्लेंडेट और, अल्ट्राइसेस ए, सशिपिट एजीट, कैसे हैं पूर्णता से नौकरी किसी भी प्रकार के लिए, या तो, या, या तो, अब के लिए तैयार करने के लिए, नाम एक निभ संभव है नाम मील आप के लिए इंतजार करना चाहते हैं कारायटीतु नरसुदा किसी भी समय के लिए एक त्वरित बिक्री के लिए भुगतान करते हैं। & Lt; / p & gt; & Lt; / div & gt; & Lt; h3 & gt; & lt; a href = "#" & gt; अनुभाग 2 & lt; / a & gt; & lt; / h3 & gt; & Lt; div & gt; ...

java - How to remove duplicate elements from a list using apache velocity -

I have a list with duplicate elements, I need to use velocity example , The duplicate element in the post #foreach ($ p in $ terms) $ p.name // will be unique #end > For the sake of reason only because others said that it is not possible with velocity, I show it I want to know that this is actually possible with velocity, but still it has not been recommended. For those who can do this: #set ($ uniquePosts = []) #foreach ($ post in post) #set ($ Exists = false) #foreach ($ uniquePost in $ uniquePost) #if ($ uniquePost.name == $ post name) #set ($ exists = true) #break #end #end #if (! $ Exists) ) #set ($ added = $ uniquePosts.add ($ post)) #end #set ($ posts = $ uniquePosts) # Exclusive list: #forach ($ post in $ post) $ post.name #end

asp.net mvc - HtmlHelper.GenerateRouteLink doesn't give expected result -

I (strictly) trying to create a link from one of my controllers It should look like this: Relevant (though probably incorrect) route: routes. MapRoute ("UsersRoute", // root name "{controller} / {action} / {userId} / {key}", new {controller = "user", action = "profile", userId = UrlParameter.Optional, key = UrlParameter.Optional}); and link code: HtmlHelper.GenerateRouteLink (requestContext, RouteTable.Routes, "MyLinkText", "UsersRoute", New RouteValueDictionary (New {userId} = UserId, key = hash password (password)}, tap; (Where I send the request reference: HttpContext.Request.RequestContext . It currently gives me: & lt; a href = "http: // account / registration / 29 / e96303852080b94cc 230611a3f 4806" target = "_ Blank"> MyLinkText Any help would be greatly appreciated. Your route definition URL will be of the form: {p> {controller} / {action} ) I can...

html - Can I display a FlowDocument (or equivalent) on Windows Phone 7? -

I have a usage case where I want to display several html pieces in a single UI. My first attempt was to use many Webbroower controls and I did not really look good for many of those controls and the controls did not work well (slow load time, playful and even accidents) . Trying # 2 html in the Flo document, after converting the WP7 to Portion, after working with this conversion, I have now got some text that I can load in the flow document, but then I say "O Fu Where is the document? " It appears that the flaw document has some systems Did not cut for Dundues. Windows Document type (fontosource, glyphs, inline, inline compile, linebreak, run) I want to paragraph and hyperlink as in html raw text instead. Is there a way to present a Floddount or something like that on WP7? If you have text block (or rich textbox If you use mango, then inside run and hyperlinks elements. This is the only form of flow document that is available for Windows Phone. Example:...

html - Make divs draggable and droppable for certain elements -

I have a page with dragable and droppable. Each div has a nested diva that is also dragable. I want to drag the nested divas from div 1 and pull them on div2 and also on the other side. Jsfiddle where I try to do this is on the link If I transfer the msn.com link from div 2 to div 1, then not left in that div is. What should I do to get the correct behavior, ie where does this link become part of div 1? To get it to work, you have to add a dragable device to the related droppable device. $ ("#editdiv .droppable") .droppable ({drop: function (event, ui) {var $ item = ui.draggable; $ item feedout ($ {Item.css} ($ {"left": "", "top": "", "bottom": "", "right": ""}}). FadeIn ();}) ; $ Item.appendTo (this);}}); $ ("#editdiv_ .droppable") .droppable ({drop: function (Event, UI) {var $ item = ui.draggable; $ item.fadeOut (function () {$ item.css ({"left": " ",...

SQL Server 2008 setup failure: Value cannot be null. Parameter name : doc -

Image
I'm trying to add some services (full text search, integration services, etc.) to SQL Server 2008 which I did not Installed with SQL Server's first installation, now when I choose to add those features to a SQL server, I get an error message: The following error has occurred in the SQL Server setup : The value can not be empty The name of the parameter: Doc Register. I have a 7 x 64 configuration I appreciate any help Will do Look at this problem on another forum, the user claims that Microsoft / P> Note: Another user using a local account on the machine has solved the problem of installation, and then logging in to another account resolves the problem on this second account

Stored procedure in MySQL -

मैं PHPMyAdmin में निम्न कमांड चला रहा हूं: DELIMITER # प्रक्रिया प्रक्रिया addid () BEGIN DECLARE INT DEFAULT पूरा किया; घोषणा ए, बी फ्लोट डिफॉल्ट 0; DECLARE c, d INT DEFAULT 0; परिणाम का चयन समय के लिए कर्सर कर्ता 1; DECLARE सेट नहीं मिला के लिए HANDLER CONTINUE CONTINUE = 1; ओपन क्यूअर 1; Read_loop: लूप फेट क्यूअर 1 में; यदि किया तो read_loop छोड़ दें; यदि ए - बी & gt; 60 तब सेट सी = सी + 1; ELSE UPDATE परिणाम एसईटी यूआईडी = सी जहां समय = ए; अगर अंत; SET बी = ए; अंत लुप; बंद करो 1; END # DELIMITER; कॉल एडिड (); हो सकता है कि वह ऐसा करे जो मैं चाहता हूँ, शायद नहीं। लेकिन मुझे नहीं पता क्योंकि मैं इसे कॉल नहीं कर सकता। मुझे निम्न त्रुटि मिलती है # 1064 - आपके एसक्यूएल वाक्यविन्यास में एक त्रुटि है; निकट 'LOOP का उपयोग करने के लिए सही सिंटैक्स के लिए आपके MySQL सर्वर संस्करण से संबंधित मैन्युअल की जांच करें; बंद करो 1; अंत # कॉल एडिड () 'पंक्ति 20 में' कुछ समय, मैं कैसे इसे ट्रिगर करने के आधार पर, मैं चलने के लिए मिल सकता है, लेकिन फिर इसे संग्रहीत कार...

git svn - How do I use git-svn to merge changes from trunk to a branch in svn? -

I have suggested using git-svn to merge people and commit to svn back to them . I'm looking for a good step by step guide. Is it worth the trouble or should I use it only to svn. Do people see if I have used git and have any meta data about merge in svn? Can I have a clone of the trunk and I can choose 1 branch? Can I have a full clone or can I import from the point where the branch was made? Is it worth the trouble or do I just do it I would like to use SVN I think this depends on how much information you want to keep in the SVN. If you merge while using GIT, then I believe that SVN will not know where the change came from, or in other words, it looks like the SVN trunk and the branch is still different. Do people see if I have used git and have any meta data about merge in svn? No, it just looks like a new comment on the trunk. Can I select a clone of the trunk and 1 branch? If you clone your git-svn in a new GIT repo, then yes. Simply clone g...

Mongodb - regex match of keys for subobjects -

I have some documents saved in the archive (such as urls ) which look like this: {payload: {url_google.com: {url: 'google.com', text: 'search'}}}, {payload: {url_t.co: {url: 't. Co ', text:' url shortener '}}}, {payload: {url_facebook.com: {url:' facebook.com ', text:' social network '}}} Mongo CLI, is it possible to see sub-topics of payload ? That match / ^ url _ / ? And, if it is possible, then will it be possible to question the match subobabic (for example, make sure that text exists)? I was thinking something like this: db.urls.find ({"payload": {"$ regex": / ^ url _ /}} ). Count (); But this 0 result is returning. Any help or suggestion would be great. Thank you, Matt document like this It is not possible to ask about the keys. You can search for exact matches using $ exists , but you can not find names that match a pattern. I think (maybe wrongly) you are trying to find docu...

c - how to store and read data from files -

I'm new to C in Linux. I am trying to store data and read them back. Is this the right way? When I try to compile it, I am getting errors. Can anyone help me please. thank you in advanced. contains # lt; Stdio.h & gt; Select Typedef Structure {int; Four last names [25]; Four first names [25]; Four addresses [25]; Four phone numbers [25]; } Address book; Address Book A [5]; File * FP; Int main () {int i; For (i = 0; i I can not find any output. It was empty. Look at this code, and tell me what all was wrong with your code. contains # lt; Stdio.h & gt; Select Typedef Structure {int; Four last names [25]; Four first names [25]; Four addresses [25]; Four phone numbers [25]; } Address book; #ArrayLEL2 Addressbook A [Arraylean]; File * FP; Int main () {int i; Fp = fopen ("addressbook.dat", "a +"); For (i = 0; i Actually, your code is similar (except for the edits you already have) is not so wrong, but there were some minor but important fl...

Put more than 1 row into mysql from a php array variable in an html form - not working with []? -

The line below is part of a form. When the form is submitted, it enters a line in a mysql table $ varw will go to different rows. I sometimes have a lot of $ varw in the row given below Just tried to change 'weight' to 'weight []' that 0 (wrong) was entered for $ varw in mysql and it still only adds 1 row. print "& lt; input type = 'hidden' name = 'weight' value =". $ Varw "& Gt;"; You should go! In other words .. a loop. A heavy comment of the unwanted example below: $ i = 0; // Different variable names are required as foreach ($ varw $ $ var) {Print "& lt; input type = \" hidden \ "name = \" ". Weight {$ i}." \ "Value = \" $ Var "\" & Gt; "; $ I ++; // Payroll increment count on every move ...} // Now you will have so many hidden fields like $ varw I want you to think about the loop Manually read, Happy coding buddy. PS: Please, the v...

c# - AES encryption with BouncyCastle: AESEngine, AESFastEngine OR AESLightEngine? -

I want to close this simple Java instance ... As I have understood, Java encryption uses AESGen for encryption / decryption operation. What is the difference between AEESGen and AESFastAgean and AESELEEZEN? Unfortunately I do not understand the information given in the document: I want to use a new encryption key for every encrypting file. AESCCC, AES. Cfb, AES.CBB or AES.OFB Is my belief that in my case I do not have to use iv / salt for (which means that I have Using a stable iv ?) Since I use AES. For key generation and use it only once? Hope Hope that my questions do not cause much confusion ;-) But I appreciate every answer, clarification or feedback. My reading of a doctor says that AESEG, FASTENGEN and Light Engine do all the different businesses. Memory versus Speed ​​To determine you, you must check yourself whether in your scenario These tradeoffs are also relevant or not. You will need to read on various AES modes under different circums...

ios - Naming guidelines for the selector methods of gesture recognizers? -

I started to naming my selector methods generally based on the description of the genescope, but the words "word" in front with. For example: UITapGestureRecognizer * aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget: auto-operation: @selector (handleOneFingerSingleTap :)]; But then I need different behavior (and different selector methods) for the same gesture in different ideas. Then I started naming my selective methods, which I wanted to do. For example: UITapGestureRecognizer * aRecognizer = [[UITapGestureRecognizer alloc] initWithTarget: Self-action: @selector (handleShowMyPopover :)]; However, I'm not sure that seems long-term. For one thing, the name of the method alone does not clearly indicate that it is a signal identifier selector. Or maybe the word "handle" indicates that this is a selector method? Do I need to worry about it? That's why I am asking: to see if anyone has the name of priority identifier selectors, P...

entity framework - EF 4.1 Code First. Table-per-type inheritance with different primary key name from its base class' primary key name -

Given this: create table location (location id int identity (1,1 ) No zero primary key, address nvarchar (maximum) zero, city nvarchar (maximum) null, state nvarchar (maximum) zero, zipcode nvarchar (maximum) zero); Table-Making Park (ParkID Int. Null Primary Key Reference Location (Location ID), Name Navratra (max.) Faucet); I tried this mapping: modelbuilder.Entity & lt; Location & gt; (); ModelBuilder.Entity & LT; Park & ​​gt; () ToTable ("Park"). Modelbuilder.Entity & lt; Park & ​​gt; (). Property (x = & gt; x.LocationId) .HasColumnName ("ParkId"); Unfortunately this is not working. Using (var db = new if ()) {var park = new park {name = "11th Street Park", address = "801 11th Street", city = "Aleado ", State =" TX ", zipcode =" 76106 "}; Db.Set & LT; Location & gt; () Add (park). Db.SaveChanges (); } There is this error in: Property 'Location ID...

javascript - Test if object is a DOM element -

A JavaScript function gets a argument that can be a DOM element or not. How does the logic ensure that the argument is a DOM element and not another object? With modern browsers, I think this is something like Examples of examples and example text / text node

android - What is going wrong in this? -

I am bringing a list of tables from the database I am using this code to get the list of tables: / P> public zeros show allTable () {db.execSQL ("select name from sqlite_master where type = 'table'"); } This query executes in the shell window. Now I want to display a list of tables in Android. How could this be possible? I am calling this function from some other activity. Edited: Thanks for the stack overflow, I found. The usual way of displaying a list of data is to use a ListView to do this You will need to: 1: Store db.query values ​​in the list by changing db.query instead of db.exec: ArrayList & LT; String & gt; Tables = new Arsuachee & lt; String & gt; (); Cursor mCursor = db.query ("sqlite_master", new string [] {"name"}, "type = table", null, null, null, null); If (mCursor.getCount ()> gt; {for (mCursor.moveToFirst),! MCursor.isAfterLast (), mCursor.moveToNext ()) {tables.add (mCursor....

php - CURL Request problem -

I am trying to verify PayPal's PDT information. I prepared my mockup form and submitted it. IT worked and returned the information too. I tried to do the same thing which curl request my mask form: & Lt; Input type = "hidden" name = "A" value = "-----" /> & lt; Input type = "hidden" name = "tx" value = "-----" /> & lt; Input type = "submit" value = "test" /> & Lt; / Form & gt; My curl rake code: $ arrData = array ('tx' = & gt; '----', 'cmd' = & Gt; '_notify-synch', 'at' = & gt; '-----'); $ Ch = curl_init ('https://sandbox.paypal.com/cgi-bin/webscr'); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ arrData); $ StrCurlResult = curl_exec ($ ch); Curl_close ($ ch); Return $ strCurlResult; EDIT: I got the following ...

html5 - why is this toDataURL line a security error? -

If an image is loaded on one page from another site, and then the canvas is partially Is written as, the use of: context.drawImage (Image, 0, 0, W, H); It would seem that the unsafe canvas would already have a draw on why window.location = canvas.toDataURL ('image / png' ); An error message exists SECURITY_ERR; DOM Exception 18. This looks External site is not more insecure than the extra step of saving the image elsewhere. My question is not how to move in this way, therefore Why is it unsafe? If the page loads from the server then the action is definitely required by the author. According to "post-text" itemprop = "text"> , the information leak may occur if scripts from the original can access information from the images (for example, to read pixels) The second basic concern is that a malicious app can detect such information which otherwise could not be accessed by loading any other domain / original (easily done with images) an...

c# - Build (and Debug) ASP.NET Web Application in a non-default folder location -

मेरे पास ASP.NET वेब अनुप्रयोग प्रोजेक्ट के साथ एक दृश्य स्टूडियो 2008 समाधान है। मैं $ (SolutionDir) \ WebApps \ $ (ProjectName) \ bin के लिए कहा गया प्रोजेक्ट का डिफ़ॉल्ट आउटपुट फ़ोल्डर बदलना चाहता हूं। यह मैं कर सकता हूं और जब मैं निर्माण करता हूँ तो मुझे इस फ़ोल्डर में उम्मीद की असेंबली फाइल मिलती है। यह सामग्री फ़ाइलों (एएसपीएक्स, इत्यादि) को मूल फ़ोल्डर में कॉपी नहीं करता है लेकिन मैंने इसे प्रोजेक्ट.csproj फ़ाइल को कस्टम बिल्ड लक्ष्य के साथ हैक कर ठीक करने में कामयाब किया है। समस्या यह है कि मैं चाहता हूं एएसपी.नेट डेवलपमेंट सर्वर का उपयोग करके इस एप्लिकेशन को डीबग करने में सक्षम होने के लिए, VS2008 में F5 दबाकर दुर्भाग्य से, asp.net सर्वर सर्वर शुरू होता है, आउटपुट डायरेक्टरी के अभिभावक की बजाय प्रोजेक्ट डायरेक्टरी में "भौतिक पथ" होता है। क्या मेरे वेब अनुप्रयोग को एक अलग आउटपुट फ़ोल्डर में बनाने का कोई तरीका है लेकिन अभी भी asp.net dev सर्वर को चलाने के लिए मेरी साइट डिबग? धन्यवाद। संक्षिप्त उत्तर हाँ है, लेकिन यह सुंदर नहीं है मैं उपयोग की गई प्रक्र...

jquery - jscrollpane gallery cutting off last image -

I am a web designer who changes a few photos to a new client in the horizontal scroll gallery on the existing web site. He mentioned that there is always no problem in the last pictures in his gallery, which is not always visible. If you refresh the page, it appears, but not when the page is initially loaded. Sometimes the last picture is completely lost, the second time it shows a small strip, but the rest is not cut until we refresh. I have no experience with horizontal jscrolling galleries. I am trying to use Control ++ and I see the code paste in the body of this post, but I get an error. If there is something that you need to see in action, please be sufficient to answer and I will send you the URL. Thanks in advance for any help! is required, but I'm sure somewhere you have 1 number less then it should be If you have something like [n] n, then 0 is offset. This means that you have placed 5 images in an array. The last photo can be seen as a picture [4] and no picture...

xml - finding children in php simplexml xpath -

I'm running an xpath query on an xml stream and I am running a group of data again in it with the tag name Need to find. But I could not find the way to retrieve the tag name. XML stream is & lt; Condition & gt; & Lt; Normal dataItmid = "Xovertemp-06" timestamp = "2011-09-02T03: 35: 34.535703Z" name = "xortemp" sequence = "24544" type = "templatelight" /> & Lt; General DataITMID = "ExServo-6" timestamp = "2011-09-02T03: 35: 34.535765Z" name = "xserve" sequence = "24545" type = "load" /> & lt; Normal dataItmid = "X-Travel-06" timestamp = "2011-09-02T03: 35: 34.535639Z" name = "extavel" sequence = "24543" type = "status" /> & Lt; / Status & gt; I'm trying to parse it as temperature = normal load - normal , So what have I done ($ Xml- & gt; xpath ("// n: condition") -...

webkit - Customizing context menus in python wwebkit gtk programs -

I work on using the Python WebKit and gtk modules to turn on the HTML / Javascript page in a desktop / application I am here. To do this, I have created a webkit window along with any other feature other than the WebKit window. import webkit, gtk, subprocess w = gtk.Window (gtk.WINDOW_TOPLEVEL) w.set_resizable (false) w.set_size_request (900600) w.connect ("delete_event", gtk.main_quit) Scroll_window = gtk.ScrolledWindow (none, none) web = webkit.WebView () web.open ('/ home / user / html / mypage .html') settings = web.get_settings () settings.set_property ('enable- Default-context-menu ', True) scroll_window.add (web) w.add (scroll_window) w.show_all () gtk.main () This works differently from context menu When I right click on most areas of the page, the context menu gives me the following options: back, forward, etc. TOP, reload. But when I right-click on a link, I get: Open Link, Open Link in New Window, Download Linked File, Download Copy Link...

php - Best way to store "tags" for speed in enormous table -

I am developing a large content site, with the table "content", with more than 50 million records. Here is the table structure: ID (INT11 index), name (varchar150 FULLTEXT), description (text FULLTEXT), date (INT11 INDEX) I I would like to add a "tag" to this content. I believe in 2 ways: Create a varchar (255 FULLTEXT) "Tag" column Table tags, all tags separated by commas Store, and do line searches by line (which I think will slow down) Use MATCH & AGAINS. 2 Create the table first table name "tag" column id, tag (varchar (30 INDEX or FULLTEXT?)), Id, tag_ID (int11 INDEX) and content_id (int11 INDEX) ) With "Content_tags" and 3 tables (to retrieve all content with a combined tag (s) of the contents - contents_tags - tags). I think this is slow and memory killer because 50M table * content_tag * tags a huge zone. Is it the best way to store tags to make it as efficient as possible? What is the fastest way t...

php - Join table rows by GROUP_CONCAT , failed! It's not working? -

I do not know why this is not working. I have a table with "resume" id from "SELECT id GROUP_CONCAT (SKILLS) SEPARATOR ','); It starts again, then two field IDs and skills it returns an error like this: Error: There is an error in your SQL syntax; On line '1' / Code> Resume_Check your manual for the right syntax to use near 'GROUP_CONCAT (skill SEPARATOR', '') from the school group. between the id and the group you miss the coma (,). From the correct id SELECT id, GROUP_CONCAT (skill SEPARATOR ',')

mysql - Running Multiple Queries through Shell Script -

I have 6 MySQL queries and I need to run the query through shell script and import the results into a CSV file I should know how to run a single MYSQL query through shell script, but how to run many queries from the shell script. just put a ";" Between all your queries select something from something; Update ?? |

c++ - What are lookup rules when calling function from lambda? -

निम्न उदाहरण VC ++ 2010 में सामने आई समस्या को दर्शाता है: वर्ग फ़ू {टेम्प्लेट & lt; class T & gt; स्थिर टी फू (टी टी) {वापसी टी; } सार्वजनिक: शून्य परीक्षण () {ऑटो लैम्ब्डा = [] () {रिटर्न एफू (1); }; // कॉल करने के लिए Foo :: foo & lt; int & gt; लैम्ब्डा (); }}; वीसी ++ का उत्पादन: त्रुटि C3861: 'foo' : पहचानकर्ता नहीं मिला अगर मैं कॉल को अर्हता प्राप्त करता हूं Foo: Foo :: foo (1); तब यह उदाहरण एक चेतावनी के साथ संकलित: चेतावनी C4573: 'foo :: foo' के उपयोग की आवश्यकता है संकलक को 'यह' पर कब्जा करना है लेकिन मौजूदा डिफॉल्ट कैप्चर मोड इसकी अनुमति नहीं देता इस मामले के बारे में मानक क्या कहते हैं? अयोग्य नाम होना चाहिए? क्या योग्य नाम के लिए यह पर कब्जा करने की आवश्यकता है? कई मामलों में रिपोर्ट देखें: जैसा आपने पाया है, स्पष्ट प्रस्ताव उसे नाम ढूंढने की अनुमति देता है। इसके बारे में एक अतिरिक्त चेतावनी है जो एक कंपाइलर त्रुटि भी है (नाम का समाधान इस तक पहुंच की आवश्यकता नहीं है, हालांकि मैं देख सकता हूं कि ...

c++ - Problem loading object data from text file -

Why does not this code load all values ​​from a text file? It only loads objects of the first object, but after that it is getting weird. Here's the code: #include & lt; Iostream & gt; # Include & lt; Fstream & gt; # Include & lt; Cstdlib & gt; using namespace std; Class space {public: location () {locName = "no name"; LocDesc = "no description"; LocID = 0; } Friend Ostream & amp; Operator & lt; & Lt; (Ostream & outs, const space & showMe) {// keeping the output is the same as input ... outs & lt; & Lt; ShowMe.locName & lt; & Lt; Endl; Exclusion & lt; & Lt; ShowMe.locDesc & lt; & Lt; Endl; Exclusion & lt; & Lt; ShowMe.locID & lt; & Lt; Endl; Return boycott; } Buddha Iron & amp; Operator & gt; & Gt; (Istream & amp; IN, location and Inococ) {getline (IN, inLoc.locName); Gateline (inLoc.locDesc); INS & gt; & Gt; InLoc.locID; Return INS; } Priva...

java - Regex to fetch all matching values from xml node -

After that I only get 1 match. I want to match all in a string or string array This is part of my output, from which to me category of & lt; Trace enabled = "wrong" & gt; & Lt; ActiveCategories & gt; & Lt; Category & gt; Environment & lt; / Category & gt; & Lt; Category & gt; EXEC & lt; / Category & gt; & Lt; Category & gt; External & lt; / Category & gt; & Lt; Category & gt; File system & lt; / Category & gt; & Lt; Category & gt; INPUT_DOC & lt; / Category & gt; & Lt; Category & gt; Interface and lt; / Category & gt; & Lt; Category & gt; Networking & lt; / Category & gt; & Lt; Category & gt; OUTPUT_DOC & lt; / Category & gt; & Lt; Category & gt; PREPROCESSOR_INPUT & lt; / Category & gt; & Lt; Category & gt; Request & lt; / Category & gt; & Lt; Category & gt; SYSTEMRESOURCES & lt; / ...

c++ - Boost CRC problem: different results with the same parameters -

I am using CRC for the first time ( boost :: crc_32_type ), and I saw Call that the call process_bytes () method gets twice the results with the same criteria, is it normal? #include & lt; Boost / crc.hpp & gt; # Include & lt; IOS & gt; // for std :: ios_base, etc #include & lt; Iostream & gt; #include & lt; String & gt; using namespace std; Int main () {string data1, data2; Boost :: crc_32_type Results 1, result 2; Data1 = "This is a test string"; Data2 = Data 1; Result1.process_bytes (data1.c_str (), data 1. lamps ()); Cout & lt; & Lt; "Results 1:" & lt; & Lt; Hex & lt; & Lt; Uppercase & lt; & Lt; Results 1. Check () & lt; & Lt; Endl; Result1.process_bytes (data1.c_str (), data 1. lamps ()); Cout & lt; & Lt; "Results 1:" & lt; & Lt; Hex & lt; & Lt; Uppercase & lt; & Lt; Results 1. Check () & lt; & Lt; Endl; Result2.process_bytes (data...

Any jquery plugin which automatic update time for all the posts of a page -

I have a page in which many posts are shown posted time, I update every 1 minute after that time Want a simple way to give them the same class and after 1 minute you can get all the elements and update the time. No better solution You can use a simple plugin like this: $ Fn.UpdateSince = Function {interval} {var times = this.map (function () {return {e: $ (this), t: parseint ($ (this). Html ())}}}); Var format = function (t) {if (t> 60) {return Math.floor (t / 60) + 'min ago'} else {return t + 'seconds ago'; }} Var update = function () {var now = new date (). GetTime (); $ .eEch (bar, function (i, o) {o.e.html (format (Math ((- now ota) / 1000));}); }; Window.setInterval (updates, intervals); Updates(); This return; } This sets a function that runs at intervals and updates the elements you specify. Elements have basically time in the integer format, meaning 1 9 71-01-01 to millisecond: & lt; Div class = "timesince" & gt; 1314952218...

c# - IOC and Silverlight -

In MVC asp.net, I can override a factory to create my controllers, and thus my IOC For just put a reference. By doing so, every interfaces required by the contractors of my controllers will be fed by the IOC. Is there some normal way to use Silverlight? At the moment, I only found the use of ninject kernels everywhere: public partial class MyUserControlSL {public MyUserControlSL () {DataContext = New MyViewModel (kernel. Get & lt; IMyRepository & gt; ()) ; InitializeComponent (); For example using StructureMap and MVC: Public class controllerfighter: Default controller factory {Safe override IController GetControllerInstance (RequestContext requestContext, type controller type) {IController Results = Zero; Try (if the controller type! = Zero) {Results = ObjectFactory.GetInstance (Controller type) as the controller;} Else {return base.GetControllerInstance (requestContext, Controller Type);}} Catch (Structured Mappress) {System.Diagnostics. Debug.WriteLine (ObjectFac...

Same technology for streaming video to iOS, Android app -

I want to know the best way to stream video to an iOS and Android apps. I would like to use the same technology for all mobile operating systems. I think the use of HTTP Streaming Live is because it is the only protocol supported by iOS. But I do not know whether HLS works on Android, BlackBerry and Windows Phone. If I use HTTP Live Streaming, then I do not need to use streaming or DSS streaming server, okay? Android tablet version (3.0+) only HTTP Live streaming supports, but (almost) all versions support RTSP streaming.

php - Session variable in Kohana 3 keeps being reset after having been deleted -

I have a notice class that is used once to provide message notifications The notification is stored in Koha Session (cookie) and my recipient looks like this (for ACO debugging): Private static function _get ($ key) {$ session = session: : Examples (); $ Value = $ session- & gt; Get ($ key); Revert $ key ':'. $ Session- & gt; Get ($ key) '& lt; Br / & gt; '; $ Session- & gt; ($ Key); The echo is 'destroyed'. $ Key ', value now:'. $ Session- & gt; Get ($ key). '& Lt; Br / & gt; & Lt; Br /> ';; $ Return; } Now, on the one page I use this category is the login page. When a user enters wrong login information, I also expect: There is an error in saying "username / password wrong". This message should be deleted because I have called the getter and it removes it from the recipient session. However, this is not the case. The message is also shown on the next page and if I go to any other ...

objective c - Change UITableViewController's style -

How can I change the style of a UITableView later? EDIT: Hi, I know how I set the style with init-method, but can change style after starting? Such as: [self. Style = "bundled"]; I think there is no way to do this, is not it? OK Anyone really is reading the question: D but its To answer: No, it can not be done, you have to recreate it

c# - Converting anonymous type to DataTable -

What is the fastest way to convert an anonymous type into DataTable? Update: I have to obtain and populate databases with anonymous type. If the reflection is ncensory, how can I do this by reflection? found: var results in p = cities in data sources In p.City p. Select new {property1 = cities.Key, property 2 = cities Average (p = & gt; p.age)}; Dt.Columns.Add ("Property1"); Dt.Columns.Add ("Property2"); Foreign currency (different items in result) {dt.Rows.Add (item.Property1, item.Property2); } For a general solution, see:

png - How to identify a NSData's image format? -

If I get an NSData that I know is the data of an image. But I do not know what this format is. So how can I identify which format is the format? JPEG or PNG? PS: IOS You can see and guess the first byte Are there. There are several lists of magic numbers available on the Internet, e.g. .

COM unregister/register type library problem -

I have a .NET COM DLL that I want to unregistered: regasm.exe / u ConfigManager.dll When I look with the COM-ole Viewer app, I still see in the Type Library section an entry for ConfigManager (Specifies the path of ConfigManager.tlb). How can I ensure that I can register for any entry in the ConfigManager.dll com? I ask this because I have a dirty mistake where it seems that the ConfigManager client does not see ConfigManager in some way and want to make sure that I re-register and register again ConfigManager All you need is a typelib registration feature TypeLibs are not specific to .NET, so that you can see these types of people Can find anywhere This is a simple one: I use TlbExp instead of RegAsm / tlb option to get typeplauses without registration. I like it. In this way I can specifically register (or unregistered) typewrays.

vim - Matchit not working -

I am using MacVM 7.3 snapshot 57. I can not find matching to work in any of my files. I press% on an opening tag. It does not take me closing tag ... My vimrc file: "Pathojen settings Call Pathojen # Rntaim_ Append_all_bundles () call pathogen # Helptag () sets the white stuff Nowrap Tabstop set = 2 sets Shiftwidth = 2 sets expandtab set cindent set of smartindent set autoindent set listchars = tab: nocompatible set number "blinkon0 set all blinking determined ruler guicursor + = a disabled": cursorline syntax set \ \, Mark: Â · Status bar laststatus = 2 default GUI color scheme "" toolbar "Guides" Start without t guioptions- t "Color default" Colors Molokai Color Railscasts set "set to set / set" set hlsearch set incessarch ignorecase set smartcase "Comments (): (" '\ " ") Line (" '\ "")> gt; & amp; amp; line ("' \") & lt; = Line ("$") \ | exe...

c# - Linq to entity framework error when using datetimeoffset -

I'm getting a strange error and I can not fix it, can someone help? The code below fails because it looks like o.ordered.DateTime.ToShortDateString () (This works when the part is commented on ). o.ordered is a datetimeoffset . There is an error in this below. I've tried some different versions like using toshortdatestring instead of date and tostring . from the LINQ method 'System.String ToShortDateString ()' method is not recognized, and this method can not be translated into the store expression o Bedb.onlineOrders of the above BeOrders = equals join BEdb.order_Statuses on o.status s.ID where o.custCode == pp.AccountID new DataLayer.OrderStatusItem {select city = o.city, customersOrderRef = o.customersOrderRef, date = (o.actualDelivery ?? o.plannedDelivery), DATE1 = (o.actualCease ?? o.actualCease), number = ordered o.number, = o.ordered.DateTime.ToShortDateString (), postal code = o.postCode state = s. Status, stockcode = o.stockcode, updatedByAcco...

Where can we use function pointers in C, what uses for function pointers -

I have recently been asked in an interview: Where can we use the function pointer in C? And what the function pointer returns I said that we can call the function using function pointer, then he asked some examples, but I could not satisfy some other examples with it. He then asked me what function pointer returns I told them that this function depends on the pointers announcement. But I would really like to know some of the function pointer in C. I think there is a classical example in C. Quote from there (and I know that this is, so there is a very good site, but this is correct). . (* Comparator) (Constant Worth *, Constant Wide *)); function that compares the two elements function will follow this prototype: int comparator (constant empty zero * Elem1, const void * elem2); The function should accept two parameters that are indications of elements, are typed as zero * These parameters should be returned to some data types and They should be compared. The re...

How to represent a random-access text file in memory (C) -

I am working on a project where I need to read the text in the memory (source) file and do the random work Enabling may enter (for example, reclaim the address related to row 3, column 15). I would like to know that there is a definite method of doing this, or work of data structures that are especially good. I should be able to use one (maybe amortized) consecutive time I am working in C, but if it is worth it then I am ready to implement high level data structures. My first idea was to go from a linked list of big buffers, in which the color data data would be file. I will also create an array, whose index is similar to line numbers and start of the content line. This array will be allocated again on the requirement. Subsidy Question: Does anyone get the average size of a source file? I was amazed at the fact that it is not on Google. To clarify: I am worried about the files are the source files, so their size should be manageable, they should not be modified. And var...

How come a returned string can be interpreted as a function in python? -

I learn the dragon by hard way and in the code snippet as I like below I've come. But I did not understand what is behind it, a function basically gives a string which is the function of the same name in the class. And it can call the function properly. Exit import from the class game (object): def __init __ (auto, start): self. Start = RF game (self): next = self.start while correct: print "\ n --------" room = getattr (self, next) next = rooms () def a1 (self): print " You are redirecting to A2, you are redirecting to A2, "Return 'A2' Def A2 (Self): Print" You are in A2, Returns from Death Def Def Death (Self) '0) a_game = Game ('a1') a_game.play () What do you see Getattr () is the result of builtin. Python is a high level language and what is more, an explanation Since all objects in the dragon are originally made in the form of hash-tables in memory, therefore Python has no large system. This means that Python r...

asp.net - Get user's geographical address -

Is there a way to track user's location without having to log in to the user's location on their address? // asp.NET thanks One can use the service to estimate their location from their IP address. Obviously, it's easy to cheat, but it's enough for a sufficient proportion of visitors.

ios - Errors autoreleasing objects just after their creation -

I am starting to investigate iOS development and I have some doubts about the release of those items for which I No reference cached. I took a look at the question "Is it possible to release an indicator without any object?" Where the autoregee message has been suggested to send immediately after its creation, and so I tried to do this in the following section of the code: int main (int argc, char * argv []} {NSAutoreleasePool * pool = [[NSAUTOriyReppul Alok] Init]; NSURLResponse * response = zero; NSError * Error = Zero; NSDT * Data; Data = [synchronous request to send NSRR connection: [[NSRR request request with url: [[NSUr URL with string: @ "http://www.google.it"] Autorelage]] Autoreques] Returning Response: And Action Error: And Addition ; [Write data file: @ "/ tmp / test.html" atom: NO]; [Data release]; [Pool drain]; Return 0; } I can not try to execute the program in XCode yet, but I am compiling it under Linux and the autorovous message ...

scrollview - Reset the scrollviewer to its initial position with Silverlight -

I have a silverlight app, which includes a scroll viewer in the grid layout. When I move the scroller down and close this grid with a closed grid, whenever I open the grid again, the scroller is left below. grdDetail.ScrollToVerticalOffset (0d); OR grdDetail.ScrollToTop ();

.net - Share SqlConnection object in ASP.NET Web App Between DB calls -

Whether efficiently sharing a single SqlConnection instance between at least one page or between a single request or a whole app call Is there any way to do this? If you are using ADO.NET or a framework that Uses ADO.NET , so it's already possible for you. Which database are you using? - Connection pooling may vary depending on the type of database. You can always verify it by monitoring your database server connection. For example, on SQL Server, sp_who2 will list all the connections to see the connection (connections) from your machine and see spid (each Unique identity for connection) remains the same among your web application page loads.

Android - custom Layout Inflater -

While taking data for XML, to be able to dynamically create layout based on my wish, the default layout Inflater There is no way to override the structure from the database Hmyzak using the Can and Methods

python - Check if element are in same paragraph (Beautiful soup) -

कैसे देखें कि क्या सुंदर सूप पेर्स ट्री के तत्व समान हैं & lt; p & gt; टैग यदि आप जानते हैं कि दोनों नोड सीधे & lt; P & gt; टैग, नोड्स की समानता की जांच करें nodea.getParent () == nodeb.getParent () ; अधिक सामान्यतः, जब तक आप & lt; p & gt; टैग को हिट नहीं करते तब तक ऊपर (ऊपर की ओर) खोज करें प्रत्येक नोड के लिए यह अलग से करें, फिर समानता के परिणामों की तुलना करें: getContainingPara (नोडा) == getContainingPara (nodeb) (चलो कोने की उपेक्षा और, सभी & lt; p & gt; टैग के माध्यम से पुनरावृत्त करें, दोनों पर मैचों के लिए खोज करने के लिए टेक्स्ट खोज या regex (es) का उपयोग कर: pat1 = re.compile (regex1) pat2 = सूप.फिंड ALL में सभी के लिए (regex2) recompile (regex2) '): Mat1 = pat1.search (पैरा) mat2 = pat2.search (पैरा) यदि नहीं (मैट 1 या मैट 2): जारी रखें # आपका मैच मिला

java - String Manipulation -

This form is XxYxZx in my string are X, Y and Z characters and are X numbers Can be different from 0-999. I want to split this string into this form. How can this be done? Xx Yx Zx Example: string myString = "A155B45C77D89"; String [] parts = myString.split ("(? & Lt; = \\ d) (? = \\ p {alpha})"); Println (Arrays.toString (parts)); Output: [A155, B45, C77, D89] Explanation: String.split works with regular expressions. Regular expression (? & Lt; = \ d) (? = \ P {alpha}) says, "matches all the substrings moving forward one digit, succeeded by an alphabet character "A155B45C77D89" , this expression corresponds to empty substrings A155 B45 C77's D89 ^ ^ ^ here | | here | | and here

java - Pressing the green key in blackberry -

I want to know that when the user presses the green key in the device, press the green key to start the phone call from the app directly. What happens when the incident is removed? Thanks I got an answer to be something similar in the way. Override KeyDown: Public Boolean KeyDown (Int kikod, int time) {if (keycode == Keypad.SEND) {// your event returns correct; } Return super. KeyDown (keycode, time); }

c# - WIF return to the RP application -

I am creating a WIF STS and I am able to generate a token. How do I return the token back to the originating URL? I have seen that this form exists in the wctx parameter in RRU =. How can I remove it without stacking it manually as a string? If you want to return tokens to the coming party, then you only use that method It can: var claims = new list & lt; Claims & gt; (New Claims (WSIdentityConstants.ClaimTypes.Name, User.Identity.Name), New Claims (Claim Type. Authentication Method, Form AuthenticationHelper.GetAuthenticationMethod (User.Identity)); Var Identity = Identification of New Claim (Claim, STS. Token Service Issue Types.); Principal = Claims Confirmation.Creature Identity (Identity); FederatedPassiveSecurityTokenServiceOperations.ProcessRequest (Request, Principal, StarterTokenServiceConfiguration.Current.CreateSecurityTokenService (), Feedback); Looking to remove criteria, then Take a look.

android - Capture Images With Intent without clicking the camera button again -

I want to get images through intent Intent camera element = new intent (android. Provider.MediaStore ACTION_IMAGE_CAPTURE) But the problem is that the camera has started with this code and the user has to capture the image to click the camera button, but what do I need to start the camera shodd INTENT This is the way I like Have done: Announce the camera example, and the Surfall Holder Create an object callback, and implement the method on Chitrakoot (the method is launched when you want to take a picture) mSurfaceHolder.setType (SurfaceHolder. SURFACE_TYPE_PUSH_BUFFERS); Camera Picturecrollback mCall = new camera.Picture callback () {@ProfitureTake public spaces (byte [] data, camera camera) {// your stuff}}; // Open the camera example mCamera = Camera.open (); {// Call on preview (Not sure that this is working without this call mCamera.setPreviewDisplay (mSurfaceHolder); mCamera.startPreview ();} Catch (IOException e) {// TODO Auto generated blocking block .printS...

animated gif - GIF Data Storage specification question -

In the GIF specification, here: I'm having trouble understanding It has two parts: This specifies the 'LZW minimum code size' which: This initial number of bits used for LZW code in byte image data Determines, as described in Appendix F. What does this mean 'the initial number of bits used for the LZW code'? How do GIFs work in LZW code references? (I think it refers to Limpel-Xavi-Welch). Where is the elusive 'Apxdix F'? (It is not in the body) It also specifies that after a single byte for 'LZW minimum code size', there is a block called 'Image Data', out of which the actual size is unspecified, and it 'Data Sub-blocks'. Does this mean 'data is all-block'? How do I work on the data sub-block size? Is it related to LZW code? If so, how should I explain it? Forgive all questions. Thanks for your time. As a side-note: Partial answer or answer to any question will also be highly appreciated. ...

sql - Poor performance of INFORMATION_SCHEMA.key_column_usage in MySQL -

मैं MySQL का संस्करण 5.5.11 चला रहा हूं और INFORMATION_SCHEMA.key_column_usage तालिका की जांच करते समय कार्यक्षमता वास्तव में खराब है। मेरे पास एक साधारण चयन का अनुरोध है: SELECT REFERENCED_TABLE_NAME, तालिका नाम के रूप में TABLE_NAME, कॉलमनाम के रूप में COLUMN_NAME, CONSTRAINT_SCHEMA AS DB से INFORMATION_SCHEMA.key_column_usage 400 पंक्तियां वापस करने के लिए औसत में 8 सेकंड लगते हैं क्या यह एक ज्ञात समस्या है? यदि हां, तो प्रदर्शन में सुधार करने का एक तरीका है (एक पैच हो सकता है?) वहां दिए गए टिप का उपयोग करके: मैंने सेकंड से एक सौ तक स्विच किया एक ही प्रश्न के लिए मिलिसेकंड यह सेटिंग, मेरा दिन सहेजा गया: innodb_stats_on_metadata = 0

java - How do I use jdepend's JavaPackage.containsCycle() in junit to detect whether my package is on a package cycle? -

I want to test through jdepend to see if my package tree is a package cycle (i.e., a direct cyclical dependency is) at is currently, it is not (see the output below, and jdepend's Eclipse plugin for tree Cycle is not found). But the below given idea, suggested in jdepend's manual, failed: // setup .... JavaPackage p = jdepend.getPackage ("tree"); System.out.println (p.getName (+ "Expiration Packages:"); For (object jp: p.getEfferents ()) {System.out.println (javaPackage) jp) .getName ()); } AssertThat (p.containsCycle (), is (wrong)); Output is: Tree's dependency packages: java.util java.lang java.lang.reflect java.util.logging java.io org Hmmmbrist The reason for this argument failure is that the cycles in () recursively getEfferents () calls, the resulting package puts it in the list and True If some package is already in it, therefore in the cycle () checks if there is a accessible package cycle (i.e. tree indirect cyclica...