Posts

Showing posts from August, 2013

ef code first - Entity Framework Projection: Materialize Additional List -

Looking at the given (simplified) object model below, give me the schedule object given to the Person , but only load the class es taking that person. I am using a projection and it works fine (excepting the EF profiler, there is a lot of complaining about joining). Now let me person. There is a new requirement to also load fineness . I expected that the comment-out code will be // FunFacts = s.Person.FunFacts, however, it is not. I can accomplish my goal by reaching the schedule.FunFacts while the context is still active. However, it creates an extra round trip to the database. Question : Can I modify my launch to return the idle without any support to the schedule.FunFacts via proxy ? Object Model (Simplified) Public category schedule {Public Entry ID (Receive; Set;} Public Person {Received} ;} Public list & lt; Class & gt; Classes {receive; set;}} Public class class {public id id (get; set;} public int name {get; set;}} public class insurance ...

- Where Developers Learn, Share, & Build Careers

My source code for testing multithat performance in C ++. Please tell me that 5x short time to run a thread Why is WaitForMultipleObject () so first sequential performance. I expect almost the same result for sequential performance and I am just going with one thread. Thanks The OS will decide when your thread should be running and also fixed To do that the dispatch is needed, perhaps. Add to it, this is also to create a separate pile for your thread, maybe read about overhead on thread construction. Everything is overhead system specific,

javascript - xmla4js I keep getting Origin null is not allowed by Access-Control-Allow-Origin ajax header -

I am using the XMLA4JS library. The XmlLA service URL is on the second domain, I get an error message: the original tap is not allowed by the access-control-permission-origin-odd ajax header I have not modified any of their code and I am using their samples. I have entered the URL of the OLAP cube which has been deployed to another server. I passed the User ID and Password in the URL but no luck ... Please suggest how should I connect it? Thank you This is a standard issue when requesting ajax cross domain I Xmla4js The wiki has a page that tells it, and also offers a solution: Another approach that might work is to enable the Corus headers on the server side.

Make git pull (rebase) by default pull only from current downstream branch -

I am using the method found when dragging git: I now use the GIT bridge '- Drag only the existing branch by default: Although this answer does not work when git is configured to rebase by default. Is there any way to regulate the githa and only to pull the current branch? branch.autosetuprebase = always , then it will also add: div class = "post-text" itemprop = "text"> rebase = true you have to do git branch --set-upstream master origin / master After, you can configure the Ribbes attribute of your branch: git config branch.master.rebase false

- Where Developers Learn, Share, & Build Careers

