Posts

Showing posts from July, 2015

c++ - Getting SFINAE correct with functions -

I have written a quick thing that determines that certain types (and arguments) are variable for plain function pointer Whether or not it works: template & lt; Typename F, typename ... args & gt; Struct is_stateless: std :: is_convertible & lt; F, typename std :: result_of & lt; F (Args ...) & gt; :: Type (*) (Args ...) & gt; :: type {}; It works for the longest time, but it has a serious drawback: std :: result_of & lt; F (Args ...) & gt; :: . If you accidentally gave incorrect arguments for your function (say that you have left & amp; ) due to result_of you type Field I like my is_stateless structure to be "false" in this case (as you like a "right" fun and logic that is not meant to be variable in a function Indicator). I am open to using the features present in C ++ 11 and C + 1 GCE 4.8. * And below. Any ideas on how to do it? institutionalizing result_of F for args is not allowed if you do it any...

Ruby Metaprograming and passing Parameters -

मैं रूबी में एक विधि को परिभाषित करना चाहता हूं define_method दूसरे फ़ंक्शन के अंदर। उदाहरण कोड नीचे है। def डेमो (method_name) variable = 5 define_method "# {method_name}" #stuff समाप्ति अंत नए परिभाषित के अंदर विधि मैं चर का उपयोग करने में सक्षम होना चाहता हूँ: variable = 5 जिसे पहले परिभाषित किया गया था उदाहरण के लिए, मैं ऐसा करने में सक्षम होना चाहता हूं: define_method "# {method_name}" चर वैरिएबल * चर अंत वापसी और चर स्क्वायर मिलता है। मैं सक्षम होना चाहता हूं: डेमो ("स्क्वेर्ड") x = squared # = & gt; 25 क्या एक तरीका है मैं define_method में चर "चर" को पारित कर सकता हूं भले ही यह एक ही क्षेत्र में नहीं है? ज़रूर, और आपने क्या काम किया है समस्या क्या है? [15] प्राइ (मुख्य) & gt; (मुख्य) * चर * चर [15] pry (मुख्य) [डेविड डेमो (method_name) [15] pry (main) * variable = 5 [15] pry (मुख्य) * define_method "# {method_name}" करना [ * अंत [15] प्राइ (मुख्य) * अंत = & gt; : डेमो [16] ...

java - Matcher lookingAt method matching empty String -

मैं एक Matcher उदाहरण का उपयोग कर रहा हूँ दिखने वाला () विधि lookingAt () फिर भी जब मैं एक खाली स्ट्रिंग से एक पैटर्न बनाते हैं और इसे खाली-रहित (ट्रिम) स्ट्रिंग के साथ मेल करने का प्रयास करते हैं तब वापस लौट रहा है। सबसे पहले, जैसा कि मैंने यह अपेक्षा की है: स्ट्रिंग फ़ील्ड = "डेव अलाबामा के पास गया" स्ट्रिंग एस्केपक्वाइडेड = पैटर्न। कोट ("दवे चला गया"); पैटर्न पैटर्न = Pattern.compile (एस्केप किया गया क्यूई, पैटर्न। सीएएसईएक्सएएनएसएएनटीटीईईईईएव); Matcher matcher = pattern.matcher (क्षेत्र); // matcher.lookingAt () == सच हालांकि, एक खाली स्ट्रिंग से उत्पन्न ये पैटर्न भी सही देता है: स्ट्रिंग escapedQuery = Pattern.quote ( ""); पैटर्न पैटर्न = Pattern.compile (एस्केप किया गया क्यूई, पैटर्न। सीएएसईएक्सएएनएसएएनटीटीईईईईएव); Matcher matcher = pattern.matcher (क्षेत्र); क्या कोई मुझे बताता है कि मैं क्या हूं बहुत सारे धन्यवाद। खाली नियमित अभिव्यक्ति सभी तारों से मेल खाती है यदि आप एक नियमित अभिव्यक्ति चाहते हैं जो केवल खाली स्ट्रिं...

python - Weird session object behavior in django -

I try to apply a simple train using a dictionary {ITEM_ID: quantity} I have been a list of items {{ID: Quantity}} dajax Quantity: (i.e., idem_id): ITEM_ID = integer (ITEM_ID) print "Itemid:", ITEM_ID # = 'Dajax' (if not 'in the cart' request.session: request.session ['train'] = {} train = request.session ['train'] If ITEM_ID is not in the car: car [ITEM_ID] = 0 car [ITEM_ID] ] = 1 print "cart:", train request.session ['train'] = train request.ses Sion.modified = true request.session.save () count = amount (cart.values ​​()) dajax.assign ('# cart_items', 'innerHTML', str (number)) I did not use any thing as a try, as mentioned in the document, I received a very strange result request.session.modified Cart: {u'1 ' : 1, 1: 1, u'3 ': 1, u'2': 1} Note: I explicitly rounded up the ITEM_ID, so I do not know Where is the string key coming from! Note: The cart object does not ...

scala - Json4s custom serializer with unordered fields -

In the example given on json4s readymade, this match only works if the order of the field is "starting": 0, "End": 0}. The match does not work if the start and end fields are swapped. The case match below is such that the JSON field order does not make any difference? JField ("End is there anyway to write", Jont (E)) :: JField ("JField"): Case JObject (JField) Code> I have not used this library, so I'm sure if this is not the right approach CustomSerializer [Interval] spreads the class IntervalSerializer (format (I came up with this after watching a few minutes spent docs) => ({Case X: JObject = & Gt; x.obj.sortBy {Case (k, _) = & gt; k} {Match Matters JField ("End", jint (e)) :: jfield ("start", joint (s) :: neel => new interval (start = s.longValue (), end = e.long value ())} }, {Case x: interval = & gt; Jobfact (Jeffield ("start", jint (BigInt (x.startTime)) :: JField ("en...

Remove element from JSON object by value -

