Posts

Showing posts from May, 2013

erlang - How to create a rebar repo? -

I want to create and deploy ARLing files which will be used as dependencies in any other project. Basically I am looking for a MVN deployment and a Sonipat repo. How can I set it up with Rebore? To create dependency, which Riber can understand, you can specify a .app.src The file must be placed in a src directory. Take a look - I have the file src / estring.app.src with my actual source file. Any other project that requires estranging, I have some of this in my rebar.config: {deps, [{estring, ".", {Git, "git: / /github.com /dweldon/estring.git "," HEAD "}}, ...

java - Can we create an Array of Generic class? -

संभव डुप्लिकेट: मैं 10 तत्वों वाले स्टैक बनाना चाहता हूं, मैं जेनेरिक के साथ ऐसा करने की कोशिश कर रहा हूं मैं टाइप टी की एक स्टैक क्लास बनाकर शुरू किया, लेकिन जब मैं सामान्य प्रकार की सरणी को इन्स्तांत करने की कोशिश करता हूं तो मुझे संकलन त्रुटि मिलती है। सार्वजनिक वर्ग स्टैक & lt; T & gt; {निजी टी [] Stk = नया टी [10]; } क्या मैं यहाँ गलत कर रहा हूं? आप ऐसा नहीं कर सकते कोड के बारे में कुछ गुप्त गोलियों का उपयोग किए बिना, और फिर भी आपको एक असुरक्षित कलाकार को अंत में करना होगा जो पहली जगह में सुरक्षित होने का प्रयास करने के पूरी तरह से पूरे कारण को नष्ट कर देता है। इसका कारण यह है कि जावा में type erasure नामक कुछ है, कम्पाइलर सभी जेनेरिक सूचनाओं को फेंकता है और रनटाइम को पता नहीं है कि T क्या है ऐसा करने का सबसे पसंदीदा तरीका यह है: @SuppressWarnings ("अनचेक") स्थिर & lt; T & gt; टी [] नए अर्रे (कक्षा & lt; T & gt; प्रकार, पूर्णांक लंबाई) {वापसी (टी []) java.lang.reflect.Array.newInstance (प्रकार, लंबाई); } यह सू...

jquery - In jqgrid, can I put the pager on the top left -

Image
When using jqgrid, I think I can add pager to the top by doing this: toppager: true, which works great, but I want to see that I can align it instead of putting it on the left side of that row. Is this possible? To place the pager element at the top position, you should have the default per top center just that left Hide which is located at the top left $ ('#' + grid [0] .id + '_toppager_left'). Hide (); Where var grid = $ ('# list') see for example: How to move different page elements between the top and bottom pagers of the description of another old answer You can. Gives some more general information about pagers.

vb.net - Why one over another: UBound or Length -

There may be a specific reason to choose a UBound plus length Could? Here is the code and the 1-dimension has passed as the second parameter. Any benefit against / code> [/ code> / P> They do different things! Ubound gives you the last indicator in the array, while length gives you length of time. Because usually UBound will be length - 1 .

html - Why isnt next:hover turning the text red? -

The class on the site should be .next: The hover text should be turned on "What next should GOPisWrong.com say?" Red on the hover, but it's not. Why? An inline style in which to get rid of color is the hover style Overriding: & lt; One square = "next" style = "margin-left: 300px; font-family: sans-serif; color: # 000000;"

c# - skip lines that contain semi-colon in text file -

How can I exclude lines in a text file, which is the semi-colon at the beginning of a line? I am currently reading a text file with a server name that works fine if a server is going in maintenance mode, I want to throw a semi-colon at the beginning of a line to comment on it. var rows = file. Read Line (Path); Foreign (different lines in line) {if (line strings (";")) {continue; } And {// your stuff}}

Want to increase Java Heap Size to 4GB+: Physical Memory 8 GB, JVM 64-bit -

I want to run a memory intensive package on a web server. The settings of the current computer are. Windows 7 64 bit 64-bit JVM RAM: 8 GB When I run EXPLUS CO-XMS 1024 M-XMX 2048 M -XX: I try: Maxim Sylez = 256m I am getting: An error occurred during the initialization of the VM, enough space could not be reserved for the object pile, the Java Virtual Machine Could make The post I read, it seems that I should be able to use more than 4GB when I ran the code of memory, then I was able to exclude memory at max-Xmx1200M And still be able to run the code. But what I want to accomplish, I need to use more memory. How can I increase memory size here? Thank you all for the issue that I was using the 32-bit version of JDK. After switching JDK to 64 bit version, I was able to run the memory in 2 GB. Thanks! The problem was that I was using the 32-bit version of JDK. Thank you, and thank you for telling Mr Smith that I should answer this and solve it.

MVC Partial Model Updates -

I often find myself in a situation where I just want to present and edit some fields from my model I have a model that represts an address, maybe I just want the form updating the city and post code fields (bad examples, but hopefully this scenario explains) I have two methods Out of the know: 1) Unwanted fields hidden in these Put it on the form in put elements, or ... 2) Create a dedicated visualization model that only defines the required field. I # 2, but the action of my controller is not a good way to merge data from the model to look back in the 'real' model. At the moment, I follow this approach ... 1) I record the record in a hidden area on the visual model 2) When the page is posted back, the controller retrieves the original record and i manually view each model for the actual model Model s Give each field 3) Save to the data store to the actual model. It works, but is it quite a work and an assignment / rescheduling and I was wondering if anyone had an...

javascript - JSON stringify objects excluding methods -

I am working on a Firefox extension and I am trying to strip a JSON object. I am using it, but I am getting this error: Javascript logic "NS_ERROR_XPC_BAD_CONVERT_JS" could not be changed I really care only about the first level or the two or the properties inside the object, and I do not care about the ways / functions if I do not have to do all this, then what to do to disturb an object An easy way? Here's a bit of code I'm using: var s = JSONstring ('ABC'); Try Firebug.Console.log (gContextMenu); S = JSON.stringify (gContextMenu); Firebug.Console.log (s); } Hold (e) {Firebug.Console.log ('error'); Firebug.Console.log (E); } Var s = JSONstring.make ('abc'); Firebug.Console.log (s); Firebug.Console.log (gContextMenu); The console window has this error: It is that I can copy from the firebug console window: Here is a screenshot of the object: You can define a custom function on your object which is called toJ...

ruby - zsh: correct 'puts' to 'tput' -

I have rvm and ruby ​​version 1.9.2 installed. Why do not I get Mac OS X 10.7? ('Hello Ruby') zsh: Right 'puts' to 'tput' [nyae]? Thank you! It seems that you want to enter the Ruby code directly, a shell prompt, which will not work Try the Ruby-A "(" Hello Ruby ")" and then learn how to write the actual Ruby program, e.g. With Chris Pine's "Program to Learn to":

rmi - How to set JMX remote port system environment parameters through java code for remote monitoring? -

Text after "div class =" itemprop = "text"> I have a program that needs dynamically (ie on run time) to open an available socket and have a JMX Let the agent begin. These JMX parameters are being set in Java code and not through the command line. It works fine after that it needs to be monitored (i.e. issue of jmx command etc.) away via java visual vm The RMI server in the program is based on the lines out of the agent agent management : I can summarize this question: How can such command line properties be set by the Java code at the system level, so that using remote profiling To be ?? -Dcom.sun .management.jmxremote.port = 1234 If "jmxremote.port" and other parameters are set through the command line Remote monitoring works fine, so goes remote. I am trying to find a way to do this through Java, not through the command line. The program can not specify the port via the command line because the new available port is runtime The proces...

c# - IEnumerable from object which is IEnumrable -

I have a way that takes (object value) and it's string with some difficult rules relates to one of those rules when the value is IEnumerable . In this case, I have to process each item on the following: public string convert (object value) {var valuetype = value.GetType (); If (value-typeGateInterface ("ILIT")! = Null) {var e = (INMONABLE; Lt; Object & gt;) value; Return E.Count () == 0? "": E. Selection (o = & gt; Convert (o)). Total ("", (c, s) => c + s); Of course, if the value is list & lt; String & gt; , for example, line var e = (IEnumerable & lt; Object & gt;) value; throw an exception Unable to remove type of object 'System.Collections.Generic.List`1 [System.String]' to type For 'System.Collections.Generic.IEnumerable`1 [System.Object]'. Any ideas, how can I get rid of it? something like var e = ((IEnumerable) value) .Cast & lt; Object & gt; () Although ...

r - How do you label a horizontal line when the x axis is categorical? -

Image
One shows how to label a straight line in R by using ggplot2. Please see Example 5 - "Rebuild the following conspiracy of the amount of flight by the longitude". If X-axis is clarified instead of continuous, how do you code? data = data.frame (x = - 119, y = 0) How to I have created a line + geom_text (AES (X, Y, label = "serial"), data = data.frame (x = 1, y = 20), size = 4, And I tried several options data = data.frame (x = 1, Y = 20) data = data.frame (x = factor (1), y = 20) #where gard is the name of a data in categories = data.frame (x = "gard", y = 20) ... but I get an error Invalid argument for inappropriate operator It is not completely clear what you are trying to do, because you say that you try to make a line, and then your code geom_text Using a specific x variable, assuming that you want to keep a vertical line, with a text label on the vertical line on that line, here is a simple example: dat & lt; - da...

java - Upgrade Hibernate version in JBOSS -

My version of my hintern (and that's what Jabos brings Then I posted my deployment " ", Which includes a jboss-app.xml file in the ER, which contains the following: & lt; loader-store> com. Example: archive = unique-archive-name & lt; loader-repository-config & gt; Java2ParentDelegation = false & lt; / loader-repository-config & gt; & lt; / loader-store & gt; & lt; / jboss -AAP & gt; And as usual, I firmly persuaded my persistent entity to form a hibernate To declare: & lt; persistence & gt; firmness-entity name = "myapp" & gt; & lt; provider & gt; org.hibernate.ejb HibernatePersistence & lt; / Provider & gt; ... But then, the worst is. On deployment, the server throws the ClasslessExtension when it org.hibernate. Ejb.HebernatePersistence attempts to put the JPA interface on javax.preistence.spi.PersistenceProvider (which is implied by Hibernate Precision). This is a type...

c# - How do I clear System.Net client DNS cache? -

I am using .NET WebRequest while changing my HOSTS file. I see that System.Net does not respect those changes - how can I do this? I have load-balanced multiple servers behind a hostname, we say 'example.com'. I want to target many of them individually, so my program will give a hard code to machine-specific IP addresses in my hosts file before sending the request to example.com: 163.56. 0.34 example Com For the first server and the first request, it works fine. Then my program replaces the HOSTS file again: 163.56.0.48 example.com And I create a new HttpWebRequest when I send it one , Then I can see in Netman that it goes to the first IP address (163.56.0.34) instead of the expected second place. By using breakpoints and debug traces, I have confirmed that the correct value of the HOSTS file is written every time when I try to reach example.com from a browser or other program, HOSTS respects the file and goes to the other IP address. I have verified using...

.net - Fluent nHibernate AutoMapping & ID Generation Scheme -

How do I use Fluent NHibernate (with automation) to configure Guid.Comb to use the default ID creation plan ? I can see that I can specify the following code in each unit (or base class): id (unit => entity id, "id"). GuidComb (); That's fine although it does not seem overlapping as the default behavior of setting I just want to know if I have a configuration The trick is missing. Thanks for any help You should use. This way you can define the default behavior that will be applied to all your classes (or conditionally, if necessary).

php - is it possible to use any html encrypter to encrypt paypal html code? -

I have a html salary button now (buy now) I have to host it on my own server and order security I want to do what I want to do, (a programmer who works in PayPal tells me what I have to do, so I can not argue with him) Now this button Just how does it work, I must encrypt it I'm googling for about 2 weeks or more, and I found many ways to get a job, but I want the best and easiest way to encrypt it, because I'm new to PayPal 's world so I I do not want to follow a tutorial which will take me a month to understand Standard HTML encrypts, what works? I suspect that but I have to ask it anyway. If there is an easy way to do this on the server side, then I would be happy What do I mean by ordinary? The code here is my button (I changed it a little bit but you can know everything that you should know) Input & Lt; / Tr & gt; & Lt; Tr & gt; & Lt; Td> & Lt; Input type = "text" name = "OS 0" max length = ...

delphi - Read a text file into an array -

How would I go about reading a text file from a file in a array in memory on the disk? In addition, I saw using Reed Lane that only the first line (this is obvious, because it is readline, but how do I go about reading the entire text document?) function readfile (conf filename: string): string; Var Strings: TStringList; Start String: = TStringList.Create; Try strings. Loadfilefile (filename); Results: = Strings. Text; Finally the strings. free; End; End; It gives the contents of the file in a string that can be indexed and such an array can be considered. Or maybe you want an array instead of string, an array of characters, from which it is easy to use the straight string list: string: TStringList ; ... wire: = TStringList.Create; Try strings. Loadfilefile (filename); // Now strings [0], strings [1], ..., string [strings.count1] can finally use strings. free; End;

php - jQuery AJAX POST to allow form data sending without page redirect- how to then insert data into mysql -

text after "itemprop =" text "> I have written three tutorials, one on a php file to submit form data, one on one that has followed To do all of this in mysql table, and then on a jQuery AJAX page without redirection. The jQuery AJAX tutorial is here, as it seems that many people on this site can send forms without post redirects: In the case of receiving data through AJX I have been installed correctly, but the php mysql statement will not write data to the database. I used firebug to check that the data is happening on PHP, and this is what I think it is. I'm sure this issue is not one of the database connectivity, I think it is due to the format of the file which is being passed to the PHP file. Tutorial mix and matching was difficult for me; I need to open the string data that I created in the jQuery function? In a different form, the jQuery AJAX tutorials he mentions are 'other than the more advanced things you can do here, besides sending a...

exc bad access - EXC_BAD_ACCESS in location based app -

My app uses Location Manager After the UpdateService is shut down, I see the error above, and the delegator is set to zero. is. This code is: - (zero) Location Manager: (CLLocationManager *) Manager updated notebook location: (CLLocation *) from the new location location: (CLLocation *) Old location {NSLog (@ " Location latitude% f "newLocation.coordinate.latitude); NSLog (@ "Location Movement% F", new location.Cordinate.) Lame; If (& lt; app-specific-location-trigger) {if (ivSignificantChangesModeUsed) [[self myLocMgr] stopMonitoringSignificantLocationChanges]; Other [[self myLocMgr] stopUpdatingLocation]; [[Self-Meel MGR] Set DeliGet: Nile]; Self.myLocMgr = Zero; [Self. Navigation controller popToRootViewController is approximate: no]; } NSLog (@ "ApteDataOo: Leaving the place"); } This is on the console: ! [2011-09-01 17: 27: 31.245 Latitude: 37.754280 2011-09-01 17: 27: 31.245 Longitude: -122.197792 2011-09-01 17: 27: 32.051 Excluding U...

objective c - Fetch the smallest date of an object in CoreData -

I am facing the same problem, but @Deidelong's answer is not working for me To get a small date in the set of objects, I get the following error - [NSDT count]: An unspecified selector was sent for example > My understanding is that NSExpression 's max: support only NSArray s so I need another solution. @Deidelong suggested to use the ascending nssort descriptor , and I did this: NSFetchRequest * fetchRequest = [[NSFetchRequest alloc ] Init]; FetchRequest.entity = [NSEntityDescription EntityForName: Managed object contexts in NSStringFromClass ([GCSession class]): self.objectContext]; FetchRequest.fetchLimit = 1; NSSortDescriptor * sort = [[NSSortDescriptor alloc] initWithKey: @ "startDate" ascending: yes]; FetchRequest.sortDescriptors = [NSArray arrayWithObject: sort]; GCSession * session = [[self.objectContext executeFetchRequest: fetchRequest error: zero] lastObject]; Return Session Start; The problem here is that the session returned fro...

java - Maven compilation dies with "Killed" -

I am running a Maven2 compilation of a large Java project on Linux virtual machine compilation has failed with the following error "Compiled with X for debugging" [DEBUG] Source roots: [DEBUG] / Home / {...} / SRC / Main / Java [DEBUG] / Home / {...} / target / generated-sources / meta [INFO] 1377 source files executed in / home / {...} executed (and I promptly prompted the bash prompt I go back to) I think it can be: One Nax thing (I checked that my vomit - yes okay, 10000) A VM thing (this never a die / java cheese (never death like this Seen, usually just like memory errors and likes) Any ideas to reduce the idea? My first guess is that you are running out of memory, and the kernel is killing the compiling process.

sql - Oracle how to cast result of a select into a number as data for the next query? -

Suppose: select from where id = (select ID from B); Where there is a column a in the id table, and there is a varchar column in the id table b . How do I convert the result of to B to in a number? It looks like this: choose from where id = to_number ((Select ID from B)); choose from where id = (to_number (id)) select from ); BTW, if you have more than 1 or 0 rows in b then you = operator will be IN

ruby - Filter through text and return the strings that start with #? -

I currently have a text form (similar to Twitter) for users to post updates, How to filter by and return full strings that start at # (For example, if a user posts "Hello World! # Nob # RUB", I will get #Nob and #RBI back) I can save in DB column. Thank you very much for your help! You can exclude pattern-matching substrings from a large string, for example, # of Next WhiteSpace "Hello World! #Nob # RUB" .scan (/ \ # string # scan \ S + /) # to capture all subsequent characters. = & Gt; ["#noob", "#ruby"]

objective c - Multiple inverse relationships in Core Data -

I have an organization library which is in two lists of books. It is important that the library will create these two lists of books. keeps. I have a relationship with my library unit which is one for many people in my book unit from each list. Similarly, the book is related to "library", I am facing some problems with erasing my data from the database and I have read that to help with data integrity, I should establish a reverse relationship. In this case however, a book wants to be able to establish an inverse relationship with each list on my library unit. How can I do this? My first naive idea is to apply relations to both the lists. So a relation of a book is "libraryForList1" and "libraryForList2" so that it is inversion for each relationship. I will never have to mention these properties because, according to core data spec, if I add any one book from the library list, then it automatically takes care of setting the library as the owner of tha...

android - BitmapFactory.decodeResource return null in Emulator API level 5 -

I have this code @OrrideCreative on Public Zero (Bundle Saved InstantState ) {Super. OnCreate (savedInstanceState); SetContentView (R.layout.main); MImageView = (ImageView) findViewById (R.id.image); Bitmap MBITMAP = BitmapFranet Decresource (getResources (), ordrawable.con); MImageView.setImageBitmap (mBitmap); } This Android emulator works fine in level 6 but the amilator does not work in level 5, which was not dependent on the library level in my project. In emulator level 5, the bitmap factory decodeResource return null. How to fix it Try, place a drawable folder inside the res folder and place your icon.png image. res / drawable / icon.png And then you can try the code above.

c# - Preventing Hyperlink inside WPF RichTextbox from being edited by end user -

Image
I have a WPF hyperlink in WPF Rich Textbox, clicking on hyperlink results in opening a popup. But I want to stop the editing of hyperlink text. Initially it looks like But when the user makes a hyperlink edit, it looks like this So I want to stop this hyperlink edit. If you add it to a container, it can not be edited (but removed entirely ): & lt; InlineUIContainer & gt; & Lt; TextBlock & gt; & Lt; Hyperlink Navigate URI = "http://www.google.com/" & gt; & Lt; Run text = "google" /> & Lt; / Hyperlink & gt; & Lt; / TextBlock & gt; & Lt; / InlineUIContainer & gt; Would that be any good?

iphone - Canvas Drawing lines are very slow in phonegap with android -

I am using phogegap to develop my drawing app. When the user contacts and rotates the finger, so many lines can be drawn, but this app is very slow / confused with Android emulator and Android device. The same coding work is fine for the iPhone Simulator. Note: In the Android emulator I can see the following message: I [[Miss Drag] because we are waiting for the response to the webcams.]] Any suggestions. After installing the app on it, try to unplug the Android handset I have found that my app Generally very slow (even on a handset) when they have an active debugging session associated with the device In other words, just run the app without the debugger and see if it's any faster. The difference in the phone is not going to be as fast as the original application. If you are leaving the graphics intense stuff, then prepare to be frustrated ...

implement "android:textOff" & "android:textOn" property for toggle button programatically in Android -

I'm trying to change the default on and off text on the toggle button in Android. I know how to do this in XML. My query is how to get this program into code. Can someone please advise? thanks a lot. Use ToggleButton.setTextOn (string) and Toggleton. Settestoff (string)

firefox - Firefinder alternative -

Since upgrading to Firefox 6, one of my favorite extensions for firebug no longer works; Does anyone have a fire finder Know the option of? I am looking for a tool to highlight the DOM elements from CSS / XPAT selectors. The favorite is connected to the firebug. The firefighter has been updated, see.

iphone: Parsing while the app is closed. -

I'm developing an iPhone app that needs to be parsed data from the server. Parsing is fine. However, when the app is closed I need to show a change in position with the badge. When the app stops, I can not parse and therefore the badge is not visible. How to parsing the app off? You can not, you will be able to start background progression for parsing, but not me Looks like you'll be able to update app badges Look at the documentation on background code execution:

gridview - Setting a footer without GridViewCommandEventArgs in asp.net -

I have a gridview. The footer is labeled. I need to set the label within a function..I do not have any E (GridViewCommandEventArgs) due to no such occurrence of it now. This is my code `GridViewRow footer = (GridViewRow) CartGrid.FooterRow; Label total = (label) footer Fund Control ("Total Elblatt"). Text = sum.ToString (); ` I'm getting the error - & gt; 'Object is not set to an instance of reference object.' CartGrid is the gridview. The label for LBL total is the label Yoga . You can use or for event example, Zero to CartGrid_RowCreated (Object Sender, GridViewRowEventArgs E) {if (r.Row.RowType == DataControlRowType.Footer) {...}}

viewmodel - INotifyDataErrorInfo reusable methods -

I am using MVVM-Light and for each visual model, I have to implement INotifyDataErrorInfo which is similar in some cases Uses ways to validate the same property types In this example, I am using date time: using the system; Using System.Collections.Generic; Using System.ComponentModel; Using SL.Resources; Namespace SL.ViewModel {public partial class AdministrationViewModel: INotifyDataErrorInfo {#region verification public void isDateToValid (? Datetime value DATETIME, dateFrom, string property) {// check if null if (value == null) AddError (property, CommonErrors .DateNull_ERROR, False); Else RemoveError (propertyName, CommonErrors.DateNull_ERROR); // If the minimum and check the maximum value (value & lt; DateTime.MinValue || value & gt; DateTime.MaxValue) AddError (property, CommonErrorskDateNotValid_ERROR, false); Else RemoveError (propertyName, CommonErrors.DateNotValid_ERROR); If (value & lt; dateFrom) addError (propertyName, CommonErrors.DateFromSmall_ERROR, i...

vim - Text flashing in GVim as I type (Windows) -

This is not really a big issue, but still is upset; When I'm typing in GVM on my Windows box, the words I write can occasionally flash me while writing. This is not true for Vim sessions in the booklet, and I have never seen this behavior when I am running GVM in Linux, but I have seen it on many other Windows setups. I am thinking that the problem is that GVM will not present the word until it will not know what the highlighting is to use syntax, because flashing disappears if I I disable highlighting. But not using Syntax highlighting is not something to think about a solution;) Is anyone else experiencing the same problem? Thanks in advance! :) I really had the same problem ~ ~ _vimrc, copy all the items and give them ~ _gvimrc Put it in, it is supposed to work though why not

ios - Does NSFetchedResultsController Observe All Changes to Persistent Store? -

मेरा प्रोग्राम नीचे दिए गए लिंक की तरह कार्य करता है: दिखाएं UITableView के लिए NSFetchedResultsController का परिणाम वेब सेवा से नई वस्तु हो और कोर डेटा को संग्रहीत (एक ही दृश्य नियंत्रक में, RestKit साथ) NSFetchedResultsController प्रतिनिधि की अधिसूचना के साथ अद्यतन तालिका दृश्य NSFetchedResultsControllerDelegate के कार्यान्वयन से एप्पल के कोर डाटा परियोजना की नकल की और है मेरी predicated है: [NSPredicate predicateWithFormat: @ "isMyTest == सही"] संपत्ति अद्यतन असत्य को सत्य से चला जाता है, यह tableview से पंक्तियों को हटा (क्योंकि पंक्ति के लिए वस्तु fetchedObjects में है) हालांकि, अगर संपत्ति अपडेट FALSE से TRUE तक जाता है, तो NSFetchedResultsController कुछ भी सूचित नहीं करता है, इसलिए नए डेटा तालिका दृश्य में नहीं देखा जा सकता है अगर मैं दोनों NSFetchedResulsController और UITableView मैन्युअल रूप से अपडेट करता हूं, तो यह नया डेटा दिखाता है मैंने सोचा कि NSFetchedResultController निरंतर दुकान में सभी परिवर्तन देखता है, क्या यह बहुत बड़ी उम्मीद...

database - Multiple aggregates from same sub query in SQL Server -

Is there a better way of doing this without repeated sub queries that select a different field? select name, er.DateEventStarts, e.LocationName, (select count (*) from tickets T where went to TkDeleted = 0 and return = 0 and t. EventRepetitionID = er.EventRepetitionID) as NoOfAttendees, select (sum (t.TicketTotalCost) where tickets T went to TkDeleted = 0 and return = 0 and t.EventRepetitionID = er.EventRepetitionID) as NoOfAttendees select ticket t (amount (t.OnlinePayFee) Where t.Deleted = 0 and return went to = 0 and t.EventRepetitionID = er.EventRepetitionID) (amount as OnlinePayFee, ticket T (TkOnlinePayTotalCost Select where) t.Deleted = 0 and use It went to Mr. = 0 and t.EventRepetitionID = er.EventRepetitionID) OnlinePayTotalCost the [event] e Join er.EventRepetitionID = on EventRepetition er (where select ER2 EventRepetition top 1 EventRepetitionID er2.EventID = e.EventID) I am sorry if it has already been answered but I can not think of a way to describe this problem...

Android listview columns based on spinner's selection -

One more question I have. I have created a screen that includes a spinner and a list view. The spinner only takes 2 values ​​and the ListWeave is transformed according to the spinner's selection. The problem is that I want to keep 2 or 3 columns (based on spinner selection) in the list, how can I get it? Or to say in other words, is there a way to hide / show a list view on the fly? In advance thanks You list elements of 3 elements as a child Together there can be a tablerow. Another option might be to use a gridview if you want a column instead of a list view or column.

java - Why do I get org.hibernate.HibernateException: No CurrentSessionContext configured -

I am writing a simple project, a professional app written in the swing using hibernate for back-end . I came from Spring, which gave me easy ways to use Hibernation and Transactions. Anyway, I managed to work in hibernation. Yesterday, while writing some code to remove a bean from DB, I found this: org.hibernate.HibernateException: Invalid attempt to associate a collection with two open sessions The deletion code is simply: session cs = hibernate utility.jet session (); Transaction tx = sess.beginTransaction (); Try {tx.begin (); Sess.delete (IMS); } Hold (exception e) {tx.rollback (); Throw e } Tx.commit (); Sess.flush (); and my HibernateUtil.getSession () : public static session getSession () throws HibernateException {session session = null ; Try {Sess = sessionFactory.getCurrentSession (); } Hold (org.hibernate.HibernateException that) {sess = sessionFactory.open session (); } Return Cess; } Additional details: I do not close a hibernate session in my code, ...

Include server-side javascript in PHP -

I have an old ASP project in PHP5 which was using a lot of server-side JavaScript. Is there a way to use that code or should I have to rewrite everything in PHP? Edit The code in the ASP is embedded The snippet of my helper.js - & lt; Script language = javascript runat = server & gt; // Here are the functions & lt; / Script & gt; Then it appears in ASP that the function is called normal, that is BTW, if I have to type the code again, then I will do it on my own, will not use any software The answer is "You have to rewrite everything in PHP" PHP is not like it is javascript reusable on the server side In addition, auto code changes are very few: cleanliness takes more time than everything from start to finish . However, you can run server-side javascript code with tools like nodes.js and backbone .js. There is no mixing with PHP code, although these projects can provide themselves, non-php-compatible, web-server.

Android(Java) - How can I do a async loading of linked list -

I have a list of items and I want to load an asynchronous list for the list, more, load me Depending on the scrolling position, by 10 (or 20, for example) elements, please help me do this work. I am starting and I am very sorry for my English. Take a look at

sqlite - Regarding fetching data from database in android application -

I am developing an Android application in which I created a database called HeadShop when I run the code It crashes crash down if it crashes: 09-02 14: 29: 36.441: error / Android runtime (14984): java.lang.RuntimeException: unable to start activity ComponentInfo {com.redorange.database / Com.redorange.database.HeadshopDatabaseActivity}: android.database.sqlite.SQLiteException: Table HeadTable already exists: Create table headset (_id whole No primary key autoincrement, name text redundant grade text NOT NULL, description text is not zero); 09-02 14: 29: 36.441: Error / Android Random (1494): Android. App ActivateTrade.Perform Launch Activity (ActivityTrad.Java1622) 09-02-14: 29: 36.441: Error / Android Time (1494): App Activity on Android. Activity ActivityJava 1638 Can anyone help me in this regard? I have coded for excited SQLite example. Its crashing because you are already trying to create a table existing. Modify your table. create [temp] sarak [if not] tbl_na...

javascript - JQuery plugin scope problems -

I feel a little ignorant, but I think some education will not hurt me. I have simplified my code to outline the problem - the problem is that when Fu () is said from within the init method, it is believed that the Worldwide, A, B Can not use C and settings. These laws are defined outside the field, so why are they not reachable? For example, the settings are clearly defined before the foo call, so why not see the foo setting? (function (jquery) {a = new date (); var b; var c = 1; settings = 0; // here or not - same issue var methods = {init: function (Settings) {c = $ (this); settings = jQuery.extend ({id: Math forrest (Math.Random) * 1001), X: 3; etc: 2}, Settings || {}); M = 1; af ();}}; function fu () {x = settings.x; / / settings var n = cm; return x;} jQuery.fn.bar = function (method) {if (methods [method]) // If we have a method that is {return methods [method]. Aply (this, Array.prototype.slice.call (argument, 1));} and if (method of type === 'object' || ! Met...

Generate key in Java & C# common for both languages -

I want to generate key algorithm with 16 characters. Should this algorithm method be able to use in two languages ​​(Java and C #)? In Java I used the UUID . It is not available in C #. Please guide me. In .NET you can use classes and more specifically static method if you have a new want to make. var guid = Guid.NewGuid ();

Pydev say, "Unresolved import" error -

hm .. sometime, PyDev says "unsolved import error". In my environment, Python 2.6.6 Eclipse 3.7 Pillows 2.2.2 There are errors. & gt; Unsolved import: cakasa - & gt; Import cookie unsolved import: & gt; WebSocketHandler - & gt; By Geventwebsocket.handler Import & gt; WebSocketHandler Unsalted Import: Tweaksi - & gt; Import tweepy Is there any useful information? Perhaps your PYTHONPATH is not set correctly (or if they are the library in the interpreter, maybe You added it after configuring). See: For references (note part of forced bundles there as this may be your case)

java - convert audio,mp3 file to string and vice versa -

Is it possible to change the audio MP3 file in a string file, or read the MP3 file and write it in a text file And on the contrary? If possible, how? Also, does the text file size of the original file or audio file be larger or equal to? Files like an MP3, all the files are just binary encoded data which can be interpreted separately That's what you use to see that data. If you are asking that you can convert an audio file to a string then this is a wrong question because binary data is only seen as a string when an alphabet-encoding is given (You can open your MP3 file notepad and read 'if you want'). However, if you are asking how you can read from MP3 files and write on the second file, then this is the code for it. Public string refill (string filename) {// variable MP3 file string line = "" represents a line of data; Try {br = new BufferedReader (new FileReader (new file (filename))); While (br.readline ()! = Null) {line + br.readLine try {i...

objective c - How to maintain 2 different versions of an app on the iphone -

Is there a way to keep 2 different versions of the same app on the iPhone? One version produces real production and the second version is the development which I can use for experiments i.e. UI changes "post-text" itemprop = "text"> Xcode 4 allows you to create goals for your applications. You can find those useful I use to keep them a free version and the payment version of my app. Each goal should have a separate bundle ID because it is a phone that uses to isolate individual applications. If you need a specific ID, (i.e. for push notifications, game centers or iads), I'm not sure about a sorry solution

html - Placing an image to the top right corner - CSS -

I need to display an image at the top right corner of a div (image is a "diagonal" ribbon) but I tried other things like adding an image to another device or defining its organs like: ex> .brbon {status: relative; Top: -16px; Correct: -706px; } & Lt; Div id = "content" & gt; & Lt; Img src = "picture / ribbon" class = "ribbon" /> & Lt; Div & gt; Some text ... & lt; / Div & gt; & Lt; / Div & gt; But without any luck Any thoughts? You can do it like this: #content { Position: relative; } # Content img {condition: full; Top: 0 pixels; Correct: 0 pixels; } & Lt; Div id = "content" & gt; & Lt; Img src = "picture / ribbon" class = "ribbon" /> & Lt; Div & gt; Some text ... & lt; / Div & gt; & Lt; / Div & gt;

internet explorer - Use image from cache or download -

I've seen that Chrome sometimes downloads images, which end in the future. Are browsers used to use the cached image (when the timeout expires) or to download the image despite the cache? You should read this: And for some browsing how caching works in a web browser Also, keep in mind that Refresh operations (like F5) will re-download cached resources already, and also keep in mind that you can use Fidler's Caching Response Inspector to check other titles. The client cache is not infinite size and therefore the contents of the cache will need to be re-inserted on the next usage.

c# - How to register a named type mapping to resolve to the unnamed type mapping -

I am using the unit framework with the unit of work design pattern, my class structure is as follows: Public Interface IUnitOfWork {void save (); } Public Class MyContext: Object Contact, IUnitOfWork {Public Zero Save () {SaveChanges (); }} As I type myContext type mapping register: IUnityContainer unityContainer = new UnityContainer () .RegisterType & LT; MyContext & gt; (New ContainerControlledLifetimeManager ()); I know I have done the following: Integration contactor. Registration Type & lt; IUnitOfWork, MyContext & gt; (); IUnitOfWork unitOfWork1 = Unity Container. Resolve & lt; IUnitOfWork & gt; (); IUnitOfWork unitOfWork2 = Unity Container. Resolve & lt; IUnitOfWork & gt; (); Then there can be an example as unitOfWork1 MyContext unitOfWork2 , as IUnitOfWork MyContext , which is a container controlled example map However, what I have to do, instead of this:. unityContainer.RegisterType & lt; IUnitOfWork, Mikan...

android - when i am doing 3d transition the animation gets stop for sometime -

When I'm transitioning 3D, the scene is stopping for a while and then rotating two scenes View the view list and the map and the second are viewing the list view with both the view database (the code blocks are fixed) / ** * on the container view Setup a new 3D rotation * * @ Paramayum status was clicked to show the image, or to show the list For the -1, the starting angle must start at which the rotation should start * @ the ultimate angle of the rotation should be eliminated / private zero applyRotation (int position, float start, flat end) {/ Find the center of the last float center of the container X = M.container.getWidth () / 2.0F; Last float center Y = mContainer.getHeight () / 2.0F; Last float center X2 = mContainerView.getWidth () / 2.0F; Last float center Y2 = mContainerView.getHeight () / 2.0F; // Create a new 3D rotation with the supplied parameter / Animation listener is used to trigger the last animation on the next rotate3dAnimation rotation = new Rotate3dAn...

java - Unable to within sitemesh -

I am using Java and sitemash. The main body decorator calls a profile jsp file. The following are a JSP file: & lt; Jsp: include page = "/ serveComments.html" flush = "true" & gt; & Lt; Jsp: param value = "78" name = "pass id" /> & Lt; / Jsp: include & gt; However when I add it, the profile is included in the profile. JSP disappears and I have just left it with serviceComments.html (Sitemap has been processed as header and boders are in place). Decorator. MML is as follows gt; & Gt; Pattern & gt; / * & Lt; / Pattern & gt; & Lt; / Decorator & gt; & Lt; Decorator name = "panel" page = "panel.jsp" / & gt; Hope I have made this clear. / div> & lt; Jsp: Include & gt; The template is problematic in experimenting with frameworks. The Jsp: Include tag is implemented in such a way that it directly writes output in the outstream instead o...

.net - RhinoMock says: "Type doesn't match the return type" -

मैंने ऐसा वर्ग लिखा है: सार्वजनिक वर्ग ए {सार्वजनिक वर्चुअल इन्ट कमलिमिट { प्राप्त; सेट; } आंतरिक वर्चुअल बूल चैकलिमिट (इंट मापन) {लौटें कम लिमिट और लेफ्टिनेंट; = माप; }} और इसके लिए एक परीक्षण: मॉक रिप्ज़ॉरीटरी मोजे = नया मोक रिपोजिटरी (); Var limit = mocks.StrictMock & lt; ए & gt; (); । Expect.Call (limit.CheckLimit (2)) लौटें (सही) .Repeat.Once (); mocks.ReplayAll (); limit.CheckLimit (2); mocks.VerifyAll (); और इसके साथ विफल रहता है: सिस्टम। अज्ञातऑपरेशन अपवाद: 'System.Boolean' प्रकार '% .get_Lowitim ();' लेकिन जब मैं चेकलामीट विधि के लिए आंतरिक खोजशब्द को सार्वजनिक करता हूं, तो यह ठीक काम करता है। यदि आप एक बाहरी पुस्तकालय ( StrictMock ), तो यह आपके आंतरिक तरीकों में से किसी भी तक नहीं पहुंच सकता है। ऐसा लगता है कि StrictMock कार्यान्वयन ए की CheckLimit , लेकिन क्योंकि यह एक कार्यान्वयन नहीं ढूँढ सकता संभवतः ए का कम लिमिट ।

javascript - use single hover script for a bunch of buttons, with a variable on mouseover? -

I am trying to define a variable on a mouseover event. The idea is that I later use that variable to replace the DIV ID, and patch a "swap-image" to create a normal mouseover script which I call a group of buttons I can use it for. So I do not have to use this code again and again and only delete some numbers. Will this work? I tried to do something like this: // set variable at mouseover $ ("# world_map_8_button"). Mouseover (function () {var location = "# world_map_8";}); // Use mouse in script / mouse over / out swap image + $ (location + "_button"). Hover (function () ($ (location + "_button_jpg"). Attr ("src", "img / buttons / map_buttons / world_map / world_map_8_button_over.jpg");}, function () {$ (location + "_button_jpg") Attr (. "Src", "img / button / map_buttons / world_map / world_map_8_button.jpg");}); }); This is some HTML code to help clean things up, all t...

java - How to use the "Guessed User name" in tomcat manager in a wicket application? -

पेज "सत्र प्रशासन" पर टॉमकेट मैनेजर में, एक कॉलम अनुमानित उपयोगकर्ता नाम है। मैं अपने विकेट सत्र से कैसे इस कॉलम को सेट कर सकता हूं? नोट: मैंने सफलतापूर्वक प्रमाणीकृत WebSession.toString () ओवरराइड किया है और यह मान सेसिन विवरण पृष्ठ पर दिखाया गया है। मैंने सेट करने का प्रयास किया है > प्रमाणित वेबसशन.युजरनाम जैसा कि अनुशंसित है। कृपया ध्यान दें कि विकेट सत्र एक अलग जानवर है वास्तविक सर्विस सत्र विकेट सत्र में एक "उपयोगकर्ता नाम" प्रॉपर्टी का निर्माण कार्य नहीं करेगा। आपको वैट से ठीक से सेट करने के लिए विकेट से कच्चे एचटीटीपीएसर्वेटर्यूवर का उपयोग करना होगा: यह है कि आप इसे कैसे करते हैं। इसे जोड़ें कोड को अपने वेबपेज में: एचटीटीपीएसर्व्वेट अनुरोध अनुरोध = getWebRequestCycle ()। GetWebRequest ()। GetHttpServletRequest (); Request.getSession ()। SetAttribute ("userName", userName);

iphone - Box2d Collision Detction - to tell which edge it collided? -

I am using box2d to find out the collision for my game. In most cases, something like "Detecting the enemy" like detection of conflict or things that are identical without regard to direction. In my case, collision detection is used to prevent the protagonist from passing through the wall. Therefore, it is important to know that from which direction he reached the wall, so I can update my situation properly. For now, my template code is: if ((collide!) {Rabbit. CSP (rabbit. Position.x + (pitch / 4), rabbit. Power. Or + ((roll / 4) * (- 1))); } And if (abdomen (roll)> stomach (pitch)) {rabbit. COP (rabbit .position.x + (pitch / 4), rabbit.} And if (abdomen (pitch)> eb (roll) {rabbit C.P.P (rabbit.fg.exe, rabbit.Comp.Y ++ (roll / 4) * (- 1));} Other {Rabbit.Search = CCP (Rabbit.Search.A., Rabbit.Com) Of course, lots of code in this code There are problems, almost a lot are listed here. So, there is no way, by using Box 2D, which direction from which directio...

generics - C# how to modify a List -

I am creating a console RPG and am quite new to generic. My problem is that I am the monster (enemy list general ), A hero (a hero's list stored in general) wants to attack. The issue I have is making the hero, my monster selects a goal from generic, then modifies the hpcurrent of the monster, it is easy with a monster and hero, but as I expanded the game , I intend to have many types of demons and heroes; That's why I want to use a piece of code for my hero who can pick one item from the normal one and modify the data. The reasons are two generics, because it makes it easy for me to see if all the heroes or monsters are dead. I will post the code for the monster (it is similar to the hero, these numbers are only different): class orc: characters {public orc () {this. Hpcurrent = 12; This.hpmax = 12; This.mpcurrent = 0; This.mpmax = 0; this. Strength = 6; This.defense = 4; This.magicstrength = 0; This.magicdefense = 2; this. Qualification = 4; This.level = 3; This.isal...

Variables in javascript switch cases? -

I want to use variables for each case in a switch statement, but it does not seem to work: Switch (Key) {Case key Next: // Go to next break; Case keypell: // Go to previous break; } I really need a switch statement because, unlike this example, I have many different cases. Why does not this work? Any work for this? Edit : As stated in the answer, it is completely valid. I was using the properties of an object for each case, and there was a syntax problem with it. You can use the variable to check, see the following example. You need to ensure that they have been announced and given a price. To see if the issue is happening elsewhere, you may need to look further to work with it. var keyNext = 1, // or "1" what you have, key = 2, key = key; // or key = 1 switch (key) {case key next: warning ('next'); break; Case key: Warning ('Previous'); break; }

php - How to load Zend view -

How can I load headers and footer files in jade in a scene? Where should I get them from? Do I have to file it in these files- $-? I will render in you use 'header' and 'footer' information to include A layout specifies your entire page layout, contains the contents of your view script.

ruby on rails 3 - How to test with Rspec if an email is delivered -

I want to test that if an email is delivered, then I: Call with the administrator method. I'll use email_spec, so I tried snapping it here: But that does not work, because I give an example of the delivery-style model object and the example is saved before delivery is. I tried to make another example of model object, but then the ID is not the same. My control method looks like this: def Do you have an idea of ​​how to fix it? Normally installed on your test environment (i.e., you have Config.action_mailer.delivery_method =: test ), then the distributed email global array as ActionMailer :: Base.deliveries as the mail :: message example You can read from the test case and make sure that the email is expected.

qt - Adding slots to automatically created menu items -

I have an existing menu called Saved, and I want to add two menus in it, save the new and save the edit. QMenu * Menu = New QMenu (this); Menu-> AddAction ("save new"); // zero saveNew () Menu- & gt; AddAction ("Save Editing"); // zero saveEdits () ui.saveButton- & gt; SetMenu (menu); I looked up for a suitable function and found it, but I need help implemening this QAction * QMenu :: addAction (constant QString & Amp; Text, Constants QObject * Receiver, Constants 4 * Member, Constants QKeySequence & Shortcut = 0) How I Can Do It menu-> AddAction ("Save new", this, slot (saveNew ()); with the same parameter you will use in that connect call: QAction * saveAction = menu-> AddAction "save new"); Connect (Save Action, Signal (Trigger), This, Slot (SaveNet)); If the menu was created in the designer, you can connect the same action at the same time: connect (ui.saveAction, signal (triggers) ...

sorting - F# - Sort a matrix containing tuples -

I did not find a way to sort the values ​​contained in the column of the following matrix of tuples: Matrix & lt; Float * float & gt; = Matrix [[(1.0, 145.0); (1.0, 45.0); (1.0, 130.0); (1.0, 30.0); (1.0, 130.0)] [(2.0, 45.0); (2.0, 45.0); (2.0, 30.0); (2.0, 30.0); (2.0, 30.0)] [(3.0, 130.0); (3.0, 30.0); (3.0, 145.0); (3.0, 45.0); (3.0, 130.0)] [(4.0, 30.0); (4.0, 30.0); (4.0, 45.0); (4.0, 45.0); (4.0, 30.0)] [(5.0, 130.0); (5.0, 30.0); (5.0, 130.0); (5.0, 30.0); I would like to sort each column on the basis of the second element of Tupal (5.0, 145.0)]] Will be given: matrix [[(1.0, 145.0); (1.0, 45.0); (3.0, 145.0); (3.0, 45.0); (5.0, 145.0)] [(3.0, 130.0); (2.0, 45.0); (1.0, 130.0); (4.0, 45.0); (1.0, 130.0)] [(5.0, 130.0); (3.0, 30.0); (5.0, 130.0); (1.0, 30.0); (3.0, 130.0)] [(2.0, 45.0); (4.0, 30.0); (4.0, 45.0); (2.0, 30.0); (2.0, 30.0)] [(4.0, 30.0); (5.0, 30.0); (2.0, 30.0); (5.0, 30.0); Thank you in advance! P> In my experience, when arrays ...

git - .gitignore exclude folder with files but include subdirectory -

मेरे पास ऐसे फ़ोल्डर्स हैं: /foo/one.txt / foo / bar /two.txt /foo/other/three.txt मैं सबफ़ोल्डर / फ़ू / बार / को छोड़कर फ़ोल्डर / फ़ू में सभी चीजों को बाहर करना चाहता हूं। मैं यह कैसे करूँ? इस के साथ। गिटग्नोर मैंने "अन्य" सबफ़ोल्डर को बाहर करने में कामयाब रहा है, लेकिन फ़ाइल "one.txt" अभी भी शामिल है। / Foo / *! / Foo / bar / ऐसा हो सकता है कि .gitignore अब काम कर रहा है कि आप सामान्य समस्या से पीड़ित हैं जो कि सूचकांक से एक ट्रैक की गई फ़ाइल को निकालने की ज़रूरत है जो अब जीटग्नॉर में है वह है, निकालने के लिए git rm & lt; file & gt; का उपयोग करें / सुनिश्चित करें कि यह अनुक्रमणिका में नहीं है।

integrate digital persona sdk into my application in java -

I need urgent help after goggleting a lot since the last 3-4 weeks. I am only able to understand this I can use the digital person SDK on my web application, which I am trying to create in Java. Since, the hardware for the fingerprint reader (digital personal personalization) has already been installed in my system and, I use the same hardware for my web application But I'm not sure how I can embed it into my application. I'm thinking that the fingerprint reader (Digital Pursue Private) will be installed in the client side. I need everyone's help, anyone knows .. I appreciate it !! OK, what you want to achieve can be difficult depending on your needs / experiences But after having a biometric mailing / enrollment / digital signature system in Delphi (Client) / Java (server), I can summarize the following steps: 1.- The client is a Win32 activex Java applet ) That can take fingerprint image and match it to server or for the purpose of enrollment For example, ...