Posts

Showing posts from February, 2011

regex - GET request htaccess redirection -

मुझे यूआरएल को website.com/search.php?city= से रीडायरेक्ट करना होगा भारत और amp; कीवर्ड = लैपटॉप से website.com/search/india/laptop मैं htaccess के साथ ऐसा कैसे कर सकता हूँ मेरे htaccess में वर्तमान कोड विकल्प + अनुवर्ती लिपियों पर पुनर्लेखन इंजन ^ ([a-z0- 9 _-] +) / ([a-z0- 9 _-] +) ( /)? $ search.php? city = $ 1 और कीवर्ड = $ 2 आप इस रूट को अपने रूट में .htaccess फ़ाइल में उपयोग कर सकते हैं: विकल्प + अनुवर्ती लिपि - मल्टीमीक्स रीव्रेटइन्गइन ऑन रीराइटकॉन्ड% {THE_REQUEST} \ s / + खोज \ .php \? city = ([^ & amp; ] +) और कीवर्ड = ([^ \ s & amp;] +) [एनसी] रीराइरेरल ^ / सर्च /% 1 /% 2? [आर = 301, एल, एनई] रीव्रेट नियम ^ खोज / ([\ w -] +) / ([\ w -] +) /? $ /search.php?city=$1&keyword=$2 [एल, क्यूएसए ]

css - Nested pseudo selectors with Sass -

मेरा एचटीएमएल जैसा दिखता है यह उन के अंदर पिक्चरोग्राफ आइकन के साथ परिपत्र बुलेट अंक की एक सूची है यद्यपि आप इसे जिस तरह से मैंने इसे पोस्ट नहीं किया है: & lt; div class = "feature-bullet" & gt; & lt; div वर्ग = "सुविधा-चिह्न" & gt; & lt; / div & gt; & Lt; / div & gt; एक एकल रेल द्वारा चार बार आंशिक रूप से प्रस्तुत किया जा रहा है इसलिए मैं अपनी विशिष्टताओं को बदलने के लिए कुछ गोलियों पर अतिरिक्त कक्षाएं नहीं डाल सकता। जो भी कारण से, फीचर-आइकन शीर्ष दो बुलेट बिंदु के अंदर हैं और मैं उन्हें सीएसएस छद्म चयनकर्ताओं के साथ चयन करना चाहता हूं और उन्हें कुछ अतिरिक्त मार्जिन देना चाहता हूं। तो मुझे क्या करने की जरूरत है modal-content के दूसरे और तीसरे बच्चे लेते हैं और उनके प्रत्येक div.feature-icon s को चुनते हैं और उन पर मार्जिन विशेषता डालते हैं। मेरा असामान्य गैर काम .scss था: .modal-content {& amp;: nth-child (2), और: nth-child (3) { .फ़ीचर-आइकन {मार्जिन-बायां: 10px; }}} लेकिन मुझे जल्दी से एहसास हुआ

android - Conversion to Dalvik format failed: Unable to execute dex: GC overhead limit exceeded -

I am stuck with this error for the last 3 hours. When I checked the latest code from SVN, then stopped this work. Note :. My new project size is about 135 MB and I am using Eclipse Kepler Also see 3Mar / sqlite.jar named myApp / res / libs In, ksoap2.jar, rt.jar Then I googled and found. And also this and I have edited eclipse.ini to: -startup plugins / org.eclipse.equinox.launcher_1.3.0 .v20130327 -1440.jar --launcher.library plugins / org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140116-2212 -product org.eclipse.epp.package.standard.product --launcher.defaultAction OpenFile - -launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256M --launcher.defaultAction OpenFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion = 1.6-Xms40m -Xmx512m --startup plugins / org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar --launcher.library plugins / org.eclipse.equinox.launcher. win32.win32 .x86_64_1.1.200.v201401

c++ - Template class requires template arguments? -

Sorry, I did not know how to write a great headline for this question, feel free to edit. I have many classes that have the same role , which means that they all apply the same interface (set of methods). Consider that they all get from the same table class (even if this is not a case in a minor example, this is not the issue of this question). and U , and one of the previous sections code> A without template logic . Internally, this new class A & lt; T & gt; and a & lt; U & gt; . Is this possible? C + + 11 replies are welcome, if necessary, do not hesitate to add the tag. The example that fails is: #include & lt; Iostream & gt; // ------------------------------------------------ ------------------------ straight eng_tag {}; Struct fr_tag {}; Struct sp_tag {}; // First implementation of the "Talk Interface" template & lt; Class T = eng_tag> struct e {zero point () {std :: cout & lt; & Lt; "Hello \ n"; }

c# - Cannot using Linq function with Bing API sdk on Winforms -

I am using a large API SDK on a Winform application (Winform and not WPF!). I am able to add pushpins. I would like to remove some pushpins. I saw some Linux method, but I am not able to compile because "first" is not found. : var pushpin = MyMapUserControl.MyMap.Children.First (p => (P. gatetype =) Typef (flowerpin) & amp; amp; ((fluffen) p) . == "Search Metallurator")); MyMapUserControl.MyMap.Children.Remove (pushpin); My error: There is no definition for 'first' in 'System.Windows.Controls.UIElementCollection' and no extension method 'first' 'System.Windows.Controls.UIElementCollection' has been found for the first argument. I include in: using System.Linq; Can anyone help me? implements the system .windows.Controls.UIElementCollection IEnumerable but not IEnumerable & lt; UIElement & gt; , therefore Linq methods do not apply directly because they only work on IEnumerable & lt

java - Turning a ResultSet into 2DArray/HashMap/Lists of Lists -