I next JSON object console.log: object {0 "/ Files / F6 / BD / 05 / A9 / medium / f6bd05a970c63b77eae164a607441818.jpeg ", 1:" /files/ff/54/e3/17/medium/ff54e317d47631661eafeec6638ec530.jpeg ", 2:" / files / B 27/03/63 / 17 / medium / B 3276317020322ef77ac39447075286e.jpeg "} and I will remove the element from the string of the object: / files / f6 / bd / 05 / a9 / medium / f6bd05a970c63b77eae164a607441818.jpeg I have read a lot of solutions to this question but all numerical index of them Area were not object. I'll use jQuery for this, please help me in working for my trouble Thanks in advance. After Repeat the item to find the value and to delete the once found key: // called that should be your object value "foo": ({if the bridesmaid in foo) (foo.hasOwnProperty (a)) {if (foo [k] == = "/ files / F6 / BD / 05 / A9 / medium / f6bd05a970c63b77eae164a607441818.jpeg ') {foo [k] to remove;}}} Console.log (foo); ...

php - Mysql error in a search script -

I have created a script to search for specific profiles in a database. if (! Bottom ($ playerListName)) {$ searchQuery. = 'WHERE'% 'like the player's name $ PlayerListName. '%' And playerstats = 1 '; } If ($ playerAge!) {$ SearchQuery. = (! Empty ($ searchQuery)? 'And': 'WHERE'). 'Player edge =' '. $ Player ahead. ' ''; '; } If (is_numeric ($ playerSex)) {$ searchQuery = (! Empty ($ searchQuery)? 'And': 'WHERE'). 'PlayerSex =' $ Player.Sex. "And PlayerStatus = 1 ';} if (! Empty ($ player term)) $ {search query. = (Empty ($ search query)?' And ':' WHERE ').' PlayerPosition = ''. $ Player post '' and playerstats = 1 ';} if (! (Player player citizenship!) {$ SearchQuery. = (! Empty ($ search query)' 'and': 'WHERE') 'Player citizenship =' '$ player citizenship' 'and PlayerStatus = 1';} So far, ...

c# - ActionLink doesn't make correct with URL, but RouteLink does with attribute routing -

Sometimes I ActionLink refuses to create the correct URL with placeholders in my application, But when I specify the name on the root attribute, it generates the url properties. This is my most recent move, with this: [RoutePrefix ("RuleConfiguration")] Public class RuleConfigurationController: EntityController & LT; RuleConfigurationModel, RuleConfiguration & gt; {// ... snip ... [Route ("{configurationId} / edit", name = "Rule configuration edit")] Public ASICNC work and lieutenant; Actionsclass & gt; Edit (int configured) {return view (...); } // Setup ...} Looking at this setup, I expect ActionLink , when used like this: @ html.ActionLink (name, "edit", "rule configuration", new {configurationId = conf.Id}) me / RuleConfiguration / 1 / edit . However, I just get the / rule configuration when using the as RouteLink then: @ Html.RouteLink (conf.Name , "RuleConfigurationEdit", new ...

c# - ListView population from array -

I'm trying to fill a ListView with items from 2D array. Array will be like this: data: John Doe, jd @ test.com, 555-123-4567, Test Jane Doe, Jane @ Test. Com, 555-123-4568, test2 test, test, TT @ test. Com, 555-123-4569, test3 etc. The code I am using: for (int line = 0; line & lt; data length; line ++) {var item = new ListViewItem (); item. Text = data [row] [0]; For (int col = 1; col & lt; data [line] lang kernel ++) {item.SubItems.Add (data [row] [col]]; } contact list. ITEM Add (item); } I However, when I address it is only the first column ends dragging and adds it to the same code ListViewItem and display a single line Therefore, it will give me the above given data: John Jen test and nothing else you You can also provide support, thanks for that. Edit 1: Here is the contact list code this.ContactsList = new system.Windows Forms.ListView (); ... this. contact list. Reaching details = "Contact list"; this. contact list. Ac...

android - Change actionbar to overlay from within Fragment -

I have a piece (piece 1) that has been replaced by another volume (piece 2). The piece is placed on 1 stack. I'm using compatibility mode (not ActionBarSherlock) Here's my problem. I want the taskbar to be displayed as an overlay in some pieces, but not in others. Specifically, when 2 pieces are shown, I want to show it in the overlay and then want to return to normal operation after a piece 2 goes out. Piece 1 has a regular taskbar which is always visible but, when I change the fragment 1 with segment 2, then I need to hide the actionbars after 5 seconds. If there is a touch event, the operation has been shown again. It all works well, but, every time the proceedings are hidden or discovered, then section 2 is re-prepared. For this reason, I want to create an action bar in the frigate 2 show as an overlay. I know that I can change the actionbar overlay, but I do not know how to program this from inside the piece. I do not want to change it for every piece, just segme...

ember.js - Setting Ember js checkbox checked value based on if the current id exists in a hasMany relationship -

I am working on a small bill-sharing app. I have a bill model which is responsible for many ('people') who is a user model in which there are many ('bills'). And in a Bill Group model there are so many connections for the two previous models. I want to create a form to edit the bill. I use #each for both items in BillGroup I have a bill and a person, and I want to check the box if the person Present in the bill I have made a Jsbine to clarify my problem. Thanks. Due to this fact, you present a very difficult problem that your model does not match the template you want This is especially true because handlers do not support conditional ISS etc. One way that you confuse the model to look like your template. Back This.store.find ('billGroup', 1). Then (function (records) {var usersPromise = record.get ('user'), bill promotion = record.get ('bill'); return Em.RSVP.hash ((user: user promos, bill: billspromos})} }. (Function (mode...

Issue in jasmine unit test in angularjs -

var a, b = []; A = गलत; [Var1: a, arrayVal: b]। ForEach (फ़ंक्शन (परिदृश्य) {scenario.var1 = true; परिदृश्य। ArrrayVal.push ("1", "2");}); यह ("परिणाम", फ़ंक्शन () (उम्मीद है (ए)। टीबी (सच); // पहला टेस्ट उम्मीद (बी) .ट्यूक्वेल (["1", "2"]); // दूसरा टेस्ट}); उपरोक्त कोड में, द्वितीय परीक्षा की सफलता, 1 टेस्ट विफल हो जाती है, कह रही है "सत्य होने की उम्मीद की झूठी" कोई सुझाव? सबसे पहले, आपको अपने कोड में एक गलती है आप वैर 1 और सरणी के लिए मूल्यों को निर्दिष्ट करके एक वस्तु की तरह सरणी का इलाज कर रहे हैं। अग्रसारण का ब्यौरा इस तरह दिखना चाहिए: [{var1: a, arrayVal: b}]। प्रत्येक (कार्य (परिदृश्य) {scenario.var1 = true; परिदृश्य। Arrrayal.push ("1 "," 2 ");}); आपकी पहली परीक्षा क्यों असफल है, इसका संबंध है क्योंकि आप संपूर्ण मूल्य और 'ए' के ​​संदर्भ को बदल रहे हैं, जबकि 'अरियलवॉल' के साथ आप मौजूदा मान को जोड़ते हैं मूल्यों को सरणी में धकेलना यहां एक कोड उदाहरण है: var a ...

tsql - SQL Server query help to update the row instead of inserting -

I have two tables called T and T1. Problem: If a data is not available in # 1 T1 then I need to insert and if the data is avialable then I have to update. Let me say that I have got empty space before # T in the end date of # T1, then I need to get involved and if I get the data with the same ID with the same ID then I would end the # T1 Date must be updated in the date column and I do not want to have 2 ND entries in the table. How do I handle it? CREATE TABLE #t (ID INT, activedate VARCHAR (15), terminationdate VARCHAR (20)) CREATE TABLE # t1 (ID INT, VARCHAR (15 activedate), expiration date VARCHAR (20) ) Insert #t values ​​(1, '2006-01-01', NULL), (1, '2006-01-01', '2006-01-31') SELECT * FROM #t SELECT * # t1 (Different from selection #t *) on ds.id = al.id and ds.activedate = al.activedate and ds.terminationdate = al.terminationdate when not matched, then merge the merge into the # t1 DS (id , Activedate, terminationdate) values ​​(id, activedate, termi...

PHP: DateTime '-1 day' -

I have to get a date date in a certain time zone. I tried this kind of thing, but it is not working: date = new date time (new, new date time zone ('Pacific / Wake')); $ Column = $ date- & gt; Modify ('-1 day'); $ Yesterday = $ tomorrow- & gt; Format ('Y-M-D'); I still get the date of today. According to this problem, completely using php, depending on the version . In this case, method zodiacing (which is what you are trying to do) is available only on previously connected docs, only PHP version 5.3.0 and above. The mind in it, tells you why your code does not work, and works like @Derrick. If you ever upgrade your PHP version, or your host can upgrade it , You might possibly deduct those three lines in two: date = new date time (zero, new datetime zone ('Pacific / wake')); $ Date = $ date- & gt; Modify ('-1 day') - & gt; Format ('Y-M-D'); No improvement, I know, but the reason is that why it failed t...

sql - How do I replace an entire column in MySQL? -

Assume that I have the following table (Table 1) in MySQL: First name Resident Bob USA I also have the following table (Table 2 ) In MySQL: Resident Japan Canada Mexico I want to update Table 1 so that the end result is: First name Resident Bob Japan Jen Canada Steve Mexico Right now, I am thinking to do the following: 1) Creating primary key on both tables May include 2) Drop the "residence" column of Table 1 3) Join tables. Is there an easier and more efficient way to update the column? An additive will take at least the linear time, when it should be a continuous time operation. In addition, using multiple update queries is difficult and slower. Putting a line in a MySQL database looks fast and straightforward. I am thinking that there is an easy way to insert a column in a MySQL database. Thank you! There are incidents that can change the order of the rows in your tables, so you actually order You want to keep a column to differentiate. If for...

asp classic - Newbie need help ASP-HTML -

appreciate if you can help me (newbies). I have "page.asp" from the server with the following body code: & lt; Body & gt; & Lt; Input id = "value1" value = '& lt;% = Value1% & gt;' Type = "hidden" /> & Lt; Input id = "value 2" value = '& lt;% = value2% & gt;' Type = "hidden" /> & Lt; Input id = "value 3" value = '& lt;% = value3% & gt;' Type = "hidden" /> & Lt; Input id = "value 4" value = '& lt;% = Value4% & gt;' Type = "hidden" /> & Lt; Input id = "value 5" value = '& lt;% = Value5% & gt;' Type = "hidden" /> & Lt; Input id = "value 6" value = '& lt;% = value 6% & gt;' Type = "hidden" /> & Lt; Input id = "value 7" value = '& lt;% = value7% & gt;' Type = "hidden" /...

php - How do I show all posts but exclude a specific category on wordpress? -

I have this code, which still cares about all the posts without any class. & lt ;? Start Php / * Loop /? & Gt; & Lt ;? Php global $ query_string; Query_posts ($ query_string 'and _sticky_posts = 1'); ? & Gt; & Lt ;? Php while (is_pos ()): the_post (); ? & Gt; & Lt ;? Php get_template_part ('content', get_post_format ()); ? & Gt; & Lt ;? Php timeline; // End of loop? & Gt; & Lt ;? Php wp_reset_query (); // Reset query? & Gt; How do I do the same thing, except for the posts with the category 'blog'? You can use the thing below: - $ Query = new WP_Query ('cat = -12, -34, -56'); OR $ query = new WP_Query (array ('category__not_in' = & gt; array (2, 6));

websocket - Custom route SailsJS and Socket -

हे SailsJS पर सॉकेट के साथ एक कस्टम विधि का उपयोग करना चाहेंगे। new: function (Req, res) {Talk.create ({message: "text"})। Exec (फ़ंक्शन निर्मित (गलती, बनाया) {Talk.publishCreate (created); res.send (created);}); } क्लाइंट साइड पर मैं यहाँ जैसा वर्णित किया है ठीक उसी तरह कर रहा हूं: publishCreate क्लाइंट साइड पर अपडेट नहीं भेज रहा है क्या ऐसा कुछ है जो मुझे याद आ रहा है? सबसे अधिक संभावना यह है कि आपने .watch () को बनाने संदेशों की सदस्यता के लिए विधि, जैसा कि आप से लिंक किए गए दस्तावेज में बताया गया है: प्रकाशित करें का डिफ़ॉल्ट कार्यान्वयन केवल संदेश प्रकाशित करता है अग्निशामक, और सॉकेट के लिए घड़ी पद्धति का उपयोग करके मॉडल वर्ग में सदस्यता लेती है सैल्स के नवीनतम रिलीज में, sails.config.blueprints.autoWatch संपत्ति डिफ़ॉल्ट io.sockets.get ('/ talk') के रूप में, जब भी कोई "कॉल" मिलती है, तो सॉकेट स्वचालित रूप से "बनाने" संदेश के लिए सुनना शुरू कर देगी कोड>। अन्यथा, आपको सॉकेट को मैन्युअल रूप से अपने नियंत्रक में ...

c# - Selenium: how to find textfield element is present or not present then do something with it? -

& lt; इनपुट आईडी = "पासवर्ड" नाम = "पासवर्ड" maxlength = "500" size = "18" स्वतः पूर्णांक = "बंद" प्रकार = "पासवर्ड" & gt; & Lt; इनपुट आईडी = "पासकोड" नाम = "पासवर्ड" अधिकतम लंबाई = "6" आकार = "18" स्वत: पूर्णांक = "बंद" प्रकार = "पाठ" & gt; मुझे यह पता लगाना है कि पासवर्ड टेक्स्टफ़ाइल अस्तित्व में है और फिर "mypassword" दर्ज करें अन्यथा अगर पासकोड टेक्स्टफील्ड मौजूद है तो "myPassCode" दर्ज करें और अपवाद छोड़ दो। यदि इनपुट आईडी "पासवर्ड" मौजूद है तो अन्यथा अन्यथा "माइटेक्स्ट" दर्ज करें यदि इनपुट आईडी "पासकोड" मौजूद है तो "myPassCode" दर्ज करें और अपवाद छोड़ें (गुम पासवर्ड, पासकोड टेक्स्ट फ़ील्ड) एक बेहतर होना चाहिए यह करने के लिए रास्ता तो यह ???? (खराब कोड): ( प्रयास करें {driver.FindElement (By.Id ("password")) SendKeys ("myPassword");} पकड़ (अपवाद पूर्व)...

assembly - Trouble Reading Sectors off of CD INT 13h AH=42H -

"itemprop =" text "> I have a bootloader that is trying to write books off of a CD instead of a floppy and I start by Only the first area is to be read but when I run Carrie Flag is still set and according to the document from here: It means that it is unable to read the area from the image. Here's my complete boot code: / P> bits 16 org 0 X00 Start: JMP Main; Define color for text% Teal 0x03% Definition Red 0x04% Definition Purple 0x05 COL: db 0 Row: db 0; Print% macro print 2 macro for XOR dx, dx mov dh byte [ROW]; Dh registers the line register xor bx, bx mov bl,% 2 mov c,% 1 call cprint mov ah, 0x02; Set cursor position mov bh, 0x00, page 00 dh; Line 00 mov dl, 0x00; Colonel 00 Intex 0x10 mov byte [ROU], DH; Next time we need to print% endmacro cprint by saving the rows:; Regular: output string in SI on screen .top: Parameter mov for input, ah, 09h; Color mov cx, 0x01; X position should be 9 to print the lodsb; Get the character from String Test Al, A...

c# - How to validate user login through stored procedure -

I am trying to call the method with my code - behind which links to my business access layer and method From the click of the Data Access Layer login, I want to know if the data table gives a line of values, and if the user is redirected to my product page. The problem is that my method is not returning anything, so if nothing happens click the button Can anyone tell me what I have done? // Private zero log in the code () {// it joins the BA layer string usernameName = Convert.tostString (txtUser.Text); String Password = Convert ToString (txtPassword.Text); New ballogin () Valid user (username, password); } / / Method / Method in your Business Access Layer class (Public Zero) ValidateUser (String Username, String Password) // wasvoid {new GetUser (). GetUserpassword (username, password); }} // Code Data Access Layer Public Zero GetUserpassword (String Username, String Password) {DataSet myDataSet = new DataSet (); SqlCommand cmdvaliduser = New SqlCommand (); Cmdvaliduser.Command...

Can't seem to get a linq bound datagrid to be savable vb.net -

It seems that it should be simple, but I've fought with it for 2 days. I have a datagrid, filling it with a linux query, editing it to the user, saving it via sub-messages. This works: Dim ReportData 2 = T. Db.Inventory_Items T Select but this clearly Gives all the columns ... So .. try this: Slow reportdata2 = In TDB select Inventory_ITs T.Description, T. The client looks fine but I will not let the edit - seems to be read only, okay ... by creating an ordinary class, avoid the anonymous type: Dim Report Data 2 = DB.Inventory_ITs {new_name}. {.emem_Desc = t.Description} Now I can edit it, but when I Submeptanges, it does not throw an error, but it does not save the database. What is the world that I am missing? Any help will be awesome! The problem is that you are not editing any object from your data reference , Some of them are getting data and putting it into new items, then modifying those new items, modifying those new objects does not affect ...

ruby - Can you integrate Shoes apps into Sinatra? -

How would the shoes integrate the GUI with something like something? How does it work or is it not possible? Will I call it instead of an ARB file? Can the shoes get, keep, post and remove GUI requests? Thank you. You can use REST requests from any application, so obviously even with shoes. Take a look at the gem - this is the quick solution for small customers. Or you can use, like an active archive approach.

objective c - Button not moving randomly -

I have to unmatch a button randomly and have to click on it to a user even if they have the right amount If not, then it disappears and I want to take it to a different place. However, whenever I do not click on it, it appears in the same position on the right screen. Here's my code. - (IBAction) randomRed: (ID) sender {[auto red dot]; CGRCT senderframe = [sender frame]; CGRact superbound = [[sender supervision] border]; Senderfram.orine.x = (superboxious.width - senderframe-size.width) * dracon48 (); SenderFrame.origin.y = (Superboxize. Highlight - Sender Frame Size. Highlight) * drand48 (); [Sender setframe: senderframe]; Counter = counter-1; [Self Performance Selector: @Selector (Showdot) withObject: After zero: 1.0]; } - (zero) startRedDot {if (counter == 0) redDot = [NSTimer scheduled timer with time interval: 4.0 target: auto selector: @ searcher (showRedDot) userInfo: zero repeats: yes]; } - (zero) showRedDot {{[UIView startup permissions: zero reference: NULL]; [UIVi...

jquery - MVC Remote Attribute Additional Fields -

jquery is to add the prefix of the input field name (mymodel.field1) in each region are listed in the remote verification data field val -remote additionalfields In my spare areas, I have a hidden field, which is not part of the model, hence its name is "fieldhide" rather than "mymodel.fieldhidden". I have a "Fildhaid" instead of "mymodel.fieldhidden" in the query string key is confirmed by reviewing the request object controller and confirmed data is zero. Pretty sure its looking for jquery verification "mymodel.fieldhidden" because it's empty and definitely can not find it. Is there a way to create jquery through mvc properties, auto no prefix or jquery auto fields through manipulation no additional fields, where the name of values ​​such as "model.fieldname" feature Formatted, where remote verification has been added? What I had to do was add the hidden area twice. I had already had a general setup for sev...

copying portion of object array in Java -

If I have an object array in Java then car [] a = {0,2,2,3 , 4, 5, 6, 7}. How do I copy this array from 2 to 7? I thought about making it for a loop car [b] = new car [a.length - 2]; For (inti = 2; i & lt; a.length; i ++) {b [i - 2] = a [i]; } Is there another way to use Java built in some library? If so, will it be more or less efficient than the proposed loop? You can use the copyOfRange to copy some of the categories arrays class sample: Arrays.copyOfRange (b, 2, 7); method copyOfRange (T [] from the original, int, int)

ios - webview won't load with string -

Viewdidload in my webview I am implementing the following code The problem is that when I include NSString * encodedString, the webview Will not be visible. I have a search string with spaces and sometimes. Any ideas about what's going on here? NSString * urlString = [NSString stringWithFormat: @ "http://google.com?q=%@", search-string]; NSString * encodedString = CFBridgingRelease (CFURLCreateStringByAddingPercentEscapes (NULL, (CFStringRef) urlString, NULL, (CFStringRef) @ "! * '() :: @ and = + $, /?% # []", KCF string encodingTTF 8)); NSLog (@ "searchstressing% @", searchstress); NSURL * myURL = [NSURL URLWithString: EncodedString]; NSURLRequest * myRequest = [NSRR request request with url: myURL]; [Load webload load: myRequest]; What will happen to Google's first page results for this search string? try it NSString * urlString = [NSString stringWithFormat: @ "Http://www.google.com/search?q=%@", search-string]; Ur...

r - Access local mysql server with shiny.io -

I am trying to create a shiny app in shiny.io which requires access to the MySQL database, which is my local Located in the machine. Is it possible to use RMySQL to connect to local databases by shiny.io? And how can I do this? I am a bit "late" to my answer, but keep in mind that if you are shiny Are deployed. Then the "localhost" shines Pointing to and you do not have any MySQL :-) So you have to open your MySQL server and your public IP address "host" variable is not such that I am proposing it, from the point of view of security, It is not wise to open your MySQL server publicly. If you follow this way, at least, you should only filter the connection to allow shiny.io's IP address. Another solution - More appropriate, in my opinion - might already be using a public server, provides you with a firm layer, such as mongohq.com (now). They use MongoDB (not MySQL), but it can meet your requirements (and you will get 512 MB of RAM for test ser...

c - page faults while reading a large file -

I'm working on a system with 4 GB RAM. I started a large file of 4 GB and started it with zero I started reading the big file integer by integer I think the number of page defects (major) Is zero, how big is the file. I did not find any page fault in both the files as both the file pointer as well as the file descriptor. Why is that so? Does the page fault in a program happen only when I swap internally? If yes, then you can suggest a program that would be a mistake of a page. I am working on Ubuntu 12.04, my computer specs: 4 GB RAM, 500 GB hardcuck thanks in advance in virtual memory data and it is not available in the RAM. Reading from a file such as I / O functions such as read () or fscanf () does not; You are requesting file contents directly from the disk, not through virtual memory access If you map the file to virtual memory using mmap () And try to access that memory, you will see errors in the file because the contents of the file are loade...

leiningen - How to disable Clojure assertions, including preconditions? -

Are there some good ways to disable Closer Claims (including pre-condition and postconditioning) in REPL? per set for an arbitrary leaning profile: Global- Your profiles.clj in from {* assert * false} . . You want to put the above settings which can be entered in Leaning profile.

ios - To change bundle identifier using command line (xcodebuild) -

I have two bundle identifiers which I need to specify in the terminal when creating an IPA file. Could? I have used the command below to generate an IPA file ExxonBild-export archive-export format IPA-archive path "/ users / XML / download / image-emeklokal Search -master / local search example .excrev "-exportpath" / users / xxx / desktop / local search.eppa "-export pricing profile" xxx development " Here I want to specify bundle identifier Yes. Any suggestions? Is this possible? It was resolved by following the link In the config files the bundle identifier Mentioned and from terminal: xcodebuild -xcconfig filename

php - How to create multiple laravel projects in wamp 2.4 (Windows 7 32 bit) -

New for Lorele and PHP programming I have successfully installed Laravel 4 Framework on my VM. Now, I want to import an existing Laravel project (Apache is configured and compiled from VC11) in my local 2.4W (PHP 5.4.16). So, my question will be 1 Is it possible to host 2 Laurel projects on the same machine for Vamp? 2. If Yes (1) is in, then what do I need to configure it or is there a guide / tutorial on it? 3. If there is no one (1), will I need to reconfigure the original settings of the existing Laurel project, so that it works on my steam? The simple answer is: The Vamp has a www directory c: \ wamp \ Www \ so you can create just two projects, for example c: \ wamp \ www \ project1 and c: \ wamp \ www \ project2 and the manufacturer's Import the project together

Warnings with a new Xcode project using FMDB, SqliteCipher and CocoaPods -

After I have installed CocoaPods .. and loaded as instructed in the workspace. I'm getting these warnings that I do not understand, here's an example: Legumes - CipherDatabaseSync-SQLCipher sqlite.c / Users / admin / Code / CipherDatabaseSync / Pods / SQLCipher / sqlite3.c: 24035: 13: Macro's ambiguous extension 'Max' I have seen around for a few hours and can be stumped on what I have to do Can someone tell me somewhere in the direction that will give some insight? Thank you. sqlite.c file it seems like MIN and MAX are trying to file two different - Must be defined in different areas. For the first time on line, 214 / * for macros min / max * / #ifndef min #define min (a, b) ((a) Lt ;? (b)) (a): (b)) #endif / * min * / #ifndef max #define max (a, b) ((a)> gt; b) (a): (B)) #endif / * max * / Then the second thing is 8519 / * ** on line To calculate the macros minimum and maximum of two numbers. * / #define min (a, b) (a) of & lt;...

Is there a way to allow safe html data bind in polymer? -

Is there a way to allow data bind with HTML rendering in polymer? For example AngularJS has the "ng-html-bind" instruction that works. I'm looking for something similar. Here is an example where I am ready to use it. & lt; Core-tooltip & gt; & Lt; Core-icon icon = "info-layout" size = "30" & gt; & Lt; / Core-icon & gt; & Lt; Div tip & gt; {{Box.description}} & lt; / Div & gt; & Lt; / Core-tooltip & gt; Any suggestions on how to do this differently? I am loading this data from a json file and I'm searching for a general way to allow "safe" HTML rendering (against XSS). It has been answered several times:

php - How to deal with time zone in MySQL? -

I have a script that works like "Google Analytics" to basically display visitor statistics for a user . I want to generate a report in that user's time zone. So far I have written a code with it: SET time_zone = timezone; This determines the time zone according to each MySQL connection. If a user retrieves data with the timestamp , the timestamp changes to the time zone of the connection. I am accumulating UTC in the timestamp. So everything seems to work. But some people are saying that this is a wrong view. Because many users can not connect to the database with different time_zone settings. But they say: The per-connection time zone that each customer connects, has its own time zone setting, according to the time zone_zone of the session it happens. Initially, the session variable takes the value of it from the global time_zone variable, but the client can change its time zone with this statement Although they urge you to do anything with tim...

Selenium Python click a link to javascript in an unordered list -

I am trying to click and activate the JavaScript link with Selenium. This is for a 5 star rating widget; Five-star is the exact item below Other items, IE4 stars are not fully displayed. & lt; Div id = "percentages_and_ratings" & gt; & Lt; Div id = "percent" & gt; & Lt; Div id = "rating" & gt; & Lt; Ul id = "personality-rating" class = "star-rating profile_rating" onmouseout = "vote.policestaraut (this)" onmouseover = "vote.tarstarver (it)" & gt; & Lt; Li id = "current-personality-3198779465475184989-1" class = "current-rating" style = "width: 0%;" & Gt; & Lt; / Li & gt; & Lt; Li & gt; ... & lt; Li & gt; ... & lt; Li & gt; ... & lt; Le & gt; ... & lt; Li & gt; & Lt; Class = "five-star" title = "" href = "javascript: processVoteNote ('vote', 'personality...

cordova - Phonegap config.xml reverts after build -

Using the command line to create a project Cordoba Build Android I made in config.xml The change has returned to the original config.xml in the project_name \ platforms \ android \ res \ xml . I am trying to change version number, description and author etc. Why is this? You need to make changes to the app / config.xml file. Note that prior to version 3.3.1-0.2.0, the file exists on ap / www / config.xml

javascript - Node.js Error: EISDIR, open Error -

I'm trying to copy one folder by using node.js in the second path here: - D: \ node \ files \ 11 \ j1_1 \ j1_2 \ j1_3 path path j1_3 to path d: \ node \ files \ 11 \ j1_1 \ Here my code is: - var source = fs.createReadStream (old); Var dest = fs.createWriteStream (newp); Source.pipe (destination); Source.one ('end', function ()) {/ * copied}); Source.on ('Error', function (error) {console.log ("hi"); / * error * /}); But I'm getting this error: - events.js: 72 for er; // unwanted 'error' event ^ Error: Iaisdiaiar, open "D: \ node \ files \ 11 \ j1_1 ' I've also tried fs.rename function, but I have a Only get error. First: Iaisdiaiar means "error goal is a DIR" (I think ), Second: that is what you think me

Android GridView full screen -

I have GridView and I have to customize the BaseAdapter Use text in my GridView I have a problem, when I run my app, my 'Gridview' left, right, top and bottom margins. I do not need these margins. This is my xml source: & lt; GridView xmlns: android = "http: // schemas.android.com/apk/res/android" android: id = "@ + id / strada_grid_view" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Background = "# D6d6d6" Android: Gravity = "Center" Android: Horizontal Location = "1 DP" Android: numColumns = "2" Android: verticalSpacing = "1dp" & gt; & Lt; / GridView & gt; GridView adapter XML code: & Lt; TextView android: id = "@ + id / stradaID" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android: layout_alignLeft = "@ + id / desc1" Android...

java - Xtend Error on overriding method that is returning an ArrayList -

मेरे पास एफ़्रैक्टफैक्टर.जावा नामक एक इंटरफ़ेस है। सार्वजनिक इंटरफ़ेस सारफैक्ट्री {सार्वजनिक एरेएलिस्ट & lt; TestStruct & gt; getListOfStruct (); } यह इंटरफ़ेस ExcelTester.xtend क्लास में कार्यान्वित किया गया है। वर्ग ExcelTester लागू करता है abstractFactory {override getListOfStruct () {val a = new ArrayList & lt; teststruct & gt; एक}} एक वर्ग है जिसमें चर की सूची होती है। class teststruct {@Property int iRow; @ प्रॉपर्टी इंट आईकॉल; @ प्रॉपर्टी स्ट्रिंग sContents; } यह कोड संकलित करने में सक्षम था, लेकिन अगर मैं एक साफ बिल्ड करता हूं, तो एक त्रुटि फेंक दी जाती है। "विधि getListOfStruct (): प्रकार के ArrayList ExcelTester एक superclass विधि ओवरराइड करना चाहिए।" इस त्रुटि को ठीक करने के लिए, मुझे बस फ़ाइल "स्पर्श" करने की आवश्यकता है (कहीं भी स्थान जोड़ें और फ़ाइल सहेजें)। मैं ओवरराइड कीवर्ड का उपयोग कर रहा हूं। किसी को भी पता कैसे त्रुटि बनाने के लिए दूर जाना है? यह एक साफ निर्माण के दौरान नहीं होना चाहिए क्योंकि कोड पर कोई त्...

ios - Pushing a view onto the Navigation Stack from a view inside a container view? -

Image
वर्तमान डिजाइन मेरे पास वर्तमान में मेरे स्टोरीबोर्ड पर एक दृश्य नियंत्रक है एक एम्बेडेड टैब नियंत्रक और एक एम्बेडेड नेविगेशन नियंत्रण है। इस दृश्य नियंत्रण में एक कंटेनर दृश्य भी है जो कि नेविगेशन बार में स्थित खंड वाले नियंत्रण में चयनित मान पर निर्भर करता है। कंटेनर के लिए दृश्य लोड हो रहा है कंटेनर दृश्य के विचार XIB फ़ाइलें हैं (स्टोरीबोर्ड आधारित नहीं) और प्रोग्रामेटिक रूप से लोड किए गए हैं: - (शून्य) दृश्यडिडलोड {[सुपर व्यूडडलोड ]; // पहला नियंत्रक self.firstViewController = [[प्रथम दृश्य नियंत्रक alloc] init]; // दूसरा नियंत्रक self.secondViewController = [[द्वितीय दृश्य नियंत्रक alloc] init]; // एक ऐरे सेल्फ कंट्रोलर्स के लिए नियंत्रकों जोड़ें = @ [स्व.फ्रीस्ट वीव कंट्रोलर, सेल्फ। सेकंडव्यूकंट्रोलर]; // लोड पर पहला दृश्य नियंत्रक दिखाने के लिए कंटेनर सेट करें [स्वयं डिस्प्लेसंपादन नियंत्रक: [self.controllers firstObject]]; } - (शून्य) displayContentController: (UIViewController *) सामग्री {[स्वयं addChildViewController: सामग्री]; Content.view.frame = [सेल्फ...

haskell - Weird type signature while combining IO actions -

मेरे अपने मशीन पर निम्न कोड प्रिंट होता है: $ ghc --version The Gloryious ग्लासगो हास्केल संकलन प्रणाली, संस्करण 7.6.3 $ रनहोस्केल क्यों एचआईएस [1,1,1] [2,2,2] लेकिन एफपी पूरा होने पर यह एक त्रुटि उत्पन्न करता है: (जब तक मैं GHC 7.8 पूर्वावलोकन , क्लोनिंग के लिए एलपीस) पर स्विच कर रहा हूं src / Main.hs@4: 7-4: 13 (मोनाद के लिए कोई उदाहरण (- (& gt; ) (आईओ इंट)) 'वापसी' के उपयोग से उत्पन्न हो सकता है संभावित सुधार: (Monad ((- & gt;) (IO Int) के लिए एक उदाहरण घोषणा जोड़ें)) अभिव्यक्ति में: वापसी 3 `अंक 'के लिए एक समीकरण में : Num = return 3 यहां कोड है मैं एक फ़ंक्शन बनाने की कोशिश कर रहा था जो एक आईओ एक्शन बार को IO Int कार्रवाई में दोहराता है मैंने देखा है कि जीएचसी ने num । आयात नियंत्रण के लिए एक अजीब प्रकार के हस्ताक्षर प्राप्त किए हैं। मौनद - अजीब प्रकार के हस्ताक्षर की सूचना, के लिए - ऐसा लगता है - कोई कारण नहीं: IO Int - & gt; Int संख्या = वापसी 3 प्रतिनिधि: IO Int - & gt; आईओ [इंट] प्रतिनिधि = संख्या> और gt; = प्रतिकृति एम प्रति...

ios - Share a link to mail using DropBox API -

I need upload a picture taken on a dropbox in my iOS device and then given a link to that picture Mail in the mail DBRestClient using the representative methods I can get the link for the uploaded file. Now, I want to send a link to this link, mail and I want it to be in Dropbox, so that I MFMailViewController You can not Dropbox-API is not supporting this feature (anyway). If you really want to avoid user interaction, you can try sending your mail through the SMTP server. How to do this example is available.

javascript - Trying to submit a form after loading it via ajax -

I am loading with the server using an Axoux, but when I try to submit it, it never also not submitted .. the code is: $ (document) .ready (function () {function successHandler (result) {} function Trutihandlr (error) {} $ .ajax ({ Url: "http: /www.***************************************************************************************** ******************************, ul '). (); Ajaks. Piarjesaanpi (result);} error: function ( Request, error) {warnings ('network error has occurred please return Do Ryas! ');}}); Var ajax = {parseJSONP: function (data) {$ ( "# movie-data'). Aepend (data); $ (" # movie-data). List View ( ' Refresh '); var newtheme =' b ';}} // here try to present the I $ loaded form ( "form"). (on' Submit ', function () {alert ( "form Submit ");});}); As you can guess, I expect a warning ('submit form') after submitting it. you get the Jquery function Submit () (): $ (...

javascript - object constructor pointing to Object function after redefining prototype of self defined function -

Image
Whenever I've redefined the prototype of the function and made it a new object, its constructor root object function itself Function explain me with this scenario: var person = function (firstName, lastName) {this.firstName = firstName; This.lastName = lastName; } Person.prototype.getFullName = function () {return this.firstName + "" + this.lastName; } Var Student = New Person ("Ankur", "Agarwal"); Student.constructor // The person who is correct After that I redefine the person prototype and Person.prototype = {} Var manager = New Person ('John', 'Smith'); What is the number of the manager.constructor // object? In addition, if the object is pointing to luck, then how does it come to use the names of persons like the first name and last name? This.lastName = lastName; } There is a default prototype property, which is an object manufacturer property reference person manufacturer. This is such property tha...

c - Compiler discrepancy in expression evaluation -

I have implemented the following function for impressions if-then-other: Int foo (int x, int y, int z) {int negOne = (1 I have some restrictions, and the top part was a bit of hack, but it works. The test evaluates for only 0 or -1. The assignment uses a specific compiler, and in the case of X = 0, y = -2147483648 and z = 2147483647, the compiler says that returning my code -2147483648 This will not happen because if x = 0, then test = 0. If test = 0, then the answer will be evaluation expression z, i.e., 2147483647. I have double-checked my output on two different compilers and it says that I am returning the correct answer of 2147483647, so I think that this is a compiler error, maybe an integer Related to the limit? Of course, the mistake is in my code. Additionally, additional compiler info: compiler is called DLC compiler. Before me, there was "parse error" problems declaring my variable in the middle of my function, and I was told that the compiler...

sql server - SQL query takes much time to execute -

I have a table candidates 43,437 rows with data, which are created by many employees I want to get a report in which I want to get the personalized candidate of each employee in a period of 7 days .. I have performed the following queries for this. Select E, E.Employinaame, (Candidate Select from C to count (CID) where CRITID = E. ID and C. Sorted between convert (date time, 19/07 / 2014 ', 103) and Convert (date time, from '26 employees to E.ID employee's ID employee Table / P> but it takes about 2 minutes to execute the above query .. I do not index indexing in the candidate Did. How to implement this query a few seconds ..? Based on your description of the problem , The query should look like this: Select Maker_ID, count (CID) Candidate convert from C here (Datetime, 1 9/07/2014 ', 103) and Convert (Datetime, '26 Creator / ID (It believes that candidate.Creator_id and Employees.id Between are a foreign key relationship....

Can I install additional encodings in eclipse? -

I have this issue, I need to use a subversion repository created under windows (and it still In use) is thus the default encoding CP-1252 . Now I want to check this repository in linux and I want to change the files using eclipse. I do not want to reload the whole file by using iconv using UTF-8 , if possible, I do not know how well the programs are under Windows. My first thought was to set up project encoding on cp-1252 There is no option under Annexing for my installation (under the Cappler under Linux) CP- For 125x encoding, only some UTF - * and ISO-8859-1 are selectable. Is there a way to install more encodings in Eclipse? Preferences & gt; On 'Text File Encoding' field; General & gt; The workspace page shows the most common encoding in drop-down only. However you can type other encoding in the field. Any encoding that is supported by Java charset class is accepted. Windows 'CP-125 x' encoding is called 'windows-125x'...

mysql - Searching for data in SQL -

Image
कृपया निम्न तालिका पर एक नज़र डालें: मैं खोज इंजन का निर्माण कर रहा हूं जो card_id मान की खोज के आधार पर देता है श्रेणी_आईड और value_id मान। खोज तंत्र को बेहतर ढंग से समझाओ, कल्पना करें कि हम एक कार ( card_id ) जानकारी की आपूर्ति करके प्रत्येक श्रेणी ( category_id ) में किस भाग ( value_id ) की कार होनी चाहिए। उदाहरण के लिए, हम कार ( card_id ), जहां श्रेणी "ईंधन प्रकार" ( category_id ) का मान "डीजल" ( value_id ) है, और श्रेणी "गियरबॉक्स" ( category_id ) का मान "मैनुअल" ( value_id ) है। मेरी समस्या यह है कि मेरा ज्ञान एक क्वेरी बनाने के लिए पर्याप्त नहीं है, जो कि रिटर्न card_id s जिसमें ca से अधिक एक जोड़ी है Tegory_id और value_id । उदाहरण के लिए, अगर मैं डीजल इंजन के साथ एक कार खोजना चाहता हूं, तो मैं इस तरह एक क्वेरी बना सकता हूं: से चुनें card_id कारों WHERE श्रेणी_id = 1 और value_id = 2 जहां category_id = 1 एक श्रेणी "ईंधन प्रकार" और value_id है = 2 है "डीजल"। मेरा सवाल है, म...

html5 - How to display two fields inline in bootstrap? -

Image
I have a forw in which I need to display two fields with each other: select + input . My code is: & lt; Div role = "form" & gt; & Lt; Div class = "form-group" & gt; & Lt; Input type = "text" class = "form-control" placeholder = "Enter date" id = "map-filter-input-date" & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" id = "map-filter-select-track" & gt; & Lt; Select class = "form-control" class = "display-inline-block" & gt; & Lt; Options & gt; Select date & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "text" class = "form-control" placeholder = "Enter date" & gt; & Lt; / Div & gt; & Lt; Div class = "form-group" id = "map-filter-select-track" & gt; & Lt; Select class = "form-control" & gt; & ...

WPF/XAML: How to make all text upper case in TextBlock? -

I want all the characters to be displayed in the upper-case text-lock & Lt; TextBlockName = "TBABC" fontSize = "12" textElement = "center" text = "channel name" foreground = "{dynamic resource {X: static R: ribbon assinnis. Ribbon group labelEffectClosureBrishKey}}" /> Wires are taken through binding, I do not want to make the string uppercase itself in itself. or use your TextBlock Code> typography. Capitalize = "All Shortcodes" Here View: Edit: It does not work on Windows Phone 8.1 , only in Windows 8.1 ...

c++ - Select function in non blocking sockets -

I am creating an online game client and when I try to connect to an offline server, my The client freezes, so I wanted to use non-blocking socket which is suitable for games because other tasks are required to connect to the server. When using non-blocking sockets, the connect function always returns the same value, regardless of the result, so people can find the result of the connection request here Choose the function is recommended. (Setting block that prevents connection before) u_long iMode = 1; Ioctlsocket (hSocket, FIONBIO, & amp; iMode); (setting up a socket set) FD_ZERO (and write); FD_ZERO (& amp; amp; nbsp;); FD_SET (HSOC, End Script); FD_SET (HSOC, and error); Timewell timeout; Int Timeout = 10; Timeout // Timeout after 10 time. Tv_SC = Timeout SEC; Timeout.tv_usec = 0; Int iResult = Select (0, // unseen tap, // read & (client.Write), // write check & amp; (client.Err), // error checking and timeout); If (iResult) {} other {messag...

ireport - Need help in report's dataset -

I am using iReport Professional 5.1.0 . I have already used a query (a few selected queries) in the report query, but I have to use multiple queries in the same report. So I after making datasets tried with the dataset (Report Inspector - Add & gt; Right Klikdetaset), I've created a separate query but I dataset newly created without any parameters (which have been assigned to the original query column) Can not get on I doubt that the dataset only applies to tables, charts and crossstubs, if not, then explain the step by step process to use the dataset in iReport . The parameter should be in each dataset so that only copy the parameter from the parent dataset, and all the datasets Paste in and when you use any sub dataset for any chart, table or crosstyle, pass all the parameters and expression for that parameter.

Enabling PNG support while installing GD.pm in Perl -

I have already installed GD.pmm. I have to make sure that it supports PNG so to check that I do this: $ perl -e 'use GD; $ Im = gd :: image & gt; New (); Print $ im- & gt; Can ("PNG")? "Yes": "no", "\ n"; 'No' As you see it prints no then I download the latest GD from CPAN with the following process: & gt; Wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.53.tar.gz & gt; Tar xvfz GD-2.53.tar.gz & gt; CD GD-2.44 & gt; Pearl Makefile.PL & gt; Make & gt; Test & gt; Install I hope that there should be a line like this that is the identity of the installed PNG support: Included Features: GD_XPM GD_JPEG GD_Fonconfig GD_FreeTipEPE GDPNG GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33 But instead I have only found it: Included Features: GD_GIF GD_GFANNEME GDOOPNPOLIGODOPOPUL.NG I was not successful with this command either with the Su...