Posts

Showing posts from August, 2014

java - How is it possible to create a sub class object within it's base class? -

वर्ग arijit {public static void main (स्ट्रिंग अरिज []) {System.out.println ("Base class मुख्य"); Amit ab = new amit (); // यह कैसे संभव है क्योंकि उप-कक्षा ऑब्जेक्ट भी बेस क्लास ab.a () रखती है; ab.ma (); } सार्वजनिक शून्य एम () {System.out.println ("बेस वर्ग विधि"); }} क्लास एमीट अरिजित (सार्वजनिक शून्य ए ()) (System.out.println ("सब क्लास विधि") फैली हुई है; मीटर (); आपके प्रश्न का मुद्दा ऐसा लगता है कि आप एक उदाहरण बना रहे हैं। अमित वर्ग की main विधि के भीतर अपने आधार वर्ग, arijit , और आप सोच रहे हैं कि यह कैसे संभव है। क्यों यह संभव नहीं होगा? आपका मुख्य विधि उप-नाम को नाम से संदर्भित करता है, इसलिए यह उस दृश्य के किसी भी अन्य वर्ग की तरह है। आप इसे गैर-स्थिर सदस्यों में भी कर सकते हैं, यदि आप चाहें तो भी। वास्तुकला , यह आमतौर पर इंगित करता है कि आपकी संरचना में एक समस्या है अगर बेस क्लास अंतरंग विवरण जानता है (जैसे नाम) इसके उपवर्गों की; यह हमेशा की तरह 'चीजों का दौर नहीं है।

oop - How to avoid downcasting when trying to extend a Java object -

I get many objects from an external API foo by call i locally I I want to process with a bit of information, so I have a subclass FooSon which adds those additional fields. How can I change all the things that are in my new heritage? Downcasting does not seem to be an option because those objects are not actually FooSon The only solution I have come up with is creating a convert function which is Fu takes the object as an argument and then a new FooSon object which is returned to all public / protected values ​​ Disadvantages: Information is being opened (private values) Convert to Convert Function To Inserting images that Fu has never been changed. Class Fu does not implement a per constructor or clone operator. I have a fu source code but I would like to avoid changing it to keep it consistent with future releases. Even if this is the only viable option, then I can change the implementation of FU which I want. FooSon can contain a field that is a foo....

Specifying Cell format for WritableHyperlink using jxl for java -

I am using jxl (a java based API for MS Excel file manipulation) to create Excel report. I am inserting hyperlink like this // Sheet is WritableSheet // To add hyperlink to 0,0 of Sheet. WritableHyperlink hl = New WritableHyperlink (0, 0, "http: //Www.google.com", "Home Page"); Sheet.addHyperlink (hl); This works fine, but this data displays in the default cell format, which is white color and blue font. Is there any way by which I can specify the cell format for this hyperlink, such as the label or the number it is important because it opens the hyperlink error screenshot, so according to the specification, the cell should be in red color. Thanks What type of hyperlink is you for the same cell Like, set a label like: WritableHyperlink hl = new WritableHyperlink (0, 0, new URL ("http://www.google.com")); Sheet.addHyperlink (hl); WritableFont redFont = New WritableFont (WritableFONT.ARIAL); RedFont.setColour (Color.RED); Writeable cellform c...

python - What is the Image API of WordPress -

c# - Push notification with php server? -

I know a simple way to create push notifications with php server ... I can not find any tutorials. Since push notification involves posting XML to an HTTP server, it is PHP's To be easy to use should be quite simple. I am not very familiar with PHP, but it seems that the handle should be handled. These (.net-centric) pages should be used:

asp.net - Saving Information For The Duration The User Has A Site open -

How do I set it up: Which link does I add to a user in a website? I want to save it. I had thought of creating a jquery function that would save the link name from clicking on a link every time, then after user shutting down the site, the information Ajax to DB Is this sound proper in any of the samples? Since there are many pages with multilayer links, I want to integrate something in javascript for a session variable so that I add a link to a user at all times and send DB information only once, every time A user opens a DB connection and sends information when clicking on a link. There are links products so I want to save related products, so I want to save related product information. Maybe I need a cookie instead? Waiting for the user to leave the site is good in theory, but never practice. Because you can not really know for sure when the user is going - or it may be late (such as the user has turned the computer off.) That you actually want to do, Keeps track of ...

asp.net mvc 3 - textfield not displaying date picked from jquery datepicker in mvc3? -

& lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; $ (दस्तावेज़) .ready (function () {$ ('date')। Datepicker ({dateFormat: 'mm / dd / yyyy', showStatus: true}})}}; & Lt; / स्क्रिप्ट & gt; & Lt; div & gt; दिनांक: & lt; इनपुट प्रकार = "टेक्स्ट" id = "datepicker" / & gt; & Lt; / div & gt; & Lt; div & gt; @ Html.TextBox ("toDate", Model.toDate.ToString ("dd / MM / yyyy"), नया {@class = "date"}) & lt; / div & gt; उपरोक्त cshtml पृष्ठ है .. मुझे पता नहीं है कि तिथिपिक्सर पर क्लिक करने की तारीख को टेक्सबॉक्स / इनपुट पर दिखाई क्यों नहीं दे रहा है .. क्या आप मदद कर सकते हैं? & lt;! DOCTYPE HTML PUBLIC "- // W3C // DTD एचटीएमएल 4.01 // एन" "http://www.w3.org/TR/html4/strict.dtd"> & LT; html & gt; & Lt; शीर्ष & gt; & Lt; title & gt; WeeklyReport & lt; / title & gt; & Lt; मेटा http-equiv =...

mysql: select all entries from a particular month using PHP -

मेरे पास POST नामक एक mysql डेटाबेस तालिका है। एक फ़ील्ड एक टाइमस्टैम्प है , जब रिकॉर्ड बनाया जाता है तो mysql सर्वर पर वर्तमान टाइमस्टैम्प के लिए डिफ़ॉल्ट पर सेट होता है। मुझे सभी पंक्तियों को निकालने के लिए SQL क्वेरी की आवश्यकता होती है, जो किसी विशेष महीने के भीतर टाइमस्टैंप हो। यही है, मार्च के लिए सभी रिकॉर्ड, या नवंबर आदि के सभी रिकॉर्ड। आपको सेलेबिल से * चुनें जहां महीना नाम (date_field) = 'फरवरी' पूर्व> चुनें जहां से महीना (date_field) = 2

actionscript 3 - AS3 child issue with if statements -

Okay, someone can tell what is wrong in my code below, there is no error, but this is not the case Doing what i want to do I need to display a movieclip on the screen when a variable called "veridant", which is generated randomly, is greater than or equal to 0.5. If it is not, then it is not displayed. Code: addEventListener (Event .ENTER_FRAME, char_coll); Function char_coll (ev: event): zero {if (currentFrame == 2) {if (Randint> = 0.5) {var w1: woman1 = new female1 (); Randint = Math Random (); If (w1.hitTestObject (stand)) {w1.gotoAndPlay (1); Cash 1 = cash 1 + 1; }}}}; randink is set inside the if statement. This means that the randink is always undefined, because it & gt; = 0.5 has to be set to any value (like a hold 22). This code should work: addEventListener (Event.ENTER_FRAME, char_coll); Function char_coll (ev: event): zero {if (currentFrame == 2) {var randint: number = Math.random (); If (Randint> = 0.5) {var w1: woman1 = New female...

audio - Sound device in Ubuntu through VMWare (Windows 7 host) -

I am using VMWire on Windows 7 to run Ubuntu 10.10 I have a sound device through Ubuntu, but there is no / dev / dsp or / dev / audio or similar. I'm having a sound from the system, so VMware is pipe it in some way, but I do not know which device to use to create my own device from my program, or how I use the system I can do Turns it on due to the use of PulseDodo in the latest versions of Ubuntu, the problem is working for me The solution is to use the padp to run its executable, which makes it difficult to think of a / dev / dsp device to use it, while it actually redirects itself. There was nothing on this issue with VMWare, but with an update in Ubuntu!

java me - ksoap connection with web service, no android (using ksoap) -

Well I'm making a connection ... Web service with SQL Server, web service with j2me, but Now I'm doing a Helloworld ... I could, but now I want to do a "hello world" + nombre ... parameter is not available in the web service, web service here [WebService (namespace = "http://tempuri.org/")] [Vebsaisbading (Confrfoto = WsiProfiles.BasicProfile1_1)] / para allow it with a web script and B service offers, which Aspianatti Ajeaks, is quite simple de la Laana Siguante // [System.Web.Script.Services.ScriptService] public class Service: System.Web.Services.WebService {public service () {WebMethod} Public string HelloWorld (string nombre) {return "Que onda" + nombre; }} and it has the code to call with ksoap ... string nombremetodo = "HelloWorld"; String url = "http: // localhost: 49175 / website1 / service command"; String namespace = "http://tempuri.org/"; String SOAP_ACTION = namespace + numerametodo; Public Ze...

Quadruple Precision in C++ (GCC) -

Recently, GCC came out with 4.6.0. Unfortunately, GNU has supported Fortran, but not C or C ++ (which is also one is also included). I have not found any way to use these new features in C ++, however, GNU supports the __ float 128 type for guaranteed quadruple-precise float. Mathematics functions in GNU C does not seem to be supported, such as publisher (full value, q is suffix for quad). Is there any way to work these tasks in C ++, or is there any optional library which I can use for mathematical work with __flat 128 ? What is the best way to work in the GCC to achieve quadruple accuracy? Now, I can add, subtract, and multiply them, but it is useless for them, considering that there is no way to convert them to string or like truncq and fabsq to create your own string function Obviously, this is an installation error my part. Whereas libccadmath.so is included in the main C / C + + portion of GCC, the FORTRAN version provides libquadmath.a and quadmath.h, wh...

design - C++/CLI - Managed class to C# events -

I have a C ++ class, which triggers some method like an event. class Blah {virtual zero event (EventArgs e); } Whenever the method is called the C # (managed) event, how do I wrap it? I thought about inheriting the class and overloading the event method, and then call somehow managed event. I'm not sure how to do it really. something like that (now compile-testing): #include & Lt; Vcclr.h & gt; Structure blah_args {int x, y; }; Straight blah {virtual zero phenomenon (const blma_argue and a) = 0; }; Public Ref: BlahEventArgs: public systems :: EventArgs {public: int x, y; }; Public Ref: BlahDotNet {Public: Event System :: Event Handler & lt; BlahEventArgs ^> ^ This happened; Internal: Zero-lifting (BlaEventErgues ^ E) {It happened (it, E); }}; Square blah_event_forwarder: public blah {gcroot & lt; BlahDotNet ^ & gt; M_managed; Public: blah_event_forwarder (BlahDotNet ^ Managed): m_managed (managed) {} ​​Protected: Virtual zero event (Const ...

android - How to make Custom Dialog look like Alert Dialog? -

I created my own (custom) dialog but want to style it as the original. To wit. On the bottom with dark background and brown button background. Is there any ready-to-use XML for this? (Therefore, I do not care about exact colors, heights, font size, etc.) This answer is incorrect Use Theme.Dialog.Alert to: & Lt; ! - The default theme for the warning dialog window, which is used by {@link android.app.AlertDialog} class. This is basically a dialogue, but sets the background to clear, so it can do two-tone backgrounds. - & gt; & Lt; Style name = "theme dialog.artart" original = "@ Android: style / theme dialog" & gt; & Lt; Item name = "windowBackground" & gt; @Android: Color / Transparent & lt; / Item & gt; & Lt; Item name = "WindyTestestyle" & gt; @Android: Style / Dialog WindowTitle & lt; / Item & gt; & Lt; Item name = "windowIs floating" & gt; True & lt; / It...

github - h2database as git repo -

I like H2 a lot! I also like and use git I failed to convert svn store to GIT repo, so I downloaded the source and pushed them. But It would be great if you would publish G2 sources in GIT repo (using github). And I'll remove my "thorn" and give your github rep for the repo. I want to read the sources and try to commit something. Thank you! Please use instead of posting here. Stack is for overflow questions, this is not a mail system or mailing list: -) By the way, it is weird: you wrote "I have corrected it." Is it really your intention fork , which means that you want it? You only suppressed a part of the source code 'only'. No document.

How to test an interactive java application using cucumber and aruba -

How to check an interactive Java application using cucumber and aruba I have this cucumber / Aruba scenario is: Scenario: When I type "some \ n" to run 'java -cp / bin echo' interactively in view of the general echo, in the output "Something" should be to test this simple Java program: import java.util. *; Square echo {public static zero main (string [] args) {scanner stdin = new scanner (System.in); Println (stdin.next ()); }} When I run the test, it fails and I get the following error: Then the output should contain "something" Output should contain "some" '' in which "something" (RSPEC :: Exxpectation :: Execution Notat Error) / Feature / Client.Feature: 15: I try the same exam with What is the second method to read from the standard input What is the system? Is the system used only for the keyboard? You can try: First test that cucumber / Aruba is getting out in your system...

osx - Shell command or script to define MobileMe Account Name and copy it to clipboard -

Hello, I am working on small service for OS X, I was wondering how I received the mobile account Can I (if the person is logged in OSX) for more use in script? Do you want to snippet the following? DSLL Localhost - Radle / Local / Default / User / $ (ID -UN) DSATRTV Penetration: LinkedIn MAC.com | Grep-A1 '& gt; Name & lt; ' | Sed -n's /.* string & gt; \ *. * \) & Lt; \ / String>. The first item reads linked to MacDocs for the request of the user from the Directory Service, the next element gets the name field and the last element is the user. Of Takes the name of Mac and displays it. To put it in the clipboard, you issue this command, with the following termination: DSLL localhost - radle / local / default / user / $ (id -UN) dsAttrTypeNative: LinkedIdentity mac.com | Grep-A1 '& gt; Name & lt; ' | Sed -n's /.* string & gt; \ (. * \) & Lt; \ / String>. * / / 1 / p '| Pbcopy which copies the value in t...

javascript - html input field, cleanse of bad characters on paste? -

We run a web2print solution, that some people fill out a form to update some artwork. The problem pips users to words or other programs, and gets strange dashes, spaces, etc. which are not part of the normal keyboard input. What do we want to have input on all "normal" keyboard keys limited, not unmapped character code how do we do this? Many thanks, b I will create array Or delete all the keyboard keys and then remove all the characters that do not match.

sqlite3 - SQLITE -- a file with 5,000,000 TINYINT values? -

I would like to create a SQLite file that contains 500,000 tonne value (between 0 - 256) according to my calculation, this file Should use approximately 5 [MB]. However, I'm getting close to the size file 50 [MB]. Here's the code that I use: import sqlite3 # debug database = sqlite3.connect ('/ home / Mine / temp.db ') db.execute and populate (0, 5000000): (Enter the value in "(test)" ({0}) .db format (0)). ("Make the table if Test (id INT2) does not exist "). Committee () db.close () Any ideas how to optimize things so that it takes very little space? 5 There is too much of a database in comparison to the place for small boats. SQLite has published. It seems that you will need at least 9 bytes per line. SQLite B -Tree uses two different versions of the structure: The table uses B-Tree, which uses 64-bit integer values ​​for keys in table B-tree, an associated The database record (section 2.3.2) is deposited with each entry. ...

ruby on rails - Can't get my type attribute set in my Profile model for STI -

I have a user model that is is_one: profile And in the profile model there is a type column for inheriting a table. I want to set up a type to sign up a user, and I'm having trouble doing this. I'm trying this in my profile controller: def make @ profile = profile.find (param [: id]) type = param [: user] [: Profile_Aditors] [: type] if type & amp; Amp; ["Artist", "Listener"] Include (type) @ profile.update_editrid (: type, type) end of end and this user new view in my form: & lt;% = form_for (setup_user (@user)) f | F | & Gt%; ... & lt;% = f.fields_for: profiling | T | & Gt%; & Lt; Div class = "field" & gt; & Lt;% = t.label: type, "Are you an artist or listener?" % & Gt; & Lt; Br / & gt; & Lt; P & gt; Artist: & lt;% = t.radio_button: type, "artist"%> & Lt; / P & gt; & Lt; P & gt; Audience: & lt;% = t.radio_button: type, ...

model view controller - Where does game logic go in Rails apps? -

(disclosure: I am very new to rail) I try to make a risk I am in the style board-game rail, although this question can apply for any MVC-style structure. I have players and games where players can join the game until the game is complete. Trying to join the full game (or two games), an error indicates, Yada Yada. Three pieces of game logic are given below, where I do not know where the place is, or at least where they are usually kept. If a game is full, then it should start and do things related to it (i.e., messaging all players starting the game, spreading forces on random maps Ones). / P> When a player executes moves during his turn, it seems that the argument in the controller is logical. What happens when its turn ends and the time for giving the message to the next player? Do this code as the same controller Assume that a player will change his turn if he does not end in 24 hours. From time to time I should see all the games in my app and see if a player ...

Nhibernate: Save all decimal properties with only two decimal numbers -

Is there any way to tell nibernate to save all numerical properties with only two decimal places? I'm using fluent nhibernate. @ If you need to apply it in all sections except for the reply to the GSCO, all the numerical properties For, you can define and specify overrides.

flash - parseInt blank field -

I am writing an age verification work sheet for a flash project. Right now, I know that if the user is born before a certain year, then it can allow them to reach the SDF, if they will not refuse. The problem is that if they leave the field empty, it will allow them to be accessed (I'm assuming because the blank field is acceptable as parseInt to validate it) So how am I curious how to To be blocked so that no person will enter the year, it will refuse to reach the SDF. Here's my code for agetext._viewable = false; Verify_btn.onRelease = function () {if (parseInt (year.text) & lt; = 1992) {_root.age._visible = false; } and (agetext._visible = true;}; if ParseInt can not parse a valid number, then return NaN (not a number). You can test it by using isNaN : // Investigation of that year is not acceptable & lt; = 1992 var birthyear = parseInt (year.text); Alternatively, you can ensure that TextField is not empty: if (years! Hole! = Null & amp; ...

C# "Backward" Convert Visual Studio 2010 .csproj project to 2008? -

संभव डुप्लिकेट: मेरे पास वी.एस. 2010 में एक .NET 3.5 प्रोजेक्ट है। क्या वीएस 2008 .csproj फ़ाइल स्वरूप को वी.एस. 2008 .csproj फ़ाइल प्रारूप को वीएस 2008 का इस्तेमाल करते हुए और सब कुछ जोड़कर बिना एक नया प्रोजेक्ट बनाने में कोई तरीका है? एक उपकरण या उपयोगिता? दृश्य स्टूडियो, जहाँ तक मुझे पता है, केवल एक उन्नयन पथ प्रदान करता है मैं वीएस 2008 के उपयोगकर्ताओं को ऐप स्रोत का वितरण कर रहा हूं। प्रोजेक्ट फाइल वास्तव में 2008 और 2010 के बीच समान हैं (2010 में जोड़े गए नए प्रकार को छोड़कर) केवल समाधान फ़ाइल भिन्न होती है, इसलिए आप 2008 में एक समाधान फ़ाइल बना सकते हैं और "मौजूदा प्रोजेक्ट जोड़ें" हालांकि अगर आप .NET 4.0 को लक्षित कर रहे हैं तो आपको समस्याएं होने पर, जैसा कि लगता है कि इसमें परिवर्तन होता है परियोजना फ़ाइल उन परिवर्तनों का ब्योरा है, और अधिक महत्वपूर्ण बात, यह आपके लिए सब कुछ करने वाला एक कार्यक्रम है।

hashmap - What is the most efficient way to detect duplicate characters in a String in Java? -

Using the data structures (Hashmap) I was able to do it. This code is: import java.util. *; Square unique {public static zero main (string [] args) {Hashmap 1) {isNotUnique = true; }} System.out.println (isNotUnique); }} Without datastro, I came up with a blunt approach. It is O (n ^ 2) class unique {public static zero main (string [] args) {string input string = args [0]; System.out.println (isUnique (inputstring)); } Private Stable Boolean is Unic (String InputString) {String Method String = Input String; (Int i = 0; i & lt; inputString.length (); i ++) {for (int j = i + 1; j & lt; inputstring.length (); j ++) {if (methodString .charAt (i) == MethodString.charAt (j)) {return false; }}} Be true; }} I was thinking that it is possible to solve the complexity of time (n) If you need to support Unicode characters that are not represented by four pairs of rentals, this will: Personal Stabilize Boolean Unic (String inputstring) {long [] used = new tall [1024...

how to calculate the count parameter to call an interface method in java? -

I am using javassist and I generate interfaces and other stuff on load time / runtime. The method of an interface to call (with the Bitcox ExploreEnterface) is to provide several parameters: indexBT1, indexbite2, counting, and 0 (to). Already an abstract method (whistle meth) that I want to call, How do I count my count? For example, they say that " invokinterface records a record of the number of logic values ​​operating in the calculation of instruction, where a debate takes the number of long type or type double value Contains two units for value and one unit contributes to any other type of argument, this information can also be obtained from a descriptor of the selected method. " But also Te that " Ginr operand is an unsigned byte which should not be zero. " If the abstract method I want to call parameters, the Y 0 will count! But counting can not be 0. Methodist's Statement () V. Any suggestions? I do not know the details of the java...

php - How to remove single and double quotes from a string -

When I run a function that contains double quotes through this function, then quoting its quote. I want to remove them altogether (even a single quote) How can I change the function to do this? Pref_title ($ s) function {$ result = preg_replace ("/ [^ a-zA-Z0-9] + /", "", $ S); Return result; Example: This is the first 'example': thisis030the039firstexample errors: Warning: preg_match_all () [function.preg-match - All]: Unknown modifier '0' in C. Example 2: This is my "second" example return: Iismyquotsecondquotexample Errors: Invalid Express in Xpath It appears that your original string contained HTML characters for " ( & amp; quot; ), so when you Clear it, you can simply delete & amp; and ; Exclude the remaining string quot . --- Edit --- Perhaps the easiest way to remove non-alpha numerical characters HTML characters have to be decoded, then it will run through regular expression, in this situation, t...

iphone - iOS - removeFromSuperview removing too many views -

In my app my main window is View 1 and View 2. View1 is loaded through a button in the main window and view 2 is loaded in view 1 through a UITable view. That's why I call [self.window addSubview: View1] . When I close View2 with [code] [self.view removeFromSuperview] I work back to MainWindow for no reason and no View1. Any thoughts as to what is happening? You must ensure that the self View2 ' It will depend on where you are calling [self.view removalFromSuperview] . If you are not calling within the controller for View 2, then it can work anywhere: [View2 removeFromSuperview];

android - Is one Activity = one Context? -

What is the context anyway, I am confused to differentiate between context and activity? Is the context related to an activity? Will there be any change if the activity has changed? I have a game that has multiple activity for each activity, for each part, splash screen, menu, game screen etc. The problem is that I have a singleton sound manager that uses a sound player because it is a sound player. I want to load every sound in the splashscreen but later I think how about the context again ? Public Zero LoadSound (reference reference, int redid, string name) {int id = sounds.load (reference, resId, priority)} I load the sound in slash screen activity, so how can I play the sound in the game screen activity? Do not have different references? To: On Android, a reference for many people Operation is used but to load and access most resources. This is why all widgets receive a reference parameter in their constructor. In regular Android applications, you usually have t...

ruby on rails - RailsTutorial - chapter 8.4.3 - Test database not clearing after adding user in integration test -

I've been stumped on this. Everything goes fine on the tutorial, but when I add this part of the code to my /spec/requests/users_spec.rb file, things start to go south: describe "success" should be "create a new user" lambadai signup_path fill_in "name", go along with: = with & gt; "Example User" fill_in "email" ,:: with = & gt; "Ryan@example.com" fill_in "password" ,:: with = & gt; "Fobor" fill_fill "confirmation" ,:: with = & gt; "Fobar" click_button response. Should_selector ("div.flash.success" ,: content = & gt; "welcome") response. Render_template ('Users / Show') End Change (user, count) .by (1) end and end If I clear Test database (Rake dB: Test: Ready), then all tests pass but if I If I run the test again, they fail because the test database does not clear the records that the above code has been added above. I ha...

mysql - Error in VBA:`[Microsoft][ODBC Manager] Data source name not found and no default driver specified -

I am creating macros to add data from my MySQL database but when I use the macro I get an error to run: [Microsoft] [ODBC manager] The name of the data source was not found and no specific driver specified code: sub-update MySQLDatabasePHP () 'ADODB.Connection Dim Server_Name string dim databases as http://www.vbaexcel.eu/ Dim Cn for detailed explanation Of In the form of string thumb as User_ID, string_demo ADODEB.Recordset set RS = new ADODB.Recordset Server_Name = Range ("e4") as string-DM password in the form of string substrate as stratrate. Value 'IP number or server name database_name = category ("E1"). Value 'name value' id user or user name password = range ("e3"). Value 'password table = range ("e2"). Range ("A6") offset (red, 0) to write the name of the value 'Red = 0'. Value & lt; & Gt; Tom Textstang = Tom Column = 0 Range ("A5") Offset (0, Column). Value & l...

mysql - Counting and Grouping -

I am trying to combine and count with a database. I have this data: column_a | Column_b ------------------- A | 1a. 2a. 2b | 3b 3a. 3b 3 I want to create a column to calculate the number of rows that match the value of the column_a to a_total I am Then I want to put together the group column_b values ​​for the type of AD. The data will then output by descending a_total , then descending column_by. I want this output: column_a | Column_b | A_total | BTatal --------------------------------------- A | 3 | 4 | 1a. 2 | 4 | 2a. 1 | 4 | 1b 3 | 3 | 3 What have I got so far ... So far I have SELECT column_a, column_b, COUNT (* ) This group from AS b_total by column_a, column_b, ORDER BY column_b, DESC, b_total DESC which puts column_b in the order with the correct b_total , but how uncertain I am Get the sum of a_total in column_a within the same question. Any help would be great! test the database; Use examination; Create table T (A VARCHAR (...

php - creating primary key based on date -

I am trying to create a unique ID for each record based on the date of the record. For example, if today's record has been made, then I need a key of 20101130XX where there will be a series of numbers like XX 01, 02, 03 etc. If more than one person records a record today If 3 people make records tomorrow, their unique ID will be 2011032700 2011032701 2011032702 And then midnight comes and makes a new record 2011032800 Its purpose is to give each record a unique ID that will be used in relation to the ticket. We are already using date format, but currently user I'm sure how to create a trigger to generate this kind of I unique ID And from dev.mysql.com: Mysam and BDB You can specify AUTO_INCREMENT at secondary column in multiple-column index in this situation, in AUTO_INCREMENT C The generated value for the MAX (auto_increment_column) + 1 is calculated as the WHERE prefix = gave prefix . This is useful when you want to put the data into groups or...

maven - multiple assemble results -

I need to maintain a situation created during an artistic process. So I got the idea of ​​bundling this state in my own zip and opening it in the prepared stage. Additional real results will also be deployed. This result is a bundle of files created, which is valuable within the next artwork. I am trying to create two result zones, but appointing another assembly name is ignored and always myArtifact-version.zip is deployed. What's wrong? Thank you in advance, Sven My palm looks like this: & lt; Project ... & gt; & Lt; ArtifactId & gt; MyArtifact & lt; / ArtifactId> & Lt; Group & gt; De.myGroup & lt; / Group & gt; & Lt; Packaging & gt; Pom & lt; / Packaging & gt; ... & lt; Dependency & gt; & Lt; Dependency & gt; & Lt; Group & gt; De.myGroup & lt; / Group & gt; & Lt; ArtifactId & gt; Generation-Status & lt; / ArtifactId> & Lt; Version & gt; $ {Project.version}...

string - Odd Oracle + .net behaviour when comparing types -

In my workplace, there is a pure application provided to us by the Postal Service, from an Oracle database running on the same machine Joins and is responsible for registering, storing and printing shipping labels. Viewing as a database host etc. is configurable. We asked the company whether the application can be used on the network (just copying it to another machine "Verbatim does not match the format string" errors), we were told that "this is not possible". To answer no, I poked around the exe with the consultant. With the v $ sqlarea view of Oracle I pinpointed errors for some date comparison tasks, but I do not know why the application was working on the first place on the original machine. The original application SELECT * uses the same queries as shipping WHERE dated = '03.03.2011' - Error Easily fixed with something SELECT * to shipping WHERE to_char (Date, 'yyyy / mm / dd') = '2011/03/28' > Why does the orig...

ruby on rails - Prevent image hotlinking; only allow referer and redirected requests? -

I have some pictures in a bucket on S3. My app uses these images What I want is the following: Allow only image access if: Referrer is my site - I can already do this with a bucket policy User redirected from my site Referer is sent to Amazon S3. Do I have any limits for accessing S3 files? My current bucket policy looks like this: {"version": "2008-10-17", "id": "e9c9be4d-cdfc-470c- 8582-1d5a9e4d04be "," Statement ": [" AWS ":" * "}," Action ":" S3: "" S: ":" Allow "," Principal ": {" AWS ":" GetAbject "," Resource ":" Ern: AAS: S3 ::: Mibecat / * "," Condition ": {" String Leak ": {" Aves: Referer ":" http://myapp.com/* " }}}}} make your files private. Use the URL in the link / A Redirection in Ni images Includes an expiration in the signed URL; Amazon ...

c++ - Calculate how many ones in bits and bits inverting -

संभव डुप्लिकेट: नमस्कार बिट्स में कितने लोगों की गणना करना है? 1100110 - & gt; 4 101 - & gt; 2 और दूसरा प्रश्न: बिट्स को कैसे उलट करना है? 1100110 - & gt; 0011001 101 - & gt; 010 धन्यवाद आप कर सकते हैं लूप जबकि संख्या शून्य है, और जब अंतिम बिट सेट हो जाती है तो एक काउंटर बढ़ता है। या यदि आप इंटेल आर्किटेक्चर पर काम कर रहे हैं, तो आप इनलाइन विधानसभा में popcnt निर्देश का उपयोग कर सकते हैं। int count_bit_set (अहस्ताक्षरित int x) {int count = 0; जबकि (x! = 0) {count + = (x और 1); X = x> और gt; 1; } वापसी की गणना; } आप ~ ऑपरेटर का उपयोग करते हैं।

Android: Standard 'Next' Button and Background -

Image
How do I get a standard next / previous button buttons styles and background like the bottom image For the gradient background, you can apply under the background drawable code. P> Change the color code according to your needs! GradientBug below. Make XML and paste code, This will give you the background of your need! Thanks.

oop - How do I prevent code from creating instances of a base class? -

Assume that I inherited from circle and triangle classes Size class My question is how do I stop making the example of the size class? You make the shape class abstract As the basis of the classes, there is an incomplete service which provides extra functionality. For example, if you have loaded classes, then you have an abstract class DataLoader and solid class DatabaseLoader , XmlLoader ...

rails 3, easiest way to implement 'popup help' for form fields -

Using the haml for our Rail 3 app (but not the compass or anything like this): When our user forms If we fill in, we want to do simple search for each field to apply a 'popup' box that explains what's included in it. Should be fancy, but arbitrarily large multi-line popup boxes with 20 to 100 words should be allowed 'Popup' is used to "open" or "wide" any kind, but one True pop-up-the-page will be ideal. Can anyone recommend an easy way to implement it? The simplest way I can think of is to insert a link inside your input field label Using a hidden device indicates your help with the information: & lt; Label = "name" & gt; Name: & lt; A href = "# name-help" rel = "facebox" & gt; & Lt; / A & gt; & Lt; / Labels & gt; & Lt; Input type = "text" name = "name" ... /> & Lt; Div id = "name-help" style = "display: none;" & G...

How to set the windows "Read & Execute" permisson flag with Ant? -

Image
I need to set a "Read and Execute" flag for a file. Since ant can not do this, Is there another way to do this with ant? Maybe the use of specific orders of windows and use it? Edit: I have to set the "Read and Run" flag, you will see the screenshot below. To set the security property for the object, you can use.

javascript - Fetching all the urls opened in the browser -

I know that getRequestURL will bring the URL of the page that I opened I should know Itemprop = "text" > It is not possible to do this from a regular web page because it will be a serious security problem. However, it is possible with browser extensions (for example, a chrome.tabs.getAllInWindow () function is available for plugins in Chrome, and accessing their URLs It is only a matter of looping through tabs obtained by that function and read .url property. See the documentation next).

android - How to detect the presence of another app? -

This is a theoretical condition: I write an app to detect presence The square path, name, activity name, etc. of the target app are random, I can not just check that it is there (it is i.e. I have root access on the phone App is an open source, and (different than package names and app names) App does not generate any log output Does it . I'm thinking about ways to find out whether this second app is present on the phone or not it is actually running from time to time), what are the following methods Are all possible? Note from time to time for the presence of certain classes in memory Find the known segments code compiled into each installed APK Fixed Detecting the memory of the device while monitoring the memory of the device detects Are there other ways to find another app in these situations? Use the rest of this method about all installed applications in the system:.

java - Do i need to make use setter or constructor in DAO implemetaion -

मेरे पास वर्ग userDAOimpl है और मैं @Resource (name = "sessionFactory ") सार्वजनिक सत्र फर्जी सत्र; मैं यह पूछना चाहता हूं कि इसके पास मुझे सेटर की तरह उपयोग करने की आवश्यकता है सार्वजनिक शून्य सेट सत्र-संचिका (सत्र-फ़ैटर सत्र सत्र) {this.sessionFactory = sessionFactory; } या सार्वजनिक डीएओआईएमपीएल (सत्रफ़ाड़ा सत्र सत्र) {this.sessionFactory = sessionFactory; } एक बात मुझे भ्रामक है कि ये कैसे मिलेंगे क्या यह सत्र कारखाने के बिना एक डीएओआईआईएलपी उदाहरण है। यदि यह समझ में नहीं आता है, तो यह कन्स्ट्रक्टर में होना चाहिए। इस तरह, एक डीएओआईआईम्पल उदाहरण एक बार वैध राज्य में है, और कभी भी अमान्य स्थिति में नहीं है। संपादित करें: सत्र फ़ैक्टरी निजी होना चाहिए, सार्वजनिक नहीं।

javascript - HTML vertical slider for touch devices -

I'm trying to find a vertical slider for touch devices (iPhone, iPad). I am using jqTouch but this widget lacks it. I have tried using the standard jquery ui widget but there are issues of mixing two structures. Michael Can anyone tell me in the right direction? jQuery in their form UI elements mobile. You can also find a link on the PhoneGap website.

attemps to access secure API in Blackberry -

I have created an application and only when I have been created and installed in my design storm I want to show this desgn only in Porteret I have written this line Ui.getUiEngineInstance (). SetAcceptableDirections (Display.DIRECTION_PORTRAIT); Install in the device. I got the error: Attemps to use a secure API I do not know what can I do? I had already signed this application before installing it in the device. When you create a project, check the log output - if your code is for any secure API If so, then there will be evidence of this by logging the meaning of logs like this: WARNING: References to the class: net.rim.device.api.system.Display is required to sign with the key -In: Rim Runtime API If you get a similar warning, it means that you can run the app on the actual file. Shm joins the rim to be, need to sign the code file with similar keys (versus simulator).

Cant find the file i created on android tablet -

/ The data directory in Android is empty I have installed some applications and I created a file in the / data / map directory Code is also written, I have these lines in the on-line mode, but I do not see any files after running in the / data directory. file fileer = getFilesDir (); String filed = file dior. Toasting (); Log.v ("Test", "FILEDIR --->" + filedir); // output I got FILEDIR --- & gt; /data/data/com.android.Test/files string strNewFileName = "test1.txt"; String strFileContents = "My first file creation PRGM"; File new file = new file (file dir, stranfile name); Try {Boolean filestat = newFile.createNewFile (); Logs. V ("Test", "Create File =>" + Filestat); // Create output file & gt; True indicator success FileOutputStream fo = new FileOutputStream (newFile.getAbsolutePath ()); Fo.write (strFileContents.getBytes ()); Fo.close (); } Hold (IOException e) {Log.v ("Test", "Exceptio...

wpf - Update textboxes to selected item listbox -

A little concerned with some of the qualities I have a Suchibak with objects selected items I have a list box text box and I have to edit them .. but my question is: when I select an item, and I fill some text to the text box that is what he delivers it, but if I click on another item I'm in the text box, I He fixes Ase? This is an example of a text box: So I want to set the maximum time for my object..I see a text box while clicking on something in the list. & lt; Text box height = "23" visibility = "{Binding Path = visible, Converter = {StaticResource boolToVis}, UpdateSourceTrigger = PropertyChanged}" Text = "{Binding Path = MaxTime, UpdateSourceTrigger = PropertyChanged, mode = TwoWay}" HorizontalAlignment = "left "Margin =" 376,322,0,0 "name =" textbox2 "verticalAlignment =" top "width =" 120 "/> This is my listbox: & lt; ListBox SelectedItem = "{Binding Path = Select...

android - How to use thread to load images from server? -

I have many images on some of my activities, and all of them are connected to remote servers. The problem every time I go to one of these activities in which images break away from the remote. All images should be loaded first or else you will get a black blank screen. Sometimes it takes around 1-5 minutes to load, and sometimes even closes the device, can I fix this issue anyway? Some people suggest using me threads, but I really do not know how somebody can give me an example, I really appreciate it very much. Here's the code I'm using: ImageViewimgView = (ImageView) findViewById (R.id.image01); Drawable drawable = LoadImageFromWebOperations ("http://forum.roda.hr/images/customavatars/avatar10164_2.gif"); ImgView.setBackgroundDrawable (drawable); Private Dry Load Load ImageWebWeb Operation (string URL) {try} {InputStream = (InputStream) is the new URL (.org) .getContent; Drawable d = Drawable.createFromStream (is, "src name"); Return D; } Hold (ex...

design patterns - Transaction like programming in Java -

I want to get functionality such as Java. I want to do operations like ` n - an operation to update the database, to include in a row, to update another data structure, etc. One operation etc., all these tasks I should behave as a transaction, if it succeeds, then all tasks should be done successfully, otherwise, if someone fails then everything should fail. One of the brush force approaches is to write the blocks that catch one and return all the functions in the grip blocks. Any signs in solving these types of problems? Is there a pattern or library to get it? I think the pattern you are looking for. Similar to the behavior of the transaction, a database engine or software installer can keep a list of actions that would have been done or done. One of them should fail, everyone else can be dismissed or rejected (usually called rollback), for example, if two database tables that refer to each other, they have to be updated, and The second update fails, the transaction can...

Python - Parse a string with custom price units -

What is the fastest way to par int in Python? String can include custom units, such as "k" (kg), "m" (lakh), or "b" (billion). For example: 100 - & gt; 100 100k - & gt; 100000 100m - & gt; 100000000 100b - & gt; 100000000000 thanks def converter (val) Try: # == 'K: 1000,' m ': 1000000,' b ': 1000000000} unit = val [-1] Try: number = int (val [: - 1]) except valueError: #search Unit In: Return Lookup [Unit] * Number Return Ent (Val)> gt; & Gt; & Gt; Print Convert ("100 M") & gt; & Gt; & Gt; 100000000 Create a lookup table and then divide the numbers into numbers and units. If the unit is present, then see our table and use it to make the final number. Otherwise, return the number.

math - maximum and minimum constraint on a variable -

I type so many ways by looking at something like this: / * myVal Between 10 and 90 * / int myVal = foo; If (myVal & lt; 10) {myVal = 10; } And if (myVal> 90) {myVal = 90; } Is there another great way to do this? Obviously you can easily write a method, but I wonder if there was a more natural way of establishing a barrier in any language, or something else which I am missing. Language is agnostic because I am interested in how it can behave in different languages. In most programming languages, you can myVal = min (max Foo, 10), 90); Or just write a clip () macro which does the same thing.

iphone - Reload data on UITableView -

How to reload in the UITableView class. I am using the reloadData method but it is not working. / P> - (id) initWithCoder: (NSCoder *) coder {if (self = [super initWithCoder: coder]) {[self-init]; } Healthy return; } - (id) init {appdelegate = [[UIApplication shared application] representative]; [Appdelegate readLiteratureFromDatabase]; Tbl_obj.backgroundColor = [UIColor clear collar]; Tbl_obj.delegate = self; Tbl_obj.dataSource = self; [Tbl_obj reloaded data]; Array_content = [[NSMUTPABARROL] INIT]; Self return; } Here is an init method call in another class. Then the table does not reload at that time. Please help! On your code it appears that you really need to read it; You should not have a method called init which does not call up super, which will eventually tap into things. Setting up your docs ivar in an empty irreversible string is nothing but ruins memory, after all you have to set the docs in something real, till that point Wait till allocation...

windows - Connected socket information -

Hello, How is it possible to get a socket connected to the information form? I need to get the address of the server, is connected to the socket and port is it possible? I have to understand this in WSPSend to stop or else I can not remember the previous tasks (such as socket (), connect () etc.) thx.

objective c - Programmatically changing desktop image -

I'm trying to change the desktop image; The process that I came up with is below, for the first time, this code is run, again the shape image is displayed on the screen as a screen, but the next time there is no response. What am i doing - (IBAction) click: (ID) sender {NSData * sourceData; NSError * error; NSFileManager * filemgr; Filemgr = [NSFileManager default manager]; Screen array = [NSScreen screen]; Screen count = [screen array count]; Unsigned index = 0; For {index; index and lieutenant; screen count; index ++} {screen = [screen ARRA ObjectAutlook: index]; ScreenTrack = [screenviewframe]; } NSLog (@ "% fx% f", screen-size. Size.width, screenRect.size.height); ArrCatDetails = [StrCatDetails Components with Authorized Bastring: appDelegate.strColDelimiter]; NSString * imageURL = [NSString stringWithFormat: @ "Upload / Product / Image /% @ _% @ _% d.jpg", [arrCatDetails ObjectIntextX: 0], App Delegate .str104by157Name, iSelectedImgIndex]; NSString *...

iphone - Adding balls, paddles...etc to Pong -

There are things like UIM's VUI, UIMage and more. If I want to import images such as pedals (used by the user) or one, the ball which acts like an object and is not just some phantom which is the ghost through everything ... What should I do? Is there any tutorial about this? Thank you. There is a lot of information about the development of the game. You just have to do your math knowledge in the programming (school math) To implement. I found a tutorial about Pong for you:

Issue with apache pdfbox java.lang.IndexOutOfBoundsException: Index: 2,Size: 2 -

I am using Apache pdfbox 1.5 to extract text from PDF. It is being used. It seems to work fine for some PDF but it failed for a PDF with error below. Let me know if anyone is facing such an issue & amp; Resolved java.lang.IndexOutOfBoundsException: Index: 2, Size: java.util.SubList.rangeCheck (AbstractList.java:864) 2 on java.util.SubList.get (AbstractList . Java: 737) org.apache.fontbox.cff.CharStringConverter.drawCurve (CharStringConverter.java:415) on org.apache.fontbox.cff.CharStringConverter.handleType2Command (CharStringConverter.java:277) on org.apache.fontbox.cff on .CharStringConverter.handleCommand org.apache.fontbox.cff.CharStringHandler.handleSequence (CharStringHandler.java:53) to (CharStringConverter.java:81) org.apache.fontbox.cff.CharStringConverter.handleType2Command (CharStringConverter.java:307) on org.apache.fontbox.cff.CharStringConverter.handleCommand org.apache.fontbox.cff.CharStringHandler.handleSequence (CharStringHandler.java:53) on org.apache.fontb...

java - spring MVC : form : radiobutton for Boolean property -

I just want to know how to use a boolean in a spring MVC form. I try this code: My JSP: & lt; Form: radiobutton path = "dateInterval" value = "false" cssClass = "radio" /> & Lt; Form: Radiobutan Path = "Date" Interval "Value =" True "cssClass =" radio "/> Property on pojo: Personal Boolean date difference = false; But my dateInterval property is always empty! I have working on my form like this: & lt; form: radiobeton path = "some property" value = "true" /> Lt; Spring: Message code = "label.roundYes" /> gt; & lt; form: radiobout path = "some property" value = "wrong" /> Lt; Spring: Message code = "label.roundNo" /> And some properties in my model look like this: Private Boolean SomeProperty = false; It works fine I have not tried to do it with 'boolean', maybe just try it with boolean...

awt - Why simulating Control_A with Robot in Java is not working? -

I use the following lines to simulate a control_a [select all] key action in Java with robots , But the clipboard is not getting text, why? robot robot = null; Try {robot = new robot (); } Hold (AWTException pre) {System.err.println ("Robots can not be started:" + East); } Robot.mouseMove (260,500); Robot.mousepress (InputEvent.BUTTON1_MASK); // robot.mouseMove (660,700); Robot.mouserelease (InputEvent.BUTTON1_MASK); Robot.keyPress (KeyEvent.VK_CONTROL); // Choose all robots. KeyPoids (KAVent.VK_A); Robot.keyRelease (KeyEvent.VK_A); Robot.keyRelease (KeyEvent.VK_CONTROL); Robot.keyPress (KeyEvent.VK_CONTROL); // copy robot KeyPoint (KeyEvent.VK_C); Robot.keyRelease (KeyEvent.VK_C); Robot.keyRelease (KeyEvent.VK_CONTROL); Transferable T = Toolkit.getDefaultToolkit () GetSystemClipboard () GetContents (faucet); {If (t! = Null & amp; amp; amp; amp; amp; amp; amp; t.isDataFlavorSupported (DataFlavor.stringFlavor)) {string text = (string) Try T.getringdata (DataFlavor.s...

winforms - Combobox with button instead of textbox -

Image
मैं बिना किसी textbox और कंबोबोक्स को बनाना चाहूंगा बटन में एक अनुकूलन आइकन जो कोम्बोबॉक्स खोलता है इस छवि की तरह कुछ ( चेकबॉक्स s के बारे में भूल जाएं) मुझे समाधान पोस्ट करने की ज़रूरत नहीं है, बस कुछ दिशा-निर्देश या संसाधन हैं ताकि मैं जान सकूं कि यह अनुकूलन कैसे शुरू किया जाए। TIA ContextMenuStrip जो आप मैन्युअल रूप से बटन के क्लिक हैंडलर में प्रदर्शित करते हैं।

c# 4.0 - Using bing to geocode -

I'm trying to figure out how to use Bing to get late / long I have all the tutorials which I Find out, they are for plotting points, but in reality they do not show how to get rid of coordinates. Anyone have experience with this. I think the new way of doing this is using their REST service here:. For example: or

php - preg_replace('/[^a-zZ-Z0-9]/', NULL, $action['class']) -

I found a line of code in the project that I am trying to modify / add extension. $ Controller = 'Controller' Preg_replace ('/ [^ a-zZ-Z0- 9] /', tap, $ verb ['square']); But I'm not sure this line is the dose which I think is the dose: Capitalizing the first letter, i.e. "order" in "order" I tried some tests, but this does not make any sense, because it starts to remove the capital letters in words. This will only remove the first alphanumeric character in the $ verb ['square'] . If you want to uppercase the letter first, then use it: $ action ['class'] = ucfirst ($ action ['class']) ;

ldap - IBM WebSphere Portal & multiple Active Directories with trusted relationship -

There are two active directory users with a trusted relation registry, where users of a directory are included in a group of other directories. I need to configure IBM WebSpace Portal 6.1 on WAS7, which he used to use those related directories. But when the federated repository is configured and I am trying to find users through the group, then only those users are in the same directory as the group. It works as if it is an independent registry without a trustworthy relationship. Is it possible to configure the portal server that the user understands the reliability of the registry? The solution was the default LDAP port 389 (636) and the Global LDAP search port instead of the standalone repository 3268 (3269) ) use of.

How do I configure Diagnostics when many websites are on the same Azure WebRole? -

I am playing a blue web role with many websites. How do I configure the diagnostics for this server I can log on and not only on the primary website, all websites in incidents / deployment / role The diagnostic Web sites roll name, role instance name and (where appropriate) IIS service ID Log in using - so the standard blue diagnostics should work to do without any other work.

javascript - how to reset elements affected by a jquery function -

I have a jQuery function, when a box is clicked that affects many other elements on the page ( Creates a slideshow Divs group) There are several boxes on the page and whenever the box is clicked again, again the normal function needs to be reset to the affected elements by the function. Is there an easy way to reset the elements affected by jQuery, or the original In order to run the opposite function vs. the function, to write another function, which tells about the first function? An easy way to do what you describe is JQuery Use CSS classes to encapsulate all the changes that apply. Your first function uses addClass to implement changes and then you can use removeClass to return the changes.

c# - Inserting using FormView -

I am trying to insert an item using a basic formio control. I'm new to C # and control it, so bear with me FormView standard entries such as: item name item value item code There are controls that will be hidden from the user such as: I Protected Zero InsertButton_Click (Object Sender, EventArgs e) {LinkButton btnInsert = (LinkButton) FormView1.FindControl ("InsertButton"); Text box txtDateAdded = (Textbox) FormView1.FindControl ("ItemDateAddedTextBox"); Text box txtDateChanged = (text box) FormView1.FindControl ("ItemDateChangedTextBox"); Text box txtChangedBy = (Textbox) FormView1.FindControl ("ItemChangedByTextBox"); TxtDateAdded.Text = DateTime.Now.ToString ("MMMM DD, yyyy"); TxtDateChanged.Text = DateTime.Now.ToString ("MMMM dd, yyyy"); . TxtChangedBy.Text = HttpContext.Current.Request.ServerVariables ["AUTH_USER"] ToString (); TblItems.Insert (); } This indicates that the ItemName fiel...