I think I have become a code-blind. I am currently doing a small project, a friend and we are using JDBC to choose from our database. What I need is that after running the selection statement, I get back some sort of '2D' list of all the data. I think I want something like this - array [columnname] [all data inside selected column] Pseudo code // Calculate all the rows in a column / calculate the column // Add the column name to the 'array' (int i = 1; i & Lt; = columnCount; I ++) columns.add (resultSetMeta.getColumnName (i)); // Adds the result of the first column to 'array'. // How can I add results to numbers? For (int i = 1; i & lt; = rowCount; i ++) {while (resultSet.next ()) rows.add (resultSet.getString (i)); } Columns and ROs Input (columns, rows); A table - What is the most appropriate data type to use to replicate 'array list, array, or hashmaps'? What is the best way to create ResultSet in a 2D datatype?

user interface - Javascript and the Web -

I hope this question is deserves here. OK, since I started web development, I was thinking, because many web experiences are highly dependent on Javascript, yet why is there an option to disable it in settings? Does it break most modern web apps on the web today? Thanks to Many people disable JavaScript because one The perceived security benefit has been used by some browser vulnerabilities via Javascript. However, this is extremely unusual and rare security holes have been patched very quickly in JavaScript engines. Most websites use javascript ???? This makes our web possible today. [...] Deactivating Javascript prevents loading of certain types of ads. We do not encourage blocking of ads, but if you want, there are better ways to disable javascript.

android - Can a radiogroup show a heading/title? -

I have set up a radiogram with three radio buttons on my app, but I want to text it from the upper part as if It does the checkbox and I can refer to the strings.xml file like this Because when I run the app, three radio buttons appear without any text or an easy way? The old question is, but maybe my answer will help someone. One way to add headers to all buttons is to use only TextView inside RadioGroup . And of course, you can set the text for each radio button. You should use the android: text property to set the text for each button below In the example of the wire used as usual, but you should remove your strings in the better strings.xml Here is an example: & lt; RadioGroup Android: id = "@ + Id / set_radiogroup" android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: orientation = "vertical" & gt; & Lt; TextView Android: id = "@ + id / header" Android: layo

serialization - BufferedImage Read from file using ObjectStream is null -

