Posts

Showing posts from September, 2014

Meteor: how to search for only distinct field values aka a collection.distinct("fieldname") similar to Mongo's -

I am using meteor, and I am trying to find only different (unique) values ​​of a field . Mongodb has a command archive ("Field name"); but it is not applicable to Mongo for Meteor drivers I tried to use the meteor-mongo-extensions package but client-side Collection.distinct ("fieldname") For the client console still has "undefined"; What, essentially, is looking a specific? I think this is such a basic question - for example, a list of students with their teachers as a field, and then the list of students is done by teachers outside of it, For example ... If I can wrap my lazy delusional brain around the general concept, then maybe I can do some success. You only underscore. You can use JS, which comes with meteorite - the recommended use case should be OK. If you try this on a large data set or run it frequently, you can participate in performance issues, but it should be enough to use common-or-garden: var distinctEntries = _.un...

arrays - How to use explode and get first element in one line in PHP? -

$ first dot = explosion (".", $ String) [0]; This is what I am trying to do, except that this syntax gives error if there is a workaround for a liner, please let me know if this is not possible , Please explain. It was implemented in PHP 5.4, so if you are using an older version, Will have to do in another way. An easy way to do this is: $ beforeDot = array_shift (explosion ('.', $ String));

excel - Use VBA Macro to print conditionally -

Thanks in advance for your help I have the following macro function: sub macro 1 () If the cell (3, 4) & gt; 0 Then Sheets ("A-Lawn"). Select ActiveWindow. Selected Sheets.PrintsTop Copies: = 1, Collated: = True End Ending What I have to do is a condition where the amount in column 4 is more than $ 0 Their individual Excel sheet prints. Below is the column header and my first seller information. Name of the contractor sheet PPW Advance Allen Bee Abelcher $ 7,947.60 $ 500.00 So, if column 4 & gt; 0, then print the letters listed in column 2. I am very new to this and appreciate whatever support you can provide. Assume that you have a list of sheet names in the rows, look at the following lines, and use the required sheet. Print: sub macro 1 () retarded as long lLRRROW long I integer lLastRow = Cells.Find (what: = "*", later: = range ("A 1 "), search order: = xlbir, search direction: = xl preverses). For rob I = 2 for llestro if...

Is there a function in c that returns the index of a string in another string? -

मेरे पास 2 वर्ण एरे हैं चार पृष्ठ = [4] [5] = { {'ए', 'बी', '', 'डी', 'ई'}, {'ए', '', 'सी', 'डी', 'ई'}, {'ए', 'बी' , 'सी', 'डी', 'ई'}, {'ए', 'बी', 'सी', 'डी', 'ई'}}; चार शब्द [5] = "सीडीई"; मैं पेज में शब्द "सीडीई" के सूचकांक ढूंढने की कोशिश कर रहा हूं, अर्थात् 7 और 17. क्या इस के लिए सी में कोई फ़ंक्शन है? या एक छोटा रास्ता कुछ ऐसा, int indexlist [] = खोज इंडेक्स (शब्द, पृष्ठ); आप निम्न प्रयास कर सकते हैं: # शामिल करें & lt; stdio.h & gt; #include & lt; string.h & gt; {'ए', 'बी', '', 'डी', 'ई'}, {'ए', '', 'सी', ' डी ',' ई '}, {' ए ',' बी ',' सी ',' डी ',' ई '}, {' ए ',' बी ',' सी ',' डी ',' ई ' }}; चार शब्द [5] ...

optimization - Alternate JavaScript compression approach in r.js build -

I'm using r.js to create a production script for the requirement of JS application and I'm looking for a way I'm either using an alternative compression library or change the default used I have to remove the empty space, but to be similar to variable names. I have a special requirement for maintaining variable names because they are and they have not been changed. Continuous variable names offer a little 'code odor' but it makes the configuration file of the application stronger against non-expert editors - so please try to avoid suggesting a design change here. I currently have .js configured to not customize JavaScript at all, which means that there is not only the variable name but also the white space. The piece related to Gruntfile.js is given below. Does anybody suggest that a RJS to be able to wait whitspace? Can not change variable name in build? English: {baseUrl: "js", mainConfigFile: "js / app-en.js", name: "app-n...

pass by reference - Ruby passing arguments: difference between Array and Set -

I am trying to put an array in another existing array and with it all its contents in the current set has put. Here's the least example: To add the requirement of "set" (myarr, bigarr, myset) bigarr & lt; & Lt; Myarr myset | = Set.new (myarr) end bigarr = [] myset = add.new ([1, 2], bigarr, myset) Which yields bigarr = [1 , 2] .. OK, but myset = {} is empty .. I know that there is something to know about passing the arguments in Ruby (value should be value) ) - In the case of the array, the value should be the reference of its contents, then I have no indication what the value of the set can be. The questions are: What is the array and set which is the car of this behavior There is more difference between the tax liability Is there any way to compel the Ruby pass-by-context or is there a different recommendation in the way with which to solve the problem? Thanks in advance! This is nothing to do with the difference between arrays ...

c++ - Setting memory on a custom heap -

Is it possible to take a Happ handle from Haptet () and set all the available memory for a certain value? I have tried to calculate the heap from the area and have tried to set it in this way, but I get access violation. I basically want to set the memory in a custom value which I can use for debugging it, before finally being destroyed through the podistore. The short answer is "No, you can not fill the heap with a specific value" You can wrap your HAP Access function with debug versions, for example // #define HeapAlloc (a, b, c) MyHeapAlloc (a, B) in some header files , C, __FILE__, __LINE__) #HapFree (a, b, c) MyHeapFree (a, b, c, __FILE__, __LINE__) ... in a separate source file: #ifdef HeapAlloc #undef HeapAlloc #undef HeapFree #endif stru Extra {Extra * Next; Size_t size; Const char * file; Int line; }; Extra * head; LPVOD MyHeapOloc (Handle Hep, Dedworld Flags, SIZE_T Size, Const Four * File, Intline) {LPVOID Ridge = HeapAlok (Stack, Flags, Size + Si...