I'm trying to apply the bluepp jQuery file uploader and it's a disappointing time to work in my PHP-based site Used to be . My main problem is with AJAX What do I want to do after uploading, Redirect it (let's say) abc.php . After uploading (earlier redirecting page), I want to save the filename to the MySQL database. I know how to handle the database with PHP, but I do not know how I can not put my PHP code. / P> For the first problem I think that I main.js $ (function () {'strict experiment'; // initialize JQuery File upload widget: $ ('# fileupload') Enable iframe cross-domain access via the Fileupload (); // redirect option: $ ('# fileupload'). Fileupload ('option', 'redirect', Window Location.href.replace (/ \ / [^ \ /] * $ /, '/cors/result.html?%s')) // Load existing files: $ ('# fileupload'). (Function () {var that = this; $ .getJSON (this.action, function) {if (result and amp; result.len...

html - limit how many dynamic form fields are shown and validate as image with javascript -

मेरे पास निम्न jquery सक्षम जावास्क्रिप्ट है: & lt; form & gt; & Lt; इनपुट प्रकार = "फ़ाइल" & gt; & Lt; / प्रपत्र & gt; प्रतिनिधि ('इनपुट [प्रकार = फ़ाइल]', 'परिवर्तन', फ़ंक्शन () {var फार्म = $ (यह) .closest ('form'); फ़ॉर्म संलग्न करें ('& lt; इनपुट प्रकार = "फ़ाइल" & gt;';);});}); यह एक फ़ाइल अपलोड फ़ील्ड को गतिशील रूप से जोड़ देगा क्योंकि उपयोगकर्ता अपलोड करना चाहते हैं, वे फ़ाइलों को जोड़ते हैं। मैं इसे केवल छवियों तक सीमित कैसे कर सकता हूं, और 5 छवियों को जोड़ने के बाद नए फ़ील्ड जोड़ना बंद कर सकता हूं? मैं कई फ़ील्ड से स्विच करने की कोशिश कर रहा हूं, जिसे मैं इस तरह की छवियों के रूप में मान्य करता हूं: var मान्य_एक्सटेंशन = /(.gif|.jpg|.jpeg|.png)$/i; फ़ंक्शन चेकएक्स्टेंशन (एफडीआर) {यदि (वैध_एक्स्टेन्सटेंस्टेस्ट। (एफडब्ल्यू.वल्यू)) सच हो तो; चेतावनी ('केवल जीआईएफ, पीएनजी या जेपीजी प्रारूप की अनुमति है!'); fld.select (); fld.value = ""; fld.focus (); विवरण झूठा है; ...

mysql - Grails or Hibernate not creating missing table -

I am new to Grails, so please forgive my ignorance - if other information is useful, then I get it Do your best to post. I have created a single domain model class ToolKitComponent which is defined: ToolCitComponent {String componentName String componentVersion int componentDownloads date compnentLastUpdate Static constraints = {}} I have an administrator who wants to test ORM by making an example, so here is the content of the controller: Def Index () {ToolKitComponent i = new ToolKitComponent () i.setComponentName ("TestComponent") i.setComponentVersion ("v1.10") i.setComponentDownloads (1) i.setCompnentLastUpdate (new date) i .save ( }} I have installed the MySql database plug-in and updated My DataSource.groovy: data source {pooled = true driverClassName = "Com.mysql.jdbc.Driver" dialect = "org .hibernate.dialect.MySQL5InnoDBDialect "logg IngSql = true} // other settings environment {development {dataSource {String dbCreate...

mapreduce - cannot found "KeyValueInputFormat" in Hadoop -

I'm a newbie for headop, but have read the Yahoo Tutorial on it and have already written some maps, improve jobs. All of my previous works used TextInputFormat but now I have to change it to KeyValueInputFormat. The problem is that KeyValueInputFormat.class can not get wasop in 0.20.2? I am attaching my code below (this is only an example of counting, only input format is changing) package org.myorg; Import java.io.IOException; Import java.util. *; Import org.apache.hadoop.fs.Path; Import org.apache.hadoop.conf *; Import org.apache.hadoop.io *; Import org.apache.hadoop.mapred *; Import org.apache.hadoop.util *; Public class wordcount {The public static class map is expanding MapReduceBase's applicable mapper & lt; LongwayText, Text, Text, Intubiate & gt; {Private Final Static IntWritable A = New IntWritable (1); Private text word = new text (); Public Zero map throws IOException (long-term appropriate key, text value, output calculator & lt; text, intWritable...

java - Preferences in Android - how does it know? -

I'm learning how to set up preferences in the Android application. I have a file race / XML / prefix XML is that there are some different components (?) Things. It is referenced by Prefs.java, which is the addPreferencesFromResource (R.xml.prefs); Uses its onCreate () method in . As I understand, prefs.xml sets the file preferences, and the prefix for this argument. The Java file reaches prefs.xml (which I will then programmatically). Then in my manifest, I have one of the activities & gt; Activity Android: name = ".prefs" android: label = "preferences" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "com.example.lesson1.PREFS" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt; Actually not sure whether the reference is prefs.java or if it is around or what happened. Besides (most deceptive right now)...

asp.net mvc - stymied by attack hampsters trying to unit test a method that returns an action result -

OK - so I started this way, public view recommended index ( ) {See Return (service.GetProjects ()); } And this is my test I [TestMethod] Public Zero index_th_th_a_list_off_activ_prejex () {var view = controller.Index (); Confirm. Erequal (see ViewData.ModelGetType (), Typef (List & Project & gt;)); } All who bend with Dokken but then I added a login and if the user is not authenticated then I redirect them to the login page. Here's what the new method looks like Public Performance Index () {If (Request .asA certified) see return (service.GetProjects ()); Return Redirect Action ("Login", "Account"); } My problem is this - I do not know how to determine the unit test for my life, I can not return any visual result any longer, so I can see the .ViewData.Model property But I can not understand how the redirect is still done while returning to the audience. I was trolling the site and I found this, but that does not really help. If som...

Rails respond_to issue with json -

I am uploading some HTML5 and facing a problem that I can not figure out. Take this function code: If the image.save render: json = & gt; {: Condition = & gt; "Successfully uploaded image!"} And render: json = & gt; {: Condition = & gt; "Something went wrong with your upload!"} End This works and it does exactly what it should do. However, when I respond to the capture of HTML requests, it completely fails (though the HTML part works.) response_to do | Format | If @ image.save format.html {redirect_to (edit_product_path (@ image.product) ,: Notice = & gt; "Your image was successfully added.")} Format.json {Render: Status = & gt; "Successfully uploaded image!"} And format.html {redirect_to (edit_product_path (@ image.product) ,: Warning = & gt; "An error occurred while trying to upload your image. Please try again." }} Format.json {rendere: condition = & gt; "Something went wrong with you...

ruby on rails - Devise with omniauth-google-oauth2 gem -

I am following this tutorial: My configuration is: GemFile: devise.rb: 'devise', '1.5' gem 'omniauth-facebook' gem 'omniauth-google-oauth2' But when I start the server I receive this error: /. Rvm / Gemstones / Ruby-1.9.2-p290 / Gemstones / Active-Support -3.0.12 / lib / active_support / dependencies.rb: 242: `Requirement ': There is no such file to load - omniauth- Google_oauth2 (LoadError) It works with Facebook, but not with Google Oauth2 GEM PS: If I remove the "config.omniauth: google_oauth2" line then the server starts normally. I think that this is something from this line. Any thoughts? Problems updating solution da 1.5 from 1.5.3 to 1.5.3

logout_then_login in Django -

I would like to allow the user to logout and redirect it directly to the login page. In the Django User Authenication page (https://docs.djangoproject.com/en/dev/topics/auth/), logout_then_login (request [, login_url]) logs out the user , Then the URL of the redirect URL on the login page: No default URL provided. Optional argument: login_url: Redirect the URL of the login page to the default settings .LOGIN_URL if not supplied Then the problem is that I click on the page, instead of going to the login page, the page This page has reloaded. My code is below: @login_required def Main (requested): "" "Main view" "path = reverse ('home', kwargs = {' Userpk ': request.user.pk}) HttpResponseRirectirect (path) @login_required def home (request, userpk): "" Home page view "" If int (userpk)! = Request.user.pk: Return Return HttpResponseForbidden (Request, 'lex / main.html', dictionary = {'user': reques...

objective c - Creating an array of objects, from multiple buttons in IB, XCode -

I have to have three sets of 10 buttons for an iOS app. I want to show / hide each set (reveal one set at a time) I am planning to use the tag to do this. Because I have a property for each button (ex: BTN 01, BTN 02, etc.), so I have 30 properties. I add it to an array, and then use the following code to hide the button with one tag or another My question is, instead of setting 30 properties (one for each button) There is a more effective way of creating an array of objects. That's fine, just a surprising way to get a surprise by using a loop to collect every button from the IB. Can not think about it. if (tagState == 1) {tagState = 2; } Else {tagState = 1; } (BRN in Meyer) {NSLog (@ "% @", BTN); If (tagState == 1) {if (btn.tag == 1) {[BTN sethead: yes]; } If (BTnTag == 2) {[BTN set hasaid: NO]; }} And if (tagstate == 2) {if (btn.tag == 1) {[BTN SetHind: No]; } If (BTnTag == 2) {[BTN set hipped: yes]; }}}}}} I think you can use the visual hierarchy here ver...

prolog - Purpose of param in do-loops -

I'm learning to learn Prolog from the "Prolog" book. I am quite a newbie in Prolol. R]), (Foreshem (e, matrix, [i, j]), the ultimate (transpose) subscript (transjees, [j, ii], e)). Play : matrix = [] ([] (11,12), [] (21,22), [] (31,32 )), Moved (matrix, transposed). Results matrix = [] ([] (11, 12), [] (21, 22), [] (31, 32) I do not understand the purpose of param / code>. Please help me understand. Thank you. variable transpose listed param so that it does do / 2 should be available inside the loop. Consider the do / 2 call macros as ECLIPs compiler turns them into assisted predictions. Your Bill transpo Something like: Transfer (matrix, transjections): - dim (matrix, [r, c]), dim (transges, [c, r ]), Do__1 (..., transjees). Do__1 (..., transjees): -!! Do__1 (..., transges): - Forummusic, subscript (transjeges, [j, ii], e), dod_1 ( ..., transges). how do__1 actually looks for the ends of the foreachelem , I do not k...

html - Table height in percentage not working -

I am developing a mobile site and am trying to use very easy markup. Below is my code giving me the problem: & lt; Div class = "abc" & gt; & Lt; Div & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; Table & gt; & Lt; / Table & gt; & Lt; / Div & gt; .abc {alt: 5%;} .abc table (Height: 95%;} The problem works on all the latest phones. But when I checked on Sony Ericsson (500i), the height of the table is from ABC's parent I was checking out this site and gave the body height {100%} but still no success. Please tell me where I am wrong. In addition, when I gave height to the px, he worked for all the handsets but I want to know why the percentage was not working. If you already know the height of the div, then use the dimensions defined in its better px . avoid complexity, if it is not necessary and for some browsers, body {height: 100} %;} The Yapt can not be. html, body {height: 100%; } .abc {heig...

seo - Search Engine Optimization forums mybb vs. vbulletin -

Is there a better ranking on Google for Forum software? For example, if I have the same platform with the same title and name, which would be at a higher position in Google? It is not an opinion question that this is a real fact question. So vBulletin or MyBB? The Vobulletin has a VBSO plugin that is developed and stored by professionals ... There is currently no work plugin SEO in MyBib (Fic)

how can i create custom grid column with radio button in custom module in magento -

I want to create a custom grid column with the radio button in it I have created with the following code, but the problem is, Radio button name is not found, so radio button can be selected multiple times ..... Please help me get the name of the radio button secure Function_prepareColumns () & lt; Br / & gt; {$ This-> addColumn ('pr_id', & lt; br / & gt; array ( 'index' = & gt; 'entity_id', & lt; br / & gt; 'type' = & gt; 'radio', & lt; br / & gt; & lt; br / & gt; Gt; 'name' = & gt; 'pride', & lt; br / & gt; 'width' => gt; 50px '', & lt; br / & gt;)); ........ Please help me $ this- & gt; AddColumn ('pr_id', array ('header' => gt; mga :: helper ('adminhtml') - & gt; __ ('p_id'), 'type' = & gt; radio ',' html_name '= & Gt; 'pride []', 'align...

google cloud messaging - Registering - Unregistering Device from Android GCM -

I am trying to add push notification feature to my application, but I have strange problems. In my first attempt, I found regId for the device; But after that the device is trying to unregister itself from GCM; In fact it succeeded because I was lost regId, but I could not get it again. I look at these rows in logcat. 07-12 08: 40: 25.615: V / GCMRegistrar (10648): Registration receiver 07-12 08:40 40: 25.620: D / GCM registrar (10648): Resetting backoffice for packageddom 07-12 08: 40: 25.635: V / gcm registrar (10648): unregistered application PACKAGENAME 07- ​​12 08: 40: 28.570: D / GCMRigestar (10648): Resizing back-up for packaging 07-12 08:40 40: 28.570: V / GCM Registrar (10648): Unregistered App PACKAGENAME 07-12 08:40: 29.125: D / GCM Registrar (10648): PACKAGENAME 07-12 08:40 40: 29.130: Reset for V / GCM Registrar (10648) Bank backoff: Unregistered app PACKAGENAME 07-12 08:40: 39.655: D / GCM registrar (10648): Resetting backoffice for packageddom 07-12 08:40: 39....

c++ - How to pass a std::shared_ptr to a function? -

संभव डुप्लिकेट: क्या मुझे मूल्य या निरंतर संदर्भ से इसे पारित करना चाहिए? मैंने अंगूठे के कई नियम पढ़ा है कि क्या प्रतिलिपि बनाने योग्य ऑब्जेक्ट को मूल्य या निरंतर संदर्भ से पास करना है। जैसे: निरंतर संदर्भ से ऑब्जेक्ट पास करें और मूल्य के अनुसार प्रकार (फंक्शन ऑब्जेक्ट को छोड़कर) में बनाया जाता है जब तक ऑब्जेक्ट का आकार (डायनामिक मेमरी सहित) वैल्यू पास नहीं होता डबल के 2 * आकार से कम। क्या आप इन नियमों को std :: shared_ptr & lt; संसाधन & gt; पर लागू होते हैं? मैं समझता हूं कि ऑब्जेक्ट शायद बहुत छोटा है, संभवतः एक संकेतक और संदर्भ काउंटर, लेकिन यह अभी भी एक ऑब्जेक्ट है। यहां सबसे अच्छा अभ्यास क्या है? शायद सबसे महत्वपूर्ण चिंता (प्रदर्शन के संबंध में) यह है कि एक std :: shared_ptr & lt; ... & gt; की प्रतिलिपि (जैसे कि जब आप मूल्य से गुजरते हैं) की आवश्यकता होती है तो एक संदर्भ गणना के इंटरलॉक की वृद्धि की आवश्यकता होती है। या हो सकता है कार्यान्वयन के आधार पर एक महत्वपूर्ण खंड की तरह सिंक्रनाइज़ेशन के कुछ अन्य रूप। ऐसी लागत एक बहुस्तरीय कार्...

redirect - asp.net authentication mode="Forms" timeout not working -

For the last 2 days I hit with this problem. Using my MVC project form authentication I am setting the timeout as 1 minute (for testing only), it successfully timed out because the page is not working after one minute but let me know my login The page must be redirected. I have given the login url in form authentication. But this will not work any body please tell me the solution to this problem. The code is as under & lt; Authentication mode = "form" & gt; & Lt; Forms loginUrl = "~ / login / login" path = "/" timeout = "1" security = "all" /> & Lt; / Authentication & gt; The error is received when the code is received Only by this error I came to know that the timeout will be successful, but the redirect is only in one problem. Public Action Personnel () {mod.StateDetails = objentity.ExecuteFunction & lt; GetStateDetails_Result & gt; ("GetStateDetails") ToList () .; & Lt; Object...

sending http request from PLSQL, receiving it by Spring Integration and replying -

I am trying to send http request from PLSQL. It works fine. HttpRequest: = UTL_HTTP.BEGIN_REQUEST (url = & gt; v_http_url, METHOD = & gt; 'POST'); Utl_http.set_header (HttpRequest, 'content-type', 'text / xml; charset = UTF-8'); Utl_http.set_header (HttpRequest, 'content-length', 64); Utl_http.write_line (HttpRequest, 'some string'); Httpresp: = utl_http.get_response (HttpRequest); Utl_http.end_request (HttpRequest); Utl_http.end_response (Httpresp); Spring integration side: & lt; Int: channel id = "input channel" /> & lt; Int: channel id = "output channel" / & gt; & Lt; Int-http: inbound-gateway request-channel = "input channel" answer-channel = "output channel" supported-methods = "post" name = "/ recycle" message-converters = "MyRequestConverter" request-payload-type = " MyRequest "& gt; & Lt; / Integer - http: inner ...

- Where Developers Learn, Share, & Build Careers

I have the following issues: I have found an event listener on the input field. The value of the input field must be valid on every important event. The problem is that the value assigned to Event-Goal is delayed: You have an empty input field and type a letter: $ ('Form.registration') keydown (function (e) {var $ el = $ (e.target); if ($ el.val () == "") {$ el.closest ("div. Control-group "). AddClass (" Error ");} console.log ($ el.val ()); // This log" ""}); You type in the second letter $ ('form.registration'). KeyDown (function (e) {Var $ el = $ (e.target); if ($ el.val () == "") {$ el.closest ("div.control-group"). AddClass ("Error ");} Console.log ($ El.val ()); // it logs the first letter (for example:" a ")}); Div> I recommend that you use keyup instead instead it will stop your program from running intensively when the user presses the k...

How to strip first 3 characters off filename in batch file -

I have some files that I want to strip 3 characters before the file name I thought it would work, But it only outputs: MiSXPRF.Txt ECHO is off ECO is off %% for %%% (% MIS * .tmt) Close @echo (set old name = %% a SET newName =% oldName: ~ 3% echo% Echo% oldName% echo% newName%) pause Note: I am then amending the REN% aa% newName Pragya, but I want to make sure that the name is already correct. You must use a delayed extension to use the variable set in the loop. Try this revised version instead @echo offset Settlelock Enable %% a in (MIS * .tmt) for expansion (old name set Can not have a location in between ==% set newName = set and = old name: ~ 3! Echo! New name!). > In addition, they should be included.

Usage of timesince built in tag in Django Applications -

I want to use the inherent tag of the times to get the number of days since the event. The documentation for the tag is found here: But when I apply it, it gives me data in a few weeks and takes some time in a few hours ... I only happen in days I'd like to ... I'm not sure how to change the filters to get the day ... Some guidance is needed ... thanks .. You can write very simple: import datetime @ register.filter (name = 'days_since ') Def days_since (value): since = 0 try: since = (Datetime.datetime.now () - value) except for .days: since pass pass ... {{obj.date | Days_since}}

- Where Developers Learn, Share, & Build Careers

Image
इस सवाल का पहले से ही एक उत्तर है: 5 जवाब एक बार फिर से आप उम्मीद कर सकते थे मेरी मदद करो। मैं सीएसएस पर एक नौसिखिया हूँ और कुछ सरल बनाने की कोशिश कर रहा हूं, लेकिन यह भी आसान है कि वास्तव में मुश्किल हो। (।) इस समस्या के लिए अब एक घंटे की तरह। > किसी भी तरह से मेरे पास अभी समस्या यह है कि मेरे पास एक ऐसी डिवीज़ है जिसमें एक इमेज है, लेकिन डिवेल में नीचे 5px स्पेस की तरह अतिरिक्त है जो मुझे पता नहीं लगा सकता कि कैसे निकालना है। मूलतः यह है कि मेरे पास क्या है जैसा कि आप देख सकते हैं कि छवि के नीचे थोड़ा "सफेद" स्थान है। यह वही है जो मैं चाहता हूँ (रंग का उपयोग करके संपादित) मूल रूप से मेरे पास शरीर के लिए एक ग्रे पृष्ठभूमि है, 70% की चौड़ाई वाली आवरण के साथ, आवरण के अंदर एक मेनू है (छोटी लाल चीज़ उस मेनू का हिस्सा है), फिर वहाँ एक div (आईडी = कंटेनर) है जो पृष्ठभूमि की पृष्ठभूमि है, चौड़ाई 142.8571% है, और बायीं 15% है, ताकि यह पूरे पृष्ठ को कवर कर सके। एचटीएमएल के लिए यह मेरा कोड है : & lt; div id = "कंटेनर" & gt; ...

coldfusion - cflock issue with Fusebox 4 application -

I have received a cf application that currently runs on fusebox 4. I'm thinking a lot about the time limit of application within the CF Administrator, and I'm not 100% locking and where seaflocks should be used. & lt; Cflock scope = "application" type = "unique" timeout = "30" & gt; & Lt; Cfinclude template = "fusebox4.runtime.cfmx.cfm" & gt; & Lt; / Cflock & gt; I can now see a CFLL around the main fusebox file. My instinct is telling me that this is not really a good practice. Can someone suggest that this is incorrect for the fusebox app? I'm sure there is nothing in it Lock Fusebox.runtime.cfmx.cfm Full App You need to check when you lock the entire "application scope" for each request, then you are affecting single-threading for that file. In other words, 2 requests can not run this file at the same time. Since it is a normal file for outline, so it greatly influences your scalab...

java - Getting values in Multimaps - Guava -

मैं गवा पुस्तकालय का उपयोग करता हूं। क्या प्रत्येक मान में बहु आयाप प्राप्त करने का कोई तरीका है? उदाहरण के लिए, मान 1 = [स्टैक], 2 = [ओवर, प्रवाह], 3 = [कॉम] मल्टीमैप में। यदि मल्टीमैप का नाम मैप है और कुंजी 2 है, तो map.get ("2") प्रकट होगा [ओवर, प्रवाह]। मुझे केवल "प्रवाह" प्राप्त करना है क्या यह सही है? एक multimap एक संग्रह देता है, यह लगता है कि आपको उस सूची में अंतिम आइटम की आवश्यकता है, उस स्थिति में आपको map.get ("2") पर कॉल करके सूची में अंतिम / एन-वें आइटम को पुनः प्राप्त करना होगा । अमरूद का एक वर्ग है जिसे Iterables नाम दिया गया है जो आपके लिए उपयोगी साबित हो सकता है। उदाहरण के लिए स्ट्रिंग अंतिम वैल्यू = Iterables.getLast (your_list);

c# - Xml serialization Exception : The type UserQuery+SpecificContentItem was not expected. Use the XmlInclude or SoapInclude -

I have a problem on class serializing to XML I have created a sample code that shows an error. The class, which I want to serialize "content container", is a collection of items in the content container, which is the type "ContentItemBase". Because I have implemented these classes according to my needs. But when the code reaches the part of the actual serial call, the serializer throws this exception: Type User Time + XmlInclude to specify those types of specific content items were not expected Or use the SoapInclude attribute that are not known statically. I have searched this problem but I can not apply the XmlInclude method described in the exception message. Is there a solution (design or implementation strategy) for this problem and similar problems? code: zero main () {var items = new specific content {name = "test", value = "test value", specific field = "testfield"} ; Var Container = New Content Container (); Cont...

- Where Developers Learn, Share, & Build Careers

I am using data transfer objects in the food, such as public class accountDEM {Private string username; Private string userAuthToken; Personal Ind users_id; Public Zero SatusName (string _username) {this.userName = _userName; } Public string getuserName () {return user name; } ...} How can I use the same in Objective-C? Probably "the purpose of the objective C" will serve the purpose I think. But some people can tell it in detail, how to use the Objective-C property to write the DTO and how to use them effectively and to keep memory safe (to avoid memory leaks). If possible, please code above OBJ C. @interface accountDEM @property (nonatomic, retain) NSString * Username; @property (nontomic, write) NSString * userAuthToken; @property (nanatomic) int user_id; @end @implementaion @ synthesis user name; @ Userstom; Synthesize; @ Synthesis user_ID; You can read for properties @end

How to Use DTO's in Objective C -

I am using data transfer objects in the food, such as public class accountDEM {Private string username; Private string userAuthToken; Personal Ind users_id; Public Zero SatusName (string _username) {this.userName = _userName; } Public string getuserName () {return user name; } ...} How can I use the same in Objective-C? Probably "the purpose of the objective C" will serve the purpose I think. But some people can tell it in detail, how to use the Objective-C property to write the DTO and how to use them effectively and to keep memory safe (to avoid memory leaks). If possible, please code above OBJ C. @interface accountDEM @property (nonatomic, retain) NSString * Username; @property (nontomic, write) NSString * userAuthToken; @property (nanatomic) int user_id; @end @implementaion @ synthesis user name; @ Userstom; Synthesize; @ Synthesis user_ID; You can read for properties @end

Importing CSV data using PHP/MySQL -

I am having some problem trying to import data from CSV and there are some questions about it that I have yet to You have not succeeded in solving. To help keep things in perspective, first here is my code (to delete it a little, count cd and db connection): & lt; Body & gt; & Lt; Div id = "container" & gt; & Lt; Div id = "form" & gt; & Lt ;? Php $ deleterecords = "Trunket Table Tabelmem"; // Your current record mysql_query ($ deleterecords) table blank; // upload file if (isset ($ _ POST ['submit']) {if_uploaded_file ($ _ files ['filename'] ['tmp_name'])) {echo "& lt; h1 & gt;" . "File" $ _FILES ['filename'] ['name']. "Successfully uploaded." . "& Lt; / h1>"; Echo "& lt; h2 & gt; Content displayed: "; Readfile ($ _ files ['file name'] ['tmp_name']); } // database to upload import file $ handl...

Can this java snippet be re-written? -

Can anyone suggest that the following java snippet has to be rewritten and if so, why it would be unfair, thanks ! Try {int i = 0; While (true) a [i ++] Func (); } Hold (ArrayIndexOutOfBoundsException E) {} Use a loop: Or alternatively, a simple for loop: for (int i = 0; i & lt; a.length; i + +) {A [i] .func (); } As a result the bytecodes are more or less similar, but I look for each loop more elegant. Your code is inappropriate, because it: Uses an exception for flow control Uses some time (true) loop (just like in some other way) Do not use it)

javascript - Tooltips undefined in ie8 -

I have the following tooltip examples, it works fine in Chrome and Firefox - but in I7 and I8 this is unsure Coming back Make sure what went wrong for IE. Use multiple bind methods instead of pure events; Your problem appears; When the mouse has to object twice or more, but when the bind method is used, there will be no undefined return on Internet Explorer. Check this jsfiddle:

c++ - boost::python export custom exception and inherit from Python's Exception -

Indicates how to export a custom exception class from C ++, and how the exception class is exported How can I do the exception of Python? It exposes an exception class that has custom methods for receiving the information and that category has been obtained with the exception of Python. A practical solution, rather than receiving from the wrapped C ++ recommended by Jim Bosch, of the structure To use The code should be made to be a python exception as is done, and then add a C ++ exception wrapped as an example variable of the Python exception. Zero Translator (const MyCPPException & x) {BP :: Object AX (X); // C + Exception: BP :: Object exc_t Wrap (BP :: Handle : (BP :: Credit (exception type)); Exc_t.attr ("cause") = exc; // Python exception add wrapped exceptions PyErr_SetString (exceptionType, x.what ()); } Wrapped C ++ exception can be accessed from Python in such a way: Try: MyModule.MyCPPExceptionType e: Reason = E But the exception here will ...

c++ - Qt program deploy -

I just wrote a QT program, and made it under release type, it works fine in QT creator , But if I double click the X in Windows, it says that it can not find anything in QTcore 4 DLL, so that Qtcore 4.dll should actually add me to its folder? I am using Qt 4.7.3 What is BTW because I have installed Tortoise HG? And it messed up with the Environmental Wars. But I have copied QtCore4.dll from my QtSDK folder. And it still does not work. You need QT and Mingav DLL used in the same folder. Need to package together.

Block selection comment for VbScript in Visual Web Developer 2010 Express -

How can I comment on a selected block in VBScript using Visual Web Developer 2010 Express? Updated: I meant to select a block and comment on every line. If I do this in Visual Studio Web developer 2010, then comment is made for html, not for vbscript Use ' & lt; Script type = "text / vbscript" & gt; Slow myMessage 'myMessage = "I'm having a great day!" MyMessage = "I can use a nap ..." This will print my message to the visitor's document. Writing (mamsage) & lt; / Script & gt;

facebook - Graph API returns empty data set for App Insight Data -

I try to get app insights like post impressions, clicks, etc. from your FB App Insight using Graph API and FQL I am not getting any data, but there is an empty data table in this response. Any sign on this? In addition to this, what would be the FQL to get the number of impressions for any story by the app. Then your page insights data may appear after one day.

c# - I want show text in textbox continually -

के लिए (int a = 0; a & lt; 10; a ++) {txtblck = txtblk + a.ToString (); } इसमें, txtbox आखिर में सभी पाठ दिखाता है मैं टेक्स्ट एक-एक करके दिखाना चाहता हूं। आप यह कोशिश कर सकते हैं के लिए (int a = 0; a & lt; 10; a ++) {txtblck.Text = txtblck.Text + a.ToString (); Application.DoEvents (); System.Threading.Thread.Sleep (1000); }

- Where Developers Learn, Share, & Build Careers

I have successfully installed my Windows Azure Web role, but ideally I want to lock access so that it only Is not it safe to be protected by password? For example, restrict RDP access to specific IP ranges, require client certificates, etc. I know that you are advised not to enable remote desktop at all times but to enable it to troubleshoot. But if this security is enabled to troubleshoot the problem then it still remains (also annoying that till I can not remember anything, I will not enable / disable RDP access without re-publication. can). Thanks Edit on November 2013: You can use ACL to lock specific port categories for RDP using PowerShell. The new Ezoor Portal allows you to access the inside of the portal It allows you to do it with your PowerShell: You can use the OS software window You can use a firewall Go to another port instead of the default 3389. In the endpoint management portal, you can create an internal port 3389 internal port (i.e., 2400) point...

php - Creating a Stripe Summary Report -

I recently changed the payment process to the stripe. I now need to make a report for our finance department Which shows a rollup of transactions within the specified date range. I have started using a simple PHP web page (and strip PPP library) which will summarize the following: Calculation of transactions Transaction amount Refund number Fee Fee Net I have a problem How to properly teach the fee with the strip for my reporting purposes I know that I can get a fee with it: $ charges = Stripe_Charge :: all (); By returning the fee, I can calculate the summary information that I need in the report. However, it will only return more than 100 charges to me, and I do not know how to return the fee within a specified date range. I hope more experienced bandage developers can point me out How can I return all the fees within a specified date range? Is there a better way to get this summary information from the strip When you have a charge. Protect...

javascript - Strange padding issue -

Image
कृपया देखें मैं क्या हासिल करना चाहता हूं "Https://i.stack.imgur.com/ZlzU9.png" alt = "यहां छवि विवरण दर्ज करें"> और दस्तावेज़ ऊंचाई के आधार पर div ऊंचाई को गतिशील रूप से बदलकर निम्नलिखित jq फ़ंक्शन का उपयोग करना $ (विंडो) .लोड (फ़ंक्शन () {$ ('। SideBg')। सीएसएस ({'ऊंचाई': ($ (दस्तावेज़) .height ())})}}; मुझे क्या याद आ रहा है? क्या यह नहीं होगा अगर आपने पृष्ठभूमि पर body का इस्तेमाल किया है तो बेहतर होगा? इस तरह, आपको अतिरिक्त तत्व या जावास्क्रिप्ट की ज़रूरत नहीं है। body {background: url (http://vefaestetik.az/design/img/bg/side_bg.png), यूआरएल (http://vefaestetik.az/design/img/bg/side_bg.png) 100% 0, काला रेडियल-ग्रेडिएंट (केंद्र पर अंडाकार, # 45484 डी 0%, काली 100%); पृष्ठभूमि-दोहराएँ: दोहराएँ- y; } पृष्ठभूमि का उपयोग करना मत भूलें: काले यूआरएल (/design/img/bg/000.png); पादलेख के लिए। और यह मत भूलो कि आपको प्रीफ़िक्स्ड वर्शन भी होना चाहिए पृष्ठभूमि: url (http://vefaestetik.az/design/img/bg/side_bg.p...

java - How to check entered String in a loop with condition? -

I want to write a program that gives the user a string of four boundaries (for example 10 characters Checks)). If the entry in the string is more than 10 characters, then the user should re-sign again until the user enters a valid string (one word of 10 characters) until the user enters a valid string. I already have some piece of code for it but it does not work yet, because I do not know how to prompt the user again or other easy way to start How to start the process? System.out.print ("Input:"); String inputts = input Screenplay (); While (inputChars.length ()> 10) {System.out.print ("Input:"); String inputts = input Screenplay (); // Here is a mistake now} System.out.print ("Output:"); System.out.print ("10 characters in login"); I'm more than just 10 words, then check the entered word, then leave it and prompt the user to enter a word again which is more than 10 Not a character. I am not good in Java yet, so if this questio...

Git commit with invalid character on Windows -

I have got a gig stock that I accidentally submitted a file 4 before that (which is located in the repository root folder ): / Core / c: / testoutput / guacu1 Xml I did this on my Linux machine, so the actual file was created without any problem. This thing happens when I go back to my Windows machine, I can not go to the branch that is in this file because Windows refuses to create such a folder. Okay, there is no problem, I deleted the file at my Linux end and committed it, but it's also not difficult that it is not working. Git still tries to make this illegal file on my Windows machine, and I do not know what to do. I know that I can remake the repo from scratch, but then I was completely lost in the history, and I wanted to avoid that. What are my options here? You do not need to check that branch to update this. The work that works from a branch: . is for.

Change text dynamically for Android Actionbar Button -

I have an action bar (using actionbarslocks) in which it has two items, among which one user collected in my app The number of points is the number. I want to change this action bar button when the quantity change changes. I do not know how to set the text of that button. What can I do to set this code through? First you do not set "TextView One Button", because the button increases textview, The text itself is set up, you can try it in the following way at onCreate () : // of your activity. I think you create custom actionbase of this last choice: addView = getActivity (see) .getLayoutInflater (). Flow (R. layout.my_action_bar, tap); Bar.setCustomView (addView); Button = (button) addView.findViewById (R.id.button); Button.setText ("whatever"); If you use the menu item, then you should try this approach: getSupportMenuInflater (). Flood (R. menu activation menu, menu); Menu item item = menu.findItem (R.id.menuSearch); Also try this, and It sh...

Linked Class in C++? -

As everyone knows: to create a program dynamic, create link lists with C / C ++ Is possible. But now, I am programming a "linked class" in C ++. My parents "games" should have a variable number of elements. And each element is a class. So I have programmed it: class games: public level {private: ELEMENT * startPointer; Public: Games () {startPointer = NULL; } InitGame () {p = aStartPointer; While (p! = Null); // This loop is based on a linked list, so its dynamic {startPointer = new ELEMENT (startPointer); P = p-> Next; }}} Class Element {Private: ELEMENT * Next; Public: element (ELEMENT * next indicator) {next = nextPointer; }} My problem: I have never heard of a link class before, and I'm not sure I should use it. Professional programmers use such methods (and is it useful?), Or are there better ways to do this? Are there better ways to do this? Yes there is one: class games: public level {personal: std :: vector & lt; ELEMENT ...

Database schema design for financial forecasting -

I need to develop a web app that allows companies to predict financially. The app has various screens, the second to define an employee's salary, for sales projection etc. Originally an app has to turn on the financial forecast model. The question is, what would be the best way to design a database, so that financial reports (eg a profit and loss statement or balance sheet) could be generated quickly? For a prediction period of 5 years, suppose you have a table with 5 years * 12 months = 60 fields in each row? Is this sufficiently demonstrative? Do you trigger the DB, whenever any employee data changes, will the recalculation of salary expenditure be made? I thought storing forecasts of each month in that table on my own line Better it looks like this Month forecast - --- -------- 30000 2 31000 3 28000 ... ... 60 52000 Then you can use the total work to calculate estimated reports, discounted cash flows etc. (Like you just want to leave the United Nations for...

php - Yii counter query in findall -

मेरे पास निम्न क्वेरी है UserLogin :: model () - & gt; साथ (सरणी ('प्रदाता' = & gt; सरणी ('चुनें' = & gt; 'नाम'))) - & gt; खोज (सभी (सरणी ('चुनें' = & gt; 'गिनती के रूप में गणना (t.id)', 'समूह' = & gt; 'provider_id', 'order' = & gt; 'provider_id')); और मेरा दृश्य & lt;? Php foreach ($ प्रदाता के रूप में $ प्रदाता काउंट होता है):? & Gt; & LT; टीआर & gt; & Lt; td & gt; & lt;? Php प्रतिध्वनि $ प्रदाताकाउंट ['प्रदाता'] ['नाम']; ? & Gt; & lt; / टीडी & gt; & Lt; td & gt; & lt;? Php प्रतिध्वनि $ प्रदाताकाउंट ['गिनती']; ? & Gt; & lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt;? Php endforeach; ? & Gt; यहाँ संबंध है 'प्रदाता' = & gt; सरणी (स्वयं :: BELONGS_TO, 'प्रदाता', 'प्रदाता_आईडी'), मुझे त्रुटि मिल रही है संपत्ति "UserLogin.counts" प...

- Where Developers Learn, Share, & Build Careers

I have a little problem, maybe you can help me I'm trying to get "currency features" from freebase I am So I tried to do this: "/ base / schemastaging / person_extra / net_worth": zero, but, I can not get the value written on the freebase (for example, with Madonna, it's 650 million) Do you know why this is not working? First of all, as the property path shows, / base / Schemastaging / person_extra / net_worth right now Now being staged so that the final property ID is something else (follow the discussion on the new schema) you should not use this property for anything other than the experiment. The reason is that you do not see that data to ask the following questions, because this property is one {/ id}: "/ en / madonna", "type": " CVT values ​​are complex objects that need to be expanded to reach the desired values. In this case, Net_worth is a CVT / base / schemastaging / person_extra "," net_worth ": ...

php - syntax highlighter doesn't work after call back -

So I'm new to JS & amp; Php and I am trying to print a piece of code from a call back function & Lt; H2 & gt; ..... & lt; / H2 & gt; & Lt; Button onclick = "loadXMLDoc ();" & Gt; Get data & lt; / Button & gt; & Lt; Div id = "mydiv" & gt; & Lt; H2 & gt; ... & lt; / H2 & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; and like my php file & lt; Php $ ch = curl_init (); $ Url = 'someurl'; $ Timeout = 5; Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ CH, CURLOPT_CONNECTTIMEOUT, $ timeout); $ Data = curl_xac ($ ch); Curl_close ($ ch); Echo "& lt; script type = 'text / javascript' src = 'SyntaxHighlighter / scripts / shCore.js' & gt; & lt; / script & gt; & lt; script type =' text / javascript 'src =' SyntaxHighlighter / Scripts / shBrushJava....

pinvoke - DllImport and return parameters -

I'm working on hardware testing. Our test framework has been written in C # The country is using DLL. We have a C ++ method: unsigned characters some method (unsigned long * root status) which executes an embedded command and returns the status when the order is completed. We use the cover [DllImport (@ "native.dll", Charset = Charset.exe, Calling Communication = Calling Communication. CDCL] Internal Static Extern Byte SomeMethod (Riff UInt32 Managed Stats) This works fine but there is a scenario when someMethod is actually a call Does not execute the command, but it adds to a sequence, then execute a particular command, by pressing ExecuteSequence Could. As the sequence is being executed, C ++ code updates the native status , simply copying the data to the memory referenced by the native status pointer. As the sequence completes the ExecuteSequence method returns, at the moment I believe all data (in this case, the nativeStatus ) has been up...

Can't connect to SQL Server database in asp.net -

I am using configurationmanager.appsetting and I'm getting an error in Cn.Open line The web form code is as follows: Public partial category admin_CheckDocuments: System.Web.UI.Page {SqlConnection cn = New SqlConnection (Configuration Manager. AppSettings ["con" ]); String sql; String str; Secure Zero Page_load (Object Sender, EventEurge E) {cn.Open (); Str = Request.QueryString ["taxid"]; If (! IsPostBack) {filldata (); }} web.config : & Lt; / AppSettings & gt; error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the example name is correct and SQL Server is configured to allow remote connection. (Provider: SQL Network Interface, Error: 26 - Error specifying server / instance) Due to throwing this problem wrong server name, disabled remote connection and firewall may be blocked. Can you follow the steps g...

Bash script: Gzip an entire folder and keep files extensions same -

I want to continuously sort every file in a file and want to keep the original names and extensions after the compression. I tried to sudo gzip-9 -r folder , but now the .gz extension is added to the original in every file, such as 2852b65c1d8b. Css.gz and when I want to place the name as 2852b65c1d8b.css for the gzipped file to upload to Amazon S3. Use what you want to do: Find folder - Type f -exec gzip-9 {} \; -XAC MV {} .gz {} \; First order the files, change the second name.

ruby on rails - Issues with jQuery UI autocomplete when form added with Javascript -

I can not seem to complete the work with the form that I'm adding to the screen with javascript . For example, I'm using my new route to present my object form in my new Rail file I have the following within Js.erb: $ ("div # container"). Hide (). Html ("& lt;% = escape_javascript render 'form' & gt% ;.); fadein (); Once sung, if I type in my input element: And listen with javascript: jQuery -> As a completely related question, I can not get anything. ('Input # ItemName'). Autocomplete source: ['Test', 'Testing', 'Test 234'] If I copy and paste this form and place it on the screen on load (and my Do not connect dynamically with the new railway route) then it will work fine. How can I get myself to listen to things dynamically added? This will automatically show your complete script with your #object_name form element First being added - if you make sure that you have added #object_n...

javascript - Can I get the current state of a twitter bootstrap popover? -

I currently call a script to dynamically add content to my popover, but I need to call it Not when a user clicks and then to turn it off This is what I have done so far: $ ('. Known'). (Click on 'function'), {var info = $ (this) .attr ('id'). Substr (5) .split (':'); var el = $ (this); // How do I see ? If popovar looks / can I just close it and get out? $ .post ('functions / get_known_issues.php? Tcid =' + info [0] + '& amp; tcdate =' + info [ 1], function data) {if (data.st) {el.attr ('data-content', data tissue); el.popover ('toggle');}}, "json");}); if ($ ('. Popover'). ')) { // popover is visible} other {// popovers are not visible}

How to define method chaining in PHP -

संभव डुप्लिकेट: मैं संयुक्त कार्यों का उपयोग करना चाहता हूं, जैसे: चुनें ("उपयोगकर्ताओं से चुनें")। जहां ("उपयोगकर्ता = l0") .जोड़ें ("।"); यह कैसे php में परिभाषित है? फ़ंक्शन का चयन करें () {.... नई myType पर लौटें; } वर्ग myType {function where () {... $ $ लौटाता है; } फ़ंक्शन शामिल () {... $ $ लौटाता है; }} डेमो: - & gt; के बजाय । PHP में उपयोग करना याद रखें। यह PHP फ़ंक्शन चेनिंग का एक उदाहरण है।

.htaccess - Htaccess and restfull app -

I'm not very good at htaccess, so here's some help looking for help. I have a web app running on myserver.com/index.html and I'm sending the request ( GET , PUT, delete an administrator ): myserver.com/controller.php?id=5 is there a way I can use myserver.com/controller/5 I have toyed with my htaccess , but like Manage to create 500 errors while attempting to hit the index.html page to deposit via a url ... If you send a request: myserver.com/controller/5 and you want to rewrite it at /controller.php?id=5 , you can use these rules: RewriteEngine RewriteCond% {REQUEST_FILENAME}! -f Rewrite Convert% {REQUEST_FILENAME}! -d Records Rules ^ /? ([^ /] +) / ([^ /] +) $ / $ 1.php? Id = $ 2 [L] Or less common: Reviving OnReitRound% {REQUEST_FILENAME}! -f rewrite %% {REQUE ST_FILENAME}! -d Records Rules ^ /? Controller / ([^ /] +) $ /controller.php?id=$1 [L]

- Where Developers Learn, Share, & Build Careers

Image
I am running Eclipse 4.2.1 on Ubuntu 12.10 and I'm busy setting up an Android plug-in for Eclipse. So far everything has gone well, I have installed the ADT plugin and it is all but now I am at that stage (after the eclipse restart) I have to point out Eclipse in that directory which I did to Android SDK Installed ... SDK is being installed here: / opt / android-sdk-linux But I get the following error message pops up: I got the answer, the issue was that I was running 64 bit system (should have said that ). You can find the solution here:

- Where Developers Learn, Share, & Build Careers

I have found a very complex query that connects eight (8) different tables. For this question, however, I simplify it with this type of structure: table table 1 (packet id int, activity int, mpid int , Partno Worker (20)) Insert values ​​in Table 1 (1, 1, 132, 'ABC 123'), (1, 2, 132, 'ABCSERA'), (1, 3, 132, 'def 123'), ( 1, 4, 132, 'Diff 94'), (2, 5, 228, 'xyz123'), (3, 6, 239, 'xyz321'), (3, 7, 239, 'AAAA 000') This type of table creates the following output: | _P_P | _R_ | _Emp_ | _PartNo_ | | _1_ | _1_ | _132_ | _abc123_ | | _1_ | _2_ | _132_ | _abc465_ | | _1_ | _3_ | _132_ | _def123_ | | _1_ | _4_ | _132_ | _def456_ | | _2_ | _5_ | _228_ | _xyz123_ | | _3_ | _6_ | _239_ | _xyz321_ | | _3_ | _7_ | _239_ | _aaa000_ | I put a bela here: I was told that they do not really need PacketID or RequestID , but whatever they need is something that shows how many requests are in the packet and which number of that ...