description I am reading a theme object from a file, the list of buffer images in the theme category Is transient, but uses a custom read / write object method that reads and writes ImageIO. The problem is that the first time a buffer image is read in a theme (it is not empty), but the rest is zero, I think there might be something wrong with the type of object that you write, but what? The program runs trough folders and creates a theme that is located in that folder. Nothing wrong in the images, I have checked using different images, but the result is the same. DataSetup Public class dataset {public zero type () {list & lt; Theme & gt; Themes = getThemes (new file ("data")); {FileOutputStream fos = Try New FileOutputStream ("data / campaign.dat"); ObjectOutputStream OOS = New ObjectOutputstream (fos); For (theme theme: topics) {oos.writeObject (subject); } Oos.close (); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTr

sql - Save two dimensional table to database -

Image
How can I efficiently represent the following table in the database, assuming that the number of rows and columns is hundreds of more (The idea to create a database with the I 100 field is not a good idea :)) I am using Ruby on Rails / SQLite. What you have here is a classical de-normalization task. And the classical approach (do not know your read-write patterns or other needs) is to create three tables: id. Name --------- 1 | Gothmist 2 | Giga ohm 3 Quick Online Tips ID | Name ---------- 1 | China 2 | Children 3 Music 4 Yahoo ID1 | ID 2 | Price ----------------- 1. 1 | 0 1 | 2 | 3 ... 3 | 4 | 22

python - How to retrieve values of list in browser using web2py? -

I am writing a TSP algorithm using a python and there is a list of output node path such as: path [1,2] , 3,4,5] where each number is the key to the city name. Now I need to recover the entire list in the browser, but I can not because I only get a value from the list when I use the return path I do: By seeing the output in the console window, my code Running like Uri Any ideas ?? Simple example: file.py def temp (): path = [1,2,3,4,5] return path File.html { {Extension 'layout.html'}} & lt; H1 & gt; {{= path}} & lt; / H1> You should do this: < Code> path = [1,2,3,4,5] return str (path)

security - Storing private keys in database -

I need to store a private key for multiple users, so that my server application can sign files on their behalf . I want to safely store the private key, but I could not find the best practice around it. If I was collecting a password, then I havehes to create a salt + password hash which can not be easily returned to the password. However, with a private key I need to store it in such a way that I can get it later. I was thinking that I would encrypt the private key and then store it in my database. I basically thought that each key would be encrypted with a different password (based on some user's qualities). However, those properties will probably be stored in the database, so if my database is leaked then the attacker has everything. I can encrypt all private keys with a single password which is known only for my application. Then an attacker would have to steal my database, and I would have to apply to do any harm. Is there any technique / best practice I am missing

ios - UINavigationController push crashes with Unrecognized Selector barStyle -

Very well this is a memory related issue, but it is always happening in one place, when one on the navigation New controller controller stack current activation viewer controller = controller = [[current vector viewer controller allot] init]; Controller delegate = self; [Controller setmodeltransition style: UIodal transistition flip horizontal]; [Self. Navigation Controller present ViewController: Animated Controller: Not Complete: Zero]; Accidents are always a randomly received object, but always before the same stack calls, another interesting thing is that it seems that only devices with devices of 4 and 4 7.0 Not running simulator, running on a 3.5inch device, then getting back to memory issues, there is not much help to reproduce on going there. Thread:. Crashed: com.apple.main thread 0 libobjc. A.dylib 0x39b42b26 objc_msgSend + 5 1 UIKit 0x32039677 - [_ UINavigationPaletteBackground _syncWithBarStyles] 42 2 UIKit 0x3203924b - [_ UINavigationPaletteBackground updateBa

javascript - Swap Images With jQuery hover -

I have an IMG tag with the following details: id = "hover1" src = "HelloPG" $ ('# button1'). Click (function () {$ ('# hover1'). Attr ('src', 'hello_hover.png');}); $ ('# button2'). Click (function () {$ ('# hover1'). Attr ('src', 'hello.png');}); However, when I try to swap the images with the following code, then nothing like this happens. $ ('# hover1'). Hover (function) {$ (This) .attr ('src', 'hello_out.png')}}, function () {$ (this) .attr ('src', 'hello.png');}); The code looks good to me, is it failing? Please help me I am using jQuery 2.1.0, Mozilla 26.0, Windows 7. Thank you. $ (function () {$ ('an img'). Hover (function ) {$ (This) .attr ('src', $ (this) .attr ('src'). Replace (/ .jpg /, 'yourImageName.jpg'));}); see it .. thanks

mongodb - Rails 4 - Uninitialized constant Mongo Model -

I am trying to setup MongoHQ using Harko and Rail 4. 4. I have set up everything correctly to my knowledge, but now I'm getting this error: undefined constant jobs :: TempEmailContactStoreCsv This is the Job model where the error is happening: class jobs & lt; And I Mongo models: p> Classes in TempEmailContactStoreCsv Mongoid :: Document field: email_contact_array, Type: Array field: job_id def self. store (job_id, email_contact_array) r = TempEmailContactStoreCsv.find_by (job_id: job_id) that (rnn?) TempEmailContactStoreCsv.create! (Job_id: job_id, email_contact_array: email_contact_array) End end def self.exists? (Job_id) r = TempEmailContactStoreCsv.find_by (job_id: job_id) Returns RNL? == wrong end Diif self.retrieve (job_id) return TempEmailContactStoreCsv.find_by (job_id: job_id) end Diif self.delete (job_id) r = TempEmailContactStoreCsv.find_by (job_id: job_id) r.destroy until r.nil? End end It seems that my Mongo model is not being started, an

Disable AssetNotPrecompiledError in Rails, ignore missing assets -

There is no easy way to configure / patch rail to ignore missing assets? If a static asset is unavailable, I do not want to receive AssetNotPrecompiledError errors. Here is my production configuration: config.assets.enabled = true config.assets.compile = false config.serve_static_assets = true The only civilized solution I have found is to make the assistant helper who wrap the call for the rail call, the property tags are created in helpers and catch the error: < p> I got a question with a similar answer. He listed three possible solutions

python - Include post data from a second form when submitting -

I am working on a DJ ango template that includes two forms. Let me first one main and one sub-phone main Want to be able to deposit and receive postal data of sub with it. The sub has options for the main and I need to change the main and choose the same options as the sub. I have everything set to be that I can get post data from the main but I do not know how to include sub Does the Django come with an optional ???? Line Formula ??? An application that separates forms into multiple web pages maintains state in a backend so that full server-side processing is delayed from submitting the last form. Read the official documentation here:.

ios - How do we rotate 2 UIView planes simultaneously in 3D space -

I am trying to create a "page flip effect" by using UIView instead of CALayer due to a project limit For 1 UIView flipping 180 degrees and essentially "pasting it" requires behind the other UIView. Then you simultaneously rotate two UIViews together in 3D space supervision. I am trying to port UIView to UIView instead of UIImage. Below it is a snippet of the port's own effort. The initial page flip works, but the "front layer" does not appear in the code like I can not see the backend of the page. When I flip the page, the animation is initially correct (the back layer is fine), but then on the other side of the page (front layer), I see the reverse view of the backlit. Any help will be awesome! flip animation layer = [[UIView alloc] init]; Flip Animation Layer.layer.anchorPoint = CGPointMake (1.0, 0.5); Flip Animation Layer.layer.frame = rect; [Auto addDeviewview: flip animation layer]; UIView * backLayer; UIView * frontLayer; If (FlipDir

c# - Save appointments to my default calendar in WP 8.1 -

I was hoping that with the new calendar API of wp8.1, I now completely change the native calendar app I am able to my own. But after a few hours in the API documentation, I came to the point that it is still not possible. This is what I have concluded: I can use my complete appointment calendar in full reading and writing. But this calendar will not be synced with my other devices. I can add / remove / edit appointments in all other calendars, but only AppointmentManager . It still takes some time to open the native calendar app and the user has to manually press the save button. The old way is still to get me to access the Outlook.com/Google Calendar / ... API to save the appointments directly from my own calendar app. Is there a way to set ReadonWrite (ReadWrite = full) into my default calendar (ReadWrite = Systemonly) from my default calendar (Outlook.com)? forum appointment calendar API allowed to write directly to an online calendar provider Does

php - translating all values in a column in a database from one language to another -

I have a table named Fish in Swedish, something looks like this: FishID | Swedish name | Resident I have all the Swedish names for every fish but I also want an English name, I want to see it like this: FishID | Swedish name | English name | Resident Is there any way to translate the Swedish name into English and put it in the 'EnglishName' column? < p> As long as you can use the API to insert the English version in your DB, if you have the list or the array ready to be inserted, it will be triple, but if you do not want to do something like this , Where you select all the rows and then make an original Form tables where you can put a list and English equivalent. exec ("SET CHARACTER SET UTF8");} Hold (PDOException $ e) {Echo 'Sorry' is a problem in the database connection: '. $ E & quot; getMessage ();} // Updates if posted Form ($ _ server ['REQUEST_METHOD'] == 'POST') {foreach ($ _ POST ['Ang Regi name

java - Records in DB are not one by one. Hibernate -

I have two column IDs: ID (AI) and NAME (UNIQUE). When I'm adding a new record for DB, then OK, this record has the ID = 1. When I'm trying to add a record with the existing name, I'm getting the error: com.mysql.jdbc.exceptions.jdbc4.MySQLInitgrityConstraintViolationException: Duplicate entry I want to add the next record, with valid data and this record has id = 3. Is there any remedy for this? I have an ID like this: 1 | 2 | 3 not 1 | 3 | 5 etc. Or should I first check that this name exists? Which option is better? My code: Public boolean save () {hibernate.beginTransaction (); hibernate.save (userObject); Committed to hibernate.getTransaction (). hibernate.close (); Back true; } There are different ID generation strategies if the ID is generated based on the sequence When the "final price" is requested, its final number immediately increases. There will be no problem you have told, if the ID is generated based on the table.

algorithm - How to decide the sign of the permutation between two ordered set? -

Suppose A and B are two arrays of the same size and each without repetitive members. Is there any efficient algorithm that 1. decides that there are only one members in A and B 2. If the answer to 1 is true, then the determining the order of the conversion Which brings A You can convert A in B by using an extent table Are: pos = hash table (value -> position) b perm = [] for an A: if there is no position: return "not the same!" This part takes O (n) time required. Now you have to get a signal of ordering. You have at least two options: It's definitely possible in O (n log n) or better it's only linear It takes time Actually you can use cycle decomposition directly on your input arrays, which will give a nice and small implementation.

Handling multiple exceptions in java -

मेरा त्याग () फेंक सकता है AbandonException । अपवाद को संभालने में मुझे उसी विधि को याद करना होगा, अगर कोई तत्व vector में छोड़ दिया। मुझे कैसे आगे बढ़ना चाहिए? और अगर मैं सीधे सोच नहीं रहा हूं, तो सबसे अच्छा समाधान क्या होगा? यदि (i + 1 & lt; lc.size ()) {try {lc.get (i + 1) abondon (); } पकड़ (AbandonException e1) {lc.get (i + 2)। बांंडोन ();}} आप अंत में यहां इस्तेमाल कर सकते हैं। कोशिश {lc.get (i + 1)। बैण्डन (); } पकड़ (AbandonException e1) {} अंत में {आपका कोड}

android - Why "OnClickListener" is not working -

I do not understand why this simple code is not working. This code believes the color of the button is set to blue, all this is that I have just added a newly created project: last button btn = (button ) FindViewById (R.id.button1); Btn.setOnClickListener (New View.OnClickListener () {@Override Public Zero Click on (see V)} // click on btn.setTextColor (color.BLUE);}}}; Full code: package com.example.b; Import android.graphics.color; Importroid.os.Bundle; Import android.support.v4.app.Fragment; Import android.support.v7.app.ActionBarActivity; Import android.view.LayoutInflater; Import android.view.Menu; Import android.view.MenuItem; Import android.view.View; Import android.view.ViewGroup; Import android.widget.Button; Public Class Main Activity ActionBarActivity (Creates the bundled saved instenstate) on Protected Zero {Super.Creative InstantState}; SetContentView (R.layout.activity_main); Find the last button BTN = (button) VVBIID (R.B. button 1); Btn.setOnClickListener

ruby on rails - Quickblox configuration for a new environment -

मैं Quickblox ruby ​​gem का उपयोग कर रहा हूँ अब मैं एक अलग क्विकब्लॉक्स खाते (विकास, बीटा, उत्पादन ... आदि) से लिंक करना चाहता हूं। वे config.yml का उपयोग करते हैं, तो क्या मुझे वहां मेरे अलग वातावरण कॉन्फ़िगर करना चाहिए? मेरी config.yml: डिफ़ॉल्ट: & amp; डिफ़ॉल्ट Quickblox: application_id: 12345 auth_key: xxxxx auth_secret: XXXxx सर्वर: api.quickblox.com user_owner_id: 1 विकास: & lt; & lt ;: * डिफ़ॉल्ट परीक्षण: & lt; & lt ;: * डिफ़ॉल्ट मेरा प्रयास काम नहीं कर रहा है। इसे बाहर की सीमा है, वे यमल फ़ाइल लोडिंग को कड़े कोडित प्रारूप। मैंने उनका रत्न अद्यतन किया और अब काम करता है।

Dart and package root -

I'm playing some code using the DART VM from the command line. The command is: DART - check-package-root = / dART / package_ test_service.dart Although I get an error: gf_service.dart ': Error: Line 7 Position 1: Library Handler Import' Package Begins: Start / Start 'as Startup; I'm confused with the DIR referenced by "pocket-root" argument, of course, looking at the "Start / Start Data" file, so it exists. The package-root folder is also correct. Is there anything I remember? Thanks Normally you -package-root argument is not required, but the directory containing the script file should have a symbolic link to the package directory of your package. Pub find should create these simulations

Write a parallel array Haskell expression once, run on CPUs & GPUs with repa and accelerate -

Image
Repo and Accelerate API similarity The CPU has a Haskell Ripa Library for the automatic calculation of parallel array . There is automatic data parity on dynamic library GPUs. The APIs are quite similar, with the same representation of the N-dimensional array. Between Quick and Ripa arrays with any fromRepa and toRepa with Data.Array.Accelerate.IO : Can switch. Repeat from (shapes, alt, e) => Array A Sh E - & gt; Array sh 'e toRepa :: size sh sh = = & gt; Array sh 'e - & gt; ARAE AHE There are many backend to accelerate including LLVM, CUDA and FPGA (from which see Figure 2). I have seen one to speed up, though the library does not seem to be maintained. Given that the repo and the programming models at a faster pace are similar, I hope that there is a great way to switch between them. A once written function can be executed with R.C.C.P.PPP or with a fast backend, e.g. With CUDA function Two very similar functions: rip and sharpen a pumpkin

php - Laravel delete action inside foreach loop -

For each of the results displayed, I want to remove an affiliate action. > (* 'path' => Array ('collection', $ warning-> ID), 'foreach loop I have: < Former> role '= & gt;' form '))}} & lt; Table class = "table-table-responsive" id = "alert" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; th class = "header" & gt; Id & lt; / Th & gt; & Lt; Th class = "header" & gt; Collection & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; @Vernak ($ ​​Warning-> Alerts as Alert) & lt; Tr & gt; & Lt; Td> & Lt; Button type = "submit" class = "btn btn-warning" name = "archive" & gt; Collection & lt; / Button & gt; & Lt; / Td> & Lt; / TR & gt; @earnchach & lt; / Tbody & gt; & Lt; / Table & gt; {{Form :: Closed ()}}