php - Finding list of all duplicates based on calculated value -

Using MySQL, I am trying to get a list of teams that are from Bangladesh (win Same number) A list of all the teams in the given list. To calculate the victory for each team, I am using a SUM function while grouping the team. So far I have created this query: SELECT results.DATE, results.team1, SUM (results.win) as WINS, SUM (results.lose ) AS Damage, SUM (results.pt_diff) AS PT_DIFF, event_team.div_sname, event_team.pool_name results, from event_tem, matches WHERE result. Ticket 1 = event_team.team_id and results.sched_id = matches.sched_id and match.match_type = 'pool' and event_team .div_sname = 'C4A' and event_team.pool_name = 'Pool_C4A_1' and event_team.event_id = 25 group results.team1 ORDER Event_team.pool_name, DESC wins, ASC losses, PT_DIFF DESC This gives a complete list of query teams and their DATE team won 1 Loss PT_DIFF div_sname pool_name ---------- ------ ------ - ----- ------- --------- - ---------- 2014-09-06 54 9 3 28C4A Pool C4,...

Getting urls without hashes in Ember.js on Github Pages -

मैं अपने url (www.example.com/#/projects/id - & gt) में बदसूरत हैश टैग से छुटकारा पा रहा था। ; Www.example.com/projects/id) इसलिए मैंने जोड़ा राउटर.रेोपन ({स्थान: 'इतिहास'}); अगर मैं अपना ऐप जड़ www.example.com पर खोलता हूं तो यह काम करता है, और लिंक पर क्लिक करने के लिए मैं www.example.com/projects पर जा सकते हैं और इसी तरह। हालांकि, अगर मैंने अपने url पट्टी में www.example.com/projects डाल दिया है और इस तरह से पृष्ठ को लोड किया है, तो हमें एक 404 त्रुटि मिलती है यह मेरे लिए समझ में आता है कि ऐसा क्यों होगा (आखिरकार, सर्वर केवल एक यूआरएल पर जावास्क्रिप्ट आस्तियों की सेवा कर रहा है) मैं अपनी साइट के लिए गिथूब पृष्ठों का उपयोग कर रहा हूं, मुझे यह काम करने के लिए किन दृष्टिकोण का उपयोग करना चाहिए? मूल रूप से ध्यान रखें कि आपके सर्वर को यहां परिभाषित सभी मार्गों पर एम्बर ऐप की सेवा करनी चाहिए। / ब्लॉकक्ॉट> और अधिक

c# - CryptEncrypt gives different results for different languages -

When I run this code in C ++ (shown), in C # or VB6, I have a crypt encryption in pbBuffer Get different results for! I can think that the only thing CryptEncrypt is language based or the parameters are wrong for other tasks. What would be the other reason? I am providing wrong parameters to CryptDeriveKey What will happen then? (CryptAcquireContext (& amp; hProv; zero, zero, PROV_RSA_FULL, 0)} {cryptCreateHash (hProv, CALG_MD5, 0, 0, & hHash)} {if (CryptHashData (hHash, (byte *) szLocalPassword, _tcslen (szLocalPassword), 0)) {If CryptDeriveKey (hProv, CALG_RC4, hHash, CRYPT_EXPORTABLE, & HKEY)} {dwLength = sizeof (TCHAR) * _tcslen (sUnencryptedString); Byte * pbBuffer = (byte *) mLok (dwLength); If (pbBuffer! = NULL) {// Convert TCHAR BYTE four c_szText [128] = {0}; // any SIZE_T then = wcslen (sUnencryptedString) + 1; Wcstombs (c_szText, sUnencryptedString, therefore); Memcpy (pbBuffer, c_szText, dwLength); If the text after "itemprop =" text (CryptEncry...

javascript - Bootstrap 3 Tooltip displaying raw HTML instead of HTML formatted text -

Image
I am trying to use Bootstrap 3 tooltip to display some custom HTML-formatted text. I have wrapped the tooltip in an amber component for reuse. As you can see below, I am really setting the Data-HTML Attribute, and setting the title in some arbitrary HTML format, but when I try to trigger Tooltip If you go, then the raw HTML string is displayed instead. Tooltip component: App.ToolTipComponent = Ember.Component.extend Text: Undefined placement: Undefined HTML: Undefined HTML text: Rarer after being undefined: - & gt; ChildElem = @ $ (": first-child") childElem.attr ('Data-Toggle', 'Tooltip') childElem.attr ('Data Trigger', 'Hover') childElem.attr ('Data-Placement', childElem ChildElem.tooltip () '.atr' ('data-html', 'true') childElem.attr ('title', ' test data & lt; / b & gt;') In this way, Outlook shows up on the application. Tooltip is started while hovering on 'TestC...

python - Counting the number of recursion of a function within the function -

I am working on this function and within the function I want to calculate the number of revision / revision of the function. Any and all help will be helpful! Def Run Generation (L): "" "Regeneration is evolving ..." "Calculation = 0 Show (L) Print (L) Time. Sleep (0.05) If AllOnes (L) == True: Return L Other: NewL = evolve (L) Return run generation (NL) + 1 DIF Run Generation (L, Count = 1): Show (L) = "text"> You can pass the count argument from your recursive series: print (L) if all the on (L) : Print ("Result {} has been found after the efforts". Format (count)) LLL = V Returns to Grace (NL, Count + 1) + 1 / Pre> This program does not really need to be recursive, though it will be an incomplete solution: def runGenerations_iterative (L): count = 1 Show (L) Print (L) while allOnes (L) No: L = Grow (L) count + = 1 (L, Count)) L + Calculation - 1 Return to ) (L) Print (L) Print ("Result {} found after the ef...

updates - AngularJS - Updating variable every second -

What's the best way to update every other variable? What do I want when the user clicks on a button, this variable x will be updated (for example 1, for example) will be added. angular caps for window .setInterval function function each Delays milliseconds is executed.

excel - Selecting a group of cells up in a range -

I have next loop which takes each cell in a category, says 10 below, calculates those ten Is cells and results in the next column. This will take cell A1 for example, zodiac A1-A10 and put it in result B1. It then has a hole in A2, gives the amount to A2-A11 and puts the result in B2. The following code (fraction only) works fine. I want to move UP downwards. Select cell A20, use A20-A10, and insert the results into B-20. The following code will have a value of 10 for E1, and each cell has the number of cells selected from the category. Range for each RNG ("LogRd1") Rng Selection selection values ​​() () (1). Select RNG Offset (, 1). Formula = ((Application Worksheet. Sum (Selection)) / ((Range ("E1"). Value + 0.0001) - (Application.WorksheetFunction.Sum (Selection)) Next RNG Any help was appreciated. Thanks, Grant Re-edited : as a bit more robust range as a dim dim RNG in the form of dim BLOCK_SIZE as dim BLOCK_SIZE, in the form of range, as in ...

Laravel: adding a class to global.php -

I would like to register some event listeners in my Larewell project. To do this, I started my start \ global. Php added the following to the bottom of the file: Use UserLog; $ UserLog = New UserLog; Event :: Listen ('sentinel.user.login', function () {$ logData = array ('eventDescription' = & gt; "user login."); $ UserLog- & gt; submitLog ($ logData);}) ; When I execute that event, I get an error message Uses a statement with the non-compound name 'userlog' which has no effect Use user should drag into class model \ UserLog.php . It works in my other files, but not in the global .php I thought it was because the classes were not automatically loaded, but the code runs after code ClassLoader Is not it possible to add a class to global.php ? Is there a better place that I should register events? Try to use it (): Use \ UserLog; Note that namespace names (namespace separators with fully named namespace names su...

amazon web services - Rails AWS S3: Downloading File and Storing in Temp Folder -

I am trying to download a file from my AWS bucket and store it in my temporary folder. Code below gives this error. The file name, extension, including the @filename bucket, is the form of a string S3 = AWS :: S3.new (: access_key_id = & gt; ENV ["AWS_ACCESS_KEY_ID"] ,: secret_access_key => ENV ["AWS_SECRET_ACCESS_KEY"]) bucket = S3.buckets ["name_of_bucket"] File.open (Rails.root.join ("tmp", @ filename), "wb ") File. open file.write. (BUCKET.objects [@filename] .url_for (read)) read the end Here's what I found out: The first bucket call returns the right thing; the second return puts the BUCKET.objects ['name_of_bucket'] BUCKET.objects ['name_of_bucket'] url_for puts it: https://ekohotstorage.s3-us-west-2.amazonaws.com/location_info what you returned when you visited that URL The bucket you are attempting to access must be addressed using specified endpoint. Please send all futur...

r - Add filename or other annotation to ggplot figures -

Image
I use ggplot to create most of my graphics, these can be single panels, or be bold. To make the modification easier to track, I would like to produce a small label in the corner of the plot that contains some text. In a phony code, I'm looking for something like this: Initial plot p Or: plot my labels in the lower right corner of my statistics without messing up existing garglet graphics. There is no luck finding a solution yet. The (very interesting) method does not work if you have a complete mxn table of tables grid extras are messed up with plots. So, is there any way to add arbitrary text anywhere on a plot that was produced using ggplot? Based on the comment of Baptiste, using a gridExtra () The solution is: is required ("ggplot2") required ("grid extra") # Set up our working directory directory Dir & lt; - '/ user / eclipse / document / project / rccode' set wd (working directory) # one data frame df & lt; - Data....

java - ArrayList issue in HTTP Servlet -

I am using the Floodlight REST API to monitor the virtual network built in Minnet. My goal is to use the ApacheTomac Web server and HTTP Circlet to switch all the switches, hosts and array of statistics to a web browser. The application successfully displays all the switches and hosts, but fails when I switch Adding Statistics. When I am mapping the JSON string to the Java object, the server returns an error in this line: ArrayList & lt; Switch & gt; Queue = mapper Reed Value (Cusjunction, new typewriter & lt; ArrayList & lt; switch & gt; & gt; () {}); Error: HTTP status 500 - Example of java.util.arraylist start_object can not deserialize outside token I have this test done without the queue part (only with the host and device) and everything works fine, but when I am adding ArrayList to the queue, then it is mentioned above Gives the error How can I resolve this issue? My code is shown in advance thanks in advance package core; Import ja...

r - In ggplot2 theme_bw() doesn't draw back grid lines anymore -

संदर्भ : r / ggplot2। अगर मैं गलत नहीं हूँ, Theme_bw () कुछ काले ग्रिडलाइन को आकर्षित करने के लिए उपयोग किया जाता है, लेकिन नवीनतम संस्करण के साथ यह नहीं है। क्या पिछली स्थिति को पुनर्स्थापित करने का कोई तरीका है? अपेक्षाकृत पुराना प्रश्न जांचें, ग्रिड ग्रे है, जो थीम परिभाषा द्वारा भी पुष्टि की गई है तो मुझे लगता है कि यह हमेशा एक ही रहा है। ब्लैक ग्रिड लाइनों को पुनर्स्थापित करने के लिए qplot (1:10) + theme_bw () + थीम का उपयोग करें (panel.grid.minor = element_line (color = " Black ", आकार = 0.5), panel.grid.major = element_line (color =" black ", आकार = 0.2))

usb - Nexus 4 undetected on fedora 17 -

I am new to Fedora system and I have to copy data between my computer and mobile. Thank you. Thanks I believe that earlier versions of Fedora There is a lack of MTP support in I strongly suggest updating Fedora 20, I have a good fortune in Android devices; Comes up as soon as I comes to plug them into a file browser. Make sure you have the simple -mtpfs package installed.

Calculate age in Groovy from today -

It is trying to figure out how old someone is based on their beta. The following code gives us the number of days def now = new date () DEF DOB = new date ('08 / 21/1982 ') println now - dob We can divide by 365 but this is not entirely accurate. There should be an easy way to do this, but I can not find it. any idea? Or using Java 8 and Groovie 2.3 RC (if you want to be on the bleeding edge); - ) import java.time * Local Date Today = Local Date () Local Day Birthday = Local Date (1982, month, August, 8) period duration = period. Beach (Birthday, Today) Println "" "$ period.years year, | $ period.months month, | $ period.days day" "". StripMargin ()

android - How to Make a Save/Load Function For a Text RPG -

I'm making a relatively simple text-based RPG Android game I think it would be a good idea to allow players to save their game and later use it to a single place (hence it is more like saving / continuing). I think that I will need to save player names, inventory items, and of course all the decisions till now will affect the game. What is the best way to do this? I think the name and option can be loaded into play, somehow, later in the form of variables somewhere. The inventory may be a little tricky, I've been on Android development for some time, but before that nothing was left. Depending on the dependent programming language and any software you can use, it will depend on What is the easiest? Usually you use the AI ​​files for what you are saving to save any information You need more specific help from your help, I am more happy to help I am

node.js - Querying multiple collections in MongoDB scoping issue -

I want to query two separate collections by using MongoJS (node.js mongodb wrapper) to create an array of objects I am trying to present myself with my views using EJS. The issue I have raised is doing it with scoping function getTeamMembers (projectID) {var member = []; // & lt; - Instant the array of objects. I want to return the projects. Fondon ({_id: mongojs.ObjectId (projectID)}, function (error, result) / // and click on the members array var team = P. = result.team; // I am convinced that I am providing the members [] array immediately in the right place to make it available to any child's work, But I'm still getting this error: Type error: property can not set 'name' to undefined. You need to create an area that takes the current code to i , why F your findOne () callback to be executed, ending loop is already to be long and i = team.length . This this: You are sending the feedback even before filling any name. for (var i...

Set html text box value from php variable -

I am trying to fill a 'default' value for text box in an HTML registration form based on session data I am If a user generates an error on my registration form, then it is sent back to them, and I want them to fill as much as possible to fill their data as much as possible. Send it in plain form to start with. Here is my handler script checking: // Get text from the IA text. $ Username = mysql_real_escape_string ($ _ POST ['username']); $ Password = mysql_real_escape_string ($ _ POST ['password']); $ Password_check = mysql_real_escape_string ($ _ POST ['pwcheck']); $ Email = mysql_real_escape_string ($ _ POST ['email']); $ Spam_check = mysql_real_escape_string ($ _ POST ['check']); // Spam check IP = $ _SERVER ['REMOTE_ADDR']; // Log in Set up some session data for your IP // unixtacks or spam or errors $ _SESSION ['Username'] = $ username; $ _SESSION ['email'] = $ email; // Check the blank information (...

kendo ui - In the KendoUI framework, is there a global way to turn off animations? -

There is a global way to turn off animation on all controls in the KNDOI, I have to be an alternative to do so that a person is less If we are using a power device, we can get an option to run without animation / transition for them. Something like that Enabled animation (false); "post-text" itemprop = "text"> An inappropriate way - kendo.effects.enable () and kendo.effects.disable () . It is currently used to avoid claims of async

fibonacci - Project Euler #2 in "Python" -

I'm starting a whole new one here, I was giving a try in Python to a query on Project Oller. Can you please tell me where my code is wrong? Question) By adding the last two words each new word is generated in the Fibonacci sequence. Starting with 1 and 2, the first 10 words will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Fibonacci By considering the words which do not value more than four million in the sequence, also find the worth-quotient conditions. Def fib (a): if ((a == 0) (1 = 1)): 1 and return: return (fiber (A-1)) + (fiber (A) -2)) R = 0 bir 0 while (FIB (R)) Your code is not incorrect , it is very slow project To solve more problems, not only should your code be correct, but your algorithm should be efficient. Your Fibonacci computing is extremely expensive - A In time, o (2 ^ N) time trying to achieve the next Fibonacci number - is too long when you want to add the number to a limit of four million. A more efficient implementation in Python Type is: ...

ios - TableView footer not scrolling with content -

Image
In my app, I have a view in the footer of my table detail (tableview.tablefooterview) which is the content. No matter what I do, push it with the addition of a cell goes . Here is the initial code: CGF footer read = CGRactam (0, 0, 320, 200); Footerview2.frame = FooterLine; Self.tableView.backgroundColor = self.footerview.backgroundColor; Self.tableView.tableFooterView = FootView 2; Try adding a section footer to execute the table view rep: - (UIView *) TableView: (UITableView *) Table view viewForFooterInSation: (NSInteger) section {return footerview2; }

android - Define and Populate a Layout for multiple activities -

I have an app where I have to add an informational box to many axiom. This box basically happens with LayoutView different TextView and ImageView . Is that a way to define the whole box in a class and I need it every time? I could copy-paste the Layout XML code and Layou populae methods for each activity, but I want to avoid it (I really hate the code). Why not use pieces ? They are reusable.

c++ - Why do I get memory errors when mmap()'ing a JPG file? -

मेरे पास कोड का निम्न भाग है: char * प्रेषक :: तैयार करना डेटा (चार * फ़ाइलनाम, अहस्ताक्षरित लंबे समय से अंतराल बाइटटॉट्रांसफर) {int fd, pagesize; चार * डेटा; ifstream फ़ाइल (फ़ाइलनाम, आईओएस :: द्विआधारी | आईओएस :: एट); Int आकार = file.tellg (); Cout & lt; & lt; "फ़ाइल आकार:" & lt; & lt; आकार & lt; & lt; endl; अगर (आकार और लेफ्टिनेंट; बाइट्स टोट्र्सफर) {cout & lt; & lt; "निर्दिष्ट संख्याओं की तुलना में छोटी बाइट्स {" & lt; & lt; बाइट्सटोट्रान्सफर & lt; & lt; "} स्थानांतरित करने के लिए - बाहर निकल रहा है! \ n"; बाहर निकलें (1);} एफडी = ओपन (फाइलनाम, ओ_आरडीएनआई); अगर (एफडी == नल) {fputs ("फ़ाइल त्रुटि", stderr); बाहर निकलें (1);} सीओएटी & एलटी; & lt; "फ़ाइल खोलें:" & lt; & lt; फ़ाइल नाम & lt; & lt; endl; पेजेज़ = मिलना (); Cout & lt; & lt; "पेजइज़:" & lt; & lt; पेजize & lt; & lt; endl; डेटा = स्टैटिक_कास्ट & lt; char * ...

android - How to show Contact Alphabet list horizontally? -

I am trying to apply a contact list and its alphabet bar. I have searched a lot, but Also the example I have found, all the alphabetical lists are stacked, but I need alphabetical horizontal list above the contact grid view. I have found some examples of using the list view but I need it on touch scroll, so I do not think listview is a good idea. Edit: Please see what I am doing like this link A b c But I need ABC .. so much. Any link or example is quite commendable thanks It is impossible, a ListView is only vertical. You can not make it horizontal However, you can apply a horizontal scroll view as a horizontal list view. But scrolling of the horizontal scroll view is hard to control because it does not have setOnScrollListener. & lt; HorizontalScrollView android: id = "@ + ID / horizontal scroll view" Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; & Lt; LinearLayout Android: ...

android - Location details not getting saved in shared preferences -

I am trying to bring the user's current location and putting those preferences in shared priorities. My code: - shared context pref1 = this.getSharedPreferences ("LocDetails", Context.MODE_WORLD_READABLE) ;. LocationManager locationManager = (LocationManager) getSystemService (context.LOCATION_SERVICE); Location Location: Author = New GetCurrentLocation (); LocationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, locationListener); } Public location changed at zero {location location} {latitude = location.getLatitude (); Longitude = location.getLongitude (); Edit SharedPreferences.Editor = pref1.edit (); Edit.putString ("latitude", latitude); Edit.putString ("Longitude", Longitude); edit.commit (); } Error: - 04-24 01: 22: 14.644: E / Android Runtime (7088): java.lang.NullPointerException 04-24 01: 22: 14.644: E / Android Random (7088): com.sunmobileappnow.mobileappnow.GetCurrentLocation.onLocationChanged (GetCurrentLo...

ruby on rails - How do i display validation error from controller using angularjs? -

I'm new to angular railways and I'm completely confused, I'm trying below code and do not know I'm sure it's right. index.html & lt; Div class = "input-group" ng-controller = "validation controller" & gt; & Lt; span class = "input-group-connector" & gt; & Lt; Span class = "glyphicon glyphicon-calendar" & gt; & Lt; / Span & gt; & Lt; / Span & gt; & Lt;% = text_field_tag: checkand, param [[checkdate]] :: placeholder = & gt; 'Select Date' ,: Category = & gt; 'Form-Control Datapicator Input-LG': Required = & gt; Truth, "NG-Model" = & gt; "Checkin.date"%> & Lt; / Div & gt; & Lt; div class = "input-group" ng-controller = 'validation controller' & gt; & Lt; span class = "input-group-connector" & gt; & Lt; Span class = "glyphicon glyphicon-calendar" & gt; ...

oracle - Either in not both clause in select sql -

Find names of both departments located in Boston or Broker "Not in Both Cities. The code is from SELECT D.DNAME on the Department de Inner Daptolko L. LDN = DDMAN.NNLLI .ttt = 'Boston' or L.City = DALLAS '; But this department which is located in Boston or the broker, but I only Want me to get results Example: In my Dispoto Comble // DEPTOPO DAME CITY ---------------- Account Basis Account Broker Sales Brokers Transport Boston Transport Brokers Then in my department I should get the output like DNAME ---------- Sales SELECT D.DNAME Join DEPTLOC L ON L.DNAME = D.DNAME WHERE L.CITY = 'BOSTON' or L.CITY = 'DALLAS' Group by D. DNA vs. COUNT (1) = 1

Adding column in CSV python and enumerating it -

मेरी CSV दिखता जॉन, बम, डॉन 3,4,5 3, 4,5 3,4,5 मैं इस तरह से सामने आईडी कॉलम जोड़ना चाहता हूं: आईडी, जॉन, बम, डॉन 1,3 , 4,5 2,3,4,5 3,3,4,5 फ़ंक्शन का उपयोग करते हुए, लेकिन मुझे नहीं पता कि कैसे यहाँ तक मेरा कोड है: इनपुट के रूप में खुला ("testi.csv", 'rb') के साथ सीएसवी आयात करें: आउटपुट के रूप में खुला ('temp.csv', 'wb'): पाठक = Csv.reader (input, delimiter = ',') लेखक = csv.writer (आउटपुट, डेलीमीटर = ',') सभी = [] पंक्ति = अगला (रीडर) row.append ('ID') all.append (पंक्ति ) गिनती = 0 रीडर में पंक्ति के लिए: गिनती = = 1 जब गिनती: all.append (पंक्ति) पंक्ति .append (गणक (पाठक, 1)) लेखक को तोड़ दो। लेखक (सभी) और आउटपुट सभी गलत होता है: जॉन, बम, डॉन, आईडी 3,4,5, & lt; 0x7fb2a5728d70 & gt; 3,4,5, & lt; 0x1764370 पर ऑब्जेक्ट एन्यूमरेट करें & gt; 3,4,5, & lt; 0x17643c0 पर ऑब्जेक्ट एन्यूमरेट करें & gt; तो आईडी अंत में आता है, जब यह शुरुआत में होना चाहिए, और यह 1,2,3 भी नहीं करता है कुछ ...

wordpress - How to add a 'selected' in a select dropdown wp/php -

I have a problem that I'm not sure how to contact, I have a WP plugin that contains the form, I have a The result is that there may be a diverse quantity of data (depending on the user being presented). How can I add 'Selected' to the selected item, when the user returns, who can edit / view who has chosen that item? & lt; Select Name = "Supplier" & gt; & Lt; Option value = "Supplier 1" & gt; Supplier 1 & lt; / Options & gt; & Lt; Option value = "Supplier 2" & gt; Supplier 2 & lt; / Options & gt; & Lt; Option value = "Supplier 3" & gt; Supplier 3 & lt; / Options & gt; & Lt; Option value = "Supplier 4" & gt; Supplier 4 & lt; / Options & gt; & Lt; / Select & gt; A loop comes in the brain, will I specify the number for each option? Can be 100 suppliers, so will it require accurate counting? I will use a loop. $ theirChosenSupplie...

Google+: Get access_token for already authorized accounts through PHP client library -

I'm implementing the hybrid sign in flow. Logged in with Google+ What I want to achieve: A user has authorized the app, next time he comes back to the website, I want to log him in automatically. In the hybrid flow, Google automatically logs on to the user and displays a welcome message (JavaScript SDK) with access tokens coming back. But this process has to be sent for an Ajax call to the Gogol API. I want to make this call via Google's backend using PHP's Client Library. Since the app has already been authorized, therefore it should be easily returned access tokens when using JavaScript SDK. But I am not able to understand how to use the client library. Can somebody help me out? access_type: set 'offline' in your call parameters, then refresh_token is required to get a new token, which is provided once at the time of first authorization. You must store that refresh_token in your database and enter the user's already completed token I...

c# - The type or namespace name 'routing' does not exist in the namespace 'system.web' visual studio -

Image
Namespace name 'routing' namespace is not present in 'System.Web' (you are missing an assembly reference ?) I added the web reference system. Web. Routing, but still showing this error. You need .NET 3.5 with SP1.

CSS and Safari : image position -

Image
I have a problem with the status of an image on Safari. First, on Chrome, the result of Firefox and Internet Explorer is correct: But there is a problem on Safari: CSS is: span.boy_hand {background: url (../img / hand_png.png) no-repeat; Height: 35px; Width: 51px; Status: fixed; Top: 470px; Margin-left: -32px; } Can you tell me where it comes from? Use the left property instead of margin-left to set the image to the right place - Different browsers will be left to guess differently for positioning element. Therefore, to include left and top properties for your element, Best Practice will be included span.boy_hand {background: url (../img/hand_png.png) No-repeat; Height: 35px; Width: 51px; Status: fixed; Top: 470px; Left: 32px; / * Set the left property according to your requirement, I'm just reusing my code * /}

php - How to insert multiple choice survey answers into database? -

I am creating a site where the user can reply to the survey, my code looks like this (answering.php): & lt ;? Php include_once 'init / init.funcs.php'; $ _SESSION ['pollen'] = (int) $ _GET ['pollen']; $ Questions = array (); If ($! Session ['reply'])) {$ result = mysql_query (select from 'katse_kysimused where kysimustik_id =' '. $ _SESSION [' pollid '].' ''); While ($ row $ [_SESSION] [$ questions [] = $ row ['kysimus'];} $ _SESSION ['answer'] ['question'] = $ question; $ _SESSION ['answer'] ['index' ] = 0;} $ X = $ _SESSION ['Reply'] ['Index']; $ result3 = mysql_query (Select from 'tyyp_id katse_kysimused where kysimus =' '. $ _SESSION [' answer '] [' question '] [$ x]. '' '); $ type = mysql_result ($ result 3, 0); if ($ type ==' 3 ') {echo "& lt; Meta http-equiv = 'Refresh' content = '0...

php - Display multiple rows as one in MySQL -

I want some advice I have created a web app where a user can assign multiple forms The recipients simultaneously insert multiple rows (one line per recipient) in a work form_assignments such that the table is like so: foreach (as the $ line $ Recipients) {$ query = "insert in form_assignments (SENDER_ID, recipient_id, form_id, DUE_DATE, priority_id, comment, completion) values ​​('{ $ {SENDER_ID} ','. $ Line ['id']. ", '{$ Assign_form_id}', '2014 -04-30 00:00:00', '{$ priority_ID}', '{$ comment}' In the above example, $ recipient is an array containing $ row ['id'], '{$ completed}'); Therefore, an assignment can generate these 100 rows (for 100 recipients), for example, and each recipient of "complete" Can edit your personal line in the form it is now Far better. The problem is, if I want to generate a list of assignments for that user, then I should see only one row for the mul...

python - Can pip access pypi without checking the SSL certificate or can it even use http instead of https? -

In my enbviroment I need to use pip through my local proxy (i.e. - Proxy command line option). I get an error when I do this Error: [Erro 10013] Attempts have been made to restrict socket through access. I think this is due to problems with the certificate, because my proxy does not support https with the certificate, but this https without Supports certificate check. (Like wget https://webpage.com works when I have check_certificate = off in .wgetrc .) So, when I can certify pip that this should work, I think this is the figure for the problem of pipes. The second option is to use pip at https , but not only to use http . Any way to do this? - Try using PP with --proxy logic. Pip installation --proxy See if the error is changed.

postgresql - Unique index on text column - what is the index type? -

मेरी तालिका में मेरे पास कॉलम slug प्रकार TEXT है। यह स्लग स्टोर करेगा जिसे इस तरह से प्रश्नों के लिए इस्तेमाल किया जाएगा: SELECT * पदों से जहां स्लग = 'मेरे पोस्ट स्लग' अभी के लिए मैं अनोखा स्लग पर सूचकांक सेट करता हूं। अद्वितीय इंडेक्स (बीटी्री, हैश, ...) का क्या प्रकार है? है यह पर्याप्त है या मुझे स्लग कॉलम के प्रकार हैश पर पुनः 1) यदि आप किसी इंडेक्स प्रकार को निर्दिष्ट नहीं करते हैं, तो यह बीटी के लिए डिफ़ॉल्ट है। पुनः 2) हां, एक बीटीआरई इंडेक्स पर्याप्त है हैश इंडेक्स आमतौर पर पोस्टग्रेज़ में बहुत कुशल नहीं माना जाता है। इसके अलावा उनके पास कुछ कमियां हैं। हैश इंडेक्स ऑपरेशन्स वर्तमान में वाल-लॉग नहीं हैं, इसलिए हैश इंडेक्स को डेटाबेस क्रैश के बाद REINDEX के साथ फिर से बनाया जाना पड़ सकता है अगर अलिखित परिवर्तन थे इसके अलावा, हैश इंडेक्स में बदलाव प्रारंभिक आधार बैकअप के बाद स्ट्रीमिंग या फ़ाइल-आधारित प्रतिकृति पर दोहराया नहीं जाता है, इसलिए वे उन सवालों के गलत उत्तर देते हैं जो बाद में उनका उपयोग करते हैं। इन कारणों से, हैश इं...

java - JPA @OrderBy Annotation - Ordering Strings -

I am using @Olderby annotations in my organization class which was eagerly arranged to organize a collection. is. The order in which I am ordering is of the string. However, in some instances, these stars may have numbers. How can I ensure that orderbrain annotation instead of 1,8,2,3,4,5,6,7,8,9 will order the numbers stored as strings in their numerical order? @ orbaby will be sorted according to the database because it is part of your SQL query Will happen. Experimenting with a custom comparator will yield your result. You can also consider combing 2 (@order bye so that you return to the database in a consistent order, then the @SortComparator for the desired order) Not sure that you How to know how to write a comparator, but it's the beginning.

android - Eclipse can't debug: what happened to my environment? -

Image
When I run in debugging mode, debug window shows "white" screen, and can not see call stack. The picture below is given: I eclipse and reboot my Is the computer? Still not solved, did anyone meet before this? I do not know at all, but I resolved it in the following way Again an Android SDK (with Eclipse) Create a new work place Then the problem is over

Haskell filter function laziness -

दिए गए: ले 5 (फ़िल्टर पी एक्सएस) कहते हैं कि अगर फ़िल्टर पी xs 1K मैच लौटाएगा, क्या हास्केल केवल 5 मैचों को फ़िल्टर कर देगा और बड़े इंटरमीडिएट परिणाम के बिना उत्पादन करेगा? यह 5 कोड का उपयोग करने के लिए केवल xs को स्कैन करेगा, केवल इस उपसर्ग पर p का मूल्यांकन करेगा xs । अधिक सटीक होने के लिए, यह वास्तव में कम गणना करता है, परिणाम के आधार पर इसका उपयोग कैसे किया जाता है। उदाहरण के लिए, मुख्य = दो पी एक्स = (एक्स == 3) || (X> = 1000000) list1 = [0..1000000000] list2 = take5 (फ़िल्टर पी सूची 1) प्रिंट (सिर list2) केवल list1 स्कैन करेगा जब तक 3 पाया जाता है, और तब तक नहीं, जबकि ले लो पांच तत्वों के लिए पूछ रहा है इसका कारण यह है कि head इन पांचों में से केवल पहले की मांग कर रहा है, इसलिए आलस्य केवल इसका मूल्यांकन करने का कारण बनता है।

c# - Add lines between two inline images in word -

I have a code to add inline images to the word. Now if I want to add a line between them What should I do? var WordApp = new Microsoft.Office.Interop.Word.Application (); WordApp.Documents.Add (); WordApp.Visible = true; Microsoft.Office.Interop.Word.DocumentDoc = WordApp.ActiveDocument; doc.InlineShapes.AddPicture ("C: \\ mypic1.jpeg"); doc.InlineShapes.AddPicture ("C: \\ 20140203_202325.jpg"); Doc.SaveAs2 ("C: \\ MyDocument.doc"); WordApp.Quit (typing, type, messing, typing, messing); I tried with the following line, but that help is needed. WordApp.Selection.InsertAfter ("\ r \ nThis is something Random text "); What would be the line between them? Use this piece of code: this will add the image and then Line to do it Object StartPos = 0; Object endpos = 1; Microsoft.Office.Interop.Word.Range rng = doc.Range (Riff Startups, RefAndo); Object Newindos = RNG Story Langha - 1; Rng = doc.Range (Ref NIndPos, Ref A New EndPo...

jquery drag n drop not working please review my code -

I have three buttons and I want to draw it in the droppable div but it is not working. Please review my code and give me the best advice & lt; body & gt; & Lt; form method = "post" action = "dashboard.expx" id = "form1" & gt; & Lt; Script type = "text / javascript" & gt; . $ ('# Play1') dragable (); $ ('# Yasin2') dragable () .; . $ ('# Page3') Dragable (); . $ ('# Page24') Dragable (); $ ('# DivScene'). Droppable ({drop: function (Event, UI) {var id = $ (ui.draggable) .attr ('id'); Alert (id);}}); & Lt; / Script & gt; & Lt; Div & gt; & Lt; Input type = "submit" name = "btnAddScene" value = "add" id = "btnAddScene" style = "float: correct; height: 26px;" & Gt; & Lt; H1 & gt; View (s) & lt; / H1> & Lt; / Div & gt; & Lt; Div id = "divScene" class = "ui-drop...

querystring drop down menu mvc asp.net selected item list -

I want to type query string if conditions = 2 I have a drop down menu in this menu I position which is {main, left, top, bottom} If I wrote in my local host localhost: 27593 admin create items? Type = 2 should be in position I just left in asp.net and mvc and want to write the main code correct plz help me Create a public function (int? Id) {/ / Querystring // 2 ise int TYPEE = HttpUtility.UrlDecode (Request.QueryString ["typee"]); String [] separateURL = url.Split ('?'); NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString (separateWorld [1]); If (TYPEE == 2) {SelectListItem [] item = New SelectListItem [2]; Item [0] = new selection list name "main", "1"); Items [1] = new selection list ("left", "2"); DropDownList1.Items.AddRange (item); DropDownList1.DataBind (); } Else {SelectListItem [] items = new selection list [5]; Item [0] = new selection list ("main", "1"); Items [1] = n...

IOS - how to make default Back button invoke unwind segue -

Is it possible to open the default navigation 'back' button to cgi? I know that it is possible by dragging a standard button on the green out icon, but the default navigation 'back' button is not visible on the storyboard. It seems that after adding a new contact to the iPhone's Contacts app, it takes you to the screen displaying all information entered, here & # 39; & lt; Back button 'button appears to display a unique segue for the contact list screen. Anyone know how this is done? I think I can add a standard button and start opening it, but in '& lt;' There is no symbol which I would like to do. As I know there is no way to set up another task for it, the default back button I spent a lot of time doing this You can create a custom button that looks like the default but the default button can be changed to the next iOS version. To open the operation, you can simply edit a viewControllers array of your navigation controller....

BizTalk AS/2 implementation certificates -

I can not add a certificate to AS2 messages in BizTalk So what I have at the moment (I have been running a host instance using the same account, which has 2 certificates installed on the BizTalk machine using the same. There are 2 certificates and Location: \ Personal \ Certificates - My own certificate 'PFX'. Other people certificate - party certificate 'cer'. Importing certificates so far.Now , When in Bizzotok administration, I go to parties And I go to the agreement between the parties, in that window I go to the 'signature certificate' and I check the "override group signing certificate." Then when I click on "Browse" I see : "No certificate is available." "No certificate fulfills the application criteria." Any ideas what is wrong here? I have found it. Quantum letter should be installed under the same example that Oandend BizTalk Administration console. Otherwise certificate not found.

html5 - restore to defaults with jQuery hover -

मेरे पास कोड है: JQUERY $ (दस्तावेज़) .ready (फ़ंक्शन () {$ ("# डेवलपर")। होवर (फ़ंक्शन () {$ ("# coder")। फीडटो (1000,0.4); $ ("# my_pic" ) .मेट ({सही: '110 पीएक्स'}, 1500);});}); यह काम करता है, लेकिन जब उपयोगकर्ता माउस को #developer के क्षेत्र से बाहर ले जाता है तो मैं डिफ़ॉल्ट को पुनर्स्थापित करना चाहता हूं। CSS # कोडर {अस्पष्टता: 1; } #my_pic {स्थिति: रिश्तेदार; } HTML & lt; div id = "developer" class = "threecol" & gt; & Lt; h1 & gt; & lt; अवधि & gt; & amp; lt; & lt; / span & gt; डेवलपर को & lt; अवधि & gt; & amp; gt; & lt; / span & gt; & lt; / h1 & gt; & Lt; / div & gt; & Lt; div वर्ग = "छक्का" & gt; & Lt; img id = "my_pic" src = "चित्र / मी पेज" / & gt; & Lt; / div & gt; & Lt; div id = "coder" वर्ग = "तीनको अंतिम" & gt; & Lt; h1 & g...

WPF combobox in a datagrid group header -

Is it possible to use a combobox in the DataGrade group header to set a selected value for each cell in the appropriate column (This is a combo box included)? Or is there a better solution to set more than one combobox value in a column at the same time? You can place the combo box in the group header: & lt; DataGrid.GroupStyle & gt; & Lt; GroupStyle & gt; & Lt; GroupStyle.ContainerStyle & gt; & Lt; Style TargetType = "{x: Type GroupItem}" & gt; & Lt; Setter Property = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: Type GroupItem}" & gt; & Lt; Expander & gt; & Lt; Expander.Header & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Text block text = "{binding path = name}" vertical alignment = "center" /> & Lt; TextBlock Text = "{Binding Path = ItemCount}" margin = ...

mysql - SQL count with another table in SELECT clause -

मेरे डेटाबेस में, 2 अलग-अलग फ़ील्ड हैं i) कर्मचारी ii।) विभाग मेरे कर्मचारी तालिका में NAME विभाग --------------------- जॉन आईटी सिटी रिसर्च जेसन रिसर्च मेरे डिपार्टमेंट में नाम ------------ आईटी रिसर्च कम्प्यूटर कथन का प्रयोग SELECT DEPARTMENT.DOMNAME से विभाग, कर्मचारी जहां विभाग। DNAME = EMPLOYEE.DNAME और (SELECT COUNT (*) FROM EMPLOYEE.DNAME) = 0; जब विभाग में कोई भी कर्मचारी प्रदर्शित नहीं करेगा नाम ------------ - कंप्यूटर कोशिश कर रहा है लेकिन उस पर कुछ त्रुटि होने दो विकल्प: IN का उपयोग करना: चयन नाम से नाम पर नाम कहाँ का उपयोग करना : SELECT D का उपयोग करने के लिए डी.नाम = कर्मचारी पर डिप्टीमेन्ट डे से कम कर्मचारी शामिल हैं। डिपार्टमेंट जहां कर्मचारी। डिपार्टमेंट नल है एक उदाहरण। इस पद्धति में उच्च प्रदर्शन अन्य की तुलना में अगर आपके पास अपने टेबल में हजारों रिकॉर्ड हैं।

wso2bam - WSO2 BAM Hardware requirements -

I am trying to define the production grade hardware specification for WSO2 BAM. I need to bridge many data sources including plain text, SAP, Excel sheet etc. and pump data to WSO2 datastore. The data volume and velocity are relatively less around 8 MB per day. Data diversity is fixed RAM: 2 GB for JMM and 2 GB for OS HDD: Minimum 10 GB free disk space for ISCL database Hardware Infrastructure 8 GB RAM Quad-core Opernon 1 TB Disk Volume Question Do I host casement separately? How many nodes are recommended in a ring? Do I have to host different hive scripts? Is it possible to separate Hope and Hive from the WSO2 BAM server? recommended settings? The documentation should have answers to your questions.

java - Two spinners change text in TextView -

Image
I'm trying to create this Android app and I have some problems, I choose a card number in my left spinner I want to have a dealer hand in the right spinner, and I also take a card number there. (See image below) I No problem can change my card and image updates, but when I select pre 17 and 2, how do I change the text in my text view? I have a TextView but have approved the text I tried to do it, but it is if (plHand.equals ("8") and dlHand.equals (" 2 ") || dlHand.equals (" 3 ") {Toast. Make Text (this, "IT Work!", Toast. LNNHH_LOG). Show (); } I have made a toast to check when I have to. But nothing happens but how do I do it? plHand and dlHand is a string array I also tried if (sp1.getselectedItem (.) ToString (.) Equals ( "17") and (sp2) .getSelectedItem (.) Equal to ("Ace") {Toast Mac Text (main activity., "IT Works!", Toast.LnnHT_LOG) Show () ;} Hope people know what to do! Edit: ...