racket - Scheme maxing a quoted list -

Then I wrote this function that lists the numbers in this format: '(1 2 5 6 7 2) Now I need to get the maximum value of this list, but the maximum function does not work with this type of list. what do you want & gt; (Maximum 1 2 5 6 7 2) 7 Since your argument is in a list, use Apply : & gt; ; (Apply maximum '(1 2 5 6 7 2)) 7 See also

osx - Can gnu utils on Mac such as gobjdump parser Linux ELF binary? -

So basically I have some ELF binaries that are compiled on Linux 32 bit. And I want to analyze it on my Mac 64 bit. I am trying to use gnu utils like gobjdump and greadelf installed by homebro. However, when I tried to pulsate Elf Binaries using GoGdspump, I found this error: : gobjdump: Hello: The file format is unclear gobjdump : Match format: elf32-i386-nacl elf32-i386 So my questions are: Is it possible to analyze 32-bit Linux ALF binary compiled Macs on their gnu utils Use? How to do this if possible? Yes, to specify the object code format, - target = bfdname option. Maybe you want the option elf32-i386 . gobjdump -x --target = elf32-i386 hello reference: man gobjdump

c# - Does it make sense to use an object hash code as a memory cache key? -

I am trying to cache the result of an expensive function in the MemoryCap object. Memory cache is a string that requires a key, so I was thinking that it was valid for the following: string key = char.ConvertFromUtf32 (myObject .GetHashCode ()); If (! _resourceDescriptionCache.Contains (key)) {_resourceDescriptionCache [key] = expensive work (myObject); } Return (string) _resourceDescriptionCache [key]; This seems strange to any UTF 32 character as a key for a potentially large cache. It depends. There are many cases where using GetHashCode () may be inaccurate behavior: The purpose of a hash code is to look at efficient entry and collection that is a hash A hash code is not a permanent value based on the table for this reason: Do not serial the hash code values ​​or store them in the database. Do not use the hash code to retrieve an object from a key store. Do not send the hash code to application domains or processes In some cases, hash codes can be calcul

bit manipulation - Alt answer to classic bitwise 2^n test: valid? -

Quick question: I used to test single-n for format 2 ^ n (n> = 0) Press the line expression. See: An associate came up with this unorthodox answer: ((n-1) xor n == 2 * n - 1 ) & Amp; Amp; (n! = 0) I used a test to test it, and it seems right. I almost tested almost n = 10000 Does anyone see any problem with this solution? I can not find this reference online. Thank you! - David In fact you all input (For example, using an SMT solver) should be tested. There are 31 cases in which this formula is correct even though n does not have the power of two, in cases where the top bit is set, apart from some other bit. For example, 0xC0000000 or 0x80000001. n ^ (n - 1) A known method is "Remove the right set bit and tidy it to the right". Among the cases I have described, n * 2 - 1 is one of the same mistakes, the upper bit is moved and the smear on the right side of -1 (because bit now One is on the left side where it was to be).

json - C# Property Named Event -

I am using Jason Serializer and need to bind property by the name 'Event', of course the event is in C # If there is a keyword, do something like that string event {get; Set; } is not allowed anyway what about doing so? I can not change the name of the object coming back. Assume that you are using Jason .net, you can use, or , Or (an underlying one that camels things, so a property name for event will be named event .). [Jasonproperty ("Event")] Received Public String Event { Set; } Public string @ event {get; Set; } Public string event {get; Set; } Var s = JsonConvert.SerializeObject (myObj, New JsonSerializer Settings [Contract = New CamelCasePropertyNamesContractResolver ()});

operations - SQLite arithmetic between columns of different tables -

मेरे पास ऐसा बयान है: चुनें f.column1, 0.9 * sum ( s.column2) पहले से एफ, दूसरा एस जहां एफ colum1 = f.column1 * 0.9 * योग (s.colum2) असल में मैं क्या करना चाहता हूँ कॉलम 1 में 'प्रथम' तालिका, 0.9 * योग (एसक्यूएल 2) से, अर्थात् दूसरी तालिका के कॉलम 2 में 0.9 अंकों की गुणा में मूल्यों का योग। मैंने अपने आप में राशि * 0.9 भाग का परीक्षण किया और यह काम करता है लेकिन यह WHERE स्थिति के बाद काम नहीं करता है। क्या कोई मुझे यह करने का उचित तरीका बता सकता है? अभी मुझे जो त्रुटि मिल रही है वह है: बयान तैयार नहीं कर सका (1 कुल योग का दुरुपयोग: sum ()) < div class = "post-text" itemprop = "text"> आपके लिए इसका जवाब HAVING के बजाय WHERE का उपयोग किया जा सकता है: साथ में एफ (चयन 12 के रूप में कॉलम 1 से दोहरा), एस एएस (चयन 33 एएस कॉलम 2 से दोहरी) चुनें f.column1, 0.9 * SUM (s.column2) f से, f.column1 = f.column1 * 0.9 * योग (s.column2); लेकिन कथन का क्या विचार है WHERE f.colum1 = f.column1 * 0.9 * योग (c.colum2) ? यह पहले कॉलून में पं

java - Netbeans swing not displaying components correctly -

Hello my laptop with Windows 8 64 bit this is a weird problem i like Netbeans swing components are not showing correctly You can see that the text is not clear (HOST, connect button, disconnect button) and I can not find any reason for this. I thought maybe this is a problem with Netbeen 8.0, so I tried installing 7.3 and I had the same problem with the installer. (Next button and other text) I am using NetBean 7.3 on my desktop, Windows 7 32 bit is not such a problem. Can you help me Thank you Solving this problem is running NetBeans IDE using a high-performance NVIDIA processor Integrated graphic Card You can select that option in Windows 8 by right-clicking on the NetBeans IDE icon before starting it, then hover over the run with the graphic processor and select your high performance graphic card.

vb.net - Return a single record from a SQL Server Stored Procedure, or use output parameters -

I am sending an order number, which is unique, from VB.NET to SQL Server through an archived methodology . Related records appear in the process table. I value the selected areas of that record in VB I want to return to the net. I can use it output parameters, which means that I have to define them in the process and then again in VB, or else I can return that single record and put it in a figure, then typing I can remove the values ​​to avoid Is there any reason that I should stay with the output parameter? In your simplest scenario, I do not think the output parameter needs to be used. In addition, if your returns Value is just a single record that is the result of the final selection statement from your stored procedure, so you do not need the datatable (more than one record) infrastructure. dim cmd = New SqlCommand (procName, connection) cmd.CommandType = CommandType.StoredProcedure dim Reader = cmd.ExecuteReader () while Reader. Read () TextBox1.Text = reader (0) '

Sorting array java -

Hello friends, I have a problem in my program, I have to call class and whether to write numbers in main parameters, To tell how many numbers will be printed and they should be the biggest one, the problem is that when I print some random numbers, if they are equal or some negative then they show only once and sometimes This is the biggest If it is not clear, then I will post code and an example. (A = 0; a & lt; array.lampper; a ++) for {for (b = 0; b & lt; array.length-1; b ++) {If (array [b] & gt; array [b + 1]) {aux = array [b]; Array [b] = array [B + 1]; Array [B + 1] = aux; } I have used this code to sort them but I do not know it's okay. Ps: I can not use simple methods or objects just simple arguments. I think that you have left some brackets here and there First of all compare your if (array [B]> array [B + 1]) sort the highest to the highest. If you want it to be the highest to reduce, then you would want to change to if (array [B]> a

where to hash form data before saving the model in createview in Django? -

I am a bit confused where the formal / model field can be validated in Generic Creatives / Update Weave. Below on my imaginary models, I have to be washed using field custom secret using my custom hash function and some validation has been assumed for the secret field (examples below I have options to do this: 1) Method of saving method (I did not show it below) 2) Method of saving form In (I have shown below) < 3) form_valid method 4) How can I enter cleaned_data in the generic view ( cleaned data only code> form_valid ) Which is the correct way to do this, both sides and the opposition I will use the same form for the updateView In that case, I will ignore the secret before displaying its data on the form. Where should it be? My model: class account (models.Model): user = models.ForeignKey (user) created = models.DateField (auto_now) = True = models.IntegerField () My form: AccountCreateForm (forms. Secret = forms .Keyfield (max_language

java - ExecutorService schedule single task only -

I am working on a bot that does some stuff at specified change intervals. The user of the application, whenever he works in the GUI, has the option to do the stuff. Although it is said that the main function then calculates the remaining time until the next item should not be made and it passes the scheduler. In addition, the application should be capable of running very long. Public Ultimate Class Bot {Private Scheduled Future (While writing this, I was under the assumption that mainHandle will only schedule the latest work - but this is my first time with scheduling. . And I am amazed.) The code works, but every time when the is called the main function () , a new task is created on the top of the previous work ( Usually with the same delay)). This app is unwanted by the user to work with every manual call () , I just want to keep "the latest" and want to discard the old ones. What would be the best solution to my problem? I would like to keep the soluti

css - Creating a Foundation-style Block Grid in Bootstrap 3? -

In Zurb Foundation 3+, they have a CSS of "Block Grid" which is an ornord list where you specify Can number of objects in a row There is no such way that I can see in Bootstrap 3; Only columns are I would like to have the ability to easily display a duplicated element (such as a LI) as a responsive grid, where I can specify how many breakpoints according to the Foundation. I can do my own role, but wants to see if anyone has been suggested or had come here earlier. I also wish BS3 had this feature. You have to make your own solution. By using percentages to define the width, the null-hair selector and the adjustment margin, my normal actions are the same way. [class * = "block-grid-"] {display: block; Padding: 0; Margin: 0 -0.55556rem; } [Class * = "block-grid -"]> gt; Li {display: Block; Height: auto; Swim left; Padding: 0 0.55556rem 1.11111rem; } .small-block-grid-3 & gt; Li {width: 33.33333%; List style: none; } .small-block-g

validation - How to make a program that verifies Card Security Codes in python? -

I want to create a program confirming card security code in Python (CSC, 3-digit security code on credit card) I am I want to write a simple program that checks whether a given code is valid or not. The code is valid if all three letters are entered between digits 0 and 9. If the CSC is valid, then I should say that it is a legitimate message and a different message is saying that it is not valid if the code entered does not include three digits. I wrote the following code but I know it is wrong. How can I write it but keep it short and simple? raw_input ("Please enter CSC:") if the code [0] limits [0, 10] and the code [1] limits [0,10] and the code [2] range In [0,10]: Print "Thank you. We will process your order!" else: print "The verification code was not valid. Please check your credit card code again." Appreciate your help! You can check to see if the length is correct: If len (code) == 3: and check to see that this is a number:

special character are not displayed properly in android webView -

Image
When I display a WebView page in my Android device (4.0) I think That particular character like ÃÆ'à à ⠀ ™ a is not displayed properly, like and this is my WebView code. Extends the public square browser activity {WebView ourBrow; String Address; @ Override Protected Zero (InstanceStat saved from bundle) {// Todo auto-generated method stub super. Connet (Saved Instantstate); setContentView (R.layout.browser); Try {getActionBar () SetDisplayShowHomeEnabled (wrong); } Hold (Exception E) {} Try {ourBrow = (WebView) findViewById (R.id.wvBrowser); ourBrow.getSettings () setJavaScriptEnabled (true). . OurBrow.getSettings () setLoadWithOverviewMode (true); . OurBrow.getSettings () setUseWideViewPort (true); ourBrow.setWebViewClient (New Our ViewClient ()); OurBrow.setWebChromeClient (New WebChromeClient ()); OurBrow.getSettings () setSupportMultipleWindows (true). String url = null; Intent = getIntent (); Try {if (intention! = Tap) {if (intent.getExtras ()! = Null} {url

Sorting number string in ruby -

मेरे पास दो अलग-अलग संख्याएं हैं: "103" और "11" irb में: 2.1.1: 005 & gt; "11" & gt; "103" = & gt; सही 2.1.1: 006 & gt; "11" & lt; "103" = & gt; गलत ऐसा क्यों होता है? मैं समझता हूं कि प्रत्येक स्ट्रिंग के लिए मैं .to_i में जा सकता हूं, लेकिन यदि यह एक रेल क्वेरी है जहां स्तंभ प्रकार स्ट्रिंग है, तो मैं इसके बारे में कुछ भी कर सकता हूं? स्ट्रिंग्स को सॉर्ट किया गया है जिसका अर्थ है कि "1" "0" के बाद आता है, और "103" पहले आता है। "11", और "1122344" से पहले और "1 बीसी" से पहले। आप स्ट्रिंग्स की तुलना नहीं कर सकते, जैसे कि वे संख्याएं हैं, आपको उन्हें ऐसा करने से पहले संख्याओं को पार्स करने की आवश्यकता है। एकमात्र तरीका मैं सोच सकता हूँ, यह सुनिश्चित करने के लिए कि वे स्ट्रिंग में बदल जाने से पहले पर्याप्त शून्य के साथ गुदगुदी हो जाएं: "000103", "000011" ...

java - JApplet RuntimeException -

I have created an applet that works perfectly in Applet Viewer. I have put it in the HTML code but when I open it, I get an error: runtime expansion java.lang.NoClassDefFoundError: javax / persistence / persistence What should I do? It will be necessary to include continuity on applet's run-time class-path Class. To do this, place it in code base similar to applet jar, and refer it to a separate list with a comma in the archive attribute element.

sql - Union to already massive table vs. create new table -

I have a table that I use to create reports using powerpivot in Excel. The table has 30 columns and ~ 2m lines, and due to this huge # column and rows, the excel file is already ~ 20 MB (and yes, I use every single column in that table). The business has asked Excel to add a new data, which will add three new columns and ~ 1M lines. I am worried about what will happen to affect my excellence and size. Unfortunately I can not join because the current table has a different hierarchy level I was thinking of modifying the stored procedures of the current table in that table, to improve the table, the new table Rather than dragging, join the new Powerpivot data model. What is the "better" approach here? Can a union be included within SQL or a union within SQL? Do <- do not feed Excel with large scale union-style tables to do a pivot questions. Already being invented for the same purpose. Excel may connect to this kind of data source for a while. The name changed s

Use cookies in non-browser clients e.g Php - Android -

How do I use cookies in non-browser clients to maintain session and other information (for example Php - Android). / P> My site is working on the basis of cookies to maintain the state, now that I am writing web services for mobile applications, it is known that the site is treating every API call As if they are coming from a unique user, as the absence of cookies How can I use cookies between PHP (web service) and Android application? If you want to keep watch, you should call PHP-SESSIONID on each call to your web service. The cookie will continue, as long as you want to keep this session alive. And other cookies are also set and sent manually on every request or when using the cookie handler.

sql - Suppress Columns with Null Values in Pivot Table -

The Hare people combine 3 tables in a pivot table to display the following queries basically in the form of the Staffrerence Code, Headers and WipAmount. . This code has been exhausted because it runs properly, though I want to suppress any column in which all fields are taped, it will be easy to read the report Example of the current output -------- ejh ----- aea-- --- firm as ---- tap ---- 10.00 ---- 6.00 fm --- null ----- 5.00 ----- Tap AIA --- Null ----- Tap- --- 7.00 For example, what do I want: ------- aea ----- fum ejh - 10.00- --- 6.00 fm --- 5.00 ---- blank AIA --- blank ----- 7.00 < / Code> Actually, if any If the value is filled with zero values, then leaving that column I have a query below. This query works and displays all the correct data declar @ sql varchar (MAX) DECLARE @ Insert the column table (col varchar (50)) @columnscsv varchar (MAX) in @columns; select separately from StaffCode: tblStaff @columnscsv Selection = COALESCE (@columnscsv + '

Where is org.gridgain.grid.GridRichNode in GridGain 6.0.3 -

I did not find GridRichNode in GridGain 6.0.3, is there any option for this class? Grid Reichondade was removed in grid-gun 6.0.3 to remove the duplicate between the Grid-Nain and GridReChannod API. To achieve the same functionality for GridRichNode, you now have to get projection on a specific node , Such as: GridNode node = ...; // Get a Single Node Grid Projection NodePrince = Grid Force node (node); // Send message to specific node. nodePrj.send (...)

unix - Reading Incoming Mbit/s in plaintext with Perl -

I can not find any solution for this, I want to read the incoming MBT / S on the interface in Perl. I am just trying to report Perl script as MBT / S: 9.66 It will be as if I have a network of 9.66 MB / s. I tried to use VNNastat and parse the characters. But no benefit. If you are on a Linux system, then there are usually sub directories in / sys / : / sys / class / net / eth0 / statistics If you can depend on that current constant (/ sys /) in kernel 2 , Then you should be fine), "files" in that directory can be used to create some statistics on the interface, including incoming (Rx) bytes in that interface. Here is a extremely crude example: Usage list :: UTL qw (amount); My @bytes; (1..11) {open (FH, "& lt;", "/ sys / class / net / eth0 / statistics / rx_bytes") or die $ @; Push (@bytes, & lt; fh & gt;); Sleeping 1; Close (FH); } My @bytes_per_second; (1..10) {my $ diff = ($ bytes [$ _] - $ bytes [($ _ - 1)]); Push

html - make submenu wider than main menu -

I have a submenu and I want that when the dropdown menu is out, it has a width of 100% full page . At the moment, if I change the width to 100% then it does the same width as the main menu. This is my current HTML: & lt; Header & gt; & Lt; Div class = "header" & gt; & Lt; Div class = "nav" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "services.html" & gt; Services & lt; / A & gt; & Lt; Ul class = "sub" & gt; & Lt; a href = "services.html # branddesign" & gt; & Lt; Li & gt; & Lt; Img class = "imgcenter" src = "picture / brand-design-circle-blue png" width = "100px" /> & Lt; Br> Brand design & lt; / li & gt; & Lt; / A & gt; & Lt; a href = "services.html # brandonline" & gt; & Lt; Li & gt; & Lt; Img class = "imgcenter" src = "picture / brand-o

php - Use variabile $_global on remote server -

I want to include variabile $ _GLOBAL on many websites that do not host in one place Are there. Or include a file that contains some functions on various servers on different servers Everything is done remotely. I think the file should be placed on websites where websites are kept, there are 150 websites. Sorry for me bad english If you want to host a data, use databases . If you want to host some remote tasks, then create a server and create an API so you can call all the tasks remotely.

plsql - Exception handler not raising -

** Updated errors have been fixed, but it still does not work as I want. I need to create a user defined exception handler which does not allow zero values ​​to be included as the cost of the item, but missing_cost is not running due to some reason. I have set user_id and item_cost to define the user but I think it is not passing correctly? The tables are: pitem {item_id number; Item_name character (20); Item_desc char (20); Retail_price number (10, 2); Item_code number (10,2); Category four (10); } and ... pitem_audit {item_id number; Message four (80); } Thanks in advance! In the form of update_item_cost (iItemId INTEGER, fNewcost NUMBER) create or change fCurCost NUMBER (10,2); Missing_cost EXCEPTION; Item_id pitem.item_id% Type: = & amp; item_id; Item_cost pitem.item_cost% Type: = & amp; item_cost; Select item_cost in fCurCost with pitem where item_id = iItemid; If fCurCost is null then increase the wrong_coast; Else updated pitem item_cost = fNewCost w

html - LESS & Bootstrap Wont Compile -

I'm fairly new to reducing, but I think that's my right idea. However, I can not get to compile less. I have now downloaded 3 compilers (Decrease, Ease, Winfield) Command I get an error Compiler errors variables @ navbar-default-bg Undefined (line: 15) WinLESS - I get "success", but CSS has not been generated. Simple - just not build or error, nothing happened. This is what I am doing. I have a Cerulian bootstrap template. You can download bootswatch.less & amp; They make Zero amendments for me. I understand how it works (and best practices) I import my CSS and fewer files into a lower file, which then less compile and takes CSS into a CSS. net page I have called this file "IMSLess.less" which looks like this .... @import "bootstrap.min.css"; // xxxxxxxxxx@import "variables.less"; // xxxxxxxxxx@import "bootswatch.less"; // xxxxxxxxxx Import of Bootstrap.min.css template, 2 united after fewer files

php - Split string by white-space -

How can I divide a string from white space, it is not known how long the white space is? For example, with the following string: "Quick brown fox jumps on lazy dogs" I will get an array ['The', 'Quick', 'Brown', 'Fox', 'Jumps', 'Over', 'D', 'Lazy', 'Dog']; You can use regular expressions to do this easily: $ string = 'Quick brown fox jumps over lazy dogs'; $ Word = preg_split ('/ \ s + /', $ string, -1, PREG_SPLIT_NO_EMPTY); Print_r (word $); This produces this output: array ([0] => [1] => immediately [2] = & gt; Brown [3] => Fox [4] = & gt; Jump [5] => Over [6] => [7] => Lazy [8] = & gt; Dog)